@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
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import type { ConversationSource } from "@capybara-hq/plugin-sdk";
|
|
1
|
+
import type { ConversationSource, TriggerSubject } from "@capybara-hq/plugin-sdk";
|
|
2
2
|
import { AgentLookup } from "../agents/agent-lookup.js";
|
|
3
3
|
import type { ModelRef } from "../agents/definition.js";
|
|
4
4
|
import type { AgentAvatarView } from "../agents/profile.js";
|
|
5
|
-
import type {
|
|
5
|
+
import type { AutomationEventMarker, ScheduleMarker } from "../automations/types.js";
|
|
6
|
+
import type { ConversationSubject, TitleSource } from "../db/kernel-schema.js";
|
|
6
7
|
import { ConversationDevices, type NewConversationDevice } from "../devices/conversation-devices.js";
|
|
8
|
+
import { DeviceProjectFilesService } from "../devices/device-project-files.service.js";
|
|
7
9
|
import { DeviceProjectsService } from "../devices/device-projects.service.js";
|
|
10
|
+
import { LibraryFilesService } from "../files/library-files.service.js";
|
|
8
11
|
import { type PersonRef } from "../identity/account-avatar.js";
|
|
9
12
|
import { KernelDb } from "../infra/database/kernel-db.js";
|
|
10
13
|
import { TransactionHost } from "../infra/database/transaction-host.js";
|
|
@@ -13,16 +16,14 @@ import { OutboxService } from "../infra/outbox/outbox.service.js";
|
|
|
13
16
|
import { ProviderRegistry } from "../runtime/providers.js";
|
|
14
17
|
import { RunDeletion } from "../runtime/run-deletion.js";
|
|
15
18
|
import { PermissionCeilingWrites } from "../sandbox/permission-ceiling-writes.js";
|
|
16
|
-
import type { ScheduleMarker } from "../schedules/types.js";
|
|
17
19
|
import { type RenderedInvocation, SkillInvoker } from "../skills/invoke.js";
|
|
18
20
|
import { type ApprovalRecord, ApprovalsService } from "../tools/approvals.service.js";
|
|
19
21
|
import { ConnectorContent } from "../tools/connector-content.js";
|
|
20
22
|
import { type QuestionRecord, QuestionsService } from "../tools/questions.service.js";
|
|
21
23
|
import { ConversationAccess } from "./access.js";
|
|
22
24
|
import { type AgentTreeNode } from "./agent-tree.js";
|
|
23
|
-
import { AttachmentsService } from "./attachments.service.js";
|
|
24
25
|
import { EventLog } from "./event-log.js";
|
|
25
|
-
import type
|
|
26
|
+
import { type ConversationEvent, type LogContentBlock } from "./events.js";
|
|
26
27
|
import { type ImSenderContext } from "./message-context.js";
|
|
27
28
|
import type { PermissionSelection } from "./permission-profiles.schemas.js";
|
|
28
29
|
import { PermissionProfilesService } from "./permission-profiles.service.js";
|
|
@@ -54,8 +55,13 @@ export interface ConversationView {
|
|
|
54
55
|
* sub-agent's is null: it works in its root conversation's.
|
|
55
56
|
*/
|
|
56
57
|
deviceId: string | null;
|
|
57
|
-
/** The
|
|
58
|
-
|
|
58
|
+
/** The automation that created it (a `new`-mode task's run); null otherwise (spec §4). */
|
|
59
|
+
automationId: string | null;
|
|
60
|
+
/**
|
|
61
|
+
* The event subject it serves (a `subject`-mode automation's conversation, collaboration spec
|
|
62
|
+
* §4.5): the emitting extension and the subject; null for any other conversation.
|
|
63
|
+
*/
|
|
64
|
+
subject: ConversationSubject | null;
|
|
59
65
|
/**
|
|
60
66
|
* The device project it is bound to (project root spec §4.3: chosen at creation, never
|
|
61
67
|
* changed), as resolved then: its name and absolute path on the device; null in free mode (a
|
|
@@ -211,7 +217,10 @@ export interface AttachmentRef {
|
|
|
211
217
|
connectorId: string;
|
|
212
218
|
uri: string;
|
|
213
219
|
}
|
|
214
|
-
/**
|
|
220
|
+
/**
|
|
221
|
+
* Resolved `@` resources and referenced project files: the blocks after the user text (the
|
|
222
|
+
* resources' bodies, then one text block per project file) and their metadata.
|
|
223
|
+
*/
|
|
215
224
|
export interface ResolvedExtra {
|
|
216
225
|
blocks: {
|
|
217
226
|
type: "text";
|
|
@@ -224,7 +233,29 @@ export interface ResolvedExtra {
|
|
|
224
233
|
uri: string;
|
|
225
234
|
name: string;
|
|
226
235
|
}[];
|
|
236
|
+
/** The referenced project files (normalized paths), in block order; absent: none. */
|
|
237
|
+
projectFiles?: {
|
|
238
|
+
path: string;
|
|
239
|
+
}[];
|
|
240
|
+
/** The project root the project file blocks name (set with `projectFiles`). */
|
|
241
|
+
projectRoot?: string;
|
|
227
242
|
}
|
|
243
|
+
export { MAX_PROJECT_FILES } from "../devices/device-project-files.service.js";
|
|
244
|
+
/** Where a message's project files are checked: the conversation's device and bound project. */
|
|
245
|
+
export interface ProjectFilesTarget {
|
|
246
|
+
deviceId: string | null;
|
|
247
|
+
project: {
|
|
248
|
+
name: string;
|
|
249
|
+
path: string;
|
|
250
|
+
} | null | undefined;
|
|
251
|
+
/** Stops the check on the device (the request's signal: the client hung up). */
|
|
252
|
+
signal?: AbortSignal | undefined;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* The model-visible text of one referenced project file (composer menus §5): English, logged in
|
|
256
|
+
* the `user_message`, so replay rebuilds it from the log as it is.
|
|
257
|
+
*/
|
|
258
|
+
export declare const projectFileText: (path: string, root: string) => string;
|
|
228
259
|
export { userMessageIdemKey } from "./idem-keys.js";
|
|
229
260
|
/** The longest conversation title (characters, after trimming). */
|
|
230
261
|
export declare const CONVERSATION_TITLE_MAX_CHARS = 120;
|
|
@@ -239,6 +270,13 @@ export interface UserMessageInput {
|
|
|
239
270
|
clientMessageId?: string;
|
|
240
271
|
attachments?: AttachmentRef[];
|
|
241
272
|
files?: string[];
|
|
273
|
+
/**
|
|
274
|
+
* Files of the conversation's device project, referenced by their paths relative to the
|
|
275
|
+
* project root (composer menus §5): checked with `stat`, never read or copied.
|
|
276
|
+
*/
|
|
277
|
+
projectFiles?: {
|
|
278
|
+
path: string;
|
|
279
|
+
}[];
|
|
242
280
|
/** Switch the conversation's model from the next run (the agent's own model = back to it). */
|
|
243
281
|
model?: ModelRef;
|
|
244
282
|
/** Switch the effort (one of the model's declared `effort` values). */
|
|
@@ -265,14 +303,18 @@ export interface UserMessageInput {
|
|
|
265
303
|
im?: ImSenderContext;
|
|
266
304
|
}
|
|
267
305
|
/**
|
|
268
|
-
* Message options only kernel callers pass (
|
|
269
|
-
* an HTTP body: the schedule marker the
|
|
270
|
-
* source of the message's `timeZone`
|
|
306
|
+
* Message options only kernel callers pass (an automation's fire, scheduled tasks spec §6), never
|
|
307
|
+
* an HTTP body: the schedule marker or the event marker (collaboration spec §4.6) the
|
|
308
|
+
* `user_message` carries, and a zone that beats every other source of the message's `timeZone`
|
|
309
|
+
* (`readMessageContext`).
|
|
271
310
|
*/
|
|
272
311
|
export interface InternalMessageOptions {
|
|
273
312
|
initialPermission?: PermissionSelection;
|
|
313
|
+
/** The request's signal: the project file check on the device stops when the client hangs up. */
|
|
314
|
+
signal?: AbortSignal;
|
|
274
315
|
createRequestHash?: string;
|
|
275
316
|
schedule?: ScheduleMarker;
|
|
317
|
+
automationEvent?: AutomationEventMarker;
|
|
276
318
|
timeZoneOverride?: string;
|
|
277
319
|
}
|
|
278
320
|
/** Options of a conversation created by a kernel caller (never an HTTP body). */
|
|
@@ -282,6 +324,14 @@ export interface NewConversationOptions {
|
|
|
282
324
|
* conversation that fell back to `web` would be offered what only the web and DMs may see.
|
|
283
325
|
*/
|
|
284
326
|
source: ConversationSource;
|
|
327
|
+
/**
|
|
328
|
+
* The event subject a `subject`-mode automation's conversation serves (collaboration spec §4.5):
|
|
329
|
+
* `subject` of the subject's trigger events and the emitting extension (`source`), fixed at
|
|
330
|
+
* creation (`conversations.subject`).
|
|
331
|
+
*/
|
|
332
|
+
subject?: TriggerSubject & {
|
|
333
|
+
source: string;
|
|
334
|
+
};
|
|
285
335
|
}
|
|
286
336
|
/**
|
|
287
337
|
* 会话:只有所有者可见;每次访问都实时复核 agent 对所有者仍可用(spec 3.6 R5),
|
|
@@ -299,8 +349,8 @@ export declare class ConversationsService {
|
|
|
299
349
|
private readonly providers;
|
|
300
350
|
/** Reads `@` resources with the sender's credentials. */
|
|
301
351
|
private readonly content;
|
|
302
|
-
/**
|
|
303
|
-
private readonly
|
|
352
|
+
/** Attaches the sender's library files to the conversation in the message's transaction. */
|
|
353
|
+
private readonly libraryFiles;
|
|
304
354
|
/** Renders a person's skill invocation (phase D). */
|
|
305
355
|
private readonly invoker;
|
|
306
356
|
/** Stops a deleted conversation's background tasks. */
|
|
@@ -309,6 +359,8 @@ export declare class ConversationsService {
|
|
|
309
359
|
private readonly devices;
|
|
310
360
|
/** The project of that device a new conversation is bound to (project root design §4.3). */
|
|
311
361
|
private readonly projects;
|
|
362
|
+
/** Checks a message's referenced project files on the device (composer menus §5). */
|
|
363
|
+
private readonly projectFiles;
|
|
312
364
|
/** A starter's message skips the run's pending questions (reply-while-question spec §8.1). */
|
|
313
365
|
private readonly questions;
|
|
314
366
|
/** ... and its pending network asks (network ask-to-allow spec §6.7). */
|
|
@@ -325,8 +377,8 @@ export declare class ConversationsService {
|
|
|
325
377
|
providers: Pick<ProviderRegistry, "resolve">,
|
|
326
378
|
/** Reads `@` resources with the sender's credentials. */
|
|
327
379
|
content: Pick<ConnectorContent, "resolveAttachments">,
|
|
328
|
-
/**
|
|
329
|
-
|
|
380
|
+
/** Attaches the sender's library files to the conversation in the message's transaction. */
|
|
381
|
+
libraryFiles: Pick<LibraryFilesService, "attachForMessage">,
|
|
330
382
|
/** Renders a person's skill invocation (phase D). */
|
|
331
383
|
invoker: Pick<SkillInvoker, "prepare">,
|
|
332
384
|
/** Stops a deleted conversation's background tasks. */
|
|
@@ -335,6 +387,8 @@ export declare class ConversationsService {
|
|
|
335
387
|
devices: Pick<ConversationDevices, "forNew">,
|
|
336
388
|
/** The project of that device a new conversation is bound to (project root design §4.3). */
|
|
337
389
|
projects: Pick<DeviceProjectsService, "resolveForBinding">,
|
|
390
|
+
/** Checks a message's referenced project files on the device (composer menus §5). */
|
|
391
|
+
projectFiles: Pick<DeviceProjectFilesService, "statAll">,
|
|
338
392
|
/** A starter's message skips the run's pending questions (reply-while-question spec §8.1). */
|
|
339
393
|
questions: Pick<QuestionsService, "skipPendingIn">,
|
|
340
394
|
/** ... and its pending network asks (network ask-to-allow spec §6.7). */
|
|
@@ -358,8 +412,8 @@ export declare class ConversationsService {
|
|
|
358
412
|
* `agent.not_found` and nothing is written. Queues a run afterwards, like `postUserMessage`.
|
|
359
413
|
* `events` are every event the create wrote, in seq order from seq 1 (a `model_switched` before
|
|
360
414
|
* the message when the send switched), so a client can seed the new conversation's log whole.
|
|
361
|
-
* `internal`: the conversation's source and, for kernel callers only,
|
|
362
|
-
* which also sets `conversations.
|
|
415
|
+
* `internal`: the conversation's source and, for kernel callers only, an automation's marker,
|
|
416
|
+
* which also sets `conversations.automation_id`, and its zone override. `pick.project` binds
|
|
363
417
|
* the conversation to one of its device's projects inside the write ({@link bindingFor}); a
|
|
364
418
|
* retry answers with the conversation the first send created, its binding unchanged.
|
|
365
419
|
*/
|
|
@@ -529,20 +583,32 @@ export declare class ConversationsService {
|
|
|
529
583
|
turnsBefore: number;
|
|
530
584
|
}>;
|
|
531
585
|
/**
|
|
532
|
-
*
|
|
533
|
-
*
|
|
534
|
-
*
|
|
586
|
+
* Appends a user message; a repeated send with the same `clientMessageId` returns the same
|
|
587
|
+
* event. After the write it calls `ensureRun`: with no run in progress it enqueues one; during
|
|
588
|
+
* a run the current run takes the message in between steps, or `ensureRun` runs again when it
|
|
589
|
+
* ends. A failed `ensureRun` is logged, not thrown: the message's transaction owes the ensure-run
|
|
535
590
|
* backstop, which starts the run once the queue is reachable (transactional outbox spec §6).
|
|
536
591
|
*
|
|
537
|
-
* `attachments
|
|
538
|
-
*
|
|
539
|
-
*
|
|
592
|
+
* `attachments` (`@` resource references): the kernel reads each resource with the sender's
|
|
593
|
+
* credentials (redacted, length-capped) and writes it as an extra text block after the user's
|
|
594
|
+
* text in the same user_message, with its metadata in `payload.attachments` (attachment i is
|
|
595
|
+
* `content[i + 1]`). A failed read writes nothing. A repeated send with the same
|
|
596
|
+
* `clientMessageId` returns the written event without reading again.
|
|
597
|
+
*
|
|
598
|
+
* `files` (uploaded attachment ids): checked and bound to this conversation in the transaction
|
|
599
|
+
* that writes the event (see {@link BindFiles}) and appended last as image / document reference
|
|
600
|
+
* blocks (after the `@` resource blocks); any unavailable file writes nothing. The log holds
|
|
601
|
+
* only references, never bytes. With empty `text` (files only: the HTTP layer ensures `files`
|
|
602
|
+
* and no `@` resources then) no text block is written.
|
|
540
603
|
*
|
|
541
|
-
* `
|
|
542
|
-
*
|
|
543
|
-
*
|
|
604
|
+
* `projectFiles` (composer menus §5): checked in the conversation's stored project before the
|
|
605
|
+
* write ({@link resolveExtra}); one block each after the `@` resources' bodies, before the
|
|
606
|
+
* uploaded files' blocks, and `payload.projectFiles`. Any refusal writes nothing; a repeated
|
|
607
|
+
* send with the same `clientMessageId` returns the written event without checking again.
|
|
544
608
|
*/
|
|
545
|
-
postUserMessage(orgId: string, conversationId: string, accountId: string, input: UserMessageInput
|
|
609
|
+
postUserMessage(orgId: string, conversationId: string, accountId: string, input: UserMessageInput,
|
|
610
|
+
/** The request's signal: the project file check on the device stops when the client hangs up. */
|
|
611
|
+
signal?: AbortSignal): Promise<ConversationEvent>;
|
|
546
612
|
/**
|
|
547
613
|
* Writes a message in one transaction: binds its files, reads its sender context and appends it
|
|
548
614
|
* (after its `model_switched` when it switches).
|
|
@@ -610,14 +676,25 @@ export declare class ConversationsService {
|
|
|
610
676
|
*/
|
|
611
677
|
prepareQueuedSkill(orgId: string, conv: ConversationView, accountId: string, input: Pick<UserMessageInput, "skill" | "text">): Promise<RenderedInvocation | undefined>;
|
|
612
678
|
/**
|
|
613
|
-
* Reads the `@` resources with the sender's credentials
|
|
614
|
-
* with the queue, which reads
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
*
|
|
619
|
-
*
|
|
620
|
-
*
|
|
679
|
+
* Reads the `@` resources with the sender's credentials and checks the referenced project files
|
|
680
|
+
* (nothing when there are none). Shared with the queue, which reads the resources when a
|
|
681
|
+
* message is queued (decision 15; a queued message carries no project files).
|
|
682
|
+
*
|
|
683
|
+
* Project files (composer menus §5) are checked in `target`'s project on its device as the
|
|
684
|
+
* sender (the conversation's owner, through `DeviceProjectFilesService.statAll`, outside any
|
|
685
|
+
* transaction): no bound project → `conversation.project_file_unavailable` with `reason:
|
|
686
|
+
* "no_project"`; a path leaving the project → `device.path_outside_project`; one that is not a
|
|
687
|
+
* file there → `conversation.project_file_unavailable` with its path; the device codes pass on.
|
|
688
|
+
* Each becomes a {@link projectFileText} block after the resources' bodies.
|
|
689
|
+
*/
|
|
690
|
+
resolveExtra(orgId: string, accountId: string, input: Pick<UserMessageInput, "attachments" | "projectFiles">, target?: ProjectFilesTarget): Promise<ResolvedExtra>;
|
|
691
|
+
/** {@link resolveExtra}'s project file check: the normalized paths and the root, or none. */
|
|
692
|
+
private checkProjectFiles;
|
|
693
|
+
/**
|
|
694
|
+
* Attaches the sender's library files inside the message's (or queue item's) transaction
|
|
695
|
+
* (`LibraryFilesService.attachForMessage`: drafts become ready, the conversation refers to each);
|
|
696
|
+
* none → no blocks. The files join the conversation's files, so open pages read the list again
|
|
697
|
+
* after the commit (`changed: files`, a hint).
|
|
621
698
|
*/
|
|
622
699
|
bindIn(orgId: string, conversationId: string, accountId: string, files: readonly string[]): Promise<LogContentBlock[]>;
|
|
623
700
|
private userMessage;
|