From c721f45892697517f7be680943cb772991528f7b Mon Sep 17 00:00:00 2001 From: David McKay Date: Sat, 21 Nov 2026 15:37:13 -0800 Subject: [PATCH 01/16] API: moving to OpenBot Cloud (export, import, verify) Exports on an OpenBot on the person's own computer: what an export would hold and free, a bundle in parts with sizes and SHA-256, resumable downloads with Range. Imports on OpenBot Cloud only: a per-import public key a model key is sealed to, resumable part uploads, apply in the background, and a verification that counts what arrived by kind. Connections to apps travel as app and account names only, listed for reconnecting. --- api/README.md | 1 + api/openapi.yaml | 1233 ++++++++++ api/openapi/common.yaml | 14 + api/openapi/moves.yaml | 1264 ++++++++++ app/src/lib/api/generated/index.ts | 1 + app/src/lib/api/generated/index.zod.ts | 1 + .../api/generated/model/applyImportHeaders.ts | 13 + app/src/lib/api/generated/model/bundlePart.ts | 12 + .../generated/model/createExportHeaders.ts | 13 + .../generated/model/createImportHeaders.ts | 13 + .../generated/model/deleteExportHeaders.ts | 13 + .../model/downloadExportPartHeaders.ts | 12 + app/src/lib/api/generated/model/export.ts | 44 + .../lib/api/generated/model/exportEstimate.ts | 22 + .../lib/api/generated/model/exportInput.ts | 10 + .../generated/model/exportNotFoundResponse.ts | 9 + .../generated/model/exportNotReadyResponse.ts | 9 + app/src/lib/api/generated/model/import.ts | 42 + .../model/importBundleRefusedResponse.ts | 9 + .../generated/model/importConflictResponse.ts | 9 + .../lib/api/generated/model/importInput.ts | 12 + .../generated/model/importNotFoundResponse.ts | 9 + app/src/lib/api/generated/model/importPage.ts | 10 + .../api/generated/model/importVerification.ts | 16 + .../generated/model/importVerificationKind.ts | 23 + app/src/lib/api/generated/model/index.ts | 29 + .../api/generated/model/listImportsParams.ts | 21 + app/src/lib/api/generated/model/moveCount.ts | 10 + app/src/lib/api/generated/model/moveKind.ts | 8 + app/src/lib/api/generated/model/moveNote.ts | 22 + .../api/generated/model/moveRecipientKey.ts | 26 + .../model/moveUnavailableResponse.ts | 9 + .../model/rangeNotSatisfiableResponse.ts | 9 + .../lib/api/generated/model/reconnectApp.ts | 28 + .../generated/model/tooManyMovesResponse.ts | 9 + .../model/uploadImportPartHeaders.ts | 13 + .../moving-to-openbot-cloud.msw.ts | 821 +++++++ .../moving-to-openbot-cloud.ts | 2104 +++++++++++++++++ .../moving-to-openbot-cloud.zod.ts | 1601 +++++++++++++ 39 files changed, 7524 insertions(+) create mode 100644 api/openapi/moves.yaml create mode 100644 app/src/lib/api/generated/model/applyImportHeaders.ts create mode 100644 app/src/lib/api/generated/model/bundlePart.ts create mode 100644 app/src/lib/api/generated/model/createExportHeaders.ts create mode 100644 app/src/lib/api/generated/model/createImportHeaders.ts create mode 100644 app/src/lib/api/generated/model/deleteExportHeaders.ts create mode 100644 app/src/lib/api/generated/model/downloadExportPartHeaders.ts create mode 100644 app/src/lib/api/generated/model/export.ts create mode 100644 app/src/lib/api/generated/model/exportEstimate.ts create mode 100644 app/src/lib/api/generated/model/exportInput.ts create mode 100644 app/src/lib/api/generated/model/exportNotFoundResponse.ts create mode 100644 app/src/lib/api/generated/model/exportNotReadyResponse.ts create mode 100644 app/src/lib/api/generated/model/import.ts create mode 100644 app/src/lib/api/generated/model/importBundleRefusedResponse.ts create mode 100644 app/src/lib/api/generated/model/importConflictResponse.ts create mode 100644 app/src/lib/api/generated/model/importInput.ts create mode 100644 app/src/lib/api/generated/model/importNotFoundResponse.ts create mode 100644 app/src/lib/api/generated/model/importPage.ts create mode 100644 app/src/lib/api/generated/model/importVerification.ts create mode 100644 app/src/lib/api/generated/model/importVerificationKind.ts create mode 100644 app/src/lib/api/generated/model/listImportsParams.ts create mode 100644 app/src/lib/api/generated/model/moveCount.ts create mode 100644 app/src/lib/api/generated/model/moveKind.ts create mode 100644 app/src/lib/api/generated/model/moveNote.ts create mode 100644 app/src/lib/api/generated/model/moveRecipientKey.ts create mode 100644 app/src/lib/api/generated/model/moveUnavailableResponse.ts create mode 100644 app/src/lib/api/generated/model/rangeNotSatisfiableResponse.ts create mode 100644 app/src/lib/api/generated/model/reconnectApp.ts create mode 100644 app/src/lib/api/generated/model/tooManyMovesResponse.ts create mode 100644 app/src/lib/api/generated/model/uploadImportPartHeaders.ts create mode 100644 app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.msw.ts create mode 100644 app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.ts create mode 100644 app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.zod.ts diff --git a/api/README.md b/api/README.md index 9f62f37a4a..3756b11612 100644 --- a/api/README.md +++ b/api/README.md @@ -34,6 +34,7 @@ not touch the same lines: | `memory.yaml` | A person's memories and memory sources | | `agents.yaml` | The agents Bots hand work to (`bot-agents`), their callback tokens, and each Bot's delegation | | `management.yaml` | Connecting a self-hosted OpenBot to CopilotKit's management service: where it stands, starting and stopping it | +| `moves.yaml` | Moving to OpenBot Cloud: exporting what a person has in an OpenBot on their own computer, importing it into a Cloud organization, and checking it all arrived | An area file holds its operations under `paths`, and under `components` the schemas, parameters, responses and examples only it uses. Inside the file, refer to them as usual diff --git a/api/openapi.yaml b/api/openapi.yaml index 826aaa3d69..460b4b385b 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -123,6 +123,8 @@ tags: description: 'The agents an organization''s Bots hand work to: OpenBot''s own, a framework OpenBot runs, or an agent somebody runs at its own address. An administrator adds the organization''s, and anybody may add a private one for their own Bots. A Bot''s delegation says whether it works on one agent or hands work to several, and which.' - name: CopilotKit management description: Connecting a self-hosted OpenBot to CopilotKit's management service, which keeps it up to date in the company's own cluster through an agent installed there. Only the administrators of the organization `default` manage it, and only on the team edition a company runs itself. + - name: Moving to OpenBot Cloud + description: 'Moving what a person has in an OpenBot on their own computer to an organization on OpenBot Cloud: exporting it there as a bundle, importing the bundle on Cloud, and checking that everything arrived before anything is removed. Connections to apps never carry their sign-in, and a model key moves only when the person chooses, sealed to the import.' paths: /api/v2/organizations/{organizationId}/reactions: parameters: @@ -20867,6 +20869,487 @@ paths: $ref: '#/components/responses/ManagementServiceFailed' default: $ref: '#/components/responses/UnexpectedError' + /api/v2/organizations/{organizationId}/export-estimate: + parameters: + - $ref: '#/components/parameters/OrganizationId' + get: + tags: + - Moving to OpenBot Cloud + operationId: getExportEstimate + summary: Read what moving to OpenBot Cloud would take + description: 'Count what an export would hold, without making one: the caller''s Bots, their skills, conversations and messages, memories, routines, goals and check-ins, files and settings, and, when the caller is an administrator, the organization''s own skills. Also says roughly how big the bundle will be, how much space this OpenBot holds for it on disk (what the move frees once the local OpenBot is removed), which apps the person will need to connect again on OpenBot Cloud, and whether a model key could come along. Served only by an OpenBot that runs on the person''s own computer; elsewhere it answers 404 with the code MOVE_UNAVAILABLE.' + x-openbot-singleton: true + security: + - webSession: [] + - appOAuth: + - exports:read + - apiKey: [] + responses: + '200': + description: What an export would hold. + headers: + Cache-Control: + $ref: '#/components/headers/PrivateNoStore' + content: + application/json: + schema: + $ref: '#/components/schemas/ExportEstimate' + examples: + example: + $ref: '#/components/examples/ExportEstimateExample' + '401': + $ref: '#/components/responses/Unauthenticated' + '404': + $ref: '#/components/responses/MoveUnavailable' + '500': + $ref: '#/components/responses/ServerError' + default: + $ref: '#/components/responses/UnexpectedError' + /api/v2/organizations/{organizationId}/exports: + parameters: + - $ref: '#/components/parameters/OrganizationId' + post: + tags: + - Moving to OpenBot Cloud + operationId: createExport + summary: Start exporting what the caller has here + description: |- + Start writing a bundle of everything the caller has in this organization, to move it to OpenBot Cloud: their Bots (settings, instructions and skills), conversations with every message, memories, routines, goals and check-ins, files, standing instructions and preferences, and, when the caller is an administrator, the organization's own skills. Connections to apps travel as their app and account name only: no token or password ever leaves, and each one is listed in reconnect so the person connects it again on Cloud. A model key travels only when includeModelKeys is true, and then only sealed to recipientKey, the key the import on Cloud gave (createImport), so the bundle never holds it readable. + + The bundle is written in the background; read getExport until status is ready. It is cut into parts of at most 32 MiB, each with its size and SHA-256, so a dropped download resumes where it stopped. One export is kept for each person: starting another removes the one before. An export is removed 7 days after it was made, or with deleteExport. Served only by an OpenBot that runs on the person's own computer; elsewhere it answers 404 with the code MOVE_UNAVAILABLE. + security: + - webSession: [] + - appOAuth: + - exports:write + - apiKey: [] + parameters: + - $ref: '#/components/parameters/IdempotencyKey' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ExportInput' + examples: + withModelKeys: + $ref: '#/components/examples/ExportInputExample' + responses: + '202': + description: The export has started. + headers: + Cache-Control: + $ref: '#/components/headers/PrivateNoStore' + content: + application/json: + schema: + $ref: '#/components/schemas/Export' + examples: + preparing: + $ref: '#/components/examples/ExportPreparingExample' + '400': + $ref: '#/components/responses/InvalidRequest' + '401': + $ref: '#/components/responses/Unauthenticated' + '404': + $ref: '#/components/responses/MoveUnavailable' + '409': + $ref: '#/components/responses/IdempotencyConflict' + '429': + $ref: '#/components/responses/TooManyMoves' + '500': + $ref: '#/components/responses/ServerError' + default: + $ref: '#/components/responses/UnexpectedError' + /api/v2/organizations/{organizationId}/exports/{exportId}: + parameters: + - $ref: '#/components/parameters/OrganizationId' + - $ref: '#/components/parameters/ExportId' + get: + tags: + - Moving to OpenBot Cloud + operationId: getExport + summary: Read an export + description: Return where the caller's export stands. Once ready it lists the bundle's parts with their sizes and SHA-256, its total size, and the count of everything in it by kind, which are the counts getImportVerification is compared with. Only the person who made it reads it; anybody else is answered 404. + security: + - webSession: [] + - appOAuth: + - exports:read + - apiKey: [] + responses: + '200': + description: The export. + headers: + Cache-Control: + $ref: '#/components/headers/PrivateNoStore' + content: + application/json: + schema: + $ref: '#/components/schemas/Export' + examples: + preparing: + $ref: '#/components/examples/ExportPreparingExample' + ready: + $ref: '#/components/examples/ExportReadyExample' + '401': + $ref: '#/components/responses/Unauthenticated' + '404': + $ref: '#/components/responses/ExportNotFound' + '500': + $ref: '#/components/responses/ServerError' + default: + $ref: '#/components/responses/UnexpectedError' + delete: + tags: + - Moving to OpenBot Cloud + operationId: deleteExport + summary: Remove an export + description: Remove the caller's export and its bundle from disk. Nothing it was made from changes. One already gone answers 204 too. + security: + - webSession: [] + - appOAuth: + - exports:write + - apiKey: [] + parameters: + - $ref: '#/components/parameters/IdempotencyKey' + responses: + '204': + description: The export is gone. + '401': + $ref: '#/components/responses/Unauthenticated' + '404': + $ref: '#/components/responses/MoveUnavailable' + '409': + $ref: '#/components/responses/IdempotencyConflict' + '500': + $ref: '#/components/responses/ServerError' + default: + $ref: '#/components/responses/UnexpectedError' + /api/v2/organizations/{organizationId}/exports/{exportId}/parts/{partNumber}: + parameters: + - $ref: '#/components/parameters/OrganizationId' + - $ref: '#/components/parameters/ExportId' + - $ref: '#/components/parameters/PartNumber' + get: + tags: + - Moving to OpenBot Cloud + operationId: downloadExportPart + summary: Download one part of an export's bundle + description: Return one part of a ready export's bundle, as bytes to hand to uploadImportPart unchanged. A Range header of one byte range (bytes=N- or bytes=N-M) answers 206 with that range, so a dropped download resumes where it stopped. The SHA-256 of the whole part is in the export's parts and in the ETag. Only the person who made the export downloads it. + x-openbot-singleton: true + security: + - webSession: [] + - appOAuth: + - exports:read + - apiKey: [] + parameters: + - name: Range + in: header + required: false + description: One byte range of the part, as RFC 9110 writes it. + schema: + type: string + pattern: ^bytes=[0-9]+-[0-9]*$ + maxLength: 64 + responses: + '200': + description: The whole part. + headers: + Cache-Control: + $ref: '#/components/headers/PrivateNoStore' + ETag: + $ref: '#/components/headers/PartETag' + Accept-Ranges: + $ref: '#/components/headers/AcceptRanges' + content: + application/octet-stream: + schema: + type: string + format: binary + '206': + description: The range asked for. + headers: + Cache-Control: + $ref: '#/components/headers/PrivateNoStore' + ETag: + $ref: '#/components/headers/PartETag' + Content-Range: + description: Which bytes of the part this is, and the part's size. + schema: + type: string + example: bytes 1048576-33554431/33554432 + content: + application/octet-stream: + schema: + type: string + format: binary + '401': + $ref: '#/components/responses/Unauthenticated' + '404': + $ref: '#/components/responses/ExportNotFound' + '409': + $ref: '#/components/responses/ExportNotReady' + '416': + $ref: '#/components/responses/RangeNotSatisfiable' + '500': + $ref: '#/components/responses/ServerError' + default: + $ref: '#/components/responses/UnexpectedError' + /api/v2/organizations/{organizationId}/imports: + parameters: + - $ref: '#/components/parameters/OrganizationId' + post: + tags: + - Moving to OpenBot Cloud + operationId: createImport + summary: Start importing a bundle into this organization + description: |- + Start an import of what the caller is moving from an OpenBot on their own computer into this organization, the caller's own organization by default. Everything imported belongs to the caller, in this organization only. The answer carries recipientKey, a public key made for this import alone: pass it to createExport, and a model key in the bundle is sealed to it, readable only by this import. The answer also says how big a bundle and a part may be. Then upload the export's parts with uploadImportPart and apply them with applyImport. + + Importing is safe to repeat: an import of the same OpenBot into the same organization (an export made again, or a new import after a dropped one) adds only what isn't here yet and duplicates nothing. Served only by OpenBot Cloud; elsewhere it answers 404 with the code MOVE_UNAVAILABLE. A person starts at most 10 imports a day. + security: + - webSession: [] + - appOAuth: + - imports:write + - apiKey: [] + parameters: + - $ref: '#/components/parameters/IdempotencyKey' + requestBody: + required: false + content: + application/json: + schema: + $ref: '#/components/schemas/ImportInput' + responses: + '201': + description: The import, waiting for its bundle. + headers: + Cache-Control: + $ref: '#/components/headers/PrivateNoStore' + content: + application/json: + schema: + $ref: '#/components/schemas/Import' + examples: + waiting: + $ref: '#/components/examples/ImportWaitingExample' + '400': + $ref: '#/components/responses/InvalidRequest' + '401': + $ref: '#/components/responses/Unauthenticated' + '404': + $ref: '#/components/responses/MoveUnavailable' + '409': + $ref: '#/components/responses/IdempotencyConflict' + '429': + $ref: '#/components/responses/TooManyMoves' + '500': + $ref: '#/components/responses/ServerError' + default: + $ref: '#/components/responses/UnexpectedError' + get: + tags: + - Moving to OpenBot Cloud + operationId: listImports + summary: List the caller's imports into this organization + description: List the imports the caller started in this organization, newest first, so an app that lost track of one after a drop finds it again. Only the caller's own. Served only by OpenBot Cloud. + security: + - webSession: [] + - appOAuth: + - imports:read + - apiKey: [] + parameters: + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/Cursor' + responses: + '200': + description: A page of imports. + headers: + Cache-Control: + $ref: '#/components/headers/PrivateNoStore' + content: + application/json: + schema: + $ref: '#/components/schemas/ImportPage' + '400': + $ref: '#/components/responses/InvalidRequest' + '401': + $ref: '#/components/responses/Unauthenticated' + '404': + $ref: '#/components/responses/MoveUnavailable' + '500': + $ref: '#/components/responses/ServerError' + default: + $ref: '#/components/responses/UnexpectedError' + /api/v2/organizations/{organizationId}/imports/{importId}: + parameters: + - $ref: '#/components/parameters/OrganizationId' + - $ref: '#/components/parameters/ImportId' + get: + tags: + - Moving to OpenBot Cloud + operationId: getImport + summary: Read an import + description: 'Return where the caller''s import stands: which parts have arrived, how far applying them has got by kind, and once imported, the summary: what was imported, what was imported differently or left out on OpenBot Cloud and why (notes), and which apps to connect again (reconnect). Only the person who started it reads it.' + security: + - webSession: [] + - appOAuth: + - imports:read + - apiKey: [] + responses: + '200': + description: The import. + headers: + Cache-Control: + $ref: '#/components/headers/PrivateNoStore' + content: + application/json: + schema: + $ref: '#/components/schemas/Import' + examples: + waiting: + $ref: '#/components/examples/ImportWaitingExample' + imported: + $ref: '#/components/examples/ImportImportedExample' + '401': + $ref: '#/components/responses/Unauthenticated' + '404': + $ref: '#/components/responses/ImportNotFound' + '500': + $ref: '#/components/responses/ServerError' + default: + $ref: '#/components/responses/UnexpectedError' + /api/v2/organizations/{organizationId}/imports/{importId}/parts/{partNumber}: + parameters: + - $ref: '#/components/parameters/OrganizationId' + - $ref: '#/components/parameters/ImportId' + - $ref: '#/components/parameters/PartNumber' + put: + tags: + - Moving to OpenBot Cloud + operationId: uploadImportPart + summary: Upload one part of the bundle + description: Upload one part of the export's bundle, exactly as downloadExportPart gave it. Part 1 carries the bundle's manifest, so it is uploaded first; after it the parts go in any order, and the import's expectedParts says how many there are and the SHA-256 of each. A part whose bytes don't match the manifest is refused (IMPORT_PART_MISMATCH) and can be uploaded again. Uploading a part that already arrived changes nothing and answers 200 again, so after a drop an app sends whatever receivedParts doesn't list. A part is at most 32 MiB, and a bundle at most maxBundleBytes. At most 120 parts a minute for each person. + security: + - webSession: [] + - appOAuth: + - imports:write + - apiKey: [] + parameters: + - $ref: '#/components/parameters/IdempotencyKey' + requestBody: + required: true + content: + application/octet-stream: + schema: + type: string + format: binary + responses: + '200': + description: The part arrived (or had already arrived). + headers: + Cache-Control: + $ref: '#/components/headers/PrivateNoStore' + content: + application/json: + schema: + $ref: '#/components/schemas/Import' + '400': + $ref: '#/components/responses/InvalidRequest' + '401': + $ref: '#/components/responses/Unauthenticated' + '404': + $ref: '#/components/responses/ImportNotFound' + '409': + $ref: '#/components/responses/ImportConflict' + '413': + $ref: '#/components/responses/PayloadTooLarge' + '422': + $ref: '#/components/responses/ImportBundleRefused' + '429': + $ref: '#/components/responses/TooManyMoves' + '500': + $ref: '#/components/responses/ServerError' + default: + $ref: '#/components/responses/UnexpectedError' + /api/v2/organizations/{organizationId}/imports/{importId}/apply: + parameters: + - $ref: '#/components/parameters/OrganizationId' + - $ref: '#/components/parameters/ImportId' + post: + tags: + - Moving to OpenBot Cloud + operationId: applyImport + summary: Import the uploaded bundle + description: |- + Once every part has arrived, import the bundle into this organization in the background: every id is given a new one here, everything is owned by the caller, and nothing reaches another organization. Read getImport until status is imported or failed. Applying again while it runs, or after it finished, changes nothing and answers where it stands; applying a failed import tries again from where it stopped, and nothing already imported is imported twice. A missing part answers 409 with IMPORT_INCOMPLETE. + + What OpenBot Cloud doesn't have comes in differently, and the summary says so in notes: a Bot that ran on its own isolated computer comes in as an ordinary Bot; a feature that needs the Business plan, in an organization that isn't on it, is left out. A model key in the bundle becomes the caller's own AI connection, unless they have one here already, which is kept. + security: + - webSession: [] + - appOAuth: + - imports:write + - apiKey: [] + parameters: + - $ref: '#/components/parameters/IdempotencyKey' + responses: + '202': + description: Importing, or where the import stands. + headers: + Cache-Control: + $ref: '#/components/headers/PrivateNoStore' + content: + application/json: + schema: + $ref: '#/components/schemas/Import' + '401': + $ref: '#/components/responses/Unauthenticated' + '404': + $ref: '#/components/responses/ImportNotFound' + '409': + $ref: '#/components/responses/ImportConflict' + '500': + $ref: '#/components/responses/ServerError' + default: + $ref: '#/components/responses/UnexpectedError' + /api/v2/organizations/{organizationId}/imports/{importId}/verification: + parameters: + - $ref: '#/components/parameters/OrganizationId' + - $ref: '#/components/parameters/ImportId' + get: + tags: + - Moving to OpenBot Cloud + operationId: getImportVerification + summary: Check that everything arrived + description: Count, by kind, what from this import's OpenBot is in this organization now, read from what is stored here rather than from the import's own tally, beside what the bundle held. matches is true only when every kind is all here, apart from what the notes say OpenBot Cloud left out on purpose. OpenBot Desktop removes nothing on the person's computer until it does. Also lists the apps to connect again. + x-openbot-singleton: true + security: + - webSession: [] + - appOAuth: + - imports:read + - apiKey: [] + responses: + '200': + description: The counts. + headers: + Cache-Control: + $ref: '#/components/headers/PrivateNoStore' + content: + application/json: + schema: + $ref: '#/components/schemas/ImportVerification' + examples: + matches: + $ref: '#/components/examples/ImportVerificationExample' + '401': + $ref: '#/components/responses/Unauthenticated' + '404': + $ref: '#/components/responses/ImportNotFound' + '409': + $ref: '#/components/responses/ImportConflict' + '500': + $ref: '#/components/responses/ServerError' + default: + $ref: '#/components/responses/UnexpectedError' components: securitySchemes: webSession: @@ -20983,6 +21466,10 @@ components: memories:write: Write, change and forget the signed-in person's memories, and add, change, sync and remove their memory sources. bot-agents:read: Read the agents the signed-in person's Bots may hand work to, and for an administrator every agent in the organization. bot-agents:write: Add, change and delete the signed-in person's own agents and their callback tokens, and for an administrator the organization's. + exports:read: Read and download the signed-in person's exports for moving to OpenBot Cloud, and what one would hold. + exports:write: Start and remove the signed-in person's exports for moving to OpenBot Cloud. + imports:read: Read the signed-in person's imports into OpenBot Cloud and check what arrived. + imports:write: Start an import into OpenBot Cloud as the signed-in person, upload its bundle and import it. apiKey: type: http scheme: bearer @@ -21727,12 +22214,54 @@ components: maxLength: 200 pattern: \S example: bag_4f7c1e2a9d0b4c63 + ExportId: + name: exportId + in: path + required: true + description: The export's id. + schema: + type: string + minLength: 1 + maxLength: 64 + pattern: ^[A-Za-z0-9_-]+$ + example: exp_7d1f2c3b8a4e4b5f + PartNumber: + name: partNumber + in: path + required: true + description: Which part of the bundle, counted from 1. + schema: + type: integer + minimum: 1 + maximum: 10000 + example: 1 + ImportId: + name: importId + in: path + required: true + description: The import's id. + schema: + type: string + minLength: 1 + maxLength: 64 + pattern: ^[A-Za-z0-9_-]+$ + example: imp_0e1f2a3b4c5d6f1d headers: PrivateNoStore: description: A Bot is private to the caller. schema: type: string const: private, no-store + PartETag: + description: The part's SHA-256 in hex, quoted. + schema: + type: string + example: '"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"' + AcceptRanges: + description: A part can be downloaded a byte range at a time. + schema: + type: string + const: bytes schemas: BotVisibility: type: string @@ -37840,6 +38369,379 @@ components: - invalid-licence - unreachable description: 'Which refusal lastError is, where a client acts on it. not-entitled: this OpenBot''s licence doesn''t include managed updates (it isn''t a team licence, or managed updates were turned off for its organization), so connecting again fails the same way until they are added to it. invalid-licence: the licence wasn''t accepted (invalid or expired). unreachable: the managed updates service couldn''t be reached when OpenBot last tried to connect by itself; it tries again within the hour. A later OpenBot may add a code; read one you don''t know as no code.' + MoveKind: + type: string + x-extensible-enum: + - bots + - skills + - conversations + - messages + - memories + - routines + - goals + - check-ins + - files + - settings + - model-keys + description: 'A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot''s and the person''s (and the organization''s, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person''s Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot''s computer. settings: the person''s standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don''t know like any other.' + MoveCount: + type: object + required: + - kind + - count + properties: + kind: + $ref: '#/components/schemas/MoveKind' + count: + type: integer + minimum: 0 + ReconnectApp: + type: object + description: 'A connection to an app that doesn''t move, because its sign-in stays on the person''s computer: the person connects it again on OpenBot Cloud. Never carries a token, a password or a key.' + required: + - appId + - appName + properties: + appId: + type: string + minLength: 1 + description: The app's id in the app directory, such as gmail or slack. + appName: + type: string + minLength: 1 + description: The app's name as a person reads it. + accountLabel: + type: string + minLength: 1 + description: Which account it was connected as, such as an email address or a workspace name, when known. + iconUrl: + type: string + format: uri + description: The app's icon, when the directory has one. + botNames: + type: array + description: The Bots that used it, so the person knows which to check. + items: + type: string + ExportEstimate: + type: object + required: + - counts + - estimatedBytes + - storedBytes + - reconnect + - modelKeysAvailable + properties: + counts: + type: array + items: + $ref: '#/components/schemas/MoveCount' + estimatedBytes: + type: integer + minimum: 0 + description: Roughly how big the bundle will be, in bytes. + storedBytes: + type: integer + minimum: 0 + description: How much this OpenBot keeps on disk for the person (its database and files), which removing it frees. OpenBot Desktop adds what the engine itself takes. + reconnect: + type: array + items: + $ref: '#/components/schemas/ReconnectApp' + modelKeysAvailable: + type: boolean + description: True when there is a model key the person could choose to bring. + MoveRecipientKey: + type: object + description: 'A public key as a JSON Web Key (RFC 7517): RSA, 4096 bits, for RSA-OAEP-256. A model key is sealed to it as a JWE (RFC 7516, RSA-OAEP-256 with A256GCM), so only the import that made it reads it.' + additionalProperties: false + required: + - kty + - 'n' + - e + - alg + - kid + properties: + kty: + type: string + const: RSA + 'n': + type: string + minLength: 1 + maxLength: 1024 + e: + type: string + minLength: 1 + maxLength: 16 + alg: + type: string + const: RSA-OAEP-256 + kid: + type: string + minLength: 1 + maxLength: 128 + ExportInput: + type: object + additionalProperties: false + properties: + includeModelKeys: + type: boolean + default: false + description: Bring the person's model key, sealed to recipientKey. Without recipientKey this is refused. + recipientKey: + $ref: '#/components/schemas/MoveRecipientKey' + BundlePart: + type: object + required: + - number + - bytes + - sha256 + properties: + number: + type: integer + minimum: 1 + bytes: + type: integer + minimum: 1 + sha256: + type: string + pattern: ^[0-9a-f]{64}$ + Export: + type: object + required: + - id + - status + - createdAt + - expiresAt + - includesModelKeys + properties: + id: + type: string + minLength: 1 + status: + type: string + x-extensible-enum: + - preparing + - ready + - failed + description: 'preparing: the bundle is being written. ready: every part can be downloaded. failed: it stopped; error says why, and starting another export tries again. A later OpenBot may add a status; read one you don''t know as preparing.' + formatVersion: + type: integer + minimum: 1 + description: The bundle's format, once ready. This OpenBot writes 1. + createdAt: + type: string + format: date-time + expiresAt: + type: string + format: date-time + description: When the bundle is removed. + totalBytes: + type: integer + minimum: 0 + description: The bundle's size, once ready. + parts: + type: array + description: The bundle's parts in order, once ready. + items: + $ref: '#/components/schemas/BundlePart' + counts: + type: array + description: Everything in the bundle by kind, once ready. + items: + $ref: '#/components/schemas/MoveCount' + reconnect: + type: array + description: The apps to connect again on OpenBot Cloud. + items: + $ref: '#/components/schemas/ReconnectApp' + includesModelKeys: + type: boolean + progress: + type: number + minimum: 0 + maximum: 1 + description: How far writing the bundle has got, while preparing. + error: + type: string + minLength: 1 + description: What went wrong, when failed, in a sentence a person reads. + MoveNote: + type: object + description: Something that moved differently, or not at all, and why, in a sentence a person reads. + required: + - code + - message + properties: + code: + type: string + x-extensible-enum: + - isolated-bot-made-ordinary + - business-plan-feature-left-out + - model-key-kept-existing + - model-key-not-brought + - item-skipped + description: 'isolated-bot-made-ordinary: OpenBot Cloud has no isolated computers, so a Bot that had one runs on an ordinary one. business-plan-feature-left-out: the feature needs the Business plan and this organization isn''t on it. model-key-kept-existing: the person already had an AI connection here, which was kept. model-key-not-brought: the person chose not to bring a model key. item-skipped: one item couldn''t be imported; message says which and why. A later OpenBot may add a code; show the message.' + kind: + $ref: '#/components/schemas/MoveKind' + count: + type: integer + minimum: 1 + description: How many items the note is about. + message: + type: string + minLength: 1 + items: + type: array + description: The names of the items, such as the Bots, when there are a few. + items: + type: string + Import: + type: object + required: + - id + - status + - createdAt + - recipientKey + - maxBundleBytes + - maxPartBytes + - receivedParts + properties: + id: + type: string + minLength: 1 + status: + type: string + x-extensible-enum: + - waiting-for-bundle + - receiving + - ready + - importing + - imported + - failed + description: 'waiting-for-bundle: no part has arrived. receiving: part 1 has arrived and others are still to come. ready: every part arrived; apply it. importing: being imported. imported: done; read the summary, then verify. failed: it stopped; error says why, and applying again goes on from there. A later OpenBot may add a status; read one you don''t know as importing.' + sourceName: + type: string + createdAt: + type: string + format: date-time + finishedAt: + type: string + format: date-time + recipientKey: + $ref: '#/components/schemas/MoveRecipientKey' + maxBundleBytes: + type: integer + minimum: 1 + maxPartBytes: + type: integer + minimum: 1 + expectedParts: + type: array + description: The bundle's parts, from its manifest, once part 1 arrived. + items: + $ref: '#/components/schemas/BundlePart' + receivedParts: + type: array + description: The numbers of the parts that arrived. + items: + type: integer + minimum: 1 + expected: + type: array + description: Everything the bundle holds by kind, from its manifest, once part 1 arrived. + items: + $ref: '#/components/schemas/MoveCount' + imported: + type: array + description: What has been imported so far by kind, while importing and once imported. Items a repeated import found already here count as imported. + items: + $ref: '#/components/schemas/MoveCount' + notes: + type: array + items: + $ref: '#/components/schemas/MoveNote' + reconnect: + type: array + description: The apps to connect again here, once part 1 arrived. + items: + $ref: '#/components/schemas/ReconnectApp' + error: + type: string + minLength: 1 + description: What went wrong, when failed, in a sentence a person reads. + ImportPage: + type: object + required: + - items + - nextCursor + properties: + items: + type: array + items: + $ref: '#/components/schemas/Import' + nextCursor: + type: + - string + - 'null' + ImportInput: + type: object + additionalProperties: false + properties: + sourceName: + type: string + minLength: 1 + maxLength: 200 + description: A name for where the bundle comes from, such as the computer's name, shown in the list of imports. + ImportVerificationKind: + type: object + required: + - kind + - expected + - found + - leftOut + properties: + kind: + $ref: '#/components/schemas/MoveKind' + expected: + type: integer + minimum: 0 + description: How many the bundle held. + found: + type: integer + minimum: 0 + description: How many from this OpenBot are in this organization now. + leftOut: + type: integer + minimum: 0 + description: How many OpenBot Cloud left out on purpose, as the notes say. + ImportVerification: + type: object + required: + - importId + - matches + - kinds + - notes + - reconnect + properties: + importId: + type: string + minLength: 1 + matches: + type: boolean + description: True when, for every kind, found plus leftOut is expected. + kinds: + type: array + items: + $ref: '#/components/schemas/ImportVerificationKind' + notes: + type: array + items: + $ref: '#/components/schemas/MoveNote' + reconnect: + type: array + items: + $ref: '#/components/schemas/ReconnectApp' responses: InvalidRequest: description: A parameter is malformed. @@ -43574,6 +44476,167 @@ components: retryable: true requestId: req_example traceId: trace_example + MoveUnavailable: + description: 'Moving isn''t served here: exports only by an OpenBot on the person''s own computer, imports only by OpenBot Cloud.' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + examples: + unavailable: + value: + type: https://open.bot/errors/move-unavailable + title: Moving isn't available here. + status: 404 + detail: Importing is available only on OpenBot Cloud. + code: MOVE_UNAVAILABLE + category: not_found + retryable: false + requestId: req_example + traceId: trace_example + TooManyMoves: + description: Too many exports, imports or parts at once for one person. + headers: + Retry-After: + description: Seconds to wait. + schema: + type: integer + minimum: 1 + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + examples: + tooMany: + value: + type: https://open.bot/errors/too-many-requests + title: Too many requests. + status: 429 + detail: That's a lot of uploads at once. Wait a minute, then go on. + code: TOO_MANY_REQUESTS + category: rate_limit + retryable: true + requestId: req_example + traceId: trace_example + ExportNotFound: + description: The export doesn't exist, has been removed, or isn't the caller's. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + examples: + notFound: + value: + type: https://open.bot/errors/export-not-found + title: Export not found. + status: 404 + detail: That export isn't here any more. Start the move again. + code: EXPORT_NOT_FOUND + category: not_found + retryable: false + requestId: req_example + traceId: trace_example + ExportNotReady: + description: The export is still being written, or failed. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + examples: + preparing: + value: + type: https://open.bot/errors/export-not-ready + title: The export isn't ready. + status: 409 + detail: The export is still being prepared. Try again when it's ready. + code: EXPORT_NOT_READY + category: conflict + retryable: true + requestId: req_example + traceId: trace_example + RangeNotSatisfiable: + description: The Range asked for lies outside the part. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + examples: + outside: + value: + type: https://open.bot/errors/range-not-satisfiable + title: That range isn't in the part. + status: 416 + detail: The part is 33554432 bytes long. + code: RANGE_NOT_SATISFIABLE + category: validation + retryable: false + requestId: req_example + traceId: trace_example + ImportNotFound: + description: The import doesn't exist, or isn't the caller's. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + examples: + notFound: + value: + type: https://open.bot/errors/import-not-found + title: Import not found. + status: 404 + detail: That import isn't here. Start the move again. + code: IMPORT_NOT_FOUND + category: not_found + retryable: false + requestId: req_example + traceId: trace_example + ImportConflict: + description: 'The import can''t do that in its state: a part doesn''t match the manifest (IMPORT_PART_MISMATCH), part 1 hasn''t arrived (IMPORT_MANIFEST_MISSING), a part is missing (IMPORT_INCOMPLETE), the import hasn''t finished (IMPORT_NOT_FINISHED), or the Idempotency-Key was used for a different request.' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + examples: + incomplete: + value: + type: https://open.bot/errors/import-incomplete + title: Some parts haven't arrived. + status: 409 + detail: Parts 3 and 4 haven't arrived yet. Upload them, then import. + code: IMPORT_INCOMPLETE + category: conflict + retryable: false + requestId: req_example + traceId: trace_example + mismatch: + value: + type: https://open.bot/errors/import-part-mismatch + title: That part doesn't match the bundle. + status: 409 + detail: Part 2 arrived damaged. Download it again and upload it. + code: IMPORT_PART_MISMATCH + category: conflict + retryable: true + requestId: req_example + traceId: trace_example + ImportBundleRefused: + description: 'Part 1 isn''t a bundle this OpenBot reads: not a bundle at all, a format newer than it reads (IMPORT_FORMAT_UNSUPPORTED), larger than maxBundleBytes, or a model key sealed to another import''s key.' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + examples: + newer: + value: + type: https://open.bot/errors/import-format-unsupported + title: This bundle is newer than OpenBot Cloud reads. + status: 422 + detail: This bundle was made by a newer OpenBot. Try again once OpenBot Cloud is updated. + code: IMPORT_FORMAT_UNSUPPORTED + category: validation + retryable: false + requestId: req_example + traceId: trace_example examples: ReactionPageLast: summary: Every reaction in a conversation, on one page. @@ -47888,3 +48951,173 @@ components: value: state: opted-out agentInstalledByChart: true + ExportEstimateExample: + value: + counts: + - kind: bots + count: 4 + - kind: skills + count: 9 + - kind: conversations + count: 37 + - kind: messages + count: 2814 + - kind: memories + count: 52 + - kind: routines + count: 3 + - kind: goals + count: 1 + - kind: check-ins + count: 2 + - kind: files + count: 64 + - kind: settings + count: 1 + estimatedBytes: 187432960 + storedBytes: 1288490188 + reconnect: + - appId: gmail + appName: Gmail + accountLabel: sam@example.com + botNames: + - Inbox helper + - appId: slack + appName: Slack + accountLabel: Example workspace + botNames: + - Inbox helper + - Standup + modelKeysAvailable: true + ExportInputExample: + value: + includeModelKeys: true + recipientKey: + kty: RSA + alg: RSA-OAEP-256 + kid: imp_0e1f2a3b4c5d6f1d + e: AQAB + 'n': 0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw + ExportPreparingExample: + value: + id: exp_7d1f2c3b8a4e4b5f + status: preparing + createdAt: '2026-11-21T10:00:00Z' + expiresAt: '2026-11-28T10:00:00Z' + includesModelKeys: true + progress: 0.4 + ExportReadyExample: + value: + id: exp_7d1f2c3b8a4e4b5f + status: ready + formatVersion: 1 + createdAt: '2026-11-21T10:00:00Z' + expiresAt: '2026-11-28T10:00:00Z' + totalBytes: 41943040 + parts: + - number: 1 + bytes: 33554432 + sha256: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 + - number: 2 + bytes: 8388608 + sha256: 60303ae22b998861bce3b28f33eec1be758a213c86c93c076dbe9f558c11c752 + counts: + - kind: bots + count: 4 + - kind: conversations + count: 37 + - kind: messages + count: 2814 + - kind: model-keys + count: 1 + reconnect: + - appId: gmail + appName: Gmail + accountLabel: sam@example.com + includesModelKeys: true + ImportWaitingExample: + value: + id: imp_0e1f2a3b4c5d6f1d + status: waiting-for-bundle + sourceName: Sam's MacBook + createdAt: '2026-11-21T10:00:00Z' + recipientKey: + kty: RSA + alg: RSA-OAEP-256 + kid: imp_0e1f2a3b4c5d6f1d + e: AQAB + 'n': 0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw + maxBundleBytes: 10737418240 + maxPartBytes: 33554432 + receivedParts: [] + ImportImportedExample: + value: + id: imp_0e1f2a3b4c5d6f1d + status: imported + createdAt: '2026-11-21T10:00:00Z' + finishedAt: '2026-11-21T10:03:12Z' + recipientKey: + kty: RSA + alg: RSA-OAEP-256 + kid: imp_0e1f2a3b4c5d6f1d + e: AQAB + 'n': 0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw + maxBundleBytes: 10737418240 + maxPartBytes: 33554432 + expectedParts: + - number: 1 + bytes: 33554432 + sha256: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 + - number: 2 + bytes: 8388608 + sha256: 60303ae22b998861bce3b28f33eec1be758a213c86c93c076dbe9f558c11c752 + receivedParts: + - 1 + - 2 + expected: + - kind: bots + count: 4 + - kind: conversations + count: 37 + - kind: messages + count: 2814 + imported: + - kind: bots + count: 4 + - kind: conversations + count: 37 + - kind: messages + count: 2814 + notes: + - code: isolated-bot-made-ordinary + kind: bots + count: 1 + message: Research runs on an ordinary computer here, because OpenBot Cloud has no isolated computers. + items: + - Research + reconnect: + - appId: gmail + appName: Gmail + accountLabel: sam@example.com + ImportVerificationExample: + value: + importId: imp_0e1f2a3b4c5d6f1d + matches: true + kinds: + - kind: bots + expected: 4 + found: 4 + leftOut: 0 + - kind: conversations + expected: 37 + found: 37 + leftOut: 0 + - kind: messages + expected: 2814 + found: 2814 + leftOut: 0 + notes: [] + reconnect: + - appId: gmail + appName: Gmail + accountLabel: sam@example.com diff --git a/api/openapi/common.yaml b/api/openapi/common.yaml index a2aa6b5a9d..4109c8bb81 100644 --- a/api/openapi/common.yaml +++ b/api/openapi/common.yaml @@ -138,6 +138,7 @@ tags: - { name: Memory, description: "The facts a person's Bots remember about them, and the app actions those facts are read in from. Each person's are theirs alone: an administrator can't read them either." } - { name: Agents, description: "The agents an organization's Bots hand work to: OpenBot's own, a framework OpenBot runs, or an agent somebody runs at its own address. An administrator adds the organization's, and anybody may add a private one for their own Bots. A Bot's delegation says whether it works on one agent or hands work to several, and which." } - { name: CopilotKit management, description: "Connecting a self-hosted OpenBot to CopilotKit's management service, which keeps it up to date in the company's own cluster through an agent installed there. Only the administrators of the organization `default` manage it, and only on the team edition a company runs itself." } + - { name: Moving to OpenBot Cloud, description: "Moving what a person has in an OpenBot on their own computer to an organization on OpenBot Cloud: exporting it there as a bundle, importing the bundle on Cloud, and checking that everything arrived before anything is removed. Connections to apps never carry their sign-in, and a model key moves only when the person chooses, sealed to the import." } paths: /api/v2/organizations/{organizationId}/reactions: { $ref: './conversations.yaml#/paths/~1api~1v2~1organizations~1{organizationId}~1reactions' } /api/v2/organizations/{organizationId}/bots: { $ref: './bots.yaml#/paths/~1api~1v2~1organizations~1{organizationId}~1bots' } @@ -493,6 +494,15 @@ paths: /api/v2/organizations/{organizationId}/bots/{botId}/delegation: { $ref: './agents.yaml#/paths/~1api~1v2~1organizations~1{organizationId}~1bots~1{botId}~1delegation' } /api/v2/organizations/{organizationId}/management: { $ref: './management.yaml#/paths/~1api~1v2~1organizations~1{organizationId}~1management' } /api/v2/organizations/{organizationId}/management/enrollment: { $ref: './management.yaml#/paths/~1api~1v2~1organizations~1{organizationId}~1management~1enrollment' } + /api/v2/organizations/{organizationId}/export-estimate: { $ref: './moves.yaml#/paths/~1api~1v2~1organizations~1{organizationId}~1export-estimate' } + /api/v2/organizations/{organizationId}/exports: { $ref: './moves.yaml#/paths/~1api~1v2~1organizations~1{organizationId}~1exports' } + /api/v2/organizations/{organizationId}/exports/{exportId}: { $ref: './moves.yaml#/paths/~1api~1v2~1organizations~1{organizationId}~1exports~1{exportId}' } + /api/v2/organizations/{organizationId}/exports/{exportId}/parts/{partNumber}: { $ref: './moves.yaml#/paths/~1api~1v2~1organizations~1{organizationId}~1exports~1{exportId}~1parts~1{partNumber}' } + /api/v2/organizations/{organizationId}/imports: { $ref: './moves.yaml#/paths/~1api~1v2~1organizations~1{organizationId}~1imports' } + /api/v2/organizations/{organizationId}/imports/{importId}: { $ref: './moves.yaml#/paths/~1api~1v2~1organizations~1{organizationId}~1imports~1{importId}' } + /api/v2/organizations/{organizationId}/imports/{importId}/parts/{partNumber}: { $ref: './moves.yaml#/paths/~1api~1v2~1organizations~1{organizationId}~1imports~1{importId}~1parts~1{partNumber}' } + /api/v2/organizations/{organizationId}/imports/{importId}/apply: { $ref: './moves.yaml#/paths/~1api~1v2~1organizations~1{organizationId}~1imports~1{importId}~1apply' } + /api/v2/organizations/{organizationId}/imports/{importId}/verification: { $ref: './moves.yaml#/paths/~1api~1v2~1organizations~1{organizationId}~1imports~1{importId}~1verification' } components: securitySchemes: webSession: @@ -659,6 +669,10 @@ components: memories:write: Write, change and forget the signed-in person's memories, and add, change, sync and remove their memory sources. bot-agents:read: Read the agents the signed-in person's Bots may hand work to, and for an administrator every agent in the organization. bot-agents:write: Add, change and delete the signed-in person's own agents and their callback tokens, and for an administrator the organization's. + exports:read: Read and download the signed-in person's exports for moving to OpenBot Cloud, and what one would hold. + exports:write: Start and remove the signed-in person's exports for moving to OpenBot Cloud. + imports:read: Read the signed-in person's imports into OpenBot Cloud and check what arrived. + imports:write: Start an import into OpenBot Cloud as the signed-in person, upload its bundle and import it. apiKey: type: http scheme: bearer diff --git a/api/openapi/moves.yaml b/api/openapi/moves.yaml new file mode 100644 index 0000000000..ed6930f4e5 --- /dev/null +++ b/api/openapi/moves.yaml @@ -0,0 +1,1264 @@ +# Moving to OpenBot Cloud: exporting what a person has in an OpenBot on their own computer, and +# importing it into an organization on OpenBot Cloud. +# +# One area of OpenBot's REST API. `bun run api:bundle` joins every area with common.yaml into +# api/openapi.yaml, the file every client and check reads. See api/README.md. +# +# The move, as OpenBot Desktop runs it: +# 1. Cloud: createImport. The answer carries recipientKey, the public key model keys are sealed to. +# 2. Here: getExportEstimate, to show what moves and how much space the move frees. +# 3. Here: createExport (with recipientKey when the person chose to bring their model keys), then +# getExport until it is ready. The answer lists the bundle's parts, their sizes and digests, +# and the counts of everything in it. +# 4. Desktop: downloadExportPart for each part (resumable with Range), and on Cloud +# uploadImportPart for each (a part already received is skipped). +# 5. Cloud: applyImport, then getImport until it is imported. +# 6. Cloud: getImportVerification. Desktop removes nothing here until it says matches. +paths: + /api/v2/organizations/{organizationId}/export-estimate: + parameters: + - $ref: './common.yaml#/components/parameters/OrganizationId' + get: + tags: [Moving to OpenBot Cloud] + operationId: getExportEstimate + summary: Read what moving to OpenBot Cloud would take + description: >- + Count what an export would hold, without making one: the caller's + Bots, their skills, conversations and messages, memories, routines, + goals and check-ins, files and settings, and, when the caller is an + administrator, the organization's own skills. Also says roughly how + big the bundle will be, how much space this OpenBot holds for it on + disk (what the move frees once the local OpenBot is removed), which + apps the person will need to connect again on OpenBot Cloud, and + whether a model key could come along. Served only by an OpenBot that + runs on the person's own computer; elsewhere it answers 404 with the + code MOVE_UNAVAILABLE. + x-openbot-singleton: true + security: + - webSession: [] + - appOAuth: [exports:read] + - apiKey: [] + responses: + '200': + description: What an export would hold. + headers: + Cache-Control: + $ref: './common.yaml#/components/headers/PrivateNoStore' + content: + application/json: + schema: + $ref: '#/components/schemas/ExportEstimate' + examples: + example: + $ref: '#/components/examples/ExportEstimateExample' + '401': + $ref: './common.yaml#/components/responses/Unauthenticated' + '404': + $ref: '#/components/responses/MoveUnavailable' + '500': + $ref: './common.yaml#/components/responses/ServerError' + default: + $ref: './common.yaml#/components/responses/UnexpectedError' + /api/v2/organizations/{organizationId}/exports: + parameters: + - $ref: './common.yaml#/components/parameters/OrganizationId' + post: + tags: [Moving to OpenBot Cloud] + operationId: createExport + summary: Start exporting what the caller has here + description: >- + Start writing a bundle of everything the caller has in this + organization, to move it to OpenBot Cloud: their Bots (settings, + instructions and skills), conversations with every message, + memories, routines, goals and check-ins, files, standing + instructions and preferences, and, when the caller is an + administrator, the organization's own skills. Connections to apps + travel as their app and account name only: no token or password ever + leaves, and each one is listed in reconnect so the person connects + it again on Cloud. A model key travels only when includeModelKeys is + true, and then only sealed to recipientKey, the key the import on + Cloud gave (createImport), so the bundle never holds it readable. + + + The bundle is written in the background; read getExport until status + is ready. It is cut into parts of at most 32 MiB, each with its size + and SHA-256, so a dropped download resumes where it stopped. One + export is kept for each person: starting another removes the one + before. An export is removed 7 days after it was made, or with + deleteExport. Served only by an OpenBot that runs on the person's own + computer; elsewhere it answers 404 with the code MOVE_UNAVAILABLE. + security: + - webSession: [] + - appOAuth: [exports:write] + - apiKey: [] + parameters: + - $ref: './common.yaml#/components/parameters/IdempotencyKey' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ExportInput' + examples: + withModelKeys: + $ref: '#/components/examples/ExportInputExample' + responses: + '202': + description: The export has started. + headers: + Cache-Control: + $ref: './common.yaml#/components/headers/PrivateNoStore' + content: + application/json: + schema: + $ref: '#/components/schemas/Export' + examples: + preparing: + $ref: '#/components/examples/ExportPreparingExample' + '400': + $ref: './common.yaml#/components/responses/InvalidRequest' + '401': + $ref: './common.yaml#/components/responses/Unauthenticated' + '404': + $ref: '#/components/responses/MoveUnavailable' + '409': + $ref: './common.yaml#/components/responses/IdempotencyConflict' + '429': + $ref: '#/components/responses/TooManyMoves' + '500': + $ref: './common.yaml#/components/responses/ServerError' + default: + $ref: './common.yaml#/components/responses/UnexpectedError' + /api/v2/organizations/{organizationId}/exports/{exportId}: + parameters: + - $ref: './common.yaml#/components/parameters/OrganizationId' + - $ref: '#/components/parameters/ExportId' + get: + tags: [Moving to OpenBot Cloud] + operationId: getExport + summary: Read an export + description: >- + Return where the caller's export stands. Once ready it lists the + bundle's parts with their sizes and SHA-256, its total size, and the + count of everything in it by kind, which are the counts + getImportVerification is compared with. Only the person who made it + reads it; anybody else is answered 404. + security: + - webSession: [] + - appOAuth: [exports:read] + - apiKey: [] + responses: + '200': + description: The export. + headers: + Cache-Control: + $ref: './common.yaml#/components/headers/PrivateNoStore' + content: + application/json: + schema: + $ref: '#/components/schemas/Export' + examples: + preparing: + $ref: '#/components/examples/ExportPreparingExample' + ready: + $ref: '#/components/examples/ExportReadyExample' + '401': + $ref: './common.yaml#/components/responses/Unauthenticated' + '404': + $ref: '#/components/responses/ExportNotFound' + '500': + $ref: './common.yaml#/components/responses/ServerError' + default: + $ref: './common.yaml#/components/responses/UnexpectedError' + delete: + tags: [Moving to OpenBot Cloud] + operationId: deleteExport + summary: Remove an export + description: >- + Remove the caller's export and its bundle from disk. Nothing it was + made from changes. One already gone answers 204 too. + security: + - webSession: [] + - appOAuth: [exports:write] + - apiKey: [] + parameters: + - $ref: './common.yaml#/components/parameters/IdempotencyKey' + responses: + '204': + description: The export is gone. + '401': + $ref: './common.yaml#/components/responses/Unauthenticated' + '404': + $ref: '#/components/responses/MoveUnavailable' + '409': + $ref: './common.yaml#/components/responses/IdempotencyConflict' + '500': + $ref: './common.yaml#/components/responses/ServerError' + default: + $ref: './common.yaml#/components/responses/UnexpectedError' + /api/v2/organizations/{organizationId}/exports/{exportId}/parts/{partNumber}: + parameters: + - $ref: './common.yaml#/components/parameters/OrganizationId' + - $ref: '#/components/parameters/ExportId' + - $ref: '#/components/parameters/PartNumber' + get: + tags: [Moving to OpenBot Cloud] + operationId: downloadExportPart + summary: Download one part of an export's bundle + description: >- + Return one part of a ready export's bundle, as bytes to hand to + uploadImportPart unchanged. A Range header of one byte range (bytes=N- + or bytes=N-M) answers 206 with that range, so a dropped download + resumes where it stopped. The SHA-256 of the whole part is in the + export's parts and in the ETag. Only the person who made the export + downloads it. + x-openbot-singleton: true + security: + - webSession: [] + - appOAuth: [exports:read] + - apiKey: [] + parameters: + - name: Range + in: header + required: false + description: One byte range of the part, as RFC 9110 writes it. + schema: + type: string + pattern: ^bytes=[0-9]+-[0-9]*$ + maxLength: 64 + responses: + '200': + description: The whole part. + headers: + Cache-Control: + $ref: './common.yaml#/components/headers/PrivateNoStore' + ETag: + $ref: '#/components/headers/PartETag' + Accept-Ranges: + $ref: '#/components/headers/AcceptRanges' + content: + application/octet-stream: + schema: + type: string + format: binary + '206': + description: The range asked for. + headers: + Cache-Control: + $ref: './common.yaml#/components/headers/PrivateNoStore' + ETag: + $ref: '#/components/headers/PartETag' + Content-Range: + description: Which bytes of the part this is, and the part's size. + schema: + type: string + example: bytes 1048576-33554431/33554432 + content: + application/octet-stream: + schema: + type: string + format: binary + '401': + $ref: './common.yaml#/components/responses/Unauthenticated' + '404': + $ref: '#/components/responses/ExportNotFound' + '409': + $ref: '#/components/responses/ExportNotReady' + '416': + $ref: '#/components/responses/RangeNotSatisfiable' + '500': + $ref: './common.yaml#/components/responses/ServerError' + default: + $ref: './common.yaml#/components/responses/UnexpectedError' + /api/v2/organizations/{organizationId}/imports: + parameters: + - $ref: './common.yaml#/components/parameters/OrganizationId' + post: + tags: [Moving to OpenBot Cloud] + operationId: createImport + summary: Start importing a bundle into this organization + description: >- + Start an import of what the caller is moving from an OpenBot on their + own computer into this organization, the caller's own organization by + default. Everything imported belongs to the caller, in this + organization only. The answer carries recipientKey, a public key made + for this import alone: pass it to createExport, and a model key in the + bundle is sealed to it, readable only by this import. The answer also + says how big a bundle and a part may be. Then upload the export's + parts with uploadImportPart and apply them with applyImport. + + + Importing is safe to repeat: an import of the same OpenBot into the + same organization (an export made again, or a new import after a + dropped one) adds only what isn't here yet and duplicates nothing. + Served only by OpenBot Cloud; elsewhere it answers 404 with the code + MOVE_UNAVAILABLE. A person starts at most 10 imports a day. + security: + - webSession: [] + - appOAuth: [imports:write] + - apiKey: [] + parameters: + - $ref: './common.yaml#/components/parameters/IdempotencyKey' + requestBody: + required: false + content: + application/json: + schema: + $ref: '#/components/schemas/ImportInput' + responses: + '201': + description: The import, waiting for its bundle. + headers: + Cache-Control: + $ref: './common.yaml#/components/headers/PrivateNoStore' + content: + application/json: + schema: + $ref: '#/components/schemas/Import' + examples: + waiting: + $ref: '#/components/examples/ImportWaitingExample' + '400': + $ref: './common.yaml#/components/responses/InvalidRequest' + '401': + $ref: './common.yaml#/components/responses/Unauthenticated' + '404': + $ref: '#/components/responses/MoveUnavailable' + '409': + $ref: './common.yaml#/components/responses/IdempotencyConflict' + '429': + $ref: '#/components/responses/TooManyMoves' + '500': + $ref: './common.yaml#/components/responses/ServerError' + default: + $ref: './common.yaml#/components/responses/UnexpectedError' + get: + tags: [Moving to OpenBot Cloud] + operationId: listImports + summary: List the caller's imports into this organization + description: >- + List the imports the caller started in this organization, newest + first, so an app that lost track of one after a drop finds it again. + Only the caller's own. Served only by OpenBot Cloud. + security: + - webSession: [] + - appOAuth: [imports:read] + - apiKey: [] + parameters: + - $ref: './common.yaml#/components/parameters/Limit' + - $ref: './common.yaml#/components/parameters/Cursor' + responses: + '200': + description: A page of imports. + headers: + Cache-Control: + $ref: './common.yaml#/components/headers/PrivateNoStore' + content: + application/json: + schema: + $ref: '#/components/schemas/ImportPage' + '400': + $ref: './common.yaml#/components/responses/InvalidRequest' + '401': + $ref: './common.yaml#/components/responses/Unauthenticated' + '404': + $ref: '#/components/responses/MoveUnavailable' + '500': + $ref: './common.yaml#/components/responses/ServerError' + default: + $ref: './common.yaml#/components/responses/UnexpectedError' + /api/v2/organizations/{organizationId}/imports/{importId}: + parameters: + - $ref: './common.yaml#/components/parameters/OrganizationId' + - $ref: '#/components/parameters/ImportId' + get: + tags: [Moving to OpenBot Cloud] + operationId: getImport + summary: Read an import + description: >- + Return where the caller's import stands: which parts have arrived, + how far applying them has got by kind, and once imported, the + summary: what was imported, what was imported differently or left + out on OpenBot Cloud and why (notes), and which apps to connect + again (reconnect). Only the person who started it reads it. + security: + - webSession: [] + - appOAuth: [imports:read] + - apiKey: [] + responses: + '200': + description: The import. + headers: + Cache-Control: + $ref: './common.yaml#/components/headers/PrivateNoStore' + content: + application/json: + schema: + $ref: '#/components/schemas/Import' + examples: + waiting: + $ref: '#/components/examples/ImportWaitingExample' + imported: + $ref: '#/components/examples/ImportImportedExample' + '401': + $ref: './common.yaml#/components/responses/Unauthenticated' + '404': + $ref: '#/components/responses/ImportNotFound' + '500': + $ref: './common.yaml#/components/responses/ServerError' + default: + $ref: './common.yaml#/components/responses/UnexpectedError' + /api/v2/organizations/{organizationId}/imports/{importId}/parts/{partNumber}: + parameters: + - $ref: './common.yaml#/components/parameters/OrganizationId' + - $ref: '#/components/parameters/ImportId' + - $ref: '#/components/parameters/PartNumber' + put: + tags: [Moving to OpenBot Cloud] + operationId: uploadImportPart + summary: Upload one part of the bundle + description: >- + Upload one part of the export's bundle, exactly as downloadExportPart + gave it. Part 1 carries the bundle's manifest, so it is uploaded + first; after it the parts go in any order, and the import's + expectedParts says how many there are and the SHA-256 of each. A part + whose bytes don't match the manifest is refused (IMPORT_PART_MISMATCH) + and can be uploaded again. Uploading a part that already arrived + changes nothing and answers 200 again, so after a drop an app sends + whatever receivedParts doesn't list. A part is at most 32 MiB, and a + bundle at most maxBundleBytes. At most 120 parts a minute for each + person. + security: + - webSession: [] + - appOAuth: [imports:write] + - apiKey: [] + parameters: + - $ref: './common.yaml#/components/parameters/IdempotencyKey' + requestBody: + required: true + content: + application/octet-stream: + schema: + type: string + format: binary + responses: + '200': + description: The part arrived (or had already arrived). + headers: + Cache-Control: + $ref: './common.yaml#/components/headers/PrivateNoStore' + content: + application/json: + schema: + $ref: '#/components/schemas/Import' + '400': + $ref: './common.yaml#/components/responses/InvalidRequest' + '401': + $ref: './common.yaml#/components/responses/Unauthenticated' + '404': + $ref: '#/components/responses/ImportNotFound' + '409': + $ref: '#/components/responses/ImportConflict' + '413': + $ref: './common.yaml#/components/responses/PayloadTooLarge' + '422': + $ref: '#/components/responses/ImportBundleRefused' + '429': + $ref: '#/components/responses/TooManyMoves' + '500': + $ref: './common.yaml#/components/responses/ServerError' + default: + $ref: './common.yaml#/components/responses/UnexpectedError' + /api/v2/organizations/{organizationId}/imports/{importId}/apply: + parameters: + - $ref: './common.yaml#/components/parameters/OrganizationId' + - $ref: '#/components/parameters/ImportId' + post: + tags: [Moving to OpenBot Cloud] + operationId: applyImport + summary: Import the uploaded bundle + description: >- + Once every part has arrived, import the bundle into this organization + in the background: every id is given a new one here, everything is + owned by the caller, and nothing reaches another organization. Read + getImport until status is imported or failed. Applying again while it + runs, or after it finished, changes nothing and answers where it + stands; applying a failed import tries again from where it stopped, + and nothing already imported is imported twice. A missing part + answers 409 with IMPORT_INCOMPLETE. + + + What OpenBot Cloud doesn't have comes in differently, and the summary + says so in notes: a Bot that ran on its own isolated computer comes + in as an ordinary Bot; a feature that needs the Business plan, in an + organization that isn't on it, is left out. A model key in the bundle + becomes the caller's own AI connection, unless they have one here + already, which is kept. + security: + - webSession: [] + - appOAuth: [imports:write] + - apiKey: [] + parameters: + - $ref: './common.yaml#/components/parameters/IdempotencyKey' + responses: + '202': + description: Importing, or where the import stands. + headers: + Cache-Control: + $ref: './common.yaml#/components/headers/PrivateNoStore' + content: + application/json: + schema: + $ref: '#/components/schemas/Import' + '401': + $ref: './common.yaml#/components/responses/Unauthenticated' + '404': + $ref: '#/components/responses/ImportNotFound' + '409': + $ref: '#/components/responses/ImportConflict' + '500': + $ref: './common.yaml#/components/responses/ServerError' + default: + $ref: './common.yaml#/components/responses/UnexpectedError' + /api/v2/organizations/{organizationId}/imports/{importId}/verification: + parameters: + - $ref: './common.yaml#/components/parameters/OrganizationId' + - $ref: '#/components/parameters/ImportId' + get: + tags: [Moving to OpenBot Cloud] + operationId: getImportVerification + summary: Check that everything arrived + description: >- + Count, by kind, what from this import's OpenBot is in this + organization now, read from what is stored here rather than from the + import's own tally, beside what the bundle held. matches is true only + when every kind is all here, apart from what the notes say OpenBot + Cloud left out on purpose. OpenBot Desktop removes nothing on the + person's computer until it does. Also lists the apps to connect again. + x-openbot-singleton: true + security: + - webSession: [] + - appOAuth: [imports:read] + - apiKey: [] + responses: + '200': + description: The counts. + headers: + Cache-Control: + $ref: './common.yaml#/components/headers/PrivateNoStore' + content: + application/json: + schema: + $ref: '#/components/schemas/ImportVerification' + examples: + matches: + $ref: '#/components/examples/ImportVerificationExample' + '401': + $ref: './common.yaml#/components/responses/Unauthenticated' + '404': + $ref: '#/components/responses/ImportNotFound' + '409': + $ref: '#/components/responses/ImportConflict' + '500': + $ref: './common.yaml#/components/responses/ServerError' + default: + $ref: './common.yaml#/components/responses/UnexpectedError' +components: + parameters: + ExportId: + name: exportId + in: path + required: true + description: The export's id. + schema: + type: string + minLength: 1 + maxLength: 64 + pattern: ^[A-Za-z0-9_-]+$ + example: exp_7d1f2c3b8a4e4b5f + ImportId: + name: importId + in: path + required: true + description: The import's id. + schema: + type: string + minLength: 1 + maxLength: 64 + pattern: ^[A-Za-z0-9_-]+$ + example: imp_0e1f2a3b4c5d6f1d + PartNumber: + name: partNumber + in: path + required: true + description: Which part of the bundle, counted from 1. + schema: + type: integer + minimum: 1 + maximum: 10000 + example: 1 + headers: + PartETag: + description: The part's SHA-256 in hex, quoted. + schema: + type: string + example: '"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"' + AcceptRanges: + description: A part can be downloaded a byte range at a time. + schema: + type: string + const: bytes + schemas: + MoveKind: + type: string + x-extensible-enum: + - bots + - skills + - conversations + - messages + - memories + - routines + - goals + - check-ins + - files + - settings + - model-keys + description: >- + A kind of thing that moves. bots: Bots with their settings and + instructions. skills: skills, a Bot's and the person's (and the + organization's, for an administrator). conversations and messages: + every conversation and every message in it. memories: what the + person's Bots remember about them. routines, goals and check-ins: + with their schedules. files: files sent in conversations and kept on + a Bot's computer. settings: the person's standing instructions and + preferences. model-keys: a model key, only when the person chose to + bring it. A later OpenBot may add a kind; count one you don't know + like any other. + MoveCount: + type: object + required: [kind, count] + properties: + kind: + $ref: '#/components/schemas/MoveKind' + count: + type: integer + minimum: 0 + ReconnectApp: + type: object + description: >- + A connection to an app that doesn't move, because its sign-in stays + on the person's computer: the person connects it again on OpenBot + Cloud. Never carries a token, a password or a key. + required: [appId, appName] + properties: + appId: + type: string + minLength: 1 + description: The app's id in the app directory, such as gmail or slack. + appName: + type: string + minLength: 1 + description: The app's name as a person reads it. + accountLabel: + type: string + minLength: 1 + description: Which account it was connected as, such as an email address or a workspace name, when known. + iconUrl: + type: string + format: uri + description: The app's icon, when the directory has one. + botNames: + type: array + description: The Bots that used it, so the person knows which to check. + items: + type: string + MoveNote: + type: object + description: >- + Something that moved differently, or not at all, and why, in a + sentence a person reads. + required: [code, message] + properties: + code: + type: string + x-extensible-enum: + - isolated-bot-made-ordinary + - business-plan-feature-left-out + - model-key-kept-existing + - model-key-not-brought + - item-skipped + description: >- + isolated-bot-made-ordinary: OpenBot Cloud has no isolated + computers, so a Bot that had one runs on an ordinary one. + business-plan-feature-left-out: the feature needs the Business + plan and this organization isn't on it. model-key-kept-existing: + the person already had an AI connection here, which was kept. + model-key-not-brought: the person chose not to bring a model key. + item-skipped: one item couldn't be imported; message says which + and why. A later OpenBot may add a code; show the message. + kind: + $ref: '#/components/schemas/MoveKind' + count: + type: integer + minimum: 1 + description: How many items the note is about. + message: + type: string + minLength: 1 + items: + type: array + description: The names of the items, such as the Bots, when there are a few. + items: + type: string + ExportEstimate: + type: object + required: [counts, estimatedBytes, storedBytes, reconnect, modelKeysAvailable] + properties: + counts: + type: array + items: + $ref: '#/components/schemas/MoveCount' + estimatedBytes: + type: integer + minimum: 0 + description: Roughly how big the bundle will be, in bytes. + storedBytes: + type: integer + minimum: 0 + description: >- + How much this OpenBot keeps on disk for the person (its database + and files), which removing it frees. OpenBot Desktop adds what the + engine itself takes. + reconnect: + type: array + items: + $ref: '#/components/schemas/ReconnectApp' + modelKeysAvailable: + type: boolean + description: True when there is a model key the person could choose to bring. + ExportInput: + type: object + additionalProperties: false + properties: + includeModelKeys: + type: boolean + default: false + description: >- + Bring the person's model key, sealed to recipientKey. Without + recipientKey this is refused. + recipientKey: + $ref: '#/components/schemas/MoveRecipientKey' + MoveRecipientKey: + type: object + description: >- + A public key as a JSON Web Key (RFC 7517): RSA, 4096 bits, for + RSA-OAEP-256. A model key is sealed to it as a JWE (RFC 7516, + RSA-OAEP-256 with A256GCM), so only the import that made it reads + it. + additionalProperties: false + required: [kty, n, e, alg, kid] + properties: + kty: + type: string + const: RSA + n: + type: string + minLength: 1 + maxLength: 1024 + e: + type: string + minLength: 1 + maxLength: 16 + alg: + type: string + const: RSA-OAEP-256 + kid: + type: string + minLength: 1 + maxLength: 128 + BundlePart: + type: object + required: [number, bytes, sha256] + properties: + number: + type: integer + minimum: 1 + bytes: + type: integer + minimum: 1 + sha256: + type: string + pattern: ^[0-9a-f]{64}$ + Export: + type: object + required: [id, status, createdAt, expiresAt, includesModelKeys] + properties: + id: + type: string + minLength: 1 + status: + type: string + x-extensible-enum: [preparing, ready, failed] + description: >- + preparing: the bundle is being written. ready: every part can be + downloaded. failed: it stopped; error says why, and starting + another export tries again. A later OpenBot may add a status; + read one you don't know as preparing. + formatVersion: + type: integer + minimum: 1 + description: The bundle's format, once ready. This OpenBot writes 1. + createdAt: + type: string + format: date-time + expiresAt: + type: string + format: date-time + description: When the bundle is removed. + totalBytes: + type: integer + minimum: 0 + description: The bundle's size, once ready. + parts: + type: array + description: The bundle's parts in order, once ready. + items: + $ref: '#/components/schemas/BundlePart' + counts: + type: array + description: Everything in the bundle by kind, once ready. + items: + $ref: '#/components/schemas/MoveCount' + reconnect: + type: array + description: The apps to connect again on OpenBot Cloud. + items: + $ref: '#/components/schemas/ReconnectApp' + includesModelKeys: + type: boolean + progress: + type: number + minimum: 0 + maximum: 1 + description: How far writing the bundle has got, while preparing. + error: + type: string + minLength: 1 + description: What went wrong, when failed, in a sentence a person reads. + ImportInput: + type: object + additionalProperties: false + properties: + sourceName: + type: string + minLength: 1 + maxLength: 200 + description: A name for where the bundle comes from, such as the computer's name, shown in the list of imports. + Import: + type: object + required: [id, status, createdAt, recipientKey, maxBundleBytes, maxPartBytes, receivedParts] + properties: + id: + type: string + minLength: 1 + status: + type: string + x-extensible-enum: [waiting-for-bundle, receiving, ready, importing, imported, failed] + description: >- + waiting-for-bundle: no part has arrived. receiving: part 1 has + arrived and others are still to come. ready: every part arrived; + apply it. importing: being imported. imported: done; read the + summary, then verify. failed: it stopped; error says why, and + applying again goes on from there. A later OpenBot may add a + status; read one you don't know as importing. + sourceName: + type: string + createdAt: + type: string + format: date-time + finishedAt: + type: string + format: date-time + recipientKey: + $ref: '#/components/schemas/MoveRecipientKey' + maxBundleBytes: + type: integer + minimum: 1 + maxPartBytes: + type: integer + minimum: 1 + expectedParts: + type: array + description: The bundle's parts, from its manifest, once part 1 arrived. + items: + $ref: '#/components/schemas/BundlePart' + receivedParts: + type: array + description: The numbers of the parts that arrived. + items: + type: integer + minimum: 1 + expected: + type: array + description: Everything the bundle holds by kind, from its manifest, once part 1 arrived. + items: + $ref: '#/components/schemas/MoveCount' + imported: + type: array + description: >- + What has been imported so far by kind, while importing and once + imported. Items a repeated import found already here count as + imported. + items: + $ref: '#/components/schemas/MoveCount' + notes: + type: array + items: + $ref: '#/components/schemas/MoveNote' + reconnect: + type: array + description: The apps to connect again here, once part 1 arrived. + items: + $ref: '#/components/schemas/ReconnectApp' + error: + type: string + minLength: 1 + description: What went wrong, when failed, in a sentence a person reads. + ImportPage: + type: object + required: [items, nextCursor] + properties: + items: + type: array + items: + $ref: '#/components/schemas/Import' + nextCursor: + type: [string, 'null'] + ImportVerificationKind: + type: object + required: [kind, expected, found, leftOut] + properties: + kind: + $ref: '#/components/schemas/MoveKind' + expected: + type: integer + minimum: 0 + description: How many the bundle held. + found: + type: integer + minimum: 0 + description: How many from this OpenBot are in this organization now. + leftOut: + type: integer + minimum: 0 + description: How many OpenBot Cloud left out on purpose, as the notes say. + ImportVerification: + type: object + required: [importId, matches, kinds, notes, reconnect] + properties: + importId: + type: string + minLength: 1 + matches: + type: boolean + description: True when, for every kind, found plus leftOut is expected. + kinds: + type: array + items: + $ref: '#/components/schemas/ImportVerificationKind' + notes: + type: array + items: + $ref: '#/components/schemas/MoveNote' + reconnect: + type: array + items: + $ref: '#/components/schemas/ReconnectApp' + responses: + MoveUnavailable: + description: >- + Moving isn't served here: exports only by an OpenBot on the person's + own computer, imports only by OpenBot Cloud. + content: + application/problem+json: + schema: + $ref: './common.yaml#/components/schemas/Problem' + examples: + unavailable: + value: + type: https://open.bot/errors/move-unavailable + title: Moving isn't available here. + status: 404 + detail: Importing is available only on OpenBot Cloud. + code: MOVE_UNAVAILABLE + category: not_found + retryable: false + requestId: req_example + traceId: trace_example + ExportNotFound: + description: The export doesn't exist, has been removed, or isn't the caller's. + content: + application/problem+json: + schema: + $ref: './common.yaml#/components/schemas/Problem' + examples: + notFound: + value: + type: https://open.bot/errors/export-not-found + title: Export not found. + status: 404 + detail: That export isn't here any more. Start the move again. + code: EXPORT_NOT_FOUND + category: not_found + retryable: false + requestId: req_example + traceId: trace_example + ExportNotReady: + description: The export is still being written, or failed. + content: + application/problem+json: + schema: + $ref: './common.yaml#/components/schemas/Problem' + examples: + preparing: + value: + type: https://open.bot/errors/export-not-ready + title: The export isn't ready. + status: 409 + detail: The export is still being prepared. Try again when it's ready. + code: EXPORT_NOT_READY + category: conflict + retryable: true + requestId: req_example + traceId: trace_example + RangeNotSatisfiable: + description: The Range asked for lies outside the part. + content: + application/problem+json: + schema: + $ref: './common.yaml#/components/schemas/Problem' + examples: + outside: + value: + type: https://open.bot/errors/range-not-satisfiable + title: That range isn't in the part. + status: 416 + detail: The part is 33554432 bytes long. + code: RANGE_NOT_SATISFIABLE + category: validation + retryable: false + requestId: req_example + traceId: trace_example + ImportNotFound: + description: The import doesn't exist, or isn't the caller's. + content: + application/problem+json: + schema: + $ref: './common.yaml#/components/schemas/Problem' + examples: + notFound: + value: + type: https://open.bot/errors/import-not-found + title: Import not found. + status: 404 + detail: That import isn't here. Start the move again. + code: IMPORT_NOT_FOUND + category: not_found + retryable: false + requestId: req_example + traceId: trace_example + ImportConflict: + description: >- + The import can't do that in its state: a part doesn't match the + manifest (IMPORT_PART_MISMATCH), part 1 hasn't arrived + (IMPORT_MANIFEST_MISSING), a part is missing (IMPORT_INCOMPLETE), the + import hasn't finished (IMPORT_NOT_FINISHED), or the Idempotency-Key + was used for a different request. + content: + application/problem+json: + schema: + $ref: './common.yaml#/components/schemas/Problem' + examples: + incomplete: + value: + type: https://open.bot/errors/import-incomplete + title: Some parts haven't arrived. + status: 409 + detail: Parts 3 and 4 haven't arrived yet. Upload them, then import. + code: IMPORT_INCOMPLETE + category: conflict + retryable: false + requestId: req_example + traceId: trace_example + mismatch: + value: + type: https://open.bot/errors/import-part-mismatch + title: That part doesn't match the bundle. + status: 409 + detail: Part 2 arrived damaged. Download it again and upload it. + code: IMPORT_PART_MISMATCH + category: conflict + retryable: true + requestId: req_example + traceId: trace_example + ImportBundleRefused: + description: >- + Part 1 isn't a bundle this OpenBot reads: not a bundle at all, a + format newer than it reads (IMPORT_FORMAT_UNSUPPORTED), larger than + maxBundleBytes, or a model key sealed to another import's key. + content: + application/problem+json: + schema: + $ref: './common.yaml#/components/schemas/Problem' + examples: + newer: + value: + type: https://open.bot/errors/import-format-unsupported + title: This bundle is newer than OpenBot Cloud reads. + status: 422 + detail: This bundle was made by a newer OpenBot. Try again once OpenBot Cloud is updated. + code: IMPORT_FORMAT_UNSUPPORTED + category: validation + retryable: false + requestId: req_example + traceId: trace_example + TooManyMoves: + description: Too many exports, imports or parts at once for one person. + headers: + Retry-After: + description: Seconds to wait. + schema: + type: integer + minimum: 1 + content: + application/problem+json: + schema: + $ref: './common.yaml#/components/schemas/Problem' + examples: + tooMany: + value: + type: https://open.bot/errors/too-many-requests + title: Too many requests. + status: 429 + detail: That's a lot of uploads at once. Wait a minute, then go on. + code: TOO_MANY_REQUESTS + category: rate_limit + retryable: true + requestId: req_example + traceId: trace_example + examples: + ExportEstimateExample: + value: + counts: + - { kind: bots, count: 4 } + - { kind: skills, count: 9 } + - { kind: conversations, count: 37 } + - { kind: messages, count: 2814 } + - { kind: memories, count: 52 } + - { kind: routines, count: 3 } + - { kind: goals, count: 1 } + - { kind: check-ins, count: 2 } + - { kind: files, count: 64 } + - { kind: settings, count: 1 } + estimatedBytes: 187432960 + storedBytes: 1288490188 + reconnect: + - { appId: gmail, appName: Gmail, accountLabel: sam@example.com, botNames: [Inbox helper] } + - { appId: slack, appName: Slack, accountLabel: Example workspace, botNames: [Inbox helper, Standup] } + modelKeysAvailable: true + ExportInputExample: + value: + includeModelKeys: true + recipientKey: + kty: RSA + alg: RSA-OAEP-256 + kid: imp_0e1f2a3b4c5d6f1d + e: AQAB + n: 0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw + ExportPreparingExample: + value: + id: exp_7d1f2c3b8a4e4b5f + status: preparing + createdAt: '2026-11-21T10:00:00Z' + expiresAt: '2026-11-28T10:00:00Z' + includesModelKeys: true + progress: 0.4 + ExportReadyExample: + value: + id: exp_7d1f2c3b8a4e4b5f + status: ready + formatVersion: 1 + createdAt: '2026-11-21T10:00:00Z' + expiresAt: '2026-11-28T10:00:00Z' + totalBytes: 41943040 + parts: + - { number: 1, bytes: 33554432, sha256: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 } + - { number: 2, bytes: 8388608, sha256: 60303ae22b998861bce3b28f33eec1be758a213c86c93c076dbe9f558c11c752 } + counts: + - { kind: bots, count: 4 } + - { kind: conversations, count: 37 } + - { kind: messages, count: 2814 } + - { kind: model-keys, count: 1 } + reconnect: + - { appId: gmail, appName: Gmail, accountLabel: sam@example.com } + includesModelKeys: true + ImportWaitingExample: + value: + id: imp_0e1f2a3b4c5d6f1d + status: waiting-for-bundle + sourceName: Sam's MacBook + createdAt: '2026-11-21T10:00:00Z' + recipientKey: + kty: RSA + alg: RSA-OAEP-256 + kid: imp_0e1f2a3b4c5d6f1d + e: AQAB + n: 0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw + maxBundleBytes: 10737418240 + maxPartBytes: 33554432 + receivedParts: [] + ImportImportedExample: + value: + id: imp_0e1f2a3b4c5d6f1d + status: imported + createdAt: '2026-11-21T10:00:00Z' + finishedAt: '2026-11-21T10:03:12Z' + recipientKey: + kty: RSA + alg: RSA-OAEP-256 + kid: imp_0e1f2a3b4c5d6f1d + e: AQAB + n: 0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw + maxBundleBytes: 10737418240 + maxPartBytes: 33554432 + expectedParts: + - { number: 1, bytes: 33554432, sha256: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 } + - { number: 2, bytes: 8388608, sha256: 60303ae22b998861bce3b28f33eec1be758a213c86c93c076dbe9f558c11c752 } + receivedParts: [1, 2] + expected: + - { kind: bots, count: 4 } + - { kind: conversations, count: 37 } + - { kind: messages, count: 2814 } + imported: + - { kind: bots, count: 4 } + - { kind: conversations, count: 37 } + - { kind: messages, count: 2814 } + notes: + - code: isolated-bot-made-ordinary + kind: bots + count: 1 + message: Research runs on an ordinary computer here, because OpenBot Cloud has no isolated computers. + items: [Research] + reconnect: + - { appId: gmail, appName: Gmail, accountLabel: sam@example.com } + ImportVerificationExample: + value: + importId: imp_0e1f2a3b4c5d6f1d + matches: true + kinds: + - { kind: bots, expected: 4, found: 4, leftOut: 0 } + - { kind: conversations, expected: 37, found: 37, leftOut: 0 } + - { kind: messages, expected: 2814, found: 2814, leftOut: 0 } + notes: [] + reconnect: + - { appId: gmail, appName: Gmail, accountLabel: sam@example.com } diff --git a/app/src/lib/api/generated/index.ts b/app/src/lib/api/generated/index.ts index 66ef6527f1..c2e5130413 100644 --- a/app/src/lib/api/generated/index.ts +++ b/app/src/lib/api/generated/index.ts @@ -28,6 +28,7 @@ export * from "./learning/learning"; export * from "./linked-accounts/linked-accounts"; export * from "./memory/memory"; export * from "./models/models"; +export * from "./moving-to-openbot-cloud/moving-to-openbot-cloud"; export * from "./network-policies/network-policies"; export * from "./notification-settings/notification-settings"; export * from "./organization-settings/organization-settings"; diff --git a/app/src/lib/api/generated/index.zod.ts b/app/src/lib/api/generated/index.zod.ts index 64afd6778c..4d4e81220f 100644 --- a/app/src/lib/api/generated/index.zod.ts +++ b/app/src/lib/api/generated/index.zod.ts @@ -28,6 +28,7 @@ export * from "./learning/learning.zod"; export * from "./linked-accounts/linked-accounts.zod"; export * from "./memory/memory.zod"; export * from "./models/models.zod"; +export * from "./moving-to-openbot-cloud/moving-to-openbot-cloud.zod"; export * from "./network-policies/network-policies.zod"; export * from "./notification-settings/notification-settings.zod"; export * from "./organization-settings/organization-settings.zod"; diff --git a/app/src/lib/api/generated/model/applyImportHeaders.ts b/app/src/lib/api/generated/model/applyImportHeaders.ts new file mode 100644 index 0000000000..665b8ca081 --- /dev/null +++ b/app/src/lib/api/generated/model/applyImportHeaders.ts @@ -0,0 +1,13 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { IdempotencyKeyParameter } from "./idempotencyKeyParameter"; + +export type ApplyImportHeaders = { + /** + * Generated by the caller for each write it means to make once. Reuse the same key and the same request for 24 hours after an uncertain response; the same key with a different request is a conflict. + * @minLength 1 + * @maxLength 128 + */ + "Idempotency-Key": IdempotencyKeyParameter; +}; diff --git a/app/src/lib/api/generated/model/bundlePart.ts b/app/src/lib/api/generated/model/bundlePart.ts new file mode 100644 index 0000000000..f35f029f79 --- /dev/null +++ b/app/src/lib/api/generated/model/bundlePart.ts @@ -0,0 +1,12 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ + +export interface BundlePart { + /** @minimum 1 */ + number: number; + /** @minimum 1 */ + bytes: number; + /** @pattern ^[0-9a-f]{64}$ */ + sha256: string; +} diff --git a/app/src/lib/api/generated/model/createExportHeaders.ts b/app/src/lib/api/generated/model/createExportHeaders.ts new file mode 100644 index 0000000000..6ad4a50cbd --- /dev/null +++ b/app/src/lib/api/generated/model/createExportHeaders.ts @@ -0,0 +1,13 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { IdempotencyKeyParameter } from "./idempotencyKeyParameter"; + +export type CreateExportHeaders = { + /** + * Generated by the caller for each write it means to make once. Reuse the same key and the same request for 24 hours after an uncertain response; the same key with a different request is a conflict. + * @minLength 1 + * @maxLength 128 + */ + "Idempotency-Key": IdempotencyKeyParameter; +}; diff --git a/app/src/lib/api/generated/model/createImportHeaders.ts b/app/src/lib/api/generated/model/createImportHeaders.ts new file mode 100644 index 0000000000..0bf3ce48e6 --- /dev/null +++ b/app/src/lib/api/generated/model/createImportHeaders.ts @@ -0,0 +1,13 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { IdempotencyKeyParameter } from "./idempotencyKeyParameter"; + +export type CreateImportHeaders = { + /** + * Generated by the caller for each write it means to make once. Reuse the same key and the same request for 24 hours after an uncertain response; the same key with a different request is a conflict. + * @minLength 1 + * @maxLength 128 + */ + "Idempotency-Key": IdempotencyKeyParameter; +}; diff --git a/app/src/lib/api/generated/model/deleteExportHeaders.ts b/app/src/lib/api/generated/model/deleteExportHeaders.ts new file mode 100644 index 0000000000..dc904d991d --- /dev/null +++ b/app/src/lib/api/generated/model/deleteExportHeaders.ts @@ -0,0 +1,13 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { IdempotencyKeyParameter } from "./idempotencyKeyParameter"; + +export type DeleteExportHeaders = { + /** + * Generated by the caller for each write it means to make once. Reuse the same key and the same request for 24 hours after an uncertain response; the same key with a different request is a conflict. + * @minLength 1 + * @maxLength 128 + */ + "Idempotency-Key": IdempotencyKeyParameter; +}; diff --git a/app/src/lib/api/generated/model/downloadExportPartHeaders.ts b/app/src/lib/api/generated/model/downloadExportPartHeaders.ts new file mode 100644 index 0000000000..963c0e5afb --- /dev/null +++ b/app/src/lib/api/generated/model/downloadExportPartHeaders.ts @@ -0,0 +1,12 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ + +export type DownloadExportPartHeaders = { + /** + * One byte range of the part, as RFC 9110 writes it. + * @maxLength 64 + * @pattern ^bytes=[0-9]+-[0-9]*$ + */ + Range?: string; +}; diff --git a/app/src/lib/api/generated/model/export.ts b/app/src/lib/api/generated/model/export.ts new file mode 100644 index 0000000000..38202ef988 --- /dev/null +++ b/app/src/lib/api/generated/model/export.ts @@ -0,0 +1,44 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { BundlePart } from "./bundlePart"; +import type { MoveCount } from "./moveCount"; +import type { ReconnectApp } from "./reconnectApp"; + +export interface Export { + /** @minLength 1 */ + id: string; + /** preparing: the bundle is being written. ready: every part can be downloaded. failed: it stopped; error says why, and starting another export tries again. A later OpenBot may add a status; read one you don't know as preparing. */ + status: string; + /** + * The bundle's format, once ready. This OpenBot writes 1. + * @minimum 1 + */ + formatVersion?: number; + createdAt: string; + /** When the bundle is removed. */ + expiresAt: string; + /** + * The bundle's size, once ready. + * @minimum 0 + */ + totalBytes?: number; + /** The bundle's parts in order, once ready. */ + parts?: BundlePart[]; + /** Everything in the bundle by kind, once ready. */ + counts?: MoveCount[]; + /** The apps to connect again on OpenBot Cloud. */ + reconnect?: ReconnectApp[]; + includesModelKeys: boolean; + /** + * How far writing the bundle has got, while preparing. + * @minimum 0 + * @maximum 1 + */ + progress?: number; + /** + * What went wrong, when failed, in a sentence a person reads. + * @minLength 1 + */ + error?: string; +} diff --git a/app/src/lib/api/generated/model/exportEstimate.ts b/app/src/lib/api/generated/model/exportEstimate.ts new file mode 100644 index 0000000000..f18ed4a706 --- /dev/null +++ b/app/src/lib/api/generated/model/exportEstimate.ts @@ -0,0 +1,22 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { MoveCount } from "./moveCount"; +import type { ReconnectApp } from "./reconnectApp"; + +export interface ExportEstimate { + counts: MoveCount[]; + /** + * Roughly how big the bundle will be, in bytes. + * @minimum 0 + */ + estimatedBytes: number; + /** + * How much this OpenBot keeps on disk for the person (its database and files), which removing it frees. OpenBot Desktop adds what the engine itself takes. + * @minimum 0 + */ + storedBytes: number; + reconnect: ReconnectApp[]; + /** True when there is a model key the person could choose to bring. */ + modelKeysAvailable: boolean; +} diff --git a/app/src/lib/api/generated/model/exportInput.ts b/app/src/lib/api/generated/model/exportInput.ts new file mode 100644 index 0000000000..249708d15f --- /dev/null +++ b/app/src/lib/api/generated/model/exportInput.ts @@ -0,0 +1,10 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { MoveRecipientKey } from "./moveRecipientKey"; + +export interface ExportInput { + /** Bring the person's model key, sealed to recipientKey. Without recipientKey this is refused. */ + includeModelKeys?: boolean; + recipientKey?: MoveRecipientKey; +} diff --git a/app/src/lib/api/generated/model/exportNotFoundResponse.ts b/app/src/lib/api/generated/model/exportNotFoundResponse.ts new file mode 100644 index 0000000000..01722277ab --- /dev/null +++ b/app/src/lib/api/generated/model/exportNotFoundResponse.ts @@ -0,0 +1,9 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { Problem } from "./problem"; + +/** + * The export doesn't exist, has been removed, or isn't the caller's. + */ +export type ExportNotFoundResponse = Problem; diff --git a/app/src/lib/api/generated/model/exportNotReadyResponse.ts b/app/src/lib/api/generated/model/exportNotReadyResponse.ts new file mode 100644 index 0000000000..7975f001f4 --- /dev/null +++ b/app/src/lib/api/generated/model/exportNotReadyResponse.ts @@ -0,0 +1,9 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { Problem } from "./problem"; + +/** + * The export is still being written, or failed. + */ +export type ExportNotReadyResponse = Problem; diff --git a/app/src/lib/api/generated/model/import.ts b/app/src/lib/api/generated/model/import.ts new file mode 100644 index 0000000000..1b5ad35e08 --- /dev/null +++ b/app/src/lib/api/generated/model/import.ts @@ -0,0 +1,42 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { BundlePart } from "./bundlePart"; +import type { MoveCount } from "./moveCount"; +import type { MoveNote } from "./moveNote"; +import type { MoveRecipientKey } from "./moveRecipientKey"; +import type { ReconnectApp } from "./reconnectApp"; + +export interface Import { + /** @minLength 1 */ + id: string; + /** waiting-for-bundle: no part has arrived. receiving: part 1 has arrived and others are still to come. ready: every part arrived; apply it. importing: being imported. imported: done; read the summary, then verify. failed: it stopped; error says why, and applying again goes on from there. A later OpenBot may add a status; read one you don't know as importing. */ + status: string; + sourceName?: string; + createdAt: string; + finishedAt?: string; + recipientKey: MoveRecipientKey; + /** @minimum 1 */ + maxBundleBytes: number; + /** @minimum 1 */ + maxPartBytes: number; + /** The bundle's parts, from its manifest, once part 1 arrived. */ + expectedParts?: BundlePart[]; + /** + * The numbers of the parts that arrived. + * @items.minimum 1 + */ + receivedParts: number[]; + /** Everything the bundle holds by kind, from its manifest, once part 1 arrived. */ + expected?: MoveCount[]; + /** What has been imported so far by kind, while importing and once imported. Items a repeated import found already here count as imported. */ + imported?: MoveCount[]; + notes?: MoveNote[]; + /** The apps to connect again here, once part 1 arrived. */ + reconnect?: ReconnectApp[]; + /** + * What went wrong, when failed, in a sentence a person reads. + * @minLength 1 + */ + error?: string; +} diff --git a/app/src/lib/api/generated/model/importBundleRefusedResponse.ts b/app/src/lib/api/generated/model/importBundleRefusedResponse.ts new file mode 100644 index 0000000000..cc13a01a89 --- /dev/null +++ b/app/src/lib/api/generated/model/importBundleRefusedResponse.ts @@ -0,0 +1,9 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { Problem } from "./problem"; + +/** + * Part 1 isn't a bundle this OpenBot reads: not a bundle at all, a format newer than it reads (IMPORT_FORMAT_UNSUPPORTED), larger than maxBundleBytes, or a model key sealed to another import's key. + */ +export type ImportBundleRefusedResponse = Problem; diff --git a/app/src/lib/api/generated/model/importConflictResponse.ts b/app/src/lib/api/generated/model/importConflictResponse.ts new file mode 100644 index 0000000000..a8a863b910 --- /dev/null +++ b/app/src/lib/api/generated/model/importConflictResponse.ts @@ -0,0 +1,9 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { Problem } from "./problem"; + +/** + * The import can't do that in its state: a part doesn't match the manifest (IMPORT_PART_MISMATCH), part 1 hasn't arrived (IMPORT_MANIFEST_MISSING), a part is missing (IMPORT_INCOMPLETE), the import hasn't finished (IMPORT_NOT_FINISHED), or the Idempotency-Key was used for a different request. + */ +export type ImportConflictResponse = Problem; diff --git a/app/src/lib/api/generated/model/importInput.ts b/app/src/lib/api/generated/model/importInput.ts new file mode 100644 index 0000000000..db905e0e3e --- /dev/null +++ b/app/src/lib/api/generated/model/importInput.ts @@ -0,0 +1,12 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ + +export interface ImportInput { + /** + * A name for where the bundle comes from, such as the computer's name, shown in the list of imports. + * @minLength 1 + * @maxLength 200 + */ + sourceName?: string; +} diff --git a/app/src/lib/api/generated/model/importNotFoundResponse.ts b/app/src/lib/api/generated/model/importNotFoundResponse.ts new file mode 100644 index 0000000000..b9a4afbf41 --- /dev/null +++ b/app/src/lib/api/generated/model/importNotFoundResponse.ts @@ -0,0 +1,9 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { Problem } from "./problem"; + +/** + * The import doesn't exist, or isn't the caller's. + */ +export type ImportNotFoundResponse = Problem; diff --git a/app/src/lib/api/generated/model/importPage.ts b/app/src/lib/api/generated/model/importPage.ts new file mode 100644 index 0000000000..592b9cdc07 --- /dev/null +++ b/app/src/lib/api/generated/model/importPage.ts @@ -0,0 +1,10 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { Import } from "./import"; + +export interface ImportPage { + items: Import[]; + /** @nullable */ + nextCursor: string | null; +} diff --git a/app/src/lib/api/generated/model/importVerification.ts b/app/src/lib/api/generated/model/importVerification.ts new file mode 100644 index 0000000000..d1eaff0ba9 --- /dev/null +++ b/app/src/lib/api/generated/model/importVerification.ts @@ -0,0 +1,16 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { ImportVerificationKind } from "./importVerificationKind"; +import type { MoveNote } from "./moveNote"; +import type { ReconnectApp } from "./reconnectApp"; + +export interface ImportVerification { + /** @minLength 1 */ + importId: string; + /** True when, for every kind, found plus leftOut is expected. */ + matches: boolean; + kinds: ImportVerificationKind[]; + notes: MoveNote[]; + reconnect: ReconnectApp[]; +} diff --git a/app/src/lib/api/generated/model/importVerificationKind.ts b/app/src/lib/api/generated/model/importVerificationKind.ts new file mode 100644 index 0000000000..bc39dc25a1 --- /dev/null +++ b/app/src/lib/api/generated/model/importVerificationKind.ts @@ -0,0 +1,23 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { MoveKind } from "./moveKind"; + +export interface ImportVerificationKind { + kind: MoveKind; + /** + * How many the bundle held. + * @minimum 0 + */ + expected: number; + /** + * How many from this OpenBot are in this organization now. + * @minimum 0 + */ + found: number; + /** + * How many OpenBot Cloud left out on purpose, as the notes say. + * @minimum 0 + */ + leftOut: number; +} diff --git a/app/src/lib/api/generated/model/index.ts b/app/src/lib/api/generated/model/index.ts index 8f4f5a3997..d26205f887 100644 --- a/app/src/lib/api/generated/model/index.ts +++ b/app/src/lib/api/generated/model/index.ts @@ -75,6 +75,7 @@ export * from "./appDirectoryUnavailableResponse"; export * from "./appError"; export * from "./appErrorSource"; export * from "./appErrorSurface"; +export * from "./applyImportHeaders"; export * from "./appNotFoundResponse"; export * from "./appOAuthClientRequest"; export * from "./appOrTeamNotFoundResponse"; @@ -375,6 +376,7 @@ export * from "./browserUnavailableResponse"; export * from "./browserUnfinishedResponse"; export * from "./browserUnreachableResponse"; export * from "./browserWindow"; +export * from "./bundlePart"; export * from "./callComponentFunctionHeaders"; export * from "./cancelComputerControlHeaders"; export * from "./cancelFollowUpHeaders"; @@ -618,6 +620,7 @@ export * from "./createConversationRequest"; export * from "./createConversationThreadHeaders"; export * from "./createCredentialHeaders"; export * from "./createdApiKey"; +export * from "./createExportHeaders"; export * from "./createGithubEventSourceHeaders"; export * from "./createGithubEventSourceRequest"; export * from "./createGoalHeaders"; @@ -628,6 +631,7 @@ export * from "./createHostAccessGrantHeaders"; export * from "./createHostAccessGrantRequest"; export * from "./createIdentityProviderHeaders"; export * from "./createIdentityProviderRequest"; +export * from "./createImportHeaders"; export * from "./createMemoryHeaders"; export * from "./createMemoryRequest"; export * from "./createMemorySourceHeaders"; @@ -685,6 +689,7 @@ export * from "./deleteConversationParams"; export * from "./deleteCurrentRecorderConnectionHeaders"; export * from "./deleteDestinationHeaders"; export * from "./deleteDeviceHeaders"; +export * from "./deleteExportHeaders"; export * from "./deleteGithubEventSourceHeaders"; export * from "./deleteGoalHeaders"; export * from "./deleteGoalTriggerHeaders"; @@ -737,6 +742,7 @@ export * from "./disconnectSharedAppHeaders"; export * from "./dismissAppAccessRequestHeaders"; export * from "./dismissCheckInItemHeaders"; export * from "./dismissQuestionHeaders"; +export * from "./downloadExportPartHeaders"; export * from "./duplicateBotHeaders"; export * from "./egressRule"; export * from "./egressRuleType"; @@ -745,7 +751,12 @@ export * from "./emailTriggerConfigKind"; export * from "./enableGoalTriggerHeaders"; export * from "./exchangeRecorderConnectCodeHeaders"; export * from "./exchangeRecorderConnectCodeRequest"; +export * from "./export"; export * from "./exportAuditEventsParams"; +export * from "./exportEstimate"; +export * from "./exportInput"; +export * from "./exportNotFoundResponse"; +export * from "./exportNotReadyResponse"; export * from "./finishSignInHeaders"; export * from "./followUpCancelled"; export * from "./followUpNotFoundResponse"; @@ -822,6 +833,14 @@ export * from "./identityProviderProtocol"; export * from "./identityProviderRemovalConflictResponse"; export * from "./identityProviderResponse"; export * from "./identityProviderText"; +export * from "./import"; +export * from "./importBundleRefusedResponse"; +export * from "./importConflictResponse"; +export * from "./importInput"; +export * from "./importNotFoundResponse"; +export * from "./importPage"; +export * from "./importVerification"; +export * from "./importVerificationKind"; export * from "./inactiveComputersStopped"; export * from "./invalidAiConnectionResponse"; export * from "./invalidAppChangeResponse"; @@ -977,6 +996,7 @@ export * from "./listGoalRunsParams"; export * from "./listGoalsParams"; export * from "./listGoalTriggersParams"; export * from "./listIdentityProvidersParams"; +export * from "./listImportsParams"; export * from "./listInvitationsParams"; export * from "./listLearningProposalsParams"; export * from "./listLinkedAccountProvidersParams"; @@ -1057,6 +1077,11 @@ export * from "./modelOption"; export * from "./modelUsage"; export * from "./modelUsageRecentItem"; export * from "./modelUsageSummaryItem"; +export * from "./moveCount"; +export * from "./moveKind"; +export * from "./moveNote"; +export * from "./moveRecipientKey"; +export * from "./moveUnavailableResponse"; export * from "./narrateInBotBrowserHeaders"; export * from "./narrateInPersonBrowserHeaders"; export * from "./navigateBotBrowserHeaders"; @@ -1191,12 +1216,14 @@ export * from "./questionAnswer"; export * from "./questionNotFoundResponse"; export * from "./questionPage"; export * from "./questionPart"; +export * from "./rangeNotSatisfiableResponse"; export * from "./reaction"; export * from "./reactionPage"; export * from "./readComputerFileHeaders"; export * from "./realBrowser"; export * from "./recheckConnectionHeaders"; export * from "./recheckSharedConnectionHeaders"; +export * from "./reconnectApp"; export * from "./recordAppErrorHeaders"; export * from "./recordConversationActivityHeaders"; export * from "./recorderActivity"; @@ -1476,6 +1503,7 @@ export * from "./teamRole"; export * from "./teamSource"; export * from "./testBotConnectionHeaders"; export * from "./textMessagesUnavailableResponse"; +export * from "./tooManyMovesResponse"; export * from "./tooManyPendingRequestsResponse"; export * from "./tooManyRecorderConnectCodesResponse"; export * from "./tooManyRequestsResponse"; @@ -1561,6 +1589,7 @@ export * from "./updateStandingInstructionsHeaders"; export * from "./updateTeamHeaders"; export * from "./updateTeamRequest"; export * from "./uploadConversationAttachmentHeaders"; +export * from "./uploadImportPartHeaders"; export * from "./useSavedLoginHeaders"; export * from "./useSavedLoginRequest"; export * from "./verifyPhoneDestinationHeaders"; diff --git a/app/src/lib/api/generated/model/listImportsParams.ts b/app/src/lib/api/generated/model/listImportsParams.ts new file mode 100644 index 0000000000..b401fc1812 --- /dev/null +++ b/app/src/lib/api/generated/model/listImportsParams.ts @@ -0,0 +1,21 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { CursorParameter } from "./cursorParameter"; +import type { LimitParameter } from "./limitParameter"; + +export type ListImportsParams = { + /** + * Most items in one page. + * @minimum 1 + * @maximum 100 + */ + limit?: LimitParameter; + /** + * Opaque continuation from the previous page's nextCursor, bound to the organization and the filters that made it. The server only ever issues cursors written in URL-safe base64 (letters, digits, - and _, no padding) and refuses anything else, so the pattern says so. A cursor that fits the pattern can still be refused: one this list never gave out, or one made for another organization or other filters. + * @minLength 1 + * @maxLength 4096 + * @pattern ^[A-Za-z0-9_-]+$ + */ + cursor?: CursorParameter; +}; diff --git a/app/src/lib/api/generated/model/moveCount.ts b/app/src/lib/api/generated/model/moveCount.ts new file mode 100644 index 0000000000..c92b43f0e8 --- /dev/null +++ b/app/src/lib/api/generated/model/moveCount.ts @@ -0,0 +1,10 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { MoveKind } from "./moveKind"; + +export interface MoveCount { + kind: MoveKind; + /** @minimum 0 */ + count: number; +} diff --git a/app/src/lib/api/generated/model/moveKind.ts b/app/src/lib/api/generated/model/moveKind.ts new file mode 100644 index 0000000000..f6975660d2 --- /dev/null +++ b/app/src/lib/api/generated/model/moveKind.ts @@ -0,0 +1,8 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ + +/** + * A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other. + */ +export type MoveKind = string; diff --git a/app/src/lib/api/generated/model/moveNote.ts b/app/src/lib/api/generated/model/moveNote.ts new file mode 100644 index 0000000000..84c73bad89 --- /dev/null +++ b/app/src/lib/api/generated/model/moveNote.ts @@ -0,0 +1,22 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { MoveKind } from "./moveKind"; + +/** + * Something that moved differently, or not at all, and why, in a sentence a person reads. + */ +export interface MoveNote { + /** isolated-bot-made-ordinary: OpenBot Cloud has no isolated computers, so a Bot that had one runs on an ordinary one. business-plan-feature-left-out: the feature needs the Business plan and this organization isn't on it. model-key-kept-existing: the person already had an AI connection here, which was kept. model-key-not-brought: the person chose not to bring a model key. item-skipped: one item couldn't be imported; message says which and why. A later OpenBot may add a code; show the message. */ + code: string; + kind?: MoveKind; + /** + * How many items the note is about. + * @minimum 1 + */ + count?: number; + /** @minLength 1 */ + message: string; + /** The names of the items, such as the Bots, when there are a few. */ + items?: string[]; +} diff --git a/app/src/lib/api/generated/model/moveRecipientKey.ts b/app/src/lib/api/generated/model/moveRecipientKey.ts new file mode 100644 index 0000000000..b58fb1c2fc --- /dev/null +++ b/app/src/lib/api/generated/model/moveRecipientKey.ts @@ -0,0 +1,26 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ + +/** + * A public key as a JSON Web Key (RFC 7517): RSA, 4096 bits, for RSA-OAEP-256. A model key is sealed to it as a JWE (RFC 7516, RSA-OAEP-256 with A256GCM), so only the import that made it reads it. + */ +export interface MoveRecipientKey { + kty: "RSA"; + /** + * @minLength 1 + * @maxLength 1024 + */ + n: string; + /** + * @minLength 1 + * @maxLength 16 + */ + e: string; + alg: "RSA-OAEP-256"; + /** + * @minLength 1 + * @maxLength 128 + */ + kid: string; +} diff --git a/app/src/lib/api/generated/model/moveUnavailableResponse.ts b/app/src/lib/api/generated/model/moveUnavailableResponse.ts new file mode 100644 index 0000000000..847a116918 --- /dev/null +++ b/app/src/lib/api/generated/model/moveUnavailableResponse.ts @@ -0,0 +1,9 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { Problem } from "./problem"; + +/** + * Moving isn't served here: exports only by an OpenBot on the person's own computer, imports only by OpenBot Cloud. + */ +export type MoveUnavailableResponse = Problem; diff --git a/app/src/lib/api/generated/model/rangeNotSatisfiableResponse.ts b/app/src/lib/api/generated/model/rangeNotSatisfiableResponse.ts new file mode 100644 index 0000000000..eec0d867a3 --- /dev/null +++ b/app/src/lib/api/generated/model/rangeNotSatisfiableResponse.ts @@ -0,0 +1,9 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { Problem } from "./problem"; + +/** + * The Range asked for lies outside the part. + */ +export type RangeNotSatisfiableResponse = Problem; diff --git a/app/src/lib/api/generated/model/reconnectApp.ts b/app/src/lib/api/generated/model/reconnectApp.ts new file mode 100644 index 0000000000..2e5e867a57 --- /dev/null +++ b/app/src/lib/api/generated/model/reconnectApp.ts @@ -0,0 +1,28 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ + +/** + * A connection to an app that doesn't move, because its sign-in stays on the person's computer: the person connects it again on OpenBot Cloud. Never carries a token, a password or a key. + */ +export interface ReconnectApp { + /** + * The app's id in the app directory, such as gmail or slack. + * @minLength 1 + */ + appId: string; + /** + * The app's name as a person reads it. + * @minLength 1 + */ + appName: string; + /** + * Which account it was connected as, such as an email address or a workspace name, when known. + * @minLength 1 + */ + accountLabel?: string; + /** The app's icon, when the directory has one. */ + iconUrl?: string; + /** The Bots that used it, so the person knows which to check. */ + botNames?: string[]; +} diff --git a/app/src/lib/api/generated/model/tooManyMovesResponse.ts b/app/src/lib/api/generated/model/tooManyMovesResponse.ts new file mode 100644 index 0000000000..e8b52143ab --- /dev/null +++ b/app/src/lib/api/generated/model/tooManyMovesResponse.ts @@ -0,0 +1,9 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { Problem } from "./problem"; + +/** + * Too many exports, imports or parts at once for one person. + */ +export type TooManyMovesResponse = Problem; diff --git a/app/src/lib/api/generated/model/uploadImportPartHeaders.ts b/app/src/lib/api/generated/model/uploadImportPartHeaders.ts new file mode 100644 index 0000000000..c8826eb16f --- /dev/null +++ b/app/src/lib/api/generated/model/uploadImportPartHeaders.ts @@ -0,0 +1,13 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import type { IdempotencyKeyParameter } from "./idempotencyKeyParameter"; + +export type UploadImportPartHeaders = { + /** + * Generated by the caller for each write it means to make once. Reuse the same key and the same request for 24 hours after an uncertain response; the same key with a different request is a conflict. + * @minLength 1 + * @maxLength 128 + */ + "Idempotency-Key": IdempotencyKeyParameter; +}; diff --git a/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.msw.ts b/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.msw.ts new file mode 100644 index 0000000000..35eb236e46 --- /dev/null +++ b/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.msw.ts @@ -0,0 +1,821 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import { faker } from "@faker-js/faker"; + +import { HttpResponse, http } from "msw"; +import type { HttpResponseResolver, RequestHandlerOptions } from "msw"; + +import type { + Export, + ExportEstimate, + ExportInput, + Import, + ImportInput, + ImportPage, + ImportVerification, +} from "../model"; + +export const getGetExportEstimateResponseMock = (): ExportEstimate => ({ + counts: [ + { kind: "bots", count: 4 }, + { kind: "skills", count: 9 }, + { kind: "conversations", count: 37 }, + { kind: "messages", count: 2814 }, + { kind: "memories", count: 52 }, + { kind: "routines", count: 3 }, + { kind: "goals", count: 1 }, + { kind: "check-ins", count: 2 }, + { kind: "files", count: 64 }, + { kind: "settings", count: 1 }, + ], + estimatedBytes: 187432960, + storedBytes: 1288490188, + reconnect: [ + { + appId: "gmail", + appName: "Gmail", + accountLabel: "sam@example.com", + botNames: ["Inbox helper"], + }, + { + appId: "slack", + appName: "Slack", + accountLabel: "Example workspace", + botNames: ["Inbox helper", "Standup"], + }, + ], + modelKeysAvailable: true, +}); + +export const getCreateExportResponseMock = (): Export => ({ + id: "exp_7d1f2c3b8a4e4b5f", + status: "preparing", + createdAt: "2026-11-21T10:00:00Z", + expiresAt: "2026-11-28T10:00:00Z", + includesModelKeys: true, + progress: 0.4, +}); + +export const getGetExportResponseMock = (): Export => ({ + id: "exp_7d1f2c3b8a4e4b5f", + status: "preparing", + createdAt: "2026-11-21T10:00:00Z", + expiresAt: "2026-11-28T10:00:00Z", + includesModelKeys: true, + progress: 0.4, +}); + +export const getDownloadExportPartResponseMock = (): Blob => + faker.helpers.arrayElement([ + new Blob([new Uint8Array(faker.number.int({ min: 1, max: 64 }))]), + new Blob([new Uint8Array(faker.number.int({ min: 1, max: 64 }))]), + ]); + +export const getCreateImportResponseMock = (): Import => ({ + id: "imp_0e1f2a3b4c5d6f1d", + status: "waiting-for-bundle", + sourceName: "Sam's MacBook", + createdAt: "2026-11-21T10:00:00Z", + recipientKey: { + kty: "RSA", + alg: "RSA-OAEP-256", + kid: "imp_0e1f2a3b4c5d6f1d", + e: "AQAB", + n: "0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw", + }, + maxBundleBytes: 10737418240, + maxPartBytes: 33554432, + receivedParts: [], +}); + +export const getListImportsResponseMock = ( + overrideResponse: Partial> = {}, +): ImportPage => ({ + items: Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => ({ + id: faker.string.alpha({ length: { min: 1, max: 20 } }), + status: faker.string.alpha({ length: { min: 10, max: 20 } }), + sourceName: faker.helpers.arrayElement([ + faker.string.alpha({ length: { min: 10, max: 20 } }), + undefined, + ]), + createdAt: faker.date.past().toISOString().slice(0, 19) + "Z", + finishedAt: faker.helpers.arrayElement([ + faker.date.past().toISOString().slice(0, 19) + "Z", + undefined, + ]), + recipientKey: { + kty: "RSA", + n: faker.string.alpha({ length: { min: 1, max: 1024 } }), + e: faker.string.alpha({ length: { min: 1, max: 16 } }), + alg: "RSA-OAEP-256", + kid: faker.string.alpha({ length: { min: 1, max: 128 } }), + }, + maxBundleBytes: faker.number.int({ min: 1 }), + maxPartBytes: faker.number.int({ min: 1 }), + expectedParts: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => ({ + number: faker.number.int({ min: 1 }), + bytes: faker.number.int({ min: 1 }), + sha256: faker.helpers.fromRegExp("^[0-9a-f]{64}$"), + })), + undefined, + ]), + receivedParts: Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => faker.number.int({ min: 1 })), + expected: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => ({ + kind: faker.string.alpha({ length: { min: 10, max: 20 } }), + count: faker.number.int({ min: 0 }), + })), + undefined, + ]), + imported: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => ({ + kind: faker.string.alpha({ length: { min: 10, max: 20 } }), + count: faker.number.int({ min: 0 }), + })), + undefined, + ]), + notes: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => ({ + code: faker.string.alpha({ length: { min: 10, max: 20 } }), + kind: faker.helpers.arrayElement([ + faker.string.alpha({ length: { min: 10, max: 20 } }), + undefined, + ]), + count: faker.helpers.arrayElement([ + faker.number.int({ min: 1 }), + undefined, + ]), + message: faker.string.alpha({ length: { min: 1, max: 20 } }), + items: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => faker.string.alpha({ length: { min: 10, max: 20 } })), + undefined, + ]), + })), + undefined, + ]), + reconnect: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => ({ + appId: faker.string.alpha({ length: { min: 1, max: 20 } }), + appName: faker.string.alpha({ length: { min: 1, max: 20 } }), + accountLabel: faker.helpers.arrayElement([ + faker.string.alpha({ length: { min: 1, max: 20 } }), + undefined, + ]), + iconUrl: faker.helpers.arrayElement([faker.internet.url(), undefined]), + botNames: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => faker.string.alpha({ length: { min: 10, max: 20 } })), + undefined, + ]), + })), + undefined, + ]), + error: faker.helpers.arrayElement([ + faker.string.alpha({ length: { min: 1, max: 20 } }), + undefined, + ]), + })), + nextCursor: faker.helpers.arrayElement([ + faker.string.alpha({ length: { min: 10, max: 20 } }), + null, + ]), + ...overrideResponse, +}); + +export const getGetImportResponseMock = (): Import => ({ + id: "imp_0e1f2a3b4c5d6f1d", + status: "waiting-for-bundle", + sourceName: "Sam's MacBook", + createdAt: "2026-11-21T10:00:00Z", + recipientKey: { + kty: "RSA", + alg: "RSA-OAEP-256", + kid: "imp_0e1f2a3b4c5d6f1d", + e: "AQAB", + n: "0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw", + }, + maxBundleBytes: 10737418240, + maxPartBytes: 33554432, + receivedParts: [], +}); + +export const getUploadImportPartResponseMock = ( + overrideResponse: Partial> = {}, +): Import => ({ + id: faker.string.alpha({ length: { min: 1, max: 20 } }), + status: faker.string.alpha({ length: { min: 10, max: 20 } }), + sourceName: faker.helpers.arrayElement([ + faker.string.alpha({ length: { min: 10, max: 20 } }), + undefined, + ]), + createdAt: faker.date.past().toISOString().slice(0, 19) + "Z", + finishedAt: faker.helpers.arrayElement([ + faker.date.past().toISOString().slice(0, 19) + "Z", + undefined, + ]), + recipientKey: { + kty: "RSA", + n: faker.string.alpha({ length: { min: 1, max: 1024 } }), + e: faker.string.alpha({ length: { min: 1, max: 16 } }), + alg: "RSA-OAEP-256", + kid: faker.string.alpha({ length: { min: 1, max: 128 } }), + }, + maxBundleBytes: faker.number.int({ min: 1 }), + maxPartBytes: faker.number.int({ min: 1 }), + expectedParts: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => ({ + number: faker.number.int({ min: 1 }), + bytes: faker.number.int({ min: 1 }), + sha256: faker.helpers.fromRegExp("^[0-9a-f]{64}$"), + })), + undefined, + ]), + receivedParts: Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => faker.number.int({ min: 1 })), + expected: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => ({ + kind: faker.string.alpha({ length: { min: 10, max: 20 } }), + count: faker.number.int({ min: 0 }), + })), + undefined, + ]), + imported: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => ({ + kind: faker.string.alpha({ length: { min: 10, max: 20 } }), + count: faker.number.int({ min: 0 }), + })), + undefined, + ]), + notes: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => ({ + code: faker.string.alpha({ length: { min: 10, max: 20 } }), + kind: faker.helpers.arrayElement([ + faker.string.alpha({ length: { min: 10, max: 20 } }), + undefined, + ]), + count: faker.helpers.arrayElement([ + faker.number.int({ min: 1 }), + undefined, + ]), + message: faker.string.alpha({ length: { min: 1, max: 20 } }), + items: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => faker.string.alpha({ length: { min: 10, max: 20 } })), + undefined, + ]), + })), + undefined, + ]), + reconnect: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => ({ + appId: faker.string.alpha({ length: { min: 1, max: 20 } }), + appName: faker.string.alpha({ length: { min: 1, max: 20 } }), + accountLabel: faker.helpers.arrayElement([ + faker.string.alpha({ length: { min: 1, max: 20 } }), + undefined, + ]), + iconUrl: faker.helpers.arrayElement([faker.internet.url(), undefined]), + botNames: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => faker.string.alpha({ length: { min: 10, max: 20 } })), + undefined, + ]), + })), + undefined, + ]), + error: faker.helpers.arrayElement([ + faker.string.alpha({ length: { min: 1, max: 20 } }), + undefined, + ]), + ...overrideResponse, +}); + +export const getApplyImportResponseMock = ( + overrideResponse: Partial> = {}, +): Import => ({ + id: faker.string.alpha({ length: { min: 1, max: 20 } }), + status: faker.string.alpha({ length: { min: 10, max: 20 } }), + sourceName: faker.helpers.arrayElement([ + faker.string.alpha({ length: { min: 10, max: 20 } }), + undefined, + ]), + createdAt: faker.date.past().toISOString().slice(0, 19) + "Z", + finishedAt: faker.helpers.arrayElement([ + faker.date.past().toISOString().slice(0, 19) + "Z", + undefined, + ]), + recipientKey: { + kty: "RSA", + n: faker.string.alpha({ length: { min: 1, max: 1024 } }), + e: faker.string.alpha({ length: { min: 1, max: 16 } }), + alg: "RSA-OAEP-256", + kid: faker.string.alpha({ length: { min: 1, max: 128 } }), + }, + maxBundleBytes: faker.number.int({ min: 1 }), + maxPartBytes: faker.number.int({ min: 1 }), + expectedParts: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => ({ + number: faker.number.int({ min: 1 }), + bytes: faker.number.int({ min: 1 }), + sha256: faker.helpers.fromRegExp("^[0-9a-f]{64}$"), + })), + undefined, + ]), + receivedParts: Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => faker.number.int({ min: 1 })), + expected: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => ({ + kind: faker.string.alpha({ length: { min: 10, max: 20 } }), + count: faker.number.int({ min: 0 }), + })), + undefined, + ]), + imported: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => ({ + kind: faker.string.alpha({ length: { min: 10, max: 20 } }), + count: faker.number.int({ min: 0 }), + })), + undefined, + ]), + notes: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => ({ + code: faker.string.alpha({ length: { min: 10, max: 20 } }), + kind: faker.helpers.arrayElement([ + faker.string.alpha({ length: { min: 10, max: 20 } }), + undefined, + ]), + count: faker.helpers.arrayElement([ + faker.number.int({ min: 1 }), + undefined, + ]), + message: faker.string.alpha({ length: { min: 1, max: 20 } }), + items: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => faker.string.alpha({ length: { min: 10, max: 20 } })), + undefined, + ]), + })), + undefined, + ]), + reconnect: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => ({ + appId: faker.string.alpha({ length: { min: 1, max: 20 } }), + appName: faker.string.alpha({ length: { min: 1, max: 20 } }), + accountLabel: faker.helpers.arrayElement([ + faker.string.alpha({ length: { min: 1, max: 20 } }), + undefined, + ]), + iconUrl: faker.helpers.arrayElement([faker.internet.url(), undefined]), + botNames: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1, + ).map(() => faker.string.alpha({ length: { min: 10, max: 20 } })), + undefined, + ]), + })), + undefined, + ]), + error: faker.helpers.arrayElement([ + faker.string.alpha({ length: { min: 1, max: 20 } }), + undefined, + ]), + ...overrideResponse, +}); + +export const getGetImportVerificationResponseMock = (): ImportVerification => ({ + importId: "imp_0e1f2a3b4c5d6f1d", + matches: true, + kinds: [ + { kind: "bots", expected: 4, found: 4, leftOut: 0 }, + { kind: "conversations", expected: 37, found: 37, leftOut: 0 }, + { kind: "messages", expected: 2814, found: 2814, leftOut: 0 }, + ], + notes: [], + reconnect: [ + { appId: "gmail", appName: "Gmail", accountLabel: "sam@example.com" }, + ], +}); + +export const getGetExportEstimateMockHandler = ( + overrideResponse?: + | ExportEstimate + | (( + info: Parameters>[0], + ) => Promise | ExportEstimate), + options?: RequestHandlerOptions, +) => { + return http.get<{ organizationId: string }>( + "*/api/v2/organizations/:organizationId/export-estimate", + async ( + info: Parameters>[0], + ) => { + return HttpResponse.json( + overrideResponse !== undefined + ? typeof overrideResponse === "function" + ? await overrideResponse(info) + : overrideResponse + : getGetExportEstimateResponseMock(), + { status: 200 }, + ); + }, + options, + ); +}; + +export const getCreateExportMockHandler = ( + overrideResponse?: + | Export + | (( + info: Parameters< + HttpResponseResolver<{ organizationId: string }, ExportInput> + >[0], + ) => Promise | Export), + options?: RequestHandlerOptions, +) => { + return http.post<{ organizationId: string }, ExportInput>( + "*/api/v2/organizations/:organizationId/exports", + async ( + info: Parameters< + HttpResponseResolver<{ organizationId: string }, ExportInput> + >[0], + ) => { + return HttpResponse.json( + overrideResponse !== undefined + ? typeof overrideResponse === "function" + ? await overrideResponse(info) + : overrideResponse + : getCreateExportResponseMock(), + { status: 202 }, + ); + }, + options, + ); +}; + +export const getGetExportMockHandler = ( + overrideResponse?: + | Export + | (( + info: Parameters< + HttpResponseResolver<{ organizationId: string; exportId: string }> + >[0], + ) => Promise | Export), + options?: RequestHandlerOptions, +) => { + return http.get<{ organizationId: string; exportId: string }>( + "*/api/v2/organizations/:organizationId/exports/:exportId", + async ( + info: Parameters< + HttpResponseResolver<{ organizationId: string; exportId: string }> + >[0], + ) => { + return HttpResponse.json( + overrideResponse !== undefined + ? typeof overrideResponse === "function" + ? await overrideResponse(info) + : overrideResponse + : getGetExportResponseMock(), + { status: 200 }, + ); + }, + options, + ); +}; + +export const getDeleteExportMockHandler = ( + overrideResponse?: + | void + | (( + info: Parameters< + HttpResponseResolver<{ organizationId: string; exportId: string }> + >[0], + ) => Promise | void), + options?: RequestHandlerOptions, +) => { + return http.delete<{ organizationId: string; exportId: string }>( + "*/api/v2/organizations/:organizationId/exports/:exportId", + async ( + info: Parameters< + HttpResponseResolver<{ organizationId: string; exportId: string }> + >[0], + ) => { + if (typeof overrideResponse === "function") { + await overrideResponse(info); + } + + return new HttpResponse(null, { status: 204 }); + }, + options, + ); +}; + +export const getDownloadExportPartMockHandler = ( + overrideResponse?: + | Blob + | (( + info: Parameters< + HttpResponseResolver<{ + organizationId: string; + exportId: string; + partNumber: string; + }> + >[0], + ) => Promise | Blob), + options?: RequestHandlerOptions, +) => { + return http.get<{ + organizationId: string; + exportId: string; + partNumber: string; + }>( + "*/api/v2/organizations/:organizationId/exports/:exportId/parts/:partNumber", + async ( + info: Parameters< + HttpResponseResolver<{ + organizationId: string; + exportId: string; + partNumber: string; + }> + >[0], + ) => { + const binaryBody = + overrideResponse !== undefined + ? typeof overrideResponse === "function" + ? await overrideResponse(info) + : overrideResponse + : getDownloadExportPartResponseMock(); + return new HttpResponse(binaryBody, { + status: 200, + headers: { "Content-Type": "application/octet-stream" }, + }); + }, + options, + ); +}; + +export const getCreateImportMockHandler = ( + overrideResponse?: + | Import + | (( + info: Parameters< + HttpResponseResolver<{ organizationId: string }, ImportInput> + >[0], + ) => Promise | Import), + options?: RequestHandlerOptions, +) => { + return http.post<{ organizationId: string }, ImportInput>( + "*/api/v2/organizations/:organizationId/imports", + async ( + info: Parameters< + HttpResponseResolver<{ organizationId: string }, ImportInput> + >[0], + ) => { + return HttpResponse.json( + overrideResponse !== undefined + ? typeof overrideResponse === "function" + ? await overrideResponse(info) + : overrideResponse + : getCreateImportResponseMock(), + { status: 201 }, + ); + }, + options, + ); +}; + +export const getListImportsMockHandler = ( + overrideResponse?: + | ImportPage + | (( + info: Parameters>[0], + ) => Promise | ImportPage), + options?: RequestHandlerOptions, +) => { + return http.get<{ organizationId: string }>( + "*/api/v2/organizations/:organizationId/imports", + async ( + info: Parameters>[0], + ) => { + return HttpResponse.json( + overrideResponse !== undefined + ? typeof overrideResponse === "function" + ? await overrideResponse(info) + : overrideResponse + : getListImportsResponseMock(), + { status: 200 }, + ); + }, + options, + ); +}; + +export const getGetImportMockHandler = ( + overrideResponse?: + | Import + | (( + info: Parameters< + HttpResponseResolver<{ organizationId: string; importId: string }> + >[0], + ) => Promise | Import), + options?: RequestHandlerOptions, +) => { + return http.get<{ organizationId: string; importId: string }>( + "*/api/v2/organizations/:organizationId/imports/:importId", + async ( + info: Parameters< + HttpResponseResolver<{ organizationId: string; importId: string }> + >[0], + ) => { + return HttpResponse.json( + overrideResponse !== undefined + ? typeof overrideResponse === "function" + ? await overrideResponse(info) + : overrideResponse + : getGetImportResponseMock(), + { status: 200 }, + ); + }, + options, + ); +}; + +export const getUploadImportPartMockHandler = ( + overrideResponse?: + | Import + | (( + info: Parameters< + HttpResponseResolver< + { organizationId: string; importId: string; partNumber: string }, + Blob + > + >[0], + ) => Promise | Import), + options?: RequestHandlerOptions, +) => { + return http.put< + { organizationId: string; importId: string; partNumber: string }, + Blob + >( + "*/api/v2/organizations/:organizationId/imports/:importId/parts/:partNumber", + async ( + info: Parameters< + HttpResponseResolver< + { organizationId: string; importId: string; partNumber: string }, + Blob + > + >[0], + ) => { + return HttpResponse.json( + overrideResponse !== undefined + ? typeof overrideResponse === "function" + ? await overrideResponse(info) + : overrideResponse + : getUploadImportPartResponseMock(), + { status: 200 }, + ); + }, + options, + ); +}; + +export const getApplyImportMockHandler = ( + overrideResponse?: + | Import + | (( + info: Parameters< + HttpResponseResolver<{ organizationId: string; importId: string }> + >[0], + ) => Promise | Import), + options?: RequestHandlerOptions, +) => { + return http.post<{ organizationId: string; importId: string }>( + "*/api/v2/organizations/:organizationId/imports/:importId/apply", + async ( + info: Parameters< + HttpResponseResolver<{ organizationId: string; importId: string }> + >[0], + ) => { + return HttpResponse.json( + overrideResponse !== undefined + ? typeof overrideResponse === "function" + ? await overrideResponse(info) + : overrideResponse + : getApplyImportResponseMock(), + { status: 202 }, + ); + }, + options, + ); +}; + +export const getGetImportVerificationMockHandler = ( + overrideResponse?: + | ImportVerification + | (( + info: Parameters< + HttpResponseResolver<{ organizationId: string; importId: string }> + >[0], + ) => Promise | ImportVerification), + options?: RequestHandlerOptions, +) => { + return http.get<{ organizationId: string; importId: string }>( + "*/api/v2/organizations/:organizationId/imports/:importId/verification", + async ( + info: Parameters< + HttpResponseResolver<{ organizationId: string; importId: string }> + >[0], + ) => { + return HttpResponse.json( + overrideResponse !== undefined + ? typeof overrideResponse === "function" + ? await overrideResponse(info) + : overrideResponse + : getGetImportVerificationResponseMock(), + { status: 200 }, + ); + }, + options, + ); +}; +export const getMovingToOpenbotCloudMock = () => [ + getGetExportEstimateMockHandler(), + getCreateExportMockHandler(), + getGetExportMockHandler(), + getDeleteExportMockHandler(), + getDownloadExportPartMockHandler(), + getCreateImportMockHandler(), + getListImportsMockHandler(), + getGetImportMockHandler(), + getUploadImportPartMockHandler(), + getApplyImportMockHandler(), + getGetImportVerificationMockHandler(), +]; diff --git a/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.ts b/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.ts new file mode 100644 index 0000000000..d1165b3eea --- /dev/null +++ b/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.ts @@ -0,0 +1,2104 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import { useMutation, useQuery } from "@tanstack/react-query"; +import type { + DataTag, + DefinedInitialDataOptions, + DefinedUseQueryResult, + MutationFunction, + QueryClient, + QueryFunction, + QueryKey, + UndefinedInitialDataOptions, + UseMutationOptions, + UseMutationResult, + UseQueryOptions, + UseQueryResult, +} from "@tanstack/react-query"; + +import type { + ApplyImportHeaders, + CreateExportHeaders, + CreateImportHeaders, + DeleteExportHeaders, + DownloadExportPartHeaders, + Export, + ExportEstimate, + ExportInput, + ExportNotFoundResponse, + ExportNotReadyResponse, + IdempotencyConflictResponse, + Import, + ImportBundleRefusedResponse, + ImportConflictResponse, + ImportInput, + ImportNotFoundResponse, + ImportPage, + ImportVerification, + InvalidRequestResponse, + ListImportsParams, + MoveUnavailableResponse, + PayloadTooLargeResponse, + RangeNotSatisfiableResponse, + ServerErrorResponse, + TooManyMovesResponse, + UnauthenticatedResponse, + UnexpectedErrorResponse, + UploadImportPartHeaders, +} from "../model"; + +import { apiRequest } from "../../request"; + +type AwaitedInput = PromiseLike | T; + +type Awaited = O extends AwaitedInput ? T : never; + +type SecondParameter unknown> = Parameters[1]; + +const withQueryKey = ( + query: T, + queryKey: K, +): T & { queryKey: K } => { + const result = { queryKey } as T & { queryKey: K }; + for (const key of Object.keys(query)) { + // The explicit queryKey always wins, matching the previous + // `{ ...query, queryKey }` spread where it was set last. + if (key === "queryKey") continue; + Object.defineProperty(result, key, { + enumerable: true, + configurable: true, + get: () => (query as Record)[key], + }); + } + return result; +}; + +export const getGetExportEstimateUrl = (organizationId: string) => { + return `/api/v2/organizations/${encodeURIComponent(String(organizationId))}/export-estimate`; +}; + +/** + * Count what an export would hold, without making one: the caller's Bots, their skills, conversations and messages, memories, routines, goals and check-ins, files and settings, and, when the caller is an administrator, the organization's own skills. Also says roughly how big the bundle will be, how much space this OpenBot holds for it on disk (what the move frees once the local OpenBot is removed), which apps the person will need to connect again on OpenBot Cloud, and whether a model key could come along. Served only by an OpenBot that runs on the person's own computer; elsewhere it answers 404 with the code MOVE_UNAVAILABLE. + * @summary Read what moving to OpenBot Cloud would take + */ +export const getExportEstimate = async ( + organizationId: string, + options?: Parameters[1], +): Promise => { + return apiRequest(getGetExportEstimateUrl(organizationId), { + ...options, + method: "GET", + }); +}; + +export const getGetExportEstimateQueryKey = (organizationId: string) => { + return [`/api/v2/organizations/${organizationId}/export-estimate`] as const; +}; + +export const getGetExportEstimateQueryOptions = < + TData = Awaited>, + TError = + | UnauthenticatedResponse + | MoveUnavailableResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + >; + request?: SecondParameter; + }, +) => { + const { query: queryOptions, request: requestOptions } = options ?? {}; + + const queryKey = + queryOptions?.queryKey ?? getGetExportEstimateQueryKey(organizationId); + + const queryFn: QueryFunction< + Awaited> + > = ({ signal }) => + getExportEstimate(organizationId, { signal, ...requestOptions }); + + return { + queryKey, + queryFn, + enabled: organizationId !== null && organizationId !== undefined, + ...queryOptions, + } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: DataTag }; +}; + +export type GetExportEstimateQueryResult = NonNullable< + Awaited> +>; +export type GetExportEstimateQueryError = + | UnauthenticatedResponse + | MoveUnavailableResponse + | ServerErrorResponse + | UnexpectedErrorResponse; + +export function useGetExportEstimate< + TData = Awaited>, + TError = + | UnauthenticatedResponse + | MoveUnavailableResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + options: { + query: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > & + Pick< + DefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): DefinedUseQueryResult & { + queryKey: DataTag; +}; +export function useGetExportEstimate< + TData = Awaited>, + TError = + | UnauthenticatedResponse + | MoveUnavailableResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > & + Pick< + UndefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +export function useGetExportEstimate< + TData = Awaited>, + TError = + | UnauthenticatedResponse + | MoveUnavailableResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +/** + * @summary Read what moving to OpenBot Cloud would take + */ + +export function useGetExportEstimate< + TData = Awaited>, + TError = + | UnauthenticatedResponse + | MoveUnavailableResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +} { + const queryOptions = getGetExportEstimateQueryOptions( + organizationId, + options, + ); + + const query = useQuery(queryOptions, queryClient) as UseQueryResult< + TData, + TError + > & { queryKey: DataTag }; + + return withQueryKey(query, queryOptions.queryKey); +} + +export const getCreateExportUrl = (organizationId: string) => { + return `/api/v2/organizations/${encodeURIComponent(String(organizationId))}/exports`; +}; + +/** + * Start writing a bundle of everything the caller has in this organization, to move it to OpenBot Cloud: their Bots (settings, instructions and skills), conversations with every message, memories, routines, goals and check-ins, files, standing instructions and preferences, and, when the caller is an administrator, the organization's own skills. Connections to apps travel as their app and account name only: no token or password ever leaves, and each one is listed in reconnect so the person connects it again on Cloud. A model key travels only when includeModelKeys is true, and then only sealed to recipientKey, the key the import on Cloud gave (createImport), so the bundle never holds it readable. + * + * The bundle is written in the background; read getExport until status is ready. It is cut into parts of at most 32 MiB, each with its size and SHA-256, so a dropped download resumes where it stopped. One export is kept for each person: starting another removes the one before. An export is removed 7 days after it was made, or with deleteExport. Served only by an OpenBot that runs on the person's own computer; elsewhere it answers 404 with the code MOVE_UNAVAILABLE. + * @summary Start exporting what the caller has here + */ +export const createExport = async ( + organizationId: string, + exportInput: ExportInput, + headers: CreateExportHeaders, + options?: Parameters[1], +): Promise => { + const getHeaders = ( + h?: NonNullable, + ): Record => { + if (!h) return {}; + if (h instanceof Headers) return Object.fromEntries(h.entries()); + if (Symbol.iterator in h) { + return Object.fromEntries( + Array.from( + h as Iterable>, + (entry) => Array.from(entry) as [string, string], + ), + ); + } + const headers: Record = {}; + for (const [name, value] of Object.entries< + string | readonly string[] | undefined + >(h)) { + if (value !== undefined) headers[name] = value; + } + return headers; + }; + return apiRequest(getCreateExportUrl(organizationId), { + ...options, + method: "POST", + headers: { + "Content-Type": "application/json", + ...headers, + ...getHeaders(options?.headers), + }, + body: JSON.stringify(exportInput), + }); +}; + +export const getCreateExportMutationKey = () => ["createExport"] as const; + +export const getCreateExportMutationOptions = < + TError = + | InvalidRequestResponse + | UnauthenticatedResponse + | MoveUnavailableResponse + | IdempotencyConflictResponse + | TooManyMovesResponse + | ServerErrorResponse + | UnexpectedErrorResponse, + TContext = unknown, +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + CreateExportMutationVariables, + TContext + >; + request?: SecondParameter; +}): UseMutationOptions< + Awaited>, + TError, + CreateExportMutationVariables, + TContext +> => { + const mutationKey = getCreateExportMutationKey(); + const { mutation: mutationOptions, request: requestOptions } = options + ? options.mutation && + "mutationKey" in options.mutation && + options.mutation.mutationKey + ? options + : { ...options, mutation: { ...options.mutation, mutationKey } } + : { mutation: { mutationKey }, request: undefined }; + + const mutationFn: MutationFunction< + Awaited>, + CreateExportMutationVariables + > = (props) => { + const { organizationId, data, headers } = props ?? {}; + + return createExport(organizationId, data, headers, requestOptions); + }; + + return { mutationFn, ...mutationOptions }; +}; + +export type CreateExportMutationResult = NonNullable< + Awaited> +>; +export type CreateExportMutationBody = ExportInput; +export type CreateExportMutationError = + | InvalidRequestResponse + | UnauthenticatedResponse + | MoveUnavailableResponse + | IdempotencyConflictResponse + | TooManyMovesResponse + | ServerErrorResponse + | UnexpectedErrorResponse; +export type CreateExportMutationVariables = { + organizationId: string; + data: ExportInput; + headers: CreateExportHeaders; +}; + +/** + * @summary Start exporting what the caller has here + */ +export const useCreateExport = < + TError = + | InvalidRequestResponse + | UnauthenticatedResponse + | MoveUnavailableResponse + | IdempotencyConflictResponse + | TooManyMovesResponse + | ServerErrorResponse + | UnexpectedErrorResponse, + TContext = unknown, +>( + options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + CreateExportMutationVariables, + TContext + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseMutationResult< + Awaited>, + TError, + CreateExportMutationVariables, + TContext +> => { + return useMutation(getCreateExportMutationOptions(options), queryClient); +}; +export const getGetExportUrl = (organizationId: string, exportId: string) => { + return `/api/v2/organizations/${encodeURIComponent(String(organizationId))}/exports/${encodeURIComponent(String(exportId))}`; +}; + +/** + * Return where the caller's export stands. Once ready it lists the bundle's parts with their sizes and SHA-256, its total size, and the count of everything in it by kind, which are the counts getImportVerification is compared with. Only the person who made it reads it; anybody else is answered 404. + * @summary Read an export + */ +export const getExport = async ( + organizationId: string, + exportId: string, + options?: Parameters[1], +): Promise => { + return apiRequest(getGetExportUrl(organizationId, exportId), { + ...options, + method: "GET", + }); +}; + +export const getGetExportQueryKey = ( + organizationId: string, + exportId: string, +) => { + return [ + `/api/v2/organizations/${organizationId}/exports/${exportId}`, + ] as const; +}; + +export const getGetExportQueryOptions = < + TData = Awaited>, + TError = + | UnauthenticatedResponse + | ExportNotFoundResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + exportId: string, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + >; + request?: SecondParameter; + }, +) => { + const { query: queryOptions, request: requestOptions } = options ?? {}; + + const queryKey = + queryOptions?.queryKey ?? getGetExportQueryKey(organizationId, exportId); + + const queryFn: QueryFunction>> = ({ + signal, + }) => getExport(organizationId, exportId, { signal, ...requestOptions }); + + return { + queryKey, + queryFn, + enabled: + organizationId !== null && + organizationId !== undefined && + exportId !== null && + exportId !== undefined, + ...queryOptions, + } as UseQueryOptions>, TError, TData> & { + queryKey: DataTag; + }; +}; + +export type GetExportQueryResult = NonNullable< + Awaited> +>; +export type GetExportQueryError = + | UnauthenticatedResponse + | ExportNotFoundResponse + | ServerErrorResponse + | UnexpectedErrorResponse; + +export function useGetExport< + TData = Awaited>, + TError = + | UnauthenticatedResponse + | ExportNotFoundResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + exportId: string, + options: { + query: Partial< + UseQueryOptions>, TError, TData> + > & + Pick< + DefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): DefinedUseQueryResult & { + queryKey: DataTag; +}; +export function useGetExport< + TData = Awaited>, + TError = + | UnauthenticatedResponse + | ExportNotFoundResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + exportId: string, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + > & + Pick< + UndefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +export function useGetExport< + TData = Awaited>, + TError = + | UnauthenticatedResponse + | ExportNotFoundResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + exportId: string, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +/** + * @summary Read an export + */ + +export function useGetExport< + TData = Awaited>, + TError = + | UnauthenticatedResponse + | ExportNotFoundResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + exportId: string, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +} { + const queryOptions = getGetExportQueryOptions( + organizationId, + exportId, + options, + ); + + const query = useQuery(queryOptions, queryClient) as UseQueryResult< + TData, + TError + > & { queryKey: DataTag }; + + return withQueryKey(query, queryOptions.queryKey); +} + +export const getDeleteExportUrl = ( + organizationId: string, + exportId: string, +) => { + return `/api/v2/organizations/${encodeURIComponent(String(organizationId))}/exports/${encodeURIComponent(String(exportId))}`; +}; + +/** + * Remove the caller's export and its bundle from disk. Nothing it was made from changes. One already gone answers 204 too. + * @summary Remove an export + */ +export const deleteExport = async ( + organizationId: string, + exportId: string, + headers: DeleteExportHeaders, + options?: Parameters[1], +): Promise => { + const getHeaders = ( + h?: NonNullable, + ): Record => { + if (!h) return {}; + if (h instanceof Headers) return Object.fromEntries(h.entries()); + if (Symbol.iterator in h) { + return Object.fromEntries( + Array.from( + h as Iterable>, + (entry) => Array.from(entry) as [string, string], + ), + ); + } + const headers: Record = {}; + for (const [name, value] of Object.entries< + string | readonly string[] | undefined + >(h)) { + if (value !== undefined) headers[name] = value; + } + return headers; + }; + return apiRequest(getDeleteExportUrl(organizationId, exportId), { + ...options, + method: "DELETE", + headers: { ...headers, ...getHeaders(options?.headers) }, + }); +}; + +export const getDeleteExportMutationKey = () => ["deleteExport"] as const; + +export const getDeleteExportMutationOptions = < + TError = + | UnauthenticatedResponse + | MoveUnavailableResponse + | IdempotencyConflictResponse + | ServerErrorResponse + | UnexpectedErrorResponse, + TContext = unknown, +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + DeleteExportMutationVariables, + TContext + >; + request?: SecondParameter; +}): UseMutationOptions< + Awaited>, + TError, + DeleteExportMutationVariables, + TContext +> => { + const mutationKey = getDeleteExportMutationKey(); + const { mutation: mutationOptions, request: requestOptions } = options + ? options.mutation && + "mutationKey" in options.mutation && + options.mutation.mutationKey + ? options + : { ...options, mutation: { ...options.mutation, mutationKey } } + : { mutation: { mutationKey }, request: undefined }; + + const mutationFn: MutationFunction< + Awaited>, + DeleteExportMutationVariables + > = (props) => { + const { organizationId, exportId, headers } = props ?? {}; + + return deleteExport(organizationId, exportId, headers, requestOptions); + }; + + return { mutationFn, ...mutationOptions }; +}; + +export type DeleteExportMutationResult = NonNullable< + Awaited> +>; + +export type DeleteExportMutationError = + | UnauthenticatedResponse + | MoveUnavailableResponse + | IdempotencyConflictResponse + | ServerErrorResponse + | UnexpectedErrorResponse; +export type DeleteExportMutationVariables = { + organizationId: string; + exportId: string; + headers: DeleteExportHeaders; +}; + +/** + * @summary Remove an export + */ +export const useDeleteExport = < + TError = + | UnauthenticatedResponse + | MoveUnavailableResponse + | IdempotencyConflictResponse + | ServerErrorResponse + | UnexpectedErrorResponse, + TContext = unknown, +>( + options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + DeleteExportMutationVariables, + TContext + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseMutationResult< + Awaited>, + TError, + DeleteExportMutationVariables, + TContext +> => { + return useMutation(getDeleteExportMutationOptions(options), queryClient); +}; +export const getDownloadExportPartUrl = ( + organizationId: string, + exportId: string, + partNumber: number, +) => { + return `/api/v2/organizations/${encodeURIComponent(String(organizationId))}/exports/${encodeURIComponent(String(exportId))}/parts/${encodeURIComponent(String(partNumber))}`; +}; + +/** + * Return one part of a ready export's bundle, as bytes to hand to uploadImportPart unchanged. A Range header of one byte range (bytes=N- or bytes=N-M) answers 206 with that range, so a dropped download resumes where it stopped. The SHA-256 of the whole part is in the export's parts and in the ETag. Only the person who made the export downloads it. + * @summary Download one part of an export's bundle + */ +export const downloadExportPart = async ( + organizationId: string, + exportId: string, + partNumber: number, + headers?: DownloadExportPartHeaders, + options?: Parameters[1], +): Promise => { + const getHeaders = ( + h?: NonNullable, + ): Record => { + if (!h) return {}; + if (h instanceof Headers) return Object.fromEntries(h.entries()); + if (Symbol.iterator in h) { + return Object.fromEntries( + Array.from( + h as Iterable>, + (entry) => Array.from(entry) as [string, string], + ), + ); + } + const headers: Record = {}; + for (const [name, value] of Object.entries< + string | readonly string[] | undefined + >(h)) { + if (value !== undefined) headers[name] = value; + } + return headers; + }; + return apiRequest( + getDownloadExportPartUrl(organizationId, exportId, partNumber), + { + ...options, + method: "GET", + headers: { ...headers, ...getHeaders(options?.headers) }, + }, + ); +}; + +export const getDownloadExportPartQueryKey = ( + organizationId: string, + exportId: string, + partNumber: number, +) => { + return [ + `/api/v2/organizations/${organizationId}/exports/${exportId}/parts/${partNumber}`, + ] as const; +}; + +export const getDownloadExportPartQueryOptions = < + TData = Awaited>, + TError = + | UnauthenticatedResponse + | ExportNotFoundResponse + | ExportNotReadyResponse + | RangeNotSatisfiableResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + exportId: string, + partNumber: number, + headers?: DownloadExportPartHeaders, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + >; + request?: SecondParameter; + }, +) => { + const { query: queryOptions, request: requestOptions } = options ?? {}; + + const queryKey = + queryOptions?.queryKey ?? + getDownloadExportPartQueryKey(organizationId, exportId, partNumber); + + const queryFn: QueryFunction< + Awaited> + > = ({ signal }) => + downloadExportPart(organizationId, exportId, partNumber, headers, { + signal, + ...requestOptions, + }); + + return { + queryKey, + queryFn, + enabled: + organizationId !== null && + organizationId !== undefined && + exportId !== null && + exportId !== undefined && + partNumber !== null && + partNumber !== undefined, + ...queryOptions, + } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: DataTag }; +}; + +export type DownloadExportPartQueryResult = NonNullable< + Awaited> +>; +export type DownloadExportPartQueryError = + | UnauthenticatedResponse + | ExportNotFoundResponse + | ExportNotReadyResponse + | RangeNotSatisfiableResponse + | ServerErrorResponse + | UnexpectedErrorResponse; + +export function useDownloadExportPart< + TData = Awaited>, + TError = + | UnauthenticatedResponse + | ExportNotFoundResponse + | ExportNotReadyResponse + | RangeNotSatisfiableResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + exportId: string, + partNumber: number, + headers: undefined | DownloadExportPartHeaders, + options: { + query: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > & + Pick< + DefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): DefinedUseQueryResult & { + queryKey: DataTag; +}; +export function useDownloadExportPart< + TData = Awaited>, + TError = + | UnauthenticatedResponse + | ExportNotFoundResponse + | ExportNotReadyResponse + | RangeNotSatisfiableResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + exportId: string, + partNumber: number, + headers?: DownloadExportPartHeaders, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > & + Pick< + UndefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +export function useDownloadExportPart< + TData = Awaited>, + TError = + | UnauthenticatedResponse + | ExportNotFoundResponse + | ExportNotReadyResponse + | RangeNotSatisfiableResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + exportId: string, + partNumber: number, + headers?: DownloadExportPartHeaders, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +/** + * @summary Download one part of an export's bundle + */ + +export function useDownloadExportPart< + TData = Awaited>, + TError = + | UnauthenticatedResponse + | ExportNotFoundResponse + | ExportNotReadyResponse + | RangeNotSatisfiableResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + exportId: string, + partNumber: number, + headers?: DownloadExportPartHeaders, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +} { + const queryOptions = getDownloadExportPartQueryOptions( + organizationId, + exportId, + partNumber, + headers, + options, + ); + + const query = useQuery(queryOptions, queryClient) as UseQueryResult< + TData, + TError + > & { queryKey: DataTag }; + + return withQueryKey(query, queryOptions.queryKey); +} + +export const getCreateImportUrl = (organizationId: string) => { + return `/api/v2/organizations/${encodeURIComponent(String(organizationId))}/imports`; +}; + +/** + * Start an import of what the caller is moving from an OpenBot on their own computer into this organization, the caller's own organization by default. Everything imported belongs to the caller, in this organization only. The answer carries recipientKey, a public key made for this import alone: pass it to createExport, and a model key in the bundle is sealed to it, readable only by this import. The answer also says how big a bundle and a part may be. Then upload the export's parts with uploadImportPart and apply them with applyImport. + * + * Importing is safe to repeat: an import of the same OpenBot into the same organization (an export made again, or a new import after a dropped one) adds only what isn't here yet and duplicates nothing. Served only by OpenBot Cloud; elsewhere it answers 404 with the code MOVE_UNAVAILABLE. A person starts at most 10 imports a day. + * @summary Start importing a bundle into this organization + */ +export const createImport = async ( + organizationId: string, + headers: CreateImportHeaders, + importInput?: ImportInput, + options?: Parameters[1], +): Promise => { + const getHeaders = ( + h?: NonNullable, + ): Record => { + if (!h) return {}; + if (h instanceof Headers) return Object.fromEntries(h.entries()); + if (Symbol.iterator in h) { + return Object.fromEntries( + Array.from( + h as Iterable>, + (entry) => Array.from(entry) as [string, string], + ), + ); + } + const headers: Record = {}; + for (const [name, value] of Object.entries< + string | readonly string[] | undefined + >(h)) { + if (value !== undefined) headers[name] = value; + } + return headers; + }; + return apiRequest(getCreateImportUrl(organizationId), { + ...options, + method: "POST", + headers: { + "Content-Type": "application/json", + ...headers, + ...getHeaders(options?.headers), + }, + body: JSON.stringify(importInput), + }); +}; + +export const getCreateImportMutationKey = () => ["createImport"] as const; + +export const getCreateImportMutationOptions = < + TError = + | InvalidRequestResponse + | UnauthenticatedResponse + | MoveUnavailableResponse + | IdempotencyConflictResponse + | TooManyMovesResponse + | ServerErrorResponse + | UnexpectedErrorResponse, + TContext = unknown, +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + CreateImportMutationVariables, + TContext + >; + request?: SecondParameter; +}): UseMutationOptions< + Awaited>, + TError, + CreateImportMutationVariables, + TContext +> => { + const mutationKey = getCreateImportMutationKey(); + const { mutation: mutationOptions, request: requestOptions } = options + ? options.mutation && + "mutationKey" in options.mutation && + options.mutation.mutationKey + ? options + : { ...options, mutation: { ...options.mutation, mutationKey } } + : { mutation: { mutationKey }, request: undefined }; + + const mutationFn: MutationFunction< + Awaited>, + CreateImportMutationVariables + > = (props) => { + const { organizationId, headers, data } = props ?? {}; + + return createImport(organizationId, headers, data, requestOptions); + }; + + return { mutationFn, ...mutationOptions }; +}; + +export type CreateImportMutationResult = NonNullable< + Awaited> +>; +export type CreateImportMutationBody = ImportInput | undefined; +export type CreateImportMutationError = + | InvalidRequestResponse + | UnauthenticatedResponse + | MoveUnavailableResponse + | IdempotencyConflictResponse + | TooManyMovesResponse + | ServerErrorResponse + | UnexpectedErrorResponse; +export type CreateImportMutationVariables = { + organizationId: string; + headers: CreateImportHeaders; + data?: ImportInput; +}; + +/** + * @summary Start importing a bundle into this organization + */ +export const useCreateImport = < + TError = + | InvalidRequestResponse + | UnauthenticatedResponse + | MoveUnavailableResponse + | IdempotencyConflictResponse + | TooManyMovesResponse + | ServerErrorResponse + | UnexpectedErrorResponse, + TContext = unknown, +>( + options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + CreateImportMutationVariables, + TContext + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseMutationResult< + Awaited>, + TError, + CreateImportMutationVariables, + TContext +> => { + return useMutation(getCreateImportMutationOptions(options), queryClient); +}; +export const getListImportsUrl = ( + organizationId: string, + params?: ListImportsParams, +) => { + const normalizedParams = new URLSearchParams(); + + Object.entries(params || {}).forEach(([key, value]) => { + if (value !== undefined) { + normalizedParams.append(key, value === null ? "null" : String(value)); + } + }); + + const stringifiedParams = normalizedParams.toString(); + + return stringifiedParams.length > 0 + ? `/api/v2/organizations/${encodeURIComponent(String(organizationId))}/imports?${stringifiedParams}` + : `/api/v2/organizations/${encodeURIComponent(String(organizationId))}/imports`; +}; + +/** + * List the imports the caller started in this organization, newest first, so an app that lost track of one after a drop finds it again. Only the caller's own. Served only by OpenBot Cloud. + * @summary List the caller's imports into this organization + */ +export const listImports = async ( + organizationId: string, + params?: ListImportsParams, + options?: Parameters[1], +): Promise => { + return apiRequest(getListImportsUrl(organizationId, params), { + ...options, + method: "GET", + }); +}; + +export const getListImportsQueryKey = ( + organizationId: string, + params?: ListImportsParams, +) => { + return [ + `/api/v2/organizations/${organizationId}/imports`, + ...(params ? [params] : []), + ] as const; +}; + +export const getListImportsQueryOptions = < + TData = Awaited>, + TError = + | InvalidRequestResponse + | UnauthenticatedResponse + | MoveUnavailableResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + params?: ListImportsParams, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + >; + request?: SecondParameter; + }, +) => { + const { query: queryOptions, request: requestOptions } = options ?? {}; + + const queryKey = + queryOptions?.queryKey ?? getListImportsQueryKey(organizationId, params); + + const queryFn: QueryFunction>> = ({ + signal, + }) => listImports(organizationId, params, { signal, ...requestOptions }); + + return { + queryKey, + queryFn, + enabled: organizationId !== null && organizationId !== undefined, + ...queryOptions, + } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: DataTag }; +}; + +export type ListImportsQueryResult = NonNullable< + Awaited> +>; +export type ListImportsQueryError = + | InvalidRequestResponse + | UnauthenticatedResponse + | MoveUnavailableResponse + | ServerErrorResponse + | UnexpectedErrorResponse; + +export function useListImports< + TData = Awaited>, + TError = + | InvalidRequestResponse + | UnauthenticatedResponse + | MoveUnavailableResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + params: undefined | ListImportsParams, + options: { + query: Partial< + UseQueryOptions>, TError, TData> + > & + Pick< + DefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): DefinedUseQueryResult & { + queryKey: DataTag; +}; +export function useListImports< + TData = Awaited>, + TError = + | InvalidRequestResponse + | UnauthenticatedResponse + | MoveUnavailableResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + params?: ListImportsParams, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + > & + Pick< + UndefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +export function useListImports< + TData = Awaited>, + TError = + | InvalidRequestResponse + | UnauthenticatedResponse + | MoveUnavailableResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + params?: ListImportsParams, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +/** + * @summary List the caller's imports into this organization + */ + +export function useListImports< + TData = Awaited>, + TError = + | InvalidRequestResponse + | UnauthenticatedResponse + | MoveUnavailableResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + params?: ListImportsParams, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +} { + const queryOptions = getListImportsQueryOptions( + organizationId, + params, + options, + ); + + const query = useQuery(queryOptions, queryClient) as UseQueryResult< + TData, + TError + > & { queryKey: DataTag }; + + return withQueryKey(query, queryOptions.queryKey); +} + +export const getGetImportUrl = (organizationId: string, importId: string) => { + return `/api/v2/organizations/${encodeURIComponent(String(organizationId))}/imports/${encodeURIComponent(String(importId))}`; +}; + +/** + * Return where the caller's import stands: which parts have arrived, how far applying them has got by kind, and once imported, the summary: what was imported, what was imported differently or left out on OpenBot Cloud and why (notes), and which apps to connect again (reconnect). Only the person who started it reads it. + * @summary Read an import + */ +export const getImport = async ( + organizationId: string, + importId: string, + options?: Parameters[1], +): Promise => { + return apiRequest(getGetImportUrl(organizationId, importId), { + ...options, + method: "GET", + }); +}; + +export const getGetImportQueryKey = ( + organizationId: string, + importId: string, +) => { + return [ + `/api/v2/organizations/${organizationId}/imports/${importId}`, + ] as const; +}; + +export const getGetImportQueryOptions = < + TData = Awaited>, + TError = + | UnauthenticatedResponse + | ImportNotFoundResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + importId: string, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + >; + request?: SecondParameter; + }, +) => { + const { query: queryOptions, request: requestOptions } = options ?? {}; + + const queryKey = + queryOptions?.queryKey ?? getGetImportQueryKey(organizationId, importId); + + const queryFn: QueryFunction>> = ({ + signal, + }) => getImport(organizationId, importId, { signal, ...requestOptions }); + + return { + queryKey, + queryFn, + enabled: + organizationId !== null && + organizationId !== undefined && + importId !== null && + importId !== undefined, + ...queryOptions, + } as UseQueryOptions>, TError, TData> & { + queryKey: DataTag; + }; +}; + +export type GetImportQueryResult = NonNullable< + Awaited> +>; +export type GetImportQueryError = + | UnauthenticatedResponse + | ImportNotFoundResponse + | ServerErrorResponse + | UnexpectedErrorResponse; + +export function useGetImport< + TData = Awaited>, + TError = + | UnauthenticatedResponse + | ImportNotFoundResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + importId: string, + options: { + query: Partial< + UseQueryOptions>, TError, TData> + > & + Pick< + DefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): DefinedUseQueryResult & { + queryKey: DataTag; +}; +export function useGetImport< + TData = Awaited>, + TError = + | UnauthenticatedResponse + | ImportNotFoundResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + importId: string, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + > & + Pick< + UndefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +export function useGetImport< + TData = Awaited>, + TError = + | UnauthenticatedResponse + | ImportNotFoundResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + importId: string, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +/** + * @summary Read an import + */ + +export function useGetImport< + TData = Awaited>, + TError = + | UnauthenticatedResponse + | ImportNotFoundResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + importId: string, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +} { + const queryOptions = getGetImportQueryOptions( + organizationId, + importId, + options, + ); + + const query = useQuery(queryOptions, queryClient) as UseQueryResult< + TData, + TError + > & { queryKey: DataTag }; + + return withQueryKey(query, queryOptions.queryKey); +} + +export const getUploadImportPartUrl = ( + organizationId: string, + importId: string, + partNumber: number, +) => { + return `/api/v2/organizations/${encodeURIComponent(String(organizationId))}/imports/${encodeURIComponent(String(importId))}/parts/${encodeURIComponent(String(partNumber))}`; +}; + +/** + * Upload one part of the export's bundle, exactly as downloadExportPart gave it. Part 1 carries the bundle's manifest, so it is uploaded first; after it the parts go in any order, and the import's expectedParts says how many there are and the SHA-256 of each. A part whose bytes don't match the manifest is refused (IMPORT_PART_MISMATCH) and can be uploaded again. Uploading a part that already arrived changes nothing and answers 200 again, so after a drop an app sends whatever receivedParts doesn't list. A part is at most 32 MiB, and a bundle at most maxBundleBytes. At most 120 parts a minute for each person. + * @summary Upload one part of the bundle + */ +export const uploadImportPart = async ( + organizationId: string, + importId: string, + partNumber: number, + uploadImportPartBody: Blob, + headers: UploadImportPartHeaders, + options?: Parameters[1], +): Promise => { + const getHeaders = ( + h?: NonNullable, + ): Record => { + if (!h) return {}; + if (h instanceof Headers) return Object.fromEntries(h.entries()); + if (Symbol.iterator in h) { + return Object.fromEntries( + Array.from( + h as Iterable>, + (entry) => Array.from(entry) as [string, string], + ), + ); + } + const headers: Record = {}; + for (const [name, value] of Object.entries< + string | readonly string[] | undefined + >(h)) { + if (value !== undefined) headers[name] = value; + } + return headers; + }; + return apiRequest( + getUploadImportPartUrl(organizationId, importId, partNumber), + { + ...options, + method: "PUT", + headers: { + "Content-Type": "application/octet-stream", + ...headers, + ...getHeaders(options?.headers), + }, + body: uploadImportPartBody, + }, + ); +}; + +export const getUploadImportPartMutationKey = () => + ["uploadImportPart"] as const; + +export const getUploadImportPartMutationOptions = < + TError = + | InvalidRequestResponse + | UnauthenticatedResponse + | ImportNotFoundResponse + | ImportConflictResponse + | PayloadTooLargeResponse + | ImportBundleRefusedResponse + | TooManyMovesResponse + | ServerErrorResponse + | UnexpectedErrorResponse, + TContext = unknown, +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + UploadImportPartMutationVariables, + TContext + >; + request?: SecondParameter; +}): UseMutationOptions< + Awaited>, + TError, + UploadImportPartMutationVariables, + TContext +> => { + const mutationKey = getUploadImportPartMutationKey(); + const { mutation: mutationOptions, request: requestOptions } = options + ? options.mutation && + "mutationKey" in options.mutation && + options.mutation.mutationKey + ? options + : { ...options, mutation: { ...options.mutation, mutationKey } } + : { mutation: { mutationKey }, request: undefined }; + + const mutationFn: MutationFunction< + Awaited>, + UploadImportPartMutationVariables + > = (props) => { + const { organizationId, importId, partNumber, data, headers } = props ?? {}; + + return uploadImportPart( + organizationId, + importId, + partNumber, + data, + headers, + requestOptions, + ); + }; + + return { mutationFn, ...mutationOptions }; +}; + +export type UploadImportPartMutationResult = NonNullable< + Awaited> +>; +export type UploadImportPartMutationBody = Blob; +export type UploadImportPartMutationError = + | InvalidRequestResponse + | UnauthenticatedResponse + | ImportNotFoundResponse + | ImportConflictResponse + | PayloadTooLargeResponse + | ImportBundleRefusedResponse + | TooManyMovesResponse + | ServerErrorResponse + | UnexpectedErrorResponse; +export type UploadImportPartMutationVariables = { + organizationId: string; + importId: string; + partNumber: number; + data: Blob; + headers: UploadImportPartHeaders; +}; + +/** + * @summary Upload one part of the bundle + */ +export const useUploadImportPart = < + TError = + | InvalidRequestResponse + | UnauthenticatedResponse + | ImportNotFoundResponse + | ImportConflictResponse + | PayloadTooLargeResponse + | ImportBundleRefusedResponse + | TooManyMovesResponse + | ServerErrorResponse + | UnexpectedErrorResponse, + TContext = unknown, +>( + options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + UploadImportPartMutationVariables, + TContext + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseMutationResult< + Awaited>, + TError, + UploadImportPartMutationVariables, + TContext +> => { + return useMutation(getUploadImportPartMutationOptions(options), queryClient); +}; +export const getApplyImportUrl = (organizationId: string, importId: string) => { + return `/api/v2/organizations/${encodeURIComponent(String(organizationId))}/imports/${encodeURIComponent(String(importId))}/apply`; +}; + +/** + * Once every part has arrived, import the bundle into this organization in the background: every id is given a new one here, everything is owned by the caller, and nothing reaches another organization. Read getImport until status is imported or failed. Applying again while it runs, or after it finished, changes nothing and answers where it stands; applying a failed import tries again from where it stopped, and nothing already imported is imported twice. A missing part answers 409 with IMPORT_INCOMPLETE. + * + * What OpenBot Cloud doesn't have comes in differently, and the summary says so in notes: a Bot that ran on its own isolated computer comes in as an ordinary Bot; a feature that needs the Business plan, in an organization that isn't on it, is left out. A model key in the bundle becomes the caller's own AI connection, unless they have one here already, which is kept. + * @summary Import the uploaded bundle + */ +export const applyImport = async ( + organizationId: string, + importId: string, + headers: ApplyImportHeaders, + options?: Parameters[1], +): Promise => { + const getHeaders = ( + h?: NonNullable, + ): Record => { + if (!h) return {}; + if (h instanceof Headers) return Object.fromEntries(h.entries()); + if (Symbol.iterator in h) { + return Object.fromEntries( + Array.from( + h as Iterable>, + (entry) => Array.from(entry) as [string, string], + ), + ); + } + const headers: Record = {}; + for (const [name, value] of Object.entries< + string | readonly string[] | undefined + >(h)) { + if (value !== undefined) headers[name] = value; + } + return headers; + }; + return apiRequest(getApplyImportUrl(organizationId, importId), { + ...options, + method: "POST", + headers: { ...headers, ...getHeaders(options?.headers) }, + }); +}; + +export const getApplyImportMutationKey = () => ["applyImport"] as const; + +export const getApplyImportMutationOptions = < + TError = + | UnauthenticatedResponse + | ImportNotFoundResponse + | ImportConflictResponse + | ServerErrorResponse + | UnexpectedErrorResponse, + TContext = unknown, +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + ApplyImportMutationVariables, + TContext + >; + request?: SecondParameter; +}): UseMutationOptions< + Awaited>, + TError, + ApplyImportMutationVariables, + TContext +> => { + const mutationKey = getApplyImportMutationKey(); + const { mutation: mutationOptions, request: requestOptions } = options + ? options.mutation && + "mutationKey" in options.mutation && + options.mutation.mutationKey + ? options + : { ...options, mutation: { ...options.mutation, mutationKey } } + : { mutation: { mutationKey }, request: undefined }; + + const mutationFn: MutationFunction< + Awaited>, + ApplyImportMutationVariables + > = (props) => { + const { organizationId, importId, headers } = props ?? {}; + + return applyImport(organizationId, importId, headers, requestOptions); + }; + + return { mutationFn, ...mutationOptions }; +}; + +export type ApplyImportMutationResult = NonNullable< + Awaited> +>; + +export type ApplyImportMutationError = + | UnauthenticatedResponse + | ImportNotFoundResponse + | ImportConflictResponse + | ServerErrorResponse + | UnexpectedErrorResponse; +export type ApplyImportMutationVariables = { + organizationId: string; + importId: string; + headers: ApplyImportHeaders; +}; + +/** + * @summary Import the uploaded bundle + */ +export const useApplyImport = < + TError = + | UnauthenticatedResponse + | ImportNotFoundResponse + | ImportConflictResponse + | ServerErrorResponse + | UnexpectedErrorResponse, + TContext = unknown, +>( + options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + ApplyImportMutationVariables, + TContext + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseMutationResult< + Awaited>, + TError, + ApplyImportMutationVariables, + TContext +> => { + return useMutation(getApplyImportMutationOptions(options), queryClient); +}; +export const getGetImportVerificationUrl = ( + organizationId: string, + importId: string, +) => { + return `/api/v2/organizations/${encodeURIComponent(String(organizationId))}/imports/${encodeURIComponent(String(importId))}/verification`; +}; + +/** + * Count, by kind, what from this import's OpenBot is in this organization now, read from what is stored here rather than from the import's own tally, beside what the bundle held. matches is true only when every kind is all here, apart from what the notes say OpenBot Cloud left out on purpose. OpenBot Desktop removes nothing on the person's computer until it does. Also lists the apps to connect again. + * @summary Check that everything arrived + */ +export const getImportVerification = async ( + organizationId: string, + importId: string, + options?: Parameters[1], +): Promise => { + return apiRequest( + getGetImportVerificationUrl(organizationId, importId), + { + ...options, + method: "GET", + }, + ); +}; + +export const getGetImportVerificationQueryKey = ( + organizationId: string, + importId: string, +) => { + return [ + `/api/v2/organizations/${organizationId}/imports/${importId}/verification`, + ] as const; +}; + +export const getGetImportVerificationQueryOptions = < + TData = Awaited>, + TError = + | UnauthenticatedResponse + | ImportNotFoundResponse + | ImportConflictResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + importId: string, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + >; + request?: SecondParameter; + }, +) => { + const { query: queryOptions, request: requestOptions } = options ?? {}; + + const queryKey = + queryOptions?.queryKey ?? + getGetImportVerificationQueryKey(organizationId, importId); + + const queryFn: QueryFunction< + Awaited> + > = ({ signal }) => + getImportVerification(organizationId, importId, { + signal, + ...requestOptions, + }); + + return { + queryKey, + queryFn, + enabled: + organizationId !== null && + organizationId !== undefined && + importId !== null && + importId !== undefined, + ...queryOptions, + } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: DataTag }; +}; + +export type GetImportVerificationQueryResult = NonNullable< + Awaited> +>; +export type GetImportVerificationQueryError = + | UnauthenticatedResponse + | ImportNotFoundResponse + | ImportConflictResponse + | ServerErrorResponse + | UnexpectedErrorResponse; + +export function useGetImportVerification< + TData = Awaited>, + TError = + | UnauthenticatedResponse + | ImportNotFoundResponse + | ImportConflictResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + importId: string, + options: { + query: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > & + Pick< + DefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): DefinedUseQueryResult & { + queryKey: DataTag; +}; +export function useGetImportVerification< + TData = Awaited>, + TError = + | UnauthenticatedResponse + | ImportNotFoundResponse + | ImportConflictResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + importId: string, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > & + Pick< + UndefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + >, + "initialData" + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +export function useGetImportVerification< + TData = Awaited>, + TError = + | UnauthenticatedResponse + | ImportNotFoundResponse + | ImportConflictResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + importId: string, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +}; +/** + * @summary Check that everything arrived + */ + +export function useGetImportVerification< + TData = Awaited>, + TError = + | UnauthenticatedResponse + | ImportNotFoundResponse + | ImportConflictResponse + | ServerErrorResponse + | UnexpectedErrorResponse, +>( + organizationId: string, + importId: string, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + >; + request?: SecondParameter; + }, + queryClient?: QueryClient, +): UseQueryResult & { + queryKey: DataTag; +} { + const queryOptions = getGetImportVerificationQueryOptions( + organizationId, + importId, + options, + ); + + const query = useQuery(queryOptions, queryClient) as UseQueryResult< + TData, + TError + > & { queryKey: DataTag }; + + return withQueryKey(query, queryOptions.queryKey); +} diff --git a/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.zod.ts b/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.zod.ts new file mode 100644 index 0000000000..2caebc66af --- /dev/null +++ b/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.zod.ts @@ -0,0 +1,1601 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ +import * as zod from "zod"; + +/** + * Count what an export would hold, without making one: the caller's Bots, their skills, conversations and messages, memories, routines, goals and check-ins, files and settings, and, when the caller is an administrator, the organization's own skills. Also says roughly how big the bundle will be, how much space this OpenBot holds for it on disk (what the move frees once the local OpenBot is removed), which apps the person will need to connect again on OpenBot Cloud, and whether a model key could come along. Served only by an OpenBot that runs on the person's own computer; elsewhere it answers 404 with the code MOVE_UNAVAILABLE. + * @summary Read what moving to OpenBot Cloud would take + */ + +export const GetExportEstimateParams = zod.object({ + organizationId: zod + .string() + .min(1) + .describe( + "The organization, by its id or its slug. One the caller is not a member of answers as one that does not exist, `default` included.", + ), +}); + +export const getExportEstimateResponseCountsItemCountMin = 0; + +export const getExportEstimateResponseEstimatedBytesMin = 0; + +export const getExportEstimateResponseStoredBytesMin = 0; + +export const GetExportEstimateResponse = zod.object({ + counts: zod.array( + zod.object({ + kind: zod + .string() + .describe( + "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", + ), + count: zod.int().min(getExportEstimateResponseCountsItemCountMin), + }), + ), + estimatedBytes: zod + .int() + .min(getExportEstimateResponseEstimatedBytesMin) + .describe("Roughly how big the bundle will be, in bytes."), + storedBytes: zod + .int() + .min(getExportEstimateResponseStoredBytesMin) + .describe( + "How much this OpenBot keeps on disk for the person (its database and files), which removing it frees. OpenBot Desktop adds what the engine itself takes.", + ), + reconnect: zod.array( + zod + .object({ + appId: zod + .string() + .min(1) + .describe( + "The app's id in the app directory, such as gmail or slack.", + ), + appName: zod + .string() + .min(1) + .describe("The app's name as a person reads it."), + accountLabel: zod + .string() + .min(1) + .optional() + .describe( + "Which account it was connected as, such as an email address or a workspace name, when known.", + ), + iconUrl: zod + .url() + .optional() + .describe("The app's icon, when the directory has one."), + botNames: zod + .array(zod.string()) + .optional() + .describe( + "The Bots that used it, so the person knows which to check.", + ), + }) + .describe( + "A connection to an app that doesn't move, because its sign-in stays on the person's computer: the person connects it again on OpenBot Cloud. Never carries a token, a password or a key.", + ), + ), + modelKeysAvailable: zod + .boolean() + .describe( + "True when there is a model key the person could choose to bring.", + ), +}); + +/** + * Start writing a bundle of everything the caller has in this organization, to move it to OpenBot Cloud: their Bots (settings, instructions and skills), conversations with every message, memories, routines, goals and check-ins, files, standing instructions and preferences, and, when the caller is an administrator, the organization's own skills. Connections to apps travel as their app and account name only: no token or password ever leaves, and each one is listed in reconnect so the person connects it again on Cloud. A model key travels only when includeModelKeys is true, and then only sealed to recipientKey, the key the import on Cloud gave (createImport), so the bundle never holds it readable. + * + * The bundle is written in the background; read getExport until status is ready. It is cut into parts of at most 32 MiB, each with its size and SHA-256, so a dropped download resumes where it stopped. One export is kept for each person: starting another removes the one before. An export is removed 7 days after it was made, or with deleteExport. Served only by an OpenBot that runs on the person's own computer; elsewhere it answers 404 with the code MOVE_UNAVAILABLE. + * @summary Start exporting what the caller has here + */ + +export const CreateExportParams = zod.object({ + organizationId: zod + .string() + .min(1) + .describe( + "The organization, by its id or its slug. One the caller is not a member of answers as one that does not exist, `default` included.", + ), +}); + +export const createExportHeaderIdempotencyKeyMax = 128; + +export const CreateExportHeader = zod.object({ + "Idempotency-Key": zod + .string() + .min(1) + .max(createExportHeaderIdempotencyKeyMax) + .describe( + "Generated by the caller for each write it means to make once. Reuse the same key and the same request for 24 hours after an uncertain response; the same key with a different request is a conflict.", + ), +}); + +export const createExportBodyIncludeModelKeysDefault = false; +export const createExportBodyRecipientKeyNMax = 1024; + +export const createExportBodyRecipientKeyEMax = 16; + +export const createExportBodyRecipientKeyKidMax = 128; + +export const CreateExportBody = zod.object({ + includeModelKeys: zod + .boolean() + .default(createExportBodyIncludeModelKeysDefault) + .describe( + "Bring the person's model key, sealed to recipientKey. Without recipientKey this is refused.", + ), + recipientKey: zod + .object({ + kty: zod.literal("RSA"), + n: zod.string().min(1).max(createExportBodyRecipientKeyNMax), + e: zod.string().min(1).max(createExportBodyRecipientKeyEMax), + alg: zod.literal("RSA-OAEP-256"), + kid: zod.string().min(1).max(createExportBodyRecipientKeyKidMax), + }) + .optional() + .describe( + "A public key as a JSON Web Key (RFC 7517): RSA, 4096 bits, for RSA-OAEP-256. A model key is sealed to it as a JWE (RFC 7516, RSA-OAEP-256 with A256GCM), so only the import that made it reads it.", + ), +}); + +export const createExportResponseTotalBytesMin = 0; + +export const createExportResponsePartsItemSha256RegExp = new RegExp( + "^[0-9a-f]{64}$", +); +export const createExportResponseCountsItemCountMin = 0; + +export const createExportResponseProgressMin = 0; +export const createExportResponseProgressMax = 1; + +export const CreateExportResponse = zod.object({ + id: zod.string().min(1), + status: zod + .string() + .describe( + "preparing: the bundle is being written. ready: every part can be downloaded. failed: it stopped; error says why, and starting another export tries again. A later OpenBot may add a status; read one you don't know as preparing.", + ), + formatVersion: zod + .int() + .min(1) + .optional() + .describe("The bundle's format, once ready. This OpenBot writes 1."), + createdAt: zod.iso.datetime({ offset: true }), + expiresAt: zod.iso + .datetime({ offset: true }) + .describe("When the bundle is removed."), + totalBytes: zod + .int() + .min(createExportResponseTotalBytesMin) + .optional() + .describe("The bundle's size, once ready."), + parts: zod + .array( + zod.object({ + number: zod.int().min(1), + bytes: zod.int().min(1), + sha256: zod.string().regex(createExportResponsePartsItemSha256RegExp), + }), + ) + .optional() + .describe("The bundle's parts in order, once ready."), + counts: zod + .array( + zod.object({ + kind: zod + .string() + .describe( + "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", + ), + count: zod.int().min(createExportResponseCountsItemCountMin), + }), + ) + .optional() + .describe("Everything in the bundle by kind, once ready."), + reconnect: zod + .array( + zod + .object({ + appId: zod + .string() + .min(1) + .describe( + "The app's id in the app directory, such as gmail or slack.", + ), + appName: zod + .string() + .min(1) + .describe("The app's name as a person reads it."), + accountLabel: zod + .string() + .min(1) + .optional() + .describe( + "Which account it was connected as, such as an email address or a workspace name, when known.", + ), + iconUrl: zod + .url() + .optional() + .describe("The app's icon, when the directory has one."), + botNames: zod + .array(zod.string()) + .optional() + .describe( + "The Bots that used it, so the person knows which to check.", + ), + }) + .describe( + "A connection to an app that doesn't move, because its sign-in stays on the person's computer: the person connects it again on OpenBot Cloud. Never carries a token, a password or a key.", + ), + ) + .optional() + .describe("The apps to connect again on OpenBot Cloud."), + includesModelKeys: zod.boolean(), + progress: zod + .number() + .min(createExportResponseProgressMin) + .max(createExportResponseProgressMax) + .optional() + .describe("How far writing the bundle has got, while preparing."), + error: zod + .string() + .min(1) + .optional() + .describe("What went wrong, when failed, in a sentence a person reads."), +}); + +/** + * Return where the caller's export stands. Once ready it lists the bundle's parts with their sizes and SHA-256, its total size, and the count of everything in it by kind, which are the counts getImportVerification is compared with. Only the person who made it reads it; anybody else is answered 404. + * @summary Read an export + */ + +export const getExportPathExportIdMax = 64; + +export const getExportPathExportIdRegExp = new RegExp("^[A-Za-z0-9_-]+$"); + +export const GetExportParams = zod.object({ + organizationId: zod + .string() + .min(1) + .describe( + "The organization, by its id or its slug. One the caller is not a member of answers as one that does not exist, `default` included.", + ), + exportId: zod + .string() + .min(1) + .max(getExportPathExportIdMax) + .regex(getExportPathExportIdRegExp) + .describe("The export's id."), +}); + +export const getExportResponseTotalBytesMin = 0; + +export const getExportResponsePartsItemSha256RegExp = new RegExp( + "^[0-9a-f]{64}$", +); +export const getExportResponseCountsItemCountMin = 0; + +export const getExportResponseProgressMin = 0; +export const getExportResponseProgressMax = 1; + +export const GetExportResponse = zod.object({ + id: zod.string().min(1), + status: zod + .string() + .describe( + "preparing: the bundle is being written. ready: every part can be downloaded. failed: it stopped; error says why, and starting another export tries again. A later OpenBot may add a status; read one you don't know as preparing.", + ), + formatVersion: zod + .int() + .min(1) + .optional() + .describe("The bundle's format, once ready. This OpenBot writes 1."), + createdAt: zod.iso.datetime({ offset: true }), + expiresAt: zod.iso + .datetime({ offset: true }) + .describe("When the bundle is removed."), + totalBytes: zod + .int() + .min(getExportResponseTotalBytesMin) + .optional() + .describe("The bundle's size, once ready."), + parts: zod + .array( + zod.object({ + number: zod.int().min(1), + bytes: zod.int().min(1), + sha256: zod.string().regex(getExportResponsePartsItemSha256RegExp), + }), + ) + .optional() + .describe("The bundle's parts in order, once ready."), + counts: zod + .array( + zod.object({ + kind: zod + .string() + .describe( + "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", + ), + count: zod.int().min(getExportResponseCountsItemCountMin), + }), + ) + .optional() + .describe("Everything in the bundle by kind, once ready."), + reconnect: zod + .array( + zod + .object({ + appId: zod + .string() + .min(1) + .describe( + "The app's id in the app directory, such as gmail or slack.", + ), + appName: zod + .string() + .min(1) + .describe("The app's name as a person reads it."), + accountLabel: zod + .string() + .min(1) + .optional() + .describe( + "Which account it was connected as, such as an email address or a workspace name, when known.", + ), + iconUrl: zod + .url() + .optional() + .describe("The app's icon, when the directory has one."), + botNames: zod + .array(zod.string()) + .optional() + .describe( + "The Bots that used it, so the person knows which to check.", + ), + }) + .describe( + "A connection to an app that doesn't move, because its sign-in stays on the person's computer: the person connects it again on OpenBot Cloud. Never carries a token, a password or a key.", + ), + ) + .optional() + .describe("The apps to connect again on OpenBot Cloud."), + includesModelKeys: zod.boolean(), + progress: zod + .number() + .min(getExportResponseProgressMin) + .max(getExportResponseProgressMax) + .optional() + .describe("How far writing the bundle has got, while preparing."), + error: zod + .string() + .min(1) + .optional() + .describe("What went wrong, when failed, in a sentence a person reads."), +}); + +/** + * Remove the caller's export and its bundle from disk. Nothing it was made from changes. One already gone answers 204 too. + * @summary Remove an export + */ + +export const deleteExportPathExportIdMax = 64; + +export const deleteExportPathExportIdRegExp = new RegExp("^[A-Za-z0-9_-]+$"); + +export const DeleteExportParams = zod.object({ + organizationId: zod + .string() + .min(1) + .describe( + "The organization, by its id or its slug. One the caller is not a member of answers as one that does not exist, `default` included.", + ), + exportId: zod + .string() + .min(1) + .max(deleteExportPathExportIdMax) + .regex(deleteExportPathExportIdRegExp) + .describe("The export's id."), +}); + +export const deleteExportHeaderIdempotencyKeyMax = 128; + +export const DeleteExportHeader = zod.object({ + "Idempotency-Key": zod + .string() + .min(1) + .max(deleteExportHeaderIdempotencyKeyMax) + .describe( + "Generated by the caller for each write it means to make once. Reuse the same key and the same request for 24 hours after an uncertain response; the same key with a different request is a conflict.", + ), +}); + +export const DeleteExportResponse = zod.void(); + +/** + * Return one part of a ready export's bundle, as bytes to hand to uploadImportPart unchanged. A Range header of one byte range (bytes=N- or bytes=N-M) answers 206 with that range, so a dropped download resumes where it stopped. The SHA-256 of the whole part is in the export's parts and in the ETag. Only the person who made the export downloads it. + * @summary Download one part of an export's bundle + */ + +export const downloadExportPartPathExportIdMax = 64; + +export const downloadExportPartPathExportIdRegExp = new RegExp( + "^[A-Za-z0-9_-]+$", +); +export const downloadExportPartPathPartNumberMax = 10000; + +export const DownloadExportPartParams = zod.object({ + organizationId: zod + .string() + .min(1) + .describe( + "The organization, by its id or its slug. One the caller is not a member of answers as one that does not exist, `default` included.", + ), + exportId: zod + .string() + .min(1) + .max(downloadExportPartPathExportIdMax) + .regex(downloadExportPartPathExportIdRegExp) + .describe("The export's id."), + partNumber: zod + .int() + .min(1) + .max(downloadExportPartPathPartNumberMax) + .describe("Which part of the bundle, counted from 1."), +}); + +export const downloadExportPartHeaderRangeMax = 64; + +export const downloadExportPartHeaderRangeRegExp = new RegExp( + "^bytes=[0-9]+-[0-9]*$", +); + +export const DownloadExportPartHeader = zod.object({ + Range: zod + .string() + .max(downloadExportPartHeaderRangeMax) + .regex(downloadExportPartHeaderRangeRegExp) + .optional() + .describe("One byte range of the part, as RFC 9110 writes it."), +}); + +export const DownloadExportPartResponse = zod.unknown(); + +/** + * Start an import of what the caller is moving from an OpenBot on their own computer into this organization, the caller's own organization by default. Everything imported belongs to the caller, in this organization only. The answer carries recipientKey, a public key made for this import alone: pass it to createExport, and a model key in the bundle is sealed to it, readable only by this import. The answer also says how big a bundle and a part may be. Then upload the export's parts with uploadImportPart and apply them with applyImport. + * + * Importing is safe to repeat: an import of the same OpenBot into the same organization (an export made again, or a new import after a dropped one) adds only what isn't here yet and duplicates nothing. Served only by OpenBot Cloud; elsewhere it answers 404 with the code MOVE_UNAVAILABLE. A person starts at most 10 imports a day. + * @summary Start importing a bundle into this organization + */ + +export const CreateImportParams = zod.object({ + organizationId: zod + .string() + .min(1) + .describe( + "The organization, by its id or its slug. One the caller is not a member of answers as one that does not exist, `default` included.", + ), +}); + +export const createImportHeaderIdempotencyKeyMax = 128; + +export const CreateImportHeader = zod.object({ + "Idempotency-Key": zod + .string() + .min(1) + .max(createImportHeaderIdempotencyKeyMax) + .describe( + "Generated by the caller for each write it means to make once. Reuse the same key and the same request for 24 hours after an uncertain response; the same key with a different request is a conflict.", + ), +}); + +export const createImportBodySourceNameMax = 200; + +export const CreateImportBody = zod.object({ + sourceName: zod + .string() + .min(1) + .max(createImportBodySourceNameMax) + .optional() + .describe( + "A name for where the bundle comes from, such as the computer's name, shown in the list of imports.", + ), +}); + +export const createImportResponseRecipientKeyNMax = 1024; + +export const createImportResponseRecipientKeyEMax = 16; + +export const createImportResponseRecipientKeyKidMax = 128; + +export const createImportResponseExpectedPartsItemSha256RegExp = new RegExp( + "^[0-9a-f]{64}$", +); + +export const createImportResponseExpectedItemCountMin = 0; + +export const createImportResponseImportedItemCountMin = 0; + +export const CreateImportResponse = zod.object({ + id: zod.string().min(1), + status: zod + .string() + .describe( + "waiting-for-bundle: no part has arrived. receiving: part 1 has arrived and others are still to come. ready: every part arrived; apply it. importing: being imported. imported: done; read the summary, then verify. failed: it stopped; error says why, and applying again goes on from there. A later OpenBot may add a status; read one you don't know as importing.", + ), + sourceName: zod.string().optional(), + createdAt: zod.iso.datetime({ offset: true }), + finishedAt: zod.iso.datetime({ offset: true }).optional(), + recipientKey: zod + .object({ + kty: zod.literal("RSA"), + n: zod.string().min(1).max(createImportResponseRecipientKeyNMax), + e: zod.string().min(1).max(createImportResponseRecipientKeyEMax), + alg: zod.literal("RSA-OAEP-256"), + kid: zod.string().min(1).max(createImportResponseRecipientKeyKidMax), + }) + .describe( + "A public key as a JSON Web Key (RFC 7517): RSA, 4096 bits, for RSA-OAEP-256. A model key is sealed to it as a JWE (RFC 7516, RSA-OAEP-256 with A256GCM), so only the import that made it reads it.", + ), + maxBundleBytes: zod.int().min(1), + maxPartBytes: zod.int().min(1), + expectedParts: zod + .array( + zod.object({ + number: zod.int().min(1), + bytes: zod.int().min(1), + sha256: zod + .string() + .regex(createImportResponseExpectedPartsItemSha256RegExp), + }), + ) + .optional() + .describe("The bundle's parts, from its manifest, once part 1 arrived."), + receivedParts: zod + .array(zod.int().min(1)) + .describe("The numbers of the parts that arrived."), + expected: zod + .array( + zod.object({ + kind: zod + .string() + .describe( + "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", + ), + count: zod.int().min(createImportResponseExpectedItemCountMin), + }), + ) + .optional() + .describe( + "Everything the bundle holds by kind, from its manifest, once part 1 arrived.", + ), + imported: zod + .array( + zod.object({ + kind: zod + .string() + .describe( + "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", + ), + count: zod.int().min(createImportResponseImportedItemCountMin), + }), + ) + .optional() + .describe( + "What has been imported so far by kind, while importing and once imported. Items a repeated import found already here count as imported.", + ), + notes: zod + .array( + zod + .object({ + code: zod + .string() + .describe( + "isolated-bot-made-ordinary: OpenBot Cloud has no isolated computers, so a Bot that had one runs on an ordinary one. business-plan-feature-left-out: the feature needs the Business plan and this organization isn't on it. model-key-kept-existing: the person already had an AI connection here, which was kept. model-key-not-brought: the person chose not to bring a model key. item-skipped: one item couldn't be imported; message says which and why. A later OpenBot may add a code; show the message.", + ), + kind: zod + .string() + .optional() + .describe( + "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", + ), + count: zod + .int() + .min(1) + .optional() + .describe("How many items the note is about."), + message: zod.string().min(1), + items: zod + .array(zod.string()) + .optional() + .describe( + "The names of the items, such as the Bots, when there are a few.", + ), + }) + .describe( + "Something that moved differently, or not at all, and why, in a sentence a person reads.", + ), + ) + .optional(), + reconnect: zod + .array( + zod + .object({ + appId: zod + .string() + .min(1) + .describe( + "The app's id in the app directory, such as gmail or slack.", + ), + appName: zod + .string() + .min(1) + .describe("The app's name as a person reads it."), + accountLabel: zod + .string() + .min(1) + .optional() + .describe( + "Which account it was connected as, such as an email address or a workspace name, when known.", + ), + iconUrl: zod + .url() + .optional() + .describe("The app's icon, when the directory has one."), + botNames: zod + .array(zod.string()) + .optional() + .describe( + "The Bots that used it, so the person knows which to check.", + ), + }) + .describe( + "A connection to an app that doesn't move, because its sign-in stays on the person's computer: the person connects it again on OpenBot Cloud. Never carries a token, a password or a key.", + ), + ) + .optional() + .describe("The apps to connect again here, once part 1 arrived."), + error: zod + .string() + .min(1) + .optional() + .describe("What went wrong, when failed, in a sentence a person reads."), +}); + +/** + * List the imports the caller started in this organization, newest first, so an app that lost track of one after a drop finds it again. Only the caller's own. Served only by OpenBot Cloud. + * @summary List the caller's imports into this organization + */ + +export const ListImportsParams = zod.object({ + organizationId: zod + .string() + .min(1) + .describe( + "The organization, by its id or its slug. One the caller is not a member of answers as one that does not exist, `default` included.", + ), +}); + +export const listImportsQueryLimitDefault = 50; +export const listImportsQueryLimitMax = 100; + +export const listImportsQueryCursorMax = 4096; + +export const listImportsQueryCursorRegExp = new RegExp("^[A-Za-z0-9_-]+$"); + +export const ListImportsQueryParams = zod.object({ + limit: zod + .int() + .min(1) + .max(listImportsQueryLimitMax) + .default(listImportsQueryLimitDefault) + .describe("Most items in one page."), + cursor: zod + .string() + .min(1) + .max(listImportsQueryCursorMax) + .regex(listImportsQueryCursorRegExp) + .optional() + .describe( + "Opaque continuation from the previous page's nextCursor, bound to the organization and the filters that made it. The server only ever issues cursors written in URL-safe base64 (letters, digits, - and _, no padding) and refuses anything else, so the pattern says so. A cursor that fits the pattern can still be refused: one this list never gave out, or one made for another organization or other filters.", + ), +}); + +export const listImportsResponseItemsItemRecipientKeyNMax = 1024; + +export const listImportsResponseItemsItemRecipientKeyEMax = 16; + +export const listImportsResponseItemsItemRecipientKeyKidMax = 128; + +export const listImportsResponseItemsItemExpectedPartsItemSha256RegExp = + new RegExp("^[0-9a-f]{64}$"); + +export const listImportsResponseItemsItemExpectedItemCountMin = 0; + +export const listImportsResponseItemsItemImportedItemCountMin = 0; + +export const ListImportsResponse = zod.object({ + items: zod.array( + zod.object({ + id: zod.string().min(1), + status: zod + .string() + .describe( + "waiting-for-bundle: no part has arrived. receiving: part 1 has arrived and others are still to come. ready: every part arrived; apply it. importing: being imported. imported: done; read the summary, then verify. failed: it stopped; error says why, and applying again goes on from there. A later OpenBot may add a status; read one you don't know as importing.", + ), + sourceName: zod.string().optional(), + createdAt: zod.iso.datetime({ offset: true }), + finishedAt: zod.iso.datetime({ offset: true }).optional(), + recipientKey: zod + .object({ + kty: zod.literal("RSA"), + n: zod + .string() + .min(1) + .max(listImportsResponseItemsItemRecipientKeyNMax), + e: zod + .string() + .min(1) + .max(listImportsResponseItemsItemRecipientKeyEMax), + alg: zod.literal("RSA-OAEP-256"), + kid: zod + .string() + .min(1) + .max(listImportsResponseItemsItemRecipientKeyKidMax), + }) + .describe( + "A public key as a JSON Web Key (RFC 7517): RSA, 4096 bits, for RSA-OAEP-256. A model key is sealed to it as a JWE (RFC 7516, RSA-OAEP-256 with A256GCM), so only the import that made it reads it.", + ), + maxBundleBytes: zod.int().min(1), + maxPartBytes: zod.int().min(1), + expectedParts: zod + .array( + zod.object({ + number: zod.int().min(1), + bytes: zod.int().min(1), + sha256: zod + .string() + .regex(listImportsResponseItemsItemExpectedPartsItemSha256RegExp), + }), + ) + .optional() + .describe( + "The bundle's parts, from its manifest, once part 1 arrived.", + ), + receivedParts: zod + .array(zod.int().min(1)) + .describe("The numbers of the parts that arrived."), + expected: zod + .array( + zod.object({ + kind: zod + .string() + .describe( + "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", + ), + count: zod + .int() + .min(listImportsResponseItemsItemExpectedItemCountMin), + }), + ) + .optional() + .describe( + "Everything the bundle holds by kind, from its manifest, once part 1 arrived.", + ), + imported: zod + .array( + zod.object({ + kind: zod + .string() + .describe( + "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", + ), + count: zod + .int() + .min(listImportsResponseItemsItemImportedItemCountMin), + }), + ) + .optional() + .describe( + "What has been imported so far by kind, while importing and once imported. Items a repeated import found already here count as imported.", + ), + notes: zod + .array( + zod + .object({ + code: zod + .string() + .describe( + "isolated-bot-made-ordinary: OpenBot Cloud has no isolated computers, so a Bot that had one runs on an ordinary one. business-plan-feature-left-out: the feature needs the Business plan and this organization isn't on it. model-key-kept-existing: the person already had an AI connection here, which was kept. model-key-not-brought: the person chose not to bring a model key. item-skipped: one item couldn't be imported; message says which and why. A later OpenBot may add a code; show the message.", + ), + kind: zod + .string() + .optional() + .describe( + "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", + ), + count: zod + .int() + .min(1) + .optional() + .describe("How many items the note is about."), + message: zod.string().min(1), + items: zod + .array(zod.string()) + .optional() + .describe( + "The names of the items, such as the Bots, when there are a few.", + ), + }) + .describe( + "Something that moved differently, or not at all, and why, in a sentence a person reads.", + ), + ) + .optional(), + reconnect: zod + .array( + zod + .object({ + appId: zod + .string() + .min(1) + .describe( + "The app's id in the app directory, such as gmail or slack.", + ), + appName: zod + .string() + .min(1) + .describe("The app's name as a person reads it."), + accountLabel: zod + .string() + .min(1) + .optional() + .describe( + "Which account it was connected as, such as an email address or a workspace name, when known.", + ), + iconUrl: zod + .url() + .optional() + .describe("The app's icon, when the directory has one."), + botNames: zod + .array(zod.string()) + .optional() + .describe( + "The Bots that used it, so the person knows which to check.", + ), + }) + .describe( + "A connection to an app that doesn't move, because its sign-in stays on the person's computer: the person connects it again on OpenBot Cloud. Never carries a token, a password or a key.", + ), + ) + .optional() + .describe("The apps to connect again here, once part 1 arrived."), + error: zod + .string() + .min(1) + .optional() + .describe( + "What went wrong, when failed, in a sentence a person reads.", + ), + }), + ), + nextCursor: zod.string().nullable(), +}); + +/** + * Return where the caller's import stands: which parts have arrived, how far applying them has got by kind, and once imported, the summary: what was imported, what was imported differently or left out on OpenBot Cloud and why (notes), and which apps to connect again (reconnect). Only the person who started it reads it. + * @summary Read an import + */ + +export const getImportPathImportIdMax = 64; + +export const getImportPathImportIdRegExp = new RegExp("^[A-Za-z0-9_-]+$"); + +export const GetImportParams = zod.object({ + organizationId: zod + .string() + .min(1) + .describe( + "The organization, by its id or its slug. One the caller is not a member of answers as one that does not exist, `default` included.", + ), + importId: zod + .string() + .min(1) + .max(getImportPathImportIdMax) + .regex(getImportPathImportIdRegExp) + .describe("The import's id."), +}); + +export const getImportResponseRecipientKeyNMax = 1024; + +export const getImportResponseRecipientKeyEMax = 16; + +export const getImportResponseRecipientKeyKidMax = 128; + +export const getImportResponseExpectedPartsItemSha256RegExp = new RegExp( + "^[0-9a-f]{64}$", +); + +export const getImportResponseExpectedItemCountMin = 0; + +export const getImportResponseImportedItemCountMin = 0; + +export const GetImportResponse = zod.object({ + id: zod.string().min(1), + status: zod + .string() + .describe( + "waiting-for-bundle: no part has arrived. receiving: part 1 has arrived and others are still to come. ready: every part arrived; apply it. importing: being imported. imported: done; read the summary, then verify. failed: it stopped; error says why, and applying again goes on from there. A later OpenBot may add a status; read one you don't know as importing.", + ), + sourceName: zod.string().optional(), + createdAt: zod.iso.datetime({ offset: true }), + finishedAt: zod.iso.datetime({ offset: true }).optional(), + recipientKey: zod + .object({ + kty: zod.literal("RSA"), + n: zod.string().min(1).max(getImportResponseRecipientKeyNMax), + e: zod.string().min(1).max(getImportResponseRecipientKeyEMax), + alg: zod.literal("RSA-OAEP-256"), + kid: zod.string().min(1).max(getImportResponseRecipientKeyKidMax), + }) + .describe( + "A public key as a JSON Web Key (RFC 7517): RSA, 4096 bits, for RSA-OAEP-256. A model key is sealed to it as a JWE (RFC 7516, RSA-OAEP-256 with A256GCM), so only the import that made it reads it.", + ), + maxBundleBytes: zod.int().min(1), + maxPartBytes: zod.int().min(1), + expectedParts: zod + .array( + zod.object({ + number: zod.int().min(1), + bytes: zod.int().min(1), + sha256: zod + .string() + .regex(getImportResponseExpectedPartsItemSha256RegExp), + }), + ) + .optional() + .describe("The bundle's parts, from its manifest, once part 1 arrived."), + receivedParts: zod + .array(zod.int().min(1)) + .describe("The numbers of the parts that arrived."), + expected: zod + .array( + zod.object({ + kind: zod + .string() + .describe( + "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", + ), + count: zod.int().min(getImportResponseExpectedItemCountMin), + }), + ) + .optional() + .describe( + "Everything the bundle holds by kind, from its manifest, once part 1 arrived.", + ), + imported: zod + .array( + zod.object({ + kind: zod + .string() + .describe( + "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", + ), + count: zod.int().min(getImportResponseImportedItemCountMin), + }), + ) + .optional() + .describe( + "What has been imported so far by kind, while importing and once imported. Items a repeated import found already here count as imported.", + ), + notes: zod + .array( + zod + .object({ + code: zod + .string() + .describe( + "isolated-bot-made-ordinary: OpenBot Cloud has no isolated computers, so a Bot that had one runs on an ordinary one. business-plan-feature-left-out: the feature needs the Business plan and this organization isn't on it. model-key-kept-existing: the person already had an AI connection here, which was kept. model-key-not-brought: the person chose not to bring a model key. item-skipped: one item couldn't be imported; message says which and why. A later OpenBot may add a code; show the message.", + ), + kind: zod + .string() + .optional() + .describe( + "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", + ), + count: zod + .int() + .min(1) + .optional() + .describe("How many items the note is about."), + message: zod.string().min(1), + items: zod + .array(zod.string()) + .optional() + .describe( + "The names of the items, such as the Bots, when there are a few.", + ), + }) + .describe( + "Something that moved differently, or not at all, and why, in a sentence a person reads.", + ), + ) + .optional(), + reconnect: zod + .array( + zod + .object({ + appId: zod + .string() + .min(1) + .describe( + "The app's id in the app directory, such as gmail or slack.", + ), + appName: zod + .string() + .min(1) + .describe("The app's name as a person reads it."), + accountLabel: zod + .string() + .min(1) + .optional() + .describe( + "Which account it was connected as, such as an email address or a workspace name, when known.", + ), + iconUrl: zod + .url() + .optional() + .describe("The app's icon, when the directory has one."), + botNames: zod + .array(zod.string()) + .optional() + .describe( + "The Bots that used it, so the person knows which to check.", + ), + }) + .describe( + "A connection to an app that doesn't move, because its sign-in stays on the person's computer: the person connects it again on OpenBot Cloud. Never carries a token, a password or a key.", + ), + ) + .optional() + .describe("The apps to connect again here, once part 1 arrived."), + error: zod + .string() + .min(1) + .optional() + .describe("What went wrong, when failed, in a sentence a person reads."), +}); + +/** + * Upload one part of the export's bundle, exactly as downloadExportPart gave it. Part 1 carries the bundle's manifest, so it is uploaded first; after it the parts go in any order, and the import's expectedParts says how many there are and the SHA-256 of each. A part whose bytes don't match the manifest is refused (IMPORT_PART_MISMATCH) and can be uploaded again. Uploading a part that already arrived changes nothing and answers 200 again, so after a drop an app sends whatever receivedParts doesn't list. A part is at most 32 MiB, and a bundle at most maxBundleBytes. At most 120 parts a minute for each person. + * @summary Upload one part of the bundle + */ + +export const uploadImportPartPathImportIdMax = 64; + +export const uploadImportPartPathImportIdRegExp = new RegExp( + "^[A-Za-z0-9_-]+$", +); +export const uploadImportPartPathPartNumberMax = 10000; + +export const UploadImportPartParams = zod.object({ + organizationId: zod + .string() + .min(1) + .describe( + "The organization, by its id or its slug. One the caller is not a member of answers as one that does not exist, `default` included.", + ), + importId: zod + .string() + .min(1) + .max(uploadImportPartPathImportIdMax) + .regex(uploadImportPartPathImportIdRegExp) + .describe("The import's id."), + partNumber: zod + .int() + .min(1) + .max(uploadImportPartPathPartNumberMax) + .describe("Which part of the bundle, counted from 1."), +}); + +export const uploadImportPartHeaderIdempotencyKeyMax = 128; + +export const UploadImportPartHeader = zod.object({ + "Idempotency-Key": zod + .string() + .min(1) + .max(uploadImportPartHeaderIdempotencyKeyMax) + .describe( + "Generated by the caller for each write it means to make once. Reuse the same key and the same request for 24 hours after an uncertain response; the same key with a different request is a conflict.", + ), +}); + +export const uploadImportPartResponseRecipientKeyNMax = 1024; + +export const uploadImportPartResponseRecipientKeyEMax = 16; + +export const uploadImportPartResponseRecipientKeyKidMax = 128; + +export const uploadImportPartResponseExpectedPartsItemSha256RegExp = new RegExp( + "^[0-9a-f]{64}$", +); + +export const uploadImportPartResponseExpectedItemCountMin = 0; + +export const uploadImportPartResponseImportedItemCountMin = 0; + +export const UploadImportPartResponse = zod.object({ + id: zod.string().min(1), + status: zod + .string() + .describe( + "waiting-for-bundle: no part has arrived. receiving: part 1 has arrived and others are still to come. ready: every part arrived; apply it. importing: being imported. imported: done; read the summary, then verify. failed: it stopped; error says why, and applying again goes on from there. A later OpenBot may add a status; read one you don't know as importing.", + ), + sourceName: zod.string().optional(), + createdAt: zod.iso.datetime({ offset: true }), + finishedAt: zod.iso.datetime({ offset: true }).optional(), + recipientKey: zod + .object({ + kty: zod.literal("RSA"), + n: zod.string().min(1).max(uploadImportPartResponseRecipientKeyNMax), + e: zod.string().min(1).max(uploadImportPartResponseRecipientKeyEMax), + alg: zod.literal("RSA-OAEP-256"), + kid: zod.string().min(1).max(uploadImportPartResponseRecipientKeyKidMax), + }) + .describe( + "A public key as a JSON Web Key (RFC 7517): RSA, 4096 bits, for RSA-OAEP-256. A model key is sealed to it as a JWE (RFC 7516, RSA-OAEP-256 with A256GCM), so only the import that made it reads it.", + ), + maxBundleBytes: zod.int().min(1), + maxPartBytes: zod.int().min(1), + expectedParts: zod + .array( + zod.object({ + number: zod.int().min(1), + bytes: zod.int().min(1), + sha256: zod + .string() + .regex(uploadImportPartResponseExpectedPartsItemSha256RegExp), + }), + ) + .optional() + .describe("The bundle's parts, from its manifest, once part 1 arrived."), + receivedParts: zod + .array(zod.int().min(1)) + .describe("The numbers of the parts that arrived."), + expected: zod + .array( + zod.object({ + kind: zod + .string() + .describe( + "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", + ), + count: zod.int().min(uploadImportPartResponseExpectedItemCountMin), + }), + ) + .optional() + .describe( + "Everything the bundle holds by kind, from its manifest, once part 1 arrived.", + ), + imported: zod + .array( + zod.object({ + kind: zod + .string() + .describe( + "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", + ), + count: zod.int().min(uploadImportPartResponseImportedItemCountMin), + }), + ) + .optional() + .describe( + "What has been imported so far by kind, while importing and once imported. Items a repeated import found already here count as imported.", + ), + notes: zod + .array( + zod + .object({ + code: zod + .string() + .describe( + "isolated-bot-made-ordinary: OpenBot Cloud has no isolated computers, so a Bot that had one runs on an ordinary one. business-plan-feature-left-out: the feature needs the Business plan and this organization isn't on it. model-key-kept-existing: the person already had an AI connection here, which was kept. model-key-not-brought: the person chose not to bring a model key. item-skipped: one item couldn't be imported; message says which and why. A later OpenBot may add a code; show the message.", + ), + kind: zod + .string() + .optional() + .describe( + "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", + ), + count: zod + .int() + .min(1) + .optional() + .describe("How many items the note is about."), + message: zod.string().min(1), + items: zod + .array(zod.string()) + .optional() + .describe( + "The names of the items, such as the Bots, when there are a few.", + ), + }) + .describe( + "Something that moved differently, or not at all, and why, in a sentence a person reads.", + ), + ) + .optional(), + reconnect: zod + .array( + zod + .object({ + appId: zod + .string() + .min(1) + .describe( + "The app's id in the app directory, such as gmail or slack.", + ), + appName: zod + .string() + .min(1) + .describe("The app's name as a person reads it."), + accountLabel: zod + .string() + .min(1) + .optional() + .describe( + "Which account it was connected as, such as an email address or a workspace name, when known.", + ), + iconUrl: zod + .url() + .optional() + .describe("The app's icon, when the directory has one."), + botNames: zod + .array(zod.string()) + .optional() + .describe( + "The Bots that used it, so the person knows which to check.", + ), + }) + .describe( + "A connection to an app that doesn't move, because its sign-in stays on the person's computer: the person connects it again on OpenBot Cloud. Never carries a token, a password or a key.", + ), + ) + .optional() + .describe("The apps to connect again here, once part 1 arrived."), + error: zod + .string() + .min(1) + .optional() + .describe("What went wrong, when failed, in a sentence a person reads."), +}); + +/** + * Once every part has arrived, import the bundle into this organization in the background: every id is given a new one here, everything is owned by the caller, and nothing reaches another organization. Read getImport until status is imported or failed. Applying again while it runs, or after it finished, changes nothing and answers where it stands; applying a failed import tries again from where it stopped, and nothing already imported is imported twice. A missing part answers 409 with IMPORT_INCOMPLETE. + * + * What OpenBot Cloud doesn't have comes in differently, and the summary says so in notes: a Bot that ran on its own isolated computer comes in as an ordinary Bot; a feature that needs the Business plan, in an organization that isn't on it, is left out. A model key in the bundle becomes the caller's own AI connection, unless they have one here already, which is kept. + * @summary Import the uploaded bundle + */ + +export const applyImportPathImportIdMax = 64; + +export const applyImportPathImportIdRegExp = new RegExp("^[A-Za-z0-9_-]+$"); + +export const ApplyImportParams = zod.object({ + organizationId: zod + .string() + .min(1) + .describe( + "The organization, by its id or its slug. One the caller is not a member of answers as one that does not exist, `default` included.", + ), + importId: zod + .string() + .min(1) + .max(applyImportPathImportIdMax) + .regex(applyImportPathImportIdRegExp) + .describe("The import's id."), +}); + +export const applyImportHeaderIdempotencyKeyMax = 128; + +export const ApplyImportHeader = zod.object({ + "Idempotency-Key": zod + .string() + .min(1) + .max(applyImportHeaderIdempotencyKeyMax) + .describe( + "Generated by the caller for each write it means to make once. Reuse the same key and the same request for 24 hours after an uncertain response; the same key with a different request is a conflict.", + ), +}); + +export const applyImportResponseRecipientKeyNMax = 1024; + +export const applyImportResponseRecipientKeyEMax = 16; + +export const applyImportResponseRecipientKeyKidMax = 128; + +export const applyImportResponseExpectedPartsItemSha256RegExp = new RegExp( + "^[0-9a-f]{64}$", +); + +export const applyImportResponseExpectedItemCountMin = 0; + +export const applyImportResponseImportedItemCountMin = 0; + +export const ApplyImportResponse = zod.object({ + id: zod.string().min(1), + status: zod + .string() + .describe( + "waiting-for-bundle: no part has arrived. receiving: part 1 has arrived and others are still to come. ready: every part arrived; apply it. importing: being imported. imported: done; read the summary, then verify. failed: it stopped; error says why, and applying again goes on from there. A later OpenBot may add a status; read one you don't know as importing.", + ), + sourceName: zod.string().optional(), + createdAt: zod.iso.datetime({ offset: true }), + finishedAt: zod.iso.datetime({ offset: true }).optional(), + recipientKey: zod + .object({ + kty: zod.literal("RSA"), + n: zod.string().min(1).max(applyImportResponseRecipientKeyNMax), + e: zod.string().min(1).max(applyImportResponseRecipientKeyEMax), + alg: zod.literal("RSA-OAEP-256"), + kid: zod.string().min(1).max(applyImportResponseRecipientKeyKidMax), + }) + .describe( + "A public key as a JSON Web Key (RFC 7517): RSA, 4096 bits, for RSA-OAEP-256. A model key is sealed to it as a JWE (RFC 7516, RSA-OAEP-256 with A256GCM), so only the import that made it reads it.", + ), + maxBundleBytes: zod.int().min(1), + maxPartBytes: zod.int().min(1), + expectedParts: zod + .array( + zod.object({ + number: zod.int().min(1), + bytes: zod.int().min(1), + sha256: zod + .string() + .regex(applyImportResponseExpectedPartsItemSha256RegExp), + }), + ) + .optional() + .describe("The bundle's parts, from its manifest, once part 1 arrived."), + receivedParts: zod + .array(zod.int().min(1)) + .describe("The numbers of the parts that arrived."), + expected: zod + .array( + zod.object({ + kind: zod + .string() + .describe( + "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", + ), + count: zod.int().min(applyImportResponseExpectedItemCountMin), + }), + ) + .optional() + .describe( + "Everything the bundle holds by kind, from its manifest, once part 1 arrived.", + ), + imported: zod + .array( + zod.object({ + kind: zod + .string() + .describe( + "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", + ), + count: zod.int().min(applyImportResponseImportedItemCountMin), + }), + ) + .optional() + .describe( + "What has been imported so far by kind, while importing and once imported. Items a repeated import found already here count as imported.", + ), + notes: zod + .array( + zod + .object({ + code: zod + .string() + .describe( + "isolated-bot-made-ordinary: OpenBot Cloud has no isolated computers, so a Bot that had one runs on an ordinary one. business-plan-feature-left-out: the feature needs the Business plan and this organization isn't on it. model-key-kept-existing: the person already had an AI connection here, which was kept. model-key-not-brought: the person chose not to bring a model key. item-skipped: one item couldn't be imported; message says which and why. A later OpenBot may add a code; show the message.", + ), + kind: zod + .string() + .optional() + .describe( + "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", + ), + count: zod + .int() + .min(1) + .optional() + .describe("How many items the note is about."), + message: zod.string().min(1), + items: zod + .array(zod.string()) + .optional() + .describe( + "The names of the items, such as the Bots, when there are a few.", + ), + }) + .describe( + "Something that moved differently, or not at all, and why, in a sentence a person reads.", + ), + ) + .optional(), + reconnect: zod + .array( + zod + .object({ + appId: zod + .string() + .min(1) + .describe( + "The app's id in the app directory, such as gmail or slack.", + ), + appName: zod + .string() + .min(1) + .describe("The app's name as a person reads it."), + accountLabel: zod + .string() + .min(1) + .optional() + .describe( + "Which account it was connected as, such as an email address or a workspace name, when known.", + ), + iconUrl: zod + .url() + .optional() + .describe("The app's icon, when the directory has one."), + botNames: zod + .array(zod.string()) + .optional() + .describe( + "The Bots that used it, so the person knows which to check.", + ), + }) + .describe( + "A connection to an app that doesn't move, because its sign-in stays on the person's computer: the person connects it again on OpenBot Cloud. Never carries a token, a password or a key.", + ), + ) + .optional() + .describe("The apps to connect again here, once part 1 arrived."), + error: zod + .string() + .min(1) + .optional() + .describe("What went wrong, when failed, in a sentence a person reads."), +}); + +/** + * Count, by kind, what from this import's OpenBot is in this organization now, read from what is stored here rather than from the import's own tally, beside what the bundle held. matches is true only when every kind is all here, apart from what the notes say OpenBot Cloud left out on purpose. OpenBot Desktop removes nothing on the person's computer until it does. Also lists the apps to connect again. + * @summary Check that everything arrived + */ + +export const getImportVerificationPathImportIdMax = 64; + +export const getImportVerificationPathImportIdRegExp = new RegExp( + "^[A-Za-z0-9_-]+$", +); + +export const GetImportVerificationParams = zod.object({ + organizationId: zod + .string() + .min(1) + .describe( + "The organization, by its id or its slug. One the caller is not a member of answers as one that does not exist, `default` included.", + ), + importId: zod + .string() + .min(1) + .max(getImportVerificationPathImportIdMax) + .regex(getImportVerificationPathImportIdRegExp) + .describe("The import's id."), +}); + +export const getImportVerificationResponseKindsItemExpectedMin = 0; + +export const getImportVerificationResponseKindsItemFoundMin = 0; + +export const getImportVerificationResponseKindsItemLeftOutMin = 0; + +export const GetImportVerificationResponse = zod.object({ + importId: zod.string().min(1), + matches: zod + .boolean() + .describe("True when, for every kind, found plus leftOut is expected."), + kinds: zod.array( + zod.object({ + kind: zod + .string() + .describe( + "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", + ), + expected: zod + .int() + .min(getImportVerificationResponseKindsItemExpectedMin) + .describe("How many the bundle held."), + found: zod + .int() + .min(getImportVerificationResponseKindsItemFoundMin) + .describe("How many from this OpenBot are in this organization now."), + leftOut: zod + .int() + .min(getImportVerificationResponseKindsItemLeftOutMin) + .describe( + "How many OpenBot Cloud left out on purpose, as the notes say.", + ), + }), + ), + notes: zod.array( + zod + .object({ + code: zod + .string() + .describe( + "isolated-bot-made-ordinary: OpenBot Cloud has no isolated computers, so a Bot that had one runs on an ordinary one. business-plan-feature-left-out: the feature needs the Business plan and this organization isn't on it. model-key-kept-existing: the person already had an AI connection here, which was kept. model-key-not-brought: the person chose not to bring a model key. item-skipped: one item couldn't be imported; message says which and why. A later OpenBot may add a code; show the message.", + ), + kind: zod + .string() + .optional() + .describe( + "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", + ), + count: zod + .int() + .min(1) + .optional() + .describe("How many items the note is about."), + message: zod.string().min(1), + items: zod + .array(zod.string()) + .optional() + .describe( + "The names of the items, such as the Bots, when there are a few.", + ), + }) + .describe( + "Something that moved differently, or not at all, and why, in a sentence a person reads.", + ), + ), + reconnect: zod.array( + zod + .object({ + appId: zod + .string() + .min(1) + .describe( + "The app's id in the app directory, such as gmail or slack.", + ), + appName: zod + .string() + .min(1) + .describe("The app's name as a person reads it."), + accountLabel: zod + .string() + .min(1) + .optional() + .describe( + "Which account it was connected as, such as an email address or a workspace name, when known.", + ), + iconUrl: zod + .url() + .optional() + .describe("The app's icon, when the directory has one."), + botNames: zod + .array(zod.string()) + .optional() + .describe( + "The Bots that used it, so the person knows which to check.", + ), + }) + .describe( + "A connection to an app that doesn't move, because its sign-in stays on the person's computer: the person connects it again on OpenBot Cloud. Never carries a token, a password or a key.", + ), + ), +}); From 0b2ce103f73dac8315ea7cb1aa2d5cd4b159dc14 Mon Sep 17 00:00:00 2001 From: David McKay Date: Sat, 21 Nov 2026 15:43:43 -0800 Subject: [PATCH 02/16] API: moving to OpenBot Cloud counts files' bytes, and files land in the organization's own store MoveCount carries bytes for files, and the verification compares expectedBytes with foundBytes read from the file store. --- api/openapi.yaml | 22 +++- api/openapi/moves.yaml | 24 +++- .../api/generated/model/importVerification.ts | 2 +- .../generated/model/importVerificationKind.ts | 10 ++ app/src/lib/api/generated/model/moveCount.ts | 5 + .../moving-to-openbot-cloud.msw.ts | 32 +++++ .../moving-to-openbot-cloud.ts | 2 +- .../moving-to-openbot-cloud.zod.ts | 113 +++++++++++++++++- 8 files changed, 202 insertions(+), 8 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index 460b4b385b..71a70aee7e 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -21281,7 +21281,7 @@ paths: operationId: applyImport summary: Import the uploaded bundle description: |- - Once every part has arrived, import the bundle into this organization in the background: every id is given a new one here, everything is owned by the caller, and nothing reaches another organization. Read getImport until status is imported or failed. Applying again while it runs, or after it finished, changes nothing and answers where it stands; applying a failed import tries again from where it stopped, and nothing already imported is imported twice. A missing part answers 409 with IMPORT_INCOMPLETE. + Once every part has arrived, import the bundle into this organization in the background: every id is given a new one here, everything is owned by the caller, and nothing reaches another organization. Every file is stored where a file uploaded here is, in this organization's own place in OpenBot's file store, and the uploaded parts are removed once the import is done. Read getImport until status is imported or failed. Applying again while it runs, or after it finished, changes nothing and answers where it stands; applying a failed import tries again from where it stopped, and nothing already imported is imported twice. A missing part answers 409 with IMPORT_INCOMPLETE. What OpenBot Cloud doesn't have comes in differently, and the summary says so in notes: a Bot that ran on its own isolated computer comes in as an ordinary Bot; a feature that needs the Business plan, in an organization that isn't on it, is left out. A model key in the bundle becomes the caller's own AI connection, unless they have one here already, which is kept. security: @@ -38395,6 +38395,10 @@ components: count: type: integer minimum: 0 + bytes: + type: integer + minimum: 0 + description: For files, how many bytes they hold together. ReconnectApp: type: object description: 'A connection to an app that doesn''t move, because its sign-in stays on the person''s computer: the person connects it again on OpenBot Cloud. Never carries a token, a password or a key.' @@ -38715,6 +38719,14 @@ components: type: integer minimum: 0 description: How many OpenBot Cloud left out on purpose, as the notes say. + expectedBytes: + type: integer + minimum: 0 + description: For files, how many bytes the bundle held. + foundBytes: + type: integer + minimum: 0 + description: For files, how many bytes are in this organization's file store now, read from the store itself. ImportVerification: type: object required: @@ -38729,7 +38741,7 @@ components: minLength: 1 matches: type: boolean - description: True when, for every kind, found plus leftOut is expected. + description: True when, for every kind, found plus leftOut is expected, and for files foundBytes is expectedBytes. kinds: type: array items: @@ -49116,6 +49128,12 @@ components: expected: 2814 found: 2814 leftOut: 0 + - kind: files + expected: 64 + found: 64 + leftOut: 0 + expectedBytes: 152043520 + foundBytes: 152043520 notes: [] reconnect: - appId: gmail diff --git a/api/openapi/moves.yaml b/api/openapi/moves.yaml index ed6930f4e5..f8d19b40ea 100644 --- a/api/openapi/moves.yaml +++ b/api/openapi/moves.yaml @@ -480,7 +480,10 @@ paths: description: >- Once every part has arrived, import the bundle into this organization in the background: every id is given a new one here, everything is - owned by the caller, and nothing reaches another organization. Read + owned by the caller, and nothing reaches another organization. Every + file is stored where a file uploaded here is, in this organization's + own place in OpenBot's file store, and the uploaded parts are removed + once the import is done. Read getImport until status is imported or failed. Applying again while it runs, or after it finished, changes nothing and answers where it stands; applying a failed import tries again from where it stopped, @@ -643,6 +646,10 @@ components: count: type: integer minimum: 0 + bytes: + type: integer + minimum: 0 + description: For files, how many bytes they hold together. ReconnectApp: type: object description: >- @@ -952,6 +959,16 @@ components: type: integer minimum: 0 description: How many OpenBot Cloud left out on purpose, as the notes say. + expectedBytes: + type: integer + minimum: 0 + description: For files, how many bytes the bundle held. + foundBytes: + type: integer + minimum: 0 + description: >- + For files, how many bytes are in this organization's file store + now, read from the store itself. ImportVerification: type: object required: [importId, matches, kinds, notes, reconnect] @@ -961,7 +978,9 @@ components: minLength: 1 matches: type: boolean - description: True when, for every kind, found plus leftOut is expected. + description: >- + True when, for every kind, found plus leftOut is expected, and for + files foundBytes is expectedBytes. kinds: type: array items: @@ -1259,6 +1278,7 @@ components: - { kind: bots, expected: 4, found: 4, leftOut: 0 } - { kind: conversations, expected: 37, found: 37, leftOut: 0 } - { kind: messages, expected: 2814, found: 2814, leftOut: 0 } + - { kind: files, expected: 64, found: 64, leftOut: 0, expectedBytes: 152043520, foundBytes: 152043520 } notes: [] reconnect: - { appId: gmail, appName: Gmail, accountLabel: sam@example.com } diff --git a/app/src/lib/api/generated/model/importVerification.ts b/app/src/lib/api/generated/model/importVerification.ts index d1eaff0ba9..d5f3e0bada 100644 --- a/app/src/lib/api/generated/model/importVerification.ts +++ b/app/src/lib/api/generated/model/importVerification.ts @@ -8,7 +8,7 @@ import type { ReconnectApp } from "./reconnectApp"; export interface ImportVerification { /** @minLength 1 */ importId: string; - /** True when, for every kind, found plus leftOut is expected. */ + /** True when, for every kind, found plus leftOut is expected, and for files foundBytes is expectedBytes. */ matches: boolean; kinds: ImportVerificationKind[]; notes: MoveNote[]; diff --git a/app/src/lib/api/generated/model/importVerificationKind.ts b/app/src/lib/api/generated/model/importVerificationKind.ts index bc39dc25a1..9bb8dce352 100644 --- a/app/src/lib/api/generated/model/importVerificationKind.ts +++ b/app/src/lib/api/generated/model/importVerificationKind.ts @@ -20,4 +20,14 @@ export interface ImportVerificationKind { * @minimum 0 */ leftOut: number; + /** + * For files, how many bytes the bundle held. + * @minimum 0 + */ + expectedBytes?: number; + /** + * For files, how many bytes are in this organization's file store now, read from the store itself. + * @minimum 0 + */ + foundBytes?: number; } diff --git a/app/src/lib/api/generated/model/moveCount.ts b/app/src/lib/api/generated/model/moveCount.ts index c92b43f0e8..9e2ad5065d 100644 --- a/app/src/lib/api/generated/model/moveCount.ts +++ b/app/src/lib/api/generated/model/moveCount.ts @@ -7,4 +7,9 @@ export interface MoveCount { kind: MoveKind; /** @minimum 0 */ count: number; + /** + * For files, how many bytes they hold together. + * @minimum 0 + */ + bytes?: number; } diff --git a/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.msw.ts b/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.msw.ts index 35eb236e46..272f491cd3 100644 --- a/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.msw.ts +++ b/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.msw.ts @@ -138,6 +138,10 @@ export const getListImportsResponseMock = ( ).map(() => ({ kind: faker.string.alpha({ length: { min: 10, max: 20 } }), count: faker.number.int({ min: 0 }), + bytes: faker.helpers.arrayElement([ + faker.number.int({ min: 0 }), + undefined, + ]), })), undefined, ]), @@ -148,6 +152,10 @@ export const getListImportsResponseMock = ( ).map(() => ({ kind: faker.string.alpha({ length: { min: 10, max: 20 } }), count: faker.number.int({ min: 0 }), + bytes: faker.helpers.arrayElement([ + faker.number.int({ min: 0 }), + undefined, + ]), })), undefined, ]), @@ -272,6 +280,10 @@ export const getUploadImportPartResponseMock = ( ).map(() => ({ kind: faker.string.alpha({ length: { min: 10, max: 20 } }), count: faker.number.int({ min: 0 }), + bytes: faker.helpers.arrayElement([ + faker.number.int({ min: 0 }), + undefined, + ]), })), undefined, ]), @@ -282,6 +294,10 @@ export const getUploadImportPartResponseMock = ( ).map(() => ({ kind: faker.string.alpha({ length: { min: 10, max: 20 } }), count: faker.number.int({ min: 0 }), + bytes: faker.helpers.arrayElement([ + faker.number.int({ min: 0 }), + undefined, + ]), })), undefined, ]), @@ -384,6 +400,10 @@ export const getApplyImportResponseMock = ( ).map(() => ({ kind: faker.string.alpha({ length: { min: 10, max: 20 } }), count: faker.number.int({ min: 0 }), + bytes: faker.helpers.arrayElement([ + faker.number.int({ min: 0 }), + undefined, + ]), })), undefined, ]), @@ -394,6 +414,10 @@ export const getApplyImportResponseMock = ( ).map(() => ({ kind: faker.string.alpha({ length: { min: 10, max: 20 } }), count: faker.number.int({ min: 0 }), + bytes: faker.helpers.arrayElement([ + faker.number.int({ min: 0 }), + undefined, + ]), })), undefined, ]), @@ -458,6 +482,14 @@ export const getGetImportVerificationResponseMock = (): ImportVerification => ({ { kind: "bots", expected: 4, found: 4, leftOut: 0 }, { kind: "conversations", expected: 37, found: 37, leftOut: 0 }, { kind: "messages", expected: 2814, found: 2814, leftOut: 0 }, + { + kind: "files", + expected: 64, + found: 64, + leftOut: 0, + expectedBytes: 152043520, + foundBytes: 152043520, + }, ], notes: [], reconnect: [ diff --git a/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.ts b/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.ts index d1165b3eea..4e594a6b89 100644 --- a/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.ts +++ b/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.ts @@ -1743,7 +1743,7 @@ export const getApplyImportUrl = (organizationId: string, importId: string) => { }; /** - * Once every part has arrived, import the bundle into this organization in the background: every id is given a new one here, everything is owned by the caller, and nothing reaches another organization. Read getImport until status is imported or failed. Applying again while it runs, or after it finished, changes nothing and answers where it stands; applying a failed import tries again from where it stopped, and nothing already imported is imported twice. A missing part answers 409 with IMPORT_INCOMPLETE. + * Once every part has arrived, import the bundle into this organization in the background: every id is given a new one here, everything is owned by the caller, and nothing reaches another organization. Every file is stored where a file uploaded here is, in this organization's own place in OpenBot's file store, and the uploaded parts are removed once the import is done. Read getImport until status is imported or failed. Applying again while it runs, or after it finished, changes nothing and answers where it stands; applying a failed import tries again from where it stopped, and nothing already imported is imported twice. A missing part answers 409 with IMPORT_INCOMPLETE. * * What OpenBot Cloud doesn't have comes in differently, and the summary says so in notes: a Bot that ran on its own isolated computer comes in as an ordinary Bot; a feature that needs the Business plan, in an organization that isn't on it, is left out. A model key in the bundle becomes the caller's own AI connection, unless they have one here already, which is kept. * @summary Import the uploaded bundle diff --git a/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.zod.ts b/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.zod.ts index 2caebc66af..a818d1a68d 100644 --- a/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.zod.ts +++ b/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.zod.ts @@ -19,6 +19,8 @@ export const GetExportEstimateParams = zod.object({ export const getExportEstimateResponseCountsItemCountMin = 0; +export const getExportEstimateResponseCountsItemBytesMin = 0; + export const getExportEstimateResponseEstimatedBytesMin = 0; export const getExportEstimateResponseStoredBytesMin = 0; @@ -32,6 +34,11 @@ export const GetExportEstimateResponse = zod.object({ "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", ), count: zod.int().min(getExportEstimateResponseCountsItemCountMin), + bytes: zod + .int() + .min(getExportEstimateResponseCountsItemBytesMin) + .optional() + .describe("For files, how many bytes they hold together."), }), ), estimatedBytes: zod @@ -149,6 +156,8 @@ export const createExportResponsePartsItemSha256RegExp = new RegExp( ); export const createExportResponseCountsItemCountMin = 0; +export const createExportResponseCountsItemBytesMin = 0; + export const createExportResponseProgressMin = 0; export const createExportResponseProgressMax = 1; @@ -192,6 +201,11 @@ export const CreateExportResponse = zod.object({ "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", ), count: zod.int().min(createExportResponseCountsItemCountMin), + bytes: zod + .int() + .min(createExportResponseCountsItemBytesMin) + .optional() + .describe("For files, how many bytes they hold together."), }), ) .optional() @@ -279,6 +293,8 @@ export const getExportResponsePartsItemSha256RegExp = new RegExp( ); export const getExportResponseCountsItemCountMin = 0; +export const getExportResponseCountsItemBytesMin = 0; + export const getExportResponseProgressMin = 0; export const getExportResponseProgressMax = 1; @@ -322,6 +338,11 @@ export const GetExportResponse = zod.object({ "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", ), count: zod.int().min(getExportResponseCountsItemCountMin), + bytes: zod + .int() + .min(getExportResponseCountsItemBytesMin) + .optional() + .describe("For files, how many bytes they hold together."), }), ) .optional() @@ -518,8 +539,12 @@ export const createImportResponseExpectedPartsItemSha256RegExp = new RegExp( export const createImportResponseExpectedItemCountMin = 0; +export const createImportResponseExpectedItemBytesMin = 0; + export const createImportResponseImportedItemCountMin = 0; +export const createImportResponseImportedItemBytesMin = 0; + export const CreateImportResponse = zod.object({ id: zod.string().min(1), status: zod @@ -567,6 +592,11 @@ export const CreateImportResponse = zod.object({ "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", ), count: zod.int().min(createImportResponseExpectedItemCountMin), + bytes: zod + .int() + .min(createImportResponseExpectedItemBytesMin) + .optional() + .describe("For files, how many bytes they hold together."), }), ) .optional() @@ -582,6 +612,11 @@ export const CreateImportResponse = zod.object({ "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", ), count: zod.int().min(createImportResponseImportedItemCountMin), + bytes: zod + .int() + .min(createImportResponseImportedItemBytesMin) + .optional() + .describe("For files, how many bytes they hold together."), }), ) .optional() @@ -716,8 +751,12 @@ export const listImportsResponseItemsItemExpectedPartsItemSha256RegExp = export const listImportsResponseItemsItemExpectedItemCountMin = 0; +export const listImportsResponseItemsItemExpectedItemBytesMin = 0; + export const listImportsResponseItemsItemImportedItemCountMin = 0; +export const listImportsResponseItemsItemImportedItemBytesMin = 0; + export const ListImportsResponse = zod.object({ items: zod.array( zod.object({ @@ -780,6 +819,11 @@ export const ListImportsResponse = zod.object({ count: zod .int() .min(listImportsResponseItemsItemExpectedItemCountMin), + bytes: zod + .int() + .min(listImportsResponseItemsItemExpectedItemBytesMin) + .optional() + .describe("For files, how many bytes they hold together."), }), ) .optional() @@ -797,6 +841,11 @@ export const ListImportsResponse = zod.object({ count: zod .int() .min(listImportsResponseItemsItemImportedItemCountMin), + bytes: zod + .int() + .min(listImportsResponseItemsItemImportedItemBytesMin) + .optional() + .describe("For files, how many bytes they hold together."), }), ) .optional() @@ -922,8 +971,12 @@ export const getImportResponseExpectedPartsItemSha256RegExp = new RegExp( export const getImportResponseExpectedItemCountMin = 0; +export const getImportResponseExpectedItemBytesMin = 0; + export const getImportResponseImportedItemCountMin = 0; +export const getImportResponseImportedItemBytesMin = 0; + export const GetImportResponse = zod.object({ id: zod.string().min(1), status: zod @@ -971,6 +1024,11 @@ export const GetImportResponse = zod.object({ "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", ), count: zod.int().min(getImportResponseExpectedItemCountMin), + bytes: zod + .int() + .min(getImportResponseExpectedItemBytesMin) + .optional() + .describe("For files, how many bytes they hold together."), }), ) .optional() @@ -986,6 +1044,11 @@ export const GetImportResponse = zod.object({ "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", ), count: zod.int().min(getImportResponseImportedItemCountMin), + bytes: zod + .int() + .min(getImportResponseImportedItemBytesMin) + .optional() + .describe("For files, how many bytes they hold together."), }), ) .optional() @@ -1126,8 +1189,12 @@ export const uploadImportPartResponseExpectedPartsItemSha256RegExp = new RegExp( export const uploadImportPartResponseExpectedItemCountMin = 0; +export const uploadImportPartResponseExpectedItemBytesMin = 0; + export const uploadImportPartResponseImportedItemCountMin = 0; +export const uploadImportPartResponseImportedItemBytesMin = 0; + export const UploadImportPartResponse = zod.object({ id: zod.string().min(1), status: zod @@ -1175,6 +1242,11 @@ export const UploadImportPartResponse = zod.object({ "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", ), count: zod.int().min(uploadImportPartResponseExpectedItemCountMin), + bytes: zod + .int() + .min(uploadImportPartResponseExpectedItemBytesMin) + .optional() + .describe("For files, how many bytes they hold together."), }), ) .optional() @@ -1190,6 +1262,11 @@ export const UploadImportPartResponse = zod.object({ "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", ), count: zod.int().min(uploadImportPartResponseImportedItemCountMin), + bytes: zod + .int() + .min(uploadImportPartResponseImportedItemBytesMin) + .optional() + .describe("For files, how many bytes they hold together."), }), ) .optional() @@ -1275,7 +1352,7 @@ export const UploadImportPartResponse = zod.object({ }); /** - * Once every part has arrived, import the bundle into this organization in the background: every id is given a new one here, everything is owned by the caller, and nothing reaches another organization. Read getImport until status is imported or failed. Applying again while it runs, or after it finished, changes nothing and answers where it stands; applying a failed import tries again from where it stopped, and nothing already imported is imported twice. A missing part answers 409 with IMPORT_INCOMPLETE. + * Once every part has arrived, import the bundle into this organization in the background: every id is given a new one here, everything is owned by the caller, and nothing reaches another organization. Every file is stored where a file uploaded here is, in this organization's own place in OpenBot's file store, and the uploaded parts are removed once the import is done. Read getImport until status is imported or failed. Applying again while it runs, or after it finished, changes nothing and answers where it stands; applying a failed import tries again from where it stopped, and nothing already imported is imported twice. A missing part answers 409 with IMPORT_INCOMPLETE. * * What OpenBot Cloud doesn't have comes in differently, and the summary says so in notes: a Bot that ran on its own isolated computer comes in as an ordinary Bot; a feature that needs the Business plan, in an organization that isn't on it, is left out. A model key in the bundle becomes the caller's own AI connection, unless they have one here already, which is kept. * @summary Import the uploaded bundle @@ -1324,8 +1401,12 @@ export const applyImportResponseExpectedPartsItemSha256RegExp = new RegExp( export const applyImportResponseExpectedItemCountMin = 0; +export const applyImportResponseExpectedItemBytesMin = 0; + export const applyImportResponseImportedItemCountMin = 0; +export const applyImportResponseImportedItemBytesMin = 0; + export const ApplyImportResponse = zod.object({ id: zod.string().min(1), status: zod @@ -1373,6 +1454,11 @@ export const ApplyImportResponse = zod.object({ "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", ), count: zod.int().min(applyImportResponseExpectedItemCountMin), + bytes: zod + .int() + .min(applyImportResponseExpectedItemBytesMin) + .optional() + .describe("For files, how many bytes they hold together."), }), ) .optional() @@ -1388,6 +1474,11 @@ export const ApplyImportResponse = zod.object({ "A kind of thing that moves. bots: Bots with their settings and instructions. skills: skills, a Bot's and the person's (and the organization's, for an administrator). conversations and messages: every conversation and every message in it. memories: what the person's Bots remember about them. routines, goals and check-ins: with their schedules. files: files sent in conversations and kept on a Bot's computer. settings: the person's standing instructions and preferences. model-keys: a model key, only when the person chose to bring it. A later OpenBot may add a kind; count one you don't know like any other.", ), count: zod.int().min(applyImportResponseImportedItemCountMin), + bytes: zod + .int() + .min(applyImportResponseImportedItemBytesMin) + .optional() + .describe("For files, how many bytes they hold together."), }), ) .optional() @@ -1504,11 +1595,17 @@ export const getImportVerificationResponseKindsItemFoundMin = 0; export const getImportVerificationResponseKindsItemLeftOutMin = 0; +export const getImportVerificationResponseKindsItemExpectedBytesMin = 0; + +export const getImportVerificationResponseKindsItemFoundBytesMin = 0; + export const GetImportVerificationResponse = zod.object({ importId: zod.string().min(1), matches: zod .boolean() - .describe("True when, for every kind, found plus leftOut is expected."), + .describe( + "True when, for every kind, found plus leftOut is expected, and for files foundBytes is expectedBytes.", + ), kinds: zod.array( zod.object({ kind: zod @@ -1530,6 +1627,18 @@ export const GetImportVerificationResponse = zod.object({ .describe( "How many OpenBot Cloud left out on purpose, as the notes say.", ), + expectedBytes: zod + .int() + .min(getImportVerificationResponseKindsItemExpectedBytesMin) + .optional() + .describe("For files, how many bytes the bundle held."), + foundBytes: zod + .int() + .min(getImportVerificationResponseKindsItemFoundBytesMin) + .optional() + .describe( + "For files, how many bytes are in this organization's file store now, read from the store itself.", + ), }), ), notes: zod.array( From aa7b21124528ff41c824778397f70c460b550452 Mon Sep 17 00:00:00 2001 From: David McKay Date: Sat, 21 Nov 2026 15:46:09 -0800 Subject: [PATCH 03/16] API: a busy move answers RATE_LIMITED, as every other 429 does --- api/openapi.yaml | 4 ++-- api/openapi/moves.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index 71a70aee7e..13c90d6bdd 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -44521,11 +44521,11 @@ components: examples: tooMany: value: - type: https://open.bot/errors/too-many-requests + type: https://open.bot/errors/rate-limited title: Too many requests. status: 429 detail: That's a lot of uploads at once. Wait a minute, then go on. - code: TOO_MANY_REQUESTS + code: RATE_LIMITED category: rate_limit retryable: true requestId: req_example diff --git a/api/openapi/moves.yaml b/api/openapi/moves.yaml index f8d19b40ea..2febaebc9e 100644 --- a/api/openapi/moves.yaml +++ b/api/openapi/moves.yaml @@ -1156,11 +1156,11 @@ components: examples: tooMany: value: - type: https://open.bot/errors/too-many-requests + type: https://open.bot/errors/rate-limited title: Too many requests. status: 429 detail: That's a lot of uploads at once. Wait a minute, then go on. - code: TOO_MANY_REQUESTS + code: RATE_LIMITED category: rate_limit retryable: true requestId: req_example From 7481ed1c431095fb1ae5e46636f949886359d452 Mon Sep 17 00:00:00 2001 From: David McKay Date: Sat, 21 Nov 2026 15:51:10 -0800 Subject: [PATCH 04/16] Desktop: move OpenBot (Self-Contained) to OpenBot Cloud The shell side of the move. Desktop signs in to OpenBot Cloud, exports everything from the OpenBot on this computer, uploads it part by part to an import on Cloud, applies it, and checks it there. Only once Cloud's check matches the export's own counts is the move kept and OpenBot removed from this computer, measured before and after to say how much space it freed. Any failure before that leaves this computer as it was. The removal is the uninstaller's "Delete the application data", now also removing OpenBot's own volumes and images on an engine that isn't OpenBot's machine (Docker Desktop kept them before). Settings can ask for the move without stopping OpenBot, and the relay's entry can open Cloud at one of the app's own pages, for Reconnect. --- desktop/src-tauri/build.rs | 2 + .../src-tauri/gen/schemas/acl-manifests.json | 2 +- .../src-tauri/gen/schemas/desktop-schema.json | 12 + .../src-tauri/gen/schemas/macOS-schema.json | 12 + desktop/src-tauri/src/connected/relay.rs | 74 +- desktop/src-tauri/src/connected_ipc_tests.rs | 10 +- desktop/src-tauri/src/desktop_connected.rs | 137 ++- desktop/src-tauri/src/desktop_move.rs | 473 ++++++++ desktop/src-tauri/src/desktop_page.rs | 19 +- desktop/src-tauri/src/lib.rs | 1 + desktop/src-tauri/src/main.rs | 47 +- desktop/src-tauri/src/move_to_cloud.rs | 992 ++++++++++++++++ desktop/src-tauri/src/move_to_cloud/tests.rs | 1032 +++++++++++++++++ desktop/src-tauri/src/superseded_images.rs | 53 + desktop/src-tauri/src/uninstall.rs | 99 +- 15 files changed, 2939 insertions(+), 26 deletions(-) create mode 100644 desktop/src-tauri/src/desktop_move.rs create mode 100644 desktop/src-tauri/src/move_to_cloud.rs create mode 100644 desktop/src-tauri/src/move_to_cloud/tests.rs diff --git a/desktop/src-tauri/build.rs b/desktop/src-tauri/build.rs index 6a0554c7fa..93217abcfe 100644 --- a/desktop/src-tauri/build.rs +++ b/desktop/src-tauri/build.rs @@ -93,6 +93,8 @@ fn main() { "sign_out", "change_connection", "set_organization", + // Settings' Move to OpenBot Cloud. See `src/desktop_move.rs`. + "move_to_cloud", ]), ), ) diff --git a/desktop/src-tauri/gen/schemas/acl-manifests.json b/desktop/src-tauri/gen/schemas/acl-manifests.json index ffe556420e..485a39d555 100644 --- a/desktop/src-tauri/gen/schemas/acl-manifests.json +++ b/desktop/src-tauri/gen/schemas/acl-manifests.json @@ -1 +1 @@ -{"core":{"default_permission":{"identifier":"default","description":"Default core plugins set.","permissions":["core:path:default","core:event:default","core:window:default","core:webview:default","core:app:default","core:image:default","core:resources:default","core:menu:default","core:tray:default"]},"permissions":{},"permission_sets":{},"global_scope_schema":null},"core:app":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-version","allow-name","allow-tauri-version","allow-identifier","allow-bundle-type","allow-register-listener","allow-remove-listener","allow-supports-multiple-windows"]},"permissions":{"allow-app-hide":{"identifier":"allow-app-hide","description":"Enables the app_hide command without any pre-configured scope.","commands":{"allow":["app_hide"],"deny":[]}},"allow-app-show":{"identifier":"allow-app-show","description":"Enables the app_show command without any pre-configured scope.","commands":{"allow":["app_show"],"deny":[]}},"allow-bundle-type":{"identifier":"allow-bundle-type","description":"Enables the bundle_type command without any pre-configured scope.","commands":{"allow":["bundle_type"],"deny":[]}},"allow-default-window-icon":{"identifier":"allow-default-window-icon","description":"Enables the default_window_icon command without any pre-configured scope.","commands":{"allow":["default_window_icon"],"deny":[]}},"allow-exit":{"identifier":"allow-exit","description":"Enables the exit command without any pre-configured scope.","commands":{"allow":["exit"],"deny":[]}},"allow-fetch-data-store-identifiers":{"identifier":"allow-fetch-data-store-identifiers","description":"Enables the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":["fetch_data_store_identifiers"],"deny":[]}},"allow-identifier":{"identifier":"allow-identifier","description":"Enables the identifier command without any pre-configured scope.","commands":{"allow":["identifier"],"deny":[]}},"allow-name":{"identifier":"allow-name","description":"Enables the name command without any pre-configured scope.","commands":{"allow":["name"],"deny":[]}},"allow-register-listener":{"identifier":"allow-register-listener","description":"Enables the register_listener command without any pre-configured scope.","commands":{"allow":["register_listener"],"deny":[]}},"allow-remove-data-store":{"identifier":"allow-remove-data-store","description":"Enables the remove_data_store command without any pre-configured scope.","commands":{"allow":["remove_data_store"],"deny":[]}},"allow-remove-listener":{"identifier":"allow-remove-listener","description":"Enables the remove_listener command without any pre-configured scope.","commands":{"allow":["remove_listener"],"deny":[]}},"allow-set-app-theme":{"identifier":"allow-set-app-theme","description":"Enables the set_app_theme command without any pre-configured scope.","commands":{"allow":["set_app_theme"],"deny":[]}},"allow-set-dock-visibility":{"identifier":"allow-set-dock-visibility","description":"Enables the set_dock_visibility command without any pre-configured scope.","commands":{"allow":["set_dock_visibility"],"deny":[]}},"allow-supports-multiple-windows":{"identifier":"allow-supports-multiple-windows","description":"Enables the supports_multiple_windows command without any pre-configured scope.","commands":{"allow":["supports_multiple_windows"],"deny":[]}},"allow-tauri-version":{"identifier":"allow-tauri-version","description":"Enables the tauri_version command without any pre-configured scope.","commands":{"allow":["tauri_version"],"deny":[]}},"allow-version":{"identifier":"allow-version","description":"Enables the version command without any pre-configured scope.","commands":{"allow":["version"],"deny":[]}},"deny-app-hide":{"identifier":"deny-app-hide","description":"Denies the app_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["app_hide"]}},"deny-app-show":{"identifier":"deny-app-show","description":"Denies the app_show command without any pre-configured scope.","commands":{"allow":[],"deny":["app_show"]}},"deny-bundle-type":{"identifier":"deny-bundle-type","description":"Denies the bundle_type command without any pre-configured scope.","commands":{"allow":[],"deny":["bundle_type"]}},"deny-default-window-icon":{"identifier":"deny-default-window-icon","description":"Denies the default_window_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["default_window_icon"]}},"deny-exit":{"identifier":"deny-exit","description":"Denies the exit command without any pre-configured scope.","commands":{"allow":[],"deny":["exit"]}},"deny-fetch-data-store-identifiers":{"identifier":"deny-fetch-data-store-identifiers","description":"Denies the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":[],"deny":["fetch_data_store_identifiers"]}},"deny-identifier":{"identifier":"deny-identifier","description":"Denies the identifier command without any pre-configured scope.","commands":{"allow":[],"deny":["identifier"]}},"deny-name":{"identifier":"deny-name","description":"Denies the name command without any pre-configured scope.","commands":{"allow":[],"deny":["name"]}},"deny-register-listener":{"identifier":"deny-register-listener","description":"Denies the register_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["register_listener"]}},"deny-remove-data-store":{"identifier":"deny-remove-data-store","description":"Denies the remove_data_store command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_data_store"]}},"deny-remove-listener":{"identifier":"deny-remove-listener","description":"Denies the remove_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_listener"]}},"deny-set-app-theme":{"identifier":"deny-set-app-theme","description":"Denies the set_app_theme command without any pre-configured scope.","commands":{"allow":[],"deny":["set_app_theme"]}},"deny-set-dock-visibility":{"identifier":"deny-set-dock-visibility","description":"Denies the set_dock_visibility command without any pre-configured scope.","commands":{"allow":[],"deny":["set_dock_visibility"]}},"deny-supports-multiple-windows":{"identifier":"deny-supports-multiple-windows","description":"Denies the supports_multiple_windows command without any pre-configured scope.","commands":{"allow":[],"deny":["supports_multiple_windows"]}},"deny-tauri-version":{"identifier":"deny-tauri-version","description":"Denies the tauri_version command without any pre-configured scope.","commands":{"allow":[],"deny":["tauri_version"]}},"deny-version":{"identifier":"deny-version","description":"Denies the version command without any pre-configured scope.","commands":{"allow":[],"deny":["version"]}}},"permission_sets":{},"global_scope_schema":null},"core:event":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-listen","allow-unlisten","allow-emit","allow-emit-to"]},"permissions":{"allow-emit":{"identifier":"allow-emit","description":"Enables the emit command without any pre-configured scope.","commands":{"allow":["emit"],"deny":[]}},"allow-emit-to":{"identifier":"allow-emit-to","description":"Enables the emit_to command without any pre-configured scope.","commands":{"allow":["emit_to"],"deny":[]}},"allow-listen":{"identifier":"allow-listen","description":"Enables the listen command without any pre-configured scope.","commands":{"allow":["listen"],"deny":[]}},"allow-unlisten":{"identifier":"allow-unlisten","description":"Enables the unlisten command without any pre-configured scope.","commands":{"allow":["unlisten"],"deny":[]}},"deny-emit":{"identifier":"deny-emit","description":"Denies the emit command without any pre-configured scope.","commands":{"allow":[],"deny":["emit"]}},"deny-emit-to":{"identifier":"deny-emit-to","description":"Denies the emit_to command without any pre-configured scope.","commands":{"allow":[],"deny":["emit_to"]}},"deny-listen":{"identifier":"deny-listen","description":"Denies the listen command without any pre-configured scope.","commands":{"allow":[],"deny":["listen"]}},"deny-unlisten":{"identifier":"deny-unlisten","description":"Denies the unlisten command without any pre-configured scope.","commands":{"allow":[],"deny":["unlisten"]}}},"permission_sets":{},"global_scope_schema":null},"core:image":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-from-bytes","allow-from-path","allow-rgba","allow-size"]},"permissions":{"allow-from-bytes":{"identifier":"allow-from-bytes","description":"Enables the from_bytes command without any pre-configured scope.","commands":{"allow":["from_bytes"],"deny":[]}},"allow-from-path":{"identifier":"allow-from-path","description":"Enables the from_path command without any pre-configured scope.","commands":{"allow":["from_path"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-rgba":{"identifier":"allow-rgba","description":"Enables the rgba command without any pre-configured scope.","commands":{"allow":["rgba"],"deny":[]}},"allow-size":{"identifier":"allow-size","description":"Enables the size command without any pre-configured scope.","commands":{"allow":["size"],"deny":[]}},"deny-from-bytes":{"identifier":"deny-from-bytes","description":"Denies the from_bytes command without any pre-configured scope.","commands":{"allow":[],"deny":["from_bytes"]}},"deny-from-path":{"identifier":"deny-from-path","description":"Denies the from_path command without any pre-configured scope.","commands":{"allow":[],"deny":["from_path"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-rgba":{"identifier":"deny-rgba","description":"Denies the rgba command without any pre-configured scope.","commands":{"allow":[],"deny":["rgba"]}},"deny-size":{"identifier":"deny-size","description":"Denies the size command without any pre-configured scope.","commands":{"allow":[],"deny":["size"]}}},"permission_sets":{},"global_scope_schema":null},"core:menu":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-append","allow-prepend","allow-insert","allow-remove","allow-remove-at","allow-items","allow-get","allow-popup","allow-create-default","allow-set-as-app-menu","allow-set-as-window-menu","allow-text","allow-set-text","allow-is-enabled","allow-set-enabled","allow-set-accelerator","allow-set-as-windows-menu-for-nsapp","allow-set-as-help-menu-for-nsapp","allow-is-checked","allow-set-checked","allow-set-icon"]},"permissions":{"allow-append":{"identifier":"allow-append","description":"Enables the append command without any pre-configured scope.","commands":{"allow":["append"],"deny":[]}},"allow-create-default":{"identifier":"allow-create-default","description":"Enables the create_default command without any pre-configured scope.","commands":{"allow":["create_default"],"deny":[]}},"allow-get":{"identifier":"allow-get","description":"Enables the get command without any pre-configured scope.","commands":{"allow":["get"],"deny":[]}},"allow-insert":{"identifier":"allow-insert","description":"Enables the insert command without any pre-configured scope.","commands":{"allow":["insert"],"deny":[]}},"allow-is-checked":{"identifier":"allow-is-checked","description":"Enables the is_checked command without any pre-configured scope.","commands":{"allow":["is_checked"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"allow-items":{"identifier":"allow-items","description":"Enables the items command without any pre-configured scope.","commands":{"allow":["items"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-popup":{"identifier":"allow-popup","description":"Enables the popup command without any pre-configured scope.","commands":{"allow":["popup"],"deny":[]}},"allow-prepend":{"identifier":"allow-prepend","description":"Enables the prepend command without any pre-configured scope.","commands":{"allow":["prepend"],"deny":[]}},"allow-remove":{"identifier":"allow-remove","description":"Enables the remove command without any pre-configured scope.","commands":{"allow":["remove"],"deny":[]}},"allow-remove-at":{"identifier":"allow-remove-at","description":"Enables the remove_at command without any pre-configured scope.","commands":{"allow":["remove_at"],"deny":[]}},"allow-set-accelerator":{"identifier":"allow-set-accelerator","description":"Enables the set_accelerator command without any pre-configured scope.","commands":{"allow":["set_accelerator"],"deny":[]}},"allow-set-as-app-menu":{"identifier":"allow-set-as-app-menu","description":"Enables the set_as_app_menu command without any pre-configured scope.","commands":{"allow":["set_as_app_menu"],"deny":[]}},"allow-set-as-help-menu-for-nsapp":{"identifier":"allow-set-as-help-menu-for-nsapp","description":"Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":["set_as_help_menu_for_nsapp"],"deny":[]}},"allow-set-as-window-menu":{"identifier":"allow-set-as-window-menu","description":"Enables the set_as_window_menu command without any pre-configured scope.","commands":{"allow":["set_as_window_menu"],"deny":[]}},"allow-set-as-windows-menu-for-nsapp":{"identifier":"allow-set-as-windows-menu-for-nsapp","description":"Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":["set_as_windows_menu_for_nsapp"],"deny":[]}},"allow-set-checked":{"identifier":"allow-set-checked","description":"Enables the set_checked command without any pre-configured scope.","commands":{"allow":["set_checked"],"deny":[]}},"allow-set-enabled":{"identifier":"allow-set-enabled","description":"Enables the set_enabled command without any pre-configured scope.","commands":{"allow":["set_enabled"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-text":{"identifier":"allow-set-text","description":"Enables the set_text command without any pre-configured scope.","commands":{"allow":["set_text"],"deny":[]}},"allow-text":{"identifier":"allow-text","description":"Enables the text command without any pre-configured scope.","commands":{"allow":["text"],"deny":[]}},"deny-append":{"identifier":"deny-append","description":"Denies the append command without any pre-configured scope.","commands":{"allow":[],"deny":["append"]}},"deny-create-default":{"identifier":"deny-create-default","description":"Denies the create_default command without any pre-configured scope.","commands":{"allow":[],"deny":["create_default"]}},"deny-get":{"identifier":"deny-get","description":"Denies the get command without any pre-configured scope.","commands":{"allow":[],"deny":["get"]}},"deny-insert":{"identifier":"deny-insert","description":"Denies the insert command without any pre-configured scope.","commands":{"allow":[],"deny":["insert"]}},"deny-is-checked":{"identifier":"deny-is-checked","description":"Denies the is_checked command without any pre-configured scope.","commands":{"allow":[],"deny":["is_checked"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}},"deny-items":{"identifier":"deny-items","description":"Denies the items command without any pre-configured scope.","commands":{"allow":[],"deny":["items"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-popup":{"identifier":"deny-popup","description":"Denies the popup command without any pre-configured scope.","commands":{"allow":[],"deny":["popup"]}},"deny-prepend":{"identifier":"deny-prepend","description":"Denies the prepend command without any pre-configured scope.","commands":{"allow":[],"deny":["prepend"]}},"deny-remove":{"identifier":"deny-remove","description":"Denies the remove command without any pre-configured scope.","commands":{"allow":[],"deny":["remove"]}},"deny-remove-at":{"identifier":"deny-remove-at","description":"Denies the remove_at command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_at"]}},"deny-set-accelerator":{"identifier":"deny-set-accelerator","description":"Denies the set_accelerator command without any pre-configured scope.","commands":{"allow":[],"deny":["set_accelerator"]}},"deny-set-as-app-menu":{"identifier":"deny-set-as-app-menu","description":"Denies the set_as_app_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_app_menu"]}},"deny-set-as-help-menu-for-nsapp":{"identifier":"deny-set-as-help-menu-for-nsapp","description":"Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_help_menu_for_nsapp"]}},"deny-set-as-window-menu":{"identifier":"deny-set-as-window-menu","description":"Denies the set_as_window_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_window_menu"]}},"deny-set-as-windows-menu-for-nsapp":{"identifier":"deny-set-as-windows-menu-for-nsapp","description":"Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_windows_menu_for_nsapp"]}},"deny-set-checked":{"identifier":"deny-set-checked","description":"Denies the set_checked command without any pre-configured scope.","commands":{"allow":[],"deny":["set_checked"]}},"deny-set-enabled":{"identifier":"deny-set-enabled","description":"Denies the set_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["set_enabled"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-text":{"identifier":"deny-set-text","description":"Denies the set_text command without any pre-configured scope.","commands":{"allow":[],"deny":["set_text"]}},"deny-text":{"identifier":"deny-text","description":"Denies the text command without any pre-configured scope.","commands":{"allow":[],"deny":["text"]}}},"permission_sets":{},"global_scope_schema":null},"core:path":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-resolve-directory","allow-resolve","allow-normalize","allow-join","allow-dirname","allow-extname","allow-basename","allow-is-absolute"]},"permissions":{"allow-basename":{"identifier":"allow-basename","description":"Enables the basename command without any pre-configured scope.","commands":{"allow":["basename"],"deny":[]}},"allow-dirname":{"identifier":"allow-dirname","description":"Enables the dirname command without any pre-configured scope.","commands":{"allow":["dirname"],"deny":[]}},"allow-extname":{"identifier":"allow-extname","description":"Enables the extname command without any pre-configured scope.","commands":{"allow":["extname"],"deny":[]}},"allow-is-absolute":{"identifier":"allow-is-absolute","description":"Enables the is_absolute command without any pre-configured scope.","commands":{"allow":["is_absolute"],"deny":[]}},"allow-join":{"identifier":"allow-join","description":"Enables the join command without any pre-configured scope.","commands":{"allow":["join"],"deny":[]}},"allow-normalize":{"identifier":"allow-normalize","description":"Enables the normalize command without any pre-configured scope.","commands":{"allow":["normalize"],"deny":[]}},"allow-resolve":{"identifier":"allow-resolve","description":"Enables the resolve command without any pre-configured scope.","commands":{"allow":["resolve"],"deny":[]}},"allow-resolve-directory":{"identifier":"allow-resolve-directory","description":"Enables the resolve_directory command without any pre-configured scope.","commands":{"allow":["resolve_directory"],"deny":[]}},"deny-basename":{"identifier":"deny-basename","description":"Denies the basename command without any pre-configured scope.","commands":{"allow":[],"deny":["basename"]}},"deny-dirname":{"identifier":"deny-dirname","description":"Denies the dirname command without any pre-configured scope.","commands":{"allow":[],"deny":["dirname"]}},"deny-extname":{"identifier":"deny-extname","description":"Denies the extname command without any pre-configured scope.","commands":{"allow":[],"deny":["extname"]}},"deny-is-absolute":{"identifier":"deny-is-absolute","description":"Denies the is_absolute command without any pre-configured scope.","commands":{"allow":[],"deny":["is_absolute"]}},"deny-join":{"identifier":"deny-join","description":"Denies the join command without any pre-configured scope.","commands":{"allow":[],"deny":["join"]}},"deny-normalize":{"identifier":"deny-normalize","description":"Denies the normalize command without any pre-configured scope.","commands":{"allow":[],"deny":["normalize"]}},"deny-resolve":{"identifier":"deny-resolve","description":"Denies the resolve command without any pre-configured scope.","commands":{"allow":[],"deny":["resolve"]}},"deny-resolve-directory":{"identifier":"deny-resolve-directory","description":"Denies the resolve_directory command without any pre-configured scope.","commands":{"allow":[],"deny":["resolve_directory"]}}},"permission_sets":{},"global_scope_schema":null},"core:resources":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-close"]},"permissions":{"allow-close":{"identifier":"allow-close","description":"Enables the close command without any pre-configured scope.","commands":{"allow":["close"],"deny":[]}},"deny-close":{"identifier":"deny-close","description":"Denies the close command without any pre-configured scope.","commands":{"allow":[],"deny":["close"]}}},"permission_sets":{},"global_scope_schema":null},"core:tray":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-get-by-id","allow-remove-by-id","allow-set-icon","allow-set-menu","allow-set-tooltip","allow-set-title","allow-set-visible","allow-set-temp-dir-path","allow-set-icon-as-template","allow-set-icon-with-as-template","allow-set-show-menu-on-left-click"]},"permissions":{"allow-get-by-id":{"identifier":"allow-get-by-id","description":"Enables the get_by_id command without any pre-configured scope.","commands":{"allow":["get_by_id"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-remove-by-id":{"identifier":"allow-remove-by-id","description":"Enables the remove_by_id command without any pre-configured scope.","commands":{"allow":["remove_by_id"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-icon-as-template":{"identifier":"allow-set-icon-as-template","description":"Enables the set_icon_as_template command without any pre-configured scope.","commands":{"allow":["set_icon_as_template"],"deny":[]}},"allow-set-icon-with-as-template":{"identifier":"allow-set-icon-with-as-template","description":"Enables the set_icon_with_as_template command without any pre-configured scope.","commands":{"allow":["set_icon_with_as_template"],"deny":[]}},"allow-set-menu":{"identifier":"allow-set-menu","description":"Enables the set_menu command without any pre-configured scope.","commands":{"allow":["set_menu"],"deny":[]}},"allow-set-show-menu-on-left-click":{"identifier":"allow-set-show-menu-on-left-click","description":"Enables the set_show_menu_on_left_click command without any pre-configured scope.","commands":{"allow":["set_show_menu_on_left_click"],"deny":[]}},"allow-set-temp-dir-path":{"identifier":"allow-set-temp-dir-path","description":"Enables the set_temp_dir_path command without any pre-configured scope.","commands":{"allow":["set_temp_dir_path"],"deny":[]}},"allow-set-title":{"identifier":"allow-set-title","description":"Enables the set_title command without any pre-configured scope.","commands":{"allow":["set_title"],"deny":[]}},"allow-set-tooltip":{"identifier":"allow-set-tooltip","description":"Enables the set_tooltip command without any pre-configured scope.","commands":{"allow":["set_tooltip"],"deny":[]}},"allow-set-visible":{"identifier":"allow-set-visible","description":"Enables the set_visible command without any pre-configured scope.","commands":{"allow":["set_visible"],"deny":[]}},"deny-get-by-id":{"identifier":"deny-get-by-id","description":"Denies the get_by_id command without any pre-configured scope.","commands":{"allow":[],"deny":["get_by_id"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-remove-by-id":{"identifier":"deny-remove-by-id","description":"Denies the remove_by_id command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_by_id"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-icon-as-template":{"identifier":"deny-set-icon-as-template","description":"Denies the set_icon_as_template command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon_as_template"]}},"deny-set-icon-with-as-template":{"identifier":"deny-set-icon-with-as-template","description":"Denies the set_icon_with_as_template command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon_with_as_template"]}},"deny-set-menu":{"identifier":"deny-set-menu","description":"Denies the set_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_menu"]}},"deny-set-show-menu-on-left-click":{"identifier":"deny-set-show-menu-on-left-click","description":"Denies the set_show_menu_on_left_click command without any pre-configured scope.","commands":{"allow":[],"deny":["set_show_menu_on_left_click"]}},"deny-set-temp-dir-path":{"identifier":"deny-set-temp-dir-path","description":"Denies the set_temp_dir_path command without any pre-configured scope.","commands":{"allow":[],"deny":["set_temp_dir_path"]}},"deny-set-title":{"identifier":"deny-set-title","description":"Denies the set_title command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title"]}},"deny-set-tooltip":{"identifier":"deny-set-tooltip","description":"Denies the set_tooltip command without any pre-configured scope.","commands":{"allow":[],"deny":["set_tooltip"]}},"deny-set-visible":{"identifier":"deny-set-visible","description":"Denies the set_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["set_visible"]}}},"permission_sets":{},"global_scope_schema":null},"core:webview":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-get-all-webviews","allow-webview-position","allow-webview-size","allow-internal-toggle-devtools"]},"permissions":{"allow-clear-all-browsing-data":{"identifier":"allow-clear-all-browsing-data","description":"Enables the clear_all_browsing_data command without any pre-configured scope.","commands":{"allow":["clear_all_browsing_data"],"deny":[]}},"allow-create-webview":{"identifier":"allow-create-webview","description":"Enables the create_webview command without any pre-configured scope.","commands":{"allow":["create_webview"],"deny":[]}},"allow-create-webview-window":{"identifier":"allow-create-webview-window","description":"Enables the create_webview_window command without any pre-configured scope.","commands":{"allow":["create_webview_window"],"deny":[]}},"allow-get-all-webviews":{"identifier":"allow-get-all-webviews","description":"Enables the get_all_webviews command without any pre-configured scope.","commands":{"allow":["get_all_webviews"],"deny":[]}},"allow-internal-toggle-devtools":{"identifier":"allow-internal-toggle-devtools","description":"Enables the internal_toggle_devtools command without any pre-configured scope.","commands":{"allow":["internal_toggle_devtools"],"deny":[]}},"allow-print":{"identifier":"allow-print","description":"Enables the print command without any pre-configured scope.","commands":{"allow":["print"],"deny":[]}},"allow-reparent":{"identifier":"allow-reparent","description":"Enables the reparent command without any pre-configured scope.","commands":{"allow":["reparent"],"deny":[]}},"allow-set-webview-auto-resize":{"identifier":"allow-set-webview-auto-resize","description":"Enables the set_webview_auto_resize command without any pre-configured scope.","commands":{"allow":["set_webview_auto_resize"],"deny":[]}},"allow-set-webview-background-color":{"identifier":"allow-set-webview-background-color","description":"Enables the set_webview_background_color command without any pre-configured scope.","commands":{"allow":["set_webview_background_color"],"deny":[]}},"allow-set-webview-focus":{"identifier":"allow-set-webview-focus","description":"Enables the set_webview_focus command without any pre-configured scope.","commands":{"allow":["set_webview_focus"],"deny":[]}},"allow-set-webview-position":{"identifier":"allow-set-webview-position","description":"Enables the set_webview_position command without any pre-configured scope.","commands":{"allow":["set_webview_position"],"deny":[]}},"allow-set-webview-size":{"identifier":"allow-set-webview-size","description":"Enables the set_webview_size command without any pre-configured scope.","commands":{"allow":["set_webview_size"],"deny":[]}},"allow-set-webview-zoom":{"identifier":"allow-set-webview-zoom","description":"Enables the set_webview_zoom command without any pre-configured scope.","commands":{"allow":["set_webview_zoom"],"deny":[]}},"allow-webview-close":{"identifier":"allow-webview-close","description":"Enables the webview_close command without any pre-configured scope.","commands":{"allow":["webview_close"],"deny":[]}},"allow-webview-hide":{"identifier":"allow-webview-hide","description":"Enables the webview_hide command without any pre-configured scope.","commands":{"allow":["webview_hide"],"deny":[]}},"allow-webview-position":{"identifier":"allow-webview-position","description":"Enables the webview_position command without any pre-configured scope.","commands":{"allow":["webview_position"],"deny":[]}},"allow-webview-show":{"identifier":"allow-webview-show","description":"Enables the webview_show command without any pre-configured scope.","commands":{"allow":["webview_show"],"deny":[]}},"allow-webview-size":{"identifier":"allow-webview-size","description":"Enables the webview_size command without any pre-configured scope.","commands":{"allow":["webview_size"],"deny":[]}},"deny-clear-all-browsing-data":{"identifier":"deny-clear-all-browsing-data","description":"Denies the clear_all_browsing_data command without any pre-configured scope.","commands":{"allow":[],"deny":["clear_all_browsing_data"]}},"deny-create-webview":{"identifier":"deny-create-webview","description":"Denies the create_webview command without any pre-configured scope.","commands":{"allow":[],"deny":["create_webview"]}},"deny-create-webview-window":{"identifier":"deny-create-webview-window","description":"Denies the create_webview_window command without any pre-configured scope.","commands":{"allow":[],"deny":["create_webview_window"]}},"deny-get-all-webviews":{"identifier":"deny-get-all-webviews","description":"Denies the get_all_webviews command without any pre-configured scope.","commands":{"allow":[],"deny":["get_all_webviews"]}},"deny-internal-toggle-devtools":{"identifier":"deny-internal-toggle-devtools","description":"Denies the internal_toggle_devtools command without any pre-configured scope.","commands":{"allow":[],"deny":["internal_toggle_devtools"]}},"deny-print":{"identifier":"deny-print","description":"Denies the print command without any pre-configured scope.","commands":{"allow":[],"deny":["print"]}},"deny-reparent":{"identifier":"deny-reparent","description":"Denies the reparent command without any pre-configured scope.","commands":{"allow":[],"deny":["reparent"]}},"deny-set-webview-auto-resize":{"identifier":"deny-set-webview-auto-resize","description":"Denies the set_webview_auto_resize command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_auto_resize"]}},"deny-set-webview-background-color":{"identifier":"deny-set-webview-background-color","description":"Denies the set_webview_background_color command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_background_color"]}},"deny-set-webview-focus":{"identifier":"deny-set-webview-focus","description":"Denies the set_webview_focus command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_focus"]}},"deny-set-webview-position":{"identifier":"deny-set-webview-position","description":"Denies the set_webview_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_position"]}},"deny-set-webview-size":{"identifier":"deny-set-webview-size","description":"Denies the set_webview_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_size"]}},"deny-set-webview-zoom":{"identifier":"deny-set-webview-zoom","description":"Denies the set_webview_zoom command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_zoom"]}},"deny-webview-close":{"identifier":"deny-webview-close","description":"Denies the webview_close command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_close"]}},"deny-webview-hide":{"identifier":"deny-webview-hide","description":"Denies the webview_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_hide"]}},"deny-webview-position":{"identifier":"deny-webview-position","description":"Denies the webview_position command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_position"]}},"deny-webview-show":{"identifier":"deny-webview-show","description":"Denies the webview_show command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_show"]}},"deny-webview-size":{"identifier":"deny-webview-size","description":"Denies the webview_size command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_size"]}}},"permission_sets":{},"global_scope_schema":null},"core:window":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-get-all-windows","allow-scale-factor","allow-inner-position","allow-outer-position","allow-inner-size","allow-outer-size","allow-is-fullscreen","allow-is-minimized","allow-is-maximized","allow-is-focused","allow-is-decorated","allow-is-resizable","allow-is-maximizable","allow-is-minimizable","allow-is-closable","allow-is-visible","allow-is-enabled","allow-title","allow-current-monitor","allow-primary-monitor","allow-monitor-from-point","allow-available-monitors","allow-cursor-position","allow-theme","allow-is-always-on-top","allow-activity-name","allow-scene-identifier","allow-internal-toggle-maximize"]},"permissions":{"allow-activity-name":{"identifier":"allow-activity-name","description":"Enables the activity_name command without any pre-configured scope.","commands":{"allow":["activity_name"],"deny":[]}},"allow-available-monitors":{"identifier":"allow-available-monitors","description":"Enables the available_monitors command without any pre-configured scope.","commands":{"allow":["available_monitors"],"deny":[]}},"allow-center":{"identifier":"allow-center","description":"Enables the center command without any pre-configured scope.","commands":{"allow":["center"],"deny":[]}},"allow-close":{"identifier":"allow-close","description":"Enables the close command without any pre-configured scope.","commands":{"allow":["close"],"deny":[]}},"allow-create":{"identifier":"allow-create","description":"Enables the create command without any pre-configured scope.","commands":{"allow":["create"],"deny":[]}},"allow-current-monitor":{"identifier":"allow-current-monitor","description":"Enables the current_monitor command without any pre-configured scope.","commands":{"allow":["current_monitor"],"deny":[]}},"allow-cursor-position":{"identifier":"allow-cursor-position","description":"Enables the cursor_position command without any pre-configured scope.","commands":{"allow":["cursor_position"],"deny":[]}},"allow-destroy":{"identifier":"allow-destroy","description":"Enables the destroy command without any pre-configured scope.","commands":{"allow":["destroy"],"deny":[]}},"allow-get-all-windows":{"identifier":"allow-get-all-windows","description":"Enables the get_all_windows command without any pre-configured scope.","commands":{"allow":["get_all_windows"],"deny":[]}},"allow-hide":{"identifier":"allow-hide","description":"Enables the hide command without any pre-configured scope.","commands":{"allow":["hide"],"deny":[]}},"allow-inner-position":{"identifier":"allow-inner-position","description":"Enables the inner_position command without any pre-configured scope.","commands":{"allow":["inner_position"],"deny":[]}},"allow-inner-size":{"identifier":"allow-inner-size","description":"Enables the inner_size command without any pre-configured scope.","commands":{"allow":["inner_size"],"deny":[]}},"allow-internal-toggle-maximize":{"identifier":"allow-internal-toggle-maximize","description":"Enables the internal_toggle_maximize command without any pre-configured scope.","commands":{"allow":["internal_toggle_maximize"],"deny":[]}},"allow-is-always-on-top":{"identifier":"allow-is-always-on-top","description":"Enables the is_always_on_top command without any pre-configured scope.","commands":{"allow":["is_always_on_top"],"deny":[]}},"allow-is-closable":{"identifier":"allow-is-closable","description":"Enables the is_closable command without any pre-configured scope.","commands":{"allow":["is_closable"],"deny":[]}},"allow-is-decorated":{"identifier":"allow-is-decorated","description":"Enables the is_decorated command without any pre-configured scope.","commands":{"allow":["is_decorated"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"allow-is-focused":{"identifier":"allow-is-focused","description":"Enables the is_focused command without any pre-configured scope.","commands":{"allow":["is_focused"],"deny":[]}},"allow-is-fullscreen":{"identifier":"allow-is-fullscreen","description":"Enables the is_fullscreen command without any pre-configured scope.","commands":{"allow":["is_fullscreen"],"deny":[]}},"allow-is-maximizable":{"identifier":"allow-is-maximizable","description":"Enables the is_maximizable command without any pre-configured scope.","commands":{"allow":["is_maximizable"],"deny":[]}},"allow-is-maximized":{"identifier":"allow-is-maximized","description":"Enables the is_maximized command without any pre-configured scope.","commands":{"allow":["is_maximized"],"deny":[]}},"allow-is-minimizable":{"identifier":"allow-is-minimizable","description":"Enables the is_minimizable command without any pre-configured scope.","commands":{"allow":["is_minimizable"],"deny":[]}},"allow-is-minimized":{"identifier":"allow-is-minimized","description":"Enables the is_minimized command without any pre-configured scope.","commands":{"allow":["is_minimized"],"deny":[]}},"allow-is-resizable":{"identifier":"allow-is-resizable","description":"Enables the is_resizable command without any pre-configured scope.","commands":{"allow":["is_resizable"],"deny":[]}},"allow-is-visible":{"identifier":"allow-is-visible","description":"Enables the is_visible command without any pre-configured scope.","commands":{"allow":["is_visible"],"deny":[]}},"allow-maximize":{"identifier":"allow-maximize","description":"Enables the maximize command without any pre-configured scope.","commands":{"allow":["maximize"],"deny":[]}},"allow-minimize":{"identifier":"allow-minimize","description":"Enables the minimize command without any pre-configured scope.","commands":{"allow":["minimize"],"deny":[]}},"allow-monitor-from-point":{"identifier":"allow-monitor-from-point","description":"Enables the monitor_from_point command without any pre-configured scope.","commands":{"allow":["monitor_from_point"],"deny":[]}},"allow-outer-position":{"identifier":"allow-outer-position","description":"Enables the outer_position command without any pre-configured scope.","commands":{"allow":["outer_position"],"deny":[]}},"allow-outer-size":{"identifier":"allow-outer-size","description":"Enables the outer_size command without any pre-configured scope.","commands":{"allow":["outer_size"],"deny":[]}},"allow-primary-monitor":{"identifier":"allow-primary-monitor","description":"Enables the primary_monitor command without any pre-configured scope.","commands":{"allow":["primary_monitor"],"deny":[]}},"allow-request-user-attention":{"identifier":"allow-request-user-attention","description":"Enables the request_user_attention command without any pre-configured scope.","commands":{"allow":["request_user_attention"],"deny":[]}},"allow-scale-factor":{"identifier":"allow-scale-factor","description":"Enables the scale_factor command without any pre-configured scope.","commands":{"allow":["scale_factor"],"deny":[]}},"allow-scene-identifier":{"identifier":"allow-scene-identifier","description":"Enables the scene_identifier command without any pre-configured scope.","commands":{"allow":["scene_identifier"],"deny":[]}},"allow-set-always-on-bottom":{"identifier":"allow-set-always-on-bottom","description":"Enables the set_always_on_bottom command without any pre-configured scope.","commands":{"allow":["set_always_on_bottom"],"deny":[]}},"allow-set-always-on-top":{"identifier":"allow-set-always-on-top","description":"Enables the set_always_on_top command without any pre-configured scope.","commands":{"allow":["set_always_on_top"],"deny":[]}},"allow-set-background-color":{"identifier":"allow-set-background-color","description":"Enables the set_background_color command without any pre-configured scope.","commands":{"allow":["set_background_color"],"deny":[]}},"allow-set-badge-count":{"identifier":"allow-set-badge-count","description":"Enables the set_badge_count command without any pre-configured scope.","commands":{"allow":["set_badge_count"],"deny":[]}},"allow-set-badge-label":{"identifier":"allow-set-badge-label","description":"Enables the set_badge_label command without any pre-configured scope.","commands":{"allow":["set_badge_label"],"deny":[]}},"allow-set-closable":{"identifier":"allow-set-closable","description":"Enables the set_closable command without any pre-configured scope.","commands":{"allow":["set_closable"],"deny":[]}},"allow-set-content-protected":{"identifier":"allow-set-content-protected","description":"Enables the set_content_protected command without any pre-configured scope.","commands":{"allow":["set_content_protected"],"deny":[]}},"allow-set-cursor-grab":{"identifier":"allow-set-cursor-grab","description":"Enables the set_cursor_grab command without any pre-configured scope.","commands":{"allow":["set_cursor_grab"],"deny":[]}},"allow-set-cursor-icon":{"identifier":"allow-set-cursor-icon","description":"Enables the set_cursor_icon command without any pre-configured scope.","commands":{"allow":["set_cursor_icon"],"deny":[]}},"allow-set-cursor-position":{"identifier":"allow-set-cursor-position","description":"Enables the set_cursor_position command without any pre-configured scope.","commands":{"allow":["set_cursor_position"],"deny":[]}},"allow-set-cursor-visible":{"identifier":"allow-set-cursor-visible","description":"Enables the set_cursor_visible command without any pre-configured scope.","commands":{"allow":["set_cursor_visible"],"deny":[]}},"allow-set-decorations":{"identifier":"allow-set-decorations","description":"Enables the set_decorations command without any pre-configured scope.","commands":{"allow":["set_decorations"],"deny":[]}},"allow-set-effects":{"identifier":"allow-set-effects","description":"Enables the set_effects command without any pre-configured scope.","commands":{"allow":["set_effects"],"deny":[]}},"allow-set-enabled":{"identifier":"allow-set-enabled","description":"Enables the set_enabled command without any pre-configured scope.","commands":{"allow":["set_enabled"],"deny":[]}},"allow-set-focus":{"identifier":"allow-set-focus","description":"Enables the set_focus command without any pre-configured scope.","commands":{"allow":["set_focus"],"deny":[]}},"allow-set-focusable":{"identifier":"allow-set-focusable","description":"Enables the set_focusable command without any pre-configured scope.","commands":{"allow":["set_focusable"],"deny":[]}},"allow-set-fullscreen":{"identifier":"allow-set-fullscreen","description":"Enables the set_fullscreen command without any pre-configured scope.","commands":{"allow":["set_fullscreen"],"deny":[]}},"allow-set-fullscreen-on-monitor":{"identifier":"allow-set-fullscreen-on-monitor","description":"Enables the set_fullscreen_on_monitor command without any pre-configured scope.","commands":{"allow":["set_fullscreen_on_monitor"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-ignore-cursor-events":{"identifier":"allow-set-ignore-cursor-events","description":"Enables the set_ignore_cursor_events command without any pre-configured scope.","commands":{"allow":["set_ignore_cursor_events"],"deny":[]}},"allow-set-max-size":{"identifier":"allow-set-max-size","description":"Enables the set_max_size command without any pre-configured scope.","commands":{"allow":["set_max_size"],"deny":[]}},"allow-set-maximizable":{"identifier":"allow-set-maximizable","description":"Enables the set_maximizable command without any pre-configured scope.","commands":{"allow":["set_maximizable"],"deny":[]}},"allow-set-min-size":{"identifier":"allow-set-min-size","description":"Enables the set_min_size command without any pre-configured scope.","commands":{"allow":["set_min_size"],"deny":[]}},"allow-set-minimizable":{"identifier":"allow-set-minimizable","description":"Enables the set_minimizable command without any pre-configured scope.","commands":{"allow":["set_minimizable"],"deny":[]}},"allow-set-overlay-icon":{"identifier":"allow-set-overlay-icon","description":"Enables the set_overlay_icon command without any pre-configured scope.","commands":{"allow":["set_overlay_icon"],"deny":[]}},"allow-set-position":{"identifier":"allow-set-position","description":"Enables the set_position command without any pre-configured scope.","commands":{"allow":["set_position"],"deny":[]}},"allow-set-progress-bar":{"identifier":"allow-set-progress-bar","description":"Enables the set_progress_bar command without any pre-configured scope.","commands":{"allow":["set_progress_bar"],"deny":[]}},"allow-set-resizable":{"identifier":"allow-set-resizable","description":"Enables the set_resizable command without any pre-configured scope.","commands":{"allow":["set_resizable"],"deny":[]}},"allow-set-shadow":{"identifier":"allow-set-shadow","description":"Enables the set_shadow command without any pre-configured scope.","commands":{"allow":["set_shadow"],"deny":[]}},"allow-set-simple-fullscreen":{"identifier":"allow-set-simple-fullscreen","description":"Enables the set_simple_fullscreen command without any pre-configured scope.","commands":{"allow":["set_simple_fullscreen"],"deny":[]}},"allow-set-size":{"identifier":"allow-set-size","description":"Enables the set_size command without any pre-configured scope.","commands":{"allow":["set_size"],"deny":[]}},"allow-set-size-constraints":{"identifier":"allow-set-size-constraints","description":"Enables the set_size_constraints command without any pre-configured scope.","commands":{"allow":["set_size_constraints"],"deny":[]}},"allow-set-skip-taskbar":{"identifier":"allow-set-skip-taskbar","description":"Enables the set_skip_taskbar command without any pre-configured scope.","commands":{"allow":["set_skip_taskbar"],"deny":[]}},"allow-set-theme":{"identifier":"allow-set-theme","description":"Enables the set_theme command without any pre-configured scope.","commands":{"allow":["set_theme"],"deny":[]}},"allow-set-title":{"identifier":"allow-set-title","description":"Enables the set_title command without any pre-configured scope.","commands":{"allow":["set_title"],"deny":[]}},"allow-set-title-bar-style":{"identifier":"allow-set-title-bar-style","description":"Enables the set_title_bar_style command without any pre-configured scope.","commands":{"allow":["set_title_bar_style"],"deny":[]}},"allow-set-visible-on-all-workspaces":{"identifier":"allow-set-visible-on-all-workspaces","description":"Enables the set_visible_on_all_workspaces command without any pre-configured scope.","commands":{"allow":["set_visible_on_all_workspaces"],"deny":[]}},"allow-show":{"identifier":"allow-show","description":"Enables the show command without any pre-configured scope.","commands":{"allow":["show"],"deny":[]}},"allow-start-dragging":{"identifier":"allow-start-dragging","description":"Enables the start_dragging command without any pre-configured scope.","commands":{"allow":["start_dragging"],"deny":[]}},"allow-start-resize-dragging":{"identifier":"allow-start-resize-dragging","description":"Enables the start_resize_dragging command without any pre-configured scope.","commands":{"allow":["start_resize_dragging"],"deny":[]}},"allow-theme":{"identifier":"allow-theme","description":"Enables the theme command without any pre-configured scope.","commands":{"allow":["theme"],"deny":[]}},"allow-title":{"identifier":"allow-title","description":"Enables the title command without any pre-configured scope.","commands":{"allow":["title"],"deny":[]}},"allow-toggle-maximize":{"identifier":"allow-toggle-maximize","description":"Enables the toggle_maximize command without any pre-configured scope.","commands":{"allow":["toggle_maximize"],"deny":[]}},"allow-unmaximize":{"identifier":"allow-unmaximize","description":"Enables the unmaximize command without any pre-configured scope.","commands":{"allow":["unmaximize"],"deny":[]}},"allow-unminimize":{"identifier":"allow-unminimize","description":"Enables the unminimize command without any pre-configured scope.","commands":{"allow":["unminimize"],"deny":[]}},"deny-activity-name":{"identifier":"deny-activity-name","description":"Denies the activity_name command without any pre-configured scope.","commands":{"allow":[],"deny":["activity_name"]}},"deny-available-monitors":{"identifier":"deny-available-monitors","description":"Denies the available_monitors command without any pre-configured scope.","commands":{"allow":[],"deny":["available_monitors"]}},"deny-center":{"identifier":"deny-center","description":"Denies the center command without any pre-configured scope.","commands":{"allow":[],"deny":["center"]}},"deny-close":{"identifier":"deny-close","description":"Denies the close command without any pre-configured scope.","commands":{"allow":[],"deny":["close"]}},"deny-create":{"identifier":"deny-create","description":"Denies the create command without any pre-configured scope.","commands":{"allow":[],"deny":["create"]}},"deny-current-monitor":{"identifier":"deny-current-monitor","description":"Denies the current_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["current_monitor"]}},"deny-cursor-position":{"identifier":"deny-cursor-position","description":"Denies the cursor_position command without any pre-configured scope.","commands":{"allow":[],"deny":["cursor_position"]}},"deny-destroy":{"identifier":"deny-destroy","description":"Denies the destroy command without any pre-configured scope.","commands":{"allow":[],"deny":["destroy"]}},"deny-get-all-windows":{"identifier":"deny-get-all-windows","description":"Denies the get_all_windows command without any pre-configured scope.","commands":{"allow":[],"deny":["get_all_windows"]}},"deny-hide":{"identifier":"deny-hide","description":"Denies the hide command without any pre-configured scope.","commands":{"allow":[],"deny":["hide"]}},"deny-inner-position":{"identifier":"deny-inner-position","description":"Denies the inner_position command without any pre-configured scope.","commands":{"allow":[],"deny":["inner_position"]}},"deny-inner-size":{"identifier":"deny-inner-size","description":"Denies the inner_size command without any pre-configured scope.","commands":{"allow":[],"deny":["inner_size"]}},"deny-internal-toggle-maximize":{"identifier":"deny-internal-toggle-maximize","description":"Denies the internal_toggle_maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["internal_toggle_maximize"]}},"deny-is-always-on-top":{"identifier":"deny-is-always-on-top","description":"Denies the is_always_on_top command without any pre-configured scope.","commands":{"allow":[],"deny":["is_always_on_top"]}},"deny-is-closable":{"identifier":"deny-is-closable","description":"Denies the is_closable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_closable"]}},"deny-is-decorated":{"identifier":"deny-is-decorated","description":"Denies the is_decorated command without any pre-configured scope.","commands":{"allow":[],"deny":["is_decorated"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}},"deny-is-focused":{"identifier":"deny-is-focused","description":"Denies the is_focused command without any pre-configured scope.","commands":{"allow":[],"deny":["is_focused"]}},"deny-is-fullscreen":{"identifier":"deny-is-fullscreen","description":"Denies the is_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["is_fullscreen"]}},"deny-is-maximizable":{"identifier":"deny-is-maximizable","description":"Denies the is_maximizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_maximizable"]}},"deny-is-maximized":{"identifier":"deny-is-maximized","description":"Denies the is_maximized command without any pre-configured scope.","commands":{"allow":[],"deny":["is_maximized"]}},"deny-is-minimizable":{"identifier":"deny-is-minimizable","description":"Denies the is_minimizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_minimizable"]}},"deny-is-minimized":{"identifier":"deny-is-minimized","description":"Denies the is_minimized command without any pre-configured scope.","commands":{"allow":[],"deny":["is_minimized"]}},"deny-is-resizable":{"identifier":"deny-is-resizable","description":"Denies the is_resizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_resizable"]}},"deny-is-visible":{"identifier":"deny-is-visible","description":"Denies the is_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["is_visible"]}},"deny-maximize":{"identifier":"deny-maximize","description":"Denies the maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["maximize"]}},"deny-minimize":{"identifier":"deny-minimize","description":"Denies the minimize command without any pre-configured scope.","commands":{"allow":[],"deny":["minimize"]}},"deny-monitor-from-point":{"identifier":"deny-monitor-from-point","description":"Denies the monitor_from_point command without any pre-configured scope.","commands":{"allow":[],"deny":["monitor_from_point"]}},"deny-outer-position":{"identifier":"deny-outer-position","description":"Denies the outer_position command without any pre-configured scope.","commands":{"allow":[],"deny":["outer_position"]}},"deny-outer-size":{"identifier":"deny-outer-size","description":"Denies the outer_size command without any pre-configured scope.","commands":{"allow":[],"deny":["outer_size"]}},"deny-primary-monitor":{"identifier":"deny-primary-monitor","description":"Denies the primary_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["primary_monitor"]}},"deny-request-user-attention":{"identifier":"deny-request-user-attention","description":"Denies the request_user_attention command without any pre-configured scope.","commands":{"allow":[],"deny":["request_user_attention"]}},"deny-scale-factor":{"identifier":"deny-scale-factor","description":"Denies the scale_factor command without any pre-configured scope.","commands":{"allow":[],"deny":["scale_factor"]}},"deny-scene-identifier":{"identifier":"deny-scene-identifier","description":"Denies the scene_identifier command without any pre-configured scope.","commands":{"allow":[],"deny":["scene_identifier"]}},"deny-set-always-on-bottom":{"identifier":"deny-set-always-on-bottom","description":"Denies the set_always_on_bottom command without any pre-configured scope.","commands":{"allow":[],"deny":["set_always_on_bottom"]}},"deny-set-always-on-top":{"identifier":"deny-set-always-on-top","description":"Denies the set_always_on_top command without any pre-configured scope.","commands":{"allow":[],"deny":["set_always_on_top"]}},"deny-set-background-color":{"identifier":"deny-set-background-color","description":"Denies the set_background_color command without any pre-configured scope.","commands":{"allow":[],"deny":["set_background_color"]}},"deny-set-badge-count":{"identifier":"deny-set-badge-count","description":"Denies the set_badge_count command without any pre-configured scope.","commands":{"allow":[],"deny":["set_badge_count"]}},"deny-set-badge-label":{"identifier":"deny-set-badge-label","description":"Denies the set_badge_label command without any pre-configured scope.","commands":{"allow":[],"deny":["set_badge_label"]}},"deny-set-closable":{"identifier":"deny-set-closable","description":"Denies the set_closable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_closable"]}},"deny-set-content-protected":{"identifier":"deny-set-content-protected","description":"Denies the set_content_protected command without any pre-configured scope.","commands":{"allow":[],"deny":["set_content_protected"]}},"deny-set-cursor-grab":{"identifier":"deny-set-cursor-grab","description":"Denies the set_cursor_grab command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_grab"]}},"deny-set-cursor-icon":{"identifier":"deny-set-cursor-icon","description":"Denies the set_cursor_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_icon"]}},"deny-set-cursor-position":{"identifier":"deny-set-cursor-position","description":"Denies the set_cursor_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_position"]}},"deny-set-cursor-visible":{"identifier":"deny-set-cursor-visible","description":"Denies the set_cursor_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_visible"]}},"deny-set-decorations":{"identifier":"deny-set-decorations","description":"Denies the set_decorations command without any pre-configured scope.","commands":{"allow":[],"deny":["set_decorations"]}},"deny-set-effects":{"identifier":"deny-set-effects","description":"Denies the set_effects command without any pre-configured scope.","commands":{"allow":[],"deny":["set_effects"]}},"deny-set-enabled":{"identifier":"deny-set-enabled","description":"Denies the set_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["set_enabled"]}},"deny-set-focus":{"identifier":"deny-set-focus","description":"Denies the set_focus command without any pre-configured scope.","commands":{"allow":[],"deny":["set_focus"]}},"deny-set-focusable":{"identifier":"deny-set-focusable","description":"Denies the set_focusable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_focusable"]}},"deny-set-fullscreen":{"identifier":"deny-set-fullscreen","description":"Denies the set_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["set_fullscreen"]}},"deny-set-fullscreen-on-monitor":{"identifier":"deny-set-fullscreen-on-monitor","description":"Denies the set_fullscreen_on_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["set_fullscreen_on_monitor"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-ignore-cursor-events":{"identifier":"deny-set-ignore-cursor-events","description":"Denies the set_ignore_cursor_events command without any pre-configured scope.","commands":{"allow":[],"deny":["set_ignore_cursor_events"]}},"deny-set-max-size":{"identifier":"deny-set-max-size","description":"Denies the set_max_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_max_size"]}},"deny-set-maximizable":{"identifier":"deny-set-maximizable","description":"Denies the set_maximizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_maximizable"]}},"deny-set-min-size":{"identifier":"deny-set-min-size","description":"Denies the set_min_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_min_size"]}},"deny-set-minimizable":{"identifier":"deny-set-minimizable","description":"Denies the set_minimizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_minimizable"]}},"deny-set-overlay-icon":{"identifier":"deny-set-overlay-icon","description":"Denies the set_overlay_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_overlay_icon"]}},"deny-set-position":{"identifier":"deny-set-position","description":"Denies the set_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_position"]}},"deny-set-progress-bar":{"identifier":"deny-set-progress-bar","description":"Denies the set_progress_bar command without any pre-configured scope.","commands":{"allow":[],"deny":["set_progress_bar"]}},"deny-set-resizable":{"identifier":"deny-set-resizable","description":"Denies the set_resizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_resizable"]}},"deny-set-shadow":{"identifier":"deny-set-shadow","description":"Denies the set_shadow command without any pre-configured scope.","commands":{"allow":[],"deny":["set_shadow"]}},"deny-set-simple-fullscreen":{"identifier":"deny-set-simple-fullscreen","description":"Denies the set_simple_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["set_simple_fullscreen"]}},"deny-set-size":{"identifier":"deny-set-size","description":"Denies the set_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_size"]}},"deny-set-size-constraints":{"identifier":"deny-set-size-constraints","description":"Denies the set_size_constraints command without any pre-configured scope.","commands":{"allow":[],"deny":["set_size_constraints"]}},"deny-set-skip-taskbar":{"identifier":"deny-set-skip-taskbar","description":"Denies the set_skip_taskbar command without any pre-configured scope.","commands":{"allow":[],"deny":["set_skip_taskbar"]}},"deny-set-theme":{"identifier":"deny-set-theme","description":"Denies the set_theme command without any pre-configured scope.","commands":{"allow":[],"deny":["set_theme"]}},"deny-set-title":{"identifier":"deny-set-title","description":"Denies the set_title command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title"]}},"deny-set-title-bar-style":{"identifier":"deny-set-title-bar-style","description":"Denies the set_title_bar_style command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title_bar_style"]}},"deny-set-visible-on-all-workspaces":{"identifier":"deny-set-visible-on-all-workspaces","description":"Denies the set_visible_on_all_workspaces command without any pre-configured scope.","commands":{"allow":[],"deny":["set_visible_on_all_workspaces"]}},"deny-show":{"identifier":"deny-show","description":"Denies the show command without any pre-configured scope.","commands":{"allow":[],"deny":["show"]}},"deny-start-dragging":{"identifier":"deny-start-dragging","description":"Denies the start_dragging command without any pre-configured scope.","commands":{"allow":[],"deny":["start_dragging"]}},"deny-start-resize-dragging":{"identifier":"deny-start-resize-dragging","description":"Denies the start_resize_dragging command without any pre-configured scope.","commands":{"allow":[],"deny":["start_resize_dragging"]}},"deny-theme":{"identifier":"deny-theme","description":"Denies the theme command without any pre-configured scope.","commands":{"allow":[],"deny":["theme"]}},"deny-title":{"identifier":"deny-title","description":"Denies the title command without any pre-configured scope.","commands":{"allow":[],"deny":["title"]}},"deny-toggle-maximize":{"identifier":"deny-toggle-maximize","description":"Denies the toggle_maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["toggle_maximize"]}},"deny-unmaximize":{"identifier":"deny-unmaximize","description":"Denies the unmaximize command without any pre-configured scope.","commands":{"allow":[],"deny":["unmaximize"]}},"deny-unminimize":{"identifier":"deny-unminimize","description":"Denies the unminimize command without any pre-configured scope.","commands":{"allow":[],"deny":["unminimize"]}}},"permission_sets":{},"global_scope_schema":null},"deep-link":{"default_permission":{"identifier":"default","description":"Allows reading the opened deep link via the get_current command","permissions":["allow-get-current"]},"permissions":{"allow-get-current":{"identifier":"allow-get-current","description":"Enables the get_current command without any pre-configured scope.","commands":{"allow":["get_current"],"deny":[]}},"allow-is-registered":{"identifier":"allow-is-registered","description":"Enables the is_registered command without any pre-configured scope.","commands":{"allow":["is_registered"],"deny":[]}},"allow-register":{"identifier":"allow-register","description":"Enables the register command without any pre-configured scope.","commands":{"allow":["register"],"deny":[]}},"allow-unregister":{"identifier":"allow-unregister","description":"Enables the unregister command without any pre-configured scope.","commands":{"allow":["unregister"],"deny":[]}},"deny-get-current":{"identifier":"deny-get-current","description":"Denies the get_current command without any pre-configured scope.","commands":{"allow":[],"deny":["get_current"]}},"deny-is-registered":{"identifier":"deny-is-registered","description":"Denies the is_registered command without any pre-configured scope.","commands":{"allow":[],"deny":["is_registered"]}},"deny-register":{"identifier":"deny-register","description":"Denies the register command without any pre-configured scope.","commands":{"allow":[],"deny":["register"]}},"deny-unregister":{"identifier":"deny-unregister","description":"Denies the unregister command without any pre-configured scope.","commands":{"allow":[],"deny":["unregister"]}}},"permission_sets":{},"global_scope_schema":null},"dialog":{"default_permission":{"identifier":"default","description":"This permission set configures the types of dialogs\navailable from the dialog plugin.\n\n#### Granted Permissions\n\nAll dialog types are enabled.\n\n\n","permissions":["allow-message","allow-save","allow-open"]},"permissions":{"allow-ask":{"identifier":"allow-ask","description":"Enables the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)","commands":{"allow":["message"],"deny":[]}},"allow-confirm":{"identifier":"allow-confirm","description":"Enables the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)","commands":{"allow":["message"],"deny":[]}},"allow-message":{"identifier":"allow-message","description":"Enables the message command without any pre-configured scope.","commands":{"allow":["message"],"deny":[]}},"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-save":{"identifier":"allow-save","description":"Enables the save command without any pre-configured scope.","commands":{"allow":["save"],"deny":[]}},"deny-ask":{"identifier":"deny-ask","description":"Denies the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)","commands":{"allow":[],"deny":["message"]}},"deny-confirm":{"identifier":"deny-confirm","description":"Denies the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)","commands":{"allow":[],"deny":["message"]}},"deny-message":{"identifier":"deny-message","description":"Denies the message command without any pre-configured scope.","commands":{"allow":[],"deny":["message"]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-save":{"identifier":"deny-save","description":"Denies the save command without any pre-configured scope.","commands":{"allow":[],"deny":["save"]}}},"permission_sets":{},"global_scope_schema":null},"log":{"default_permission":{"identifier":"default","description":"Allows the log command","permissions":["allow-log"]},"permissions":{"allow-log":{"identifier":"allow-log","description":"Enables the log command without any pre-configured scope.","commands":{"allow":["log"],"deny":[]}},"deny-log":{"identifier":"deny-log","description":"Denies the log command without any pre-configured scope.","commands":{"allow":[],"deny":["log"]}}},"permission_sets":{},"global_scope_schema":null},"notification":{"default_permission":{"identifier":"default","description":"This permission set configures which\nnotification features are by default exposed.\n\n#### Granted Permissions\n\nIt allows all notification related features.\n\n","permissions":["allow-is-permission-granted","allow-request-permission","allow-notify","allow-register-action-types","allow-register-listener","allow-remove-listener","allow-cancel","allow-get-pending","allow-remove-active","allow-get-active","allow-check-permissions","allow-show","allow-batch","allow-list-channels","allow-delete-channel","allow-create-channel","allow-permission-state"]},"permissions":{"allow-batch":{"identifier":"allow-batch","description":"Enables the batch command without any pre-configured scope.","commands":{"allow":["batch"],"deny":[]}},"allow-cancel":{"identifier":"allow-cancel","description":"Enables the cancel command without any pre-configured scope.","commands":{"allow":["cancel"],"deny":[]}},"allow-check-permissions":{"identifier":"allow-check-permissions","description":"Enables the check_permissions command without any pre-configured scope.","commands":{"allow":["check_permissions"],"deny":[]}},"allow-create-channel":{"identifier":"allow-create-channel","description":"Enables the create_channel command without any pre-configured scope.","commands":{"allow":["create_channel"],"deny":[]}},"allow-delete-channel":{"identifier":"allow-delete-channel","description":"Enables the delete_channel command without any pre-configured scope.","commands":{"allow":["delete_channel"],"deny":[]}},"allow-get-active":{"identifier":"allow-get-active","description":"Enables the get_active command without any pre-configured scope.","commands":{"allow":["get_active"],"deny":[]}},"allow-get-pending":{"identifier":"allow-get-pending","description":"Enables the get_pending command without any pre-configured scope.","commands":{"allow":["get_pending"],"deny":[]}},"allow-is-permission-granted":{"identifier":"allow-is-permission-granted","description":"Enables the is_permission_granted command without any pre-configured scope.","commands":{"allow":["is_permission_granted"],"deny":[]}},"allow-list-channels":{"identifier":"allow-list-channels","description":"Enables the list_channels command without any pre-configured scope.","commands":{"allow":["list_channels"],"deny":[]}},"allow-notify":{"identifier":"allow-notify","description":"Enables the notify command without any pre-configured scope.","commands":{"allow":["notify"],"deny":[]}},"allow-permission-state":{"identifier":"allow-permission-state","description":"Enables the permission_state command without any pre-configured scope.","commands":{"allow":["permission_state"],"deny":[]}},"allow-register-action-types":{"identifier":"allow-register-action-types","description":"Enables the register_action_types command without any pre-configured scope.","commands":{"allow":["register_action_types"],"deny":[]}},"allow-register-listener":{"identifier":"allow-register-listener","description":"Enables the register_listener command without any pre-configured scope.","commands":{"allow":["register_listener"],"deny":[]}},"allow-remove-active":{"identifier":"allow-remove-active","description":"Enables the remove_active command without any pre-configured scope.","commands":{"allow":["remove_active"],"deny":[]}},"allow-remove-listener":{"identifier":"allow-remove-listener","description":"Enables the remove_listener command without any pre-configured scope.","commands":{"allow":["remove_listener"],"deny":[]}},"allow-request-permission":{"identifier":"allow-request-permission","description":"Enables the request_permission command without any pre-configured scope.","commands":{"allow":["request_permission"],"deny":[]}},"allow-show":{"identifier":"allow-show","description":"Enables the show command without any pre-configured scope.","commands":{"allow":["show"],"deny":[]}},"deny-batch":{"identifier":"deny-batch","description":"Denies the batch command without any pre-configured scope.","commands":{"allow":[],"deny":["batch"]}},"deny-cancel":{"identifier":"deny-cancel","description":"Denies the cancel command without any pre-configured scope.","commands":{"allow":[],"deny":["cancel"]}},"deny-check-permissions":{"identifier":"deny-check-permissions","description":"Denies the check_permissions command without any pre-configured scope.","commands":{"allow":[],"deny":["check_permissions"]}},"deny-create-channel":{"identifier":"deny-create-channel","description":"Denies the create_channel command without any pre-configured scope.","commands":{"allow":[],"deny":["create_channel"]}},"deny-delete-channel":{"identifier":"deny-delete-channel","description":"Denies the delete_channel command without any pre-configured scope.","commands":{"allow":[],"deny":["delete_channel"]}},"deny-get-active":{"identifier":"deny-get-active","description":"Denies the get_active command without any pre-configured scope.","commands":{"allow":[],"deny":["get_active"]}},"deny-get-pending":{"identifier":"deny-get-pending","description":"Denies the get_pending command without any pre-configured scope.","commands":{"allow":[],"deny":["get_pending"]}},"deny-is-permission-granted":{"identifier":"deny-is-permission-granted","description":"Denies the is_permission_granted command without any pre-configured scope.","commands":{"allow":[],"deny":["is_permission_granted"]}},"deny-list-channels":{"identifier":"deny-list-channels","description":"Denies the list_channels command without any pre-configured scope.","commands":{"allow":[],"deny":["list_channels"]}},"deny-notify":{"identifier":"deny-notify","description":"Denies the notify command without any pre-configured scope.","commands":{"allow":[],"deny":["notify"]}},"deny-permission-state":{"identifier":"deny-permission-state","description":"Denies the permission_state command without any pre-configured scope.","commands":{"allow":[],"deny":["permission_state"]}},"deny-register-action-types":{"identifier":"deny-register-action-types","description":"Denies the register_action_types command without any pre-configured scope.","commands":{"allow":[],"deny":["register_action_types"]}},"deny-register-listener":{"identifier":"deny-register-listener","description":"Denies the register_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["register_listener"]}},"deny-remove-active":{"identifier":"deny-remove-active","description":"Denies the remove_active command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_active"]}},"deny-remove-listener":{"identifier":"deny-remove-listener","description":"Denies the remove_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_listener"]}},"deny-request-permission":{"identifier":"deny-request-permission","description":"Denies the request_permission command without any pre-configured scope.","commands":{"allow":[],"deny":["request_permission"]}},"deny-show":{"identifier":"deny-show","description":"Denies the show command without any pre-configured scope.","commands":{"allow":[],"deny":["show"]}}},"permission_sets":{},"global_scope_schema":null},"openbot-desktop":{"default_permission":null,"permissions":{"allow-ai-connection":{"identifier":"allow-ai-connection","description":"Enables the ai_connection command without any pre-configured scope.","commands":{"allow":["ai_connection"],"deny":[]}},"allow-ai-providers":{"identifier":"allow-ai-providers","description":"Enables the ai_providers command without any pre-configured scope.","commands":{"allow":["ai_providers"],"deny":[]}},"allow-appearance":{"identifier":"allow-appearance","description":"Enables the appearance command without any pre-configured scope.","commands":{"allow":["appearance"],"deny":[]}},"allow-begin-plan-sign-in":{"identifier":"allow-begin-plan-sign-in","description":"Enables the begin_plan_sign_in command without any pre-configured scope.","commands":{"allow":["begin_plan_sign_in"],"deny":[]}},"allow-begin-provider-sign-in":{"identifier":"allow-begin-provider-sign-in","description":"Enables the begin_provider_sign_in command without any pre-configured scope.","commands":{"allow":["begin_provider_sign_in"],"deny":[]}},"allow-cancel-plan-sign-in":{"identifier":"allow-cancel-plan-sign-in","description":"Enables the cancel_plan_sign_in command without any pre-configured scope.","commands":{"allow":["cancel_plan_sign_in"],"deny":[]}},"allow-cancel-provider-sign-in":{"identifier":"allow-cancel-provider-sign-in","description":"Enables the cancel_provider_sign_in command without any pre-configured scope.","commands":{"allow":["cancel_provider_sign_in"],"deny":[]}},"allow-change-ai-connection":{"identifier":"allow-change-ai-connection","description":"Enables the change_ai_connection command without any pre-configured scope.","commands":{"allow":["change_ai_connection"],"deny":[]}},"allow-change-connection":{"identifier":"allow-change-connection","description":"Enables the change_connection command without any pre-configured scope.","commands":{"allow":["change_connection"],"deny":[]}},"allow-check-update":{"identifier":"allow-check-update","description":"Enables the check_update command without any pre-configured scope.","commands":{"allow":["check_update"],"deny":[]}},"allow-connection":{"identifier":"allow-connection","description":"Enables the connection command without any pre-configured scope.","commands":{"allow":["connection"],"deny":[]}},"allow-dismiss-update":{"identifier":"allow-dismiss-update","description":"Enables the dismiss_update command without any pre-configured scope.","commands":{"allow":["dismiss_update"],"deny":[]}},"allow-finish-plan-sign-in":{"identifier":"allow-finish-plan-sign-in","description":"Enables the finish_plan_sign_in command without any pre-configured scope.","commands":{"allow":["finish_plan_sign_in"],"deny":[]}},"allow-finish-provider-sign-in":{"identifier":"allow-finish-provider-sign-in","description":"Enables the finish_provider_sign_in command without any pre-configured scope.","commands":{"allow":["finish_provider_sign_in"],"deny":[]}},"allow-install-update":{"identifier":"allow-install-update","description":"Enables the install_update command without any pre-configured scope.","commands":{"allow":["install_update"],"deny":[]}},"allow-intelligence":{"identifier":"allow-intelligence","description":"Enables the intelligence command without any pre-configured scope.","commands":{"allow":["intelligence"],"deny":[]}},"allow-notify":{"identifier":"allow-notify","description":"Enables the notify command without any pre-configured scope.","commands":{"allow":["notify"],"deny":[]}},"allow-open-logs":{"identifier":"allow-open-logs","description":"Enables the open_logs command without any pre-configured scope.","commands":{"allow":["open_logs"],"deny":[]}},"allow-prepare-ai-connection":{"identifier":"allow-prepare-ai-connection","description":"Enables the prepare_ai_connection command without any pre-configured scope.","commands":{"allow":["prepare_ai_connection"],"deny":[]}},"allow-quit":{"identifier":"allow-quit","description":"Enables the quit command without any pre-configured scope.","commands":{"allow":["quit"],"deny":[]}},"allow-restart":{"identifier":"allow-restart","description":"Enables the restart command without any pre-configured scope.","commands":{"allow":["restart"],"deny":[]}},"allow-set-organization":{"identifier":"allow-set-organization","description":"Enables the set_organization command without any pre-configured scope.","commands":{"allow":["set_organization"],"deny":[]}},"allow-set-usage-data":{"identifier":"allow-set-usage-data","description":"Enables the set_usage_data command without any pre-configured scope.","commands":{"allow":["set_usage_data"],"deny":[]}},"allow-settle-ai-connection":{"identifier":"allow-settle-ai-connection","description":"Enables the settle_ai_connection command without any pre-configured scope.","commands":{"allow":["settle_ai_connection"],"deny":[]}},"allow-sign-out":{"identifier":"allow-sign-out","description":"Enables the sign_out command without any pre-configured scope.","commands":{"allow":["sign_out"],"deny":[]}},"allow-speech-abort":{"identifier":"allow-speech-abort","description":"Enables the speech_abort command without any pre-configured scope.","commands":{"allow":["speech_abort"],"deny":[]}},"allow-speech-available":{"identifier":"allow-speech-available","description":"Enables the speech_available command without any pre-configured scope.","commands":{"allow":["speech_available"],"deny":[]}},"allow-speech-start":{"identifier":"allow-speech-start","description":"Enables the speech_start command without any pre-configured scope.","commands":{"allow":["speech_start"],"deny":[]}},"allow-speech-stop":{"identifier":"allow-speech-stop","description":"Enables the speech_stop command without any pre-configured scope.","commands":{"allow":["speech_stop"],"deny":[]}},"allow-status":{"identifier":"allow-status","description":"Enables the status command without any pre-configured scope.","commands":{"allow":["status"],"deny":[]}},"allow-stop":{"identifier":"allow-stop","description":"Enables the stop command without any pre-configured scope.","commands":{"allow":["stop"],"deny":[]}},"allow-update-offer":{"identifier":"allow-update-offer","description":"Enables the update_offer command without any pre-configured scope.","commands":{"allow":["update_offer"],"deny":[]}},"allow-usage-data":{"identifier":"allow-usage-data","description":"Enables the usage_data command without any pre-configured scope.","commands":{"allow":["usage_data"],"deny":[]}},"allow-zoom":{"identifier":"allow-zoom","description":"Enables the zoom command without any pre-configured scope.","commands":{"allow":["zoom"],"deny":[]}},"deny-ai-connection":{"identifier":"deny-ai-connection","description":"Denies the ai_connection command without any pre-configured scope.","commands":{"allow":[],"deny":["ai_connection"]}},"deny-ai-providers":{"identifier":"deny-ai-providers","description":"Denies the ai_providers command without any pre-configured scope.","commands":{"allow":[],"deny":["ai_providers"]}},"deny-appearance":{"identifier":"deny-appearance","description":"Denies the appearance command without any pre-configured scope.","commands":{"allow":[],"deny":["appearance"]}},"deny-begin-plan-sign-in":{"identifier":"deny-begin-plan-sign-in","description":"Denies the begin_plan_sign_in command without any pre-configured scope.","commands":{"allow":[],"deny":["begin_plan_sign_in"]}},"deny-begin-provider-sign-in":{"identifier":"deny-begin-provider-sign-in","description":"Denies the begin_provider_sign_in command without any pre-configured scope.","commands":{"allow":[],"deny":["begin_provider_sign_in"]}},"deny-cancel-plan-sign-in":{"identifier":"deny-cancel-plan-sign-in","description":"Denies the cancel_plan_sign_in command without any pre-configured scope.","commands":{"allow":[],"deny":["cancel_plan_sign_in"]}},"deny-cancel-provider-sign-in":{"identifier":"deny-cancel-provider-sign-in","description":"Denies the cancel_provider_sign_in command without any pre-configured scope.","commands":{"allow":[],"deny":["cancel_provider_sign_in"]}},"deny-change-ai-connection":{"identifier":"deny-change-ai-connection","description":"Denies the change_ai_connection command without any pre-configured scope.","commands":{"allow":[],"deny":["change_ai_connection"]}},"deny-change-connection":{"identifier":"deny-change-connection","description":"Denies the change_connection command without any pre-configured scope.","commands":{"allow":[],"deny":["change_connection"]}},"deny-check-update":{"identifier":"deny-check-update","description":"Denies the check_update command without any pre-configured scope.","commands":{"allow":[],"deny":["check_update"]}},"deny-connection":{"identifier":"deny-connection","description":"Denies the connection command without any pre-configured scope.","commands":{"allow":[],"deny":["connection"]}},"deny-dismiss-update":{"identifier":"deny-dismiss-update","description":"Denies the dismiss_update command without any pre-configured scope.","commands":{"allow":[],"deny":["dismiss_update"]}},"deny-finish-plan-sign-in":{"identifier":"deny-finish-plan-sign-in","description":"Denies the finish_plan_sign_in command without any pre-configured scope.","commands":{"allow":[],"deny":["finish_plan_sign_in"]}},"deny-finish-provider-sign-in":{"identifier":"deny-finish-provider-sign-in","description":"Denies the finish_provider_sign_in command without any pre-configured scope.","commands":{"allow":[],"deny":["finish_provider_sign_in"]}},"deny-install-update":{"identifier":"deny-install-update","description":"Denies the install_update command without any pre-configured scope.","commands":{"allow":[],"deny":["install_update"]}},"deny-intelligence":{"identifier":"deny-intelligence","description":"Denies the intelligence command without any pre-configured scope.","commands":{"allow":[],"deny":["intelligence"]}},"deny-notify":{"identifier":"deny-notify","description":"Denies the notify command without any pre-configured scope.","commands":{"allow":[],"deny":["notify"]}},"deny-open-logs":{"identifier":"deny-open-logs","description":"Denies the open_logs command without any pre-configured scope.","commands":{"allow":[],"deny":["open_logs"]}},"deny-prepare-ai-connection":{"identifier":"deny-prepare-ai-connection","description":"Denies the prepare_ai_connection command without any pre-configured scope.","commands":{"allow":[],"deny":["prepare_ai_connection"]}},"deny-quit":{"identifier":"deny-quit","description":"Denies the quit command without any pre-configured scope.","commands":{"allow":[],"deny":["quit"]}},"deny-restart":{"identifier":"deny-restart","description":"Denies the restart command without any pre-configured scope.","commands":{"allow":[],"deny":["restart"]}},"deny-set-organization":{"identifier":"deny-set-organization","description":"Denies the set_organization command without any pre-configured scope.","commands":{"allow":[],"deny":["set_organization"]}},"deny-set-usage-data":{"identifier":"deny-set-usage-data","description":"Denies the set_usage_data command without any pre-configured scope.","commands":{"allow":[],"deny":["set_usage_data"]}},"deny-settle-ai-connection":{"identifier":"deny-settle-ai-connection","description":"Denies the settle_ai_connection command without any pre-configured scope.","commands":{"allow":[],"deny":["settle_ai_connection"]}},"deny-sign-out":{"identifier":"deny-sign-out","description":"Denies the sign_out command without any pre-configured scope.","commands":{"allow":[],"deny":["sign_out"]}},"deny-speech-abort":{"identifier":"deny-speech-abort","description":"Denies the speech_abort command without any pre-configured scope.","commands":{"allow":[],"deny":["speech_abort"]}},"deny-speech-available":{"identifier":"deny-speech-available","description":"Denies the speech_available command without any pre-configured scope.","commands":{"allow":[],"deny":["speech_available"]}},"deny-speech-start":{"identifier":"deny-speech-start","description":"Denies the speech_start command without any pre-configured scope.","commands":{"allow":[],"deny":["speech_start"]}},"deny-speech-stop":{"identifier":"deny-speech-stop","description":"Denies the speech_stop command without any pre-configured scope.","commands":{"allow":[],"deny":["speech_stop"]}},"deny-status":{"identifier":"deny-status","description":"Denies the status command without any pre-configured scope.","commands":{"allow":[],"deny":["status"]}},"deny-stop":{"identifier":"deny-stop","description":"Denies the stop command without any pre-configured scope.","commands":{"allow":[],"deny":["stop"]}},"deny-update-offer":{"identifier":"deny-update-offer","description":"Denies the update_offer command without any pre-configured scope.","commands":{"allow":[],"deny":["update_offer"]}},"deny-usage-data":{"identifier":"deny-usage-data","description":"Denies the usage_data command without any pre-configured scope.","commands":{"allow":[],"deny":["usage_data"]}},"deny-zoom":{"identifier":"deny-zoom","description":"Denies the zoom command without any pre-configured scope.","commands":{"allow":[],"deny":["zoom"]}}},"permission_sets":{},"global_scope_schema":null},"openbot-intelligence":{"default_permission":null,"permissions":{"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-watch":{"identifier":"allow-watch","description":"Enables the watch command without any pre-configured scope.","commands":{"allow":["watch"],"deny":[]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-watch":{"identifier":"deny-watch","description":"Denies the watch command without any pre-configured scope.","commands":{"allow":[],"deny":["watch"]}}},"permission_sets":{},"global_scope_schema":null},"opener":{"default_permission":{"identifier":"default","description":"This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer","permissions":["allow-open-url","allow-reveal-item-in-dir","allow-default-urls"]},"permissions":{"allow-default-urls":{"identifier":"allow-default-urls","description":"This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"url":"mailto:*"},{"url":"tel:*"},{"url":"http://*"},{"url":"https://*"}]}},"allow-open-path":{"identifier":"allow-open-path","description":"Enables the open_path command without any pre-configured scope.","commands":{"allow":["open_path"],"deny":[]}},"allow-open-url":{"identifier":"allow-open-url","description":"Enables the open_url command without any pre-configured scope.","commands":{"allow":["open_url"],"deny":[]}},"allow-reveal-item-in-dir":{"identifier":"allow-reveal-item-in-dir","description":"Enables the reveal_item_in_dir command without any pre-configured scope.","commands":{"allow":["reveal_item_in_dir"],"deny":[]}},"deny-open-path":{"identifier":"deny-open-path","description":"Denies the open_path command without any pre-configured scope.","commands":{"allow":[],"deny":["open_path"]}},"deny-open-url":{"identifier":"deny-open-url","description":"Denies the open_url command without any pre-configured scope.","commands":{"allow":[],"deny":["open_url"]}},"deny-reveal-item-in-dir":{"identifier":"deny-reveal-item-in-dir","description":"Denies the reveal_item_in_dir command without any pre-configured scope.","commands":{"allow":[],"deny":["reveal_item_in_dir"]}}},"permission_sets":{},"global_scope_schema":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"properties":{"app":{"allOf":[{"$ref":"#/definitions/Application"}],"description":"An application to open this url with, for example: firefox."},"url":{"description":"A URL that can be opened by the webview when using the Opener APIs.\n\nWildcards can be used following the UNIX glob pattern.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"","type":"string"}},"required":["url"],"type":"object"},{"properties":{"app":{"allOf":[{"$ref":"#/definitions/Application"}],"description":"An application to open this path with, for example: xdg-open."},"path":{"description":"A path that can be opened by the webview when using the Opener APIs.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.","type":"string"}},"required":["path"],"type":"object"}],"definitions":{"Application":{"anyOf":[{"description":"Open in default application.","type":"null"},{"description":"If true, allow open with any application.","type":"boolean"},{"description":"Allow specific application to open with.","type":"string"}],"description":"Opener scope application."}},"description":"Opener scope entry.","title":"OpenerScopeEntry"}},"shell":{"default_permission":{"identifier":"default","description":"This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n","permissions":["allow-open"]},"permissions":{"allow-execute":{"identifier":"allow-execute","description":"Enables the execute command without any pre-configured scope.","commands":{"allow":["execute"],"deny":[]}},"allow-kill":{"identifier":"allow-kill","description":"Enables the kill command without any pre-configured scope.","commands":{"allow":["kill"],"deny":[]}},"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-spawn":{"identifier":"allow-spawn","description":"Enables the spawn command without any pre-configured scope.","commands":{"allow":["spawn"],"deny":[]}},"allow-stdin-write":{"identifier":"allow-stdin-write","description":"Enables the stdin_write command without any pre-configured scope.","commands":{"allow":["stdin_write"],"deny":[]}},"deny-execute":{"identifier":"deny-execute","description":"Denies the execute command without any pre-configured scope.","commands":{"allow":[],"deny":["execute"]}},"deny-kill":{"identifier":"deny-kill","description":"Denies the kill command without any pre-configured scope.","commands":{"allow":[],"deny":["kill"]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-spawn":{"identifier":"deny-spawn","description":"Denies the spawn command without any pre-configured scope.","commands":{"allow":[],"deny":["spawn"]}},"deny-stdin-write":{"identifier":"deny-stdin-write","description":"Denies the stdin_write command without any pre-configured scope.","commands":{"allow":[],"deny":["stdin_write"]}}},"permission_sets":{},"global_scope_schema":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"additionalProperties":false,"properties":{"args":{"allOf":[{"$ref":"#/definitions/ShellScopeEntryAllowedArgs"}],"description":"The allowed arguments for the command execution."},"cmd":{"description":"The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.","type":"string"},"name":{"description":"The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.","type":"string"}},"required":["cmd","name"],"type":"object"},{"additionalProperties":false,"properties":{"args":{"allOf":[{"$ref":"#/definitions/ShellScopeEntryAllowedArgs"}],"description":"The allowed arguments for the command execution."},"name":{"description":"The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.","type":"string"},"sidecar":{"description":"If this command is a sidecar command.","type":"boolean"}},"required":["name","sidecar"],"type":"object"}],"definitions":{"ShellScopeEntryAllowedArg":{"anyOf":[{"description":"A non-configurable argument that is passed to the command in the order it was specified.","type":"string"},{"additionalProperties":false,"description":"A variable that is set while calling the command from the webview API.","properties":{"raw":{"default":false,"description":"Marks the validator as a raw regex, meaning the plugin should not make any modification at runtime.\n\nThis means the regex will not match on the entire string by default, which might be exploited if your regex allow unexpected input to be considered valid. When using this option, make sure your regex is correct.","type":"boolean"},"validator":{"description":"[regex] validator to require passed values to conform to an expected input.\n\nThis will require the argument value passed to this variable to match the `validator` regex before it will be executed.\n\nThe regex string is by default surrounded by `^...$` to match the full string. For example the `https?://\\w+` regex would be registered as `^https?://\\w+$`.\n\n[regex]: ","type":"string"}},"required":["validator"],"type":"object"}],"description":"A command argument allowed to be executed by the webview API."},"ShellScopeEntryAllowedArgs":{"anyOf":[{"description":"Use a simple boolean to allow all or disable all arguments to this command configuration.","type":"boolean"},{"description":"A specific set of [`ShellScopeEntryAllowedArg`] that are valid to call for the command configuration.","items":{"$ref":"#/definitions/ShellScopeEntryAllowedArg"},"type":"array"}],"description":"A set of command arguments allowed to be executed by the webview API.\n\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellScopeEntryAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration."}},"description":"Shell scope entry.","title":"ShellScopeEntry"}},"updater":{"default_permission":{"identifier":"default","description":"This permission set configures which kind of\nupdater functions are exposed to the frontend.\n\n#### Granted Permissions\n\nThe full workflow from checking for updates to installing them\nis enabled.\n\n","permissions":["allow-check","allow-download","allow-install","allow-download-and-install"]},"permissions":{"allow-check":{"identifier":"allow-check","description":"Enables the check command without any pre-configured scope.","commands":{"allow":["check"],"deny":[]}},"allow-download":{"identifier":"allow-download","description":"Enables the download command without any pre-configured scope.","commands":{"allow":["download"],"deny":[]}},"allow-download-and-install":{"identifier":"allow-download-and-install","description":"Enables the download_and_install command without any pre-configured scope.","commands":{"allow":["download_and_install"],"deny":[]}},"allow-install":{"identifier":"allow-install","description":"Enables the install command without any pre-configured scope.","commands":{"allow":["install"],"deny":[]}},"deny-check":{"identifier":"deny-check","description":"Denies the check command without any pre-configured scope.","commands":{"allow":[],"deny":["check"]}},"deny-download":{"identifier":"deny-download","description":"Denies the download command without any pre-configured scope.","commands":{"allow":[],"deny":["download"]}},"deny-download-and-install":{"identifier":"deny-download-and-install","description":"Denies the download_and_install command without any pre-configured scope.","commands":{"allow":[],"deny":["download_and_install"]}},"deny-install":{"identifier":"deny-install","description":"Denies the install command without any pre-configured scope.","commands":{"allow":[],"deny":["install"]}}},"permission_sets":{},"global_scope_schema":null},"window-state":{"default_permission":{"identifier":"default","description":"This permission set configures what kind of\noperations are available from the window state plugin.\n\n#### Granted Permissions\n\nAll operations are enabled by default.\n\n","permissions":["allow-filename","allow-restore-state","allow-save-window-state"]},"permissions":{"allow-filename":{"identifier":"allow-filename","description":"Enables the filename command without any pre-configured scope.","commands":{"allow":["filename"],"deny":[]}},"allow-restore-state":{"identifier":"allow-restore-state","description":"Enables the restore_state command without any pre-configured scope.","commands":{"allow":["restore_state"],"deny":[]}},"allow-save-window-state":{"identifier":"allow-save-window-state","description":"Enables the save_window_state command without any pre-configured scope.","commands":{"allow":["save_window_state"],"deny":[]}},"deny-filename":{"identifier":"deny-filename","description":"Denies the filename command without any pre-configured scope.","commands":{"allow":[],"deny":["filename"]}},"deny-restore-state":{"identifier":"deny-restore-state","description":"Denies the restore_state command without any pre-configured scope.","commands":{"allow":[],"deny":["restore_state"]}},"deny-save-window-state":{"identifier":"deny-save-window-state","description":"Denies the save_window_state command without any pre-configured scope.","commands":{"allow":[],"deny":["save_window_state"]}}},"permission_sets":{},"global_scope_schema":null}} \ No newline at end of file +{"core":{"default_permission":{"identifier":"default","description":"Default core plugins set.","permissions":["core:path:default","core:event:default","core:window:default","core:webview:default","core:app:default","core:image:default","core:resources:default","core:menu:default","core:tray:default"]},"permissions":{},"permission_sets":{},"global_scope_schema":null},"core:app":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-version","allow-name","allow-tauri-version","allow-identifier","allow-bundle-type","allow-register-listener","allow-remove-listener","allow-supports-multiple-windows"]},"permissions":{"allow-app-hide":{"identifier":"allow-app-hide","description":"Enables the app_hide command without any pre-configured scope.","commands":{"allow":["app_hide"],"deny":[]}},"allow-app-show":{"identifier":"allow-app-show","description":"Enables the app_show command without any pre-configured scope.","commands":{"allow":["app_show"],"deny":[]}},"allow-bundle-type":{"identifier":"allow-bundle-type","description":"Enables the bundle_type command without any pre-configured scope.","commands":{"allow":["bundle_type"],"deny":[]}},"allow-default-window-icon":{"identifier":"allow-default-window-icon","description":"Enables the default_window_icon command without any pre-configured scope.","commands":{"allow":["default_window_icon"],"deny":[]}},"allow-exit":{"identifier":"allow-exit","description":"Enables the exit command without any pre-configured scope.","commands":{"allow":["exit"],"deny":[]}},"allow-fetch-data-store-identifiers":{"identifier":"allow-fetch-data-store-identifiers","description":"Enables the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":["fetch_data_store_identifiers"],"deny":[]}},"allow-identifier":{"identifier":"allow-identifier","description":"Enables the identifier command without any pre-configured scope.","commands":{"allow":["identifier"],"deny":[]}},"allow-name":{"identifier":"allow-name","description":"Enables the name command without any pre-configured scope.","commands":{"allow":["name"],"deny":[]}},"allow-register-listener":{"identifier":"allow-register-listener","description":"Enables the register_listener command without any pre-configured scope.","commands":{"allow":["register_listener"],"deny":[]}},"allow-remove-data-store":{"identifier":"allow-remove-data-store","description":"Enables the remove_data_store command without any pre-configured scope.","commands":{"allow":["remove_data_store"],"deny":[]}},"allow-remove-listener":{"identifier":"allow-remove-listener","description":"Enables the remove_listener command without any pre-configured scope.","commands":{"allow":["remove_listener"],"deny":[]}},"allow-set-app-theme":{"identifier":"allow-set-app-theme","description":"Enables the set_app_theme command without any pre-configured scope.","commands":{"allow":["set_app_theme"],"deny":[]}},"allow-set-dock-visibility":{"identifier":"allow-set-dock-visibility","description":"Enables the set_dock_visibility command without any pre-configured scope.","commands":{"allow":["set_dock_visibility"],"deny":[]}},"allow-supports-multiple-windows":{"identifier":"allow-supports-multiple-windows","description":"Enables the supports_multiple_windows command without any pre-configured scope.","commands":{"allow":["supports_multiple_windows"],"deny":[]}},"allow-tauri-version":{"identifier":"allow-tauri-version","description":"Enables the tauri_version command without any pre-configured scope.","commands":{"allow":["tauri_version"],"deny":[]}},"allow-version":{"identifier":"allow-version","description":"Enables the version command without any pre-configured scope.","commands":{"allow":["version"],"deny":[]}},"deny-app-hide":{"identifier":"deny-app-hide","description":"Denies the app_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["app_hide"]}},"deny-app-show":{"identifier":"deny-app-show","description":"Denies the app_show command without any pre-configured scope.","commands":{"allow":[],"deny":["app_show"]}},"deny-bundle-type":{"identifier":"deny-bundle-type","description":"Denies the bundle_type command without any pre-configured scope.","commands":{"allow":[],"deny":["bundle_type"]}},"deny-default-window-icon":{"identifier":"deny-default-window-icon","description":"Denies the default_window_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["default_window_icon"]}},"deny-exit":{"identifier":"deny-exit","description":"Denies the exit command without any pre-configured scope.","commands":{"allow":[],"deny":["exit"]}},"deny-fetch-data-store-identifiers":{"identifier":"deny-fetch-data-store-identifiers","description":"Denies the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":[],"deny":["fetch_data_store_identifiers"]}},"deny-identifier":{"identifier":"deny-identifier","description":"Denies the identifier command without any pre-configured scope.","commands":{"allow":[],"deny":["identifier"]}},"deny-name":{"identifier":"deny-name","description":"Denies the name command without any pre-configured scope.","commands":{"allow":[],"deny":["name"]}},"deny-register-listener":{"identifier":"deny-register-listener","description":"Denies the register_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["register_listener"]}},"deny-remove-data-store":{"identifier":"deny-remove-data-store","description":"Denies the remove_data_store command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_data_store"]}},"deny-remove-listener":{"identifier":"deny-remove-listener","description":"Denies the remove_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_listener"]}},"deny-set-app-theme":{"identifier":"deny-set-app-theme","description":"Denies the set_app_theme command without any pre-configured scope.","commands":{"allow":[],"deny":["set_app_theme"]}},"deny-set-dock-visibility":{"identifier":"deny-set-dock-visibility","description":"Denies the set_dock_visibility command without any pre-configured scope.","commands":{"allow":[],"deny":["set_dock_visibility"]}},"deny-supports-multiple-windows":{"identifier":"deny-supports-multiple-windows","description":"Denies the supports_multiple_windows command without any pre-configured scope.","commands":{"allow":[],"deny":["supports_multiple_windows"]}},"deny-tauri-version":{"identifier":"deny-tauri-version","description":"Denies the tauri_version command without any pre-configured scope.","commands":{"allow":[],"deny":["tauri_version"]}},"deny-version":{"identifier":"deny-version","description":"Denies the version command without any pre-configured scope.","commands":{"allow":[],"deny":["version"]}}},"permission_sets":{},"global_scope_schema":null},"core:event":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-listen","allow-unlisten","allow-emit","allow-emit-to"]},"permissions":{"allow-emit":{"identifier":"allow-emit","description":"Enables the emit command without any pre-configured scope.","commands":{"allow":["emit"],"deny":[]}},"allow-emit-to":{"identifier":"allow-emit-to","description":"Enables the emit_to command without any pre-configured scope.","commands":{"allow":["emit_to"],"deny":[]}},"allow-listen":{"identifier":"allow-listen","description":"Enables the listen command without any pre-configured scope.","commands":{"allow":["listen"],"deny":[]}},"allow-unlisten":{"identifier":"allow-unlisten","description":"Enables the unlisten command without any pre-configured scope.","commands":{"allow":["unlisten"],"deny":[]}},"deny-emit":{"identifier":"deny-emit","description":"Denies the emit command without any pre-configured scope.","commands":{"allow":[],"deny":["emit"]}},"deny-emit-to":{"identifier":"deny-emit-to","description":"Denies the emit_to command without any pre-configured scope.","commands":{"allow":[],"deny":["emit_to"]}},"deny-listen":{"identifier":"deny-listen","description":"Denies the listen command without any pre-configured scope.","commands":{"allow":[],"deny":["listen"]}},"deny-unlisten":{"identifier":"deny-unlisten","description":"Denies the unlisten command without any pre-configured scope.","commands":{"allow":[],"deny":["unlisten"]}}},"permission_sets":{},"global_scope_schema":null},"core:image":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-from-bytes","allow-from-path","allow-rgba","allow-size"]},"permissions":{"allow-from-bytes":{"identifier":"allow-from-bytes","description":"Enables the from_bytes command without any pre-configured scope.","commands":{"allow":["from_bytes"],"deny":[]}},"allow-from-path":{"identifier":"allow-from-path","description":"Enables the from_path command without any pre-configured scope.","commands":{"allow":["from_path"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-rgba":{"identifier":"allow-rgba","description":"Enables the rgba command without any pre-configured scope.","commands":{"allow":["rgba"],"deny":[]}},"allow-size":{"identifier":"allow-size","description":"Enables the size command without any pre-configured scope.","commands":{"allow":["size"],"deny":[]}},"deny-from-bytes":{"identifier":"deny-from-bytes","description":"Denies the from_bytes command without any pre-configured scope.","commands":{"allow":[],"deny":["from_bytes"]}},"deny-from-path":{"identifier":"deny-from-path","description":"Denies the from_path command without any pre-configured scope.","commands":{"allow":[],"deny":["from_path"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-rgba":{"identifier":"deny-rgba","description":"Denies the rgba command without any pre-configured scope.","commands":{"allow":[],"deny":["rgba"]}},"deny-size":{"identifier":"deny-size","description":"Denies the size command without any pre-configured scope.","commands":{"allow":[],"deny":["size"]}}},"permission_sets":{},"global_scope_schema":null},"core:menu":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-append","allow-prepend","allow-insert","allow-remove","allow-remove-at","allow-items","allow-get","allow-popup","allow-create-default","allow-set-as-app-menu","allow-set-as-window-menu","allow-text","allow-set-text","allow-is-enabled","allow-set-enabled","allow-set-accelerator","allow-set-as-windows-menu-for-nsapp","allow-set-as-help-menu-for-nsapp","allow-is-checked","allow-set-checked","allow-set-icon"]},"permissions":{"allow-append":{"identifier":"allow-append","description":"Enables the append command without any pre-configured scope.","commands":{"allow":["append"],"deny":[]}},"allow-create-default":{"identifier":"allow-create-default","description":"Enables the create_default command without any pre-configured scope.","commands":{"allow":["create_default"],"deny":[]}},"allow-get":{"identifier":"allow-get","description":"Enables the get command without any pre-configured scope.","commands":{"allow":["get"],"deny":[]}},"allow-insert":{"identifier":"allow-insert","description":"Enables the insert command without any pre-configured scope.","commands":{"allow":["insert"],"deny":[]}},"allow-is-checked":{"identifier":"allow-is-checked","description":"Enables the is_checked command without any pre-configured scope.","commands":{"allow":["is_checked"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"allow-items":{"identifier":"allow-items","description":"Enables the items command without any pre-configured scope.","commands":{"allow":["items"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-popup":{"identifier":"allow-popup","description":"Enables the popup command without any pre-configured scope.","commands":{"allow":["popup"],"deny":[]}},"allow-prepend":{"identifier":"allow-prepend","description":"Enables the prepend command without any pre-configured scope.","commands":{"allow":["prepend"],"deny":[]}},"allow-remove":{"identifier":"allow-remove","description":"Enables the remove command without any pre-configured scope.","commands":{"allow":["remove"],"deny":[]}},"allow-remove-at":{"identifier":"allow-remove-at","description":"Enables the remove_at command without any pre-configured scope.","commands":{"allow":["remove_at"],"deny":[]}},"allow-set-accelerator":{"identifier":"allow-set-accelerator","description":"Enables the set_accelerator command without any pre-configured scope.","commands":{"allow":["set_accelerator"],"deny":[]}},"allow-set-as-app-menu":{"identifier":"allow-set-as-app-menu","description":"Enables the set_as_app_menu command without any pre-configured scope.","commands":{"allow":["set_as_app_menu"],"deny":[]}},"allow-set-as-help-menu-for-nsapp":{"identifier":"allow-set-as-help-menu-for-nsapp","description":"Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":["set_as_help_menu_for_nsapp"],"deny":[]}},"allow-set-as-window-menu":{"identifier":"allow-set-as-window-menu","description":"Enables the set_as_window_menu command without any pre-configured scope.","commands":{"allow":["set_as_window_menu"],"deny":[]}},"allow-set-as-windows-menu-for-nsapp":{"identifier":"allow-set-as-windows-menu-for-nsapp","description":"Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":["set_as_windows_menu_for_nsapp"],"deny":[]}},"allow-set-checked":{"identifier":"allow-set-checked","description":"Enables the set_checked command without any pre-configured scope.","commands":{"allow":["set_checked"],"deny":[]}},"allow-set-enabled":{"identifier":"allow-set-enabled","description":"Enables the set_enabled command without any pre-configured scope.","commands":{"allow":["set_enabled"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-text":{"identifier":"allow-set-text","description":"Enables the set_text command without any pre-configured scope.","commands":{"allow":["set_text"],"deny":[]}},"allow-text":{"identifier":"allow-text","description":"Enables the text command without any pre-configured scope.","commands":{"allow":["text"],"deny":[]}},"deny-append":{"identifier":"deny-append","description":"Denies the append command without any pre-configured scope.","commands":{"allow":[],"deny":["append"]}},"deny-create-default":{"identifier":"deny-create-default","description":"Denies the create_default command without any pre-configured scope.","commands":{"allow":[],"deny":["create_default"]}},"deny-get":{"identifier":"deny-get","description":"Denies the get command without any pre-configured scope.","commands":{"allow":[],"deny":["get"]}},"deny-insert":{"identifier":"deny-insert","description":"Denies the insert command without any pre-configured scope.","commands":{"allow":[],"deny":["insert"]}},"deny-is-checked":{"identifier":"deny-is-checked","description":"Denies the is_checked command without any pre-configured scope.","commands":{"allow":[],"deny":["is_checked"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}},"deny-items":{"identifier":"deny-items","description":"Denies the items command without any pre-configured scope.","commands":{"allow":[],"deny":["items"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-popup":{"identifier":"deny-popup","description":"Denies the popup command without any pre-configured scope.","commands":{"allow":[],"deny":["popup"]}},"deny-prepend":{"identifier":"deny-prepend","description":"Denies the prepend command without any pre-configured scope.","commands":{"allow":[],"deny":["prepend"]}},"deny-remove":{"identifier":"deny-remove","description":"Denies the remove command without any pre-configured scope.","commands":{"allow":[],"deny":["remove"]}},"deny-remove-at":{"identifier":"deny-remove-at","description":"Denies the remove_at command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_at"]}},"deny-set-accelerator":{"identifier":"deny-set-accelerator","description":"Denies the set_accelerator command without any pre-configured scope.","commands":{"allow":[],"deny":["set_accelerator"]}},"deny-set-as-app-menu":{"identifier":"deny-set-as-app-menu","description":"Denies the set_as_app_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_app_menu"]}},"deny-set-as-help-menu-for-nsapp":{"identifier":"deny-set-as-help-menu-for-nsapp","description":"Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_help_menu_for_nsapp"]}},"deny-set-as-window-menu":{"identifier":"deny-set-as-window-menu","description":"Denies the set_as_window_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_window_menu"]}},"deny-set-as-windows-menu-for-nsapp":{"identifier":"deny-set-as-windows-menu-for-nsapp","description":"Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_windows_menu_for_nsapp"]}},"deny-set-checked":{"identifier":"deny-set-checked","description":"Denies the set_checked command without any pre-configured scope.","commands":{"allow":[],"deny":["set_checked"]}},"deny-set-enabled":{"identifier":"deny-set-enabled","description":"Denies the set_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["set_enabled"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-text":{"identifier":"deny-set-text","description":"Denies the set_text command without any pre-configured scope.","commands":{"allow":[],"deny":["set_text"]}},"deny-text":{"identifier":"deny-text","description":"Denies the text command without any pre-configured scope.","commands":{"allow":[],"deny":["text"]}}},"permission_sets":{},"global_scope_schema":null},"core:path":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-resolve-directory","allow-resolve","allow-normalize","allow-join","allow-dirname","allow-extname","allow-basename","allow-is-absolute"]},"permissions":{"allow-basename":{"identifier":"allow-basename","description":"Enables the basename command without any pre-configured scope.","commands":{"allow":["basename"],"deny":[]}},"allow-dirname":{"identifier":"allow-dirname","description":"Enables the dirname command without any pre-configured scope.","commands":{"allow":["dirname"],"deny":[]}},"allow-extname":{"identifier":"allow-extname","description":"Enables the extname command without any pre-configured scope.","commands":{"allow":["extname"],"deny":[]}},"allow-is-absolute":{"identifier":"allow-is-absolute","description":"Enables the is_absolute command without any pre-configured scope.","commands":{"allow":["is_absolute"],"deny":[]}},"allow-join":{"identifier":"allow-join","description":"Enables the join command without any pre-configured scope.","commands":{"allow":["join"],"deny":[]}},"allow-normalize":{"identifier":"allow-normalize","description":"Enables the normalize command without any pre-configured scope.","commands":{"allow":["normalize"],"deny":[]}},"allow-resolve":{"identifier":"allow-resolve","description":"Enables the resolve command without any pre-configured scope.","commands":{"allow":["resolve"],"deny":[]}},"allow-resolve-directory":{"identifier":"allow-resolve-directory","description":"Enables the resolve_directory command without any pre-configured scope.","commands":{"allow":["resolve_directory"],"deny":[]}},"deny-basename":{"identifier":"deny-basename","description":"Denies the basename command without any pre-configured scope.","commands":{"allow":[],"deny":["basename"]}},"deny-dirname":{"identifier":"deny-dirname","description":"Denies the dirname command without any pre-configured scope.","commands":{"allow":[],"deny":["dirname"]}},"deny-extname":{"identifier":"deny-extname","description":"Denies the extname command without any pre-configured scope.","commands":{"allow":[],"deny":["extname"]}},"deny-is-absolute":{"identifier":"deny-is-absolute","description":"Denies the is_absolute command without any pre-configured scope.","commands":{"allow":[],"deny":["is_absolute"]}},"deny-join":{"identifier":"deny-join","description":"Denies the join command without any pre-configured scope.","commands":{"allow":[],"deny":["join"]}},"deny-normalize":{"identifier":"deny-normalize","description":"Denies the normalize command without any pre-configured scope.","commands":{"allow":[],"deny":["normalize"]}},"deny-resolve":{"identifier":"deny-resolve","description":"Denies the resolve command without any pre-configured scope.","commands":{"allow":[],"deny":["resolve"]}},"deny-resolve-directory":{"identifier":"deny-resolve-directory","description":"Denies the resolve_directory command without any pre-configured scope.","commands":{"allow":[],"deny":["resolve_directory"]}}},"permission_sets":{},"global_scope_schema":null},"core:resources":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-close"]},"permissions":{"allow-close":{"identifier":"allow-close","description":"Enables the close command without any pre-configured scope.","commands":{"allow":["close"],"deny":[]}},"deny-close":{"identifier":"deny-close","description":"Denies the close command without any pre-configured scope.","commands":{"allow":[],"deny":["close"]}}},"permission_sets":{},"global_scope_schema":null},"core:tray":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-get-by-id","allow-remove-by-id","allow-set-icon","allow-set-menu","allow-set-tooltip","allow-set-title","allow-set-visible","allow-set-temp-dir-path","allow-set-icon-as-template","allow-set-icon-with-as-template","allow-set-show-menu-on-left-click"]},"permissions":{"allow-get-by-id":{"identifier":"allow-get-by-id","description":"Enables the get_by_id command without any pre-configured scope.","commands":{"allow":["get_by_id"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-remove-by-id":{"identifier":"allow-remove-by-id","description":"Enables the remove_by_id command without any pre-configured scope.","commands":{"allow":["remove_by_id"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-icon-as-template":{"identifier":"allow-set-icon-as-template","description":"Enables the set_icon_as_template command without any pre-configured scope.","commands":{"allow":["set_icon_as_template"],"deny":[]}},"allow-set-icon-with-as-template":{"identifier":"allow-set-icon-with-as-template","description":"Enables the set_icon_with_as_template command without any pre-configured scope.","commands":{"allow":["set_icon_with_as_template"],"deny":[]}},"allow-set-menu":{"identifier":"allow-set-menu","description":"Enables the set_menu command without any pre-configured scope.","commands":{"allow":["set_menu"],"deny":[]}},"allow-set-show-menu-on-left-click":{"identifier":"allow-set-show-menu-on-left-click","description":"Enables the set_show_menu_on_left_click command without any pre-configured scope.","commands":{"allow":["set_show_menu_on_left_click"],"deny":[]}},"allow-set-temp-dir-path":{"identifier":"allow-set-temp-dir-path","description":"Enables the set_temp_dir_path command without any pre-configured scope.","commands":{"allow":["set_temp_dir_path"],"deny":[]}},"allow-set-title":{"identifier":"allow-set-title","description":"Enables the set_title command without any pre-configured scope.","commands":{"allow":["set_title"],"deny":[]}},"allow-set-tooltip":{"identifier":"allow-set-tooltip","description":"Enables the set_tooltip command without any pre-configured scope.","commands":{"allow":["set_tooltip"],"deny":[]}},"allow-set-visible":{"identifier":"allow-set-visible","description":"Enables the set_visible command without any pre-configured scope.","commands":{"allow":["set_visible"],"deny":[]}},"deny-get-by-id":{"identifier":"deny-get-by-id","description":"Denies the get_by_id command without any pre-configured scope.","commands":{"allow":[],"deny":["get_by_id"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-remove-by-id":{"identifier":"deny-remove-by-id","description":"Denies the remove_by_id command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_by_id"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-icon-as-template":{"identifier":"deny-set-icon-as-template","description":"Denies the set_icon_as_template command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon_as_template"]}},"deny-set-icon-with-as-template":{"identifier":"deny-set-icon-with-as-template","description":"Denies the set_icon_with_as_template command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon_with_as_template"]}},"deny-set-menu":{"identifier":"deny-set-menu","description":"Denies the set_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_menu"]}},"deny-set-show-menu-on-left-click":{"identifier":"deny-set-show-menu-on-left-click","description":"Denies the set_show_menu_on_left_click command without any pre-configured scope.","commands":{"allow":[],"deny":["set_show_menu_on_left_click"]}},"deny-set-temp-dir-path":{"identifier":"deny-set-temp-dir-path","description":"Denies the set_temp_dir_path command without any pre-configured scope.","commands":{"allow":[],"deny":["set_temp_dir_path"]}},"deny-set-title":{"identifier":"deny-set-title","description":"Denies the set_title command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title"]}},"deny-set-tooltip":{"identifier":"deny-set-tooltip","description":"Denies the set_tooltip command without any pre-configured scope.","commands":{"allow":[],"deny":["set_tooltip"]}},"deny-set-visible":{"identifier":"deny-set-visible","description":"Denies the set_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["set_visible"]}}},"permission_sets":{},"global_scope_schema":null},"core:webview":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-get-all-webviews","allow-webview-position","allow-webview-size","allow-internal-toggle-devtools"]},"permissions":{"allow-clear-all-browsing-data":{"identifier":"allow-clear-all-browsing-data","description":"Enables the clear_all_browsing_data command without any pre-configured scope.","commands":{"allow":["clear_all_browsing_data"],"deny":[]}},"allow-create-webview":{"identifier":"allow-create-webview","description":"Enables the create_webview command without any pre-configured scope.","commands":{"allow":["create_webview"],"deny":[]}},"allow-create-webview-window":{"identifier":"allow-create-webview-window","description":"Enables the create_webview_window command without any pre-configured scope.","commands":{"allow":["create_webview_window"],"deny":[]}},"allow-get-all-webviews":{"identifier":"allow-get-all-webviews","description":"Enables the get_all_webviews command without any pre-configured scope.","commands":{"allow":["get_all_webviews"],"deny":[]}},"allow-internal-toggle-devtools":{"identifier":"allow-internal-toggle-devtools","description":"Enables the internal_toggle_devtools command without any pre-configured scope.","commands":{"allow":["internal_toggle_devtools"],"deny":[]}},"allow-print":{"identifier":"allow-print","description":"Enables the print command without any pre-configured scope.","commands":{"allow":["print"],"deny":[]}},"allow-reparent":{"identifier":"allow-reparent","description":"Enables the reparent command without any pre-configured scope.","commands":{"allow":["reparent"],"deny":[]}},"allow-set-webview-auto-resize":{"identifier":"allow-set-webview-auto-resize","description":"Enables the set_webview_auto_resize command without any pre-configured scope.","commands":{"allow":["set_webview_auto_resize"],"deny":[]}},"allow-set-webview-background-color":{"identifier":"allow-set-webview-background-color","description":"Enables the set_webview_background_color command without any pre-configured scope.","commands":{"allow":["set_webview_background_color"],"deny":[]}},"allow-set-webview-focus":{"identifier":"allow-set-webview-focus","description":"Enables the set_webview_focus command without any pre-configured scope.","commands":{"allow":["set_webview_focus"],"deny":[]}},"allow-set-webview-position":{"identifier":"allow-set-webview-position","description":"Enables the set_webview_position command without any pre-configured scope.","commands":{"allow":["set_webview_position"],"deny":[]}},"allow-set-webview-size":{"identifier":"allow-set-webview-size","description":"Enables the set_webview_size command without any pre-configured scope.","commands":{"allow":["set_webview_size"],"deny":[]}},"allow-set-webview-zoom":{"identifier":"allow-set-webview-zoom","description":"Enables the set_webview_zoom command without any pre-configured scope.","commands":{"allow":["set_webview_zoom"],"deny":[]}},"allow-webview-close":{"identifier":"allow-webview-close","description":"Enables the webview_close command without any pre-configured scope.","commands":{"allow":["webview_close"],"deny":[]}},"allow-webview-hide":{"identifier":"allow-webview-hide","description":"Enables the webview_hide command without any pre-configured scope.","commands":{"allow":["webview_hide"],"deny":[]}},"allow-webview-position":{"identifier":"allow-webview-position","description":"Enables the webview_position command without any pre-configured scope.","commands":{"allow":["webview_position"],"deny":[]}},"allow-webview-show":{"identifier":"allow-webview-show","description":"Enables the webview_show command without any pre-configured scope.","commands":{"allow":["webview_show"],"deny":[]}},"allow-webview-size":{"identifier":"allow-webview-size","description":"Enables the webview_size command without any pre-configured scope.","commands":{"allow":["webview_size"],"deny":[]}},"deny-clear-all-browsing-data":{"identifier":"deny-clear-all-browsing-data","description":"Denies the clear_all_browsing_data command without any pre-configured scope.","commands":{"allow":[],"deny":["clear_all_browsing_data"]}},"deny-create-webview":{"identifier":"deny-create-webview","description":"Denies the create_webview command without any pre-configured scope.","commands":{"allow":[],"deny":["create_webview"]}},"deny-create-webview-window":{"identifier":"deny-create-webview-window","description":"Denies the create_webview_window command without any pre-configured scope.","commands":{"allow":[],"deny":["create_webview_window"]}},"deny-get-all-webviews":{"identifier":"deny-get-all-webviews","description":"Denies the get_all_webviews command without any pre-configured scope.","commands":{"allow":[],"deny":["get_all_webviews"]}},"deny-internal-toggle-devtools":{"identifier":"deny-internal-toggle-devtools","description":"Denies the internal_toggle_devtools command without any pre-configured scope.","commands":{"allow":[],"deny":["internal_toggle_devtools"]}},"deny-print":{"identifier":"deny-print","description":"Denies the print command without any pre-configured scope.","commands":{"allow":[],"deny":["print"]}},"deny-reparent":{"identifier":"deny-reparent","description":"Denies the reparent command without any pre-configured scope.","commands":{"allow":[],"deny":["reparent"]}},"deny-set-webview-auto-resize":{"identifier":"deny-set-webview-auto-resize","description":"Denies the set_webview_auto_resize command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_auto_resize"]}},"deny-set-webview-background-color":{"identifier":"deny-set-webview-background-color","description":"Denies the set_webview_background_color command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_background_color"]}},"deny-set-webview-focus":{"identifier":"deny-set-webview-focus","description":"Denies the set_webview_focus command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_focus"]}},"deny-set-webview-position":{"identifier":"deny-set-webview-position","description":"Denies the set_webview_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_position"]}},"deny-set-webview-size":{"identifier":"deny-set-webview-size","description":"Denies the set_webview_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_size"]}},"deny-set-webview-zoom":{"identifier":"deny-set-webview-zoom","description":"Denies the set_webview_zoom command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_zoom"]}},"deny-webview-close":{"identifier":"deny-webview-close","description":"Denies the webview_close command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_close"]}},"deny-webview-hide":{"identifier":"deny-webview-hide","description":"Denies the webview_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_hide"]}},"deny-webview-position":{"identifier":"deny-webview-position","description":"Denies the webview_position command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_position"]}},"deny-webview-show":{"identifier":"deny-webview-show","description":"Denies the webview_show command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_show"]}},"deny-webview-size":{"identifier":"deny-webview-size","description":"Denies the webview_size command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_size"]}}},"permission_sets":{},"global_scope_schema":null},"core:window":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-get-all-windows","allow-scale-factor","allow-inner-position","allow-outer-position","allow-inner-size","allow-outer-size","allow-is-fullscreen","allow-is-minimized","allow-is-maximized","allow-is-focused","allow-is-decorated","allow-is-resizable","allow-is-maximizable","allow-is-minimizable","allow-is-closable","allow-is-visible","allow-is-enabled","allow-title","allow-current-monitor","allow-primary-monitor","allow-monitor-from-point","allow-available-monitors","allow-cursor-position","allow-theme","allow-is-always-on-top","allow-activity-name","allow-scene-identifier","allow-internal-toggle-maximize"]},"permissions":{"allow-activity-name":{"identifier":"allow-activity-name","description":"Enables the activity_name command without any pre-configured scope.","commands":{"allow":["activity_name"],"deny":[]}},"allow-available-monitors":{"identifier":"allow-available-monitors","description":"Enables the available_monitors command without any pre-configured scope.","commands":{"allow":["available_monitors"],"deny":[]}},"allow-center":{"identifier":"allow-center","description":"Enables the center command without any pre-configured scope.","commands":{"allow":["center"],"deny":[]}},"allow-close":{"identifier":"allow-close","description":"Enables the close command without any pre-configured scope.","commands":{"allow":["close"],"deny":[]}},"allow-create":{"identifier":"allow-create","description":"Enables the create command without any pre-configured scope.","commands":{"allow":["create"],"deny":[]}},"allow-current-monitor":{"identifier":"allow-current-monitor","description":"Enables the current_monitor command without any pre-configured scope.","commands":{"allow":["current_monitor"],"deny":[]}},"allow-cursor-position":{"identifier":"allow-cursor-position","description":"Enables the cursor_position command without any pre-configured scope.","commands":{"allow":["cursor_position"],"deny":[]}},"allow-destroy":{"identifier":"allow-destroy","description":"Enables the destroy command without any pre-configured scope.","commands":{"allow":["destroy"],"deny":[]}},"allow-get-all-windows":{"identifier":"allow-get-all-windows","description":"Enables the get_all_windows command without any pre-configured scope.","commands":{"allow":["get_all_windows"],"deny":[]}},"allow-hide":{"identifier":"allow-hide","description":"Enables the hide command without any pre-configured scope.","commands":{"allow":["hide"],"deny":[]}},"allow-inner-position":{"identifier":"allow-inner-position","description":"Enables the inner_position command without any pre-configured scope.","commands":{"allow":["inner_position"],"deny":[]}},"allow-inner-size":{"identifier":"allow-inner-size","description":"Enables the inner_size command without any pre-configured scope.","commands":{"allow":["inner_size"],"deny":[]}},"allow-internal-toggle-maximize":{"identifier":"allow-internal-toggle-maximize","description":"Enables the internal_toggle_maximize command without any pre-configured scope.","commands":{"allow":["internal_toggle_maximize"],"deny":[]}},"allow-is-always-on-top":{"identifier":"allow-is-always-on-top","description":"Enables the is_always_on_top command without any pre-configured scope.","commands":{"allow":["is_always_on_top"],"deny":[]}},"allow-is-closable":{"identifier":"allow-is-closable","description":"Enables the is_closable command without any pre-configured scope.","commands":{"allow":["is_closable"],"deny":[]}},"allow-is-decorated":{"identifier":"allow-is-decorated","description":"Enables the is_decorated command without any pre-configured scope.","commands":{"allow":["is_decorated"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"allow-is-focused":{"identifier":"allow-is-focused","description":"Enables the is_focused command without any pre-configured scope.","commands":{"allow":["is_focused"],"deny":[]}},"allow-is-fullscreen":{"identifier":"allow-is-fullscreen","description":"Enables the is_fullscreen command without any pre-configured scope.","commands":{"allow":["is_fullscreen"],"deny":[]}},"allow-is-maximizable":{"identifier":"allow-is-maximizable","description":"Enables the is_maximizable command without any pre-configured scope.","commands":{"allow":["is_maximizable"],"deny":[]}},"allow-is-maximized":{"identifier":"allow-is-maximized","description":"Enables the is_maximized command without any pre-configured scope.","commands":{"allow":["is_maximized"],"deny":[]}},"allow-is-minimizable":{"identifier":"allow-is-minimizable","description":"Enables the is_minimizable command without any pre-configured scope.","commands":{"allow":["is_minimizable"],"deny":[]}},"allow-is-minimized":{"identifier":"allow-is-minimized","description":"Enables the is_minimized command without any pre-configured scope.","commands":{"allow":["is_minimized"],"deny":[]}},"allow-is-resizable":{"identifier":"allow-is-resizable","description":"Enables the is_resizable command without any pre-configured scope.","commands":{"allow":["is_resizable"],"deny":[]}},"allow-is-visible":{"identifier":"allow-is-visible","description":"Enables the is_visible command without any pre-configured scope.","commands":{"allow":["is_visible"],"deny":[]}},"allow-maximize":{"identifier":"allow-maximize","description":"Enables the maximize command without any pre-configured scope.","commands":{"allow":["maximize"],"deny":[]}},"allow-minimize":{"identifier":"allow-minimize","description":"Enables the minimize command without any pre-configured scope.","commands":{"allow":["minimize"],"deny":[]}},"allow-monitor-from-point":{"identifier":"allow-monitor-from-point","description":"Enables the monitor_from_point command without any pre-configured scope.","commands":{"allow":["monitor_from_point"],"deny":[]}},"allow-outer-position":{"identifier":"allow-outer-position","description":"Enables the outer_position command without any pre-configured scope.","commands":{"allow":["outer_position"],"deny":[]}},"allow-outer-size":{"identifier":"allow-outer-size","description":"Enables the outer_size command without any pre-configured scope.","commands":{"allow":["outer_size"],"deny":[]}},"allow-primary-monitor":{"identifier":"allow-primary-monitor","description":"Enables the primary_monitor command without any pre-configured scope.","commands":{"allow":["primary_monitor"],"deny":[]}},"allow-request-user-attention":{"identifier":"allow-request-user-attention","description":"Enables the request_user_attention command without any pre-configured scope.","commands":{"allow":["request_user_attention"],"deny":[]}},"allow-scale-factor":{"identifier":"allow-scale-factor","description":"Enables the scale_factor command without any pre-configured scope.","commands":{"allow":["scale_factor"],"deny":[]}},"allow-scene-identifier":{"identifier":"allow-scene-identifier","description":"Enables the scene_identifier command without any pre-configured scope.","commands":{"allow":["scene_identifier"],"deny":[]}},"allow-set-always-on-bottom":{"identifier":"allow-set-always-on-bottom","description":"Enables the set_always_on_bottom command without any pre-configured scope.","commands":{"allow":["set_always_on_bottom"],"deny":[]}},"allow-set-always-on-top":{"identifier":"allow-set-always-on-top","description":"Enables the set_always_on_top command without any pre-configured scope.","commands":{"allow":["set_always_on_top"],"deny":[]}},"allow-set-background-color":{"identifier":"allow-set-background-color","description":"Enables the set_background_color command without any pre-configured scope.","commands":{"allow":["set_background_color"],"deny":[]}},"allow-set-badge-count":{"identifier":"allow-set-badge-count","description":"Enables the set_badge_count command without any pre-configured scope.","commands":{"allow":["set_badge_count"],"deny":[]}},"allow-set-badge-label":{"identifier":"allow-set-badge-label","description":"Enables the set_badge_label command without any pre-configured scope.","commands":{"allow":["set_badge_label"],"deny":[]}},"allow-set-closable":{"identifier":"allow-set-closable","description":"Enables the set_closable command without any pre-configured scope.","commands":{"allow":["set_closable"],"deny":[]}},"allow-set-content-protected":{"identifier":"allow-set-content-protected","description":"Enables the set_content_protected command without any pre-configured scope.","commands":{"allow":["set_content_protected"],"deny":[]}},"allow-set-cursor-grab":{"identifier":"allow-set-cursor-grab","description":"Enables the set_cursor_grab command without any pre-configured scope.","commands":{"allow":["set_cursor_grab"],"deny":[]}},"allow-set-cursor-icon":{"identifier":"allow-set-cursor-icon","description":"Enables the set_cursor_icon command without any pre-configured scope.","commands":{"allow":["set_cursor_icon"],"deny":[]}},"allow-set-cursor-position":{"identifier":"allow-set-cursor-position","description":"Enables the set_cursor_position command without any pre-configured scope.","commands":{"allow":["set_cursor_position"],"deny":[]}},"allow-set-cursor-visible":{"identifier":"allow-set-cursor-visible","description":"Enables the set_cursor_visible command without any pre-configured scope.","commands":{"allow":["set_cursor_visible"],"deny":[]}},"allow-set-decorations":{"identifier":"allow-set-decorations","description":"Enables the set_decorations command without any pre-configured scope.","commands":{"allow":["set_decorations"],"deny":[]}},"allow-set-effects":{"identifier":"allow-set-effects","description":"Enables the set_effects command without any pre-configured scope.","commands":{"allow":["set_effects"],"deny":[]}},"allow-set-enabled":{"identifier":"allow-set-enabled","description":"Enables the set_enabled command without any pre-configured scope.","commands":{"allow":["set_enabled"],"deny":[]}},"allow-set-focus":{"identifier":"allow-set-focus","description":"Enables the set_focus command without any pre-configured scope.","commands":{"allow":["set_focus"],"deny":[]}},"allow-set-focusable":{"identifier":"allow-set-focusable","description":"Enables the set_focusable command without any pre-configured scope.","commands":{"allow":["set_focusable"],"deny":[]}},"allow-set-fullscreen":{"identifier":"allow-set-fullscreen","description":"Enables the set_fullscreen command without any pre-configured scope.","commands":{"allow":["set_fullscreen"],"deny":[]}},"allow-set-fullscreen-on-monitor":{"identifier":"allow-set-fullscreen-on-monitor","description":"Enables the set_fullscreen_on_monitor command without any pre-configured scope.","commands":{"allow":["set_fullscreen_on_monitor"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-ignore-cursor-events":{"identifier":"allow-set-ignore-cursor-events","description":"Enables the set_ignore_cursor_events command without any pre-configured scope.","commands":{"allow":["set_ignore_cursor_events"],"deny":[]}},"allow-set-max-size":{"identifier":"allow-set-max-size","description":"Enables the set_max_size command without any pre-configured scope.","commands":{"allow":["set_max_size"],"deny":[]}},"allow-set-maximizable":{"identifier":"allow-set-maximizable","description":"Enables the set_maximizable command without any pre-configured scope.","commands":{"allow":["set_maximizable"],"deny":[]}},"allow-set-min-size":{"identifier":"allow-set-min-size","description":"Enables the set_min_size command without any pre-configured scope.","commands":{"allow":["set_min_size"],"deny":[]}},"allow-set-minimizable":{"identifier":"allow-set-minimizable","description":"Enables the set_minimizable command without any pre-configured scope.","commands":{"allow":["set_minimizable"],"deny":[]}},"allow-set-overlay-icon":{"identifier":"allow-set-overlay-icon","description":"Enables the set_overlay_icon command without any pre-configured scope.","commands":{"allow":["set_overlay_icon"],"deny":[]}},"allow-set-position":{"identifier":"allow-set-position","description":"Enables the set_position command without any pre-configured scope.","commands":{"allow":["set_position"],"deny":[]}},"allow-set-progress-bar":{"identifier":"allow-set-progress-bar","description":"Enables the set_progress_bar command without any pre-configured scope.","commands":{"allow":["set_progress_bar"],"deny":[]}},"allow-set-resizable":{"identifier":"allow-set-resizable","description":"Enables the set_resizable command without any pre-configured scope.","commands":{"allow":["set_resizable"],"deny":[]}},"allow-set-shadow":{"identifier":"allow-set-shadow","description":"Enables the set_shadow command without any pre-configured scope.","commands":{"allow":["set_shadow"],"deny":[]}},"allow-set-simple-fullscreen":{"identifier":"allow-set-simple-fullscreen","description":"Enables the set_simple_fullscreen command without any pre-configured scope.","commands":{"allow":["set_simple_fullscreen"],"deny":[]}},"allow-set-size":{"identifier":"allow-set-size","description":"Enables the set_size command without any pre-configured scope.","commands":{"allow":["set_size"],"deny":[]}},"allow-set-size-constraints":{"identifier":"allow-set-size-constraints","description":"Enables the set_size_constraints command without any pre-configured scope.","commands":{"allow":["set_size_constraints"],"deny":[]}},"allow-set-skip-taskbar":{"identifier":"allow-set-skip-taskbar","description":"Enables the set_skip_taskbar command without any pre-configured scope.","commands":{"allow":["set_skip_taskbar"],"deny":[]}},"allow-set-theme":{"identifier":"allow-set-theme","description":"Enables the set_theme command without any pre-configured scope.","commands":{"allow":["set_theme"],"deny":[]}},"allow-set-title":{"identifier":"allow-set-title","description":"Enables the set_title command without any pre-configured scope.","commands":{"allow":["set_title"],"deny":[]}},"allow-set-title-bar-style":{"identifier":"allow-set-title-bar-style","description":"Enables the set_title_bar_style command without any pre-configured scope.","commands":{"allow":["set_title_bar_style"],"deny":[]}},"allow-set-visible-on-all-workspaces":{"identifier":"allow-set-visible-on-all-workspaces","description":"Enables the set_visible_on_all_workspaces command without any pre-configured scope.","commands":{"allow":["set_visible_on_all_workspaces"],"deny":[]}},"allow-show":{"identifier":"allow-show","description":"Enables the show command without any pre-configured scope.","commands":{"allow":["show"],"deny":[]}},"allow-start-dragging":{"identifier":"allow-start-dragging","description":"Enables the start_dragging command without any pre-configured scope.","commands":{"allow":["start_dragging"],"deny":[]}},"allow-start-resize-dragging":{"identifier":"allow-start-resize-dragging","description":"Enables the start_resize_dragging command without any pre-configured scope.","commands":{"allow":["start_resize_dragging"],"deny":[]}},"allow-theme":{"identifier":"allow-theme","description":"Enables the theme command without any pre-configured scope.","commands":{"allow":["theme"],"deny":[]}},"allow-title":{"identifier":"allow-title","description":"Enables the title command without any pre-configured scope.","commands":{"allow":["title"],"deny":[]}},"allow-toggle-maximize":{"identifier":"allow-toggle-maximize","description":"Enables the toggle_maximize command without any pre-configured scope.","commands":{"allow":["toggle_maximize"],"deny":[]}},"allow-unmaximize":{"identifier":"allow-unmaximize","description":"Enables the unmaximize command without any pre-configured scope.","commands":{"allow":["unmaximize"],"deny":[]}},"allow-unminimize":{"identifier":"allow-unminimize","description":"Enables the unminimize command without any pre-configured scope.","commands":{"allow":["unminimize"],"deny":[]}},"deny-activity-name":{"identifier":"deny-activity-name","description":"Denies the activity_name command without any pre-configured scope.","commands":{"allow":[],"deny":["activity_name"]}},"deny-available-monitors":{"identifier":"deny-available-monitors","description":"Denies the available_monitors command without any pre-configured scope.","commands":{"allow":[],"deny":["available_monitors"]}},"deny-center":{"identifier":"deny-center","description":"Denies the center command without any pre-configured scope.","commands":{"allow":[],"deny":["center"]}},"deny-close":{"identifier":"deny-close","description":"Denies the close command without any pre-configured scope.","commands":{"allow":[],"deny":["close"]}},"deny-create":{"identifier":"deny-create","description":"Denies the create command without any pre-configured scope.","commands":{"allow":[],"deny":["create"]}},"deny-current-monitor":{"identifier":"deny-current-monitor","description":"Denies the current_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["current_monitor"]}},"deny-cursor-position":{"identifier":"deny-cursor-position","description":"Denies the cursor_position command without any pre-configured scope.","commands":{"allow":[],"deny":["cursor_position"]}},"deny-destroy":{"identifier":"deny-destroy","description":"Denies the destroy command without any pre-configured scope.","commands":{"allow":[],"deny":["destroy"]}},"deny-get-all-windows":{"identifier":"deny-get-all-windows","description":"Denies the get_all_windows command without any pre-configured scope.","commands":{"allow":[],"deny":["get_all_windows"]}},"deny-hide":{"identifier":"deny-hide","description":"Denies the hide command without any pre-configured scope.","commands":{"allow":[],"deny":["hide"]}},"deny-inner-position":{"identifier":"deny-inner-position","description":"Denies the inner_position command without any pre-configured scope.","commands":{"allow":[],"deny":["inner_position"]}},"deny-inner-size":{"identifier":"deny-inner-size","description":"Denies the inner_size command without any pre-configured scope.","commands":{"allow":[],"deny":["inner_size"]}},"deny-internal-toggle-maximize":{"identifier":"deny-internal-toggle-maximize","description":"Denies the internal_toggle_maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["internal_toggle_maximize"]}},"deny-is-always-on-top":{"identifier":"deny-is-always-on-top","description":"Denies the is_always_on_top command without any pre-configured scope.","commands":{"allow":[],"deny":["is_always_on_top"]}},"deny-is-closable":{"identifier":"deny-is-closable","description":"Denies the is_closable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_closable"]}},"deny-is-decorated":{"identifier":"deny-is-decorated","description":"Denies the is_decorated command without any pre-configured scope.","commands":{"allow":[],"deny":["is_decorated"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}},"deny-is-focused":{"identifier":"deny-is-focused","description":"Denies the is_focused command without any pre-configured scope.","commands":{"allow":[],"deny":["is_focused"]}},"deny-is-fullscreen":{"identifier":"deny-is-fullscreen","description":"Denies the is_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["is_fullscreen"]}},"deny-is-maximizable":{"identifier":"deny-is-maximizable","description":"Denies the is_maximizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_maximizable"]}},"deny-is-maximized":{"identifier":"deny-is-maximized","description":"Denies the is_maximized command without any pre-configured scope.","commands":{"allow":[],"deny":["is_maximized"]}},"deny-is-minimizable":{"identifier":"deny-is-minimizable","description":"Denies the is_minimizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_minimizable"]}},"deny-is-minimized":{"identifier":"deny-is-minimized","description":"Denies the is_minimized command without any pre-configured scope.","commands":{"allow":[],"deny":["is_minimized"]}},"deny-is-resizable":{"identifier":"deny-is-resizable","description":"Denies the is_resizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_resizable"]}},"deny-is-visible":{"identifier":"deny-is-visible","description":"Denies the is_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["is_visible"]}},"deny-maximize":{"identifier":"deny-maximize","description":"Denies the maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["maximize"]}},"deny-minimize":{"identifier":"deny-minimize","description":"Denies the minimize command without any pre-configured scope.","commands":{"allow":[],"deny":["minimize"]}},"deny-monitor-from-point":{"identifier":"deny-monitor-from-point","description":"Denies the monitor_from_point command without any pre-configured scope.","commands":{"allow":[],"deny":["monitor_from_point"]}},"deny-outer-position":{"identifier":"deny-outer-position","description":"Denies the outer_position command without any pre-configured scope.","commands":{"allow":[],"deny":["outer_position"]}},"deny-outer-size":{"identifier":"deny-outer-size","description":"Denies the outer_size command without any pre-configured scope.","commands":{"allow":[],"deny":["outer_size"]}},"deny-primary-monitor":{"identifier":"deny-primary-monitor","description":"Denies the primary_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["primary_monitor"]}},"deny-request-user-attention":{"identifier":"deny-request-user-attention","description":"Denies the request_user_attention command without any pre-configured scope.","commands":{"allow":[],"deny":["request_user_attention"]}},"deny-scale-factor":{"identifier":"deny-scale-factor","description":"Denies the scale_factor command without any pre-configured scope.","commands":{"allow":[],"deny":["scale_factor"]}},"deny-scene-identifier":{"identifier":"deny-scene-identifier","description":"Denies the scene_identifier command without any pre-configured scope.","commands":{"allow":[],"deny":["scene_identifier"]}},"deny-set-always-on-bottom":{"identifier":"deny-set-always-on-bottom","description":"Denies the set_always_on_bottom command without any pre-configured scope.","commands":{"allow":[],"deny":["set_always_on_bottom"]}},"deny-set-always-on-top":{"identifier":"deny-set-always-on-top","description":"Denies the set_always_on_top command without any pre-configured scope.","commands":{"allow":[],"deny":["set_always_on_top"]}},"deny-set-background-color":{"identifier":"deny-set-background-color","description":"Denies the set_background_color command without any pre-configured scope.","commands":{"allow":[],"deny":["set_background_color"]}},"deny-set-badge-count":{"identifier":"deny-set-badge-count","description":"Denies the set_badge_count command without any pre-configured scope.","commands":{"allow":[],"deny":["set_badge_count"]}},"deny-set-badge-label":{"identifier":"deny-set-badge-label","description":"Denies the set_badge_label command without any pre-configured scope.","commands":{"allow":[],"deny":["set_badge_label"]}},"deny-set-closable":{"identifier":"deny-set-closable","description":"Denies the set_closable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_closable"]}},"deny-set-content-protected":{"identifier":"deny-set-content-protected","description":"Denies the set_content_protected command without any pre-configured scope.","commands":{"allow":[],"deny":["set_content_protected"]}},"deny-set-cursor-grab":{"identifier":"deny-set-cursor-grab","description":"Denies the set_cursor_grab command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_grab"]}},"deny-set-cursor-icon":{"identifier":"deny-set-cursor-icon","description":"Denies the set_cursor_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_icon"]}},"deny-set-cursor-position":{"identifier":"deny-set-cursor-position","description":"Denies the set_cursor_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_position"]}},"deny-set-cursor-visible":{"identifier":"deny-set-cursor-visible","description":"Denies the set_cursor_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_visible"]}},"deny-set-decorations":{"identifier":"deny-set-decorations","description":"Denies the set_decorations command without any pre-configured scope.","commands":{"allow":[],"deny":["set_decorations"]}},"deny-set-effects":{"identifier":"deny-set-effects","description":"Denies the set_effects command without any pre-configured scope.","commands":{"allow":[],"deny":["set_effects"]}},"deny-set-enabled":{"identifier":"deny-set-enabled","description":"Denies the set_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["set_enabled"]}},"deny-set-focus":{"identifier":"deny-set-focus","description":"Denies the set_focus command without any pre-configured scope.","commands":{"allow":[],"deny":["set_focus"]}},"deny-set-focusable":{"identifier":"deny-set-focusable","description":"Denies the set_focusable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_focusable"]}},"deny-set-fullscreen":{"identifier":"deny-set-fullscreen","description":"Denies the set_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["set_fullscreen"]}},"deny-set-fullscreen-on-monitor":{"identifier":"deny-set-fullscreen-on-monitor","description":"Denies the set_fullscreen_on_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["set_fullscreen_on_monitor"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-ignore-cursor-events":{"identifier":"deny-set-ignore-cursor-events","description":"Denies the set_ignore_cursor_events command without any pre-configured scope.","commands":{"allow":[],"deny":["set_ignore_cursor_events"]}},"deny-set-max-size":{"identifier":"deny-set-max-size","description":"Denies the set_max_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_max_size"]}},"deny-set-maximizable":{"identifier":"deny-set-maximizable","description":"Denies the set_maximizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_maximizable"]}},"deny-set-min-size":{"identifier":"deny-set-min-size","description":"Denies the set_min_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_min_size"]}},"deny-set-minimizable":{"identifier":"deny-set-minimizable","description":"Denies the set_minimizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_minimizable"]}},"deny-set-overlay-icon":{"identifier":"deny-set-overlay-icon","description":"Denies the set_overlay_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_overlay_icon"]}},"deny-set-position":{"identifier":"deny-set-position","description":"Denies the set_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_position"]}},"deny-set-progress-bar":{"identifier":"deny-set-progress-bar","description":"Denies the set_progress_bar command without any pre-configured scope.","commands":{"allow":[],"deny":["set_progress_bar"]}},"deny-set-resizable":{"identifier":"deny-set-resizable","description":"Denies the set_resizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_resizable"]}},"deny-set-shadow":{"identifier":"deny-set-shadow","description":"Denies the set_shadow command without any pre-configured scope.","commands":{"allow":[],"deny":["set_shadow"]}},"deny-set-simple-fullscreen":{"identifier":"deny-set-simple-fullscreen","description":"Denies the set_simple_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["set_simple_fullscreen"]}},"deny-set-size":{"identifier":"deny-set-size","description":"Denies the set_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_size"]}},"deny-set-size-constraints":{"identifier":"deny-set-size-constraints","description":"Denies the set_size_constraints command without any pre-configured scope.","commands":{"allow":[],"deny":["set_size_constraints"]}},"deny-set-skip-taskbar":{"identifier":"deny-set-skip-taskbar","description":"Denies the set_skip_taskbar command without any pre-configured scope.","commands":{"allow":[],"deny":["set_skip_taskbar"]}},"deny-set-theme":{"identifier":"deny-set-theme","description":"Denies the set_theme command without any pre-configured scope.","commands":{"allow":[],"deny":["set_theme"]}},"deny-set-title":{"identifier":"deny-set-title","description":"Denies the set_title command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title"]}},"deny-set-title-bar-style":{"identifier":"deny-set-title-bar-style","description":"Denies the set_title_bar_style command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title_bar_style"]}},"deny-set-visible-on-all-workspaces":{"identifier":"deny-set-visible-on-all-workspaces","description":"Denies the set_visible_on_all_workspaces command without any pre-configured scope.","commands":{"allow":[],"deny":["set_visible_on_all_workspaces"]}},"deny-show":{"identifier":"deny-show","description":"Denies the show command without any pre-configured scope.","commands":{"allow":[],"deny":["show"]}},"deny-start-dragging":{"identifier":"deny-start-dragging","description":"Denies the start_dragging command without any pre-configured scope.","commands":{"allow":[],"deny":["start_dragging"]}},"deny-start-resize-dragging":{"identifier":"deny-start-resize-dragging","description":"Denies the start_resize_dragging command without any pre-configured scope.","commands":{"allow":[],"deny":["start_resize_dragging"]}},"deny-theme":{"identifier":"deny-theme","description":"Denies the theme command without any pre-configured scope.","commands":{"allow":[],"deny":["theme"]}},"deny-title":{"identifier":"deny-title","description":"Denies the title command without any pre-configured scope.","commands":{"allow":[],"deny":["title"]}},"deny-toggle-maximize":{"identifier":"deny-toggle-maximize","description":"Denies the toggle_maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["toggle_maximize"]}},"deny-unmaximize":{"identifier":"deny-unmaximize","description":"Denies the unmaximize command without any pre-configured scope.","commands":{"allow":[],"deny":["unmaximize"]}},"deny-unminimize":{"identifier":"deny-unminimize","description":"Denies the unminimize command without any pre-configured scope.","commands":{"allow":[],"deny":["unminimize"]}}},"permission_sets":{},"global_scope_schema":null},"deep-link":{"default_permission":{"identifier":"default","description":"Allows reading the opened deep link via the get_current command","permissions":["allow-get-current"]},"permissions":{"allow-get-current":{"identifier":"allow-get-current","description":"Enables the get_current command without any pre-configured scope.","commands":{"allow":["get_current"],"deny":[]}},"allow-is-registered":{"identifier":"allow-is-registered","description":"Enables the is_registered command without any pre-configured scope.","commands":{"allow":["is_registered"],"deny":[]}},"allow-register":{"identifier":"allow-register","description":"Enables the register command without any pre-configured scope.","commands":{"allow":["register"],"deny":[]}},"allow-unregister":{"identifier":"allow-unregister","description":"Enables the unregister command without any pre-configured scope.","commands":{"allow":["unregister"],"deny":[]}},"deny-get-current":{"identifier":"deny-get-current","description":"Denies the get_current command without any pre-configured scope.","commands":{"allow":[],"deny":["get_current"]}},"deny-is-registered":{"identifier":"deny-is-registered","description":"Denies the is_registered command without any pre-configured scope.","commands":{"allow":[],"deny":["is_registered"]}},"deny-register":{"identifier":"deny-register","description":"Denies the register command without any pre-configured scope.","commands":{"allow":[],"deny":["register"]}},"deny-unregister":{"identifier":"deny-unregister","description":"Denies the unregister command without any pre-configured scope.","commands":{"allow":[],"deny":["unregister"]}}},"permission_sets":{},"global_scope_schema":null},"dialog":{"default_permission":{"identifier":"default","description":"This permission set configures the types of dialogs\navailable from the dialog plugin.\n\n#### Granted Permissions\n\nAll dialog types are enabled.\n\n\n","permissions":["allow-message","allow-save","allow-open"]},"permissions":{"allow-ask":{"identifier":"allow-ask","description":"Enables the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)","commands":{"allow":["message"],"deny":[]}},"allow-confirm":{"identifier":"allow-confirm","description":"Enables the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)","commands":{"allow":["message"],"deny":[]}},"allow-message":{"identifier":"allow-message","description":"Enables the message command without any pre-configured scope.","commands":{"allow":["message"],"deny":[]}},"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-save":{"identifier":"allow-save","description":"Enables the save command without any pre-configured scope.","commands":{"allow":["save"],"deny":[]}},"deny-ask":{"identifier":"deny-ask","description":"Denies the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)","commands":{"allow":[],"deny":["message"]}},"deny-confirm":{"identifier":"deny-confirm","description":"Denies the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)","commands":{"allow":[],"deny":["message"]}},"deny-message":{"identifier":"deny-message","description":"Denies the message command without any pre-configured scope.","commands":{"allow":[],"deny":["message"]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-save":{"identifier":"deny-save","description":"Denies the save command without any pre-configured scope.","commands":{"allow":[],"deny":["save"]}}},"permission_sets":{},"global_scope_schema":null},"log":{"default_permission":{"identifier":"default","description":"Allows the log command","permissions":["allow-log"]},"permissions":{"allow-log":{"identifier":"allow-log","description":"Enables the log command without any pre-configured scope.","commands":{"allow":["log"],"deny":[]}},"deny-log":{"identifier":"deny-log","description":"Denies the log command without any pre-configured scope.","commands":{"allow":[],"deny":["log"]}}},"permission_sets":{},"global_scope_schema":null},"notification":{"default_permission":{"identifier":"default","description":"This permission set configures which\nnotification features are by default exposed.\n\n#### Granted Permissions\n\nIt allows all notification related features.\n\n","permissions":["allow-is-permission-granted","allow-request-permission","allow-notify","allow-register-action-types","allow-register-listener","allow-remove-listener","allow-cancel","allow-get-pending","allow-remove-active","allow-get-active","allow-check-permissions","allow-show","allow-batch","allow-list-channels","allow-delete-channel","allow-create-channel","allow-permission-state"]},"permissions":{"allow-batch":{"identifier":"allow-batch","description":"Enables the batch command without any pre-configured scope.","commands":{"allow":["batch"],"deny":[]}},"allow-cancel":{"identifier":"allow-cancel","description":"Enables the cancel command without any pre-configured scope.","commands":{"allow":["cancel"],"deny":[]}},"allow-check-permissions":{"identifier":"allow-check-permissions","description":"Enables the check_permissions command without any pre-configured scope.","commands":{"allow":["check_permissions"],"deny":[]}},"allow-create-channel":{"identifier":"allow-create-channel","description":"Enables the create_channel command without any pre-configured scope.","commands":{"allow":["create_channel"],"deny":[]}},"allow-delete-channel":{"identifier":"allow-delete-channel","description":"Enables the delete_channel command without any pre-configured scope.","commands":{"allow":["delete_channel"],"deny":[]}},"allow-get-active":{"identifier":"allow-get-active","description":"Enables the get_active command without any pre-configured scope.","commands":{"allow":["get_active"],"deny":[]}},"allow-get-pending":{"identifier":"allow-get-pending","description":"Enables the get_pending command without any pre-configured scope.","commands":{"allow":["get_pending"],"deny":[]}},"allow-is-permission-granted":{"identifier":"allow-is-permission-granted","description":"Enables the is_permission_granted command without any pre-configured scope.","commands":{"allow":["is_permission_granted"],"deny":[]}},"allow-list-channels":{"identifier":"allow-list-channels","description":"Enables the list_channels command without any pre-configured scope.","commands":{"allow":["list_channels"],"deny":[]}},"allow-notify":{"identifier":"allow-notify","description":"Enables the notify command without any pre-configured scope.","commands":{"allow":["notify"],"deny":[]}},"allow-permission-state":{"identifier":"allow-permission-state","description":"Enables the permission_state command without any pre-configured scope.","commands":{"allow":["permission_state"],"deny":[]}},"allow-register-action-types":{"identifier":"allow-register-action-types","description":"Enables the register_action_types command without any pre-configured scope.","commands":{"allow":["register_action_types"],"deny":[]}},"allow-register-listener":{"identifier":"allow-register-listener","description":"Enables the register_listener command without any pre-configured scope.","commands":{"allow":["register_listener"],"deny":[]}},"allow-remove-active":{"identifier":"allow-remove-active","description":"Enables the remove_active command without any pre-configured scope.","commands":{"allow":["remove_active"],"deny":[]}},"allow-remove-listener":{"identifier":"allow-remove-listener","description":"Enables the remove_listener command without any pre-configured scope.","commands":{"allow":["remove_listener"],"deny":[]}},"allow-request-permission":{"identifier":"allow-request-permission","description":"Enables the request_permission command without any pre-configured scope.","commands":{"allow":["request_permission"],"deny":[]}},"allow-show":{"identifier":"allow-show","description":"Enables the show command without any pre-configured scope.","commands":{"allow":["show"],"deny":[]}},"deny-batch":{"identifier":"deny-batch","description":"Denies the batch command without any pre-configured scope.","commands":{"allow":[],"deny":["batch"]}},"deny-cancel":{"identifier":"deny-cancel","description":"Denies the cancel command without any pre-configured scope.","commands":{"allow":[],"deny":["cancel"]}},"deny-check-permissions":{"identifier":"deny-check-permissions","description":"Denies the check_permissions command without any pre-configured scope.","commands":{"allow":[],"deny":["check_permissions"]}},"deny-create-channel":{"identifier":"deny-create-channel","description":"Denies the create_channel command without any pre-configured scope.","commands":{"allow":[],"deny":["create_channel"]}},"deny-delete-channel":{"identifier":"deny-delete-channel","description":"Denies the delete_channel command without any pre-configured scope.","commands":{"allow":[],"deny":["delete_channel"]}},"deny-get-active":{"identifier":"deny-get-active","description":"Denies the get_active command without any pre-configured scope.","commands":{"allow":[],"deny":["get_active"]}},"deny-get-pending":{"identifier":"deny-get-pending","description":"Denies the get_pending command without any pre-configured scope.","commands":{"allow":[],"deny":["get_pending"]}},"deny-is-permission-granted":{"identifier":"deny-is-permission-granted","description":"Denies the is_permission_granted command without any pre-configured scope.","commands":{"allow":[],"deny":["is_permission_granted"]}},"deny-list-channels":{"identifier":"deny-list-channels","description":"Denies the list_channels command without any pre-configured scope.","commands":{"allow":[],"deny":["list_channels"]}},"deny-notify":{"identifier":"deny-notify","description":"Denies the notify command without any pre-configured scope.","commands":{"allow":[],"deny":["notify"]}},"deny-permission-state":{"identifier":"deny-permission-state","description":"Denies the permission_state command without any pre-configured scope.","commands":{"allow":[],"deny":["permission_state"]}},"deny-register-action-types":{"identifier":"deny-register-action-types","description":"Denies the register_action_types command without any pre-configured scope.","commands":{"allow":[],"deny":["register_action_types"]}},"deny-register-listener":{"identifier":"deny-register-listener","description":"Denies the register_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["register_listener"]}},"deny-remove-active":{"identifier":"deny-remove-active","description":"Denies the remove_active command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_active"]}},"deny-remove-listener":{"identifier":"deny-remove-listener","description":"Denies the remove_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_listener"]}},"deny-request-permission":{"identifier":"deny-request-permission","description":"Denies the request_permission command without any pre-configured scope.","commands":{"allow":[],"deny":["request_permission"]}},"deny-show":{"identifier":"deny-show","description":"Denies the show command without any pre-configured scope.","commands":{"allow":[],"deny":["show"]}}},"permission_sets":{},"global_scope_schema":null},"openbot-desktop":{"default_permission":null,"permissions":{"allow-ai-connection":{"identifier":"allow-ai-connection","description":"Enables the ai_connection command without any pre-configured scope.","commands":{"allow":["ai_connection"],"deny":[]}},"allow-ai-providers":{"identifier":"allow-ai-providers","description":"Enables the ai_providers command without any pre-configured scope.","commands":{"allow":["ai_providers"],"deny":[]}},"allow-appearance":{"identifier":"allow-appearance","description":"Enables the appearance command without any pre-configured scope.","commands":{"allow":["appearance"],"deny":[]}},"allow-begin-plan-sign-in":{"identifier":"allow-begin-plan-sign-in","description":"Enables the begin_plan_sign_in command without any pre-configured scope.","commands":{"allow":["begin_plan_sign_in"],"deny":[]}},"allow-begin-provider-sign-in":{"identifier":"allow-begin-provider-sign-in","description":"Enables the begin_provider_sign_in command without any pre-configured scope.","commands":{"allow":["begin_provider_sign_in"],"deny":[]}},"allow-cancel-plan-sign-in":{"identifier":"allow-cancel-plan-sign-in","description":"Enables the cancel_plan_sign_in command without any pre-configured scope.","commands":{"allow":["cancel_plan_sign_in"],"deny":[]}},"allow-cancel-provider-sign-in":{"identifier":"allow-cancel-provider-sign-in","description":"Enables the cancel_provider_sign_in command without any pre-configured scope.","commands":{"allow":["cancel_provider_sign_in"],"deny":[]}},"allow-change-ai-connection":{"identifier":"allow-change-ai-connection","description":"Enables the change_ai_connection command without any pre-configured scope.","commands":{"allow":["change_ai_connection"],"deny":[]}},"allow-change-connection":{"identifier":"allow-change-connection","description":"Enables the change_connection command without any pre-configured scope.","commands":{"allow":["change_connection"],"deny":[]}},"allow-check-update":{"identifier":"allow-check-update","description":"Enables the check_update command without any pre-configured scope.","commands":{"allow":["check_update"],"deny":[]}},"allow-connection":{"identifier":"allow-connection","description":"Enables the connection command without any pre-configured scope.","commands":{"allow":["connection"],"deny":[]}},"allow-dismiss-update":{"identifier":"allow-dismiss-update","description":"Enables the dismiss_update command without any pre-configured scope.","commands":{"allow":["dismiss_update"],"deny":[]}},"allow-finish-plan-sign-in":{"identifier":"allow-finish-plan-sign-in","description":"Enables the finish_plan_sign_in command without any pre-configured scope.","commands":{"allow":["finish_plan_sign_in"],"deny":[]}},"allow-finish-provider-sign-in":{"identifier":"allow-finish-provider-sign-in","description":"Enables the finish_provider_sign_in command without any pre-configured scope.","commands":{"allow":["finish_provider_sign_in"],"deny":[]}},"allow-install-update":{"identifier":"allow-install-update","description":"Enables the install_update command without any pre-configured scope.","commands":{"allow":["install_update"],"deny":[]}},"allow-intelligence":{"identifier":"allow-intelligence","description":"Enables the intelligence command without any pre-configured scope.","commands":{"allow":["intelligence"],"deny":[]}},"allow-move-to-cloud":{"identifier":"allow-move-to-cloud","description":"Enables the move_to_cloud command without any pre-configured scope.","commands":{"allow":["move_to_cloud"],"deny":[]}},"allow-notify":{"identifier":"allow-notify","description":"Enables the notify command without any pre-configured scope.","commands":{"allow":["notify"],"deny":[]}},"allow-open-logs":{"identifier":"allow-open-logs","description":"Enables the open_logs command without any pre-configured scope.","commands":{"allow":["open_logs"],"deny":[]}},"allow-prepare-ai-connection":{"identifier":"allow-prepare-ai-connection","description":"Enables the prepare_ai_connection command without any pre-configured scope.","commands":{"allow":["prepare_ai_connection"],"deny":[]}},"allow-quit":{"identifier":"allow-quit","description":"Enables the quit command without any pre-configured scope.","commands":{"allow":["quit"],"deny":[]}},"allow-restart":{"identifier":"allow-restart","description":"Enables the restart command without any pre-configured scope.","commands":{"allow":["restart"],"deny":[]}},"allow-set-organization":{"identifier":"allow-set-organization","description":"Enables the set_organization command without any pre-configured scope.","commands":{"allow":["set_organization"],"deny":[]}},"allow-set-usage-data":{"identifier":"allow-set-usage-data","description":"Enables the set_usage_data command without any pre-configured scope.","commands":{"allow":["set_usage_data"],"deny":[]}},"allow-settle-ai-connection":{"identifier":"allow-settle-ai-connection","description":"Enables the settle_ai_connection command without any pre-configured scope.","commands":{"allow":["settle_ai_connection"],"deny":[]}},"allow-sign-out":{"identifier":"allow-sign-out","description":"Enables the sign_out command without any pre-configured scope.","commands":{"allow":["sign_out"],"deny":[]}},"allow-speech-abort":{"identifier":"allow-speech-abort","description":"Enables the speech_abort command without any pre-configured scope.","commands":{"allow":["speech_abort"],"deny":[]}},"allow-speech-available":{"identifier":"allow-speech-available","description":"Enables the speech_available command without any pre-configured scope.","commands":{"allow":["speech_available"],"deny":[]}},"allow-speech-start":{"identifier":"allow-speech-start","description":"Enables the speech_start command without any pre-configured scope.","commands":{"allow":["speech_start"],"deny":[]}},"allow-speech-stop":{"identifier":"allow-speech-stop","description":"Enables the speech_stop command without any pre-configured scope.","commands":{"allow":["speech_stop"],"deny":[]}},"allow-status":{"identifier":"allow-status","description":"Enables the status command without any pre-configured scope.","commands":{"allow":["status"],"deny":[]}},"allow-stop":{"identifier":"allow-stop","description":"Enables the stop command without any pre-configured scope.","commands":{"allow":["stop"],"deny":[]}},"allow-update-offer":{"identifier":"allow-update-offer","description":"Enables the update_offer command without any pre-configured scope.","commands":{"allow":["update_offer"],"deny":[]}},"allow-usage-data":{"identifier":"allow-usage-data","description":"Enables the usage_data command without any pre-configured scope.","commands":{"allow":["usage_data"],"deny":[]}},"allow-zoom":{"identifier":"allow-zoom","description":"Enables the zoom command without any pre-configured scope.","commands":{"allow":["zoom"],"deny":[]}},"deny-ai-connection":{"identifier":"deny-ai-connection","description":"Denies the ai_connection command without any pre-configured scope.","commands":{"allow":[],"deny":["ai_connection"]}},"deny-ai-providers":{"identifier":"deny-ai-providers","description":"Denies the ai_providers command without any pre-configured scope.","commands":{"allow":[],"deny":["ai_providers"]}},"deny-appearance":{"identifier":"deny-appearance","description":"Denies the appearance command without any pre-configured scope.","commands":{"allow":[],"deny":["appearance"]}},"deny-begin-plan-sign-in":{"identifier":"deny-begin-plan-sign-in","description":"Denies the begin_plan_sign_in command without any pre-configured scope.","commands":{"allow":[],"deny":["begin_plan_sign_in"]}},"deny-begin-provider-sign-in":{"identifier":"deny-begin-provider-sign-in","description":"Denies the begin_provider_sign_in command without any pre-configured scope.","commands":{"allow":[],"deny":["begin_provider_sign_in"]}},"deny-cancel-plan-sign-in":{"identifier":"deny-cancel-plan-sign-in","description":"Denies the cancel_plan_sign_in command without any pre-configured scope.","commands":{"allow":[],"deny":["cancel_plan_sign_in"]}},"deny-cancel-provider-sign-in":{"identifier":"deny-cancel-provider-sign-in","description":"Denies the cancel_provider_sign_in command without any pre-configured scope.","commands":{"allow":[],"deny":["cancel_provider_sign_in"]}},"deny-change-ai-connection":{"identifier":"deny-change-ai-connection","description":"Denies the change_ai_connection command without any pre-configured scope.","commands":{"allow":[],"deny":["change_ai_connection"]}},"deny-change-connection":{"identifier":"deny-change-connection","description":"Denies the change_connection command without any pre-configured scope.","commands":{"allow":[],"deny":["change_connection"]}},"deny-check-update":{"identifier":"deny-check-update","description":"Denies the check_update command without any pre-configured scope.","commands":{"allow":[],"deny":["check_update"]}},"deny-connection":{"identifier":"deny-connection","description":"Denies the connection command without any pre-configured scope.","commands":{"allow":[],"deny":["connection"]}},"deny-dismiss-update":{"identifier":"deny-dismiss-update","description":"Denies the dismiss_update command without any pre-configured scope.","commands":{"allow":[],"deny":["dismiss_update"]}},"deny-finish-plan-sign-in":{"identifier":"deny-finish-plan-sign-in","description":"Denies the finish_plan_sign_in command without any pre-configured scope.","commands":{"allow":[],"deny":["finish_plan_sign_in"]}},"deny-finish-provider-sign-in":{"identifier":"deny-finish-provider-sign-in","description":"Denies the finish_provider_sign_in command without any pre-configured scope.","commands":{"allow":[],"deny":["finish_provider_sign_in"]}},"deny-install-update":{"identifier":"deny-install-update","description":"Denies the install_update command without any pre-configured scope.","commands":{"allow":[],"deny":["install_update"]}},"deny-intelligence":{"identifier":"deny-intelligence","description":"Denies the intelligence command without any pre-configured scope.","commands":{"allow":[],"deny":["intelligence"]}},"deny-move-to-cloud":{"identifier":"deny-move-to-cloud","description":"Denies the move_to_cloud command without any pre-configured scope.","commands":{"allow":[],"deny":["move_to_cloud"]}},"deny-notify":{"identifier":"deny-notify","description":"Denies the notify command without any pre-configured scope.","commands":{"allow":[],"deny":["notify"]}},"deny-open-logs":{"identifier":"deny-open-logs","description":"Denies the open_logs command without any pre-configured scope.","commands":{"allow":[],"deny":["open_logs"]}},"deny-prepare-ai-connection":{"identifier":"deny-prepare-ai-connection","description":"Denies the prepare_ai_connection command without any pre-configured scope.","commands":{"allow":[],"deny":["prepare_ai_connection"]}},"deny-quit":{"identifier":"deny-quit","description":"Denies the quit command without any pre-configured scope.","commands":{"allow":[],"deny":["quit"]}},"deny-restart":{"identifier":"deny-restart","description":"Denies the restart command without any pre-configured scope.","commands":{"allow":[],"deny":["restart"]}},"deny-set-organization":{"identifier":"deny-set-organization","description":"Denies the set_organization command without any pre-configured scope.","commands":{"allow":[],"deny":["set_organization"]}},"deny-set-usage-data":{"identifier":"deny-set-usage-data","description":"Denies the set_usage_data command without any pre-configured scope.","commands":{"allow":[],"deny":["set_usage_data"]}},"deny-settle-ai-connection":{"identifier":"deny-settle-ai-connection","description":"Denies the settle_ai_connection command without any pre-configured scope.","commands":{"allow":[],"deny":["settle_ai_connection"]}},"deny-sign-out":{"identifier":"deny-sign-out","description":"Denies the sign_out command without any pre-configured scope.","commands":{"allow":[],"deny":["sign_out"]}},"deny-speech-abort":{"identifier":"deny-speech-abort","description":"Denies the speech_abort command without any pre-configured scope.","commands":{"allow":[],"deny":["speech_abort"]}},"deny-speech-available":{"identifier":"deny-speech-available","description":"Denies the speech_available command without any pre-configured scope.","commands":{"allow":[],"deny":["speech_available"]}},"deny-speech-start":{"identifier":"deny-speech-start","description":"Denies the speech_start command without any pre-configured scope.","commands":{"allow":[],"deny":["speech_start"]}},"deny-speech-stop":{"identifier":"deny-speech-stop","description":"Denies the speech_stop command without any pre-configured scope.","commands":{"allow":[],"deny":["speech_stop"]}},"deny-status":{"identifier":"deny-status","description":"Denies the status command without any pre-configured scope.","commands":{"allow":[],"deny":["status"]}},"deny-stop":{"identifier":"deny-stop","description":"Denies the stop command without any pre-configured scope.","commands":{"allow":[],"deny":["stop"]}},"deny-update-offer":{"identifier":"deny-update-offer","description":"Denies the update_offer command without any pre-configured scope.","commands":{"allow":[],"deny":["update_offer"]}},"deny-usage-data":{"identifier":"deny-usage-data","description":"Denies the usage_data command without any pre-configured scope.","commands":{"allow":[],"deny":["usage_data"]}},"deny-zoom":{"identifier":"deny-zoom","description":"Denies the zoom command without any pre-configured scope.","commands":{"allow":[],"deny":["zoom"]}}},"permission_sets":{},"global_scope_schema":null},"openbot-intelligence":{"default_permission":null,"permissions":{"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-watch":{"identifier":"allow-watch","description":"Enables the watch command without any pre-configured scope.","commands":{"allow":["watch"],"deny":[]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-watch":{"identifier":"deny-watch","description":"Denies the watch command without any pre-configured scope.","commands":{"allow":[],"deny":["watch"]}}},"permission_sets":{},"global_scope_schema":null},"opener":{"default_permission":{"identifier":"default","description":"This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer","permissions":["allow-open-url","allow-reveal-item-in-dir","allow-default-urls"]},"permissions":{"allow-default-urls":{"identifier":"allow-default-urls","description":"This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"url":"mailto:*"},{"url":"tel:*"},{"url":"http://*"},{"url":"https://*"}]}},"allow-open-path":{"identifier":"allow-open-path","description":"Enables the open_path command without any pre-configured scope.","commands":{"allow":["open_path"],"deny":[]}},"allow-open-url":{"identifier":"allow-open-url","description":"Enables the open_url command without any pre-configured scope.","commands":{"allow":["open_url"],"deny":[]}},"allow-reveal-item-in-dir":{"identifier":"allow-reveal-item-in-dir","description":"Enables the reveal_item_in_dir command without any pre-configured scope.","commands":{"allow":["reveal_item_in_dir"],"deny":[]}},"deny-open-path":{"identifier":"deny-open-path","description":"Denies the open_path command without any pre-configured scope.","commands":{"allow":[],"deny":["open_path"]}},"deny-open-url":{"identifier":"deny-open-url","description":"Denies the open_url command without any pre-configured scope.","commands":{"allow":[],"deny":["open_url"]}},"deny-reveal-item-in-dir":{"identifier":"deny-reveal-item-in-dir","description":"Denies the reveal_item_in_dir command without any pre-configured scope.","commands":{"allow":[],"deny":["reveal_item_in_dir"]}}},"permission_sets":{},"global_scope_schema":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"properties":{"app":{"allOf":[{"$ref":"#/definitions/Application"}],"description":"An application to open this url with, for example: firefox."},"url":{"description":"A URL that can be opened by the webview when using the Opener APIs.\n\nWildcards can be used following the UNIX glob pattern.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"","type":"string"}},"required":["url"],"type":"object"},{"properties":{"app":{"allOf":[{"$ref":"#/definitions/Application"}],"description":"An application to open this path with, for example: xdg-open."},"path":{"description":"A path that can be opened by the webview when using the Opener APIs.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.","type":"string"}},"required":["path"],"type":"object"}],"definitions":{"Application":{"anyOf":[{"description":"Open in default application.","type":"null"},{"description":"If true, allow open with any application.","type":"boolean"},{"description":"Allow specific application to open with.","type":"string"}],"description":"Opener scope application."}},"description":"Opener scope entry.","title":"OpenerScopeEntry"}},"shell":{"default_permission":{"identifier":"default","description":"This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n","permissions":["allow-open"]},"permissions":{"allow-execute":{"identifier":"allow-execute","description":"Enables the execute command without any pre-configured scope.","commands":{"allow":["execute"],"deny":[]}},"allow-kill":{"identifier":"allow-kill","description":"Enables the kill command without any pre-configured scope.","commands":{"allow":["kill"],"deny":[]}},"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-spawn":{"identifier":"allow-spawn","description":"Enables the spawn command without any pre-configured scope.","commands":{"allow":["spawn"],"deny":[]}},"allow-stdin-write":{"identifier":"allow-stdin-write","description":"Enables the stdin_write command without any pre-configured scope.","commands":{"allow":["stdin_write"],"deny":[]}},"deny-execute":{"identifier":"deny-execute","description":"Denies the execute command without any pre-configured scope.","commands":{"allow":[],"deny":["execute"]}},"deny-kill":{"identifier":"deny-kill","description":"Denies the kill command without any pre-configured scope.","commands":{"allow":[],"deny":["kill"]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-spawn":{"identifier":"deny-spawn","description":"Denies the spawn command without any pre-configured scope.","commands":{"allow":[],"deny":["spawn"]}},"deny-stdin-write":{"identifier":"deny-stdin-write","description":"Denies the stdin_write command without any pre-configured scope.","commands":{"allow":[],"deny":["stdin_write"]}}},"permission_sets":{},"global_scope_schema":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"additionalProperties":false,"properties":{"args":{"allOf":[{"$ref":"#/definitions/ShellScopeEntryAllowedArgs"}],"description":"The allowed arguments for the command execution."},"cmd":{"description":"The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.","type":"string"},"name":{"description":"The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.","type":"string"}},"required":["cmd","name"],"type":"object"},{"additionalProperties":false,"properties":{"args":{"allOf":[{"$ref":"#/definitions/ShellScopeEntryAllowedArgs"}],"description":"The allowed arguments for the command execution."},"name":{"description":"The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.","type":"string"},"sidecar":{"description":"If this command is a sidecar command.","type":"boolean"}},"required":["name","sidecar"],"type":"object"}],"definitions":{"ShellScopeEntryAllowedArg":{"anyOf":[{"description":"A non-configurable argument that is passed to the command in the order it was specified.","type":"string"},{"additionalProperties":false,"description":"A variable that is set while calling the command from the webview API.","properties":{"raw":{"default":false,"description":"Marks the validator as a raw regex, meaning the plugin should not make any modification at runtime.\n\nThis means the regex will not match on the entire string by default, which might be exploited if your regex allow unexpected input to be considered valid. When using this option, make sure your regex is correct.","type":"boolean"},"validator":{"description":"[regex] validator to require passed values to conform to an expected input.\n\nThis will require the argument value passed to this variable to match the `validator` regex before it will be executed.\n\nThe regex string is by default surrounded by `^...$` to match the full string. For example the `https?://\\w+` regex would be registered as `^https?://\\w+$`.\n\n[regex]: ","type":"string"}},"required":["validator"],"type":"object"}],"description":"A command argument allowed to be executed by the webview API."},"ShellScopeEntryAllowedArgs":{"anyOf":[{"description":"Use a simple boolean to allow all or disable all arguments to this command configuration.","type":"boolean"},{"description":"A specific set of [`ShellScopeEntryAllowedArg`] that are valid to call for the command configuration.","items":{"$ref":"#/definitions/ShellScopeEntryAllowedArg"},"type":"array"}],"description":"A set of command arguments allowed to be executed by the webview API.\n\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellScopeEntryAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration."}},"description":"Shell scope entry.","title":"ShellScopeEntry"}},"updater":{"default_permission":{"identifier":"default","description":"This permission set configures which kind of\nupdater functions are exposed to the frontend.\n\n#### Granted Permissions\n\nThe full workflow from checking for updates to installing them\nis enabled.\n\n","permissions":["allow-check","allow-download","allow-install","allow-download-and-install"]},"permissions":{"allow-check":{"identifier":"allow-check","description":"Enables the check command without any pre-configured scope.","commands":{"allow":["check"],"deny":[]}},"allow-download":{"identifier":"allow-download","description":"Enables the download command without any pre-configured scope.","commands":{"allow":["download"],"deny":[]}},"allow-download-and-install":{"identifier":"allow-download-and-install","description":"Enables the download_and_install command without any pre-configured scope.","commands":{"allow":["download_and_install"],"deny":[]}},"allow-install":{"identifier":"allow-install","description":"Enables the install command without any pre-configured scope.","commands":{"allow":["install"],"deny":[]}},"deny-check":{"identifier":"deny-check","description":"Denies the check command without any pre-configured scope.","commands":{"allow":[],"deny":["check"]}},"deny-download":{"identifier":"deny-download","description":"Denies the download command without any pre-configured scope.","commands":{"allow":[],"deny":["download"]}},"deny-download-and-install":{"identifier":"deny-download-and-install","description":"Denies the download_and_install command without any pre-configured scope.","commands":{"allow":[],"deny":["download_and_install"]}},"deny-install":{"identifier":"deny-install","description":"Denies the install command without any pre-configured scope.","commands":{"allow":[],"deny":["install"]}}},"permission_sets":{},"global_scope_schema":null},"window-state":{"default_permission":{"identifier":"default","description":"This permission set configures what kind of\noperations are available from the window state plugin.\n\n#### Granted Permissions\n\nAll operations are enabled by default.\n\n","permissions":["allow-filename","allow-restore-state","allow-save-window-state"]},"permissions":{"allow-filename":{"identifier":"allow-filename","description":"Enables the filename command without any pre-configured scope.","commands":{"allow":["filename"],"deny":[]}},"allow-restore-state":{"identifier":"allow-restore-state","description":"Enables the restore_state command without any pre-configured scope.","commands":{"allow":["restore_state"],"deny":[]}},"allow-save-window-state":{"identifier":"allow-save-window-state","description":"Enables the save_window_state command without any pre-configured scope.","commands":{"allow":["save_window_state"],"deny":[]}},"deny-filename":{"identifier":"deny-filename","description":"Denies the filename command without any pre-configured scope.","commands":{"allow":[],"deny":["filename"]}},"deny-restore-state":{"identifier":"deny-restore-state","description":"Denies the restore_state command without any pre-configured scope.","commands":{"allow":[],"deny":["restore_state"]}},"deny-save-window-state":{"identifier":"deny-save-window-state","description":"Denies the save_window_state command without any pre-configured scope.","commands":{"allow":[],"deny":["save_window_state"]}}},"permission_sets":{},"global_scope_schema":null}} \ No newline at end of file diff --git a/desktop/src-tauri/gen/schemas/desktop-schema.json b/desktop/src-tauri/gen/schemas/desktop-schema.json index ca542e4d7f..dec21aa372 100644 --- a/desktop/src-tauri/gen/schemas/desktop-schema.json +++ b/desktop/src-tauri/gen/schemas/desktop-schema.json @@ -3038,6 +3038,12 @@ "const": "openbot-desktop:allow-intelligence", "markdownDescription": "Enables the intelligence command without any pre-configured scope." }, + { + "description": "Enables the move_to_cloud command without any pre-configured scope.", + "type": "string", + "const": "openbot-desktop:allow-move-to-cloud", + "markdownDescription": "Enables the move_to_cloud command without any pre-configured scope." + }, { "description": "Enables the notify command without any pre-configured scope.", "type": "string", @@ -3242,6 +3248,12 @@ "const": "openbot-desktop:deny-intelligence", "markdownDescription": "Denies the intelligence command without any pre-configured scope." }, + { + "description": "Denies the move_to_cloud command without any pre-configured scope.", + "type": "string", + "const": "openbot-desktop:deny-move-to-cloud", + "markdownDescription": "Denies the move_to_cloud command without any pre-configured scope." + }, { "description": "Denies the notify command without any pre-configured scope.", "type": "string", diff --git a/desktop/src-tauri/gen/schemas/macOS-schema.json b/desktop/src-tauri/gen/schemas/macOS-schema.json index ca542e4d7f..dec21aa372 100644 --- a/desktop/src-tauri/gen/schemas/macOS-schema.json +++ b/desktop/src-tauri/gen/schemas/macOS-schema.json @@ -3038,6 +3038,12 @@ "const": "openbot-desktop:allow-intelligence", "markdownDescription": "Enables the intelligence command without any pre-configured scope." }, + { + "description": "Enables the move_to_cloud command without any pre-configured scope.", + "type": "string", + "const": "openbot-desktop:allow-move-to-cloud", + "markdownDescription": "Enables the move_to_cloud command without any pre-configured scope." + }, { "description": "Enables the notify command without any pre-configured scope.", "type": "string", @@ -3242,6 +3248,12 @@ "const": "openbot-desktop:deny-intelligence", "markdownDescription": "Denies the intelligence command without any pre-configured scope." }, + { + "description": "Denies the move_to_cloud command without any pre-configured scope.", + "type": "string", + "const": "openbot-desktop:deny-move-to-cloud", + "markdownDescription": "Denies the move_to_cloud command without any pre-configured scope." + }, { "description": "Denies the notify command without any pre-configured scope.", "type": "string", diff --git a/desktop/src-tauri/src/connected/relay.rs b/desktop/src-tauri/src/connected/relay.rs index 99591a8bd8..e5dd3e773d 100644 --- a/desktop/src-tauri/src/connected/relay.rs +++ b/desktop/src-tauri/src/connected/relay.rs @@ -80,6 +80,25 @@ const ENTRY_PAGE: &str = concat!( "OpenBot" ); +/// The entry page, sending the window on to `to`, which `app_page` has passed. +fn entry_page(to: &str) -> String { + ENTRY_PAGE.replace("url=/\"", &format!("url={to}\"")) +} + +/** +Whether `to` is plainly a page of the app on the relay's own origin: a path from the root, of +lowercase letters, digits, `-`, `_` and single `/`, at most 100 characters. Never `//` (another +host), never a scheme, a query, a quote or an escape: it goes into the entry page's refresh. +*/ +pub fn app_page(to: &str) -> bool { + to.len() <= 100 + && to.starts_with('/') + && !to.contains("//") + && to + .bytes() + .all(|byte| matches!(byte, b'a'..=b'z' | b'0'..=b'9' | b'-' | b'_' | b'/')) +} + /// The request header that names the organisation the person is working in. A token carries no /// session, and a person can belong to several, so every request says which. Set by the shell /// from the person's choice (`choice::Choice::organization_id`), never taken from the page. @@ -229,6 +248,15 @@ impl Relay { pub fn entry(&self) -> String { format!("{}{ENTER_PATH}?key={}", self.origin(), self.secret) } + + /// The entry, sending the window on to the app's page `to` (such as `/connections`) in place + /// of its home. A `to` that isn't plainly one of the app's own pages (`app_page`) is home. + pub fn entry_to(&self, to: &str) -> String { + if to == "/" || !app_page(to) { + return self.entry(); + } + format!("{}&to={to}", self.entry()) + } } impl Drop for Relay { @@ -390,6 +418,13 @@ async fn answer(mut request: Request, shared: Arc) -> Response "This relay is for the OpenBot window.", ); } + // Where the app opens: `to`, when it names one of the app's own pages, else its home. + let to = request + .uri() + .query() + .and_then(|query| query.split('&').find_map(|pair| pair.strip_prefix("to="))) + .filter(|to| app_page(to)) + .unwrap_or("/"); // A page, not a redirect: see the module's documentation. return Response::builder() .status(StatusCode::OK) @@ -409,7 +444,7 @@ async fn answer(mut request: Request, shared: Arc) -> Response "default-src 'none'; frame-ancestors 'none'", ) .body( - Full::new(Bytes::from_static(ENTRY_PAGE.as_bytes())) + Full::new(Bytes::from(entry_page(to))) .map_err(|never| match never {}) .boxed(), ) @@ -1781,6 +1816,43 @@ mod tests { assert_eq!(rig.openbot.seen_at(ENTER_PATH).len(), 0); } + /// After the move to OpenBot Cloud, Reconnect opens the window at Cloud's Connections page: + /// the entry sends the window on to that page, and to nothing that isn't plainly one of the + /// app's own pages (another host, a scheme, a quote that would leave the refresh). + #[test] + fn the_entry_can_open_one_of_the_apps_own_pages_and_nothing_else() { + let rig = rig(); + let mut window = WebKitWindow::new(); + let arrived = window.navigate(SETUP_PAGE, &rig.relay.entry_to("/landing")); + assert_eq!(arrived.status, 200); + assert_eq!(arrived.body, "OpenBot"); + assert_eq!( + arrived.url.as_str(), + format!("{}/landing", rig.relay.origin()) + ); + assert_eq!(rig.openbot.seen_at("/landing").len(), 1); + for to in [ + "//evil.example/x", + "https://evil.example/", + "/a\">`, + }); + }); + await page.goto(`${ORIGIN}/settings/computer`); + return page; +} + +/** Style the page for every class it draws now: what just opened brings classes of its own. */ +async function style(page: Page) { + const classes = await page.evaluate(() => + [...document.querySelectorAll("[class]")].flatMap((element) => [ + ...element.classList, + ]), + ); + await page.addStyleTag({ content: await stylesheet([...new Set(classes)]) }); + await page.evaluate(() => document.fonts.ready); + await page.waitForTimeout(250); +} + +async function shoot(page: Page, step: string, engine: string, theme: Theme) { + await style(page); + if (!shots) return; + mkdirSync(shots, { recursive: true }); + await page.screenshot({ + path: join(shots, `move-to-cloud-settings-${step}-${engine}-${theme}.png`), + }); +} + +/** What a person would see wrong: sideways scroll, a control cut off, the dialog off screen. */ +async function measured(page: Page) { + return page.evaluate(() => { + const inside = (rect: DOMRect) => + rect.left >= -0.5 && rect.right <= innerWidth + 0.5; + const dialog = document.querySelector("[data-slot=dialog-content]"); + const scope: Element = dialog ?? document.body; + const cut = [...scope.querySelectorAll("button, a, input")] + .filter((control) => { + const rect = control.getBoundingClientRect(); + return rect.width > 0 && rect.height > 0; + }) + .filter((control) => !control.matches("[data-sidebar=rail]")) + .filter((control) => !inside(control.getBoundingClientRect())) + .map( + (control) => + control.textContent?.trim() || + control.getAttribute("aria-label") || + control.tagName, + ); + const box = dialog?.getBoundingClientRect(); + return { + sideways: document.documentElement.scrollWidth > innerWidth, + cut, + dialogInside: box + ? inside(box) && box.top >= 0 && box.bottom <= innerHeight + 0.5 + : true, + }; + }); +} + +const FINE = { sideways: false, cut: [], dialogInside: true }; + +describe.skipIf(!asked)("Move to OpenBot Cloud in Settings", () => { + for (const engine of engines) + for (const theme of THEMES) + test(`the row opens a dialog that says what happens, and Continue asks the desktop app, in ${engine}, ${theme}`, async () => { + const page = await open(engine, theme); + try { + const move = page.getByRole("button", { + name: "Move to OpenBot Cloud", + }); + await move.waitFor(); + await page + .getByText("OpenBot runs on this computer", { exact: true }) + .waitFor(); + // Styled first, so the row is scrolled to where it is drawn. + await style(page); + await page.evaluate(() => + [...document.querySelectorAll("button")] + .find((button) => button.textContent === "Move to OpenBot Cloud") + ?.scrollIntoView({ block: "center" }), + ); + await shoot(page, "row", engine, theme); + expect(await measured(page)).toEqual(FINE); + await move.click(); + const dialog = page.getByRole("dialog"); + await dialog + .getByText("Move to OpenBot Cloud?", { exact: true }) + .waitFor(); + await shoot(page, "dialog", engine, theme); + expect(await measured(page)).toEqual(FINE); + expect( + await page.evaluate(() => + (window as unknown as { __asked: string[] }).__asked.includes( + "move_to_cloud", + ), + ), + ).toBe(false); + await dialog.getByRole("button", { name: "Continue" }).click(); + await page.waitForFunction(() => + (window as unknown as { __asked: string[] }).__asked.includes( + "move_to_cloud", + ), + ); + } finally { + await page.close(); + } + }, 60_000); +}); diff --git a/desktop/src/App.test.tsx b/desktop/src/App.test.tsx index 3534436535..108ca63704 100644 --- a/desktop/src/App.test.tsx +++ b/desktop/src/App.test.tsx @@ -1565,8 +1565,16 @@ describe("with OpenBot Cloud on in this build (VITE_OPENBOT_CLOUD_ENABLED=true)" await userEvent.click( view.getByRole("button", { name: "Use OpenBot (Self-Contained)" }), ); + // Not chosen until Install: looking at it is not an answer. + expect( + invokeCalls.filter((call) => call.command === "keep_self_contained"), + ).toEqual([]); await installLocal(view); await view.findByRole("heading", { name: "Connect your AI" }); + // Chosen on the first screen in this version: the move to OpenBot Cloud is never offered. + expect( + invokeCalls.filter((call) => call.command === "keep_self_contained"), + ).toHaveLength(1); // Nothing of OpenBot Cloud was asked for. expect( invokeCalls.some((call) => diff --git a/desktop/src/App.tsx b/desktop/src/App.tsx index 71aeb9da39..3033d8d4e5 100644 --- a/desktop/src/App.tsx +++ b/desktop/src/App.tsx @@ -2,6 +2,7 @@ import { invoke } from "@tauri-apps/api/core"; import { listen } from "@tauri-apps/api/event"; import { useCallback, useEffect, useRef, useState } from "react"; import { CheckForUpdates } from "./CheckForUpdates"; +import { cloudEnabled } from "./CloudSignIn"; import { CopilotKitAccount } from "./CopilotKitAccount"; import { EarlyDownloadsLine, @@ -30,6 +31,12 @@ import { resourcesShortSaid, updateRoomShort, } from "./localReadiness"; +import { + askMoveOffer, + type MoveOffer, + MoveToCloud, + moveOffered, +} from "./MoveToCloud"; import { PausePodman, PodmanGoAhead } from "./PodmanGoAhead"; import { asProblem, Failure, InlineFailure, type Problem } from "./Problem"; import { @@ -331,6 +338,14 @@ function LocalSetup({ address, choose }: { address: string; choose: boolean }) { // Running-screen actions that wait on the native side, said while they do. const [stopping, setStopping] = useState(false); const [showing, setShowing] = useState(false); + /* + * The move to OpenBot Cloud, offered where this window would hand itself to the OpenBot running + * here: after an update to a person who never answered, or asked for from Settings. It needs + * OpenBot running, since what moves is read from it. Asked once per page; shown, it takes the + * window until the person keeps OpenBot here or moves (`MoveToCloud`). + */ + const moveAsked = useRef | null>(null); + const [moveShown, setMoveShown] = useState(null); // Start could not move the deployment to this app's release, and started the one it had. const [releaseNotice, setReleaseNotice] = useState(null); // The back end is ready on the release it had, and its update did not finish. @@ -611,6 +626,7 @@ function LocalSetup({ address, choose }: { address: string; choose: boolean }) { // A launch after the restart Windows needed, with Windows ready: the install asked for goes on. const [installAskedFor, setInstallAskedFor] = useState(false); + // biome-ignore lint/correctness/useExhaustiveDependencies: once per launch; `handOver` reads only refs and setters. useEffect(() => { let active = true; // A restart still owed comes first: a feature switched on reads as on before it runs. Only a @@ -745,7 +761,7 @@ function LocalSetup({ address, choose }: { address: string; choose: boolean }) { ) { // Already up from a previous window: show it, rather than a screen about it. try { - await invoke("show_openbot"); + await handOver(); } catch (error) { /* * Up, and needing a newer version of this app: the shell holds it as this session's @@ -1013,7 +1029,12 @@ function LocalSetup({ address, choose }: { address: string; choose: boolean }) { // Straight from Starting to OpenBot, after an update as after any Start: the running screen // only if this page is still here once OpenBot's page had time to replace it (`handover.ts`). setHandingOver({ returning: returnedTo }); - await invoke("show_openbot"); + if (!(await handOver())) { + // The move to OpenBot Cloud is offered first, over the running OpenBot. + setHandingOver(null); + setSteps((current) => settleProgress(current)); + return "started"; + } if (handoverHeld.current !== null) clearTimeout(handoverHeld.current); handoverHeld.current = setTimeout(() => { handoverHeld.current = null; @@ -1152,7 +1173,7 @@ function LocalSetup({ address, choose }: { address: string; choose: boolean }) { async function showOpenBot() { setShowing(true); try { - await invoke("show_openbot"); + await handOver(); } catch (error) { recoverFromStart(error); } finally { @@ -1160,6 +1181,30 @@ function LocalSetup({ address, choose }: { address: string; choose: boolean }) { } } + /** + * The window to the OpenBot running here (`show_openbot`), unless the move to OpenBot Cloud is + * offered first: then its screens show instead, and this answers false. The shell is told whether + * this build offers OpenBot Cloud, and says the move is due only where it does. + */ + async function handOver(): Promise { + moveAsked.current ??= askMoveOffer(cloudEnabled()); + const offer = await moveAsked.current; + if (moveOffered(offer)) { + // Once per page: from here the person keeps OpenBot here or moves. + moveAsked.current = Promise.resolve(null); + setMoveShown(offer); + return false; + } + await invoke("show_openbot"); + return true; + } + + /** Keep OpenBot on this computer, from the move's screens: recorded by them, then shown. */ + async function keepHere() { + setMoveShown(null); + await showOpenBot(); + } + /* * Starts local Intelligence without a click: a recorded stack on a first run that was not * interrupted, or a connected one on relaunch with auto-start on. Never after Stop OpenBot. And a @@ -1262,6 +1307,9 @@ function LocalSetup({ address, choose }: { address: string; choose: boolean }) { function installHere() { // The default Bot, recorded as a choice of it would be. recordSetupEvent(harnessChoiceEvent(DEFAULT_HARNESS)); + // Chosen on the first screen in this version: the move to OpenBot Cloud is never offered. + // Best effort, and never in the install's way: an older shell has no such command. + invoke("keep_self_contained").catch(() => {}); // The account is the first screen; OpenBot installs behind it meanwhile. setStep("account"); void beginLocalInstall(); @@ -1307,6 +1355,13 @@ function LocalSetup({ address, choose }: { address: string; choose: boolean }) { const quitting = useQuitStatus(false); if (quitting) return ; + if (moveShown) + return ( +
+ +
+ ); + // Nothing else on this screen can be done until the machine allows it, so nothing else is shown. if (blockerFailure) { return ( diff --git a/desktop/src/MoveToCloud.test.tsx b/desktop/src/MoveToCloud.test.tsx new file mode 100644 index 0000000000..74bdc38006 --- /dev/null +++ b/desktop/src/MoveToCloud.test.tsx @@ -0,0 +1,453 @@ +import { + afterAll, + afterEach, + beforeAll, + beforeEach, + expect, + mock, + test, +} from "bun:test"; +import { GlobalRegistrator } from "@happy-dom/global-registrator"; +import { act, cleanup, render, waitFor } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; + +/* + * The move to OpenBot Cloud as the setup window runs it, through the whole window (`App`): the + * shell is scripted at `invoke` and `listen`, as it answers a person who updated OpenBot + * (Self-Contained) to this version, or one connected to an OpenBot elsewhere. + */ + +type Answer = unknown | ((args: unknown) => unknown); +let answers: Record = {}; +let calls: Array<{ command: string; args?: unknown }> = []; +const listeners = new Map void>>(); + +mock.module("@tauri-apps/api/core", () => ({ + invoke: async (command: string, args?: unknown) => { + calls.push({ command, args }); + if (command in answers) { + const answer = answers[command]; + return typeof answer === "function" ? answer(args) : answer; + } + return null; + }, +})); + +mock.module("@tauri-apps/api/event", () => ({ + listen: async ( + name: string, + listener: (event: { payload: unknown }) => void, + ) => { + if (!listeners.has(name)) listeners.set(name, new Set()); + listeners.get(name)?.add(listener); + return () => listeners.get(name)?.delete(listener); + }, +})); + +mock.module("./Mark", () => ({ + Mark: ({ name }: { name: string }) => {name}, + ButtonMark: () => null, + MarkImage: ({ id, name }: { id: string; name: string }) => ( + {name} + ), +})); + +const { App } = await import("./App"); +const { countLines, formatSpace } = await import("./MoveToCloud"); + +beforeAll(() => GlobalRegistrator.register()); +afterAll(() => GlobalRegistrator.unregister()); + +let before: string | undefined; +beforeEach(() => { + before = process.env.VITE_OPENBOT_CLOUD_ENABLED; + process.env.VITE_OPENBOT_CLOUD_ENABLED = "true"; +}); +afterEach(() => { + cleanup(); + if (before === undefined) delete process.env.VITE_OPENBOT_CLOUD_ENABLED; + else process.env.VITE_OPENBOT_CLOUD_ENABLED = before; + answers = {}; + calls = []; + listeners.clear(); + localStorage.clear(); +}); + +const GB = 18_400_000_000; + +/** OpenBot (Self-Contained), set up and already running when the window opens. */ +function selfContainedRunning(offer: { + due: boolean; + fromSettings?: boolean; +}): void { + answers = { + connection: { mode: "local", address: null, signedIn: false }, + default_root: "/Users/you/OpenBot", + already_configured: { + values: {}, + saved: { + modelApiKeys: { openai: true, anthropic: false }, + modelSessions: { openai: false, anthropic: false }, + model: "open-ai-api-key", + }, + launch: { harness: { id: "langgraph-ts" } }, + localEval: { + stack: "local-abc123", + ownership: "created", + phase: "installed", + connected: true, + }, + }, + take_ai_connection_change: false, + already_running: true, + move_offer: { + due: offer.due, + fromSettings: offer.fromSettings ?? false, + footprintBytes: GB, + }, + }; +} + +const APPS = [ + { + appId: "gmail", + appName: "Gmail", + accountLabel: "sam@example.com", + botNames: ["Inbox helper"], + }, + { appId: "slack", appName: "Slack" }, + { appId: "google-drive", appName: "Google Drive" }, +]; + +const PREVIEW = { + counts: [ + { kind: "bots", count: 3 }, + { kind: "conversations", count: 42 }, + { kind: "messages", count: 2814 }, + { kind: "memories", count: 52 }, + { kind: "skills", count: 9 }, + { kind: "routines", count: 1 }, + { kind: "goals", count: 0 }, + { kind: "files", count: 64 }, + { kind: "settings", count: 1 }, + { kind: "model-keys", count: 1 }, + ], + apps: APPS, + footprintBytes: GB, + modelKeysAvailable: true, +}; + +const MOVED = { + freedBytes: GB, + apps: APPS, + notes: [ + "Research runs on an ordinary computer here, because OpenBot Cloud has no isolated computers.", + ], + leftBehind: [], +}; + +async function launch() { + let view!: ReturnType; + await act(async () => { + view = render(); + }); + return view; +} + +function called(command: string) { + return calls.filter((call) => call.command === command); +} + +async function emit(payload: unknown) { + await act(async () => { + for (const listener of listeners.get("move:progress") ?? []) + listener({ payload }); + }); +} + +/** Settings' Move to OpenBot Cloud: the window opens on what moves. */ +async function atConfirm() { + selfContainedRunning({ due: false, fromSettings: true }); + answers.move_preview = PREVIEW; + const view = await launch(); + await view.findByRole("button", { name: "Move to OpenBot Cloud" }); + await waitFor(() => + expect( + ( + view.getByRole("button", { + name: "Move to OpenBot Cloud", + }) as HTMLButtonElement + ).disabled, + ).toBe(false), + ); + return view; +} + +test("after the update, OpenBot (Self-Contained) asks once, before showing OpenBot, with the space it would free", async () => { + selfContainedRunning({ due: true }); + const view = await launch(); + await view.findByRole("heading", { name: "Move to OpenBot Cloud?" }); + // The shell is told this build offers OpenBot Cloud, and OpenBot is not shown yet. + expect(called("move_offer").map((call) => call.args)).toEqual([ + { cloud: true }, + ]); + expect(called("show_openbot")).toEqual([]); + const cloud = view.getByRole("radio", { + name: /^OpenBot Cloud/, + }) as HTMLInputElement; + expect(cloud.checked).toBe(true); + expect(cloud.closest("label")?.textContent).toContain("Recommended"); + expect(cloud.closest("label")?.textContent).toContain( + "Your Bots, conversations, memory, skills, routines and files move to your OpenBot Cloud account. This frees about 18.4 GB on this computer.", + ); + expect( + view.getByRole("radio", { name: /^OpenBot \(Self-Contained\)/ }), + ).toBeTruthy(); + // Continue goes on to what moves, read from the OpenBot running here. + answers.move_preview = PREVIEW; + await userEvent.click(view.getByRole("button", { name: "Continue" })); + await view.findByRole("heading", { name: "Move to OpenBot Cloud" }); + expect(called("move_preview")).toHaveLength(1); +}); + +test("a launch that isn't due shows OpenBot straight away, and a connected app is never asked", async () => { + selfContainedRunning({ due: false }); + let view = await launch(); + await waitFor(() => expect(called("show_openbot")).toHaveLength(1)); + expect(view.queryByRole("heading", { name: "Move to OpenBot Cloud?" })).toBe( + null, + ); + cleanup(); + calls = []; + // Connected to OpenBot Cloud or a company's OpenBot: the shell opens it, and nothing is asked. + answers = { + connection: { + mode: "connected", + address: "https://api.open.bot", + signedIn: true, + }, + move_offer: { due: true, fromSettings: false, footprintBytes: GB }, + }; + view = await launch(); + await waitFor(() => expect(called("show_connected")).toHaveLength(1)); + expect(called("move_offer")).toEqual([]); + expect(view.queryByRole("heading", { name: "Move to OpenBot Cloud?" })).toBe( + null, + ); +}); + +test("Keep records the answer and shows OpenBot, and the next launch never asks again", async () => { + selfContainedRunning({ due: true }); + const view = await launch(); + await view.findByRole("heading", { name: "Move to OpenBot Cloud?" }); + await userEvent.click( + view.getByRole("radio", { name: /^OpenBot \(Self-Contained\)/ }), + ); + await userEvent.click( + view.getByRole("button", { name: "Keep OpenBot on this computer" }), + ); + await waitFor(() => expect(called("show_openbot")).toHaveLength(1)); + const order = calls.map((call) => call.command); + expect(order.indexOf("keep_self_contained")).toBeGreaterThan(-1); + expect(order.indexOf("keep_self_contained")).toBeLessThan( + order.indexOf("show_openbot"), + ); + expect(called("move_offer")).toHaveLength(1); + expect(called("move_to_cloud")).toEqual([]); + cleanup(); + calls = []; + // Recorded: the shell answers not due from now on. + selfContainedRunning({ due: false }); + const next = await launch(); + await waitFor(() => expect(called("show_openbot")).toHaveLength(1)); + expect(next.queryByRole("heading", { name: "Move to OpenBot Cloud?" })).toBe( + null, + ); +}); + +test("before the move, the apps that must be reconnected are listed by name, above the Move button", async () => { + const view = await atConfirm(); + const counts = view.getByRole("list", { name: "What moves" }); + expect( + [...counts.querySelectorAll("li")].map((li) => li.textContent), + ).toEqual([ + "3 Bots", + "9 skills", + "42 conversations", + "2,814 messages", + "52 memories", + "1 routine", + "64 files", + ]); + const apps = view.getByRole("list", { name: "Apps to reconnect" }); + expect([...apps.querySelectorAll("li")].map((li) => li.textContent)).toEqual([ + "Gmail, sam@example.comUsed by Inbox helper", + "Slack", + "Google Drive", + ]); + expect(view.getByText(/can't move safely/)).toBeTruthy(); + const move = view.getByRole("button", { name: "Move to OpenBot Cloud" }); + // The notice comes before the button a person presses. + expect( + apps.compareDocumentPosition(move) & Node.DOCUMENT_POSITION_FOLLOWING, + ).toBeTruthy(); + expect( + ( + view.getByRole("checkbox", { + name: /Bring my AI key to OpenBot Cloud/, + }) as HTMLInputElement + ).checked, + ).toBe(true); + expect( + view.getByText(/Frees about 18\.4 GB\. Nothing is removed/), + ).toBeTruthy(); +}); + +test("a move that fails removes nothing, and Try again moves again", async () => { + for (const kind of ["move-failed", "move-mismatch"]) { + const view = await atConfirm(); + const said = + kind === "move-failed" + ? "OpenBot couldn't send your Bots to OpenBot Cloud. Check your internet connection and try again." + : "OpenBot Cloud didn't get all of your conversations."; + let attempts = 0; + answers.move_to_cloud = () => { + attempts += 1; + if (attempts === 1) throw { said, kind }; + return new Promise(() => {}); + }; + await userEvent.click( + view.getByRole("button", { name: "Move to OpenBot Cloud" }), + ); + await view.findByText("Nothing was removed from this computer."); + expect(view.getByText(said)).toBeTruthy(); + expect( + view.getByRole("heading", { + name: + kind === "move-failed" + ? "The move didn't finish" + : "Not everything arrived", + }), + ).toBeTruthy(); + expect( + view.getByRole("button", { name: "Keep OpenBot on this computer" }), + ).toBeTruthy(); + expect(called("move_to_cloud")[0]?.args).toEqual({ + address: "https://api.open.bot", + includeModelKeys: true, + }); + await userEvent.click(view.getByRole("button", { name: "Try again" })); + await view.findByRole("heading", { name: "Moving to OpenBot Cloud" }); + expect(called("move_to_cloud")).toHaveLength(2); + cleanup(); + calls = []; + listeners.clear(); + } +}); + +test("the move shows each stage, and Cancel while signing in goes back with nothing removed", async () => { + const view = await atConfirm(); + let reject!: (error: unknown) => void; + answers.move_to_cloud = () => + new Promise((_resolve, fail) => { + reject = fail; + }); + await userEvent.click( + view.getByRole("button", { name: "Move to OpenBot Cloud" }), + ); + await view.findByRole("heading", { name: "Moving to OpenBot Cloud" }); + await emit({ stage: "sign-in", state: "running" }); + expect(view.getByText("Finish signing in in your browser.")).toBeTruthy(); + await userEvent.click(view.getByRole("button", { name: "Cancel" })); + expect(called("cancel_move")).toHaveLength(1); + await act(async () => + reject({ said: "Signing in didn't finish.", kind: "sign-in" }), + ); + await view.findByRole("button", { name: "Move to OpenBot Cloud" }); + expect(view.queryByText("Nothing was removed from this computer.")).toBe( + null, + ); + // Again, signed in: the stages done tick, and the one running says how far it got. + answers.move_to_cloud = () => new Promise(() => {}); + await userEvent.click( + view.getByRole("button", { name: "Move to OpenBot Cloud" }), + ); + await view.findByRole("heading", { name: "Moving to OpenBot Cloud" }); + await emit({ stage: "upload", state: "running", progress: 0.42 }); + const rows = view.getByRole("list", { name: "Move progress" }); + expect([...rows.querySelectorAll("li")].map((li) => li.textContent)).toEqual([ + "✓Signing in to OpenBot CloudComplete", + "✓Packing up your Bots and their workComplete", + expect.stringMatching(/^Sending to OpenBot CloudIn progress.*42% sent\.$/), + "Adding them to OpenBot Cloud", + "Checking everything arrived", + "Removing OpenBot from this computer", + ]); + expect(view.queryByRole("button", { name: "Cancel" })).toBe(null); +}); + +test("a finished move shows the space freed and one Reconnect per app, each opening OpenBot Cloud's connections", async () => { + const view = await atConfirm(); + answers.move_to_cloud = MOVED; + await userEvent.click( + view.getByRole("button", { name: "Move to OpenBot Cloud" }), + ); + await view.findByRole("heading", { name: "You're on OpenBot Cloud" }); + expect(view.getByText("18.4 GB freed")).toBeTruthy(); + expect(view.getByText(MOVED.notes[0] as string)).toBeTruthy(); + const reconnect = view.getAllByRole("button", { name: /^Reconnect / }); + expect(reconnect.map((button) => button.getAttribute("aria-label"))).toEqual([ + "Reconnect Gmail", + "Reconnect Slack", + "Reconnect Google Drive", + ]); + await userEvent.click(reconnect[1] as HTMLElement); + expect(called("open_moved_cloud").map((call) => call.args)).toEqual([ + { path: "/connections" }, + ]); + await userEvent.click(view.getByRole("button", { name: "Open OpenBot" })); + // Opening already: the window is on its way to OpenBot Cloud. + expect(called("open_moved_cloud")).toHaveLength(1); +}); + +test("Open OpenBot opens OpenBot Cloud's home, and what couldn't be removed is said calmly", async () => { + const view = await atConfirm(); + answers.move_to_cloud = { + freedBytes: 640_000_000, + apps: [], + notes: [], + leftBehind: [ + "Some of OpenBot's software is still on this computer. You can remove it from Settings.", + ], + }; + await userEvent.click( + view.getByRole("button", { name: "Move to OpenBot Cloud" }), + ); + await view.findByRole("heading", { name: "You're on OpenBot Cloud" }); + expect(view.getByText("640 MB freed")).toBeTruthy(); + expect(view.getByRole("status").textContent).toContain( + "Some of OpenBot's software is still on this computer.", + ); + expect(view.queryByRole("button", { name: /^Reconnect / })).toBe(null); + await userEvent.click(view.getByRole("button", { name: "Open OpenBot" })); + expect(called("open_moved_cloud").map((call) => call.args)).toEqual([ + { path: "/" }, + ]); +}); + +test("counts keep the kinds there are words for, in order, and skip zeros; space reads in GB or MB", () => { + expect( + countLines([ + { kind: "files", count: 1 }, + { kind: "check-ins", count: 2 }, + { kind: "goals", count: 1 }, + { kind: "bots", count: 1 }, + { kind: "settings", count: 4 }, + { kind: "something-new", count: 7 }, + { kind: "memories", count: 0 }, + ]).map((line) => line.said), + ).toEqual(["1 Bot", "1 goal", "2 check-ins", "1 file"]); + expect(formatSpace(18_449_999_999)).toBe("18.4 GB"); + expect(formatSpace(999_000_000)).toBe("999 MB"); + expect(formatSpace(1_000)).toBe("1 MB"); +}); diff --git a/desktop/src/MoveToCloud.tsx b/desktop/src/MoveToCloud.tsx new file mode 100644 index 0000000000..5926204bce --- /dev/null +++ b/desktop/src/MoveToCloud.tsx @@ -0,0 +1,793 @@ +import { + type Icon, + IconBell, + IconBook, + IconBrain, + IconCircleCheck, + IconClock, + IconCloud, + IconDeviceLaptop, + IconFiles, + IconMessage, + IconMessages, + IconPlug, + IconRobot, + IconTarget, +} from "@tabler/icons-react"; +import { invoke } from "@tauri-apps/api/core"; +import { listen } from "@tauri-apps/api/event"; +import { + type ReactNode, + useCallback, + useEffect, + useRef, + useState, +} from "react"; +import { cloudAddress } from "./CloudSignIn"; +import { asProblem, type Problem } from "./Problem"; +import { + type Progress, + SetupProgress, + StatusLine, + StepFooter, +} from "./SetupProgress"; + +/** + * Whether this window offers the move to OpenBot Cloud, as the shell answers `move_offer`. `due`: + * OpenBot is set up and runs on this computer, and the person has never answered. `fromSettings`: + * Settings' "Move to OpenBot Cloud" sent the window here, answered once. `footprintBytes`: what + * OpenBot takes on this computer now, or null when it couldn't be measured. + */ +export type MoveOffer = { + due: boolean; + fromSettings: boolean; + footprintBytes: number | null; +}; + +/** One private app connection, which can't move and is connected again in OpenBot Cloud. */ +export type ReconnectApp = { + appId: string; + appName: string; + accountLabel?: string; + iconUrl?: string; + botNames?: string[]; +}; + +/** What the move would take, read from the OpenBot running on this computer (`move_preview`). */ +export type MovePreview = { + counts: { kind: string; count: number }[]; + apps: ReconnectApp[]; + footprintBytes: number | null; + /** This computer has an AI key the move can bring along, sealed for the person's Cloud account. */ + modelKeysAvailable: boolean; +}; + +/** What a finished move answers (`move_to_cloud`). */ +export type Moved = { + freedBytes: number | null; + apps: ReconnectApp[]; + /** Plain sentences from OpenBot Cloud about things that moved differently. */ + notes: string[]; + /** Plain sentences about what couldn't be removed from this computer after the move. */ + leftBehind: string[]; +}; + +export type MoveStage = + | "sign-in" + | "export" + | "upload" + | "import" + | "verify" + | "remove"; + +/** The shell's `move:progress` event. `progress` (0 to 1) only for packing up and sending. */ +export type MoveProgress = { + stage: MoveStage; + state: "running" | "done"; + progress?: number; +}; + +/** The move's rows, in order, as the person reads them. */ +export const MOVE_STAGES: readonly { stage: MoveStage; label: string }[] = [ + { stage: "sign-in", label: "Signing in to OpenBot Cloud" }, + { stage: "export", label: "Packing up your Bots and their work" }, + { stage: "upload", label: "Sending to OpenBot Cloud" }, + { stage: "import", label: "Adding them to OpenBot Cloud" }, + { stage: "verify", label: "Checking everything arrived" }, + { stage: "remove", label: "Removing OpenBot from this computer" }, +]; + +/** What moves, said the same way on every screen. */ +export const WHAT_MOVES = + "Your Bots, conversations, memory, skills, routines and files"; + +/** The promise every screen before the end keeps. */ +export const NOTHING_REMOVED_UNTIL_CHECKED = + "Nothing is removed from this computer until everything has arrived in OpenBot Cloud and been checked."; + +/** Said when a move stopped: the one thing the person needs to know first. */ +export const NOTHING_WAS_REMOVED = "Nothing was removed from this computer."; + +/** The words for each kind the preview counts, in the order they are listed. */ +const KINDS: readonly { + kind: string; + one: string; + many: string; + icon: Icon; +}[] = [ + { kind: "bots", one: "Bot", many: "Bots", icon: IconRobot }, + { kind: "skills", one: "skill", many: "skills", icon: IconBook }, + { + kind: "conversations", + one: "conversation", + many: "conversations", + icon: IconMessages, + }, + { kind: "messages", one: "message", many: "messages", icon: IconMessage }, + { kind: "memories", one: "memory", many: "memories", icon: IconBrain }, + { kind: "routines", one: "routine", many: "routines", icon: IconClock }, + { kind: "goals", one: "goal", many: "goals", icon: IconTarget }, + { kind: "check-ins", one: "check-in", many: "check-ins", icon: IconBell }, + { kind: "files", one: "file", many: "files", icon: IconFiles }, +]; + +/** + * The preview's counts as a person reads them: "3 Bots", "2,814 messages". Only the kinds there are + * words for, in their order, and none that is zero. A kind a later OpenBot adds is left out until + * this list names it, and settings and AI keys are never a count. + */ +export function countLines( + counts: MovePreview["counts"], +): { kind: string; said: string; icon: Icon }[] { + return KINDS.flatMap(({ kind, one, many, icon }) => { + const count = counts + .filter((each) => each.kind === kind) + .reduce((sum, each) => sum + each.count, 0); + if (count <= 0) return []; + return [ + { + kind, + said: `${count.toLocaleString("en-US")} ${count === 1 ? one : many}`, + icon, + }, + ]; + }); +} + +/** Disk space as a person reads it: "18.4 GB", or "640 MB" under a gigabyte. */ +export function formatSpace(bytes: number): string { + if (bytes >= 1e9) return `${(bytes / 1e9).toFixed(1)} GB`; + return `${Math.max(1, Math.round(bytes / 1e6))} MB`; +} + +/** "Inbox helper", "Inbox helper and Standup", "Inbox helper, Standup and 2 more". */ +function namesSaid(names: string[]): string { + if (names.length <= 2) return names.join(" and "); + if (names.length === 3) return `${names[0]}, ${names[1]} and ${names[2]}`; + return `${names[0]}, ${names[1]} and ${names.length - 2} more`; +} + +/** The setup window asks this once per page, at its first handover. An older shell: never due. */ +export function askMoveOffer(cloud: boolean): Promise { + return invoke("move_offer", { cloud }).catch(() => null); +} + +/** Whether the offer means the move's screens show before OpenBot does. */ +export function moveOffered(offer: MoveOffer | null): offer is MoveOffer { + return Boolean(offer && (offer.due || offer.fromSettings)); +} + +type StageState = "pending" | "running" | "done" | "failed"; +type Stages = Record; + +function freshStages(): Stages { + return Object.fromEntries( + MOVE_STAGES.map(({ stage }) => [stage, { state: "pending" }]), + ) as Stages; +} + +/** One event applied: a stage that runs or is done means every stage before it is done. */ +function advance(stages: Stages, event: MoveProgress): Stages { + const at = MOVE_STAGES.findIndex(({ stage }) => stage === event.stage); + if (at === -1) return stages; + const next = { ...stages }; + MOVE_STAGES.forEach(({ stage }, index) => { + if (index < at) next[stage] = { state: "done" }; + }); + next[event.stage] = + event.state === "done" + ? { state: "done" } + : { state: "running", progress: event.progress }; + return next; +} + +/** Where a failed move stopped: the stage running then, or the first one not done. */ +function stopped(stages: Stages): Stages { + const running = MOVE_STAGES.find( + ({ stage }) => stages[stage].state === "running", + ); + const first = + running ?? + MOVE_STAGES.find(({ stage }) => stages[stage].state === "pending"); + if (!first) return stages; + return { ...stages, [first.stage]: { state: "failed" } }; +} + +function stageRows(stages: Stages): Progress[] { + return MOVE_STAGES.map(({ stage, label }) => { + const { state, progress } = stages[stage]; + const share = + state === "running" && progress != null + ? Math.round(Math.min(1, Math.max(0, progress)) * 100) + : null; + return { + step: label, + ok: state !== "failed", + running: state === "running", + pending: state === "pending", + detail: + stage === "sign-in" && state === "running" + ? "Finish signing in in your browser." + : share !== null + ? stage === "upload" + ? `${share}% sent.` + : `${share}% packed.` + : "", + }; + }); +} + +type Screen = + | { at: "choice" } + | { at: "confirm" } + | { at: "moving" } + | { at: "failed"; problem: Problem } + | { at: "done"; moved: Moved }; + +/** + * The move to OpenBot Cloud, in the setup window, for a person who runs OpenBot (Self-Contained): + * offered once after an update, or opened from Settings. + * + * 1. The choice: OpenBot Cloud, recommended and picked to begin with, or keep everything here. With + * the space the move frees. Keep is recorded and never asked again (`onKeep`). + * 2. What moves, from the OpenBot running here (`move_preview`), and the app connections that can't + * move, by name, to reconnect in OpenBot Cloud. Settings opens here. + * 3. The move (`move_to_cloud`): sign in through the browser, pack up, send, add, check, and only + * then remove OpenBot from this computer, each a row (`move:progress`). + * 4. A move that stopped removed nothing: the sentence, Try again, or keep OpenBot here. + * 5. Done: the space freed, the apps to reconnect, each opening OpenBot Cloud's connections in this + * window (`open_moved_cloud`), and Open OpenBot. + */ +export function MoveToCloud({ + offer, + onKeep, +}: { + offer: MoveOffer; + /** Keep OpenBot here: recorded, then OpenBot shows. */ + onKeep: () => Promise; +}) { + const [screen, setScreen] = useState( + offer.fromSettings ? { at: "confirm" } : { at: "choice" }, + ); + const [keeping, setKeeping] = useState(false); + const alive = useRef(true); + useEffect(() => { + alive.current = true; + return () => { + alive.current = false; + }; + }, []); + const keep = async () => { + setKeeping(true); + try { + await invoke("keep_self_contained").catch((error) => + console.warn("keep_self_contained", error), + ); + await onKeep(); + } finally { + if (alive.current) setKeeping(false); + } + }; + + // What moves: asked of the OpenBot running here once the confirm screen shows. + const [preview, setPreview] = useState(null); + const [previewProblem, setPreviewProblem] = useState(null); + const loadPreview = useCallback(() => { + setPreviewProblem(null); + invoke("move_preview") + .then((found) => { + if (alive.current) setPreview(found); + }) + .catch((error) => { + if (alive.current) setPreviewProblem(asProblem(error)); + }); + }, []); + const wantsPreview = screen.at !== "choice" && preview === null; + const asked = useRef(false); + useEffect(() => { + if (!wantsPreview || asked.current) return; + asked.current = true; + loadPreview(); + }, [wantsPreview, loadPreview]); + const [includeKeys, setIncludeKeys] = useState(true); + + const [stages, setStages] = useState(freshStages); + const cancelled = useRef(false); + const [cancelling, setCancelling] = useState(false); + const move = async () => { + cancelled.current = false; + setCancelling(false); + setStages(freshStages()); + setScreen({ at: "moving" }); + const stop = await listen("move:progress", (event) => { + if (alive.current) setStages((now) => advance(now, event.payload)); + }).catch(() => null); + try { + const moved = await invoke("move_to_cloud", { + address: cloudAddress(), + includeModelKeys: Boolean(preview?.modelKeysAvailable && includeKeys), + }); + if (alive.current) setScreen({ at: "done", moved }); + } catch (error) { + if (!alive.current) return; + const problem = asProblem(error); + // Cancelled in the browser's wait: back to what moves, with nothing to say. + if (cancelled.current && problem.kind === "sign-in") { + setScreen({ at: "confirm" }); + return; + } + setStages((now) => stopped(now)); + setScreen({ at: "failed", problem }); + } finally { + stop?.(); + } + }; + const cancel = () => { + cancelled.current = true; + setCancelling(true); + invoke("cancel_move").catch((error) => console.warn("cancel_move", error)); + }; + + if (screen.at === "choice") + return ( + setScreen({ at: "confirm" })} + onKeep={() => void keep()} + /> + ); + if (screen.at === "confirm") + return ( + void move()} + onKeep={() => void keep()} + /> + ); + if (screen.at === "moving") { + const signingIn = stages["sign-in"].state === "running"; + return ( + +

Moving to OpenBot Cloud

+

+ Keep OpenBot open while it moves. This can take a few minutes. +

+ + {signingIn && ( +
+ +
+ )} +

{NOTHING_REMOVED_UNTIL_CHECKED}

+
+ ); + } + if (screen.at === "failed") { + const { problem } = screen; + return ( + +

+ {problem.kind === "sign-in" + ? "Signing in didn't finish" + : problem.kind === "move-mismatch" + ? "Not everything arrived" + : "The move didn't finish"} +

+

{problem.said}

+
+

{NOTHING_WAS_REMOVED}

+

+ Your Bots and their work are on this computer, just as they were. + You can try again, or keep using OpenBot here. +

+
+ + {problem.detail && ( +
+ Technical details +
{problem.detail}
+
+ )} +
+ + +
+
+ ); + } + return ; +} + +/** The card every move screen is drawn in, under OpenBot's mark, as the first screen is. */ +function Sheet({ children }: { children: ReactNode }) { + return ( +
+
+ + {children} +
+ ); +} + +function Mark({ icon: Glyph }: { icon: Icon }) { + return ( + + ); +} + +function Choice({ + footprintBytes, + keeping, + onCloud, + onKeep, +}: { + footprintBytes: number | null; + keeping: boolean; + onCloud: () => void; + onKeep: () => void; +}) { + const [picked, setPicked] = useState<"cloud" | "keep">("cloud"); + const rowClass = (chosen: boolean) => (chosen ? "tile chosen" : "tile"); + return ( + +

Move to OpenBot Cloud?

+

+ Choose where OpenBot runs from now on. If you keep it here, you can + still move later in Settings. +

+
+ Where OpenBot runs + + +
+
+ {picked === "cloud" ? ( + + ) : ( + + )} +
+ {keeping ? ( + Opening OpenBot… + ) : ( +

{NOTHING_REMOVED_UNTIL_CHECKED}

+ )} +
+ ); +} + +function Confirm({ + preview, + problem, + footprintBytes, + includeKeys, + onIncludeKeys, + keeping, + onRetryPreview, + onMove, + onKeep, +}: { + preview: MovePreview | null; + problem: Problem | null; + footprintBytes: number | null; + includeKeys: boolean; + onIncludeKeys: (include: boolean) => void; + keeping: boolean; + onRetryPreview: () => void; + onMove: () => void; + onKeep: () => void; +}) { + const lines = preview ? countLines(preview.counts) : []; + return ( + +

Move to OpenBot Cloud

+

+ {lines.length > 0 + ? "Here's what moves to your OpenBot Cloud account." + : `${WHAT_MOVES} move to your OpenBot Cloud account.`} +

+ {problem ? ( +
+

{problem.said}

+
+ +
+
+ ) : !preview ? ( + Looking at what's on this computer… + ) : ( + <> + {lines.length > 0 && ( +
    + {lines.map((line) => ( +
  • +
  • + ))} +
+ )} + {preview.apps.length > 0 && ( +
+

+ You'll reconnect these apps in OpenBot Cloud +

+

+ Your app connections are private, so they can't move safely. +

+ +
+ )} + {preview.modelKeysAvailable ? ( + + ) : ( +

+ You'll connect your AI in OpenBot Cloud after the move. +

+ )} + + )} + +
+ + +
+ {keeping ? ( + Opening OpenBot… + ) : ( +

+ {footprintBytes != null && + `Frees about ${formatSpace(footprintBytes)}. `} + {NOTHING_REMOVED_UNTIL_CHECKED} +

+ )} +
+
+ ); +} + +/** The app connections to reconnect, by name, with an action on each row when there is one. */ +function AppList({ + apps, + action, +}: { + apps: ReconnectApp[]; + action?: (app: ReconnectApp) => ReactNode; +}) { + return ( +
    + {apps.map((app) => ( +
  • + + + + {app.appName} + {app.accountLabel && ( + , {app.accountLabel} + )} + + {app.botNames && app.botNames.length > 0 && ( + + Used by {namesSaid(app.botNames)} + + )} + + {action?.(app)} +
  • + ))} +
+ ); +} + +/** The app's own icon when there is one that loads, else a plain plug on the same tile. */ +function AppMark({ app }: { app: ReconnectApp }) { + const [broken, setBroken] = useState(false); + return ( + + ); +} + +function Done({ moved }: { moved: Moved }) { + const [opening, setOpening] = useState(null); + const [problem, setProblem] = useState(null); + const open = async (path: string) => { + setOpening(path); + setProblem(null); + try { + await invoke("open_moved_cloud", { path }); + } catch (error) { + setProblem(asProblem(error)); + setOpening(null); + } + }; + const notices = [...moved.notes, ...moved.leftBehind]; + return ( + +

You're on OpenBot Cloud

+

+ {WHAT_MOVES} are in your OpenBot Cloud account now. +

+ {moved.freedBytes != null && moved.freedBytes > 0 && ( +

+

+ )} + {moved.apps.length > 0 && ( +
+

Reconnect your apps in OpenBot Cloud

+

Your app connections are private, so they didn't move.

+ ( + + )} + /> +
+ )} + {notices.length > 0 && ( +
+ {notices.map((said) => ( +

{said}

+ ))} +
+ )} + {problem && ( +
+

{problem.said}

+
+ )} + +
+ +
+ {opening !== null && Opening OpenBot Cloud…} +
+
+ ); +} diff --git a/desktop/src/SetupProgress.tsx b/desktop/src/SetupProgress.tsx index fe3f76e390..fe8c866938 100644 --- a/desktop/src/SetupProgress.tsx +++ b/desktop/src/SetupProgress.tsx @@ -67,6 +67,11 @@ export type Progress = { position?: { at: number; of: number }; /** The step waits on the person, not on work: no spinner, and its status says so. */ waiting?: boolean; + /** + * The step hasn't started and comes later in a list shown whole from the start (the move to + * OpenBot Cloud): an empty mark, its name in the quieter ink, and no status. + */ + pending?: boolean; /** * The step holds until there is room on the disk (`early_downloads::wait_for_room`): no spinner * and no time running on, and its status says "Paused". @@ -333,6 +338,23 @@ function SetupProgressRow({ }: { step: Progress; showElapsed: boolean; +}) { + if (step.pending) + return ( +
  • +
  • + ); + return ; +} + +function StartedRow({ + step, + showElapsed, +}: { + step: Progress; + showElapsed: boolean; }) { const waiting = step.waiting ?? false; const paused = !waiting && (step.paused ?? false); diff --git a/desktop/src/setupLayout.browser.test.ts b/desktop/src/setupLayout.browser.test.ts index 80f81f95a5..fd635e0c66 100644 --- a/desktop/src/setupLayout.browser.test.ts +++ b/desktop/src/setupLayout.browser.test.ts @@ -110,8 +110,59 @@ const runningFails = location.hash === "#local-running-fails"; const offered = location.search === "?offer"; // A build that never updates itself (internal, candidate, or without the updater). const internal = location.search === "?internal"; +// The move to OpenBot Cloud, offered over an OpenBot (Self-Contained) found running: \`#move-choice\` +// after an update, and the rest from Settings, at the screen each names (see \`moveAnswer\`). +const move = location.hash.startsWith("#move-") ? location.hash.slice(6) : null; // Found running by the launch is a relaunch too: an installation set up and started before. -const relaunch = location.hash === "#start" || updateShort || backEndShort || localTooOld || runningTooOld || launcherAhead; +const relaunch = location.hash === "#start" || updateShort || backEndShort || localTooOld || runningTooOld || launcherAhead || Boolean(move); +const MOVE_APPS = [ + { appId: "gmail", appName: "Gmail", accountLabel: "sam@example.com", botNames: ["Inbox helper", "Standup"] }, + { appId: "slack", appName: "Slack", accountLabel: "Northwind" }, + { appId: "google-drive", appName: "Google Drive" }, +]; +const MORE_APPS = [ + ...MOVE_APPS, + { appId: "notion", appName: "Notion" }, + { appId: "github", appName: "GitHub", accountLabel: "sam-codes" }, + { appId: "linear", appName: "Linear" }, + { appId: "google-calendar", appName: "Google Calendar", accountLabel: "sam@example.com" }, + { appId: "hubspot", appName: "HubSpot" }, +]; +const MOVE_PREVIEW = { + counts: [ + { kind: "bots", count: 3 }, { kind: "skills", count: 9 }, { kind: "conversations", count: 37 }, + { kind: "messages", count: 2814 }, { kind: "memories", count: 52 }, { kind: "routines", count: 3 }, + { kind: "goals", count: 1 }, { kind: "check-ins", count: 2 }, { kind: "files", count: 64 }, + { kind: "settings", count: 1 }, + ], + apps: move === "confirm-many" ? MORE_APPS : MOVE_APPS, + footprintBytes: 18_400_000_000, + modelKeysAvailable: true, +}; +function moveAnswer(command) { + if (command === "move_offer") + return { due: true, fromSettings: move !== "choice", footprintBytes: 18_400_000_000 }; + if (command === "move_preview") + return move === "confirm-loading" ? new Promise(() => {}) : MOVE_PREVIEW; + if (command !== "move_to_cloud") return undefined; + const progress = (stage, state, share) => emit("move:progress", { stage, state, progress: share }); + if (move === "signin") { + progress("sign-in", "running"); + return new Promise(() => {}); + } + progress("sign-in", "done"); + progress("export", "done"); + progress("upload", "running", 0.42); + if (move === "midway") return new Promise(() => {}); + if (move === "failed") + throw { said: "OpenBot couldn't send your Bots to OpenBot Cloud. Check your internet connection, then try again.", kind: "move-failed" }; + return { + freedBytes: 18_400_000_000, + apps: MOVE_APPS, + notes: move === "done" ? ["Research runs on an ordinary computer here, because OpenBot Cloud has no isolated computers."] : [], + leftBehind: move === "done-left" ? ["Some of OpenBot's software is still on this computer. Restart your computer to finish removing it."] : [], + }; +} const signingIn = location.hash === "#signin"; const installing = location.hash === "#licence-installing"; const pausing = location.hash === "#pause-podman"; @@ -150,7 +201,11 @@ export async function invoke(command, args) { if (connectedProblem && command === "connection") return { mode: "connected", address: "https://openbot.example.com", signedIn: true }; if (connectedProblem && command === "show_connected") throw connectedProblem; - if ((runningTooOld || runningFails) && command === "already_running") return true; + if ((runningTooOld || runningFails || move) && command === "already_running") return true; + if (move) { + const answer = moveAnswer(command); + if (answer !== undefined) return answer; + } if (runningFails && command === "show_openbot") throw { said: "Part of OpenBot needs recovery. Try starting OpenBot once more." }; if (localSecurity && command === "show_openbot") @@ -2947,3 +3002,97 @@ describe.skipIf(!asked)( } }, ); + +/* + * The move to OpenBot Cloud, each of its screens at the window's size less a title bar (1000x760), + * in the first screen's card: every common case fits with nothing scrolled inside the card, and the + * page never scrolls either way. Only a long list of apps to reconnect scrolls, inside the card, + * with Move still in view. `OPENBOT_APP_SHOTS=` keeps a screenshot of each, light and dark, + * taken before anything is asserted. + */ +describe.skipIf(!asked)( + "the move to OpenBot Cloud at the window's size", + () => { + const shots = process.env.OPENBOT_APP_SHOTS; + const engine = process.env.OPENBOT_APP_ENGINE ?? "chromium"; + const SCREENS: { + hash: string; + heading: string; + /** Pressed on the confirm screen, once what moves has loaded. */ + move?: boolean; + scrolls?: boolean; + }[] = [ + { hash: "#move-choice", heading: "Move to OpenBot Cloud?" }, + { hash: "#move-confirm", heading: "Move to OpenBot Cloud" }, + { hash: "#move-confirm-loading", heading: "Move to OpenBot Cloud" }, + { + hash: "#move-confirm-many", + heading: "Move to OpenBot Cloud", + scrolls: true, + }, + { hash: "#move-signin", heading: "Moving to OpenBot Cloud", move: true }, + { hash: "#move-midway", heading: "Moving to OpenBot Cloud", move: true }, + { hash: "#move-failed", heading: "The move didn't finish", move: true }, + { hash: "#move-done", heading: "You're on OpenBot Cloud", move: true }, + { + hash: "#move-done-left", + heading: "You're on OpenBot Cloud", + move: true, + }, + ]; + for (const colorScheme of ["light", "dark"] as const) { + for (const screen of SCREENS) { + test(`${screen.hash.slice(1)} fits the window (${colorScheme})`, async () => { + const page = await browser.newPage({ + viewport: { width: 1000, height: 760 }, + colorScheme, + }); + try { + await open(page, screen.hash, cloudBuilt); + if (screen.move) { + await page.getByRole("list", { name: "What moves" }).waitFor(); + await page + .getByRole("button", { name: "Move to OpenBot Cloud" }) + .click(); + } + await page + .getByRole("heading", { name: screen.heading, exact: true }) + .waitFor(); + if (screen.hash === "#move-confirm") + await page.getByRole("list", { name: "What moves" }).waitFor(); + // The card's entrance over, and the pointer off whatever it pressed. + await page.mouse.move(0, 0); + await page.waitForTimeout(600); + if (shots) + await page.screenshot({ + path: `${shots}/${screen.hash.slice(1)}-${colorScheme}-${engine}.png`, + }); + const fit = await page.evaluate(() => { + const sheet = document.querySelector("main > .sheet"); + const move = [...document.querySelectorAll("button")].find( + (button) => button.textContent === "Move to OpenBot Cloud", + ); + const bottom = move?.getBoundingClientRect().bottom ?? 0; + return { + cardScrolls: sheet + ? sheet.scrollHeight > sheet.clientHeight + 1 + : true, + pageScrolls: + document.documentElement.scrollHeight > window.innerHeight || + document.documentElement.scrollWidth > window.innerWidth, + moveInView: !move || bottom <= window.innerHeight, + }; + }); + expect(fit).toEqual({ + cardScrolls: screen.scrolls === true, + pageScrolls: false, + moveInView: true, + }); + } finally { + await page.close(); + } + }, 30_000); + } + } + }, +); diff --git a/desktop/src/styles.css b/desktop/src/styles.css index 952b5c5b1d..ae7602f5de 100644 --- a/desktop/src/styles.css +++ b/desktop/src/styles.css @@ -2567,3 +2567,254 @@ main > .sheet > .step-footer > .row:first-child:empty:has(+ .behind-slot) { .usage-choice .usage-choice-failed { grid-column: 2; } + +/* + * The move to OpenBot Cloud (`MoveToCloud`): the first screen's card, mark, rows and buttons, with + * what moves, the apps to reconnect and the move's rows in the shapes the other steps draw. + */ + +/* A row not started yet, in a list shown whole: an empty ring, its name quieter, no badge. */ +.step.pending .step-label { + color: var(--text-secondary); + font-weight: 400; +} + +.step .mark.pending { + width: 14px; + height: 14px; + margin: 0 1px; + border: 1.5px solid + color-mix(in srgb, var(--muted-foreground) 45%, transparent); + border-radius: 50%; +} + +/* "Recommended" beside OpenBot Cloud's name: the app's badge, in the chosen row's ring tint. */ +.move-badge { + display: inline-block; + margin-left: 6px; + padding: 1px 8px; + border-radius: var(--r-full); + background: color-mix(in srgb, var(--ring) 14%, var(--card)); + color: color-mix(in srgb, var(--ring) 70%, var(--text-primary)); + font-size: var(--text-xs); + line-height: 18px; + font-weight: 500; + vertical-align: 1px; +} + +/* What moves, counted: one bordered group, as the rows are, three to a line. */ +.move-counts { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 6px 12px; + margin: 0; + padding: 12px 16px; + list-style: none; + border: 1px solid var(--border); + border-radius: var(--r-card); + background: var(--card); + font-size: var(--text-sm); + line-height: 20px; + font-weight: 500; + font-variant-numeric: tabular-nums; +} + +.move-counts li { + display: flex; + align-items: center; + gap: 8px; + min-width: 0; + white-space: nowrap; +} + +.move-counts svg { + width: 16px; + height: 16px; + flex: none; + color: var(--text-secondary); +} + +/* The apps that can't move: the card that waits on the person, with the apps listed in it. */ +.move-apps { + margin: 10px 0 0; + padding: 0; + list-style: none; + display: flex; + flex-direction: column; + gap: 4px; +} + +.move-app { + display: flex; + align-items: center; + gap: 10px; + min-height: 30px; +} + +.move-app-mark { + width: 26px; + height: 26px; + flex: none; + display: flex; + align-items: center; + justify-content: center; + padding: 5px; + border: 1px solid var(--border); + border-radius: var(--radius-sm); + background: var(--mark-ground); + color: var(--mark-ink); +} + +.move-app-mark img, +.move-app-mark svg { + width: 100%; + height: 100%; +} + +.move-app-text { + display: flex; + flex-direction: column; + min-width: 0; + flex: 1; +} + +.local-alert .move-app-name { + color: var(--text-primary); + font-size: var(--text-sm); + line-height: 20px; + font-weight: 500; + overflow-wrap: anywhere; +} + +.move-app-account, +.move-app-bots { + color: var(--text-secondary); + font-weight: 400; +} + +.move-app-bots { + font-size: var(--text-xs); + line-height: 16px; +} + +/* A row's own action, in the app's small outline button. */ +button.move-app-action { + flex: none; + min-height: 30px; + padding: 0 12px; + border-radius: var(--r-item); +} + +/* Bringing the AI key: the app's checkbox beside a name and a line. */ +.move-key { + display: grid; + grid-template-columns: auto 1fr; + column-gap: 10px; + align-items: start; + cursor: pointer; +} + +.move-key input[type="checkbox"] { + width: 15px; + height: 15px; + margin: 2px 0 0; + accent-color: var(--primary); + cursor: pointer; +} + +.move-key > span { + display: flex; + flex-direction: column; +} + +.move-key-name { + font-size: var(--text-sm); + line-height: 20px; + font-weight: 500; +} + +.move-key-said { + font-size: var(--text-sm); + line-height: 20px; + color: var(--text-secondary); +} + +p.move-key-none { + margin: 0; +} + +/* Under the buttons, with the room the row's own gap gives: the first screen's footnote. */ +.move-sheet .step-footer .footnote { + margin-top: 12px; +} + +.move-sheet .step-footer .status-line { + margin-top: 12px; +} + +.move-detail { + margin-top: 16px; +} + +/* The space the move freed: one line in the success colour's mark. */ +.move-freed { + display: flex; + align-items: center; + gap: 8px; + margin: 0; + font-size: var(--text-base); + line-height: 22px; + color: var(--text-secondary); +} + +.move-freed svg { + width: 20px; + height: 20px; + flex: none; + color: var(--good); +} + +.move-freed strong { + color: var(--text-primary); + font-weight: 600; +} + +/* What OpenBot Cloud said about the move, calmly: the muted fill, no alarm. */ +.move-notice { + padding: 12px 16px; + border-radius: var(--r-card); + background: var(--muted); +} + +.move-notice p { + margin: 0; + font-size: var(--text-sm); + line-height: 20px; + color: var(--text-secondary); +} + +.move-notice p + p { + margin-top: 6px; +} + +/* + * The blocks under a move screen's lede, each apart from the one above it by the same 12px, and + * the last one's foot left to the buttons' own gap. Last, so they outrank each block's own rule. + */ +.move-sheet > .move-apps-notice, +.move-sheet > .move-key, +.move-sheet > .move-key-none, +.move-sheet > .move-notice, +.move-sheet > .local-alert { + margin: 12px 0 0; +} + +/* Right under the lede, its own gap is the one above. */ +.move-sheet > .lede + * { + margin-top: 0; +} + +/* A move that stopped: the reassurance first, then where it stopped. */ +.move-sheet > .move-safe { + margin: 0 0 16px; +} From 0e6063bd6d03e2daa74f07f5a3ec4504bcf0832d Mon Sep 17 00:00:00 2001 From: David McKay Date: Sat, 21 Nov 2026 16:00:21 -0800 Subject: [PATCH 07/16] CI: run Settings' Move to OpenBot Cloud row in Chromium and WebKit --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac8a8b4875..c070b964d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -385,6 +385,7 @@ jobs: # next language the recognizer has, or says which language to add and where. The page's # language and its names for languages are the engine's own. And the sidebar's edge, dragged in a # window zoomed in, narrowing the sidebar, which never takes more than two-fifths of the window. + # And Settings' Move to OpenBot Cloud row and its dialog, in both engines. # In the image, as above: WebKit's # system packages are about 94 MB, which took nine minutes from the mirror on a slow day. app-browser-webkit: @@ -409,7 +410,7 @@ jobs: --volume "$(command -v bun):/usr/local/bin/bun:ro" \ --env OPENBOT_APP_BROWSER=1 --env OPENBOT_APP_ENGINES=chromium,webkit \ "$PLAYWRIGHT_IMAGE" \ - bun test app/tests/composer-dictation-language.test.tsx app/tests/sidebar-zoom-drag.test.tsx + bun test app/tests/composer-dictation-language.test.tsx app/tests/sidebar-zoom-drag.test.tsx app/tests/move-to-cloud-settings.test.tsx # The desktop setup window's, for the same reason as the list above: the AI step's form holding # still while the install behind it comes and goes. It bundles the window from the desktop's own From 3352d90d5177ffc1d53ebbb9a3d985301ee4fc8a Mon Sep 17 00:00:00 2001 From: David McKay Date: Sat, 21 Nov 2026 16:03:21 -0800 Subject: [PATCH 08/16] API: examples for every move answer, so the browser's mock handlers need no fake data The part download's bytes can't be an example, so the app's Orval config gives that one operation an empty mock. Without these the generated handlers imported @faker-js/faker, which the app doesn't depend on. --- api/openapi.yaml | 85 ++++ api/openapi/moves.yaml | 69 +++ app/orval.config.ts | 4 + .../moving-to-openbot-cloud.msw.ts | 431 +++--------------- 4 files changed, 228 insertions(+), 361 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index 13c90d6bdd..c7433089f1 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -21170,6 +21170,9 @@ paths: application/json: schema: $ref: '#/components/schemas/ImportPage' + examples: + page: + $ref: '#/components/examples/ImportPageExample' '400': $ref: '#/components/responses/InvalidRequest' '401': @@ -21253,6 +21256,9 @@ paths: application/json: schema: $ref: '#/components/schemas/Import' + examples: + receiving: + $ref: '#/components/examples/ImportReceivingExample' '400': $ref: '#/components/responses/InvalidRequest' '401': @@ -21301,6 +21307,9 @@ paths: application/json: schema: $ref: '#/components/schemas/Import' + examples: + importing: + $ref: '#/components/examples/ImportImportingExample' '401': $ref: '#/components/responses/Unauthenticated' '404': @@ -49047,6 +49056,23 @@ components: appName: Gmail accountLabel: sam@example.com includesModelKeys: true + ImportPageExample: + value: + items: + - id: imp_0e1f2a3b4c5d6f1d + status: waiting-for-bundle + sourceName: Sam's MacBook + createdAt: '2026-11-21T10:00:00Z' + recipientKey: + kty: RSA + alg: RSA-OAEP-256 + kid: imp_0e1f2a3b4c5d6f1d + e: AQAB + 'n': 0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw + maxBundleBytes: 10737418240 + maxPartBytes: 33554432 + receivedParts: [] + nextCursor: null ImportWaitingExample: value: id: imp_0e1f2a3b4c5d6f1d @@ -49111,6 +49137,65 @@ components: - appId: gmail appName: Gmail accountLabel: sam@example.com + ImportReceivingExample: + value: + id: imp_0e1f2a3b4c5d6f1d + status: receiving + createdAt: '2026-11-21T10:00:00Z' + recipientKey: + kty: RSA + alg: RSA-OAEP-256 + kid: imp_0e1f2a3b4c5d6f1d + e: AQAB + 'n': 0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw + maxBundleBytes: 10737418240 + maxPartBytes: 33554432 + expectedParts: + - number: 1 + bytes: 2048 + sha256: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 + - number: 2 + bytes: 8388608 + sha256: 60303ae22b998861bce3b28f33eec1be758a213c86c93c076dbe9f558c11c752 + receivedParts: + - 1 + expected: + - kind: bots + count: 4 + - kind: conversations + count: 37 + - kind: messages + count: 2814 + reconnect: + - appId: gmail + appName: Gmail + accountLabel: sam@example.com + ImportImportingExample: + value: + id: imp_0e1f2a3b4c5d6f1d + status: importing + createdAt: '2026-11-21T10:00:00Z' + recipientKey: + kty: RSA + alg: RSA-OAEP-256 + kid: imp_0e1f2a3b4c5d6f1d + e: AQAB + 'n': 0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw + maxBundleBytes: 10737418240 + maxPartBytes: 33554432 + receivedParts: + - 1 + - 2 + expected: + - kind: bots + count: 4 + - kind: conversations + count: 37 + imported: + - kind: bots + count: 4 + - kind: conversations + count: 12 ImportVerificationExample: value: importId: imp_0e1f2a3b4c5d6f1d diff --git a/api/openapi/moves.yaml b/api/openapi/moves.yaml index 2febaebc9e..ff0d9c6ebe 100644 --- a/api/openapi/moves.yaml +++ b/api/openapi/moves.yaml @@ -357,6 +357,9 @@ paths: application/json: schema: $ref: '#/components/schemas/ImportPage' + examples: + page: + $ref: '#/components/examples/ImportPageExample' '400': $ref: './common.yaml#/components/responses/InvalidRequest' '401': @@ -451,6 +454,9 @@ paths: application/json: schema: $ref: '#/components/schemas/Import' + examples: + receiving: + $ref: '#/components/examples/ImportReceivingExample' '400': $ref: './common.yaml#/components/responses/InvalidRequest' '401': @@ -513,6 +519,9 @@ paths: application/json: schema: $ref: '#/components/schemas/Import' + examples: + importing: + $ref: '#/components/examples/ImportImportingExample' '401': $ref: './common.yaml#/components/responses/Unauthenticated' '404': @@ -1236,6 +1245,66 @@ components: maxBundleBytes: 10737418240 maxPartBytes: 33554432 receivedParts: [] + ImportReceivingExample: + value: + id: imp_0e1f2a3b4c5d6f1d + status: receiving + createdAt: '2026-11-21T10:00:00Z' + recipientKey: + kty: RSA + alg: RSA-OAEP-256 + kid: imp_0e1f2a3b4c5d6f1d + e: AQAB + n: 0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw + maxBundleBytes: 10737418240 + maxPartBytes: 33554432 + expectedParts: + - { number: 1, bytes: 2048, sha256: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 } + - { number: 2, bytes: 8388608, sha256: 60303ae22b998861bce3b28f33eec1be758a213c86c93c076dbe9f558c11c752 } + receivedParts: [1] + expected: + - { kind: bots, count: 4 } + - { kind: conversations, count: 37 } + - { kind: messages, count: 2814 } + reconnect: + - { appId: gmail, appName: Gmail, accountLabel: sam@example.com } + ImportImportingExample: + value: + id: imp_0e1f2a3b4c5d6f1d + status: importing + createdAt: '2026-11-21T10:00:00Z' + recipientKey: + kty: RSA + alg: RSA-OAEP-256 + kid: imp_0e1f2a3b4c5d6f1d + e: AQAB + n: 0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw + maxBundleBytes: 10737418240 + maxPartBytes: 33554432 + receivedParts: [1, 2] + expected: + - { kind: bots, count: 4 } + - { kind: conversations, count: 37 } + imported: + - { kind: bots, count: 4 } + - { kind: conversations, count: 12 } + ImportPageExample: + value: + items: + - id: imp_0e1f2a3b4c5d6f1d + status: waiting-for-bundle + sourceName: Sam's MacBook + createdAt: '2026-11-21T10:00:00Z' + recipientKey: + kty: RSA + alg: RSA-OAEP-256 + kid: imp_0e1f2a3b4c5d6f1d + e: AQAB + n: 0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw + maxBundleBytes: 10737418240 + maxPartBytes: 33554432 + receivedParts: [] + nextCursor: null ImportImportedExample: value: id: imp_0e1f2a3b4c5d6f1d diff --git a/app/orval.config.ts b/app/orval.config.ts index df4df16aee..b2f5f6b47f 100644 --- a/app/orval.config.ts +++ b/app/orval.config.ts @@ -41,6 +41,10 @@ export default defineConfig({ mutator: { path: "src/lib/api/request.ts", name: "apiRequest" }, fetch: { includeHttpResponseReturnType: false }, query: { signal: true }, + operations: { + // A part of a move's bundle is bytes, which no example in the spec can be: an empty one. + downloadExportPart: { mock: { data: new Blob([]) } }, + }, }, }, hooks: { afterAllFilesWrite: "bunx biome format --write" }, diff --git a/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.msw.ts b/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.msw.ts index 272f491cd3..79ad5d8832 100644 --- a/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.msw.ts +++ b/app/src/lib/api/generated/moving-to-openbot-cloud/moving-to-openbot-cloud.msw.ts @@ -1,8 +1,6 @@ /** * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. */ -import { faker } from "@faker-js/faker"; - import { HttpResponse, http } from "msw"; import type { HttpResponseResolver, RequestHandlerOptions } from "msw"; @@ -66,11 +64,7 @@ export const getGetExportResponseMock = (): Export => ({ progress: 0.4, }); -export const getDownloadExportPartResponseMock = (): Blob => - faker.helpers.arrayElement([ - new Blob([new Uint8Array(faker.number.int({ min: 1, max: 64 }))]), - new Blob([new Uint8Array(faker.number.int({ min: 1, max: 64 }))]), - ]); +export const getDownloadExportPartResponseMock = () => ({}); export const getCreateImportResponseMock = (): Import => ({ id: "imp_0e1f2a3b4c5d6f1d", @@ -89,133 +83,26 @@ export const getCreateImportResponseMock = (): Import => ({ receivedParts: [], }); -export const getListImportsResponseMock = ( - overrideResponse: Partial> = {}, -): ImportPage => ({ - items: Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => ({ - id: faker.string.alpha({ length: { min: 1, max: 20 } }), - status: faker.string.alpha({ length: { min: 10, max: 20 } }), - sourceName: faker.helpers.arrayElement([ - faker.string.alpha({ length: { min: 10, max: 20 } }), - undefined, - ]), - createdAt: faker.date.past().toISOString().slice(0, 19) + "Z", - finishedAt: faker.helpers.arrayElement([ - faker.date.past().toISOString().slice(0, 19) + "Z", - undefined, - ]), - recipientKey: { - kty: "RSA", - n: faker.string.alpha({ length: { min: 1, max: 1024 } }), - e: faker.string.alpha({ length: { min: 1, max: 16 } }), - alg: "RSA-OAEP-256", - kid: faker.string.alpha({ length: { min: 1, max: 128 } }), +export const getListImportsResponseMock = (): ImportPage => ({ + items: [ + { + id: "imp_0e1f2a3b4c5d6f1d", + status: "waiting-for-bundle", + sourceName: "Sam's MacBook", + createdAt: "2026-11-21T10:00:00Z", + recipientKey: { + kty: "RSA", + alg: "RSA-OAEP-256", + kid: "imp_0e1f2a3b4c5d6f1d", + e: "AQAB", + n: "0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw", + }, + maxBundleBytes: 10737418240, + maxPartBytes: 33554432, + receivedParts: [], }, - maxBundleBytes: faker.number.int({ min: 1 }), - maxPartBytes: faker.number.int({ min: 1 }), - expectedParts: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => ({ - number: faker.number.int({ min: 1 }), - bytes: faker.number.int({ min: 1 }), - sha256: faker.helpers.fromRegExp("^[0-9a-f]{64}$"), - })), - undefined, - ]), - receivedParts: Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => faker.number.int({ min: 1 })), - expected: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => ({ - kind: faker.string.alpha({ length: { min: 10, max: 20 } }), - count: faker.number.int({ min: 0 }), - bytes: faker.helpers.arrayElement([ - faker.number.int({ min: 0 }), - undefined, - ]), - })), - undefined, - ]), - imported: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => ({ - kind: faker.string.alpha({ length: { min: 10, max: 20 } }), - count: faker.number.int({ min: 0 }), - bytes: faker.helpers.arrayElement([ - faker.number.int({ min: 0 }), - undefined, - ]), - })), - undefined, - ]), - notes: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => ({ - code: faker.string.alpha({ length: { min: 10, max: 20 } }), - kind: faker.helpers.arrayElement([ - faker.string.alpha({ length: { min: 10, max: 20 } }), - undefined, - ]), - count: faker.helpers.arrayElement([ - faker.number.int({ min: 1 }), - undefined, - ]), - message: faker.string.alpha({ length: { min: 1, max: 20 } }), - items: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => faker.string.alpha({ length: { min: 10, max: 20 } })), - undefined, - ]), - })), - undefined, - ]), - reconnect: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => ({ - appId: faker.string.alpha({ length: { min: 1, max: 20 } }), - appName: faker.string.alpha({ length: { min: 1, max: 20 } }), - accountLabel: faker.helpers.arrayElement([ - faker.string.alpha({ length: { min: 1, max: 20 } }), - undefined, - ]), - iconUrl: faker.helpers.arrayElement([faker.internet.url(), undefined]), - botNames: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => faker.string.alpha({ length: { min: 10, max: 20 } })), - undefined, - ]), - })), - undefined, - ]), - error: faker.helpers.arrayElement([ - faker.string.alpha({ length: { min: 1, max: 20 } }), - undefined, - ]), - })), - nextCursor: faker.helpers.arrayElement([ - faker.string.alpha({ length: { min: 10, max: 20 } }), - null, - ]), - ...overrideResponse, + ], + nextCursor: null, }); export const getGetImportResponseMock = (): Import => ({ @@ -235,244 +122,66 @@ export const getGetImportResponseMock = (): Import => ({ receivedParts: [], }); -export const getUploadImportPartResponseMock = ( - overrideResponse: Partial> = {}, -): Import => ({ - id: faker.string.alpha({ length: { min: 1, max: 20 } }), - status: faker.string.alpha({ length: { min: 10, max: 20 } }), - sourceName: faker.helpers.arrayElement([ - faker.string.alpha({ length: { min: 10, max: 20 } }), - undefined, - ]), - createdAt: faker.date.past().toISOString().slice(0, 19) + "Z", - finishedAt: faker.helpers.arrayElement([ - faker.date.past().toISOString().slice(0, 19) + "Z", - undefined, - ]), +export const getUploadImportPartResponseMock = (): Import => ({ + id: "imp_0e1f2a3b4c5d6f1d", + status: "receiving", + createdAt: "2026-11-21T10:00:00Z", recipientKey: { kty: "RSA", - n: faker.string.alpha({ length: { min: 1, max: 1024 } }), - e: faker.string.alpha({ length: { min: 1, max: 16 } }), alg: "RSA-OAEP-256", - kid: faker.string.alpha({ length: { min: 1, max: 128 } }), + kid: "imp_0e1f2a3b4c5d6f1d", + e: "AQAB", + n: "0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw", }, - maxBundleBytes: faker.number.int({ min: 1 }), - maxPartBytes: faker.number.int({ min: 1 }), - expectedParts: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => ({ - number: faker.number.int({ min: 1 }), - bytes: faker.number.int({ min: 1 }), - sha256: faker.helpers.fromRegExp("^[0-9a-f]{64}$"), - })), - undefined, - ]), - receivedParts: Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => faker.number.int({ min: 1 })), - expected: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => ({ - kind: faker.string.alpha({ length: { min: 10, max: 20 } }), - count: faker.number.int({ min: 0 }), - bytes: faker.helpers.arrayElement([ - faker.number.int({ min: 0 }), - undefined, - ]), - })), - undefined, - ]), - imported: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => ({ - kind: faker.string.alpha({ length: { min: 10, max: 20 } }), - count: faker.number.int({ min: 0 }), - bytes: faker.helpers.arrayElement([ - faker.number.int({ min: 0 }), - undefined, - ]), - })), - undefined, - ]), - notes: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => ({ - code: faker.string.alpha({ length: { min: 10, max: 20 } }), - kind: faker.helpers.arrayElement([ - faker.string.alpha({ length: { min: 10, max: 20 } }), - undefined, - ]), - count: faker.helpers.arrayElement([ - faker.number.int({ min: 1 }), - undefined, - ]), - message: faker.string.alpha({ length: { min: 1, max: 20 } }), - items: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => faker.string.alpha({ length: { min: 10, max: 20 } })), - undefined, - ]), - })), - undefined, - ]), - reconnect: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => ({ - appId: faker.string.alpha({ length: { min: 1, max: 20 } }), - appName: faker.string.alpha({ length: { min: 1, max: 20 } }), - accountLabel: faker.helpers.arrayElement([ - faker.string.alpha({ length: { min: 1, max: 20 } }), - undefined, - ]), - iconUrl: faker.helpers.arrayElement([faker.internet.url(), undefined]), - botNames: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => faker.string.alpha({ length: { min: 10, max: 20 } })), - undefined, - ]), - })), - undefined, - ]), - error: faker.helpers.arrayElement([ - faker.string.alpha({ length: { min: 1, max: 20 } }), - undefined, - ]), - ...overrideResponse, + maxBundleBytes: 10737418240, + maxPartBytes: 33554432, + expectedParts: [ + { + number: 1, + bytes: 2048, + sha256: + "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", + }, + { + number: 2, + bytes: 8388608, + sha256: + "60303ae22b998861bce3b28f33eec1be758a213c86c93c076dbe9f558c11c752", + }, + ], + receivedParts: [1], + expected: [ + { kind: "bots", count: 4 }, + { kind: "conversations", count: 37 }, + { kind: "messages", count: 2814 }, + ], + reconnect: [ + { appId: "gmail", appName: "Gmail", accountLabel: "sam@example.com" }, + ], }); -export const getApplyImportResponseMock = ( - overrideResponse: Partial> = {}, -): Import => ({ - id: faker.string.alpha({ length: { min: 1, max: 20 } }), - status: faker.string.alpha({ length: { min: 10, max: 20 } }), - sourceName: faker.helpers.arrayElement([ - faker.string.alpha({ length: { min: 10, max: 20 } }), - undefined, - ]), - createdAt: faker.date.past().toISOString().slice(0, 19) + "Z", - finishedAt: faker.helpers.arrayElement([ - faker.date.past().toISOString().slice(0, 19) + "Z", - undefined, - ]), +export const getApplyImportResponseMock = (): Import => ({ + id: "imp_0e1f2a3b4c5d6f1d", + status: "importing", + createdAt: "2026-11-21T10:00:00Z", recipientKey: { kty: "RSA", - n: faker.string.alpha({ length: { min: 1, max: 1024 } }), - e: faker.string.alpha({ length: { min: 1, max: 16 } }), alg: "RSA-OAEP-256", - kid: faker.string.alpha({ length: { min: 1, max: 128 } }), + kid: "imp_0e1f2a3b4c5d6f1d", + e: "AQAB", + n: "0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw", }, - maxBundleBytes: faker.number.int({ min: 1 }), - maxPartBytes: faker.number.int({ min: 1 }), - expectedParts: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => ({ - number: faker.number.int({ min: 1 }), - bytes: faker.number.int({ min: 1 }), - sha256: faker.helpers.fromRegExp("^[0-9a-f]{64}$"), - })), - undefined, - ]), - receivedParts: Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => faker.number.int({ min: 1 })), - expected: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => ({ - kind: faker.string.alpha({ length: { min: 10, max: 20 } }), - count: faker.number.int({ min: 0 }), - bytes: faker.helpers.arrayElement([ - faker.number.int({ min: 0 }), - undefined, - ]), - })), - undefined, - ]), - imported: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => ({ - kind: faker.string.alpha({ length: { min: 10, max: 20 } }), - count: faker.number.int({ min: 0 }), - bytes: faker.helpers.arrayElement([ - faker.number.int({ min: 0 }), - undefined, - ]), - })), - undefined, - ]), - notes: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => ({ - code: faker.string.alpha({ length: { min: 10, max: 20 } }), - kind: faker.helpers.arrayElement([ - faker.string.alpha({ length: { min: 10, max: 20 } }), - undefined, - ]), - count: faker.helpers.arrayElement([ - faker.number.int({ min: 1 }), - undefined, - ]), - message: faker.string.alpha({ length: { min: 1, max: 20 } }), - items: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => faker.string.alpha({ length: { min: 10, max: 20 } })), - undefined, - ]), - })), - undefined, - ]), - reconnect: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => ({ - appId: faker.string.alpha({ length: { min: 1, max: 20 } }), - appName: faker.string.alpha({ length: { min: 1, max: 20 } }), - accountLabel: faker.helpers.arrayElement([ - faker.string.alpha({ length: { min: 1, max: 20 } }), - undefined, - ]), - iconUrl: faker.helpers.arrayElement([faker.internet.url(), undefined]), - botNames: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1, - ).map(() => faker.string.alpha({ length: { min: 10, max: 20 } })), - undefined, - ]), - })), - undefined, - ]), - error: faker.helpers.arrayElement([ - faker.string.alpha({ length: { min: 1, max: 20 } }), - undefined, - ]), - ...overrideResponse, + maxBundleBytes: 10737418240, + maxPartBytes: 33554432, + receivedParts: [1, 2], + expected: [ + { kind: "bots", count: 4 }, + { kind: "conversations", count: 37 }, + ], + imported: [ + { kind: "bots", count: 4 }, + { kind: "conversations", count: 12 }, + ], }); export const getGetImportVerificationResponseMock = (): ImportVerification => ({ From e7538e3bd796a5d072f35ef3e6ef9fe43591b07c Mon Sep 17 00:00:00 2001 From: David McKay Date: Sat, 21 Nov 2026 16:07:41 -0800 Subject: [PATCH 09/16] API boundary: the move's own addresses, built by hand in Rust --- api/client-boundary.allow.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/api/client-boundary.allow.ts b/api/client-boundary.allow.ts index 677c631bea..5f2a00cd4d 100644 --- a/api/client-boundary.allow.ts +++ b/api/client-boundary.allow.ts @@ -339,6 +339,18 @@ export const ALLOWED: Allowed[] = [ rule: "hand-built-v2", why: "the Recorder host's handoff, from Rust, which has no generated client", }, + { + file: "desktop/src-tauri/src/move_to_cloud.rs", + what: /^\/api\/v2\/(people\/me\/organizations|organizations\/\{\}\{path\})$/, + rule: "hand-built-v2", + why: "the move to OpenBot Cloud, from Rust, which has no generated client: the export from the OpenBot on this computer and the import into OpenBot Cloud, in the organization each answers for the person", + }, + { + file: "desktop/src-tauri/src/move_to_cloud/tests.rs", + what: /^\/api\/v2\/(people\/me\/organizations|organizations\/org_(here|mine)\/(exports|imports)(\/[a-z0-9_]+)*\/?)$/, + rule: "hand-built-v2", + why: "the move's tests, against an OpenBot here and an OpenBot Cloud that answer as the API describes", + }, { file: "desktop/src-tauri/src/install_token.rs", what: "/api/install/enter", From a7e9711d8b43747f27b89e385a094b2044390c6d Mon Sep 17 00:00:00 2001 From: David McKay Date: Sat, 21 Nov 2026 16:08:14 -0800 Subject: [PATCH 10/16] Desktop: the move's test servers match parts by their own path --- desktop/src-tauri/src/move_to_cloud/tests.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/desktop/src-tauri/src/move_to_cloud/tests.rs b/desktop/src-tauri/src/move_to_cloud/tests.rs index 72f9d667ab..fa018c3249 100644 --- a/desktop/src-tauri/src/move_to_cloud/tests.rs +++ b/desktop/src-tauri/src/move_to_cloud/tests.rs @@ -713,9 +713,7 @@ fn local_openbot(parts: Vec<(Part, Vec)>, counts: Vec) -> String { json_response(200, ready.clone()) } } - ("GET", path) - if path.starts_with("/api/v2/organizations/org_here/exports/exp_1/parts/") => - { + ("GET", path) if path.contains("/org_here/exports/exp_1/parts/") => { let number: usize = path.rsplit('/').next().unwrap().parse().unwrap(); let bytes = &parts[number - 1].1; match request.headers.get("range") { @@ -777,9 +775,7 @@ fn cloud_openbot(expected: Vec, verify: serde_json::Value) -> (String, Rec ("POST", "/api/v2/organizations/org_mine/imports") => { json_response(201, import("waiting-for-bundle")) } - ("PUT", path) - if path.starts_with("/api/v2/organizations/org_mine/imports/imp_1/parts/") => - { + ("PUT", path) if path.contains("/org_mine/imports/imp_1/parts/") => { let number: u32 = path.rsplit('/').next().unwrap().parse().unwrap(); let held = parts.lock().unwrap(); if number != 1 && !held.contains_key(&1) { From 0e97d9fb46388c8bc18f86618fcb47ed75fffbfe Mon Sep 17 00:00:00 2001 From: David McKay Date: Sat, 21 Nov 2026 16:55:39 -0800 Subject: [PATCH 11/16] Desktop: read the move from the OpenBot here in its one organization OpenBot (Self-Contained) doesn't list the caller's organizations: on a real 1.1.2 install updated to this build, /api/v2/people/me/organizations answered 404, so the move's confirm screen could never load. It has one organization, which the API names `default`, and the move now asks it there. Failures to read the OpenBot here are logged too. --- api/client-boundary.allow.ts | 2 +- desktop/src-tauri/src/desktop_move.rs | 6 ++-- desktop/src-tauri/src/move_to_cloud.rs | 35 +++++++++++--------- desktop/src-tauri/src/move_to_cloud/tests.rs | 18 ++++------ 4 files changed, 32 insertions(+), 29 deletions(-) diff --git a/api/client-boundary.allow.ts b/api/client-boundary.allow.ts index 5f2a00cd4d..41894d42c6 100644 --- a/api/client-boundary.allow.ts +++ b/api/client-boundary.allow.ts @@ -347,7 +347,7 @@ export const ALLOWED: Allowed[] = [ }, { file: "desktop/src-tauri/src/move_to_cloud/tests.rs", - what: /^\/api\/v2\/(people\/me\/organizations|organizations\/org_(here|mine)\/(exports|imports)(\/[a-z0-9_]+)*\/?)$/, + what: /^\/api\/v2\/(people\/me\/organizations|organizations\/(default|org_mine)\/(exports|imports)(\/[a-z0-9_]+)*\/?)$/, rule: "hand-built-v2", why: "the move's tests, against an OpenBot here and an OpenBot Cloud that answer as the API describes", }, diff --git a/desktop/src-tauri/src/desktop_move.rs b/desktop/src-tauri/src/desktop_move.rs index 78c7f97808..2978f07361 100644 --- a/desktop/src-tauri/src/desktop_move.rs +++ b/desktop/src-tauri/src/desktop_move.rs @@ -151,6 +151,7 @@ pub async fn move_preview( blocking(move || { let mut local = local_api(&app)?; let estimate = moving::Local::estimate(&mut local).map_err(|detail| { + log::warn!("[move] could not read what would move: {detail}"); Problem::with( "OpenBot couldn't read what's on this computer. Try again in a moment.", detail, @@ -361,12 +362,13 @@ fn local_api(app: &tauri::AppHandle) -> Result, } +/// The organization OpenBot (Self-Contained) answers for: it has one, and the API names it +/// `default`. Its server doesn't list the caller's organizations, which needs the sign-in an +/// organization-keeping OpenBot has (box A: `/api/v2/people/me/organizations` answered 404). +pub const THIS_COMPUTERS_ORGANIZATION: &str = "default"; + impl Api { - /// The API at `base`, in the organization `pick` chooses from the caller's own list. - pub fn open( + /// The API at `base`, in the organization `organization` (an id or a slug). + pub fn at( base: &str, credentials: Box, - pick: fn(&[Organization]) -> Option, + organization: &str, ) -> Result { let client = reqwest::blocking::Client::builder() .connect_timeout(Duration::from_secs(20)) @@ -611,12 +616,21 @@ impl Api { .default_headers(crate::client_version::headers()) .build() .map_err(|error| error.to_string())?; - let mut api = Api { + Ok(Api { base: base.trim_end_matches('/').to_owned(), - organization: String::new(), + organization: organization.to_owned(), credentials, client, - }; + }) + } + + /// The API at `base`, in the organization `pick` chooses from the caller's own list. + pub fn open( + base: &str, + credentials: Box, + pick: fn(&[Organization]) -> Option, + ) -> Result { + let mut api = Api::at(base, credentials, "")?; let page: OrganizationPage = api.json( reqwest::Method::GET, "/api/v2/people/me/organizations", @@ -767,15 +781,6 @@ struct OrganizationPage { organizations: Vec, } -/// Here: the organization the person works in on this computer (a personal OpenBot has one). -pub fn this_computers_organization(list: &[Organization]) -> Option { - list.iter() - .find(|organization| organization.active) - .or_else(|| list.iter().find(|organization| organization.personal)) - .or_else(|| list.first()) - .map(|organization| organization.id.clone()) -} - /// On Cloud: the person's own organization, the one Cloud made for them. pub fn their_own_organization(list: &[Organization]) -> Option { list.iter() diff --git a/desktop/src-tauri/src/move_to_cloud/tests.rs b/desktop/src-tauri/src/move_to_cloud/tests.rs index fa018c3249..5c4dda370b 100644 --- a/desktop/src-tauri/src/move_to_cloud/tests.rs +++ b/desktop/src-tauri/src/move_to_cloud/tests.rs @@ -689,20 +689,16 @@ fn local_openbot(parts: Vec<(Part, Vec)>, counts: Vec) -> String { "counts": counts.iter().map(|c| serde_json::json!({"kind": c.kind, "count": c.count})).collect::>(), "reconnect": [{"appId": "gmail", "appName": "Gmail", "accountLabel": "sam@example.com"}], }); + // OpenBot (Self-Contained) lists no organizations (box A: that address answered 404); + // its one organization is `default`. match (request.method.as_str(), request.path.as_str()) { - ("GET", "/api/v2/people/me/organizations") => json_response( - 200, - serde_json::json!({"organizations": [ - {"id": "org_here", "slug": "me", "name": "Me", "role": "owner", "active": true, "personal": true} - ], "canCreate": false, "nextCursor": null}), - ), - ("POST", "/api/v2/organizations/org_here/exports") => { + ("POST", "/api/v2/organizations/default/exports") => { assert!(request.headers.contains_key("idempotency-key")); let mut preparing = ready.clone(); preparing["status"] = "preparing".into(); json_response(202, preparing) } - ("GET", "/api/v2/organizations/org_here/exports/exp_1") => { + ("GET", "/api/v2/organizations/default/exports/exp_1") => { let mut polled = polled.lock().unwrap(); *polled += 1; if *polled == 1 { @@ -713,7 +709,7 @@ fn local_openbot(parts: Vec<(Part, Vec)>, counts: Vec) -> String { json_response(200, ready.clone()) } } - ("GET", path) if path.contains("/org_here/exports/exp_1/parts/") => { + ("GET", path) if path.contains("/default/exports/exp_1/parts/") => { let number: usize = path.rsplit('/').next().unwrap().parse().unwrap(); let bytes = &parts[number - 1].1; match request.headers.get("range") { @@ -941,10 +937,10 @@ fn real_move(verify: serde_json::Value) -> (Result, PathBuf, Pat let local_address = local_openbot(parts.clone(), counts); let (cloud_address, received) = cloud_openbot(parts.iter().map(|(part, _)| part.clone()).collect(), verify); - let mut local = Api::open( + let mut local = Api::at( &local_address, Box::new(InstallToken(Some(TOKEN.into()))), - this_computers_organization, + THIS_COMPUTERS_ORGANIZATION, ) .unwrap(); let mut cloud = Api::open(&cloud_address, Box::new(Bearer), their_own_organization).unwrap(); From 5c083f1314ed520f6154e57d288beacc62a39e83 Mon Sep 17 00:00:00 2001 From: David McKay Date: Sat, 21 Nov 2026 17:09:22 -0800 Subject: [PATCH 12/16] Desktop: under Keep, say the move stays on offer in Settings --- desktop/src/MoveToCloud.test.tsx | 3 +++ desktop/src/MoveToCloud.tsx | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/desktop/src/MoveToCloud.test.tsx b/desktop/src/MoveToCloud.test.tsx index 74bdc38006..e0df4a168d 100644 --- a/desktop/src/MoveToCloud.test.tsx +++ b/desktop/src/MoveToCloud.test.tsx @@ -243,6 +243,9 @@ test("Keep records the answer and shows OpenBot, and the next launch never asks await userEvent.click( view.getByRole("radio", { name: /^OpenBot \(Self-Contained\)/ }), ); + // Keep picked: the note is about moving later, not about what a move removes (box B). + expect(view.queryByText(/Nothing is removed/)).toBe(null); + view.getByText("You can still move to OpenBot Cloud later in Settings."); await userEvent.click( view.getByRole("button", { name: "Keep OpenBot on this computer" }), ); diff --git a/desktop/src/MoveToCloud.tsx b/desktop/src/MoveToCloud.tsx index 5926204bce..10aeec39a1 100644 --- a/desktop/src/MoveToCloud.tsx +++ b/desktop/src/MoveToCloud.tsx @@ -105,6 +105,10 @@ export const WHAT_MOVES = export const NOTHING_REMOVED_UNTIL_CHECKED = "Nothing is removed from this computer until everything has arrived in OpenBot Cloud and been checked."; +/** Under the choice while Keep is picked: the move stays on offer. */ +export const MOVE_LATER_IN_SETTINGS = + "You can still move to OpenBot Cloud later in Settings."; + /** Said when a move stopped: the one thing the person needs to know first. */ export const NOTHING_WAS_REMOVED = "Nothing was removed from this computer."; @@ -540,7 +544,11 @@ function Choice({ {keeping ? ( Opening OpenBot… ) : ( -

    {NOTHING_REMOVED_UNTIL_CHECKED}

    +

    + {picked === "cloud" + ? NOTHING_REMOVED_UNTIL_CHECKED + : MOVE_LATER_IN_SETTINGS} +

    )} ); From c1656f27c08e5e79613ecaf63829b86bd73ea843 Mon Sep 17 00:00:00 2001 From: David McKay Date: Sat, 21 Nov 2026 17:37:48 -0800 Subject: [PATCH 13/16] Desktop: count OpenBot's machine disk on a Mac when measuring the move On a Mac, Podman 6.1's machine inspect names no disk image, only the provider through its configuration folder, so the move offered to free 168 MB of a machine holding 9 GB. The machine's own disk is now found in that provider's data folder, by its exact name, and another machine's beside it is never counted. --- desktop/src-tauri/src/desktop_move.rs | 21 ++++-- desktop/src-tauri/src/move_to_cloud.rs | 69 ++++++++++++++++++-- desktop/src-tauri/src/move_to_cloud/tests.rs | 49 +++++++++++++- 3 files changed, 124 insertions(+), 15 deletions(-) diff --git a/desktop/src-tauri/src/desktop_move.rs b/desktop/src-tauri/src/desktop_move.rs index 2978f07361..ea6dd84a3d 100644 --- a/desktop/src-tauri/src/desktop_move.rs +++ b/desktop/src-tauri/src/desktop_move.rs @@ -426,13 +426,22 @@ fn own_machine_disks() -> Vec { else { return Vec::new(); }; - let output = std::process::Command::new(podman) - .args(["machine", "inspect", openbot_desktop_lib::acquire::MACHINE]) - .output(); + let machine = openbot_desktop_lib::acquire::MACHINE; + let output = openbot_desktop_lib::quiet::output_within( + openbot_desktop_lib::quiet::command(podman).args(["machine", "inspect", machine]), + std::time::Duration::from_secs(30), + ); + // Where Podman keeps a machine's disk: its data folder, `~/.local/share` unless XDG says. + let data_home = std::env::var_os("XDG_DATA_HOME") + .map(PathBuf::from) + .filter(|path| path.is_absolute()) + .or_else(|| dirs::home_dir().map(|home| home.join(".local").join("share"))); match output { - Ok(output) if output.status.success() => { - moving::machine_disks(&String::from_utf8_lossy(&output.stdout)) - } + Ok(output) if output.status.success() => moving::machine_disks( + &String::from_utf8_lossy(&output.stdout), + machine, + data_home.as_deref(), + ), _ => Vec::new(), } } diff --git a/desktop/src-tauri/src/move_to_cloud.rs b/desktop/src-tauri/src/move_to_cloud.rs index f9d68e8877..59a3f37375 100644 --- a/desktop/src-tauri/src/move_to_cloud.rs +++ b/desktop/src-tauri/src/move_to_cloud.rs @@ -959,17 +959,26 @@ fn allocated(meta: &std::fs::Metadata) -> u64 { meta.len() } +/// What a Podman machine's disk image is called by its end. +const DISK_IMAGES: [&str; 4] = [".raw", ".vhdx", ".qcow2", ".img"]; + /** -The disk images of a Podman machine, from what `podman machine inspect` printed for it: every -existing file named under any key whose value is a path to a machine disk image (`.raw`, `.vhdx`, -`.qcow2`, `.img`, `.tar`), wherever this Podman puts it in the JSON. +The disk images of the Podman machine `machine`, from what `podman machine inspect` printed for +it: every existing file named under any key whose value is a path to a disk image, wherever a +Podman puts one in the JSON, and the machine's own images in its provider's data folder under +`data_home` (`~/.local/share` on a Mac). + +Podman 6.1 on a Mac names no disk in inspect at all: it says the provider only through +`ConfigDir` (`~/.config/containers/podman/machine/libkrun`), and keeps the disk at +`~/.local/share/containers/podman/machine/libkrun/openbot-arm64.raw`, 9 GB used of a 60 GB sparse +file on the cloud Mac. Measuring without it, the move offered to free 168 MB. */ -pub fn machine_disks(inspected: &str) -> Vec { +pub fn machine_disks(inspected: &str, machine: &str, data_home: Option<&Path>) -> Vec { fn walk(value: &serde_json::Value, found: &mut Vec) { match value { serde_json::Value::String(text) => { let lower = text.to_ascii_lowercase(); - if [".raw", ".vhdx", ".qcow2", ".img"] + if DISK_IMAGES .iter() .any(|extension| lower.ends_with(extension)) { @@ -985,8 +994,54 @@ pub fn machine_disks(inspected: &str) -> Vec { } } let mut found = Vec::new(); - if let Ok(value) = serde_json::from_str::(inspected) { - walk(&value, &mut found); + let Ok(value) = serde_json::from_str::(inspected) else { + return found; + }; + walk(&value, &mut found); + // The provider, from the machine's configuration folder, and its images in the data folder. + let entry = value + .as_array() + .and_then(|machines| { + machines + .iter() + .find(|entry| entry.get("Name").and_then(|name| name.as_str()) == Some(machine)) + }) + .unwrap_or(&value); + let provider = entry + .pointer("/ConfigDir/Path") + .and_then(|path| path.as_str()) + .and_then(|path| Path::new(path).file_name()) + .and_then(|name| name.to_str()) + .filter(|name| !name.is_empty() && *name != ".."); + if let (Some(provider), Some(data_home)) = (provider, data_home) { + let folder = data_home + .join("containers") + .join("podman") + .join("machine") + .join(provider); + if let Ok(entries) = std::fs::read_dir(&folder) { + for entry in entries.flatten() { + let name = entry.file_name().to_string_lossy().to_ascii_lowercase(); + let Some(stem) = DISK_IMAGES + .iter() + .find_map(|extension| name.strip_suffix(extension)) + else { + continue; + }; + // `openbot.raw` or `openbot-arm64.raw`; never `openbot-s1-arm64.raw`, which is + // another machine's. + let machine = machine.to_ascii_lowercase(); + let own = stem == machine + || stem + .strip_prefix(&format!("{machine}-")) + .is_some_and(|arch| { + matches!(arch, "arm64" | "aarch64" | "amd64" | "x86_64") + }); + if own && entry.file_type().is_ok_and(|kind| kind.is_file()) { + found.push(entry.path()); + } + } + } } found.sort(); found.dedup(); diff --git a/desktop/src-tauri/src/move_to_cloud/tests.rs b/desktop/src-tauri/src/move_to_cloud/tests.rs index 5c4dda370b..1f967a1b9d 100644 --- a/desktop/src-tauri/src/move_to_cloud/tests.rs +++ b/desktop/src-tauri/src/move_to_cloud/tests.rs @@ -571,11 +571,56 @@ fn a_machines_disk_is_found_in_what_inspect_prints() { "Elsewhere": [root.join("gone.raw").display().to_string()] }]) .to_string(); - assert_eq!(machine_disks(&inspected), [disk]); - assert!(machine_disks("not json").is_empty()); + assert_eq!(machine_disks(&inspected, "openbot", None), [disk]); + assert!(machine_disks("not json", "openbot", None).is_empty()); let _ = std::fs::remove_dir_all(root); } +/// The cloud Mac: Podman 6.1.1's inspect names no disk, only the provider through ConfigDir, and +/// the move offered to free 168 MB of a 9 GB machine. The machine's disk is found in that +/// provider's data folder, and another machine's beside it is not. +#[test] +fn a_macs_machine_disk_is_found_through_its_provider() { + let home = crate::test_support::temp_root("move-mac-disk"); + let data = home.join(".local/share"); + let folder = data.join("containers/podman/machine/libkrun"); + std::fs::create_dir_all(folder.join("cache")).unwrap(); + let disk = folder.join("openbot-arm64.raw"); + std::fs::write(&disk, vec![1u8; 8192]).unwrap(); + std::fs::write(folder.join("openbot-s1-arm64.raw"), vec![1u8; 8192]).unwrap(); + std::fs::write( + folder.join("podman-machine-default-arm64.raw"), + vec![1u8; 8192], + ) + .unwrap(); + // As Podman 6.1.1 printed it on the cloud Mac, paths moved under the test's home. + let inspected = serde_json::json!([{ + "ConfigDir": { "Path": home.join(".config/containers/podman/machine/libkrun").display().to_string() }, + "ConnectionInfo": { "PodmanSocket": { "Path": "/tmp/podman/openbot-api.sock" }, "PodmanPipe": null }, + "Created": "2026-11-22T00:14:08.925059Z", + "LastUp": "2026-11-22T01:06:40.153517Z", + "Name": "openbot", + "Resources": { "CPUs": 4, "DiskSize": 60, "Memory": 6144, "USBs": [] }, + "SSHConfig": { + "IdentityPath": data.join("containers/podman/machine/machine").display().to_string(), + "Port": 49812, + "RemoteUsername": "core" + }, + "State": "running", + "UserModeNetworking": true, + "Rootful": true, + "Rosetta": false + }]) + .to_string(); + assert!(machine_disks(&inspected, "openbot", None).is_empty()); + assert_eq!( + machine_disks(&inspected, "openbot", Some(&data)), + [disk.clone()] + ); + assert!(footprint(&machine_disks(&inspected, "openbot", Some(&data))) >= 8192); + let _ = std::fs::remove_dir_all(home); +} + // ------------------------------------------------------------------------------------------------ // Over HTTP, against an OpenBot here and an OpenBot Cloud that answer as the API says, and with the // real uninstall code removing a real installation folder. From c6a1cf75346b2e35d3ddc4ce9bacc751c2fc4472 Mon Sep 17 00:00:00 2001 From: David McKay Date: Sat, 21 Nov 2026 18:40:23 -0800 Subject: [PATCH 14/16] Desktop: the move's counts leave out messages, which include a Bot's tool steps --- desktop/src/MoveToCloud.test.tsx | 3 ++- desktop/src/MoveToCloud.tsx | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/desktop/src/MoveToCloud.test.tsx b/desktop/src/MoveToCloud.test.tsx index e0df4a168d..b125417438 100644 --- a/desktop/src/MoveToCloud.test.tsx +++ b/desktop/src/MoveToCloud.test.tsx @@ -277,7 +277,6 @@ test("before the move, the apps that must be reconnected are listed by name, abo "3 Bots", "9 skills", "42 conversations", - "2,814 messages", "52 memories", "1 routine", "64 files", @@ -446,6 +445,8 @@ test("counts keep the kinds there are words for, in order, and skip zeros; space { kind: "goals", count: 1 }, { kind: "bots", count: 1 }, { kind: "settings", count: 4 }, + // A Bot's tool steps are message records too: never a count a person reads. + { kind: "messages", count: 39 }, { kind: "something-new", count: 7 }, { kind: "memories", count: 0 }, ]).map((line) => line.said), diff --git a/desktop/src/MoveToCloud.tsx b/desktop/src/MoveToCloud.tsx index 10aeec39a1..d514a4d2d2 100644 --- a/desktop/src/MoveToCloud.tsx +++ b/desktop/src/MoveToCloud.tsx @@ -8,7 +8,6 @@ import { IconCloud, IconDeviceLaptop, IconFiles, - IconMessage, IconMessages, IconPlug, IconRobot, @@ -127,7 +126,6 @@ const KINDS: readonly { many: "conversations", icon: IconMessages, }, - { kind: "messages", one: "message", many: "messages", icon: IconMessage }, { kind: "memories", one: "memory", many: "memories", icon: IconBrain }, { kind: "routines", one: "routine", many: "routines", icon: IconClock }, { kind: "goals", one: "goal", many: "goals", icon: IconTarget }, @@ -136,9 +134,11 @@ const KINDS: readonly { ]; /** - * The preview's counts as a person reads them: "3 Bots", "2,814 messages". Only the kinds there are + * The preview's counts as a person reads them: "3 Bots", "42 conversations". Only the kinds there are * words for, in their order, and none that is zero. A kind a later OpenBot adds is left out until - * this list names it, and settings and AI keys are never a count. + * this list names it, and settings and AI keys are never a count. Nor are messages: the count holds + * every record of a conversation, a Bot's tool steps included, so on the test boxes a person who sent + * 6 messages and got 6 replies read "39 messages". Conversations say what moves. */ export function countLines( counts: MovePreview["counts"], From 24befd8c32637ff64b3a677c76f831900af147a5 Mon Sep 17 00:00:00 2001 From: David McKay Date: Sat, 21 Nov 2026 18:46:23 -0800 Subject: [PATCH 15/16] Desktop: never claim more space freed than the disk gained --- desktop/src-tauri/src/desktop_move.rs | 6 ++++ desktop/src-tauri/src/move_to_cloud.rs | 33 +++++++++++++++++++- desktop/src-tauri/src/move_to_cloud/tests.rs | 26 +++++++++++++++ 3 files changed, 64 insertions(+), 1 deletion(-) diff --git a/desktop/src-tauri/src/desktop_move.rs b/desktop/src-tauri/src/desktop_move.rs index ea6dd84a3d..b485ba1bcb 100644 --- a/desktop/src-tauri/src/desktop_move.rs +++ b/desktop/src-tauri/src/desktop_move.rs @@ -458,6 +458,12 @@ impl moving::Here for ThisComputer { footprint(&self.app) } + /// The disk the installation folder is on, which holds OpenBot's machine disk too wherever + /// OpenBot put it (`\engine` on Windows, the home folder on a Mac). + fn free_space(&mut self) -> Option { + openbot_desktop_lib::early_downloads::free_space(&root(&self.app)) + } + /// Kept before anything goes: the answer, and the app connected to OpenBot Cloud from the /// next launch on, so a removal cut short never offers the move again. fn moved(&mut self) -> Result<(), String> { diff --git a/desktop/src-tauri/src/move_to_cloud.rs b/desktop/src-tauri/src/move_to_cloud.rs index 59a3f37375..ebe79ed6e4 100644 --- a/desktop/src-tauri/src/move_to_cloud.rs +++ b/desktop/src-tauri/src/move_to_cloud.rs @@ -221,6 +221,35 @@ pub trait Here { fn moved(&mut self) -> Result<(), String>; /// OpenBot's software and data removed from this computer. What couldn't be, in plain words. fn remove(&mut self) -> Vec; + /// The space free on the disk OpenBot is on, when the system says. + fn free_space(&mut self) -> Option { + None + } +} + +/** +What removing OpenBot freed: what it measured of its own files before and after, but never more +than the disk itself gained when the disk says. On two Windows boxes the files measured 12.2 and +12.0 GB while the disk gained 11.4 and 10.8 GB (Podman's own helper stays, and a deleted disk +image does not hand back every byte its length claims), and the person reads the claim against +the disk. +*/ +pub fn freed( + footprint: (Option, Option), + free_space: (Option, Option), +) -> Option { + let measured = footprint + .0 + .map(|before| before.saturating_sub(footprint.1.unwrap_or(0))); + let gained = match free_space { + (Some(before), Some(after)) if after > before => Some(after - before), + _ => None, + }; + match (measured, gained) { + (Some(measured), Some(gained)) => Some(measured.min(gained)), + (measured, None) => measured, + (None, gained) => gained, + } } /// The move's steps, for the setup window's progress rows. @@ -392,8 +421,10 @@ pub fn run( progress.running(Stage::Remove, None); here.moved().map_err(failed(Stage::Verify))?; let before = here.footprint(); + let free_before = here.free_space(); let left_behind = here.remove(); let after = here.footprint(); + let free_after = here.free_space(); progress.done(Stage::Remove); let apps = if verification.reconnect.is_empty() { @@ -402,7 +433,7 @@ pub fn run( verification.reconnect }; Ok(Moved { - freed_bytes: before.map(|before| before.saturating_sub(after.unwrap_or(0))), + freed_bytes: freed((before, after), (free_before, free_after)), apps, notes: verification .notes diff --git a/desktop/src-tauri/src/move_to_cloud/tests.rs b/desktop/src-tauri/src/move_to_cloud/tests.rs index 1f967a1b9d..18bc33ad75 100644 --- a/desktop/src-tauri/src/move_to_cloud/tests.rs +++ b/desktop/src-tauri/src/move_to_cloud/tests.rs @@ -531,6 +531,32 @@ fn a_failed_import_is_applied_once_more() { assert!(here.removed); } +/// The freed figure is what the files measured, held to what the disk gained: box B's files measured +/// 12.0 GB while its disk gained 10.8 GB, and the screen said 12.0. A disk that didn't move (another +/// program wrote meanwhile) or couldn't be read leaves the files' figure. +#[test] +fn the_space_freed_is_never_more_than_the_disk_gained() { + const GB: u64 = 1_000_000_000; + assert_eq!( + freed( + (Some(12 * GB), Some(0)), + (Some(106_810_000_000), Some(117_610_000_000)) + ), + Some(10_800_000_000) + ); + assert_eq!( + freed((Some(12 * GB), Some(0)), (Some(100 * GB), Some(115 * GB))), + Some(12 * GB) + ); + assert_eq!( + freed((Some(12 * GB), Some(0)), (Some(100 * GB), Some(99 * GB))), + Some(12 * GB) + ); + assert_eq!(freed((Some(12 * GB), None), (None, None)), Some(12 * GB)); + assert_eq!(freed((None, None), (Some(GB), Some(3 * GB))), Some(2 * GB)); + assert_eq!(freed((None, None), (None, None)), None); +} + // ------------------------------------------------------------------------------------------------ // Footprint. From 200d83683eacf9aa2c470f60a7036e0a7ec19500 Mon Sep 17 00:00:00 2001 From: David McKay Date: Sat, 21 Nov 2026 18:48:35 -0800 Subject: [PATCH 16/16] Desktop: tidy a move test for clippy --- desktop/src-tauri/src/move_to_cloud/tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/src-tauri/src/move_to_cloud/tests.rs b/desktop/src-tauri/src/move_to_cloud/tests.rs index 18bc33ad75..15a0609602 100644 --- a/desktop/src-tauri/src/move_to_cloud/tests.rs +++ b/desktop/src-tauri/src/move_to_cloud/tests.rs @@ -641,7 +641,7 @@ fn a_macs_machine_disk_is_found_through_its_provider() { assert!(machine_disks(&inspected, "openbot", None).is_empty()); assert_eq!( machine_disks(&inspected, "openbot", Some(&data)), - [disk.clone()] + std::slice::from_ref(&disk) ); assert!(footprint(&machine_disks(&inspected, "openbot", Some(&data))) >= 8192); let _ = std::fs::remove_dir_all(home);