@desplega.ai/agent-swarm 1.119.6 → 1.121.0
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/README.md +2 -2
- package/dist/{actions-qe5zjcbr.js → actions-mwshtkf7.js} +6 -6
- package/dist/{anthropic-messages-qjxzsabf.js → anthropic-messages-4gn944cn.js} +29 -13
- package/dist/{app-31x7k3vj.js → app-skbty91x.js} +4 -4
- package/dist/{assistant-4crt9dve.js → assistant-tg7dhfj8.js} +13 -13
- package/dist/{azure-openai-responses-ntfd05zd.js → azure-openai-responses-79zc0wyy.js} +28 -13
- package/dist/{boot-reembed-8g69ttz4.js → boot-reembed-ntjmeyh2.js} +4 -4
- package/dist/{boot-reembed-q648j733.js → boot-reembed-q5x0xpcp.js} +5 -5
- package/dist/{boot-scrub-logs-sfmzd2hj.js → boot-scrub-logs-5gznsfbe.js} +4 -4
- package/dist/{claude-adapter-9n3nzt65.js → claude-adapter-vxvcym3r.js} +3 -3
- package/dist/{claude-managed-adapter-pv2nbqy4.js → claude-managed-adapter-g807894s.js} +2 -2
- package/dist/{cli-bpvgs2y6.js → cli-072t49hf.js} +2123 -1533
- package/dist/{cli-g6qz2kts.js → cli-0df2g86x.js} +336 -18
- package/dist/cli-1728qh70.js +791 -0
- package/dist/{cli-vg1jxfqz.js → cli-3b1ayz83.js} +5 -5
- package/dist/{cli-r93nz80j.js → cli-3fxqwfh3.js} +1 -1
- package/dist/{cli-w6rhc30s.js → cli-3jrdwnn9.js} +20 -5
- package/dist/{cli-pasyk3vc.js → cli-46etyprn.js} +10 -5
- package/dist/{cli-433c0f4b.js → cli-4pfweq4x.js} +8 -8
- package/dist/{cli-2r7s8jhp.js → cli-5c4327dx.js} +7 -1
- package/dist/{cli-4s84mw72.js → cli-5hpvd15x.js} +2 -2
- package/dist/{cli-branks1w.js → cli-6s3ytc5x.js} +1 -1
- package/dist/{cli-da3x3btq.js → cli-7pt9sc83.js} +2 -2
- package/dist/{cli-2gv8ygwr.js → cli-7pzae66m.js} +2 -2
- package/dist/{cli-qs7nb3zn.js → cli-8wrympd7.js} +27 -1
- package/dist/{cli-qw1ccvxm.js → cli-95rbe11h.js} +70 -51
- package/dist/{cli-6rvm3jkk.js → cli-agdrxyex.js} +1 -1
- package/dist/{cli-wr706gez.js → cli-av2s7my4.js} +167 -66
- package/dist/{cli-59jy217p.js → cli-avw9ev3x.js} +55 -21
- package/dist/{cli-fkxxh5d4.js → cli-b2mqkg1h.js} +2 -2
- package/dist/{cli-1arw00dp.js → cli-ccjwgarc.js} +12 -3
- package/dist/{cli-pscrc6tw.js → cli-ch7t5v7n.js} +5 -0
- package/dist/{cli-tghre7g6.js → cli-cw70hymf.js} +1 -0
- package/dist/{cli-n61x2aph.js → cli-dmzv0986.js} +816 -1335
- package/dist/{cli-d1reabed.js → cli-g9vva2qh.js} +2 -2
- package/dist/{cli-ner6af7m.js → cli-gdpx70nc.js} +24048 -23715
- package/dist/{cli-96feg24n.js → cli-ghq3v4c9.js} +2 -2
- package/dist/{cli-wxbnjgce.js → cli-ky8esb8t.js} +3 -3
- package/dist/{cli-gdqdkr3j.js → cli-nf7sadev.js} +2 -2
- package/dist/{cli-h6cf69x5.js → cli-p9w7kb3h.js} +1 -1
- package/dist/{cli-xeatwfbe.js → cli-ry656xem.js} +24 -17
- package/dist/{cli-q8dway4w.js → cli-s8bdcke2.js} +1 -1
- package/dist/cli-s8s499xy.js +81 -0
- package/dist/{cli-sbkwvn5e.js → cli-srjqn7fd.js} +1 -1
- package/dist/cli-tv7vekye.js +367 -0
- package/dist/{cli-gg5bd32n.js → cli-vg3zrw6h.js} +4 -4
- package/dist/{cli-vx0y68jv.js → cli-vp9r4ap4.js} +5 -4
- package/dist/{cli-mg280wsv.js → cli-we156bmz.js} +1 -1
- package/dist/{cli-86fdnerz.js → cli-wwsaj97q.js} +9 -4
- package/dist/{cli-e0y603nn.js → cli-x0e0yvnq.js} +101 -1
- package/dist/{cli-mw3xpgwb.js → cli-x4apc9t3.js} +4 -4
- package/dist/cli.js +26 -21
- package/dist/{codex-adapter-6j2b38tg.js → codex-adapter-mmy741zd.js} +8 -9
- package/dist/{codex-session-runner-vz215wgw.js → codex-session-runner-sazmx9zt.js} +8 -9
- package/dist/{commands-6xr20jbe.js → commands-cxxye5e4.js} +3 -3
- package/dist/{db-1mmvk1z4.js → db-ab1954b7.js} +5 -3
- package/dist/{google-generative-ai-n1d3xt4n.js → google-generative-ai-wwa2ked5.js} +14 -18
- package/dist/{google-vertex-mxst23gy.js → google-vertex-71xmdd7n.js} +14 -18
- package/dist/{handlers-xvrknk8w.js → handlers-fmfe2343.js} +13 -13
- package/dist/{hook-qm7he8wn.js → hook-ygnw3cvt.js} +7 -8
- package/dist/{http-hj08zq67.js → http-kactcc0z.js} +1128 -536
- package/dist/{index-688jph6a.js → index-6erq0wvk.js} +11 -11
- package/dist/{index-gze4fg2w.js → index-g86j2yt5.js} +9 -9
- package/dist/{index-etz7d8md.js → index-gmzs6a2q.js} +10 -10
- package/dist/{index-wj8dfpwh.js → index-hmp82wn0.js} +12 -12
- package/dist/{keepalive-94wn9yxw.js → keepalive-3cvt26dw.js} +18 -14
- package/dist/{lead-rvcqkp11.js → lead-ysf26cjr.js} +31 -32
- package/dist/{maintenance-qhfc4dnp.js → maintenance-9npwptbb.js} +5 -5
- package/dist/{mistral-conversations-ykcg66za.js → mistral-conversations-26ya4yah.js} +17 -13
- package/dist/{oauth-refresh-sweep-rj8wgvsw.js → oauth-refresh-sweep-0r2v76vw.js} +23 -17
- package/dist/{onboard-8bv8q1wc.js → onboard-ddb1674a.js} +2 -2
- package/dist/{openai-codex-responses-zy0907j9.js → openai-codex-responses-6rr2ye0s.js} +78 -38
- package/dist/{openai-completions-xk4p56n9.js → openai-completions-zfa9nkvt.js} +130 -33
- package/dist/{openai-responses-4gv3ca5d.js → openai-responses-9wmdks0g.js} +38 -14
- package/dist/{opencode-adapter-5bwzvbwj.js → opencode-adapter-h6rkxwrk.js} +2 -2
- package/dist/{openrouter-images-4fsrrzes.js → openrouter-images-dgq98729.js} +10 -3
- package/dist/{otel-impl-1kf6fr2m.js → otel-impl-b43bkq8e.js} +4 -4
- package/dist/{pi-messages-zb8v76wx.js → pi-messages-nzjbbz47.js} +4 -6
- package/dist/{pi-mono-adapter-9sg69kg3.js → pi-mono-adapter-ke789738.js} +2328 -1281
- package/dist/{pricing-refresh-e84tar2s.js → pricing-refresh-2rqf114z.js} +5 -5
- package/dist/{rbac-roles-atytq5ch.js → rbac-roles-5wkhc8xv.js} +5 -5
- package/dist/{rbac-roles-pg0zvnwn.js → rbac-roles-6vtafvzb.js} +4 -4
- package/dist/{seed-pricing-xd6nxq7k.js → seed-pricing-23wrb873.js} +4 -4
- package/dist/{setup-4z389yk0.js → setup-6rny4fk6.js} +2 -2
- package/dist/{worker-m61r0t7m.js → worker-yapewe14.js} +31 -32
- package/openapi.json +2671 -1811
- package/package.json +10 -5
- package/plugin/commands/swarm-chat.md +2 -0
- package/plugin/pi-skills/swarm-chat/SKILL.md +2 -0
- package/src/be/connection-bindings-blob-migration.ts +123 -0
- package/src/be/db-queries/mcp-oauth.ts +409 -247
- package/src/be/db-queries/oauth.ts +813 -131
- package/src/be/db.ts +97 -6
- package/src/be/migrations/117_unified_oauth.sql +624 -0
- package/src/be/migrations/119_agent_avatar.sql +7 -0
- package/src/be/migrations/120_task_title.sql +3 -0
- package/src/be/oauth-credential-bindings.ts +48 -14
- package/src/be/oauth-encryption-backfill.ts +84 -0
- package/src/be/oauth-refresh-sweep.ts +38 -23
- package/src/be/script-connections.ts +1130 -163
- package/src/be/script-credential-broker.ts +37 -27
- package/src/be/scripts/typecheck.ts +3 -2
- package/src/be/seed-capabilities.ts +62 -0
- package/src/be/seed-pricing.ts +1 -1
- package/src/be/seed-scripts/catalog/ops-catalog-audit.inline.ts +1 -1
- package/src/be/seed-scripts/catalog/ops-catalog-audit.ts +1 -1
- package/src/be/vendored-openapi.ts +98 -0
- package/src/commands/runner.ts +69 -6
- package/src/http/agents.ts +23 -5
- package/src/http/all-routes.ts +1 -0
- package/src/http/core.ts +8 -5
- package/src/http/index.ts +18 -5
- package/src/http/mcp-bridge.ts +5 -2
- package/src/http/mcp-oauth.ts +103 -101
- package/src/http/oauth-callback.ts +332 -0
- package/src/http/oauth-generic.ts +14 -54
- package/src/http/poll.ts +5 -1
- package/src/http/script-connections.ts +651 -170
- package/src/http/scripts.ts +4 -2
- package/src/http/sessions.ts +1 -1
- package/src/http/tasks.ts +35 -0
- package/src/http/trackers/jira.ts +22 -34
- package/src/http/trackers/linear.ts +21 -36
- package/src/http/x.ts +6 -2
- package/src/jira/app.ts +12 -6
- package/src/jira/oauth.ts +48 -48
- package/src/linear/app.ts +44 -2
- package/src/linear/oauth.ts +12 -37
- package/src/oauth/app-validation.ts +27 -9
- package/src/oauth/ensure-mcp-token.ts +1 -0
- package/src/oauth/ensure-token.ts +331 -108
- package/src/oauth/identity-capture.ts +103 -0
- package/src/oauth/keepalive.ts +14 -9
- package/src/oauth/presets.ts +242 -0
- package/src/oauth/wrapper.ts +197 -76
- package/src/prompts/base-prompt.ts +48 -4
- package/src/prompts/session-templates.ts +13 -1
- package/src/providers/claude-managed-models.ts +8 -0
- package/src/rbac/legacy-policy.ts +2 -1
- package/src/rbac/permissions.ts +7 -3
- package/src/scripts-runtime/credential-broker/broker.ts +51 -8
- package/src/scripts-runtime/credential-broker/fetch-patch.ts +30 -3
- package/src/scripts-runtime/credential-broker/index.ts +1 -1
- package/src/scripts-runtime/credential-broker/types.ts +55 -8
- package/src/scripts-runtime/egress-secrets.ts +6 -2
- package/src/scripts-runtime/eval-harness.ts +2 -2
- package/src/scripts-runtime/executors/types.ts +2 -1
- package/src/scripts-runtime/loader.ts +3 -0
- package/src/scripts-runtime/types/stdlib.d.ts +11 -0
- package/src/server.ts +230 -126
- package/src/tests/agent-avatar-resolution.test.ts +123 -0
- package/src/tests/agents-list-model-display.test.ts +10 -0
- package/src/tests/base-prompt.test.ts +72 -0
- package/src/tests/claude-managed-adapter.test.ts +6 -0
- package/src/tests/connection-embedded-auth.test.ts +709 -0
- package/src/tests/context-window.test.ts +1 -0
- package/src/tests/credential-broker.test.ts +123 -125
- package/src/tests/db-queries-oauth.test.ts +126 -1
- package/src/tests/ensure-token.test.ts +44 -2
- package/src/tests/list-endpoint-slimming.test.ts +45 -0
- package/src/tests/mcp-oauth-manual-client.test.ts +20 -1
- package/src/tests/mcp-oauth-queries.test.ts +154 -8
- package/src/tests/oauth-access-token-tool.test.ts +37 -1
- package/src/tests/oauth-callback-flow.test.ts +534 -0
- package/src/tests/oauth-credential-bindings.test.ts +50 -22
- package/src/tests/oauth-presets.test.ts +275 -0
- package/src/tests/oauth-refresh-failure.test.ts +263 -0
- package/src/tests/oauth-refresh-sweep.test.ts +83 -3
- package/src/tests/oauth-wrapper.test.ts +77 -55
- package/src/tests/prompt-template-session.test.ts +6 -5
- package/src/tests/rbac-charact-misc-tools.test.ts +60 -0
- package/src/tests/rbac-engine.test.ts +2 -1
- package/src/tests/script-connections-http.test.ts +356 -11
- package/src/tests/script-connections.test.ts +102 -0
- package/src/tests/sdk-allowlist.test.ts +4 -1
- package/src/tests/seed-capabilities.test.ts +92 -0
- package/src/tests/session-costs-model-key-normalize.test.ts +1 -0
- package/src/tests/sessions.test.ts +46 -0
- package/src/tests/spec-base-url.test.ts +266 -0
- package/src/tests/status.test.ts +3 -4
- package/src/tests/swarm-config-reserved-keys.test.ts +4 -2
- package/src/tests/task-title-route.test.ts +106 -0
- package/src/tests/tool-annotations.test.ts +6 -3
- package/src/tests/tracker-fold.test.ts +412 -0
- package/src/tests/unified-oauth-migration.test.ts +455 -0
- package/src/tests/vendored-openapi.test.ts +263 -0
- package/src/tools/credential-bindings/tool.ts +232 -77
- package/src/tools/oauth-access-token.ts +55 -6
- package/src/tools/script-connections/tool.ts +73 -53
- package/src/tools/swarm-config/set-config.ts +24 -50
- package/src/tools/update-profile.ts +15 -5
- package/src/tracker/types.ts +12 -0
- package/src/types.ts +29 -0
- package/src/utils/context-window.ts +1 -0
- package/src/workflows/executors/swarm-script.ts +6 -2
- package/vendored-openapi/README.md +22 -0
- package/vendored-openapi/github.json +7759 -0
- package/vendored-openapi/gmail.json +393 -0
- package/vendored-openapi/jira.json +3396 -0
- package/vendored-openapi/linear.json +252 -0
- package/vendored-openapi/manifest.json +128 -0
- package/vendored-openapi/slack.json +2895 -0
- package/dist/cli-0pygq9r1.js +0 -429
- package/dist/cli-8hhms4hp.js +0 -393
- package/dist/cli-z9gzq07x.js +0 -27
- package/src/scripts-runtime/credential-broker/store.ts +0 -72
- package/dist/{otel-g299k41b.js → otel-63jr5v38.js} +1 -1
|
@@ -2,6 +2,14 @@ import {
|
|
|
2
2
|
deriveProviderFromKeyType,
|
|
3
3
|
init_credentials
|
|
4
4
|
} from "./cli-z2zcxes1.js";
|
|
5
|
+
import {
|
|
6
|
+
init_package,
|
|
7
|
+
package_default
|
|
8
|
+
} from "./cli-46etyprn.js";
|
|
9
|
+
import {
|
|
10
|
+
init_secret_scrubber,
|
|
11
|
+
scrubSecrets
|
|
12
|
+
} from "./cli-4j2mrzag.js";
|
|
5
13
|
import {
|
|
6
14
|
init_zod
|
|
7
15
|
} from "./cli-bw80ck94.js";
|
|
@@ -23,14 +31,6 @@ import {
|
|
|
23
31
|
unknown,
|
|
24
32
|
uuid
|
|
25
33
|
} from "./cli-xz9aq0rf.js";
|
|
26
|
-
import {
|
|
27
|
-
init_package,
|
|
28
|
-
package_default
|
|
29
|
-
} from "./cli-pasyk3vc.js";
|
|
30
|
-
import {
|
|
31
|
-
init_secret_scrubber,
|
|
32
|
-
scrubSecrets
|
|
33
|
-
} from "./cli-4j2mrzag.js";
|
|
34
34
|
import {
|
|
35
35
|
__commonJS,
|
|
36
36
|
__esm,
|
|
@@ -803,7 +803,7 @@ function resolveTaskModelSelection(opts) {
|
|
|
803
803
|
function isTerminalTaskStatus(status) {
|
|
804
804
|
return TERMINAL_TASK_STATUSES.includes(status);
|
|
805
805
|
}
|
|
806
|
-
var AssetKeySchema, AssetEntityTypeSchema, AssetProviderRefSchema, AssetKeyMappingSchema, AssetSummarySchema, ModelTierSchema, MODEL_TIERS, ReasoningEffortSchema, LEGACY_MODEL_TO_TIER, DEFAULT_MODEL_TIER_MAP, AgentTaskStatusSchema, TERMINAL_TASK_STATUSES, InboxMessageStatusSchema, InboxMessageSchema, AgentTaskSourceSchema, ProviderNameSchema, FollowUpConfigSchema, RoutingAffinitySchema, AgentTaskSchema, TaskAttachmentKindSchema, attachmentCommonFields, AttachmentInputSchema, TaskAttachmentSchema, UserSchema, IdentityEventTypeSchema, InboxItemTypeSchema, InboxItemStatusSchema, InboxItemStateSchema, FavoriteItemTypeSchema, UserFavoriteSchema, TaskTemplateKindSchema, TaskTemplateSchema, AgentStatusSchema, AgentSchema, AgentCredStatusLiveTestSchema, AgentLatestModelSchema, AgentBedrockStatusSchema, AgentCredStatusSchema, AgentWithTasksSchema, ChangeSourceSchema, VersionableFieldSchema, ContextVersionSchema, ChannelTypeSchema, ChannelSchema, ChannelMessageSchema, ServiceStatusSchema, ServiceSchema, AgentLogEventTypeSchema, ResumeReasonSchema, AgentLogSchema, SessionLogSchema, SessionCostSourceSchema, SessionCostSchema, EventCategorySchema, EventStatusSchema, EventSourceSchema, EventNameSchema, SwarmEventSchema, ScheduledTaskTargetTypeSchema, ScheduledTaskSchema, SwarmConfigScopeSchema, SwarmConfigSchema, RepoGuidelinesSchema, RepoHooksSchema, SwarmRepoSchema, AgentMemoryScopeSchema, AgentMemorySourceSchema, AgentMemorySchema, ActiveSessionSchema, RetryPolicySchema, ExecutorMetaSchema, ValidationResultSchema, StepValidationConfigSchema, SwarmScriptNodeConfigSchema, WorkflowNodeSchema, WorkflowEdgeSchema, WorkflowDefinitionSchema, WorkflowNodePatchSchema, WorkflowPatchSchema, WebhookVerificationSchema, TriggerConfigSchema, CooldownConfigSchema, InputValueSchema, WorkflowTemplateSchema, WorkflowSnapshotSchema, WorkflowSchema, WorkflowVersionSchema, PageContentTypeSchema, PageAuthModeSchema, PageSnapshotSchema, PageSchema, PageVersionSchema, MetricParamSchema, MetricVariableTypeSchema, MetricFormatSchema, MetricVisualizationSchema, MetricQuerySchema, MetricVariableSchema, MetricVizConfigSchema, MetricWidgetSchema, MetricDefinitionSchema, MetricSnapshotSchema, MetricSchema, MetricVersionSchema, WorkflowRunStatusSchema, WorkflowRunSchema, ScriptRunStatusSchema, TERMINAL_SCRIPT_RUN_STATUSES, ScriptRunKindSchema, ScriptRunSchema, ScriptRunListItemSchema, ScriptRunJournalEntrySchema, WorkflowRunStepStatusSchema, WorkflowRunStepSchema, WaitModeSchema, WaitStateStatusSchema, WaitStateRowSchema, PromptTemplateScopeSchema, PromptTemplateStateSchema, PromptTemplateSchema, PromptTemplateHistorySchema, ScriptScopeSchema, ScriptFsModeSchema, ScriptRecordSchema, ScriptVersionRecordSchema, ScriptApiAuthModeSchema, ScriptApiRecordSchema, SkillTypeSchema, SkillScopeSchema, SkillSchema, AgentSkillSchema, SkillWithInstallInfoSchema, SkillFileSchema, McpServerTransportSchema, McpServerScopeSchema, McpAuthMethodSchema, McpServerSchema, AgentMcpServerSchema, McpServerWithInstallInfoSchema, ContextSnapshotEventTypeSchema, ContextFormulaSchema, ContextSnapshotSchema, BudgetScopeSchema, BudgetSchema, PricingProviderSchema, PricingTokenClassSchema, PricingRowSchema, BudgetRefusalCauseSchema, BudgetRefusalNotificationSchema, BudgetRefusedTriggerSchema, KvValueTypeSchema, KV_NAME_REGEX, KvNamespaceSchema, KvKeySchema, KvEntrySchema;
|
|
806
|
+
var AssetKeySchema, AssetEntityTypeSchema, AssetProviderRefSchema, AssetKeyMappingSchema, AssetSummarySchema, ModelTierSchema, MODEL_TIERS, ReasoningEffortSchema, LEGACY_MODEL_TO_TIER, DEFAULT_MODEL_TIER_MAP, AgentTaskStatusSchema, TERMINAL_TASK_STATUSES, InboxMessageStatusSchema, InboxMessageSchema, AgentTaskSourceSchema, ProviderNameSchema, FollowUpConfigSchema, RoutingAffinitySchema, AgentTaskSchema, TaskAttachmentKindSchema, attachmentCommonFields, AttachmentInputSchema, TaskAttachmentSchema, UserSchema, IdentityEventTypeSchema, InboxItemTypeSchema, InboxItemStatusSchema, InboxItemStateSchema, FavoriteItemTypeSchema, UserFavoriteSchema, TaskTemplateKindSchema, TaskTemplateSchema, AgentStatusSchema, AgentAvatarSchema, AgentSchema, AgentCredStatusLiveTestSchema, AgentLatestModelSchema, AgentBedrockStatusSchema, AgentCredStatusSchema, AgentWithTasksSchema, ChangeSourceSchema, VersionableFieldSchema, ContextVersionSchema, ChannelTypeSchema, ChannelSchema, ChannelMessageSchema, ServiceStatusSchema, ServiceSchema, AgentLogEventTypeSchema, ResumeReasonSchema, AgentLogSchema, SessionLogSchema, SessionCostSourceSchema, SessionCostSchema, EventCategorySchema, EventStatusSchema, EventSourceSchema, EventNameSchema, SwarmEventSchema, ScheduledTaskTargetTypeSchema, ScheduledTaskSchema, SwarmConfigScopeSchema, SwarmConfigSchema, RepoGuidelinesSchema, RepoHooksSchema, SwarmRepoSchema, AgentMemoryScopeSchema, AgentMemorySourceSchema, AgentMemorySchema, ActiveSessionSchema, RetryPolicySchema, ExecutorMetaSchema, ValidationResultSchema, StepValidationConfigSchema, SwarmScriptNodeConfigSchema, WorkflowNodeSchema, WorkflowEdgeSchema, WorkflowDefinitionSchema, WorkflowNodePatchSchema, WorkflowPatchSchema, WebhookVerificationSchema, TriggerConfigSchema, CooldownConfigSchema, InputValueSchema, WorkflowTemplateSchema, WorkflowSnapshotSchema, WorkflowSchema, WorkflowVersionSchema, PageContentTypeSchema, PageAuthModeSchema, PageSnapshotSchema, PageSchema, PageVersionSchema, MetricParamSchema, MetricVariableTypeSchema, MetricFormatSchema, MetricVisualizationSchema, MetricQuerySchema, MetricVariableSchema, MetricVizConfigSchema, MetricWidgetSchema, MetricDefinitionSchema, MetricSnapshotSchema, MetricSchema, MetricVersionSchema, WorkflowRunStatusSchema, WorkflowRunSchema, ScriptRunStatusSchema, TERMINAL_SCRIPT_RUN_STATUSES, ScriptRunKindSchema, ScriptRunSchema, ScriptRunListItemSchema, ScriptRunJournalEntrySchema, WorkflowRunStepStatusSchema, WorkflowRunStepSchema, WaitModeSchema, WaitStateStatusSchema, WaitStateRowSchema, PromptTemplateScopeSchema, PromptTemplateStateSchema, PromptTemplateSchema, PromptTemplateHistorySchema, ScriptScopeSchema, ScriptFsModeSchema, ScriptRecordSchema, ScriptVersionRecordSchema, ScriptApiAuthModeSchema, ScriptApiRecordSchema, SkillTypeSchema, SkillScopeSchema, SkillSchema, AgentSkillSchema, SkillWithInstallInfoSchema, SkillFileSchema, McpServerTransportSchema, McpServerScopeSchema, McpAuthMethodSchema, McpServerSchema, AgentMcpServerSchema, McpServerWithInstallInfoSchema, ContextSnapshotEventTypeSchema, ContextFormulaSchema, ContextSnapshotSchema, BudgetScopeSchema, BudgetSchema, PricingProviderSchema, PricingTokenClassSchema, PricingRowSchema, BudgetRefusalCauseSchema, BudgetRefusalNotificationSchema, BudgetRefusedTriggerSchema, KvValueTypeSchema, KV_NAME_REGEX, KvNamespaceSchema, KvKeySchema, KvEntrySchema;
|
|
807
807
|
var init_types = __esm(() => {
|
|
808
808
|
init_zod();
|
|
809
809
|
init_key();
|
|
@@ -968,6 +968,7 @@ var init_types = __esm(() => {
|
|
|
968
968
|
agentId: uuid().nullable(),
|
|
969
969
|
creatorAgentId: uuid().optional(),
|
|
970
970
|
task: string().min(1),
|
|
971
|
+
title: string().optional(),
|
|
971
972
|
status: AgentTaskStatusSchema,
|
|
972
973
|
source: AgentTaskSourceSchema.default("mcp"),
|
|
973
974
|
taskType: string().max(50).optional(),
|
|
@@ -1166,6 +1167,13 @@ var init_types = __esm(() => {
|
|
|
1166
1167
|
createdAt: string()
|
|
1167
1168
|
});
|
|
1168
1169
|
AgentStatusSchema = _enum(["idle", "busy", "offline", "waiting_for_credentials"]);
|
|
1170
|
+
AgentAvatarSchema = discriminatedUnion("type", [
|
|
1171
|
+
object({
|
|
1172
|
+
type: literal("lucide"),
|
|
1173
|
+
icon: string().regex(/^[a-z0-9-]+$/).max(64),
|
|
1174
|
+
color: string().regex(/^#[0-9a-fA-F]{6}$/).optional()
|
|
1175
|
+
})
|
|
1176
|
+
]);
|
|
1169
1177
|
AgentSchema = object({
|
|
1170
1178
|
id: uuid(),
|
|
1171
1179
|
name: string().min(1),
|
|
@@ -1187,6 +1195,7 @@ var init_types = __esm(() => {
|
|
|
1187
1195
|
harnessProvider: ProviderNameSchema.nullable().optional(),
|
|
1188
1196
|
credentialMissing: array(string()).nullable().optional(),
|
|
1189
1197
|
credStatus: lazy(() => AgentCredStatusSchema).nullable().optional(),
|
|
1198
|
+
avatar: lazy(() => AgentAvatarSchema).nullable().optional(),
|
|
1190
1199
|
createdAt: exports_iso.datetime().default(() => new Date().toISOString()),
|
|
1191
1200
|
lastUpdatedAt: exports_iso.datetime().default(() => new Date().toISOString())
|
|
1192
1201
|
});
|
|
@@ -2378,6 +2387,220 @@ var init_asset_key_audit = __esm(() => {
|
|
|
2378
2387
|
];
|
|
2379
2388
|
});
|
|
2380
2389
|
|
|
2390
|
+
// src/scripts-runtime/credential-broker/types.ts
|
|
2391
|
+
function placeholderForConfigKey(configKey) {
|
|
2392
|
+
return `${REDACTED_PLACEHOLDER_PREFIX}${configKey}]`;
|
|
2393
|
+
}
|
|
2394
|
+
function normalizeCredentialBindingsDocument(input, resolveLegacyOAuthProvider, defaultScope) {
|
|
2395
|
+
const document = Array.isArray(input) ? input : input && typeof input === "object" && Array.isArray(input.bindings) ? input.bindings : [];
|
|
2396
|
+
return document.flatMap((raw) => {
|
|
2397
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw))
|
|
2398
|
+
return [];
|
|
2399
|
+
const candidate = { ...raw };
|
|
2400
|
+
if (defaultScope !== undefined && candidate.scope == null) {
|
|
2401
|
+
candidate.scope = defaultScope;
|
|
2402
|
+
}
|
|
2403
|
+
if (candidate.authKind === "oauth" && typeof candidate.oauthAuthorizationId !== "string" && typeof candidate.oauthProvider === "string") {
|
|
2404
|
+
const authorizationId = resolveLegacyOAuthProvider?.(candidate.oauthProvider);
|
|
2405
|
+
if (!authorizationId)
|
|
2406
|
+
return [];
|
|
2407
|
+
candidate.oauthAuthorizationId = authorizationId;
|
|
2408
|
+
}
|
|
2409
|
+
const parsed = CredentialBindingSchema.safeParse(candidate);
|
|
2410
|
+
return parsed.success ? [parsed.data] : [];
|
|
2411
|
+
});
|
|
2412
|
+
}
|
|
2413
|
+
var CREDENTIAL_BINDINGS_CONFIG_KEY = "SCRIPT_CREDENTIAL_BINDINGS", REDACTED_PLACEHOLDER_PREFIX = "[REDACTED:", CredentialBindingScopeSchema, CredentialBindingAuthKindSchema, CredentialBindingSchema, CredentialBindingsDocumentSchema;
|
|
2414
|
+
var init_types2 = __esm(() => {
|
|
2415
|
+
init_zod();
|
|
2416
|
+
CredentialBindingScopeSchema = _enum(["global", "agent", "repo"]);
|
|
2417
|
+
CredentialBindingAuthKindSchema = _enum(["config", "oauth"]);
|
|
2418
|
+
CredentialBindingSchema = object({
|
|
2419
|
+
configKey: string().min(1).max(255),
|
|
2420
|
+
allowedHosts: array(string().min(1)).min(1),
|
|
2421
|
+
headerTemplate: string().min(1).optional(),
|
|
2422
|
+
queryTemplate: string().min(1).optional(),
|
|
2423
|
+
scope: CredentialBindingScopeSchema.default("global"),
|
|
2424
|
+
scopeId: string().nullable().optional(),
|
|
2425
|
+
active: boolean().default(true),
|
|
2426
|
+
authKind: CredentialBindingAuthKindSchema.default("config"),
|
|
2427
|
+
oauthAuthorizationId: string().min(1).max(255).optional()
|
|
2428
|
+
}).refine((binding) => binding.headerTemplate || binding.queryTemplate, {
|
|
2429
|
+
message: "At least one of headerTemplate or queryTemplate is required."
|
|
2430
|
+
}).refine((binding) => binding.authKind !== "oauth" || !!binding.oauthAuthorizationId, {
|
|
2431
|
+
message: "oauthAuthorizationId is required when authKind is oauth.",
|
|
2432
|
+
path: ["oauthAuthorizationId"]
|
|
2433
|
+
});
|
|
2434
|
+
CredentialBindingsDocumentSchema = union([
|
|
2435
|
+
array(CredentialBindingSchema),
|
|
2436
|
+
object({ bindings: array(CredentialBindingSchema) })
|
|
2437
|
+
]);
|
|
2438
|
+
});
|
|
2439
|
+
|
|
2440
|
+
// src/scripts-runtime/credential-broker/broker.ts
|
|
2441
|
+
function bindingHasPlaceholder(binding) {
|
|
2442
|
+
const placeholder = placeholderForConfigKey(binding.configKey);
|
|
2443
|
+
return binding.headerTemplate?.includes(placeholder) === true || binding.queryTemplate?.includes(placeholder) === true;
|
|
2444
|
+
}
|
|
2445
|
+
function reasonFromError(err) {
|
|
2446
|
+
const reason = err.reason;
|
|
2447
|
+
return typeof reason === "string" && reason.length > 0 ? reason : "refresh_failed";
|
|
2448
|
+
}
|
|
2449
|
+
function labelFromError(err) {
|
|
2450
|
+
const label = err.authorizationLabel;
|
|
2451
|
+
return typeof label === "string" && label.length > 0 ? label : undefined;
|
|
2452
|
+
}
|
|
2453
|
+
|
|
2454
|
+
class CredentialBroker {
|
|
2455
|
+
store;
|
|
2456
|
+
resolveConfigCredential;
|
|
2457
|
+
defaults;
|
|
2458
|
+
resolveOAuthCredential;
|
|
2459
|
+
constructor(store, resolveConfigCredential, defaults = [], resolveOAuthCredential) {
|
|
2460
|
+
this.store = store;
|
|
2461
|
+
this.resolveConfigCredential = resolveConfigCredential;
|
|
2462
|
+
this.defaults = defaults;
|
|
2463
|
+
this.resolveOAuthCredential = resolveOAuthCredential;
|
|
2464
|
+
}
|
|
2465
|
+
async resolveBindingsWithFailures(context) {
|
|
2466
|
+
const merged = [...this.defaults, ...this.store.listActiveBindings(context)];
|
|
2467
|
+
const resolved = [];
|
|
2468
|
+
const failed = [];
|
|
2469
|
+
const seen = new Set;
|
|
2470
|
+
const failedSeen = new Set;
|
|
2471
|
+
for (const binding of merged) {
|
|
2472
|
+
if (binding.active === false)
|
|
2473
|
+
continue;
|
|
2474
|
+
if (!bindingHasPlaceholder(binding))
|
|
2475
|
+
continue;
|
|
2476
|
+
let value;
|
|
2477
|
+
if (binding.authKind === "oauth") {
|
|
2478
|
+
if (!binding.oauthAuthorizationId)
|
|
2479
|
+
continue;
|
|
2480
|
+
try {
|
|
2481
|
+
value = await this.resolveOAuthCredential?.(binding.oauthAuthorizationId);
|
|
2482
|
+
} catch (err) {
|
|
2483
|
+
const placeholder = placeholderForConfigKey(binding.configKey);
|
|
2484
|
+
const failKey = [placeholder, [...binding.allowedHosts].sort().join(",")].join("\x00");
|
|
2485
|
+
if (!failedSeen.has(failKey)) {
|
|
2486
|
+
failedSeen.add(failKey);
|
|
2487
|
+
const label = labelFromError(err);
|
|
2488
|
+
failed.push({
|
|
2489
|
+
placeholder,
|
|
2490
|
+
allowedHosts: binding.allowedHosts,
|
|
2491
|
+
reason: reasonFromError(err),
|
|
2492
|
+
...label ? { authorizationLabel: label } : {}
|
|
2493
|
+
});
|
|
2494
|
+
}
|
|
2495
|
+
continue;
|
|
2496
|
+
}
|
|
2497
|
+
} else {
|
|
2498
|
+
value = this.resolveConfigCredential(binding.configKey);
|
|
2499
|
+
}
|
|
2500
|
+
if (!value)
|
|
2501
|
+
continue;
|
|
2502
|
+
const dedupeKey = [
|
|
2503
|
+
binding.configKey,
|
|
2504
|
+
[...binding.allowedHosts].sort().join(","),
|
|
2505
|
+
binding.headerTemplate ?? "",
|
|
2506
|
+
binding.queryTemplate ?? "",
|
|
2507
|
+
binding.scope,
|
|
2508
|
+
binding.scopeId ?? ""
|
|
2509
|
+
].join("\x00");
|
|
2510
|
+
if (seen.has(dedupeKey))
|
|
2511
|
+
continue;
|
|
2512
|
+
seen.add(dedupeKey);
|
|
2513
|
+
resolved.push({
|
|
2514
|
+
...binding,
|
|
2515
|
+
placeholder: placeholderForConfigKey(binding.configKey),
|
|
2516
|
+
value
|
|
2517
|
+
});
|
|
2518
|
+
}
|
|
2519
|
+
return { resolved, failed };
|
|
2520
|
+
}
|
|
2521
|
+
async resolveBindings(context) {
|
|
2522
|
+
return (await this.resolveBindingsWithFailures(context)).resolved;
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
var init_broker = __esm(() => {
|
|
2526
|
+
init_types2();
|
|
2527
|
+
});
|
|
2528
|
+
|
|
2529
|
+
// src/scripts-runtime/credential-broker/default-bindings.ts
|
|
2530
|
+
var DEFAULT_CREDENTIAL_BINDINGS;
|
|
2531
|
+
var init_default_bindings = __esm(() => {
|
|
2532
|
+
DEFAULT_CREDENTIAL_BINDINGS = [
|
|
2533
|
+
{
|
|
2534
|
+
configKey: "GITHUB_TOKEN",
|
|
2535
|
+
allowedHosts: ["api.github.com"],
|
|
2536
|
+
headerTemplate: "Authorization: Bearer [REDACTED:GITHUB_TOKEN]",
|
|
2537
|
+
scope: "global",
|
|
2538
|
+
scopeId: null,
|
|
2539
|
+
active: true,
|
|
2540
|
+
authKind: "config"
|
|
2541
|
+
}
|
|
2542
|
+
];
|
|
2543
|
+
});
|
|
2544
|
+
|
|
2545
|
+
// src/scripts-runtime/credential-broker/fetch-patch.ts
|
|
2546
|
+
var init_fetch_patch = () => {};
|
|
2547
|
+
|
|
2548
|
+
// src/scripts-runtime/credential-broker/index.ts
|
|
2549
|
+
var init_credential_broker = __esm(() => {
|
|
2550
|
+
init_broker();
|
|
2551
|
+
init_default_bindings();
|
|
2552
|
+
init_fetch_patch();
|
|
2553
|
+
init_types2();
|
|
2554
|
+
});
|
|
2555
|
+
|
|
2556
|
+
// src/be/connection-bindings-blob-migration.ts
|
|
2557
|
+
function migrateLegacyCredentialBindingBlob(database) {
|
|
2558
|
+
const rows = database.prepare("SELECT id, scope, scopeId, value FROM swarm_config WHERE key = ?").all(CREDENTIAL_BINDINGS_CONFIG_KEY);
|
|
2559
|
+
if (rows.length === 0)
|
|
2560
|
+
return 0;
|
|
2561
|
+
const resolveLegacyOAuthProvider = (provider) => {
|
|
2562
|
+
const row = database.prepare(`SELECT z.id
|
|
2563
|
+
FROM oauth_authorizations z
|
|
2564
|
+
JOIN oauth_apps a ON a.id = z.appId
|
|
2565
|
+
WHERE a.provider = ? AND a.mcpServerId IS NULL AND z.label = 'default'
|
|
2566
|
+
ORDER BY a.createdAt ASC, a.id ASC
|
|
2567
|
+
LIMIT 1`).get(provider);
|
|
2568
|
+
return row?.id;
|
|
2569
|
+
};
|
|
2570
|
+
const insert = database.prepare(`INSERT OR IGNORE INTO script_credential_bindings
|
|
2571
|
+
(id, config_key, allowed_hosts_json, header_template, query_template, scope, scope_id,
|
|
2572
|
+
active, auth_kind, oauth_authorization_id, source, managed_by_connection_id,
|
|
2573
|
+
created_at, updated_at)
|
|
2574
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'migration', NULL,
|
|
2575
|
+
datetime('now'), datetime('now'))`);
|
|
2576
|
+
let imported = 0;
|
|
2577
|
+
const tx = database.transaction(() => {
|
|
2578
|
+
for (const config of rows) {
|
|
2579
|
+
let bindings;
|
|
2580
|
+
try {
|
|
2581
|
+
bindings = normalizeCredentialBindingsDocument(JSON.parse(config.value), resolveLegacyOAuthProvider, config.scope);
|
|
2582
|
+
} catch (err) {
|
|
2583
|
+
console.warn(`[credential-bindings] Skipping unparseable SCRIPT_CREDENTIAL_BINDINGS entry (config id ${config.id}, scope ${config.scope}): ${scrubSecrets(err instanceof Error ? err.message : String(err))}`);
|
|
2584
|
+
continue;
|
|
2585
|
+
}
|
|
2586
|
+
for (const binding of bindings) {
|
|
2587
|
+
const scope = binding.scope ?? config.scope;
|
|
2588
|
+
const scopeId = binding.scopeId ?? config.scopeId ?? null;
|
|
2589
|
+
insert.run(crypto.randomUUID(), binding.configKey, JSON.stringify(binding.allowedHosts), binding.headerTemplate ?? null, binding.queryTemplate ?? null, scope, scope === "global" ? null : scopeId, binding.active === false ? 0 : 1, binding.authKind, binding.oauthAuthorizationId ?? null);
|
|
2590
|
+
imported += 1;
|
|
2591
|
+
}
|
|
2592
|
+
}
|
|
2593
|
+
database.prepare("DELETE FROM swarm_config WHERE key = ?").run(CREDENTIAL_BINDINGS_CONFIG_KEY);
|
|
2594
|
+
});
|
|
2595
|
+
tx();
|
|
2596
|
+
console.log(`[credential-bindings] Migrated ${imported} legacy SCRIPT_CREDENTIAL_BINDINGS entr(ies) to relational rows and retired the blob key.`);
|
|
2597
|
+
return imported;
|
|
2598
|
+
}
|
|
2599
|
+
var init_connection_bindings_blob_migration = __esm(() => {
|
|
2600
|
+
init_credential_broker();
|
|
2601
|
+
init_secret_scrubber();
|
|
2602
|
+
});
|
|
2603
|
+
|
|
2381
2604
|
// src/be/crypto/secrets-cipher.ts
|
|
2382
2605
|
import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";
|
|
2383
2606
|
function assertKey(key) {
|
|
@@ -2692,6 +2915,45 @@ var init_runner = __esm(() => {
|
|
|
2692
2915
|
];
|
|
2693
2916
|
});
|
|
2694
2917
|
|
|
2918
|
+
// src/be/oauth-encryption-backfill.ts
|
|
2919
|
+
function autoEncryptLegacyOAuthSecrets(database) {
|
|
2920
|
+
const apps = database.prepare(`SELECT id, clientSecret
|
|
2921
|
+
FROM oauth_apps
|
|
2922
|
+
WHERE clientSecretEncrypted = 0 AND clientSecret IS NOT NULL`).all();
|
|
2923
|
+
const authorizations = database.prepare(`SELECT id, accessToken, refreshToken
|
|
2924
|
+
FROM oauth_authorizations
|
|
2925
|
+
WHERE tokensEncrypted = 0`).all();
|
|
2926
|
+
if (apps.length === 0 && authorizations.length === 0) {
|
|
2927
|
+
console.log("[oauth-encryption] No plaintext OAuth secrets to migrate.");
|
|
2928
|
+
return { appsEncrypted: 0, authorizationsEncrypted: 0 };
|
|
2929
|
+
}
|
|
2930
|
+
const key = getEncryptionKey();
|
|
2931
|
+
const updateApp = database.prepare(`UPDATE oauth_apps
|
|
2932
|
+
SET clientSecret = ?, clientSecretEncrypted = 1,
|
|
2933
|
+
updatedAt = strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
|
|
2934
|
+
WHERE id = ? AND clientSecretEncrypted = 0`);
|
|
2935
|
+
const updateAuthorization = database.prepare(`UPDATE oauth_authorizations
|
|
2936
|
+
SET accessToken = ?, refreshToken = ?, tokensEncrypted = 1,
|
|
2937
|
+
updatedAt = strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
|
|
2938
|
+
WHERE id = ? AND tokensEncrypted = 0`);
|
|
2939
|
+
database.transaction(() => {
|
|
2940
|
+
for (const app of apps) {
|
|
2941
|
+
updateApp.run(encryptSecret(app.clientSecret, key), app.id);
|
|
2942
|
+
}
|
|
2943
|
+
for (const authorization of authorizations) {
|
|
2944
|
+
updateAuthorization.run(encryptSecret(authorization.accessToken, key), authorization.refreshToken == null ? null : encryptSecret(authorization.refreshToken, key), authorization.id);
|
|
2945
|
+
}
|
|
2946
|
+
})();
|
|
2947
|
+
console.log(`[oauth-encryption] Migrated ${apps.length} app secret(s) and ${authorizations.length} authorization token set(s).`);
|
|
2948
|
+
return {
|
|
2949
|
+
appsEncrypted: apps.length,
|
|
2950
|
+
authorizationsEncrypted: authorizations.length
|
|
2951
|
+
};
|
|
2952
|
+
}
|
|
2953
|
+
var init_oauth_encryption_backfill = __esm(() => {
|
|
2954
|
+
init_crypto();
|
|
2955
|
+
});
|
|
2956
|
+
|
|
2695
2957
|
// src/prompts/session-templates.ts
|
|
2696
2958
|
var init_session_templates = __esm(() => {
|
|
2697
2959
|
init_registry();
|
|
@@ -2825,7 +3087,6 @@ As a worker agent of the swarm, you are responsible for executing tasks assigned
|
|
|
2825
3087
|
|
|
2826
3088
|
- \`store-progress\`: Save your work progress on tasks (critical!)
|
|
2827
3089
|
- \`task-action\`: Manage tasks - claim from pool, release, accept/reject offered tasks
|
|
2828
|
-
- \`read-messages\`: Read messages from the lead or other workers
|
|
2829
3090
|
|
|
2830
3091
|
#### Completing Tasks
|
|
2831
3092
|
|
|
@@ -2855,6 +3116,18 @@ curl -H "Authorization: Bearer lin_oauth_abc123..." https://api.example.com
|
|
|
2855
3116
|
\`\`\`
|
|
2856
3117
|
|
|
2857
3118
|
The same applies to \`store-progress\` output — never include raw secret values in progress text, output, or failure reasons.
|
|
3119
|
+
`,
|
|
3120
|
+
variables: [],
|
|
3121
|
+
category: "system"
|
|
3122
|
+
});
|
|
3123
|
+
registerTemplate({
|
|
3124
|
+
eventType: "system.agent.messaging",
|
|
3125
|
+
header: "",
|
|
3126
|
+
defaultBody: `
|
|
3127
|
+
#### Swarm Messaging
|
|
3128
|
+
|
|
3129
|
+
- \`post-message\`: Post a message to a swarm channel (use \`mentions\` to notify specific agents, \`replyTo\` to thread)
|
|
3130
|
+
- \`read-messages\`: Read messages from the lead or other agents (filters: \`unreadOnly\`, \`mentionsOnly\`)
|
|
2858
3131
|
`,
|
|
2859
3132
|
variables: [],
|
|
2860
3133
|
category: "system"
|
|
@@ -4164,6 +4437,7 @@ __export(exports_db, {
|
|
|
4164
4437
|
updateWorkflow: () => updateWorkflow,
|
|
4165
4438
|
updateUser: () => updateUser,
|
|
4166
4439
|
updateTaskVcs: () => updateTaskVcs,
|
|
4440
|
+
updateTaskTitle: () => updateTaskTitle,
|
|
4167
4441
|
updateTaskProgress: () => updateTaskProgress,
|
|
4168
4442
|
updateTaskClaudeSessionId: () => updateTaskClaudeSessionId,
|
|
4169
4443
|
updateSwarmRepo: () => updateSwarmRepo,
|
|
@@ -4661,15 +4935,34 @@ function initDb(dbPath = "./agent-swarm-db.sqlite") {
|
|
|
4661
4935
|
seedContextVersions();
|
|
4662
4936
|
configureDbResolver(resolvePromptTemplate);
|
|
4663
4937
|
seedDefaultTemplates();
|
|
4664
|
-
const hasExistingEncryptedSecrets = (database.prepare(
|
|
4938
|
+
const hasExistingEncryptedSecrets = (database.prepare(`SELECT EXISTS(
|
|
4939
|
+
SELECT 1 FROM swarm_config WHERE isSecret = 1 AND encrypted = 1
|
|
4940
|
+
UNION ALL
|
|
4941
|
+
SELECT 1 FROM oauth_apps
|
|
4942
|
+
WHERE clientSecretEncrypted = 1 AND clientSecret IS NOT NULL
|
|
4943
|
+
UNION ALL
|
|
4944
|
+
SELECT 1 FROM oauth_authorizations WHERE tokensEncrypted = 1
|
|
4945
|
+
) AS present`).get()?.present ?? 0) === 1;
|
|
4665
4946
|
const userProvidedKey = !!(process.env.SECRETS_ENCRYPTION_KEY?.length || process.env.SECRETS_ENCRYPTION_KEY_FILE?.length);
|
|
4666
4947
|
resolveEncryptionKey(dbPath, { allowGenerate: !hasExistingEncryptedSecrets });
|
|
4948
|
+
try {
|
|
4949
|
+
autoEncryptLegacyOAuthSecrets(database);
|
|
4950
|
+
} catch (err) {
|
|
4951
|
+
console.error(`[oauth-encryption] FATAL: failed to auto-encrypt legacy OAuth secrets: ${err.message}`);
|
|
4952
|
+
throw err;
|
|
4953
|
+
}
|
|
4667
4954
|
try {
|
|
4668
4955
|
autoEncryptLegacyPlaintextSecrets(database, dbPath, { createBackup: !userProvidedKey });
|
|
4669
4956
|
} catch (err) {
|
|
4670
4957
|
console.error(`[secrets] FATAL: failed to auto-encrypt legacy secrets: ${err.message}`);
|
|
4671
4958
|
throw err;
|
|
4672
4959
|
}
|
|
4960
|
+
try {
|
|
4961
|
+
migrateLegacyCredentialBindingBlob(database);
|
|
4962
|
+
} catch (err) {
|
|
4963
|
+
console.error(`[credential-bindings] FATAL: failed to migrate legacy credential binding blob: ${err.message}`);
|
|
4964
|
+
throw err;
|
|
4965
|
+
}
|
|
4673
4966
|
return db;
|
|
4674
4967
|
}
|
|
4675
4968
|
function getDb(path2) {
|
|
@@ -4763,6 +5056,16 @@ function seedContextVersions() {
|
|
|
4763
5056
|
}
|
|
4764
5057
|
}
|
|
4765
5058
|
}
|
|
5059
|
+
function parseAgentAvatar(raw) {
|
|
5060
|
+
if (!raw)
|
|
5061
|
+
return null;
|
|
5062
|
+
try {
|
|
5063
|
+
const parsed = AgentAvatarSchema.safeParse(JSON.parse(raw));
|
|
5064
|
+
return parsed.success ? parsed.data : null;
|
|
5065
|
+
} catch {
|
|
5066
|
+
return null;
|
|
5067
|
+
}
|
|
5068
|
+
}
|
|
4766
5069
|
function rowToAgent(row, slim = false) {
|
|
4767
5070
|
const base = {
|
|
4768
5071
|
id: row.id,
|
|
@@ -4780,7 +5083,8 @@ function rowToAgent(row, slim = false) {
|
|
|
4780
5083
|
createdAt: row.createdAt,
|
|
4781
5084
|
lastUpdatedAt: row.lastUpdatedAt,
|
|
4782
5085
|
credentialMissing: row.credentialMissing ? JSON.parse(row.credentialMissing) : null,
|
|
4783
|
-
credStatus: row.cred_status ? JSON.parse(row.cred_status) : null
|
|
5086
|
+
credStatus: row.cred_status ? JSON.parse(row.cred_status) : null,
|
|
5087
|
+
avatar: parseAgentAvatar(row.avatar)
|
|
4784
5088
|
};
|
|
4785
5089
|
if (slim)
|
|
4786
5090
|
return base;
|
|
@@ -5007,6 +5311,7 @@ function rowToAgentTask(row) {
|
|
|
5007
5311
|
agentId: row.agentId,
|
|
5008
5312
|
creatorAgentId: row.creatorAgentId ?? undefined,
|
|
5009
5313
|
task: row.task,
|
|
5314
|
+
title: row.title ?? undefined,
|
|
5010
5315
|
status: row.status,
|
|
5011
5316
|
source: row.source,
|
|
5012
5317
|
taskType: row.taskType ?? undefined,
|
|
@@ -5081,6 +5386,7 @@ function rowToAgentTaskSummary(row) {
|
|
|
5081
5386
|
agentId: t.agentId,
|
|
5082
5387
|
creatorAgentId: t.creatorAgentId,
|
|
5083
5388
|
task: previewText(t.task, TASK_PREVIEW_LENGTH),
|
|
5389
|
+
title: t.title,
|
|
5084
5390
|
status: t.status,
|
|
5085
5391
|
source: t.source,
|
|
5086
5392
|
taskType: t.taskType,
|
|
@@ -5263,6 +5569,11 @@ function updateTaskClaudeSessionId(taskId, claudeSessionId, provider, providerMe
|
|
|
5263
5569
|
const row = getDb().prepare(`UPDATE agent_tasks SET ${setClauses.join(", ")} WHERE id = ? RETURNING *`).get(...params);
|
|
5264
5570
|
return row ? rowToAgentTask(row) : null;
|
|
5265
5571
|
}
|
|
5572
|
+
function updateTaskTitle(taskId, title) {
|
|
5573
|
+
const normalized = title === null ? null : title.trim() || null;
|
|
5574
|
+
const row = getDb().prepare("UPDATE agent_tasks SET title = ? WHERE id = ? RETURNING *").get(normalized, taskId);
|
|
5575
|
+
return row ? rowToAgentTask(row) : null;
|
|
5576
|
+
}
|
|
5266
5577
|
function updateTaskVcs(taskId, vcs) {
|
|
5267
5578
|
const row = getDb().prepare(`UPDATE agent_tasks
|
|
5268
5579
|
SET vcsProvider = ?, vcsRepo = ?, vcsNumber = ?, vcsUrl = ?, lastUpdatedAt = ?
|
|
@@ -6910,6 +7221,8 @@ function updateAgentProfile(id, updates, meta) {
|
|
|
6910
7221
|
previousVersionId: latestVersion?.id ?? null
|
|
6911
7222
|
});
|
|
6912
7223
|
}
|
|
7224
|
+
const avatarProvided = Object.hasOwn(updates, "avatar");
|
|
7225
|
+
const avatarJson = updates.avatar ? JSON.stringify(updates.avatar) : null;
|
|
6913
7226
|
const now = new Date().toISOString();
|
|
6914
7227
|
const row = database.prepare(`UPDATE agents SET
|
|
6915
7228
|
description = COALESCE(?, description),
|
|
@@ -6921,8 +7234,9 @@ function updateAgentProfile(id, updates, meta) {
|
|
|
6921
7234
|
setupScript = COALESCE(?, setupScript),
|
|
6922
7235
|
toolsMd = COALESCE(?, toolsMd),
|
|
6923
7236
|
heartbeatMd = COALESCE(?, heartbeatMd),
|
|
7237
|
+
avatar = CASE WHEN ? = 1 THEN ? ELSE avatar END,
|
|
6924
7238
|
lastUpdatedAt = ?
|
|
6925
|
-
WHERE id = ? RETURNING *`).get(updates.description ?? null, updates.role ?? null, updates.capabilities ? JSON.stringify(updates.capabilities) : null, updates.claudeMd ?? null, updates.soulMd ?? null, updates.identityMd ?? null, updates.setupScript ?? null, updates.toolsMd ?? null, updates.heartbeatMd ?? null, now, id);
|
|
7239
|
+
WHERE id = ? RETURNING *`).get(updates.description ?? null, updates.role ?? null, updates.capabilities ? JSON.stringify(updates.capabilities) : null, updates.claudeMd ?? null, updates.soulMd ?? null, updates.identityMd ?? null, updates.setupScript ?? null, updates.toolsMd ?? null, updates.heartbeatMd ?? null, avatarProvided ? 1 : 0, avatarJson, now, id);
|
|
6926
7240
|
return row ? rowToAgent(row) : null;
|
|
6927
7241
|
})();
|
|
6928
7242
|
}
|
|
@@ -10490,8 +10804,9 @@ function listRecentSessions(opts) {
|
|
|
10490
10804
|
params.push(...sources);
|
|
10491
10805
|
}
|
|
10492
10806
|
if (q && q.length > 0) {
|
|
10493
|
-
conditions.push("lower(r.task) LIKE ?");
|
|
10494
|
-
|
|
10807
|
+
conditions.push("(lower(r.task) LIKE ? OR lower(COALESCE(r.title, '')) LIKE ?)");
|
|
10808
|
+
const like = `%${q.toLowerCase()}%`;
|
|
10809
|
+
params.push(like, like);
|
|
10495
10810
|
}
|
|
10496
10811
|
if (requestedByUserId) {
|
|
10497
10812
|
conditions.push("r.requestedByUserId = ?");
|
|
@@ -10563,8 +10878,9 @@ function countSessions(opts) {
|
|
|
10563
10878
|
params.push(...sources);
|
|
10564
10879
|
}
|
|
10565
10880
|
if (q && q.length > 0) {
|
|
10566
|
-
conditions.push("lower(task) LIKE ?");
|
|
10567
|
-
|
|
10881
|
+
conditions.push("(lower(task) LIKE ? OR lower(COALESCE(title, '')) LIKE ?)");
|
|
10882
|
+
const like = `%${q.toLowerCase()}%`;
|
|
10883
|
+
params.push(like, like);
|
|
10568
10884
|
}
|
|
10569
10885
|
if (requestedByUserId) {
|
|
10570
10886
|
conditions.push("requestedByUserId = ?");
|
|
@@ -11143,9 +11459,11 @@ var init_db = __esm(() => {
|
|
|
11143
11459
|
init_request_auth_context();
|
|
11144
11460
|
init_secret_scrubber();
|
|
11145
11461
|
init_asset_key_audit();
|
|
11462
|
+
init_connection_bindings_blob_migration();
|
|
11146
11463
|
init_crypto();
|
|
11147
11464
|
init_date_utils();
|
|
11148
11465
|
init_runner();
|
|
11466
|
+
init_oauth_encryption_backfill();
|
|
11149
11467
|
init_seed_prompt_templates();
|
|
11150
11468
|
init_swarm_config_guard();
|
|
11151
11469
|
init_task_lifecycle_events();
|
|
@@ -11243,4 +11561,4 @@ var init_db = __esm(() => {
|
|
|
11243
11561
|
};
|
|
11244
11562
|
});
|
|
11245
11563
|
|
|
11246
|
-
export { normalizeAssetKey, parseAssetKey, canWriteAssetKey, init_key, interpolate, deepInterpolate, init_template, registerTemplate, getTemplateDefinition, getAllTemplateDefinitions, init_registry, configureHttpResolver, resolveTemplate, resolveTemplateAsync, init_resolver, slackContextKey, agentmailContextKey, githubContextKey, gitlabContextKey, linearContextKey, buildJiraContextKey, scheduleContextKey, workflowContextKey, agentContextKey, pageContextKey, init_context_key, checkSlackRoutingCoherence, init_slack_routing, initTelemetry, telemetry, init_telemetry, AssetKeySchema, AssetEntityTypeSchema, ModelTierSchema, ReasoningEffortSchema, splitLegacyModelAlias, resolveTaskModelSelection, AgentTaskStatusSchema, isTerminalTaskStatus, AgentTaskSourceSchema, ProviderNameSchema, FollowUpConfigSchema, AgentTaskSchema, AttachmentInputSchema, TaskAttachmentSchema, InboxItemTypeSchema, InboxItemStatusSchema, FavoriteItemTypeSchema, TaskTemplateKindSchema, AgentSchema, AgentLatestModelSchema, AgentCredStatusSchema, ChannelTypeSchema, ChannelSchema, ChannelMessageSchema, ServiceStatusSchema, ServiceSchema, ResumeReasonSchema, AgentLogSchema, EventCategorySchema, EventStatusSchema, EventSourceSchema, EventNameSchema, ScheduledTaskTargetTypeSchema, SwarmConfigScopeSchema, SwarmConfigSchema, RepoGuidelinesSchema, RepoHooksSchema, SwarmRepoSchema, AgentMemoryScopeSchema, AgentMemorySourceSchema, AgentMemorySchema, WorkflowDefinitionSchema, WorkflowNodePatchSchema, WorkflowPatchSchema, TriggerConfigSchema, CooldownConfigSchema, InputValueSchema, PageContentTypeSchema, PageAuthModeSchema, MetricDefinitionSchema, MetricVersionSchema, WorkflowRunStatusSchema, ScriptRunStatusSchema, TERMINAL_SCRIPT_RUN_STATUSES, PromptTemplateScopeSchema, PromptTemplateStateSchema, PromptTemplateSchema, PromptTemplateHistorySchema, ScriptScopeSchema, ScriptFsModeSchema, ScriptApiAuthModeSchema, ContextSnapshotEventTypeSchema, ContextFormulaSchema, BudgetScopeSchema, BudgetSchema, PricingProviderSchema, PricingTokenClassSchema, PricingRowSchema, BudgetRefusalCauseSchema, BudgetRefusalNotificationSchema, KvValueTypeSchema, KvNamespaceSchema, KvKeySchema, KvEntrySchema, init_types, setRequestAuth, getRequestAuth, getCurrentRequestAuth, init_request_auth_context, auditAssetKeys, init_asset_key_audit, encryptSecret, decryptSecret, getEncryptionKey, init_crypto, normalizeDate, normalizeDateRequired, init_date_utils, init_session_templates, init_templates, init_templates2 as init_templates1, isReservedConfigKey, reservedKeyError, validateConfigValue, init_swarm_config_guard, onTaskStarted, init_task_lifecycle_events, generateDefaultClaudeMd, generateDefaultSoulMd, generateDefaultIdentityMd, generateDefaultToolsMd, init_defaults, isSqliteVecAvailable, initDb, getDb, closeDb, computeContentHash, createContextVersion, getLatestContextVersion, getContextVersion, getContextVersionHistory, agentQueries, updateAgentCredentialState, createAgent, getAgentById, getAllAgents, getLeadAgent, updateAgentStatus, updateAgentMaxTasks, updateAgentProvider, setAgentHarnessProvider, updateAgentCredStatus, listAgentsWithCredStatusByProvider, getAgentHarnessProviders, updateAgentActivity, MAX_EMPTY_POLLS, incrementEmptyPollCount, resetEmptyPollCount, shouldBlockPolling, deleteAgent, getActiveTaskCount, hasCapacity, getRemainingCapacity, updateAgentStatusFromCapacity, isPoolAffinityEnforcementEnabled, buildRoutingAffinityFromAgent, isAgentEligibleForTask, taskQueries, createTask, getPendingTaskForAgent, assignUnassignedTaskPending, startTask, getTaskById, markTaskSlackReplySent, setSlackMessageTracking, getChildTasks, hasNonTerminalResumeChild, hasNonTerminalRerouteDecisionChild, updateTaskClaudeSessionId, updateTaskVcs, getTasksByAgentId, getAgentCurrentTask, getTasksByStatus, findTaskByVcs, findTaskByGitHub, getAllTasks, getTasksCount, getTaskStats, getCompletedSlackTasks, getRecentlyFinishedWorkerTasks, markTasksNotified, resetTasksNotified, getInProgressSlackTasks, getInProgressTasksByContextKey, findExistingLinearTrackerContextWork, getLatestTaskByContextKey, getAgentWorkingOnThread, getLatestActiveTaskInThread, getMostRecentTaskInThread, findCompletedTaskInThread, findRecentCancelledTaskInThread, completeTask, failTask, cancelTask, supersedeTask, backfillSupersedeTaskResumeTaskId, pauseTask, resumeTask, getPausedTasksForAgent, getOrphanedInProgressTasksForAgent, resetOrphanedInProgressTasksForAgent, getRecentlyCancelledTasksForAgent, deleteTask, updateTaskProgress, insertTaskAttachment, getAssetKeyMappingByProvider, upsertAssetKeyMapping, getAssetKeyMapping, listAssetSummaries, moveAssetKey, deleteTaskAttachment, replaceTaskAttachment, getTaskAttachments, getAgentWithTasks, getAllAgentsWithTasks, logQueries, createLogEntry, getLogsByAgentId, getLogsByTaskId, getLogsByTaskIdChronological, getLogsByEventType, getAllLogs, findRecentSimilarTasks, createTaskExtended, claimTask, releaseTask, acceptTask, rejectTask, moveTaskToBacklog, moveTaskFromBacklog, releaseStaleReviewingTasks, getOfferedTasksForAgent, claimOfferedTask, getUnassignedTasksCount, getUnassignedTaskIds, getUnassignedTaskIdsForAgent, checkDependencies, getDependentTasks, cascadeFailDependents, updateAgentProfile, updateAgentName, createChannel, getMessageById, getChannelById, getChannelByName, getAllChannels, deleteChannel, postMessage, getChannelMessages, updateReadState, getLastReadAt, getUnreadMessages, getMentionsForAgent, getInboxSummary, claimMentions, releaseMentionProcessing, releaseStaleMentionProcessing, createService, getServiceById, getServiceByAgentAndName, getServicesByAgentId, getAllServices, updateServiceStatus, deleteService, upsertService, deleteServicesByAgentId, sessionLogQueries, createSessionLogs, getSessionLogsByTaskId, getSessionLogsBySession, createSessionCost, getSessionCostsByTaskId, getSessionCostsByAgentId, getAllSessionCosts, getSessionCostsFiltered, getSessionCostSummary, getDashboardCostSummary, createInboxMessage, getInboxMessageById, getUnreadInboxMessages, claimInboxMessages, markInboxMessageRead, markInboxMessageResponded, markInboxMessageDelegated, releaseStaleProcessingInbox, getConcurrentContext, getScheduledTasks, getScheduledTaskById, getScheduledTaskByName, createScheduledTask, updateScheduledTask, deleteScheduledTask, getDueScheduledTasks, autoEncryptLegacyPlaintextSecrets, maskSecrets, getSwarmConfigs, getInjectableGlobalConfigs, getSwarmConfigById, getSwarmConfigLookupById, upsertSwarmConfig, deleteSwarmConfig, deleteSwarmConfigByKey, getResolvedConfig, getSwarmRepos, getSwarmRepoById, getSwarmRepoByName, getSwarmRepoByUrl, createSwarmRepo, updateSwarmRepo, deleteSwarmRepo, getAgentMailInboxMapping, getAgentMailInboxMappingsByAgent, getAllAgentMailInboxMappings, createAgentMailInboxMapping, deleteAgentMailInboxMapping, findTaskByAgentMailThread, insertActiveSession, deleteActiveSession, deleteActiveSessionById, getActiveSessions, heartbeatActiveSession, cleanupStaleSessions, cleanupAgentSessions, updateActiveSessionProviderSessionId, getActiveSessionForTask, reassociateSessionLogs, getStalledInProgressTasks, getStalePinnedResumes, failPendingResumeIfUnclaimed, getIdleWorkersWithCapacity, getUnassignedPoolTasks, getStaleUnassignedAffinityTasks, getRecentFailedTasks, getRecentCompletedCount, getRecentFailedCount, createWorkflow, getWorkflow, listWorkflows, updateWorkflow, deleteWorkflow, getWorkflowsByScheduleId, createWorkflowRun, getWorkflowRun, updateWorkflowRun, listWorkflowRuns, createWorkflowRunStep, getWorkflowRunStep, updateWorkflowRunStep, getWorkflowRunStepsByRunId, getStuckWorkflowRuns, getLastSuccessfulRun, getLastRunStart, getRetryableSteps, getCompletedStepNodeIds, getTaskByWorkflowRunStepId, getStepByIdempotencyKey, getStepCountForNode, getLatestStepForNode, createWorkflowVersion, getWorkflowVersions, getWorkflowVersion, createPage, getPage, getPageBySlug, getLatestPageBySlug, listPagesByAgent, listAllPages, countAllPages, countPagesByAgent, updatePage, deletePage, incrementPageViewCount, createPageVersion, getPageVersions, getPageVersion, createMetric, getMetric, getMetricBySlug, listMetricsByAgent, listAllMetrics, countAllMetrics, countMetricsByAgent, updateMetric, deleteMetric, createMetricVersion, getMetricVersions, getMetricVersion, getPromptTemplates, getPromptTemplateById, upsertPromptTemplate, deletePromptTemplate, resetPromptTemplateToDefault, getPromptTemplateHistory, resolvePromptTemplate, checkoutPromptTemplate, getAllChannelActivityCursors, getChannelActivityCursor, upsertChannelActivityCursor, createApprovalRequest, getApprovalRequestById, resolveApprovalRequest, updateApprovalRequestNotifications, listApprovalRequests, getStuckApprovalRuns, getApprovalRequestByStepId, getExpiredPendingApprovals, createWaitState, getWaitStateById, getWaitStateByStepId, getDueWaitStates, getPendingEventWaitNames, getPendingWaitsByEvent, resolveWaitState, getStuckWaitRuns, SKILL_FILE_LIMITS, normalizeSkillFilePath, createSkill, updateSkill, listSkillFileManifest, getSkillFiles, getSkillFile, upsertSkillFile, upsertSkillFiles, deleteSkillFile, deleteSkill, getSkillById, getSkillByName, listSkills, searchSkills, installSkill, getSystemDefaultSkills, installSystemDefaultSkillsForAgent, uninstallSkill, getAgentSkills, toggleAgentSkill, createMcpServer, updateMcpServer, deleteMcpServer, getMcpServerById, getMcpServerByName, listMcpServers, installMcpServer, uninstallMcpServer, getAgentMcpServers, createContextSnapshot, getContextSnapshotsByTaskId, getContextSnapshotsBySessionId, getContextSummaryByTaskId, getAvailableKeyIndices, recordKeyUsage, markKeyRateLimited, recordKeyRateLimitWindows, setApiKeyName, clearKeyRateLimit, getKeyStatuses, getKeyCostSummary, getUserById, getAllUsers, createUser, updateUser, deleteUser, listInboxState, upsertInboxState, listFavorites, listUserFavorites, getFavoriteItemIdSet, setFavorite, setUserFavorite, withFavoriteFlags, listTaskTemplates, getRootTaskChain, listRecentSessions, countSessions, getBudget, getBudgets, upsertBudget, deleteBudget, getAllPricingRows, getPricingRows, getActivePricingRow, insertPricingRow, deletePricingRow, getDailySpendForAgent, getDailySpendGlobal, getDailySpendForUser, recordBudgetRefusalNotification, getBudgetRefusalNotification, getRecentBudgetRefusalNotifications, hasBudgetRefusalNotificationToday, setBudgetRefusalFollowUpTaskId, getLiveAgentCounts, getInstanceActivity, getSwarmMetrics, hasFirstCompletedTask, getKv, upsertKv, deleteKv, KvTypeCollisionError, incrKv, listKv, countKv, createScriptRun, recordInlineScriptRun, getScriptRun, getScriptRunByIdempotencyKey, listScriptRuns, countScriptRuns, countActiveScriptRuns, updateScriptRun, getRunningScriptRuns, getScriptRunJournalStep, upsertScriptRunJournalStep, listScriptRunJournalSteps, countScriptRunJournalSteps, countScriptRunJournalAgentTaskSteps, exports_db, init_db };
|
|
11564
|
+
export { normalizeAssetKey, parseAssetKey, canWriteAssetKey, init_key, interpolate, deepInterpolate, init_template, registerTemplate, getTemplateDefinition, getAllTemplateDefinitions, init_registry, configureHttpResolver, resolveTemplate, resolveTemplateAsync, init_resolver, slackContextKey, agentmailContextKey, githubContextKey, gitlabContextKey, linearContextKey, buildJiraContextKey, scheduleContextKey, workflowContextKey, agentContextKey, pageContextKey, init_context_key, checkSlackRoutingCoherence, init_slack_routing, initTelemetry, telemetry, init_telemetry, AssetKeySchema, AssetEntityTypeSchema, ModelTierSchema, ReasoningEffortSchema, splitLegacyModelAlias, resolveTaskModelSelection, AgentTaskStatusSchema, isTerminalTaskStatus, AgentTaskSourceSchema, ProviderNameSchema, FollowUpConfigSchema, AgentTaskSchema, AttachmentInputSchema, TaskAttachmentSchema, InboxItemTypeSchema, InboxItemStatusSchema, FavoriteItemTypeSchema, TaskTemplateKindSchema, AgentAvatarSchema, AgentSchema, AgentLatestModelSchema, AgentCredStatusSchema, ChannelTypeSchema, ChannelSchema, ChannelMessageSchema, ServiceStatusSchema, ServiceSchema, ResumeReasonSchema, AgentLogSchema, EventCategorySchema, EventStatusSchema, EventSourceSchema, EventNameSchema, ScheduledTaskTargetTypeSchema, SwarmConfigScopeSchema, SwarmConfigSchema, RepoGuidelinesSchema, RepoHooksSchema, SwarmRepoSchema, AgentMemoryScopeSchema, AgentMemorySourceSchema, AgentMemorySchema, WorkflowDefinitionSchema, WorkflowNodePatchSchema, WorkflowPatchSchema, TriggerConfigSchema, CooldownConfigSchema, InputValueSchema, PageContentTypeSchema, PageAuthModeSchema, MetricDefinitionSchema, MetricVersionSchema, WorkflowRunStatusSchema, ScriptRunStatusSchema, TERMINAL_SCRIPT_RUN_STATUSES, PromptTemplateScopeSchema, PromptTemplateStateSchema, PromptTemplateSchema, PromptTemplateHistorySchema, ScriptScopeSchema, ScriptFsModeSchema, ScriptApiAuthModeSchema, ContextSnapshotEventTypeSchema, ContextFormulaSchema, BudgetScopeSchema, BudgetSchema, PricingProviderSchema, PricingTokenClassSchema, PricingRowSchema, BudgetRefusalCauseSchema, BudgetRefusalNotificationSchema, KvValueTypeSchema, KvNamespaceSchema, KvKeySchema, KvEntrySchema, init_types, setRequestAuth, getRequestAuth, getCurrentRequestAuth, init_request_auth_context, auditAssetKeys, init_asset_key_audit, CredentialBindingSchema, placeholderForConfigKey, CredentialBroker, DEFAULT_CREDENTIAL_BINDINGS, init_credential_broker, encryptSecret, decryptSecret, getEncryptionKey, init_crypto, normalizeDate, normalizeDateRequired, init_date_utils, init_session_templates, init_templates, init_templates2 as init_templates1, isReservedConfigKey, reservedKeyError, validateConfigValue, init_swarm_config_guard, onTaskStarted, init_task_lifecycle_events, generateDefaultClaudeMd, generateDefaultSoulMd, generateDefaultIdentityMd, generateDefaultToolsMd, init_defaults, isSqliteVecAvailable, initDb, getDb, closeDb, computeContentHash, createContextVersion, getLatestContextVersion, getContextVersion, getContextVersionHistory, agentQueries, updateAgentCredentialState, createAgent, getAgentById, getAllAgents, getLeadAgent, updateAgentStatus, updateAgentMaxTasks, updateAgentProvider, setAgentHarnessProvider, updateAgentCredStatus, listAgentsWithCredStatusByProvider, getAgentHarnessProviders, updateAgentActivity, MAX_EMPTY_POLLS, incrementEmptyPollCount, resetEmptyPollCount, shouldBlockPolling, deleteAgent, getActiveTaskCount, hasCapacity, getRemainingCapacity, updateAgentStatusFromCapacity, isPoolAffinityEnforcementEnabled, buildRoutingAffinityFromAgent, isAgentEligibleForTask, taskQueries, createTask, getPendingTaskForAgent, assignUnassignedTaskPending, startTask, getTaskById, markTaskSlackReplySent, setSlackMessageTracking, getChildTasks, hasNonTerminalResumeChild, hasNonTerminalRerouteDecisionChild, updateTaskClaudeSessionId, updateTaskTitle, updateTaskVcs, getTasksByAgentId, getAgentCurrentTask, getTasksByStatus, findTaskByVcs, findTaskByGitHub, getAllTasks, getTasksCount, getTaskStats, getCompletedSlackTasks, getRecentlyFinishedWorkerTasks, markTasksNotified, resetTasksNotified, getInProgressSlackTasks, getInProgressTasksByContextKey, findExistingLinearTrackerContextWork, getLatestTaskByContextKey, getAgentWorkingOnThread, getLatestActiveTaskInThread, getMostRecentTaskInThread, findCompletedTaskInThread, findRecentCancelledTaskInThread, completeTask, failTask, cancelTask, supersedeTask, backfillSupersedeTaskResumeTaskId, pauseTask, resumeTask, getPausedTasksForAgent, getOrphanedInProgressTasksForAgent, resetOrphanedInProgressTasksForAgent, getRecentlyCancelledTasksForAgent, deleteTask, updateTaskProgress, insertTaskAttachment, getAssetKeyMappingByProvider, upsertAssetKeyMapping, getAssetKeyMapping, listAssetSummaries, moveAssetKey, deleteTaskAttachment, replaceTaskAttachment, getTaskAttachments, getAgentWithTasks, getAllAgentsWithTasks, logQueries, createLogEntry, getLogsByAgentId, getLogsByTaskId, getLogsByTaskIdChronological, getLogsByEventType, getAllLogs, findRecentSimilarTasks, createTaskExtended, claimTask, releaseTask, acceptTask, rejectTask, moveTaskToBacklog, moveTaskFromBacklog, releaseStaleReviewingTasks, getOfferedTasksForAgent, claimOfferedTask, getUnassignedTasksCount, getUnassignedTaskIds, getUnassignedTaskIdsForAgent, checkDependencies, getDependentTasks, cascadeFailDependents, updateAgentProfile, updateAgentName, createChannel, getMessageById, getChannelById, getChannelByName, getAllChannels, deleteChannel, postMessage, getChannelMessages, updateReadState, getLastReadAt, getUnreadMessages, getMentionsForAgent, getInboxSummary, claimMentions, releaseMentionProcessing, releaseStaleMentionProcessing, createService, getServiceById, getServiceByAgentAndName, getServicesByAgentId, getAllServices, updateServiceStatus, deleteService, upsertService, deleteServicesByAgentId, sessionLogQueries, createSessionLogs, getSessionLogsByTaskId, getSessionLogsBySession, createSessionCost, getSessionCostsByTaskId, getSessionCostsByAgentId, getAllSessionCosts, getSessionCostsFiltered, getSessionCostSummary, getDashboardCostSummary, createInboxMessage, getInboxMessageById, getUnreadInboxMessages, claimInboxMessages, markInboxMessageRead, markInboxMessageResponded, markInboxMessageDelegated, releaseStaleProcessingInbox, getConcurrentContext, getScheduledTasks, getScheduledTaskById, getScheduledTaskByName, createScheduledTask, updateScheduledTask, deleteScheduledTask, getDueScheduledTasks, autoEncryptLegacyPlaintextSecrets, maskSecrets, getSwarmConfigs, getInjectableGlobalConfigs, getSwarmConfigById, getSwarmConfigLookupById, upsertSwarmConfig, deleteSwarmConfig, deleteSwarmConfigByKey, getResolvedConfig, getSwarmRepos, getSwarmRepoById, getSwarmRepoByName, getSwarmRepoByUrl, createSwarmRepo, updateSwarmRepo, deleteSwarmRepo, getAgentMailInboxMapping, getAgentMailInboxMappingsByAgent, getAllAgentMailInboxMappings, createAgentMailInboxMapping, deleteAgentMailInboxMapping, findTaskByAgentMailThread, insertActiveSession, deleteActiveSession, deleteActiveSessionById, getActiveSessions, heartbeatActiveSession, cleanupStaleSessions, cleanupAgentSessions, updateActiveSessionProviderSessionId, getActiveSessionForTask, reassociateSessionLogs, getStalledInProgressTasks, getStalePinnedResumes, failPendingResumeIfUnclaimed, getIdleWorkersWithCapacity, getUnassignedPoolTasks, getStaleUnassignedAffinityTasks, getRecentFailedTasks, getRecentCompletedCount, getRecentFailedCount, createWorkflow, getWorkflow, listWorkflows, updateWorkflow, deleteWorkflow, getWorkflowsByScheduleId, createWorkflowRun, getWorkflowRun, updateWorkflowRun, listWorkflowRuns, createWorkflowRunStep, getWorkflowRunStep, updateWorkflowRunStep, getWorkflowRunStepsByRunId, getStuckWorkflowRuns, getLastSuccessfulRun, getLastRunStart, getRetryableSteps, getCompletedStepNodeIds, getTaskByWorkflowRunStepId, getStepByIdempotencyKey, getStepCountForNode, getLatestStepForNode, createWorkflowVersion, getWorkflowVersions, getWorkflowVersion, createPage, getPage, getPageBySlug, getLatestPageBySlug, listPagesByAgent, listAllPages, countAllPages, countPagesByAgent, updatePage, deletePage, incrementPageViewCount, createPageVersion, getPageVersions, getPageVersion, createMetric, getMetric, getMetricBySlug, listMetricsByAgent, listAllMetrics, countAllMetrics, countMetricsByAgent, updateMetric, deleteMetric, createMetricVersion, getMetricVersions, getMetricVersion, getPromptTemplates, getPromptTemplateById, upsertPromptTemplate, deletePromptTemplate, resetPromptTemplateToDefault, getPromptTemplateHistory, resolvePromptTemplate, checkoutPromptTemplate, getAllChannelActivityCursors, getChannelActivityCursor, upsertChannelActivityCursor, createApprovalRequest, getApprovalRequestById, resolveApprovalRequest, updateApprovalRequestNotifications, listApprovalRequests, getStuckApprovalRuns, getApprovalRequestByStepId, getExpiredPendingApprovals, createWaitState, getWaitStateById, getWaitStateByStepId, getDueWaitStates, getPendingEventWaitNames, getPendingWaitsByEvent, resolveWaitState, getStuckWaitRuns, SKILL_FILE_LIMITS, normalizeSkillFilePath, createSkill, updateSkill, listSkillFileManifest, getSkillFiles, getSkillFile, upsertSkillFile, upsertSkillFiles, deleteSkillFile, deleteSkill, getSkillById, getSkillByName, listSkills, searchSkills, installSkill, getSystemDefaultSkills, installSystemDefaultSkillsForAgent, uninstallSkill, getAgentSkills, toggleAgentSkill, createMcpServer, updateMcpServer, deleteMcpServer, getMcpServerById, getMcpServerByName, listMcpServers, installMcpServer, uninstallMcpServer, getAgentMcpServers, createContextSnapshot, getContextSnapshotsByTaskId, getContextSnapshotsBySessionId, getContextSummaryByTaskId, getAvailableKeyIndices, recordKeyUsage, markKeyRateLimited, recordKeyRateLimitWindows, setApiKeyName, clearKeyRateLimit, getKeyStatuses, getKeyCostSummary, getUserById, getAllUsers, createUser, updateUser, deleteUser, listInboxState, upsertInboxState, listFavorites, listUserFavorites, getFavoriteItemIdSet, setFavorite, setUserFavorite, withFavoriteFlags, listTaskTemplates, getRootTaskChain, listRecentSessions, countSessions, getBudget, getBudgets, upsertBudget, deleteBudget, getAllPricingRows, getPricingRows, getActivePricingRow, insertPricingRow, deletePricingRow, getDailySpendForAgent, getDailySpendGlobal, getDailySpendForUser, recordBudgetRefusalNotification, getBudgetRefusalNotification, getRecentBudgetRefusalNotifications, hasBudgetRefusalNotificationToday, setBudgetRefusalFollowUpTaskId, getLiveAgentCounts, getInstanceActivity, getSwarmMetrics, hasFirstCompletedTask, getKv, upsertKv, deleteKv, KvTypeCollisionError, incrKv, listKv, countKv, createScriptRun, recordInlineScriptRun, getScriptRun, getScriptRunByIdempotencyKey, listScriptRuns, countScriptRuns, countActiveScriptRuns, updateScriptRun, getRunningScriptRuns, getScriptRunJournalStep, upsertScriptRunJournalStep, listScriptRunJournalSteps, countScriptRunJournalSteps, countScriptRunJournalAgentTaskSteps, exports_db, init_db };
|