@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
|
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { Module } from "@nestjs/common";
|
|
8
8
|
import { AdminModule } from "../admin/admin.module.js";
|
|
9
9
|
import { AgentsModule } from "../agents/agents.module.js";
|
|
10
|
+
import { AutomationsModule } from "../automations/automations.module.js";
|
|
10
11
|
import { BackgroundModule } from "../background/background.module.js";
|
|
11
12
|
import { AppearanceModule } from "../catalog/appearance.service.js";
|
|
12
13
|
import { CatalogModule } from "../catalog/catalog.module.js";
|
|
@@ -16,13 +17,13 @@ import { DevicesModule } from "../devices/devices.module.js";
|
|
|
16
17
|
import { EvalsModule } from "../evals/evals.module.js";
|
|
17
18
|
import { ExtensionsModule } from "../extensions/extensions.module.js";
|
|
18
19
|
import { FilesModule } from "../files/files.module.js";
|
|
20
|
+
import { LibraryReadModule } from "../files/library-read.module.js";
|
|
19
21
|
import { IdentityModule } from "../identity/identity.module.js";
|
|
20
22
|
import { InboxModule } from "../inbox/inbox.module.js";
|
|
21
23
|
import { ModelsModule } from "../models/models.module.js";
|
|
22
24
|
import { OrgsModule } from "../orgs/orgs.module.js";
|
|
23
25
|
import { PushModule } from "../push/push.module.js";
|
|
24
26
|
import { ProvidersModule } from "../runtime/providers.js";
|
|
25
|
-
import { SchedulesModule } from "../schedules/schedules.module.js";
|
|
26
27
|
import { SetupModule } from "../setup/setup.module.js";
|
|
27
28
|
import { SharesModule } from "../shares/shares.module.js";
|
|
28
29
|
import { SkillsModule } from "../skills/skills.module.js";
|
|
@@ -35,6 +36,7 @@ import { AgentSkillsOperations } from "./ops/agent-skills.ops.js";
|
|
|
35
36
|
import { AgentTemplatesOperations } from "./ops/agent-templates.ops.js";
|
|
36
37
|
import { AgentsOperations } from "./ops/agents.ops.js";
|
|
37
38
|
import { ApprovalsOperations } from "./ops/approvals.ops.js";
|
|
39
|
+
import { AutomationsOperations } from "./ops/automations.ops.js";
|
|
38
40
|
import { BackgroundOperations } from "./ops/background.ops.js";
|
|
39
41
|
import { CatalogAdminOperations } from "./ops/catalog-admin.ops.js";
|
|
40
42
|
import { ChannelsOperations } from "./ops/channels.ops.js";
|
|
@@ -45,6 +47,7 @@ import { DevicesOperations } from "./ops/devices.ops.js";
|
|
|
45
47
|
import { EvalsOperations } from "./ops/evals.ops.js";
|
|
46
48
|
import { ExtensionsOperations } from "./ops/extensions.ops.js";
|
|
47
49
|
import { ExtensionsAdminOperations } from "./ops/extensions-admin.ops.js";
|
|
50
|
+
import { FilesOperations } from "./ops/files.ops.js";
|
|
48
51
|
import { InboxOperations } from "./ops/inbox.ops.js";
|
|
49
52
|
import { MarketplacesOperations } from "./ops/marketplaces.ops.js";
|
|
50
53
|
import { ModelsOperations } from "./ops/models.ops.js";
|
|
@@ -57,7 +60,6 @@ import { PlatformIconsOperations } from "./ops/platform-icons.ops.js";
|
|
|
57
60
|
import { PluginsOperations } from "./ops/plugins.ops.js";
|
|
58
61
|
import { PreviewersOperations } from "./ops/previewers.ops.js";
|
|
59
62
|
import { RequestsOperations } from "./ops/requests.ops.js";
|
|
60
|
-
import { SchedulesOperations } from "./ops/schedules.ops.js";
|
|
61
63
|
import { SetupOperations } from "./ops/setup.ops.js";
|
|
62
64
|
import { SharesOperations } from "./ops/shares.ops.js";
|
|
63
65
|
import { SkillsOperations } from "./ops/skills.ops.js";
|
|
@@ -110,14 +112,16 @@ export const PLATFORM_OPERATION_PROVIDERS = [
|
|
|
110
112
|
UiOperations,
|
|
111
113
|
// every org's agents and connectors, the conversation org's through the tool (spec §4.5)
|
|
112
114
|
AdminItemsOperations,
|
|
113
|
-
//
|
|
114
|
-
|
|
115
|
+
// automations (scheduled tasks spec §10)
|
|
116
|
+
AutomationsOperations,
|
|
115
117
|
// dead outbox rows (transactional outbox spec §3.4)
|
|
116
118
|
OutboxOperations,
|
|
117
119
|
// shared file links (file sharing spec §10)
|
|
118
120
|
SharesOperations,
|
|
119
121
|
// the platform icon (mobile layout spec §10.2.1)
|
|
120
122
|
PlatformIconsOperations,
|
|
123
|
+
// the person's file library (file library spec §6)
|
|
124
|
+
FilesOperations,
|
|
121
125
|
];
|
|
122
126
|
/**
|
|
123
127
|
* The `Platform` tool's operations (ruling P2): one provider per domain, each registering its
|
|
@@ -148,9 +152,10 @@ PlatformOpsModule = __decorate([
|
|
|
148
152
|
DevicesModule,
|
|
149
153
|
BackgroundModule,
|
|
150
154
|
FilesModule,
|
|
155
|
+
LibraryReadModule,
|
|
151
156
|
ThemesModule,
|
|
152
157
|
SetupModule,
|
|
153
|
-
|
|
158
|
+
AutomationsModule,
|
|
154
159
|
SharesModule,
|
|
155
160
|
PushModule,
|
|
156
161
|
],
|
|
@@ -8,6 +8,7 @@ import { OUTBOX_DEAD_ROUTES } from "../admin/outbox-dead.schemas.js";
|
|
|
8
8
|
import { OVERVIEW_ROUTES } from "../admin/overview.schemas.js";
|
|
9
9
|
import { AGENT_ROUTES } from "../agents/agents.schemas.js";
|
|
10
10
|
import { AGENT_TEMPLATE_ROUTES } from "../agents/templates.schemas.js";
|
|
11
|
+
import { AUTOMATION_ROUTES } from "../automations/automations.schemas.js";
|
|
11
12
|
import { BACKGROUND_ROUTES } from "../background/background.schemas.js";
|
|
12
13
|
import { ADMIN_CATALOG_ROUTES } from "../catalog/admin-catalog.schemas.js";
|
|
13
14
|
import { APPEARANCE_ROUTES } from "../catalog/appearance.schemas.js";
|
|
@@ -21,13 +22,13 @@ import { CONVERSATION_ROUTES } from "../conversations/conversations.schemas.js";
|
|
|
21
22
|
import { DEVICE_ROUTES } from "../devices/devices.schemas.js";
|
|
22
23
|
import { EVAL_ROUTES } from "../evals/evals.schemas.js";
|
|
23
24
|
import { EXTENSION_POINT_ROUTES } from "../extensions/point-defaults.schemas.js";
|
|
25
|
+
import { FILE_ROUTES } from "../files/library.schemas.js";
|
|
24
26
|
import { FILE_PREVIEWER_ROUTES } from "../files/previewers.schemas.js";
|
|
25
27
|
import { ME_ROUTES } from "../identity/me.schemas.js";
|
|
26
28
|
import { INBOX_ROUTES } from "../inbox/inbox.schemas.js";
|
|
27
29
|
import { ORG_MODEL_ROUTES } from "../models/org-models.schemas.js";
|
|
28
30
|
import { ORG_ROUTES, ORG_SETTINGS_ROUTES } from "../orgs/orgs.schemas.js";
|
|
29
31
|
import { PUSH_ROUTES } from "../push/push.schemas.js";
|
|
30
|
-
import { SCHEDULE_ROUTES } from "../schedules/schedules.schemas.js";
|
|
31
32
|
import { SETUP_CHECK_ROUTES } from "../setup/setup-checks.schemas.js";
|
|
32
33
|
import { SETUP_GUIDE_ROUTES } from "../setup/setup-guides.schemas.js";
|
|
33
34
|
import { SHARE_ROUTES } from "../shares/shares.schemas.js";
|
|
@@ -92,8 +93,8 @@ export const ROUTE_SCHEMAS = [
|
|
|
92
93
|
...UI_ROUTES,
|
|
93
94
|
// every org's agents and connectors (admin agents and connectors spec §4)
|
|
94
95
|
...ADMIN_ITEM_ROUTES,
|
|
95
|
-
//
|
|
96
|
-
...
|
|
96
|
+
// automations (scheduled tasks spec §10)
|
|
97
|
+
...AUTOMATION_ROUTES,
|
|
97
98
|
// the admin overview and the platform-level audit log (admin overview spec §5.2)
|
|
98
99
|
...OVERVIEW_ROUTES,
|
|
99
100
|
...AUDIT_ROUTES,
|
|
@@ -104,4 +105,6 @@ export const ROUTE_SCHEMAS = [
|
|
|
104
105
|
...LOGIN_SOURCE_ROUTES,
|
|
105
106
|
// shares of conversation files (file sharing spec §10)
|
|
106
107
|
...SHARE_ROUTES,
|
|
108
|
+
// the person's file library (file library spec §6)
|
|
109
|
+
...FILE_ROUTES,
|
|
107
110
|
];
|
package/dist/push/jobs.d.ts
CHANGED
|
@@ -12,8 +12,8 @@ export declare const PUSH_FANOUT_JOB = "push-fanout";
|
|
|
12
12
|
export declare const PUSH_DELIVER_JOB = "push-deliver";
|
|
13
13
|
/** The event id of a conversation event (`conv-<conversationId>-<seq>`). */
|
|
14
14
|
export declare const conversationEventId: (conversationId: string, seq: number) => string;
|
|
15
|
-
/** The event id of
|
|
16
|
-
export declare const
|
|
15
|
+
/** The event id of an automation run's settle (`automation-<taskRunId>`). */
|
|
16
|
+
export declare const automationRunEventId: (taskRunId: string) => string;
|
|
17
17
|
/** One fanout per event: `push-fanout-<eventId>`. */
|
|
18
18
|
export declare const pushFanoutJobId: (eventId: string) => string;
|
|
19
19
|
/** One delivery per event and registration: `push-<eventId>-<registrationId>`. */
|
|
@@ -26,7 +26,7 @@ export type PushFanoutData = {
|
|
|
26
26
|
conversationId: string;
|
|
27
27
|
seq: number;
|
|
28
28
|
} | {
|
|
29
|
-
kind: "
|
|
29
|
+
kind: "automation";
|
|
30
30
|
taskRunId: string;
|
|
31
31
|
};
|
|
32
32
|
};
|
package/dist/push/jobs.js
CHANGED
|
@@ -11,8 +11,8 @@ export const PUSH_FANOUT_JOB = "push-fanout";
|
|
|
11
11
|
export const PUSH_DELIVER_JOB = "push-deliver";
|
|
12
12
|
/** The event id of a conversation event (`conv-<conversationId>-<seq>`). */
|
|
13
13
|
export const conversationEventId = (conversationId, seq) => `conv-${conversationId}-${seq}`;
|
|
14
|
-
/** The event id of
|
|
15
|
-
export const
|
|
14
|
+
/** The event id of an automation run's settle (`automation-<taskRunId>`). */
|
|
15
|
+
export const automationRunEventId = (taskRunId) => `automation-${taskRunId}`;
|
|
16
16
|
/** One fanout per event: `push-fanout-<eventId>`. */
|
|
17
17
|
export const pushFanoutJobId = (eventId) => `push-fanout-${eventId}`;
|
|
18
18
|
/** One delivery per event and registration: `push-<eventId>-<registrationId>`. */
|
|
@@ -31,7 +31,7 @@ let PushPreferencesService = class PushPreferencesService {
|
|
|
31
31
|
.select(["category", "enabled"])
|
|
32
32
|
.where("account_id", "=", accountId)
|
|
33
33
|
.execute();
|
|
34
|
-
const out = { waiting: true, replies: true, tasks: true,
|
|
34
|
+
const out = { waiting: true, replies: true, tasks: true, automations: true };
|
|
35
35
|
for (const r of rows)
|
|
36
36
|
out[r.category] = r.enabled;
|
|
37
37
|
return out;
|
package/dist/push/push-owed.d.ts
CHANGED
|
@@ -20,13 +20,13 @@ export declare class PushOwed {
|
|
|
20
20
|
*/
|
|
21
21
|
oweIn(conversationId: string, orgId: string, kind: string, events: readonly ConversationEvent[]): Promise<void>;
|
|
22
22
|
/**
|
|
23
|
-
* The fanout of
|
|
23
|
+
* The fanout of an automation run's settle (completed or failed), in the caller's
|
|
24
24
|
* transaction.
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
oweAutomationRun(taskRunId: string, orgId: string): Promise<void>;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
* {@link PushOwed}: infra and the extension registry only, so the event log and the
|
|
29
|
+
* {@link PushOwed}: infra and the extension registry only, so the event log and the automation
|
|
30
30
|
* run tracker import it without a cycle.
|
|
31
31
|
*/
|
|
32
32
|
export declare class PushOwedModule {
|
package/dist/push/push-owed.js
CHANGED
|
@@ -11,7 +11,7 @@ import { Inject, Injectable, Module } from "@nestjs/common";
|
|
|
11
11
|
import { TransactionHost } from "../infra/database/transaction-host.js";
|
|
12
12
|
import { Transactional } from "../infra/database/transactional.decorator.js";
|
|
13
13
|
import { OutboxService } from "../infra/outbox/outbox.service.js";
|
|
14
|
-
import { conversationEventId, PUSH_FANOUT_JOB, PUSH_QUEUE, pushFanoutJobId,
|
|
14
|
+
import { automationRunEventId, conversationEventId, PUSH_FANOUT_JOB, PUSH_QUEUE, pushFanoutJobId, } from "./jobs.js";
|
|
15
15
|
import { PushHostModule, PushProviderHost } from "./provider-host.js";
|
|
16
16
|
import { pushTriggerOf } from "./triggers.js";
|
|
17
17
|
/**
|
|
@@ -50,13 +50,13 @@ let PushOwed = class PushOwed {
|
|
|
50
50
|
})));
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
* The fanout of
|
|
53
|
+
* The fanout of an automation run's settle (completed or failed), in the caller's
|
|
54
54
|
* transaction.
|
|
55
55
|
*/
|
|
56
|
-
async
|
|
56
|
+
async oweAutomationRun(taskRunId, orgId) {
|
|
57
57
|
if (!this.host.any())
|
|
58
58
|
return;
|
|
59
|
-
await this.outbox.add(fanoutJob(
|
|
59
|
+
await this.outbox.add(fanoutJob(automationRunEventId(taskRunId), orgId, { kind: "automation", taskRunId }));
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
__decorate([
|
|
@@ -64,7 +64,7 @@ __decorate([
|
|
|
64
64
|
], PushOwed.prototype, "oweIn", null);
|
|
65
65
|
__decorate([
|
|
66
66
|
Transactional({ propagation: "mandatory" })
|
|
67
|
-
], PushOwed.prototype, "
|
|
67
|
+
], PushOwed.prototype, "oweAutomationRun", null);
|
|
68
68
|
PushOwed = __decorate([
|
|
69
69
|
Injectable(),
|
|
70
70
|
__param(0, Inject(OutboxService)),
|
|
@@ -82,7 +82,7 @@ function fanoutJob(eventId, orgId, source) {
|
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
85
|
-
* {@link PushOwed}: infra and the extension registry only, so the event log and the
|
|
85
|
+
* {@link PushOwed}: infra and the extension registry only, so the event log and the automation
|
|
86
86
|
* run tracker import it without a cycle.
|
|
87
87
|
*/
|
|
88
88
|
let PushOwedModule = class PushOwedModule {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { RouteSchemas } from "../platform/route-schemas.js";
|
|
3
3
|
/** The push categories a person switches (mobile app spec §9.4); an absent preference is on. */
|
|
4
|
-
export declare const PUSH_CATEGORIES: readonly ["waiting", "replies", "tasks", "
|
|
4
|
+
export declare const PUSH_CATEGORIES: readonly ["waiting", "replies", "tasks", "automations"];
|
|
5
5
|
export type PushCategory = (typeof PUSH_CATEGORIES)[number];
|
|
6
6
|
/**
|
|
7
7
|
* `POST /me/push-registrations`: what the app's shell returns from `push@1.register()`, plus the
|
|
@@ -64,7 +64,7 @@ export declare const PushPreferencesSchema: z.ZodObject<{
|
|
|
64
64
|
waiting: z.ZodBoolean;
|
|
65
65
|
replies: z.ZodBoolean;
|
|
66
66
|
tasks: z.ZodBoolean;
|
|
67
|
-
|
|
67
|
+
automations: z.ZodBoolean;
|
|
68
68
|
}, z.core.$strict>;
|
|
69
69
|
export type PushPreferences = z.infer<typeof PushPreferencesSchema>;
|
|
70
70
|
/** `PUT /me/push-preferences`: the switches to change, at least one. */
|
|
@@ -72,14 +72,14 @@ export declare const PushPreferencesPatchSchema: z.ZodObject<{
|
|
|
72
72
|
waiting: z.ZodOptional<z.ZodBoolean>;
|
|
73
73
|
replies: z.ZodOptional<z.ZodBoolean>;
|
|
74
74
|
tasks: z.ZodOptional<z.ZodBoolean>;
|
|
75
|
-
|
|
75
|
+
automations: z.ZodOptional<z.ZodBoolean>;
|
|
76
76
|
}, z.core.$strict>;
|
|
77
77
|
export type PushPreferencesPatch = z.infer<typeof PushPreferencesPatchSchema>;
|
|
78
78
|
declare const PushPreferencesPatchDto_base: import("../infra/validation/create-zod-dto.js").ZodDtoClass<z.ZodObject<{
|
|
79
79
|
waiting: z.ZodOptional<z.ZodBoolean>;
|
|
80
80
|
replies: z.ZodOptional<z.ZodBoolean>;
|
|
81
81
|
tasks: z.ZodOptional<z.ZodBoolean>;
|
|
82
|
-
|
|
82
|
+
automations: z.ZodOptional<z.ZodBoolean>;
|
|
83
83
|
}, z.core.$strict>>;
|
|
84
84
|
export declare class PushPreferencesPatchDto extends PushPreferencesPatchDto_base {
|
|
85
85
|
}
|
|
@@ -2,7 +2,7 @@ import { PUSH_LIMITS } from "@capybara-hq/plugin-sdk";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { createZodDto } from "../infra/validation/create-zod-dto.js";
|
|
4
4
|
/** The push categories a person switches (mobile app spec §9.4); an absent preference is on. */
|
|
5
|
-
export const PUSH_CATEGORIES = ["waiting", "replies", "tasks", "
|
|
5
|
+
export const PUSH_CATEGORIES = ["waiting", "replies", "tasks", "automations"];
|
|
6
6
|
/**
|
|
7
7
|
* `POST /me/push-registrations`: what the app's shell returns from `push@1.register()`, plus the
|
|
8
8
|
* person's locale and a device name. The token is sealed at rest and never echoed.
|
|
@@ -39,11 +39,11 @@ export const PushPreferencesSchema = z
|
|
|
39
39
|
waiting: z.boolean(),
|
|
40
40
|
replies: z.boolean(),
|
|
41
41
|
tasks: z.boolean(),
|
|
42
|
-
|
|
42
|
+
automations: z.boolean(),
|
|
43
43
|
})
|
|
44
44
|
.strict();
|
|
45
45
|
/** `PUT /me/push-preferences`: the switches to change, at least one. */
|
|
46
|
-
export const PushPreferencesPatchSchema = PushPreferencesSchema.partial().refine((p) => Object.values(p).some((v) => v !== undefined), { message: "give at least one of waiting, replies, tasks,
|
|
46
|
+
export const PushPreferencesPatchSchema = PushPreferencesSchema.partial().refine((p) => Object.values(p).some((v) => v !== undefined), { message: "give at least one of waiting, replies, tasks, automations" });
|
|
47
47
|
export class PushPreferencesPatchDto extends createZodDto(PushPreferencesPatchSchema, "PushPreferencesPatch") {
|
|
48
48
|
}
|
|
49
49
|
/** The push routes the Platform operations mirror (`check:platform-ops` keys). */
|
|
@@ -15,15 +15,15 @@ export type ResolvedRecipients = Omit<ResolvedPush, "eventId">;
|
|
|
15
15
|
* while it is still `pending`; a question only while pending; both, and a connect request, go to
|
|
16
16
|
* the run's trigger account (an approval assigned to someone goes to that person);
|
|
17
17
|
* - `replies`: chat conversations only, to the conversation's owner, never for a run serving a
|
|
18
|
-
*
|
|
18
|
+
* automation (that pushes as `automations`);
|
|
19
19
|
* - `tasks`: the root conversation's owner;
|
|
20
|
-
* - `
|
|
20
|
+
* - `automations`: the task's owner, for a task run `completed` or `failed` of a task not deleted;
|
|
21
21
|
* - eval conversations (a sub-agent under an eval root too) and deleted conversations never push;
|
|
22
22
|
* - an escalated approval whose run is gone pushes nothing (its initiator is unknown).
|
|
23
23
|
*
|
|
24
24
|
* The path carries the org (`/chat/<root>?org=<orgId>`, `&subagent=<child>` for an event of a
|
|
25
|
-
* sub-agent's log;
|
|
26
|
-
* is the root conversation (`
|
|
25
|
+
* sub-agent's log; an automation run without a conversation opens `/inbox?org=<orgId>`), the thread
|
|
26
|
+
* is the root conversation (`automation-<taskId>` for an automation), the title the root's agent name
|
|
27
27
|
* (the task's name).
|
|
28
28
|
*/
|
|
29
29
|
export declare function resolveRecipients(db: KernelSchemaDb, source: PushFanoutData["source"]): Promise<ResolvedRecipients | null>;
|
package/dist/push/recipients.js
CHANGED
|
@@ -13,20 +13,20 @@ import { pushTriggerOf } from "./triggers.js";
|
|
|
13
13
|
* while it is still `pending`; a question only while pending; both, and a connect request, go to
|
|
14
14
|
* the run's trigger account (an approval assigned to someone goes to that person);
|
|
15
15
|
* - `replies`: chat conversations only, to the conversation's owner, never for a run serving a
|
|
16
|
-
*
|
|
16
|
+
* automation (that pushes as `automations`);
|
|
17
17
|
* - `tasks`: the root conversation's owner;
|
|
18
|
-
* - `
|
|
18
|
+
* - `automations`: the task's owner, for a task run `completed` or `failed` of a task not deleted;
|
|
19
19
|
* - eval conversations (a sub-agent under an eval root too) and deleted conversations never push;
|
|
20
20
|
* - an escalated approval whose run is gone pushes nothing (its initiator is unknown).
|
|
21
21
|
*
|
|
22
22
|
* The path carries the org (`/chat/<root>?org=<orgId>`, `&subagent=<child>` for an event of a
|
|
23
|
-
* sub-agent's log;
|
|
24
|
-
* is the root conversation (`
|
|
23
|
+
* sub-agent's log; an automation run without a conversation opens `/inbox?org=<orgId>`), the thread
|
|
24
|
+
* is the root conversation (`automation-<taskId>` for an automation), the title the root's agent name
|
|
25
25
|
* (the task's name).
|
|
26
26
|
*/
|
|
27
27
|
export async function resolveRecipients(db, source) {
|
|
28
|
-
return source.kind === "
|
|
29
|
-
?
|
|
28
|
+
return source.kind === "automation"
|
|
29
|
+
? resolveAutomation(db, source.taskRunId)
|
|
30
30
|
: resolveConversation(db, source.conversationId, source.seq);
|
|
31
31
|
}
|
|
32
32
|
async function resolveConversation(db, conversationId, seq) {
|
|
@@ -132,11 +132,11 @@ async function resolveConversation(db, conversationId, seq) {
|
|
|
132
132
|
return null;
|
|
133
133
|
const run = await db
|
|
134
134
|
.selectFrom("runs")
|
|
135
|
-
.select("
|
|
135
|
+
.select("automation_run_id")
|
|
136
136
|
.where("id", "=", event.run_id)
|
|
137
137
|
.where("conversation_id", "=", conversationId)
|
|
138
138
|
.executeTakeFirst();
|
|
139
|
-
if (!run || run.
|
|
139
|
+
if (!run || run.automation_run_id !== null)
|
|
140
140
|
return null;
|
|
141
141
|
candidates = [owner];
|
|
142
142
|
break;
|
|
@@ -168,24 +168,24 @@ async function resolveConversation(db, conversationId, seq) {
|
|
|
168
168
|
text: trigger.text,
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
|
-
async function
|
|
171
|
+
async function resolveAutomation(db, taskRunId) {
|
|
172
172
|
// org-filter: taskRunId comes from the kernel-written push fan-out job; this read learns the
|
|
173
173
|
// run's org (checked against its task's below), which every later read filters by
|
|
174
174
|
const row = await db
|
|
175
|
-
.selectFrom("
|
|
176
|
-
.innerJoin("
|
|
175
|
+
.selectFrom("automation_runs")
|
|
176
|
+
.innerJoin("automations", "automations.id", "automation_runs.automation_id")
|
|
177
177
|
.select([
|
|
178
|
-
"
|
|
179
|
-
"
|
|
180
|
-
"
|
|
181
|
-
"
|
|
182
|
-
"
|
|
183
|
-
"
|
|
184
|
-
"
|
|
178
|
+
"automation_runs.org_id",
|
|
179
|
+
"automation_runs.status",
|
|
180
|
+
"automation_runs.conversation_id",
|
|
181
|
+
"automations.id as automation_id",
|
|
182
|
+
"automations.org_id as task_org_id",
|
|
183
|
+
"automations.account_id",
|
|
184
|
+
"automations.name",
|
|
185
185
|
])
|
|
186
|
-
.where("
|
|
186
|
+
.where("automation_runs.id", "=", taskRunId)
|
|
187
187
|
// a deleted task pushes nothing
|
|
188
|
-
.where("
|
|
188
|
+
.where("automations.deleted_at", "is", null)
|
|
189
189
|
.executeTakeFirst();
|
|
190
190
|
if (!row || row.org_id !== row.task_org_id)
|
|
191
191
|
return null;
|
|
@@ -210,12 +210,12 @@ async function resolveSchedule(db, taskRunId) {
|
|
|
210
210
|
return {
|
|
211
211
|
orgId,
|
|
212
212
|
accountIds,
|
|
213
|
-
category: "
|
|
213
|
+
category: "automations",
|
|
214
214
|
path: conv === undefined ? `/inbox?org=${org}` : `/chat/${row.conversation_id}?org=${org}`,
|
|
215
|
-
threadId: `
|
|
215
|
+
threadId: `automation-${row.automation_id}`,
|
|
216
216
|
title: row.name,
|
|
217
217
|
conversationTitle: conv?.title ?? null,
|
|
218
|
-
text: row.status === "completed" ? "
|
|
218
|
+
text: row.status === "completed" ? "automationRan" : "automationFailed",
|
|
219
219
|
};
|
|
220
220
|
}
|
|
221
221
|
const optional = (id) => (id === null ? [] : [id]);
|
package/dist/push/texts.d.ts
CHANGED
|
@@ -6,16 +6,16 @@ export declare const PUSH_TEXT_KEYS: readonly PushTextKey[];
|
|
|
6
6
|
export declare function pushText(key: PushTextKey, locale: "zh" | "en"): string;
|
|
7
7
|
/** An event's push as the fanout resolved it (`recipients.ts`), with the event id. */
|
|
8
8
|
export interface ResolvedPush {
|
|
9
|
-
/** `conv-<conversationId>-<seq>` or `
|
|
9
|
+
/** `conv-<conversationId>-<seq>` or `automation-<taskRunId>`: the message's collapse id. */
|
|
10
10
|
eventId: string;
|
|
11
11
|
orgId: string;
|
|
12
12
|
accountIds: string[];
|
|
13
13
|
category: PushCategory;
|
|
14
14
|
/** In-app path with `?org=` (plan decision 8). */
|
|
15
15
|
path: string;
|
|
16
|
-
/** The root conversation id, or `
|
|
16
|
+
/** The root conversation id, or `automation-<taskId>`. */
|
|
17
17
|
threadId: string;
|
|
18
|
-
/** The agent's display name (the task's name for
|
|
18
|
+
/** The agent's display name (the task's name for an automation). */
|
|
19
19
|
title: string;
|
|
20
20
|
/** Shown only with `push.previews: "titles"`. */
|
|
21
21
|
conversationTitle: string | null;
|
package/dist/push/texts.js
CHANGED
|
@@ -8,8 +8,8 @@ const PUSH_TEXTS = {
|
|
|
8
8
|
runFailed: { en: "failed", zh: "运行失败" },
|
|
9
9
|
backgroundFinished: { en: "a background task ended", zh: "后台任务已结束" },
|
|
10
10
|
subagentFinished: { en: "a sub-agent finished", zh: "子智能体已完成" },
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
automationRan: { en: "your automation ran", zh: "你的自动化已运行" },
|
|
12
|
+
automationFailed: { en: "your automation failed", zh: "你的自动化运行失败" },
|
|
13
13
|
};
|
|
14
14
|
/** Every push text key. */
|
|
15
15
|
export const PUSH_TEXT_KEYS = Object.keys(PUSH_TEXTS);
|
package/dist/push/triggers.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ConversationEvent } from "../conversations/events.js";
|
|
|
2
2
|
import type { PushCategory } from "./push.schemas.js";
|
|
3
3
|
export type { PushCategory } from "./push.schemas.js";
|
|
4
4
|
/** The fixed sentences of a push body (`texts.ts` holds the copy). */
|
|
5
|
-
export type PushTextKey = "approval" | "question" | "connect" | "runFinished" | "runFailed" | "backgroundFinished" | "subagentFinished" | "
|
|
5
|
+
export type PushTextKey = "approval" | "question" | "connect" | "runFinished" | "runFailed" | "backgroundFinished" | "subagentFinished" | "automationRan" | "automationFailed";
|
|
6
6
|
/** What one event pushes: its category (the person's switch) and its sentence. */
|
|
7
7
|
export interface PushTrigger {
|
|
8
8
|
category: PushCategory;
|
|
@@ -6,6 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
var WorkerModule_1;
|
|
8
8
|
import { Module } from "@nestjs/common";
|
|
9
|
+
import { AutomationFireModule } from "../automations/fire.js";
|
|
9
10
|
import { BackgroundModule } from "../background/background.module.js";
|
|
10
11
|
import { BackgroundTaskPollJob } from "../background/poll.job.js";
|
|
11
12
|
import { RetireLegacyTasksJob } from "../background/retire-legacy-tasks.job.js";
|
|
@@ -28,6 +29,11 @@ import { EvalWorkersModule } from "../evals/evals.module.js";
|
|
|
28
29
|
import { ExtensionsModule } from "../extensions/extensions.module.js";
|
|
29
30
|
import { PluginsReconcileJob } from "../extensions/lifecycle.js";
|
|
30
31
|
import { LifecycleHookWorkersModule } from "../extensions/lifecycle-hooks.js";
|
|
32
|
+
import { BlobSweepJob } from "../files/blob-sweep.job.js";
|
|
33
|
+
import { FileDraftCleanupJob } from "../files/draft-cleanup.job.js";
|
|
34
|
+
import { FileLibraryKickoffJob } from "../files/hash-job.js";
|
|
35
|
+
import { LibraryFilesModule } from "../files/library.module.js";
|
|
36
|
+
import { FileLibraryJobsModule } from "../files/library-jobs.module.js";
|
|
31
37
|
import { AccountAvatarCleanupJob } from "../identity/account-avatars.service.js";
|
|
32
38
|
import { IdentityModule } from "../identity/identity.module.js";
|
|
33
39
|
import { InitialPasswordCleanupJob } from "../identity/initial-passwords.job.js";
|
|
@@ -45,7 +51,6 @@ import { RuntimeModule } from "../runtime/runtime.module.js";
|
|
|
45
51
|
import { UsageReportModule } from "../runtime/usage-report.js";
|
|
46
52
|
import { SandboxSweepJobs } from "../sandbox/jobs.js";
|
|
47
53
|
import { SandboxModule } from "../sandbox/sandbox.module.js";
|
|
48
|
-
import { ScheduledTaskFireModule } from "../schedules/fire.js";
|
|
49
54
|
import { ShareObjectsModule } from "../shares/share-objects.js";
|
|
50
55
|
import { ShareSweepJob } from "../shares/sweep.job.js";
|
|
51
56
|
import { StoragePurgeJob } from "../storage/purge.js";
|
|
@@ -96,6 +101,10 @@ let WorkerModule = WorkerModule_1 = class WorkerModule {
|
|
|
96
101
|
TitlesModule,
|
|
97
102
|
PromptSuggestionsModule,
|
|
98
103
|
AttachmentsModule,
|
|
104
|
+
// the hourly cleanup of expired uploads and drafts
|
|
105
|
+
LibraryFilesModule,
|
|
106
|
+
// the hashing and catch-up copy the kickoff owes
|
|
107
|
+
FileLibraryJobsModule,
|
|
99
108
|
IdentityModule,
|
|
100
109
|
StorageModule,
|
|
101
110
|
SandboxModule,
|
|
@@ -107,9 +116,9 @@ let WorkerModule = WorkerModule_1 = class WorkerModule {
|
|
|
107
116
|
OrgLockModule,
|
|
108
117
|
ExtensionsModule,
|
|
109
118
|
ChannelsModule,
|
|
110
|
-
// the
|
|
111
|
-
|
|
112
|
-
// the share
|
|
119
|
+
// the automation scanner (`@LockedCron`) and the fire job's body
|
|
120
|
+
AutomationFireModule,
|
|
121
|
+
// the legacy share snapshot deletions the maintenance processor still runs
|
|
113
122
|
ShareObjectsModule,
|
|
114
123
|
// the owed conversation notices the sweep delivers
|
|
115
124
|
ConversationNoticesModule,
|
|
@@ -118,6 +127,11 @@ let WorkerModule = WorkerModule_1 = class WorkerModule {
|
|
|
118
127
|
// the one repair of a run nobody runs (transactional outbox spec §8.3)
|
|
119
128
|
RunOrphanCheck,
|
|
120
129
|
AttachmentCleanupJob,
|
|
130
|
+
// expired uploads and composer drafts of the file library (file library spec §3)
|
|
131
|
+
FileDraftCleanupJob,
|
|
132
|
+
// the daily blob sweep and the hourly kickoff of hashing and the catch-up copy (§7, §9)
|
|
133
|
+
BlobSweepJob,
|
|
134
|
+
FileLibraryKickoffJob,
|
|
121
135
|
StoragePurgeJob,
|
|
122
136
|
SandboxSweepJobs,
|
|
123
137
|
LegacySandboxCleanupJob,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { KernelSchemaDb } from "../db/kernel-schema.js";
|
|
2
|
-
import { type CompactionSettings, SettingsService } from "../identity/settings.js";
|
|
2
|
+
import { type CompactionSettings, type PromptCacheSettings, SettingsService } from "../identity/settings.js";
|
|
3
3
|
import { KernelDb } from "../infra/database/kernel-db.js";
|
|
4
4
|
export { COMPACTION_SETTINGS, type CompactionSettings, effectiveCompactionSettings, } from "../identity/settings.js";
|
|
5
5
|
/**
|
|
@@ -9,6 +9,16 @@ export { COMPACTION_SETTINGS, type CompactionSettings, effectiveCompactionSettin
|
|
|
9
9
|
* job), which would otherwise import the runtime module in a cycle.
|
|
10
10
|
*/
|
|
11
11
|
export declare function resolveCompactionSettings(settings: Pick<SettingsService, "get">, db: KernelSchemaDb, orgId: string): Promise<CompactionSettings>;
|
|
12
|
+
/** The settings a model step reads: compaction and the prompt cache, from one read of each source. */
|
|
13
|
+
export interface StepSettings {
|
|
14
|
+
compaction: CompactionSettings;
|
|
15
|
+
promptCache: PromptCacheSettings;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The effective compaction and prompt cache settings for `orgId` (org override > platform setting
|
|
19
|
+
* > built-in default), with one read of the platform settings and one of the org row.
|
|
20
|
+
*/
|
|
21
|
+
export declare function resolveStepSettings(settings: Pick<SettingsService, "get">, db: KernelSchemaDb, orgId: string): Promise<StepSettings>;
|
|
12
22
|
/**
|
|
13
23
|
* The compaction settings in effect for one organization (context compaction spec §4.8):
|
|
14
24
|
* the organization's override over the platform's stored settings, which carry the built-in
|
|
@@ -21,4 +31,6 @@ export declare class CompactionSettingsService {
|
|
|
21
31
|
constructor(settings: Pick<SettingsService, "get">, db: KernelDb);
|
|
22
32
|
/** The effective settings for `orgId`: org override > platform setting > built-in default. */
|
|
23
33
|
resolve(orgId: string): Promise<CompactionSettings>;
|
|
34
|
+
/** What a model step reads for `orgId`: the compaction and prompt cache settings, one read each. */
|
|
35
|
+
resolveStep(orgId: string): Promise<StepSettings>;
|
|
24
36
|
}
|
|
@@ -8,7 +8,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
8
8
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
9
|
};
|
|
10
10
|
import { Inject, Injectable } from "@nestjs/common";
|
|
11
|
-
import { effectiveCompactionSettings, SettingsService, } from "../identity/settings.js";
|
|
11
|
+
import { effectiveCompactionSettings, effectivePromptCacheSettings, SettingsService, } from "../identity/settings.js";
|
|
12
12
|
import { KernelDb } from "../infra/database/kernel-db.js";
|
|
13
13
|
import { readOrgSettings } from "../orgs/settings.service.js";
|
|
14
14
|
export { COMPACTION_SETTINGS, effectiveCompactionSettings, } from "../identity/settings.js";
|
|
@@ -22,6 +22,17 @@ export async function resolveCompactionSettings(settings, db, orgId) {
|
|
|
22
22
|
const [platform, org] = await Promise.all([settings.get(), readOrgSettings(db, orgId)]);
|
|
23
23
|
return effectiveCompactionSettings(platform.compaction, org.compaction);
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* The effective compaction and prompt cache settings for `orgId` (org override > platform setting
|
|
27
|
+
* > built-in default), with one read of the platform settings and one of the org row.
|
|
28
|
+
*/
|
|
29
|
+
export async function resolveStepSettings(settings, db, orgId) {
|
|
30
|
+
const [platform, org] = await Promise.all([settings.get(), readOrgSettings(db, orgId)]);
|
|
31
|
+
return {
|
|
32
|
+
compaction: effectiveCompactionSettings(platform.compaction, org.compaction),
|
|
33
|
+
promptCache: effectivePromptCacheSettings(platform.promptCache, org.promptCache),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
25
36
|
/**
|
|
26
37
|
* The compaction settings in effect for one organization (context compaction spec §4.8):
|
|
27
38
|
* the organization's override over the platform's stored settings, which carry the built-in
|
|
@@ -39,6 +50,10 @@ let CompactionSettingsService = class CompactionSettingsService {
|
|
|
39
50
|
resolve(orgId) {
|
|
40
51
|
return resolveCompactionSettings(this.settings, this.db.db, orgId);
|
|
41
52
|
}
|
|
53
|
+
/** What a model step reads for `orgId`: the compaction and prompt cache settings, one read each. */
|
|
54
|
+
resolveStep(orgId) {
|
|
55
|
+
return resolveStepSettings(this.settings, this.db.db, orgId);
|
|
56
|
+
}
|
|
42
57
|
};
|
|
43
58
|
CompactionSettingsService = __decorate([
|
|
44
59
|
Injectable(),
|
|
@@ -37,7 +37,9 @@ export interface ForcedCompaction {
|
|
|
37
37
|
* settings) and calls the shared {@link runCompaction} with `force: true`: the trigger,
|
|
38
38
|
* `enabled: false` and the failure backoff are bypassed, the compaction plan is still required, with
|
|
39
39
|
* the manual rule (`manual: true`: every turn before the latest summarized, about a fifth of the
|
|
40
|
-
* window of the latest turn kept; maintainer decision 2026-11-28).
|
|
40
|
+
* window of the latest turn kept; maintainer decision 2026-11-28). A manual compaction always
|
|
41
|
+
* summarizes the transcript with that plan, on a model the in-context gate lists too (ruling R13,
|
|
42
|
+
* idle compaction spec §9.4).
|
|
41
43
|
*
|
|
42
44
|
* The run writes only its outcome, with `step: 0`: `compaction_summary` / `compaction_failed` + the
|
|
43
45
|
* summary calls' `usage`, or `compaction_skipped` when there is nothing to summarize (maintainer
|
|
@@ -19,7 +19,9 @@ import { RunSteps } from "./run-steps.js";
|
|
|
19
19
|
* settings) and calls the shared {@link runCompaction} with `force: true`: the trigger,
|
|
20
20
|
* `enabled: false` and the failure backoff are bypassed, the compaction plan is still required, with
|
|
21
21
|
* the manual rule (`manual: true`: every turn before the latest summarized, about a fifth of the
|
|
22
|
-
* window of the latest turn kept; maintainer decision 2026-11-28).
|
|
22
|
+
* window of the latest turn kept; maintainer decision 2026-11-28). A manual compaction always
|
|
23
|
+
* summarizes the transcript with that plan, on a model the in-context gate lists too (ruling R13,
|
|
24
|
+
* idle compaction spec §9.4).
|
|
23
25
|
*
|
|
24
26
|
* The run writes only its outcome, with `step: 0`: `compaction_summary` / `compaction_failed` + the
|
|
25
27
|
* summary calls' `usage`, or `compaction_skipped` when there is nothing to summarize (maintainer
|