@capybara-hq/kernel 0.1.0-rc.105 → 0.1.0-rc.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/admin.schemas.d.ts +3 -0
- package/dist/agents/agents.schemas.d.ts +9 -9
- package/dist/{schedules/schedules.controller.d.ts → automations/automations.controller.d.ts} +37 -32
- package/dist/{schedules/schedules.controller.js → automations/automations.controller.js} +68 -57
- package/dist/automations/automations.module.d.ts +16 -0
- package/dist/{schedules/schedules.module.js → automations/automations.module.js} +18 -15
- package/dist/{schedules/schedules.schemas.d.ts → automations/automations.schemas.d.ts} +151 -50
- package/dist/automations/automations.schemas.js +253 -0
- package/dist/{schedules/scheduled-tasks.service.d.ts → automations/automations.service.d.ts} +99 -52
- package/dist/{schedules/scheduled-tasks.service.js → automations/automations.service.js} +303 -134
- package/dist/{schedules → automations}/calendar.d.ts +8 -8
- package/dist/{schedules → automations}/calendar.js +2 -2
- package/dist/automations/effective-settings.d.ts +28 -0
- package/dist/automations/effective-settings.js +25 -0
- package/dist/automations/errors.d.ts +19 -0
- package/dist/automations/errors.js +19 -0
- package/dist/automations/events/coalesce.d.ts +28 -0
- package/dist/automations/events/coalesce.js +131 -0
- package/dist/automations/events/deadline.d.ts +10 -0
- package/dist/automations/events/deadline.js +24 -0
- package/dist/automations/events/dispatcher.d.ts +74 -0
- package/dist/automations/events/dispatcher.js +353 -0
- package/dist/automations/events/events.module.d.ts +7 -0
- package/dist/automations/events/events.module.js +26 -0
- package/dist/automations/events/guards.d.ts +32 -0
- package/dist/automations/events/guards.js +87 -0
- package/dist/automations/events/sweep.job.d.ts +49 -0
- package/dist/automations/events/sweep.job.js +202 -0
- package/dist/automations/events/token.d.ts +5 -0
- package/dist/automations/events/token.js +5 -0
- package/dist/automations/events/trigger-events.service.d.ts +47 -0
- package/dist/automations/events/trigger-events.service.js +254 -0
- package/dist/{schedules → automations}/fire.d.ts +57 -17
- package/dist/{schedules → automations}/fire.js +311 -79
- package/dist/{schedules → automations}/grant-rules.d.ts +1 -1
- package/dist/{schedules → automations}/grant-rules.js +5 -5
- package/dist/automations/job-ids.d.ts +113 -0
- package/dist/automations/job-ids.js +117 -0
- package/dist/{schedules → automations}/pause.d.ts +3 -3
- package/dist/{schedules → automations}/pause.js +3 -3
- package/dist/{schedules → automations}/run-tracker.d.ts +21 -10
- package/dist/{schedules → automations}/run-tracker.js +68 -56
- package/dist/{schedules → automations}/scan.job.d.ts +12 -8
- package/dist/{schedules → automations}/scan.job.js +39 -23
- package/dist/{schedules → automations}/schedule-math.d.ts +19 -12
- package/dist/{schedules → automations}/schedule-math.js +17 -7
- package/dist/{schedules → automations}/store.d.ts +57 -27
- package/dist/{schedules → automations}/store.js +102 -52
- package/dist/automations/store.module.d.ts +6 -0
- package/dist/{schedules → automations}/store.module.js +9 -9
- package/dist/automations/types.d.ts +178 -0
- package/dist/{schedules → automations}/unattended.d.ts +22 -11
- package/dist/{schedules → automations}/unattended.js +53 -30
- package/dist/catalog/marketplaces.service.d.ts +1 -1
- package/dist/channels/channels.module.js +7 -6
- package/dist/channels/file-delivery.d.ts +26 -11
- package/dist/channels/file-delivery.js +32 -11
- package/dist/channels/outbound.d.ts +8 -8
- package/dist/channels/outbound.js +32 -30
- package/dist/channels/threads.d.ts +1 -1
- package/dist/channels/threads.js +1 -1
- package/dist/config/schema.d.ts +8 -1
- package/dist/config/schema.js +56 -6
- package/dist/conversations/approval-profile.d.ts +2 -2
- package/dist/conversations/approval-profile.js +3 -3
- package/dist/conversations/artifacts.d.ts +20 -17
- package/dist/conversations/artifacts.js +30 -37
- package/dist/conversations/attachments.controller.d.ts +6 -19
- package/dist/conversations/attachments.controller.js +8 -59
- package/dist/conversations/attachments.service.d.ts +30 -74
- package/dist/conversations/attachments.service.js +51 -193
- package/dist/conversations/conversations.controller.d.ts +7 -1
- package/dist/conversations/conversations.controller.js +26 -10
- package/dist/conversations/conversations.module.js +4 -0
- package/dist/conversations/conversations.service.d.ts +112 -35
- package/dist/conversations/conversations.service.js +160 -43
- package/dist/conversations/event-log.d.ts +1 -0
- package/dist/conversations/events.d.ts +95 -27
- package/dist/conversations/events.js +108 -10
- package/dist/conversations/files.d.ts +66 -64
- package/dist/conversations/files.js +127 -147
- package/dist/conversations/message-context.d.ts +2 -2
- package/dist/conversations/message-context.js +1 -1
- package/dist/conversations/permission-profile-store.d.ts +2 -1
- package/dist/conversations/permission-profiles.controller.d.ts +3 -0
- package/dist/conversations/permission-profiles.service.js +1 -1
- package/dist/conversations/prompt-suggestion-request.d.ts +1 -1
- package/dist/conversations/prompt-suggestion-request.js +4 -2
- package/dist/conversations/prompt-suggestions.d.ts +3 -3
- package/dist/conversations/prompt-suggestions.js +11 -10
- package/dist/conversations/queue.d.ts +7 -4
- package/dist/conversations/queue.js +6 -2
- package/dist/conversations/queue.service.d.ts +5 -5
- package/dist/conversations/queue.service.js +27 -16
- package/dist/ctx/create-ctx.d.ts +23 -2
- package/dist/ctx/create-ctx.js +78 -3
- package/dist/db/kernel-schema.d.ts +184 -27
- package/dist/devices/device-project-files.service.d.ts +88 -0
- package/dist/devices/device-project-files.service.js +249 -0
- package/dist/devices/device-projects.service.d.ts +40 -0
- package/dist/devices/device-projects.service.js +16 -13
- package/dist/devices/devices.controller.d.ts +9 -3
- package/dist/devices/devices.controller.js +27 -5
- package/dist/devices/devices.module.js +9 -1
- package/dist/devices/devices.schemas.js +6 -1
- package/dist/devices/dto.d.ts +15 -0
- package/dist/devices/dto.js +11 -0
- package/dist/devices/project-paths.d.ts +29 -0
- package/dist/devices/project-paths.js +66 -0
- package/dist/devices/project-rules.d.ts +5 -1
- package/dist/devices/project-rules.js +5 -1
- package/dist/errors.d.ts +53 -13
- package/dist/errors.js +53 -13
- package/dist/evals/canonical-json.d.ts +7 -0
- package/dist/evals/canonical-json.js +21 -0
- package/dist/evals/reconstruct.d.ts +10 -1
- package/dist/evals/reconstruct.js +20 -1
- package/dist/evals/recorded-tools.d.ts +0 -2
- package/dist/evals/recorded-tools.js +1 -16
- package/dist/evals/snapshot.d.ts +26 -3
- package/dist/evals/snapshot.js +110 -57
- package/dist/evals/worker.d.ts +4 -3
- package/dist/evals/worker.js +8 -4
- package/dist/extensions/host.d.ts +9 -2
- package/dist/extensions/host.js +12 -0
- package/dist/extensions/instance.d.ts +3 -1
- package/dist/extensions/instance.js +4 -0
- package/dist/extensions/ledger.d.ts +1 -1
- package/dist/extensions/permission-set.d.ts +17 -1
- package/dist/extensions/permission-set.js +13 -1
- package/dist/extensions/permission-view.d.ts +1 -1
- package/dist/extensions/permission-view.js +4 -1
- package/dist/files/blob-objects.d.ts +124 -0
- package/dist/files/blob-objects.js +341 -0
- package/dist/files/blob-sweep.job.d.ts +122 -0
- package/dist/files/blob-sweep.job.js +389 -0
- package/dist/files/blobs.service.d.ts +135 -0
- package/dist/files/blobs.service.js +300 -0
- package/dist/files/conversation-media.d.ts +41 -0
- package/dist/files/conversation-media.js +124 -0
- package/dist/files/deliveries.d.ts +64 -0
- package/dist/files/deliveries.js +156 -0
- package/dist/files/deliveries.module.d.ts +6 -0
- package/dist/files/deliveries.module.js +24 -0
- package/dist/files/draft-cleanup.job.d.ts +26 -0
- package/dist/files/draft-cleanup.job.js +93 -0
- package/dist/files/files.module.d.ts +1 -1
- package/dist/files/files.module.js +3 -2
- package/dist/files/hash-job.d.ts +127 -0
- package/dist/files/hash-job.js +447 -0
- package/dist/files/library-backfill.d.ts +63 -0
- package/dist/files/library-backfill.js +143 -0
- package/dist/files/library-files.service.d.ts +255 -0
- package/dist/files/library-files.service.js +883 -0
- package/dist/files/library-jobs.module.d.ts +8 -0
- package/dist/files/library-jobs.module.js +27 -0
- package/dist/files/library-query.d.ts +127 -0
- package/dist/files/library-query.js +322 -0
- package/dist/files/library-read.module.d.ts +9 -0
- package/dist/files/library-read.module.js +30 -0
- package/dist/files/library.controller.d.ts +77 -0
- package/dist/files/library.controller.js +235 -0
- package/dist/files/library.module.d.ts +9 -0
- package/dist/files/library.module.js +29 -0
- package/dist/files/library.schemas.d.ts +46 -0
- package/dist/files/library.schemas.js +49 -0
- package/dist/files/previewers.controller.d.ts +20 -0
- package/dist/files/previewers.controller.js +47 -0
- package/dist/files/previewers.d.ts +25 -11
- package/dist/files/previewers.js +43 -27
- package/dist/files/referenced-files.d.ts +150 -0
- package/dist/files/referenced-files.js +234 -0
- package/dist/git/gateway.js +2 -2
- package/dist/html/html-document.controller.d.ts +8 -1
- package/dist/html/html-document.controller.js +19 -1
- package/dist/html/html-document.service.d.ts +19 -4
- package/dist/html/html-document.service.js +43 -22
- package/dist/html/html-token.d.ts +10 -1
- package/dist/html/html-token.js +14 -0
- package/dist/html/html.module.js +8 -1
- package/dist/http/api.module.js +10 -5
- package/dist/http/request-signal.d.ts +8 -0
- package/dist/http/request-signal.js +14 -0
- package/dist/identity/settings.d.ts +26 -0
- package/dist/identity/settings.js +33 -2
- package/dist/inbox/inbox.module.js +2 -2
- package/dist/inbox/inbox.service.d.ts +8 -8
- package/dist/inbox/inbox.service.js +7 -7
- package/dist/infra/config/kernel-config.service.js +10 -5
- package/dist/infra/outbox/registry.d.ts +111 -2
- package/dist/infra/outbox/registry.js +104 -9
- package/dist/infra/throttler/named-throttlers.d.ts +2 -0
- package/dist/infra/throttler/named-throttlers.js +14 -0
- package/dist/kernel.module.js +3 -0
- package/dist/lifecycle/kernel-lifecycle.js +6 -0
- package/dist/models/purposes.js +1 -1
- package/dist/orgs/offboarding.js +1 -1
- package/dist/orgs/roles.d.ts +1 -1
- package/dist/orgs/roles.js +3 -3
- package/dist/orgs/settings.controller.d.ts +1 -1
- package/dist/orgs/settings.service.d.ts +75 -13
- package/dist/orgs/settings.service.js +104 -26
- package/dist/platform/exclusions.js +45 -8
- package/dist/platform/file-ref.d.ts +18 -3
- package/dist/platform/file-ref.js +22 -11
- package/dist/platform/operation.js +6 -2
- package/dist/platform/ops/admin.ops.js +5 -2
- package/dist/platform/ops/{schedules.ops.d.ts → automations.ops.d.ts} +4 -4
- package/dist/platform/ops/automations.ops.js +560 -0
- package/dist/platform/ops/devices.ops.d.ts +3 -1
- package/dist/platform/ops/devices.ops.js +77 -3
- package/dist/platform/ops/files.ops.d.ts +18 -0
- package/dist/platform/ops/files.ops.js +267 -0
- package/dist/platform/ops/inbox.ops.js +4 -4
- package/dist/platform/ops/org-settings.ops.js +6 -2
- package/dist/platform/ops/orgs.ops.js +2 -1
- package/dist/platform/ops/platform.ops.js +4 -4
- package/dist/platform/ops/shares.ops.js +2 -2
- package/dist/platform/platform-ops.module.d.ts +3 -2
- package/dist/platform/platform-ops.module.js +10 -5
- package/dist/platform/route-schemas.js +6 -3
- package/dist/push/jobs.d.ts +3 -3
- package/dist/push/jobs.js +2 -2
- package/dist/push/preferences.service.js +1 -1
- package/dist/push/push-owed.d.ts +3 -3
- package/dist/push/push-owed.js +6 -6
- package/dist/push/push.schemas.d.ts +4 -4
- package/dist/push/push.schemas.js +3 -3
- package/dist/push/recipients.d.ts +4 -4
- package/dist/push/recipients.js +23 -23
- package/dist/push/texts.d.ts +3 -3
- package/dist/push/texts.js +2 -2
- package/dist/push/triggers.d.ts +1 -1
- package/dist/roles/worker.module.js +18 -4
- package/dist/runtime/compaction-settings.service.d.ts +13 -1
- package/dist/runtime/compaction-settings.service.js +16 -1
- package/dist/runtime/compaction.service.d.ts +3 -1
- package/dist/runtime/compaction.service.js +3 -1
- package/dist/runtime/context/build.d.ts +24 -1
- package/dist/runtime/context/build.js +33 -11
- package/dist/runtime/context/cache-expiry.d.ts +31 -0
- package/dist/runtime/context/cache-expiry.js +60 -0
- package/dist/runtime/context/cache-ttl.d.ts +18 -0
- package/dist/runtime/context/cache-ttl.js +30 -0
- package/dist/runtime/context/compaction.d.ts +9 -2
- package/dist/runtime/context/compaction.js +64 -21
- package/dist/runtime/context/in-context-compaction.d.ts +156 -0
- package/dist/runtime/context/in-context-compaction.js +310 -0
- package/dist/runtime/context/run-context.d.ts +38 -0
- package/dist/runtime/context/run-context.js +54 -0
- package/dist/runtime/hook-calls.d.ts +2 -1
- package/dist/runtime/hook-calls.js +5 -2
- package/dist/runtime/maintenance.d.ts +16 -4
- package/dist/runtime/maintenance.js +79 -18
- package/dist/runtime/model-call.d.ts +34 -5
- package/dist/runtime/model-call.js +207 -22
- package/dist/runtime/providers.js +11 -1
- package/dist/runtime/run-finish.d.ts +4 -4
- package/dist/runtime/run-finish.js +3 -3
- package/dist/runtime/run-queue.js +12 -7
- package/dist/runtime/run-steps.d.ts +4 -2
- package/dist/runtime/run-steps.js +10 -5
- package/dist/runtime/run-worker.js +7 -1
- package/dist/runtime/runtime.module.js +6 -3
- package/dist/runtime/subagents/dispatch.js +11 -3
- package/dist/sandbox/browse-roots.d.ts +8 -0
- package/dist/sandbox/browse-roots.js +22 -0
- package/dist/sandbox/network-grants.d.ts +4 -4
- package/dist/sandbox/network-grants.js +7 -7
- package/dist/sandbox/operation-authority.d.ts +10 -3
- package/dist/sandbox/operation-authority.js +20 -10
- package/dist/sandbox/operation-intents.d.ts +3 -1
- package/dist/sandbox/operation-intents.js +11 -4
- package/dist/sandbox/permission-call-grants.js +2 -2
- package/dist/sandbox/permission-facts.js +1 -1
- package/dist/sandbox/review/classifier.d.ts +2 -2
- package/dist/sandbox/review/classifier.js +22 -11
- package/dist/sandbox/review/permission-candidate.d.ts +1 -1
- package/dist/sandbox/review/permission-candidate.js +1 -1
- package/dist/sandbox/sandbox.service.d.ts +15 -5
- package/dist/sandbox/sandbox.service.js +14 -8
- package/dist/shares/liveness.d.ts +26 -12
- package/dist/shares/liveness.js +79 -20
- package/dist/shares/revoke.d.ts +16 -11
- package/dist/shares/revoke.js +18 -14
- package/dist/shares/share-objects.d.ts +16 -21
- package/dist/shares/share-objects.js +25 -55
- package/dist/shares/share-open.service.d.ts +8 -4
- package/dist/shares/share-open.service.js +14 -11
- package/dist/shares/shares.controller.d.ts +16 -5
- package/dist/shares/shares.controller.js +39 -5
- package/dist/shares/shares.module.d.ts +4 -4
- package/dist/shares/shares.module.js +7 -6
- package/dist/shares/shares.schemas.d.ts +4 -0
- package/dist/shares/shares.schemas.js +2 -0
- package/dist/shares/shares.service.d.ts +93 -54
- package/dist/shares/shares.service.js +292 -131
- package/dist/shares/sweep.job.d.ts +18 -39
- package/dist/shares/sweep.job.js +47 -206
- package/dist/storage/purge.d.ts +1 -1
- package/dist/storage/purge.js +2 -2
- package/dist/tools/approvals.service.d.ts +6 -6
- package/dist/tools/approvals.service.js +19 -19
- package/dist/tools/builtin-names.d.ts +12 -12
- package/dist/tools/builtin-names.js +29 -29
- package/dist/tools/builtins/artifacts.d.ts +21 -13
- package/dist/tools/builtins/artifacts.js +81 -51
- package/dist/tools/builtins/{schedules.d.ts → automations.d.ts} +35 -33
- package/dist/tools/builtins/{schedules.js → automations.js} +236 -105
- package/dist/tools/builtins/builtin-tools.d.ts +15 -9
- package/dist/tools/builtins/builtin-tools.js +33 -22
- package/dist/tools/builtins/conversation-files.d.ts +23 -13
- package/dist/tools/builtins/conversation-files.js +62 -83
- package/dist/tools/builtins/image/generate.d.ts +7 -1
- package/dist/tools/builtins/image/generate.js +1 -1
- package/dist/tools/builtins/platform.js +1 -0
- package/dist/tools/builtins/sandbox/common.d.ts +6 -2
- package/dist/tools/builtins/sandbox/deliver.js +6 -7
- package/dist/tools/builtins/sandbox/fetch-attachment.d.ts +6 -5
- package/dist/tools/builtins/sandbox/fetch-attachment.js +19 -12
- package/dist/tools/call-scope.d.ts +1 -1
- package/dist/tools/git-asks.js +1 -1
- package/dist/tools/git-push-policy.d.ts +3 -3
- package/dist/tools/git-push-policy.js +6 -6
- package/dist/tools/network-asks.d.ts +3 -3
- package/dist/tools/network-asks.js +3 -3
- package/dist/tools/pipeline.d.ts +4 -4
- package/dist/tools/pipeline.js +2 -2
- package/dist/tools/policy.d.ts +3 -3
- package/dist/tools/policy.js +3 -3
- package/dist/tools/tools.module.js +15 -9
- package/dist/ui/call-extension.d.ts +6 -4
- package/dist/ui/call-extension.js +5 -4
- package/dist/ui/embed-token.js +6 -3
- package/dist/ui/registry.d.ts +21 -5
- package/dist/ui/registry.js +24 -6
- package/dist/ui/ui.schemas.d.ts +22 -0
- package/dist/ui/ui.schemas.js +22 -4
- package/dist/ui/views.controller.d.ts +13 -3
- package/dist/ui/views.controller.js +33 -2
- package/dist/ui/views.d.ts +29 -1
- package/dist/ui/views.js +131 -7
- package/package.json +3 -3
- package/src/migrations/0188_automations_rename.sql +309 -0
- package/src/migrations/0189_event_automations.sql +136 -0
- package/src/migrations/0190_file_library.sql +285 -0
- package/src/migrations/0191_file_library_copy.sql +4 -0
- package/dist/platform/ops/schedules.ops.js +0 -509
- package/dist/schedules/effective-settings.d.ts +0 -22
- package/dist/schedules/effective-settings.js +0 -18
- package/dist/schedules/errors.d.ts +0 -8
- package/dist/schedules/errors.js +0 -8
- package/dist/schedules/job-ids.d.ts +0 -81
- package/dist/schedules/job-ids.js +0 -95
- package/dist/schedules/schedules.module.d.ts +0 -16
- package/dist/schedules/schedules.schemas.js +0 -213
- package/dist/schedules/store.module.d.ts +0 -6
- package/dist/schedules/types.d.ts +0 -110
- /package/dist/{schedules → automations}/types.js +0 -0
|
@@ -9,9 +9,10 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
9
9
|
};
|
|
10
10
|
import { Inject, Injectable } from "@nestjs/common";
|
|
11
11
|
import { z } from "zod";
|
|
12
|
+
import { DeviceProjectFilesService } from "../../devices/device-project-files.service.js";
|
|
12
13
|
import { DeviceProjectsService } from "../../devices/device-projects.service.js";
|
|
13
14
|
import { DevicesService } from "../../devices/devices.service.js";
|
|
14
|
-
import { DeviceCreateBody, DeviceNameBody, DeviceNetworkBody, DeviceParams, DeviceProjectAddBody, DeviceProjectParams, } from "../../devices/dto.js";
|
|
15
|
+
import { DeviceCreateBody, DeviceNameBody, DeviceNetworkBody, DeviceParams, DeviceProjectAddBody, DeviceProjectFilesQuery, DeviceProjectParams, } from "../../devices/dto.js";
|
|
15
16
|
import { deviceLabel } from "../../devices/label.js";
|
|
16
17
|
import { KernelDb } from "../../infra/database/kernel-db.js";
|
|
17
18
|
import { rootConversationOf } from "../../runtime/subagents/child.js";
|
|
@@ -74,11 +75,13 @@ let DevicesOperations = class DevicesOperations {
|
|
|
74
75
|
registry;
|
|
75
76
|
devices;
|
|
76
77
|
projects;
|
|
78
|
+
projectFiles;
|
|
77
79
|
kdb;
|
|
78
|
-
constructor(registry, devices, projects, kdb) {
|
|
80
|
+
constructor(registry, devices, projects, projectFiles, kdb) {
|
|
79
81
|
this.registry = registry;
|
|
80
82
|
this.devices = devices;
|
|
81
83
|
this.projects = projects;
|
|
84
|
+
this.projectFiles = projectFiles;
|
|
82
85
|
this.kdb = kdb;
|
|
83
86
|
}
|
|
84
87
|
/**
|
|
@@ -416,6 +419,76 @@ let DevicesOperations = class DevicesOperations {
|
|
|
416
419
|
],
|
|
417
420
|
run: (input, ctx) => this.projects.candidates(ctx.orgId, ctx.actorAccountId, input.deviceId),
|
|
418
421
|
}),
|
|
422
|
+
defineOperation({
|
|
423
|
+
id: "devices.list-project-files",
|
|
424
|
+
description: "List one directory of a project on one of your devices: its folders, then its files, by name (at most 200; truncated says more exist). path is relative to the project root (empty or absent for the root), never absolute and never above the root; q keeps the names containing it. Names only, never file contents. Takes the id from devices.list and the name from devices.list-projects.",
|
|
425
|
+
input: DeviceId.extend({ name: DeviceProjectParams.shape.name })
|
|
426
|
+
.extend(DeviceProjectFilesQuery.shape)
|
|
427
|
+
.strict(),
|
|
428
|
+
example: {
|
|
429
|
+
deviceId: "4e8a0c1d-6b2f-4a37-8d19-3c5e7f9a1b20",
|
|
430
|
+
name: "capybara",
|
|
431
|
+
path: "src",
|
|
432
|
+
},
|
|
433
|
+
authz: { orgAction: "agents.use" },
|
|
434
|
+
mirrors: ["GET /api/v1/orgs/:orgId/devices/:id/projects/:name/files"],
|
|
435
|
+
renames: { deviceId: "id" },
|
|
436
|
+
confirm: "read",
|
|
437
|
+
errors: [
|
|
438
|
+
{
|
|
439
|
+
code: "device.not_found",
|
|
440
|
+
next: "Check the id with devices.list: you only see your own devices.",
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
code: "device.project_not_found",
|
|
444
|
+
next: "Check the project name with devices.list-projects.",
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
code: "device.path_outside_project",
|
|
448
|
+
next: "Pass a path relative to the project root that stays inside it (no leading /, no .. above the root).",
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
code: "device.project_path_missing",
|
|
452
|
+
next: "List the parent directory to find the right path.",
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
code: "device.list_unsupported",
|
|
456
|
+
next: "This device's provider cannot list files: ask the person for the path instead.",
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
code: "device.project_path_unreadable",
|
|
460
|
+
next: "The path is a file or a folder the device cannot read: list its parent folder instead.",
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
code: "device.project_outside_mode",
|
|
464
|
+
next: "The device does not let its owner browse there: pick another path in the project, or ask the person to remove the project and add it again from a directory under the device's base.",
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
code: "device.project_refused",
|
|
468
|
+
next: "The device refused that directory and said why: tell the person its reason, then list another path.",
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
code: "device.project_path_too_broad",
|
|
472
|
+
next: "The project lies above the owner's home now: ask the person to re-add the project's own directory.",
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
code: "device.not_running",
|
|
476
|
+
next: "The device stopped before it could be read: call again, it is started first.",
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
code: "device.projects_unavailable",
|
|
480
|
+
next: "The device could not be asked now: try again shortly.",
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
code: "device.offline",
|
|
484
|
+
next: "The machine serving it is offline: ask the person to connect that machine again, then call again.",
|
|
485
|
+
},
|
|
486
|
+
],
|
|
487
|
+
run: (input, ctx) => this.projectFiles.list(ctx.orgId, ctx.actorAccountId, input.deviceId, input.name, {
|
|
488
|
+
...(input.path !== undefined && { path: input.path }),
|
|
489
|
+
...(input.q !== undefined && { q: input.q }),
|
|
490
|
+
}),
|
|
491
|
+
}),
|
|
419
492
|
defineOperation({
|
|
420
493
|
id: "devices.add-project",
|
|
421
494
|
description: "Add a project to one of your devices: path is relative to the device's base (see devices.list-projects; empty for the base itself), never absolute, and never above the owner's home; name defaults to the directory's name (1-64 characters, no /, unique on the device). The device is asked first, so a missing directory, a file, an unreadable path or one the device refuses (with its reason) is refused. At most 100 projects per device. Takes the id from devices.list.",
|
|
@@ -515,6 +588,7 @@ DevicesOperations = __decorate([
|
|
|
515
588
|
__param(0, Inject(PlatformOperations)),
|
|
516
589
|
__param(1, Inject(DevicesService)),
|
|
517
590
|
__param(2, Inject(DeviceProjectsService)),
|
|
518
|
-
__param(3, Inject(
|
|
591
|
+
__param(3, Inject(DeviceProjectFilesService)),
|
|
592
|
+
__param(4, Inject(KernelDb))
|
|
519
593
|
], DevicesOperations);
|
|
520
594
|
export { DevicesOperations };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type OnModuleInit } from "@nestjs/common";
|
|
2
|
+
import { LibraryFilesService } from "../../files/library-files.service.js";
|
|
3
|
+
import { LibraryQuery } from "../../files/library-query.js";
|
|
4
|
+
import { PlatformOperations } from "../registry.js";
|
|
5
|
+
/**
|
|
6
|
+
* File library operations of the `Platform` tool (file library spec §6, §8): the person's own
|
|
7
|
+
* files, as the Files page shows them. Bytes, previews and the HTML document stay with the web
|
|
8
|
+
* (`transport` exclusions); deleting a file is confirmed by the person on the Files page, so
|
|
9
|
+
* `files.delete` only checks the file and hands them the link. `files.add` is the upload routes
|
|
10
|
+
* with a file reference in place of the bytes (platform web parity spec §5).
|
|
11
|
+
*/
|
|
12
|
+
export declare class FilesOperations implements OnModuleInit {
|
|
13
|
+
private readonly registry;
|
|
14
|
+
private readonly library;
|
|
15
|
+
private readonly files;
|
|
16
|
+
constructor(registry: PlatformOperations, library: LibraryQuery, files: LibraryFilesService);
|
|
17
|
+
onModuleInit(): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
8
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
|
+
};
|
|
10
|
+
import { ToolError } from "@capybara-hq/plugin-sdk";
|
|
11
|
+
import { Inject, Injectable } from "@nestjs/common";
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
import { FileCreateBody, FileIdParams, LibraryListQuery } from "../../files/library.schemas.js";
|
|
14
|
+
import { FileBlobClaimedError, LibraryFilesService } from "../../files/library-files.service.js";
|
|
15
|
+
import { LibraryQuery } from "../../files/library-query.js";
|
|
16
|
+
import { FileRefSchema } from "../file-ref.js";
|
|
17
|
+
import { defineOperation } from "../operation.js";
|
|
18
|
+
import { PlatformOperations } from "../registry.js";
|
|
19
|
+
import { named, orElse } from "./summary.js";
|
|
20
|
+
const PAGE = 50;
|
|
21
|
+
const FileId = FileIdParams.shape.id;
|
|
22
|
+
/** A list row: the compact form of a library entry. */
|
|
23
|
+
const row = (f) => ({
|
|
24
|
+
id: f.id,
|
|
25
|
+
name: f.name,
|
|
26
|
+
contentType: f.contentType,
|
|
27
|
+
size: f.size,
|
|
28
|
+
origin: f.origin,
|
|
29
|
+
...(f.agentName !== undefined && { agent: f.agentName }),
|
|
30
|
+
...(f.sourceConversation !== null && {
|
|
31
|
+
conversation: {
|
|
32
|
+
id: f.sourceConversation.id,
|
|
33
|
+
title: f.sourceConversation.title,
|
|
34
|
+
...(f.sourceConversation.deleted && { deleted: true }),
|
|
35
|
+
},
|
|
36
|
+
}),
|
|
37
|
+
versionCount: f.versions,
|
|
38
|
+
createdAt: f.createdAt,
|
|
39
|
+
});
|
|
40
|
+
/** Model-visible: the bytes' blob kept being deleted while the file was added (a transient race). */
|
|
41
|
+
const BLOB_CLAIMED_TEXT = "The stored bytes were being cleaned up while the file was added, and nothing was added; call the operation again.";
|
|
42
|
+
/** The link of one file on the Files page. */
|
|
43
|
+
const fileLink = (id) => `/files#item=${encodeURIComponent(id)}`;
|
|
44
|
+
/**
|
|
45
|
+
* File library operations of the `Platform` tool (file library spec §6, §8): the person's own
|
|
46
|
+
* files, as the Files page shows them. Bytes, previews and the HTML document stay with the web
|
|
47
|
+
* (`transport` exclusions); deleting a file is confirmed by the person on the Files page, so
|
|
48
|
+
* `files.delete` only checks the file and hands them the link. `files.add` is the upload routes
|
|
49
|
+
* with a file reference in place of the bytes (platform web parity spec §5).
|
|
50
|
+
*/
|
|
51
|
+
let FilesOperations = class FilesOperations {
|
|
52
|
+
registry;
|
|
53
|
+
library;
|
|
54
|
+
files;
|
|
55
|
+
constructor(registry, library, files) {
|
|
56
|
+
this.registry = registry;
|
|
57
|
+
this.library = library;
|
|
58
|
+
this.files = files;
|
|
59
|
+
}
|
|
60
|
+
onModuleInit() {
|
|
61
|
+
this.registry.register([
|
|
62
|
+
defineOperation({
|
|
63
|
+
id: "files.list",
|
|
64
|
+
description: "List your files (the Files page), newest first: files you uploaded and files agents delivered or generated in your conversations, each with id, name, type, size, origin, the agent and the conversation it came from (deleted conversations keep their files) and the number of versions as versionCount (repeated deliveries of one path in one conversation are one entry). Filter by origin, agentId, type (image, document, text, other) or q (part of the name). Pages by 50: pass the returned next as params.cursor.",
|
|
65
|
+
input: LibraryListQuery.pick({
|
|
66
|
+
origin: true,
|
|
67
|
+
agentId: true,
|
|
68
|
+
type: true,
|
|
69
|
+
q: true,
|
|
70
|
+
cursor: true,
|
|
71
|
+
}).strict(),
|
|
72
|
+
example: { q: "report" },
|
|
73
|
+
authz: { orgAction: "agents.use" },
|
|
74
|
+
mirrors: ["GET /api/v1/orgs/:orgId/files"],
|
|
75
|
+
// the page size is fixed at 50
|
|
76
|
+
omits: ["limit"],
|
|
77
|
+
errors: [
|
|
78
|
+
{
|
|
79
|
+
code: "validation_failed",
|
|
80
|
+
next: "Pass the next value of the previous page as params.cursor, unchanged.",
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
confirm: "read",
|
|
84
|
+
run: async (input, ctx) => {
|
|
85
|
+
const out = await this.library.list(ctx.orgId, ctx.actorAccountId, {
|
|
86
|
+
limit: PAGE,
|
|
87
|
+
...(input.origin !== undefined && { origin: input.origin }),
|
|
88
|
+
...(input.agentId !== undefined && { agentId: input.agentId }),
|
|
89
|
+
...(input.type !== undefined && { type: input.type }),
|
|
90
|
+
...(input.q !== undefined && { q: input.q }),
|
|
91
|
+
...(input.cursor !== undefined && { cursor: input.cursor }),
|
|
92
|
+
});
|
|
93
|
+
return { files: out.files.map(row), next: out.next };
|
|
94
|
+
},
|
|
95
|
+
}),
|
|
96
|
+
defineOperation({
|
|
97
|
+
id: "files.get",
|
|
98
|
+
description: "Read one of your files: its details, your conversations it was sent or delivered in, and its versions (newest first). Takes the id from files.list. File contents are opened on the web.",
|
|
99
|
+
input: z.object({ fileId: FileId }).strict(),
|
|
100
|
+
example: { fileId: "3f2b8a40-6c1d-4e0b-9a77-5d1e2c8b9f10" },
|
|
101
|
+
authz: { orgAction: "agents.use" },
|
|
102
|
+
mirrors: ["GET /api/v1/orgs/:orgId/files/:id"],
|
|
103
|
+
renames: { fileId: "id" },
|
|
104
|
+
errors: [
|
|
105
|
+
{
|
|
106
|
+
code: "file.not_found",
|
|
107
|
+
next: "Check the id with files.list: only your own files can be read.",
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
confirm: "read",
|
|
111
|
+
run: async (input, ctx) => {
|
|
112
|
+
const d = await this.library.details(ctx.orgId, ctx.actorAccountId, input.fileId);
|
|
113
|
+
return { file: row(d.file), conversations: d.conversations, versions: d.versions };
|
|
114
|
+
},
|
|
115
|
+
}),
|
|
116
|
+
defineOperation({
|
|
117
|
+
id: "files.usage",
|
|
118
|
+
description: "Read how much storage your files use: the number of your files and their bytes (a file stored twice counts once).",
|
|
119
|
+
input: z.object({}).strict(),
|
|
120
|
+
example: {},
|
|
121
|
+
authz: { orgAction: "agents.use" },
|
|
122
|
+
mirrors: ["GET /api/v1/orgs/:orgId/files/usage"],
|
|
123
|
+
confirm: "read",
|
|
124
|
+
run: async (_input, ctx) => this.library.usage(ctx.orgId, ctx.actorAccountId),
|
|
125
|
+
}),
|
|
126
|
+
defineOperation({
|
|
127
|
+
id: "files.add",
|
|
128
|
+
description: "Add a file of this conversation to your files (the Files page) as your own upload: an attachment, a generated image, an image a tool showed you or a delivered file, passed as file: { fileId } (Deliver a device file first). A file has one owner: a file of another person's files is refused (they add it themselves). name names the new entry (default: the file's name). A file that already is one of your files is returned as it is (with a different name, a renamed entry is added next to it), and so is your file of the same name and bytes: nothing is added twice. Bytes the org already stores are not stored again. Only the types and sizes the composer accepts can be added. The person sees the file on the card. Returns the entry's id, name, size and content type, and added: false when it was already there.",
|
|
129
|
+
input: z
|
|
130
|
+
.object({ file: FileRefSchema, name: FileCreateBody.shape.name.optional() })
|
|
131
|
+
.strict(),
|
|
132
|
+
example: { file: { fileId: "0b9f2c4e-1d3a-4c55-9e0a-7a2f6d1c8b11" } },
|
|
133
|
+
authz: { orgAction: "agents.use" },
|
|
134
|
+
mirrors: ["POST /api/v1/orgs/:orgId/files", "POST /api/v1/orgs/:orgId/files/:id/finalize"],
|
|
135
|
+
// the upload registration's fields come from the referenced file (its type, size and
|
|
136
|
+
// sha256, a library upload); the kernel adds the bytes it holds, so there is no upload to
|
|
137
|
+
// finalize and no id to pass
|
|
138
|
+
omits: ["contentType", "size", "sha256", "purpose", "id"],
|
|
139
|
+
extras: ["file"],
|
|
140
|
+
loosens: { name: "optional: the referenced file's name is the default" },
|
|
141
|
+
confirm: "personal",
|
|
142
|
+
errors: [
|
|
143
|
+
{
|
|
144
|
+
code: "file.type_not_allowed",
|
|
145
|
+
next: "This type of file cannot be added to the Files page (or its bytes are not of its type); tell the person, or convert it to an accepted type, deliver it and retry.",
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
code: "file.too_large",
|
|
149
|
+
next: "The file is over the upload limit; tell the person, or make it smaller, deliver it and retry.",
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
code: "storage.unavailable",
|
|
153
|
+
next: "File storage is unavailable; try again later, or tell the person to contact the super admin.",
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
// the upload's types, signature and per-type size, and one owner per file, are checked
|
|
157
|
+
// before the card (and again before the run)
|
|
158
|
+
fileRef: (i) => {
|
|
159
|
+
const limits = this.files.limits();
|
|
160
|
+
return {
|
|
161
|
+
ref: i.file,
|
|
162
|
+
limits: {
|
|
163
|
+
maxBytes: Math.max(limits.maxBytes, limits.imageMaxBytes),
|
|
164
|
+
contentTypes: limits.types,
|
|
165
|
+
typeMaxBytes: Object.fromEntries(limits.types.map((t) => [t, this.files.limitFor(t)])),
|
|
166
|
+
ownFilesOnly: true,
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
},
|
|
170
|
+
summary: async (i, ctx) => {
|
|
171
|
+
const f = named(ctx.file?.name ?? "?");
|
|
172
|
+
const own = await orElse(async () => (await this.files.ownerOf(ctx.orgId, i.file.fileId)) === ctx.actorAccountId, false);
|
|
173
|
+
const renamed = i.name !== undefined && i.name !== ctx.file?.name;
|
|
174
|
+
if (own && !renamed) {
|
|
175
|
+
return {
|
|
176
|
+
zh: `文件「${f}」已在你的文件中,不会重复添加`,
|
|
177
|
+
en: `The file "${f}" is already in your files; nothing is added`,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
return renamed
|
|
181
|
+
? {
|
|
182
|
+
zh: `把文件「${f}」以「${named(i.name ?? "")}」为名加入你的文件`,
|
|
183
|
+
en: `Add the file "${f}" to your files as "${named(i.name ?? "")}"`,
|
|
184
|
+
}
|
|
185
|
+
: { zh: `把文件「${f}」加入你的文件`, en: `Add the file "${f}" to your files` };
|
|
186
|
+
},
|
|
187
|
+
run: async (input, ctx) => {
|
|
188
|
+
const f = ctx.file;
|
|
189
|
+
if (f === undefined)
|
|
190
|
+
throw new Error("files.add: the file is missing");
|
|
191
|
+
const out = await this.files
|
|
192
|
+
.addFromBytes(ctx.orgId, ctx.actorAccountId, {
|
|
193
|
+
referencedId: input.file.fileId,
|
|
194
|
+
name: f.name,
|
|
195
|
+
...(input.name !== undefined && { rename: input.name }),
|
|
196
|
+
contentType: f.contentType,
|
|
197
|
+
bytes: f.bytes,
|
|
198
|
+
sha256: f.sha256,
|
|
199
|
+
signal: ctx.signal,
|
|
200
|
+
})
|
|
201
|
+
.catch((e) => {
|
|
202
|
+
if (e instanceof FileBlobClaimedError)
|
|
203
|
+
throw new ToolError(BLOB_CLAIMED_TEXT);
|
|
204
|
+
throw e;
|
|
205
|
+
});
|
|
206
|
+
return {
|
|
207
|
+
id: out.id,
|
|
208
|
+
name: out.name,
|
|
209
|
+
size: out.size,
|
|
210
|
+
contentType: out.contentType,
|
|
211
|
+
added: !out.existing,
|
|
212
|
+
};
|
|
213
|
+
},
|
|
214
|
+
handoff: (_input, result) => {
|
|
215
|
+
const id = result?.id;
|
|
216
|
+
return typeof id === "string"
|
|
217
|
+
? {
|
|
218
|
+
kind: "handoff",
|
|
219
|
+
title: { zh: "在文件页查看这个文件", en: "View this file on the Files page" },
|
|
220
|
+
target: { type: "link", url: fileLink(id) },
|
|
221
|
+
}
|
|
222
|
+
: null;
|
|
223
|
+
},
|
|
224
|
+
}),
|
|
225
|
+
defineOperation({
|
|
226
|
+
id: "files.delete",
|
|
227
|
+
description: "Ask to delete one of your files: nothing is deleted here; this checks the file and hands the person a link to the Files page to confirm the deletion there (its shared links stop working, and conversations show it as no longer available). Takes the id from files.list.",
|
|
228
|
+
input: z.object({ fileId: FileId }).strict(),
|
|
229
|
+
example: { fileId: "3f2b8a40-6c1d-4e0b-9a77-5d1e2c8b9f10" },
|
|
230
|
+
authz: { orgAction: "agents.use" },
|
|
231
|
+
mirrors: ["DELETE /api/v1/orgs/:orgId/files/:id"],
|
|
232
|
+
renames: { fileId: "id" },
|
|
233
|
+
errors: [
|
|
234
|
+
{
|
|
235
|
+
code: "file.not_found",
|
|
236
|
+
next: "Check the id with files.list: only your own files can be read.",
|
|
237
|
+
},
|
|
238
|
+
],
|
|
239
|
+
// nothing is written: the person deletes on the Files page
|
|
240
|
+
confirm: "read",
|
|
241
|
+
run: async (input, ctx) => {
|
|
242
|
+
const d = await this.library.details(ctx.orgId, ctx.actorAccountId, input.fileId);
|
|
243
|
+
return {
|
|
244
|
+
id: d.file.id,
|
|
245
|
+
name: d.file.name,
|
|
246
|
+
next: "Ask the person to confirm the deletion on the Files page (the link card).",
|
|
247
|
+
};
|
|
248
|
+
},
|
|
249
|
+
handoff: (input) => ({
|
|
250
|
+
kind: "handoff",
|
|
251
|
+
title: {
|
|
252
|
+
zh: "在文件页确认删除这个文件",
|
|
253
|
+
en: "Confirm deleting this file on the Files page",
|
|
254
|
+
},
|
|
255
|
+
target: { type: "link", url: fileLink(input.fileId) },
|
|
256
|
+
}),
|
|
257
|
+
}),
|
|
258
|
+
]);
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
FilesOperations = __decorate([
|
|
262
|
+
Injectable(),
|
|
263
|
+
__param(0, Inject(PlatformOperations)),
|
|
264
|
+
__param(1, Inject(LibraryQuery)),
|
|
265
|
+
__param(2, Inject(LibraryFilesService))
|
|
266
|
+
], FilesOperations);
|
|
267
|
+
export { FilesOperations };
|
|
@@ -108,13 +108,13 @@ function orgRow(i) {
|
|
|
108
108
|
summary: `Your ${r.kind} request was ${r.status}${r.reason ? `: ${r.reason}` : ""}.`,
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
|
-
case "
|
|
111
|
+
case "automation_attention": {
|
|
112
112
|
const a = i.attention;
|
|
113
113
|
const summary = a.reason === "missing_grants"
|
|
114
|
-
? `
|
|
114
|
+
? `Automation "${a.name}" ran without: ${a.missing.join(", ")}.${a.needsRole.length > 0 ? ` Needing a higher role than the owner has (cannot be pre-approved): ${a.needsRole.join(", ")}.` : ""}${a.needsAdmin.length > 0 ? ` Outside the organization's network allowlist (only an org admin can add them): ${a.needsAdmin.join(", ")}.` : ""}`
|
|
115
115
|
: a.reason === "failed"
|
|
116
|
-
? `
|
|
117
|
-
: `
|
|
116
|
+
? `Automation "${a.name}"'s latest run failed${a.error ? `: ${a.error}` : ""}.`
|
|
117
|
+
: `Automation "${a.name}" is paused (${a.reason}${a.pausedBy ? ` by ${a.pausedBy.name || a.pausedBy.id}` : ""}).`;
|
|
118
118
|
return {
|
|
119
119
|
...base,
|
|
120
120
|
name: a.name,
|
|
@@ -39,7 +39,7 @@ let OrgSettingsOperations = class OrgSettingsOperations {
|
|
|
39
39
|
this.registry.register([
|
|
40
40
|
defineOperation({
|
|
41
41
|
id: "org-settings.get",
|
|
42
|
-
description: "Read this org's settings: toolSearch, locale, sandboxToolPolicy, platformTool (on, read-only or off), outsideSandbox (allowed or off: whether the org's devices may be granted running a call outside their sandbox; absent follows the deployment, and the org may never exceed it), deviceNetwork (the org's device sandbox network: default, the network a device gets when its owner chooses none, and ceiling, the widest a device may choose, each open or allowlist and absent following the platform; base platform or none; extraHosts the org adds; excludedHosts platform hosts it drops; open means any public host, while loopback, private and cloud metadata addresses stay closed), wakeOnBackgroundTask (absent means it follows the deployment), theme (the org's default theme id, null or absent following the platform, and personal: allowed or locked), uiArrangement (per list slot, the extension contributions the org hides and their order; per single slot, the contribution that replaces the built-in as use, null for the built-in; a slot not listed follows the platform), the deployment's outside-sandbox switch (outsideSandbox) and device network (deviceNetwork: its default and ceiling, its allowlist, orgHosts: extend lets the org go beyond the allowlist, within makes it the hosts' ceiling, and off for the platform kill switch), effectiveNetwork (the mode and hosts the org's devices really get), externalSharing (on or off, absent meaning off: whether members may share conversation files through public links; the deployment's externalSharing must be allow too) with the deployment's externalSharing and shareMaxExpiryDays, promptSuggestions (on or off, absent meaning on: whether the composer suggests the person's next message after a completed run; the deployment's promptSuggestions must be on too) with the deployment's promptSuggestions, and the sandbox cpu / memory limits in effect.",
|
|
42
|
+
description: "Read this org's settings: toolSearch, locale, sandboxToolPolicy, platformTool (on, read-only or off), outsideSandbox (allowed or off: whether the org's devices may be granted running a call outside their sandbox; absent follows the deployment, and the org may never exceed it), deviceNetwork (the org's device sandbox network: default, the network a device gets when its owner chooses none, and ceiling, the widest a device may choose, each open or allowlist and absent following the platform; base platform or none; extraHosts the org adds; excludedHosts platform hosts it drops; open means any public host, while loopback, private and cloud metadata addresses stay closed), wakeOnBackgroundTask (absent means it follows the deployment), theme (the org's default theme id, null or absent following the platform, and personal: allowed or locked), navigation (pluginPages: per plugin page contribution key <extension>/<contribution>, the section primary or more an org admin chose; at most 3 primary; absent means every page follows its own suggestion), uiArrangement (per list slot, the extension contributions the org hides and their order; per single slot, the contribution that replaces the built-in as use, null for the built-in; a slot not listed follows the platform), the deployment's outside-sandbox switch (outsideSandbox) and device network (deviceNetwork: its default and ceiling, its allowlist, orgHosts: extend lets the org go beyond the allowlist, within makes it the hosts' ceiling, and off for the platform kill switch), effectiveNetwork (the mode and hosts the org's devices really get), externalSharing (on or off, absent meaning off: whether members may share conversation files through public links; the deployment's externalSharing must be allow too) with the deployment's externalSharing and shareMaxExpiryDays, promptSuggestions (on or off, absent meaning on: whether the composer suggests the person's next message after a completed run; the deployment's promptSuggestions must be on too) with the deployment's promptSuggestions, and the sandbox cpu / memory limits in effect.",
|
|
43
43
|
input: z.object({}).strict(),
|
|
44
44
|
example: {},
|
|
45
45
|
authz: { orgAction: "org.read" },
|
|
@@ -57,7 +57,7 @@ let OrgSettingsOperations = class OrgSettingsOperations {
|
|
|
57
57
|
}),
|
|
58
58
|
defineOperation({
|
|
59
59
|
id: "org-settings.update",
|
|
60
|
-
description: "Change this org's settings (org admins). Give only the settings to change; null clears outsideSandbox, deviceNetwork or wakeOnBackgroundTask so they follow the deployment again (refused when the deployment value is wider than what this tool may set). outsideSandbox (allowed or off; the platform must allow it) and deviceNetwork ({ default?, ceiling?: open | allowlist, base?: platform | none, extraHosts?, excludedHosts? }, replaced whole, so send the stored fields you keep; neither default nor ceiling may be open where the platform's ceiling is allowlist, and the default may not be above the ceiling) may only narrow the org's devices here: allowing outside-sandbox runs where the org has them off, opening the default or the ceiling, adding an extra host, dropping an exclusion or moving base from none to platform is refused and needs a person in the organization settings on the web. theme: { id, personal } sets the org's default theme (a theme id from themes.list, or null to follow the platform) and whether members may pick their own (allowed) or not (locked); null clears it. uiArrangement: { <slot>: { hidden, order } } (a list slot) or { <slot>: { use } } (a single slot: shell.brand, conversation.empty, conversation.composer.frame) replaces that slot's entry, where hidden, order and use name contribution keys <extension>/<contribution> (hidden ones are not listed in the web UI but their pages still open by URL; use null is the built-in); null for a slot makes it follow the platform again; platform.page is refused. externalSharing (on or off; null clears it, off) may only be turned off through this tool: turning it on needs a person in the organization settings on the web, and the platform must allow it. promptSuggestions (on or off; null clears it, absent meaning on: whether the composer suggests the person's next message after a completed run; the deployment's promptSuggestions must be on too) may be set either way through this tool. Setting platformTool to off or read-only takes effect from the next call and cuts this Platform tool off in the org; an org admin switches it back on in the web settings.",
|
|
60
|
+
description: "Change this org's settings (org admins). Give only the settings to change; null clears outsideSandbox, deviceNetwork or wakeOnBackgroundTask so they follow the deployment again (refused when the deployment value is wider than what this tool may set). outsideSandbox (allowed or off; the platform must allow it) and deviceNetwork ({ default?, ceiling?: open | allowlist, base?: platform | none, extraHosts?, excludedHosts? }, replaced whole, so send the stored fields you keep; neither default nor ceiling may be open where the platform's ceiling is allowlist, and the default may not be above the ceiling) may only narrow the org's devices here: allowing outside-sandbox runs where the org has them off, opening the default or the ceiling, adding an extra host, dropping an exclusion or moving base from none to platform is refused and needs a person in the organization settings on the web. theme: { id, personal } sets the org's default theme (a theme id from themes.list, or null to follow the platform) and whether members may pick their own (allowed) or not (locked); null clears it. uiArrangement: { <slot>: { hidden, order } } (a list slot) or { <slot>: { use } } (a single slot: shell.brand, conversation.empty, conversation.composer.frame) replaces that slot's entry, where hidden, order and use name contribution keys <extension>/<contribution> (hidden ones are not listed in the web UI but their pages still open by URL; use null is the built-in); null for a slot makes it follow the platform again; platform.page is refused. navigation: { pluginPages: [{ contribution: <extension>/<contribution>, section: primary or more }] } replaces where the org's plugin pages sit in the navigation (at most 3 primary, so send the whole list you keep); null clears it. externalSharing (on or off; null clears it, off) may only be turned off through this tool: turning it on needs a person in the organization settings on the web, and the platform must allow it. promptSuggestions (on or off; null clears it, absent meaning on: whether the composer suggests the person's next message after a completed run; the deployment's promptSuggestions must be on too) may be set either way through this tool. compaction ({ enabled?, threshold? (0.5 to 0.95), keepRecentTurns? (0 to 20), reserveTokens? (0 to 50000), maxOutputTokens? (1024 to 32000) }: the org's conversation compaction overrides, merged into the stored fields; null clears the override so the org follows the platform) may be set either way. promptCache ({ longTtl }: true or false; whether requests use the model's prompt cache tier of at least 30 minutes, such as 1 hour, where cache writes cost more; null clears it so the org follows the platform) may be set either way. Setting platformTool to off or read-only takes effect from the next call and cuts this Platform tool off in the org; an org admin switches it back on in the web settings.",
|
|
61
61
|
input: OrgSettingsPatchSchema.refine((i) => Object.values(i).some((v) => v !== undefined), {
|
|
62
62
|
message: "give at least one setting",
|
|
63
63
|
}),
|
|
@@ -82,6 +82,10 @@ let OrgSettingsOperations = class OrgSettingsOperations {
|
|
|
82
82
|
code: "org.external_sharing_not_allowed",
|
|
83
83
|
next: "Through this tool external sharing may only be turned off; to turn it on, ask an org admin to change it in the organization settings on the web. When the platform denies external sharing (org-settings.get shows deployment.externalSharing), a super admin must allow it first.",
|
|
84
84
|
},
|
|
85
|
+
{
|
|
86
|
+
code: "org_settings.nav_primary_limit",
|
|
87
|
+
next: "At most 3 plugin pages can be in the primary navigation: move one to more, or drop it from the list, and send the whole navigation.pluginPages again.",
|
|
88
|
+
},
|
|
85
89
|
{
|
|
86
90
|
code: "theme.not_available",
|
|
87
91
|
next: "Pick a theme id that themes.list shows for this org, or null to follow the platform.",
|
|
@@ -274,6 +274,7 @@ let OrgsOperations = class OrgsOperations {
|
|
|
274
274
|
"devicesDefaultProvider",
|
|
275
275
|
"attribution",
|
|
276
276
|
"compaction",
|
|
277
|
+
"promptCache",
|
|
277
278
|
"externalSharing",
|
|
278
279
|
"shareMaxExpiryDays",
|
|
279
280
|
"htmlRenderCdnAllowlist",
|
|
@@ -693,7 +694,7 @@ let OrgsOperations = class OrgsOperations {
|
|
|
693
694
|
}),
|
|
694
695
|
defineOperation({
|
|
695
696
|
id: "orgs.audit",
|
|
696
|
-
description: "The audit log of this conversation's org (org admins), newest first: members and invitations, settings, agents, connectors, skills, plugins and extensions in the org, channels,
|
|
697
|
+
description: "The audit log of this conversation's org (org admins), newest first: members and invitations, settings, agents, connectors, skills, plugins and extensions in the org, channels, automations. Each event has its id, time, actor (id, name, email; null for the kernel itself), viaToken (done with a personal access token), viaAgent (done through the Platform tool), action and target; never the event's details. action filters by an action name or its prefix (e.g. org.member.). limit is 1 to 100 (default 20); pages by keyset: pass the returned next as params.after (null: no more).",
|
|
697
698
|
input: OrgAuditListQuery.strict(),
|
|
698
699
|
example: { limit: 20 },
|
|
699
700
|
authz: { orgAction: "org.update" },
|
|
@@ -50,7 +50,7 @@ const PUSH_CATEGORY_NAMES = {
|
|
|
50
50
|
waiting: { zh: "等你处理", en: "Waiting for you" },
|
|
51
51
|
replies: { zh: "智能体回复", en: "Agent replies" },
|
|
52
52
|
tasks: { zh: "任务状态", en: "Task status" },
|
|
53
|
-
|
|
53
|
+
automations: { zh: "自动化", en: "Automations" },
|
|
54
54
|
};
|
|
55
55
|
/**
|
|
56
56
|
* The `platform` domain: orientation and what this agent is (spec §7, synthetic), and the
|
|
@@ -257,7 +257,7 @@ let PlatformOperationsProvider = class PlatformOperationsProvider {
|
|
|
257
257
|
}),
|
|
258
258
|
defineOperation({
|
|
259
259
|
id: "platform.push-preferences",
|
|
260
|
-
description: "Read your own push notification switches for your mobile app: waiting (approvals, questions and connect requests waiting for you), replies (an agent's run in your conversation finished or failed), tasks (background tasks and sub-agents finished) and
|
|
260
|
+
description: "Read your own push notification switches for your mobile app: waiting (approvals, questions and connect requests waiting for you), replies (an agent's run in your conversation finished or failed), tasks (background tasks and sub-agents finished) and automations (your automation ran or failed). Each is true unless you switched it off; they apply in every org.",
|
|
261
261
|
input: EMPTY,
|
|
262
262
|
example: {},
|
|
263
263
|
// any signed-in person may call the route; every run's actor is a member of this org
|
|
@@ -268,7 +268,7 @@ let PlatformOperationsProvider = class PlatformOperationsProvider {
|
|
|
268
268
|
}),
|
|
269
269
|
defineOperation({
|
|
270
270
|
id: "platform.set-push-preferences",
|
|
271
|
-
description: "Switch your own push notification categories on or off; give only the ones to change (waiting, replies, tasks,
|
|
271
|
+
description: "Switch your own push notification categories on or off; give only the ones to change (waiting, replies, tasks, automations: true or false), the others keep their values. They apply to every device of yours that receives push, in every org.",
|
|
272
272
|
input: PushPreferencesPatchSchema,
|
|
273
273
|
example: { replies: false },
|
|
274
274
|
authz: { orgAction: "agents.use" },
|
|
@@ -277,7 +277,7 @@ let PlatformOperationsProvider = class PlatformOperationsProvider {
|
|
|
277
277
|
errors: [
|
|
278
278
|
{
|
|
279
279
|
code: "validation_failed",
|
|
280
|
-
next: "Give at least one of waiting, replies, tasks,
|
|
280
|
+
next: "Give at least one of waiting, replies, tasks, automations, each true or false.",
|
|
281
281
|
},
|
|
282
282
|
],
|
|
283
283
|
summary: async (input) => {
|
|
@@ -56,7 +56,7 @@ let SharesOperations = class SharesOperations {
|
|
|
56
56
|
this.registry.register([
|
|
57
57
|
defineOperation({
|
|
58
58
|
id: "conversations.list-shares",
|
|
59
|
-
description: "List shared links to
|
|
59
|
+
description: "List shared links to files, newest first: your own (scope mine, the default) or every member's in the org (scope all, org admins only). Each row has the file name, state (live, suspended, expired, revoked), the audience (internal: signed-in members; external: anyone with the link), the expiry and who shared it; revoked and expired links stay listed for 7 days. Pages by 50: pass the returned next as params.cursor.",
|
|
60
60
|
input: z.object({ scope: ListSharesQuery.shape.scope, cursor: Cursor.optional() }).strict(),
|
|
61
61
|
example: { scope: "mine" },
|
|
62
62
|
authz: { orgAction: "agents.use" },
|
|
@@ -73,7 +73,7 @@ let SharesOperations = class SharesOperations {
|
|
|
73
73
|
}),
|
|
74
74
|
defineOperation({
|
|
75
75
|
id: "conversations.revoke-share",
|
|
76
|
-
description: "Revoke a shared link to a
|
|
76
|
+
description: "Revoke a shared link to a file: the link stops working at once (the file itself is kept). Takes the share id from conversations.list-shares. Your own shares, or any member's for org admins. Revoking a link already revoked changes nothing. The person confirms every revoke.",
|
|
77
77
|
input: z.object({ shareId: ShareIdParams.shape.shareId }).strict(),
|
|
78
78
|
example: { shareId: "3f2b8a40-6c1d-4e0b-9a77-5d1e2c8b9f10" },
|
|
79
79
|
authz: { orgAction: "agents.use" },
|
|
@@ -5,6 +5,7 @@ import { AgentSkillsOperations } from "./ops/agent-skills.ops.js";
|
|
|
5
5
|
import { AgentTemplatesOperations } from "./ops/agent-templates.ops.js";
|
|
6
6
|
import { AgentsOperations } from "./ops/agents.ops.js";
|
|
7
7
|
import { ApprovalsOperations } from "./ops/approvals.ops.js";
|
|
8
|
+
import { AutomationsOperations } from "./ops/automations.ops.js";
|
|
8
9
|
import { BackgroundOperations } from "./ops/background.ops.js";
|
|
9
10
|
import { CatalogAdminOperations } from "./ops/catalog-admin.ops.js";
|
|
10
11
|
import { ChannelsOperations } from "./ops/channels.ops.js";
|
|
@@ -15,6 +16,7 @@ import { DevicesOperations } from "./ops/devices.ops.js";
|
|
|
15
16
|
import { EvalsOperations } from "./ops/evals.ops.js";
|
|
16
17
|
import { ExtensionsOperations } from "./ops/extensions.ops.js";
|
|
17
18
|
import { ExtensionsAdminOperations } from "./ops/extensions-admin.ops.js";
|
|
19
|
+
import { FilesOperations } from "./ops/files.ops.js";
|
|
18
20
|
import { InboxOperations } from "./ops/inbox.ops.js";
|
|
19
21
|
import { MarketplacesOperations } from "./ops/marketplaces.ops.js";
|
|
20
22
|
import { ModelsOperations } from "./ops/models.ops.js";
|
|
@@ -27,7 +29,6 @@ import { PlatformIconsOperations } from "./ops/platform-icons.ops.js";
|
|
|
27
29
|
import { PluginsOperations } from "./ops/plugins.ops.js";
|
|
28
30
|
import { PreviewersOperations } from "./ops/previewers.ops.js";
|
|
29
31
|
import { RequestsOperations } from "./ops/requests.ops.js";
|
|
30
|
-
import { SchedulesOperations } from "./ops/schedules.ops.js";
|
|
31
32
|
import { SetupOperations } from "./ops/setup.ops.js";
|
|
32
33
|
import { SharesOperations } from "./ops/shares.ops.js";
|
|
33
34
|
import { SkillsOperations } from "./ops/skills.ops.js";
|
|
@@ -37,7 +38,7 @@ import { UiOperations } from "./ops/ui.ops.js";
|
|
|
37
38
|
* One provider per domain, each taking `PlatformOperations` as its first constructor argument:
|
|
38
39
|
* the parity test in `tools/checks` builds the operations from it without a Nest app.
|
|
39
40
|
*/
|
|
40
|
-
export declare const PLATFORM_OPERATION_PROVIDERS: readonly [typeof PlatformOperationsProvider, typeof SkillsOperations, typeof AgentsOperations, typeof AgentTemplatesOperations, typeof PluginsOperations, typeof MarketplacesOperations, typeof RequestsOperations, typeof ConnectorsOperations, typeof ExtensionsOperations, typeof ConversationsOperations, typeof ComponentsOperations, typeof AccountsOperations, typeof OrgsOperations, typeof AdminOperations, typeof CatalogAdminOperations, typeof OrgPluginsOperations, typeof ExtensionsAdminOperations, typeof ModelsOperations, typeof InboxOperations, typeof ApprovalsOperations, typeof ChannelsOperations, typeof OrgSettingsOperations, typeof EvalsOperations, typeof BackgroundOperations, typeof PreviewersOperations, typeof DevicesOperations, typeof AgentSkillsOperations, typeof ThemesOperations, typeof SetupOperations, typeof UiOperations, typeof AdminItemsOperations, typeof
|
|
41
|
+
export declare const PLATFORM_OPERATION_PROVIDERS: readonly [typeof PlatformOperationsProvider, typeof SkillsOperations, typeof AgentsOperations, typeof AgentTemplatesOperations, typeof PluginsOperations, typeof MarketplacesOperations, typeof RequestsOperations, typeof ConnectorsOperations, typeof ExtensionsOperations, typeof ConversationsOperations, typeof ComponentsOperations, typeof AccountsOperations, typeof OrgsOperations, typeof AdminOperations, typeof CatalogAdminOperations, typeof OrgPluginsOperations, typeof ExtensionsAdminOperations, typeof ModelsOperations, typeof InboxOperations, typeof ApprovalsOperations, typeof ChannelsOperations, typeof OrgSettingsOperations, typeof EvalsOperations, typeof BackgroundOperations, typeof PreviewersOperations, typeof DevicesOperations, typeof AgentSkillsOperations, typeof ThemesOperations, typeof SetupOperations, typeof UiOperations, typeof AdminItemsOperations, typeof AutomationsOperations, typeof OutboxOperations, typeof SharesOperations, typeof PlatformIconsOperations, typeof FilesOperations];
|
|
41
42
|
/**
|
|
42
43
|
* The `Platform` tool's operations (ruling P2): one provider per domain, each registering its
|
|
43
44
|
* operations into `PlatformOperations` from `onModuleInit`. It imports the domain modules, which
|