@desplega.ai/agent-swarm 1.107.0 → 1.108.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-q3hcb6ea.js → actions-sdr91cfp.js} +9 -8
- package/dist/{app-4r3mstc2.js → app-0mcf7mwz.js} +8 -6
- package/dist/{artifact-12d91qnq.js → artifact-0874w6js.js} +2 -1
- package/dist/{assistant-a6vp3nv8.js → assistant-7f3cmabp.js} +14 -12
- package/dist/{boot-reembed-cnsk021h.js → boot-reembed-47cfre4w.js} +5 -5
- package/dist/{boot-reembed-gaxjq6ds.js → boot-reembed-a9btk2eh.js} +6 -6
- package/dist/{boot-scrub-logs-sm0m581p.js → boot-scrub-logs-hy8pqhej.js} +3 -3
- package/dist/{claude-adapter-hw0wsvpj.js → claude-adapter-mma9a1yr.js} +2 -2
- package/dist/{claude-managed-adapter-vj9kzegz.js → claude-managed-adapter-pv2nbqy4.js} +2 -2
- package/dist/{cli-09rxrad0.js → cli-1z7048dy.js} +1 -1
- package/dist/{cli-awqz8v9k.js → cli-1zs2dm5w.js} +4 -4
- package/dist/{cli-4r9m8f3t.js → cli-2fc97xm5.js} +1 -1
- package/dist/{cli-jk4tj5m6.js → cli-2r7s8jhp.js} +1 -1
- package/dist/{cli-8p36pjyp.js → cli-3cfvx630.js} +3 -3
- package/dist/{cli-3pp1362w.js → cli-4j2mrzag.js} +1 -0
- package/dist/{cli-z92pkwzn.js → cli-6xd0bvf8.js} +4 -17
- package/dist/{cli-t7cyte2g.js → cli-75b0wmer.js} +3 -3
- package/dist/{cli-heavyg0w.js → cli-7r40bgvr.js} +5 -5
- package/dist/cli-7wmybrt5.js +115 -0
- package/dist/{cli-wb4j4tfe.js → cli-9wv4e7qs.js} +203 -15
- package/dist/{cli-bk526b46.js → cli-a0t7vapf.js} +1 -1
- package/dist/{cli-3jcx2wmm.js → cli-a0w6tqyc.js} +1 -1
- package/dist/{cli-r0nfastp.js → cli-a8gkr14c.js} +49 -30
- package/dist/{cli-ccre5q9r.js → cli-apdrt1ch.js} +28 -5
- package/dist/{cli-hn38x1bp.js → cli-cya9knf9.js} +3 -3
- package/dist/{cli-tda8d5q0.js → cli-entbgsd5.js} +1 -1
- package/dist/{cli-xaht317v.js → cli-gx7gnvha.js} +99 -25
- package/dist/{cli-4rx7v585.js → cli-h2qhdwhr.js} +5 -11
- package/dist/{cli-6kqcg4zv.js → cli-hv2fndhm.js} +4 -1
- package/dist/{cli-f8cdgmdk.js → cli-j9eqkarv.js} +3 -3
- package/dist/{cli-8da61htc.js → cli-kc3h8mnm.js} +1 -1
- package/dist/{cli-61hj3yzp.js → cli-kppbkzj4.js} +22 -14
- package/dist/{cli-5s8hgqmd.js → cli-m0k99m2s.js} +1 -1
- package/dist/{cli-hr69yv51.js → cli-m3enfr8q.js} +2 -2
- package/dist/{cli-5nt81kzd.js → cli-mkn2ryba.js} +1 -1
- package/dist/{cli-9xjc8dt2.js → cli-mmaz2btq.js} +1 -1
- package/dist/{cli-n4qvvhy0.js → cli-nmt32dxp.js} +1 -1
- package/dist/{cli-kgr1cazt.js → cli-psz2xq0n.js} +6 -6
- package/dist/{cli-h9k3grhx.js → cli-pwfsqc2x.js} +1 -1
- package/dist/{cli-3j01d33e.js → cli-q25ejbyn.js} +1 -1
- package/dist/{cli-fete3y1e.js → cli-rkndnn90.js} +4 -1
- package/dist/{cli-t6r1ex00.js → cli-tehpf2fm.js} +1 -1
- package/dist/{cli-ygcrdkqt.js → cli-vbraamxr.js} +5 -2
- package/dist/{cli-2yn35y8c.js → cli-vemx13wc.js} +3 -3
- package/dist/{cli-rpjrpkzy.js → cli-vhpa5j27.js} +2 -2
- package/dist/{cli-wnkwyhmw.js → cli-w6zp4qcx.js} +2 -2
- package/dist/cli-wspgs9bt.js +27 -0
- package/dist/{cli-6n1nnzm7.js → cli-wx82tw1k.js} +1 -1
- package/dist/{cli-938phztx.js → cli-xy83cmfc.js} +282 -2
- package/dist/cli.js +43 -19
- package/dist/{codex-adapter-wer4en6f.js → codex-adapter-ebs12jef.js} +3 -3
- package/dist/{codex-session-runner-b199pwwr.js → codex-session-runner-3bx0b1hn.js} +3 -3
- package/dist/{commands-ys948zs2.js → commands-4p93q1rf.js} +3 -3
- package/dist/{db-sy3tqg9d.js → db-hb0chrmg.js} +20 -4
- package/dist/{e2b-jy6t336w.js → e2b-2s4psnbf.js} +3 -3
- package/dist/{google-generative-ai-rf42vj2h.js → google-generative-ai-vfq6ymz9.js} +1 -1
- package/dist/{google-vertex-m92pj5fb.js → google-vertex-mj5y5rfj.js} +1 -1
- package/dist/{handlers-h9vh0t22.js → handlers-pz3zc83m.js} +14 -12
- package/dist/{hook-06rfe1bc.js → hook-mye8ket2.js} +4 -4
- package/dist/{http-fk80h22g.js → http-3nrx1tp1.js} +1051 -68
- package/dist/{index-0krvvan6.js → index-17n7z8k8.js} +12 -11
- package/dist/{index-py84s5en.js → index-5n2c8yay.js} +2 -1
- package/dist/{index-pq2d08xe.js → index-6sgpkhby.js} +11 -25
- package/dist/{index-40wjvdfg.js → index-rys8ctm6.js} +9 -9
- package/dist/{index-bb95344w.js → index-x9n06ze1.js} +10 -10
- package/dist/{keepalive-np0ham11.js → keepalive-b6eax0y0.js} +5 -5
- package/dist/{lead-gf7sa5vn.js → lead-v1g4j7he.js} +29 -27
- package/dist/{maintenance-38n2z7p9.js → maintenance-xwf1vf0v.js} +6 -6
- package/dist/{onboard-63r24gwq.js → onboard-vy0z8b11.js} +4 -4
- package/dist/{opencode-adapter-5jxw9cv8.js → opencode-adapter-mqsxr170.js} +2 -2
- package/dist/{otel-impl-18fxmezz.js → otel-impl-94sm94jm.js} +6 -3
- package/dist/{pi-mono-adapter-5bbyymfw.js → pi-mono-adapter-ayr3akk8.js} +49 -49
- package/dist/{pricing-refresh-x7b6rjxy.js → pricing-refresh-an9bxjcd.js} +5 -5
- package/dist/{seed-pricing-8hdb1xyg.js → seed-pricing-3t22x5ax.js} +4 -4
- package/dist/{setup-prqde3h7.js → setup-8hd3jk8s.js} +4 -4
- package/dist/{worker-34hev47c.js → worker-s0xm8naj.js} +29 -27
- package/dist/{x-knyx9vek.js → x-6mg4kfpe.js} +2 -2
- package/openapi.json +396 -2
- package/package.json +28 -5
- package/src/be/db.ts +330 -4
- package/src/be/migrations/105_user_favorites.sql +18 -0
- package/src/be/migrations/106_task_attachments_provider_agnostic.sql +29 -0
- package/src/be/seed/agent-fs-provision.ts +423 -0
- package/src/be/seed/registry.ts +2 -1
- package/src/be/seed-scripts/catalog/memory-eval.ts +0 -15
- package/src/be/seed-scripts/index.ts +1 -1
- package/src/commands/context-preamble.ts +4 -11
- package/src/commands/e2b.ts +1 -1
- package/src/commands/onboard/compose-generator.ts +1 -1
- package/src/commands/onboard/dashboard-url.ts +1 -1
- package/src/commands/runner.ts +42 -0
- package/src/fs/agent-fs-provider.ts +290 -0
- package/src/fs/capabilities.ts +59 -0
- package/src/fs/index.ts +5 -0
- package/src/fs/local-fs-provider.ts +163 -0
- package/src/fs/provider.ts +166 -0
- package/src/fs/registry.ts +26 -0
- package/src/http/config.ts +19 -7
- package/src/http/core.ts +1 -1
- package/src/http/favorites.ts +98 -0
- package/src/http/fs.ts +492 -0
- package/src/http/index.ts +5 -1
- package/src/http/pages-public.ts +1 -0
- package/src/http/pages.ts +51 -7
- package/src/http/schedules.ts +7 -2
- package/src/http/stats.ts +7 -1
- package/src/http/status.ts +22 -0
- package/src/http/workflows.ts +16 -4
- package/src/linear/sync.ts +75 -3
- package/src/providers/pricing-sources.md +1 -1
- package/src/providers/reasoning-effort.ts +1 -1
- package/src/slack/blocks.ts +3 -17
- package/src/tasks/worker-follow-up.ts +2 -10
- package/src/tests/agent-fs-provision-seeder.test.ts +293 -0
- package/src/tests/agents-list-model-display.test.ts +1 -1
- package/src/tests/bedrock-model-groups.test.ts +1 -1
- package/src/tests/config-api-only-keys.test.ts +106 -0
- package/src/tests/context-key-db.test.ts +55 -1
- package/src/tests/favorites.test.ts +162 -0
- package/src/tests/fs-provider.test.ts +274 -0
- package/src/tests/fs-routes.test.ts +311 -0
- package/src/tests/linear-webhook.test.ts +34 -1
- package/src/tests/pages-public-html.test.ts +6 -0
- package/src/tests/pages-versioning.test.ts +2 -2
- package/src/tests/scheduled-tasks-api.test.ts +20 -14
- package/src/tests/send-task-requested-by.test.ts +26 -0
- package/src/tests/slack-attachments-block.test.ts +21 -5
- package/src/tests/task-attachments-schema.test.ts +157 -0
- package/src/tests/template-recommendations.test.ts +4 -4
- package/src/tests/ui-logs-parser.test.ts +1 -1
- package/src/tests/use-dismissible-card.test.ts +4 -4
- package/src/tools/send-task.ts +19 -3
- package/src/tools/store-progress.ts +3 -0
- package/src/types.ts +30 -0
- package/src/utils/secret-scrubber.ts +1 -0
- package/src/utils/task-attachment-links.ts +24 -0
- package/tsconfig.json +1 -3
|
@@ -25,11 +25,11 @@ import {
|
|
|
25
25
|
import {
|
|
26
26
|
init_package,
|
|
27
27
|
package_default
|
|
28
|
-
} from "./cli-
|
|
28
|
+
} from "./cli-apdrt1ch.js";
|
|
29
29
|
import {
|
|
30
30
|
init_secret_scrubber,
|
|
31
31
|
scrubSecrets
|
|
32
|
-
} from "./cli-
|
|
32
|
+
} from "./cli-4j2mrzag.js";
|
|
33
33
|
import {
|
|
34
34
|
__commonJS,
|
|
35
35
|
__esm,
|
|
@@ -469,7 +469,7 @@ function resolveTaskModelSelection(opts) {
|
|
|
469
469
|
function isTerminalTaskStatus(status) {
|
|
470
470
|
return TERMINAL_TASK_STATUSES.includes(status);
|
|
471
471
|
}
|
|
472
|
-
var ModelTierSchema, MODEL_TIERS, ReasoningEffortSchema, LEGACY_MODEL_TO_TIER, DEFAULT_MODEL_TIER_MAP, AgentTaskStatusSchema, TERMINAL_TASK_STATUSES, InboxMessageStatusSchema, InboxMessageSchema, AgentTaskSourceSchema, ProviderNameSchema, FollowUpConfigSchema, AgentTaskSchema, TaskAttachmentKindSchema, attachmentCommonFields, AttachmentInputSchema, TaskAttachmentSchema, UserSchema, IdentityEventTypeSchema, InboxItemTypeSchema, InboxItemStatusSchema, InboxItemStateSchema, 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, 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;
|
|
472
|
+
var ModelTierSchema, MODEL_TIERS, ReasoningEffortSchema, LEGACY_MODEL_TO_TIER, DEFAULT_MODEL_TIER_MAP, AgentTaskStatusSchema, TERMINAL_TASK_STATUSES, InboxMessageStatusSchema, InboxMessageSchema, AgentTaskSourceSchema, ProviderNameSchema, FollowUpConfigSchema, 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, 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;
|
|
473
473
|
var init_types = __esm(() => {
|
|
474
474
|
init_zod();
|
|
475
475
|
ModelTierSchema = _enum(["smol", "regular", "smart", "ultra"]);
|
|
@@ -654,6 +654,9 @@ var init_types = __esm(() => {
|
|
|
654
654
|
TaskAttachmentKindSchema = _enum(["agent-fs", "url", "shared-fs", "page"]);
|
|
655
655
|
attachmentCommonFields = {
|
|
656
656
|
name: string().min(1).describe("Display name for the attachment."),
|
|
657
|
+
providerId: string().min(1).optional(),
|
|
658
|
+
providerKey: string().min(1).optional(),
|
|
659
|
+
capabilities: record(string(), unknown()).optional(),
|
|
657
660
|
mimeType: string().optional(),
|
|
658
661
|
sizeBytes: number().int().min(0).optional(),
|
|
659
662
|
sha256: string().optional(),
|
|
@@ -694,6 +697,9 @@ var init_types = __esm(() => {
|
|
|
694
697
|
url: string().optional(),
|
|
695
698
|
path: string().optional(),
|
|
696
699
|
pageId: string().optional(),
|
|
700
|
+
providerId: string().optional(),
|
|
701
|
+
providerKey: string().optional(),
|
|
702
|
+
capabilities: record(string(), unknown()).optional(),
|
|
697
703
|
orgId: string().optional(),
|
|
698
704
|
driveId: string().optional(),
|
|
699
705
|
mimeType: string().optional(),
|
|
@@ -702,7 +708,9 @@ var init_types = __esm(() => {
|
|
|
702
708
|
intent: string().optional(),
|
|
703
709
|
description: string().optional(),
|
|
704
710
|
isPrimary: boolean().default(false),
|
|
705
|
-
createdAt: exports_iso.datetime()
|
|
711
|
+
createdAt: exports_iso.datetime(),
|
|
712
|
+
createdBy: string().optional(),
|
|
713
|
+
updatedBy: string().optional()
|
|
706
714
|
});
|
|
707
715
|
UserSchema = object({
|
|
708
716
|
id: string(),
|
|
@@ -752,6 +760,17 @@ var init_types = __esm(() => {
|
|
|
752
760
|
createdAt: string(),
|
|
753
761
|
lastUpdatedAt: string()
|
|
754
762
|
});
|
|
763
|
+
FavoriteItemTypeSchema = _enum(["page", "workflow", "schedule"]);
|
|
764
|
+
UserFavoriteSchema = object({
|
|
765
|
+
id: string(),
|
|
766
|
+
userId: string(),
|
|
767
|
+
itemType: FavoriteItemTypeSchema,
|
|
768
|
+
itemId: string(),
|
|
769
|
+
createdAt: string(),
|
|
770
|
+
lastUpdatedAt: string(),
|
|
771
|
+
createdBy: string().optional(),
|
|
772
|
+
updatedBy: string().optional()
|
|
773
|
+
});
|
|
755
774
|
TaskTemplateKindSchema = _enum(["task", "workflow", "schedule"]);
|
|
756
775
|
TaskTemplateSchema = object({
|
|
757
776
|
id: string(),
|
|
@@ -1041,7 +1060,8 @@ var init_types = __esm(() => {
|
|
|
1041
1060
|
createdAt: exports_iso.datetime(),
|
|
1042
1061
|
lastUpdatedAt: exports_iso.datetime(),
|
|
1043
1062
|
createdBy: string().optional(),
|
|
1044
|
-
updatedBy: string().optional()
|
|
1063
|
+
updatedBy: string().optional(),
|
|
1064
|
+
favorite: boolean().optional()
|
|
1045
1065
|
}).refine((data) => {
|
|
1046
1066
|
if (data.scheduleType === "one_time")
|
|
1047
1067
|
return true;
|
|
@@ -1269,7 +1289,8 @@ var init_types = __esm(() => {
|
|
|
1269
1289
|
createdAt: string(),
|
|
1270
1290
|
lastUpdatedAt: string(),
|
|
1271
1291
|
createdBy: string().optional(),
|
|
1272
|
-
updatedBy: string().optional()
|
|
1292
|
+
updatedBy: string().optional(),
|
|
1293
|
+
favorite: boolean().optional()
|
|
1273
1294
|
});
|
|
1274
1295
|
WorkflowVersionSchema = object({
|
|
1275
1296
|
id: string().uuid(),
|
|
@@ -1303,7 +1324,8 @@ var init_types = __esm(() => {
|
|
|
1303
1324
|
needsCredentials: array(string()).optional(),
|
|
1304
1325
|
viewCount: number().int().min(0).default(0),
|
|
1305
1326
|
createdAt: string(),
|
|
1306
|
-
updatedAt: string()
|
|
1327
|
+
updatedAt: string(),
|
|
1328
|
+
favorite: boolean().optional()
|
|
1307
1329
|
});
|
|
1308
1330
|
PageVersionSchema = object({
|
|
1309
1331
|
id: string(),
|
|
@@ -3443,6 +3465,7 @@ var require_sqlite_vec = __commonJS((exports, module) => {
|
|
|
3443
3465
|
// src/be/db.ts
|
|
3444
3466
|
var exports_db = {};
|
|
3445
3467
|
__export(exports_db, {
|
|
3468
|
+
withFavoriteFlags: () => withFavoriteFlags,
|
|
3446
3469
|
upsertSwarmConfig: () => upsertSwarmConfig,
|
|
3447
3470
|
upsertSkillFiles: () => upsertSkillFiles,
|
|
3448
3471
|
upsertSkillFile: () => upsertSkillFile,
|
|
@@ -3487,6 +3510,7 @@ __export(exports_db, {
|
|
|
3487
3510
|
supersedeTask: () => supersedeTask,
|
|
3488
3511
|
startTask: () => startTask,
|
|
3489
3512
|
shouldBlockPolling: () => shouldBlockPolling,
|
|
3513
|
+
setUserFavorite: () => setUserFavorite,
|
|
3490
3514
|
setSlackMessageTracking: () => setSlackMessageTracking,
|
|
3491
3515
|
setBudgetRefusalFollowUpTaskId: () => setBudgetRefusalFollowUpTaskId,
|
|
3492
3516
|
setApiKeyName: () => setApiKeyName,
|
|
@@ -3501,6 +3525,7 @@ __export(exports_db, {
|
|
|
3501
3525
|
resetPromptTemplateToDefault: () => resetPromptTemplateToDefault,
|
|
3502
3526
|
resetOrphanedInProgressTasksForAgent: () => resetOrphanedInProgressTasksForAgent,
|
|
3503
3527
|
resetEmptyPollCount: () => resetEmptyPollCount,
|
|
3528
|
+
replaceTaskAttachment: () => replaceTaskAttachment,
|
|
3504
3529
|
releaseTask: () => releaseTask,
|
|
3505
3530
|
releaseStaleReviewingTasks: () => releaseStaleReviewingTasks,
|
|
3506
3531
|
releaseStaleProcessingInbox: () => releaseStaleProcessingInbox,
|
|
@@ -3527,6 +3552,7 @@ __export(exports_db, {
|
|
|
3527
3552
|
logQueries: () => logQueries,
|
|
3528
3553
|
listWorkflows: () => listWorkflows,
|
|
3529
3554
|
listWorkflowRuns: () => listWorkflowRuns,
|
|
3555
|
+
listUserFavorites: () => listUserFavorites,
|
|
3530
3556
|
listTaskTemplates: () => listTaskTemplates,
|
|
3531
3557
|
listSkills: () => listSkills,
|
|
3532
3558
|
listSkillFileManifest: () => listSkillFileManifest,
|
|
@@ -3658,6 +3684,7 @@ __export(exports_db, {
|
|
|
3658
3684
|
getLeadAgent: () => getLeadAgent,
|
|
3659
3685
|
getLatestTaskByContextKey: () => getLatestTaskByContextKey,
|
|
3660
3686
|
getLatestStepForNode: () => getLatestStepForNode,
|
|
3687
|
+
getLatestPageBySlug: () => getLatestPageBySlug,
|
|
3661
3688
|
getLatestContextVersion: () => getLatestContextVersion,
|
|
3662
3689
|
getLatestActiveTaskInThread: () => getLatestActiveTaskInThread,
|
|
3663
3690
|
getLastSuccessfulRun: () => getLastSuccessfulRun,
|
|
@@ -3673,6 +3700,7 @@ __export(exports_db, {
|
|
|
3673
3700
|
getInProgressTasksByContextKey: () => getInProgressTasksByContextKey,
|
|
3674
3701
|
getInProgressSlackTasks: () => getInProgressSlackTasks,
|
|
3675
3702
|
getIdleWorkersWithCapacity: () => getIdleWorkersWithCapacity,
|
|
3703
|
+
getFavoriteItemIdSet: () => getFavoriteItemIdSet,
|
|
3676
3704
|
getExpiredPendingApprovals: () => getExpiredPendingApprovals,
|
|
3677
3705
|
getDueWaitStates: () => getDueWaitStates,
|
|
3678
3706
|
getDueScheduledTasks: () => getDueScheduledTasks,
|
|
@@ -3734,11 +3762,13 @@ __export(exports_db, {
|
|
|
3734
3762
|
findTaskByAgentMailThread: () => findTaskByAgentMailThread,
|
|
3735
3763
|
findRecentSimilarTasks: () => findRecentSimilarTasks,
|
|
3736
3764
|
findRecentCancelledTaskInThread: () => findRecentCancelledTaskInThread,
|
|
3765
|
+
findExistingLinearTrackerContextWork: () => findExistingLinearTrackerContextWork,
|
|
3737
3766
|
findCompletedTaskInThread: () => findCompletedTaskInThread,
|
|
3738
3767
|
failTask: () => failTask,
|
|
3739
3768
|
failPendingResumeIfUnclaimed: () => failPendingResumeIfUnclaimed,
|
|
3740
3769
|
deleteWorkflow: () => deleteWorkflow,
|
|
3741
3770
|
deleteUser: () => deleteUser,
|
|
3771
|
+
deleteTaskAttachment: () => deleteTaskAttachment,
|
|
3742
3772
|
deleteTask: () => deleteTask,
|
|
3743
3773
|
deleteSwarmRepo: () => deleteSwarmRepo,
|
|
3744
3774
|
deleteSwarmConfigByKey: () => deleteSwarmConfigByKey,
|
|
@@ -4776,6 +4806,34 @@ function getInProgressTasksByContextKey(contextKey, statuses = ["pending", "in_p
|
|
|
4776
4806
|
ORDER BY lastUpdatedAt DESC
|
|
4777
4807
|
LIMIT 200`).all(contextKey, ...statuses).map(rowToAgentTask);
|
|
4778
4808
|
}
|
|
4809
|
+
function isLinearTrackerContextKey(contextKey) {
|
|
4810
|
+
return !!contextKey && contextKey.startsWith(LINEAR_TRACKER_CONTEXT_KEY_PREFIX);
|
|
4811
|
+
}
|
|
4812
|
+
function findExistingLinearTrackerContextWork(contextKey) {
|
|
4813
|
+
if (!isLinearTrackerContextKey(contextKey))
|
|
4814
|
+
return null;
|
|
4815
|
+
const activeRow = getDb().prepare(`SELECT * FROM agent_tasks
|
|
4816
|
+
WHERE contextKey = ?
|
|
4817
|
+
AND status NOT IN ('completed', 'failed', 'cancelled', 'superseded')
|
|
4818
|
+
ORDER BY lastUpdatedAt DESC
|
|
4819
|
+
LIMIT 1`).get(contextKey);
|
|
4820
|
+
if (activeRow) {
|
|
4821
|
+
return { task: rowToAgentTask(activeRow), reason: "active_task" };
|
|
4822
|
+
}
|
|
4823
|
+
const linkedPrRow = getDb().prepare(`SELECT * FROM agent_tasks
|
|
4824
|
+
WHERE contextKey = ?
|
|
4825
|
+
AND status = 'completed'
|
|
4826
|
+
AND vcsProvider IS NOT NULL
|
|
4827
|
+
AND vcsRepo IS NOT NULL
|
|
4828
|
+
AND vcsNumber IS NOT NULL
|
|
4829
|
+
AND vcsUrl IS NOT NULL
|
|
4830
|
+
ORDER BY lastUpdatedAt DESC
|
|
4831
|
+
LIMIT 1`).get(contextKey);
|
|
4832
|
+
if (linkedPrRow) {
|
|
4833
|
+
return { task: rowToAgentTask(linkedPrRow), reason: "linked_open_pr" };
|
|
4834
|
+
}
|
|
4835
|
+
return null;
|
|
4836
|
+
}
|
|
4779
4837
|
function getLatestTaskByContextKey(contextKey) {
|
|
4780
4838
|
if (!contextKey)
|
|
4781
4839
|
return null;
|
|
@@ -5205,6 +5263,9 @@ function rowToTaskAttachment(row) {
|
|
|
5205
5263
|
url: row.url ?? undefined,
|
|
5206
5264
|
path: row.path ?? undefined,
|
|
5207
5265
|
pageId: row.page_id ?? undefined,
|
|
5266
|
+
providerId: row.provider_id ?? undefined,
|
|
5267
|
+
providerKey: row.provider_key ?? undefined,
|
|
5268
|
+
capabilities: parseAttachmentCapabilities(row.capabilities),
|
|
5208
5269
|
orgId: row.agent_fs_org_id ?? undefined,
|
|
5209
5270
|
driveId: row.agent_fs_drive_id ?? undefined,
|
|
5210
5271
|
mimeType: row.mime_type ?? undefined,
|
|
@@ -5213,9 +5274,24 @@ function rowToTaskAttachment(row) {
|
|
|
5213
5274
|
intent: row.intent ?? undefined,
|
|
5214
5275
|
description: row.description ?? undefined,
|
|
5215
5276
|
isPrimary: !!row.is_primary,
|
|
5216
|
-
createdAt: row.created_at
|
|
5277
|
+
createdAt: row.created_at,
|
|
5278
|
+
createdBy: row.created_by ?? undefined,
|
|
5279
|
+
updatedBy: row.updated_by ?? undefined
|
|
5217
5280
|
};
|
|
5218
5281
|
}
|
|
5282
|
+
function parseAttachmentCapabilities(value) {
|
|
5283
|
+
if (!value)
|
|
5284
|
+
return;
|
|
5285
|
+
try {
|
|
5286
|
+
const parsed = JSON.parse(value);
|
|
5287
|
+
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : undefined;
|
|
5288
|
+
} catch {
|
|
5289
|
+
return;
|
|
5290
|
+
}
|
|
5291
|
+
}
|
|
5292
|
+
function stringifyAttachmentCapabilities(value) {
|
|
5293
|
+
return value ? JSON.stringify(value) : null;
|
|
5294
|
+
}
|
|
5219
5295
|
function insertTaskAttachment(input) {
|
|
5220
5296
|
const db2 = getDb();
|
|
5221
5297
|
if (input.sha256) {
|
|
@@ -5237,15 +5313,59 @@ function insertTaskAttachment(input) {
|
|
|
5237
5313
|
const id = crypto.randomUUID();
|
|
5238
5314
|
const row = db2.prepare(`INSERT INTO task_attachments
|
|
5239
5315
|
(id, task_id, agent_id, name, kind, url, path, page_id,
|
|
5316
|
+
provider_id, provider_key, capabilities,
|
|
5240
5317
|
agent_fs_org_id, agent_fs_drive_id,
|
|
5241
|
-
mime_type, size_bytes, sha256, intent, description, is_primary
|
|
5242
|
-
|
|
5243
|
-
|
|
5318
|
+
mime_type, size_bytes, sha256, intent, description, is_primary,
|
|
5319
|
+
created_by, updated_by)
|
|
5320
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
5321
|
+
RETURNING *`).get(id, input.taskId, input.agentId ?? null, input.name, input.kind, input.url ?? null, input.path ?? null, input.pageId ?? null, input.providerId ?? defaultProviderId(input.kind), input.providerKey ?? defaultProviderKey(input), stringifyAttachmentCapabilities(input.capabilities), input.orgId ?? null, input.driveId ?? null, input.mimeType ?? null, input.sizeBytes ?? null, input.sha256 ?? null, input.intent ?? null, input.description ?? null, input.isPrimary ? 1 : 0, input.createdBy ?? null, input.updatedBy ?? input.createdBy ?? null);
|
|
5244
5322
|
if (!row) {
|
|
5245
5323
|
throw new Error("Failed to insert task attachment");
|
|
5246
5324
|
}
|
|
5247
5325
|
return rowToTaskAttachment(row);
|
|
5248
5326
|
}
|
|
5327
|
+
function defaultProviderId(kind) {
|
|
5328
|
+
if (kind === "agent-fs" || kind === "shared-fs")
|
|
5329
|
+
return "agent-fs";
|
|
5330
|
+
return kind;
|
|
5331
|
+
}
|
|
5332
|
+
function defaultProviderKey(input) {
|
|
5333
|
+
if (input.kind === "agent-fs" || input.kind === "shared-fs")
|
|
5334
|
+
return input.path ?? null;
|
|
5335
|
+
if (input.kind === "url")
|
|
5336
|
+
return input.url ?? null;
|
|
5337
|
+
if (input.kind === "page")
|
|
5338
|
+
return input.pageId ?? null;
|
|
5339
|
+
return null;
|
|
5340
|
+
}
|
|
5341
|
+
function deleteTaskAttachment(id) {
|
|
5342
|
+
const result = getDb().run("DELETE FROM task_attachments WHERE id = ?", [id]);
|
|
5343
|
+
return result.changes > 0;
|
|
5344
|
+
}
|
|
5345
|
+
function replaceTaskAttachment(id, input) {
|
|
5346
|
+
const row = getDb().prepare(`UPDATE task_attachments
|
|
5347
|
+
SET agent_id = ?,
|
|
5348
|
+
name = ?,
|
|
5349
|
+
kind = ?,
|
|
5350
|
+
url = ?,
|
|
5351
|
+
path = ?,
|
|
5352
|
+
page_id = ?,
|
|
5353
|
+
provider_id = ?,
|
|
5354
|
+
provider_key = ?,
|
|
5355
|
+
capabilities = ?,
|
|
5356
|
+
agent_fs_org_id = ?,
|
|
5357
|
+
agent_fs_drive_id = ?,
|
|
5358
|
+
mime_type = ?,
|
|
5359
|
+
size_bytes = ?,
|
|
5360
|
+
sha256 = ?,
|
|
5361
|
+
intent = ?,
|
|
5362
|
+
description = ?,
|
|
5363
|
+
is_primary = ?,
|
|
5364
|
+
updated_by = ?
|
|
5365
|
+
WHERE id = ?
|
|
5366
|
+
RETURNING *`).get(input.agentId ?? null, input.name, input.kind, input.url ?? null, input.path ?? null, input.pageId ?? null, input.providerId ?? defaultProviderId(input.kind), input.providerKey ?? defaultProviderKey(input), stringifyAttachmentCapabilities(input.capabilities), input.orgId ?? null, input.driveId ?? null, input.mimeType ?? null, input.sizeBytes ?? null, input.sha256 ?? null, input.intent ?? null, input.description ?? null, input.isPrimary ? 1 : 0, input.updatedBy ?? null, id);
|
|
5367
|
+
return row ? rowToTaskAttachment(row) : null;
|
|
5368
|
+
}
|
|
5249
5369
|
function getTaskAttachments(taskId) {
|
|
5250
5370
|
return getDb().prepare("SELECT * FROM task_attachments WHERE task_id = ? ORDER BY created_at ASC, rowid ASC").all(taskId).map(rowToTaskAttachment);
|
|
5251
5371
|
}
|
|
@@ -5399,6 +5519,11 @@ function createTaskExtended(task, options) {
|
|
|
5399
5519
|
}
|
|
5400
5520
|
}
|
|
5401
5521
|
}
|
|
5522
|
+
const existingTrackerWork = findExistingLinearTrackerContextWork(options?.contextKey);
|
|
5523
|
+
if (existingTrackerWork) {
|
|
5524
|
+
console.log(`[task-dedup] Skipping Linear tracker task creation for ${options?.contextKey}: ${existingTrackerWork.reason} ${existingTrackerWork.task.id.slice(0, 8)} already exists`);
|
|
5525
|
+
return existingTrackerWork.task;
|
|
5526
|
+
}
|
|
5402
5527
|
if (options?.creatorAgentId && !options.slackChannelId && options.sourceTaskId) {
|
|
5403
5528
|
const sourceTask = getTaskById(options.sourceTaskId);
|
|
5404
5529
|
if (sourceTask?.slackChannelId) {
|
|
@@ -6470,7 +6595,7 @@ function getScheduledTasks(filters, opts) {
|
|
|
6470
6595
|
if (filters?.hideCompleted !== false) {
|
|
6471
6596
|
query += " AND NOT (scheduleType = 'one_time' AND enabled = 0)";
|
|
6472
6597
|
}
|
|
6473
|
-
query += " ORDER BY
|
|
6598
|
+
query += " ORDER BY lastRunAt IS NULL ASC, lastRunAt DESC, lastUpdatedAt DESC";
|
|
6474
6599
|
const rows = getDb().prepare(query).all(...params);
|
|
6475
6600
|
return opts?.slim ? rows.map(rowToScheduledTaskSummary) : rows.map(rowToScheduledTask);
|
|
6476
6601
|
}
|
|
@@ -7128,7 +7253,7 @@ function listWorkflows(filters, opts) {
|
|
|
7128
7253
|
query += " AND enabled = ?";
|
|
7129
7254
|
params.push(filters.enabled ? 1 : 0);
|
|
7130
7255
|
}
|
|
7131
|
-
query += " ORDER BY
|
|
7256
|
+
query += " ORDER BY lastUpdatedAt DESC";
|
|
7132
7257
|
const rows = getDb().prepare(query).all(...params);
|
|
7133
7258
|
return opts?.slim ? rows.map(rowToWorkflowSummary) : rows.map(rowToWorkflow);
|
|
7134
7259
|
}
|
|
@@ -7474,6 +7599,10 @@ function getPageBySlug(agentId, slug) {
|
|
|
7474
7599
|
const row = getDb().prepare("SELECT * FROM pages WHERE agentId = ? AND slug = ?").get(agentId, slug);
|
|
7475
7600
|
return row ? rowToPage(row) : null;
|
|
7476
7601
|
}
|
|
7602
|
+
function getLatestPageBySlug(slug) {
|
|
7603
|
+
const row = getDb().prepare("SELECT * FROM pages WHERE slug = ? ORDER BY updatedAt DESC LIMIT 1").get(slug);
|
|
7604
|
+
return row ? rowToPage(row) : null;
|
|
7605
|
+
}
|
|
7477
7606
|
function rowToPageSummary(row) {
|
|
7478
7607
|
return {
|
|
7479
7608
|
id: row.id,
|
|
@@ -9016,6 +9145,65 @@ function upsertInboxState(opts) {
|
|
|
9016
9145
|
throw new Error("Failed to upsert inbox state");
|
|
9017
9146
|
return rowToInboxItemState(row);
|
|
9018
9147
|
}
|
|
9148
|
+
function rowToUserFavorite(row) {
|
|
9149
|
+
return {
|
|
9150
|
+
id: row.id,
|
|
9151
|
+
userId: row.userId,
|
|
9152
|
+
itemType: row.itemType,
|
|
9153
|
+
itemId: row.itemId,
|
|
9154
|
+
createdAt: row.createdAt,
|
|
9155
|
+
lastUpdatedAt: row.lastUpdatedAt,
|
|
9156
|
+
createdBy: row.created_by ?? undefined,
|
|
9157
|
+
updatedBy: row.updated_by ?? undefined
|
|
9158
|
+
};
|
|
9159
|
+
}
|
|
9160
|
+
function listUserFavorites(opts) {
|
|
9161
|
+
const conditions = ["userId = ?"];
|
|
9162
|
+
const params = [opts.userId];
|
|
9163
|
+
if (opts.itemType) {
|
|
9164
|
+
conditions.push("itemType = ?");
|
|
9165
|
+
params.push(opts.itemType);
|
|
9166
|
+
}
|
|
9167
|
+
if (opts.itemIds && opts.itemIds.length > 0) {
|
|
9168
|
+
conditions.push(`itemId IN (${opts.itemIds.map(() => "?").join(",")})`);
|
|
9169
|
+
params.push(...opts.itemIds);
|
|
9170
|
+
}
|
|
9171
|
+
const rows = getDb().prepare(`SELECT * FROM user_favorites WHERE ${conditions.join(" AND ")} ORDER BY lastUpdatedAt DESC`).all(...params);
|
|
9172
|
+
return rows.map(rowToUserFavorite);
|
|
9173
|
+
}
|
|
9174
|
+
function getFavoriteItemIdSet(opts) {
|
|
9175
|
+
return new Set(listUserFavorites(opts).map((favorite) => favorite.itemId));
|
|
9176
|
+
}
|
|
9177
|
+
function setUserFavorite(opts) {
|
|
9178
|
+
if (!opts.favorite) {
|
|
9179
|
+
getDb().prepare("DELETE FROM user_favorites WHERE userId = ? AND itemType = ? AND itemId = ?").run(opts.userId, opts.itemType, opts.itemId);
|
|
9180
|
+
return null;
|
|
9181
|
+
}
|
|
9182
|
+
const now = new Date().toISOString();
|
|
9183
|
+
const actor = opts.actorUserId ?? opts.userId;
|
|
9184
|
+
const row = getDb().prepare(`INSERT INTO user_favorites (
|
|
9185
|
+
userId, itemType, itemId, createdAt, lastUpdatedAt, created_by, updated_by
|
|
9186
|
+
)
|
|
9187
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
9188
|
+
ON CONFLICT(userId, itemType, itemId) DO UPDATE SET
|
|
9189
|
+
lastUpdatedAt = excluded.lastUpdatedAt,
|
|
9190
|
+
updated_by = excluded.updated_by
|
|
9191
|
+
RETURNING *`).get(opts.userId, opts.itemType, opts.itemId, now, now, actor, actor);
|
|
9192
|
+
if (!row)
|
|
9193
|
+
throw new Error("Failed to set favorite");
|
|
9194
|
+
return rowToUserFavorite(row);
|
|
9195
|
+
}
|
|
9196
|
+
function withFavoriteFlags(rows, opts) {
|
|
9197
|
+
if (!opts.userId || rows.length === 0) {
|
|
9198
|
+
return rows.map((row) => ({ ...row, favorite: false }));
|
|
9199
|
+
}
|
|
9200
|
+
const favoriteIds = getFavoriteItemIdSet({
|
|
9201
|
+
userId: opts.userId,
|
|
9202
|
+
itemType: opts.itemType,
|
|
9203
|
+
itemIds: rows.map((row) => row.id)
|
|
9204
|
+
});
|
|
9205
|
+
return rows.map((row) => ({ ...row, favorite: favoriteIds.has(row.id) }));
|
|
9206
|
+
}
|
|
9019
9207
|
function rowToTaskTemplate(row) {
|
|
9020
9208
|
let payload = {};
|
|
9021
9209
|
try {
|
|
@@ -9721,7 +9909,7 @@ function countScriptRunJournalAgentTaskSteps(runId) {
|
|
|
9721
9909
|
const row = getDb().prepare("SELECT COUNT(*) AS count FROM script_run_journal WHERE runId = ? AND stepType = 'agent-task'").get(runId);
|
|
9722
9910
|
return row?.count ?? 0;
|
|
9723
9911
|
}
|
|
9724
|
-
var db = null, sqliteVecAvailable = false, VERSIONABLE_FIELDS, agentQueries, MAX_EMPTY_POLLS = 2, taskQueries, findTaskByGitHub, logQueries, sessionLogQueries, sessionCostQueries, SCHEDULE_TEMPLATE_PREVIEW_LENGTH = 280, TASK_PREVIEW_LENGTH = 300, RESERVED_CONFIG_PLACEHOLDER = "[reserved key stored in swarm_config; delete this row]", SKILL_FILE_LIMITS, BINARY_SKILL_FILE_PLACEHOLDER = "[binary file - not synced]", SKILL_SLIM_COLUMNS = "id, name, description, type, scope, ownerAgentId, sourceUrl, sourceRepo, sourcePath, sourceBranch, sourceHash, isComplex, allowedTools, model, effort, context, agent, disableModelInvocation, userInvocable, version, isEnabled, systemDefault, createdAt, lastUpdatedAt, lastFetchedAt, '' as content", contextSnapshotQueries, KvTypeCollisionError;
|
|
9912
|
+
var db = null, sqliteVecAvailable = false, VERSIONABLE_FIELDS, agentQueries, MAX_EMPTY_POLLS = 2, taskQueries, findTaskByGitHub, LINEAR_TRACKER_CONTEXT_KEY_PREFIX = "task:trackers:linear:", logQueries, sessionLogQueries, sessionCostQueries, SCHEDULE_TEMPLATE_PREVIEW_LENGTH = 280, TASK_PREVIEW_LENGTH = 300, RESERVED_CONFIG_PLACEHOLDER = "[reserved key stored in swarm_config; delete this row]", SKILL_FILE_LIMITS, BINARY_SKILL_FILE_PLACEHOLDER = "[binary file - not synced]", SKILL_SLIM_COLUMNS = "id, name, description, type, scope, ownerAgentId, sourceUrl, sourceRepo, sourcePath, sourceBranch, sourceHash, isComplex, allowedTools, model, effort, context, agent, disableModelInvocation, userInvocable, version, isEnabled, systemDefault, createdAt, lastUpdatedAt, lastFetchedAt, '' as content", contextSnapshotQueries, KvTypeCollisionError;
|
|
9725
9913
|
var init_db = __esm(() => {
|
|
9726
9914
|
init_provider_metadata();
|
|
9727
9915
|
init_package();
|
|
@@ -9829,4 +10017,4 @@ var init_db = __esm(() => {
|
|
|
9829
10017
|
};
|
|
9830
10018
|
});
|
|
9831
10019
|
|
|
9832
|
-
export { interpolate, deepInterpolate, init_template, registerTemplate, getTemplateDefinition, getAllTemplateDefinitions, init_registry, configureHttpResolver, resolveTemplate, resolveTemplateAsync, init_resolver, initTelemetry, telemetry, init_telemetry, ModelTierSchema, ReasoningEffortSchema, splitLegacyModelAlias, resolveTaskModelSelection, AgentTaskStatusSchema, isTerminalTaskStatus, AgentTaskSourceSchema, ProviderNameSchema, FollowUpConfigSchema, AgentTaskSchema, AttachmentInputSchema, TaskAttachmentSchema, InboxItemTypeSchema, InboxItemStatusSchema, 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, init_request_auth_context, encryptSecret, decryptSecret, getEncryptionKey, init_crypto, 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, 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, getLatestTaskByContextKey, getAgentWorkingOnThread, getLatestActiveTaskInThread, getMostRecentTaskInThread, findCompletedTaskInThread, findRecentCancelledTaskInThread, completeTask, failTask, cancelTask, supersedeTask, backfillSupersedeTaskResumeTaskId, pauseTask, resumeTask, getPausedTasksForAgent, getOrphanedInProgressTasksForAgent, resetOrphanedInProgressTasksForAgent, getRecentlyCancelledTasksForAgent, deleteTask, updateTaskProgress, insertTaskAttachment, getTaskAttachments, getAgentWithTasks, getAllAgentsWithTasks, logQueries, createLogEntry, getLogsByAgentId, getLogsByTaskId, getLogsByTaskIdChronological, getLogsByEventType, getAllLogs, findRecentSimilarTasks, createTaskExtended, claimTask, releaseTask, acceptTask, rejectTask, moveTaskToBacklog, moveTaskFromBacklog, releaseStaleReviewingTasks, getOfferedTasksForAgent, claimOfferedTask, getUnassignedTasksCount, getUnassignedTaskIds, 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, 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, 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, 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 };
|
|
10020
|
+
export { interpolate, deepInterpolate, init_template, registerTemplate, getTemplateDefinition, getAllTemplateDefinitions, init_registry, configureHttpResolver, resolveTemplate, resolveTemplateAsync, init_resolver, initTelemetry, telemetry, init_telemetry, 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, encryptSecret, decryptSecret, getEncryptionKey, init_crypto, 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, 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, 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, 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, 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, listUserFavorites, getFavoriteItemIdSet, 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 };
|
|
@@ -2,19 +2,19 @@ import {
|
|
|
2
2
|
authJsonToCredentialSelection,
|
|
3
3
|
checkCodexCredentials,
|
|
4
4
|
credentialsToAuthJson
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-w6zp4qcx.js";
|
|
6
6
|
import {
|
|
7
7
|
loadAllCodexOAuthSlots
|
|
8
8
|
} from "./cli-amncg1dq.js";
|
|
9
9
|
import {
|
|
10
10
|
checkClaudeManagedCredentials
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-2r7s8jhp.js";
|
|
12
12
|
import {
|
|
13
13
|
checkDevinCredentials
|
|
14
14
|
} from "./cli-tyfxrrdd.js";
|
|
15
15
|
import {
|
|
16
16
|
checkOpencodeCredentials
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-a0t7vapf.js";
|
|
18
18
|
import {
|
|
19
19
|
initOtel,
|
|
20
20
|
injectTraceContext,
|
|
@@ -23,10 +23,10 @@ import {
|
|
|
23
23
|
withSpan,
|
|
24
24
|
withSpanContext,
|
|
25
25
|
writeSkillsToFilesystem
|
|
26
|
-
} from "./cli-
|
|
26
|
+
} from "./cli-gx7gnvha.js";
|
|
27
27
|
import {
|
|
28
28
|
checkClaudeCredentials
|
|
29
|
-
} from "./cli-
|
|
29
|
+
} from "./cli-2fc97xm5.js";
|
|
30
30
|
import {
|
|
31
31
|
MAX_RATE_LIMIT_RESET_MS,
|
|
32
32
|
isCodexCreditsExhaustedMessage,
|
|
@@ -40,10 +40,10 @@ import {
|
|
|
40
40
|
import {
|
|
41
41
|
ensure,
|
|
42
42
|
initialize
|
|
43
|
-
} from "./cli-
|
|
43
|
+
} from "./cli-1zs2dm5w.js";
|
|
44
44
|
import {
|
|
45
45
|
validateJsonSchema
|
|
46
|
-
} from "./cli-
|
|
46
|
+
} from "./cli-psz2xq0n.js";
|
|
47
47
|
import {
|
|
48
48
|
getApiKey
|
|
49
49
|
} from "./cli-f14fvzag.js";
|
|
@@ -53,7 +53,10 @@ import {
|
|
|
53
53
|
resolveClaudeMdPath,
|
|
54
54
|
syncProfileFilesToServer,
|
|
55
55
|
writeIdentityBaselines
|
|
56
|
-
} from "./cli-
|
|
56
|
+
} from "./cli-q25ejbyn.js";
|
|
57
|
+
import {
|
|
58
|
+
taskAttachmentDisplayUrl
|
|
59
|
+
} from "./cli-wspgs9bt.js";
|
|
57
60
|
import {
|
|
58
61
|
getMcpBaseUrl
|
|
59
62
|
} from "./cli-dh55d5fg.js";
|
|
@@ -76,7 +79,7 @@ import {
|
|
|
76
79
|
resolveTaskModelSelection,
|
|
77
80
|
resolveTemplateAsync,
|
|
78
81
|
telemetry
|
|
79
|
-
} from "./cli-
|
|
82
|
+
} from "./cli-9wv4e7qs.js";
|
|
80
83
|
import {
|
|
81
84
|
init_credentials,
|
|
82
85
|
resolveCredentialPools
|
|
@@ -84,7 +87,7 @@ import {
|
|
|
84
87
|
import {
|
|
85
88
|
init_secret_scrubber,
|
|
86
89
|
scrubSecrets
|
|
87
|
-
} from "./cli-
|
|
90
|
+
} from "./cli-4j2mrzag.js";
|
|
88
91
|
import {
|
|
89
92
|
__require
|
|
90
93
|
} from "./cli-p9swy5t3.js";
|
|
@@ -438,19 +441,19 @@ async function materializeCodexAuthJson(_slot, creds, deps = {}) {
|
|
|
438
441
|
async function createProviderAdapter(provider) {
|
|
439
442
|
switch (provider) {
|
|
440
443
|
case "claude": {
|
|
441
|
-
const { ClaudeAdapter } = await import("./claude-adapter-
|
|
444
|
+
const { ClaudeAdapter } = await import("./claude-adapter-mma9a1yr.js");
|
|
442
445
|
return new ClaudeAdapter;
|
|
443
446
|
}
|
|
444
447
|
case "pi": {
|
|
445
|
-
const { PiMonoAdapter } = await import("./pi-mono-adapter-
|
|
448
|
+
const { PiMonoAdapter } = await import("./pi-mono-adapter-ayr3akk8.js");
|
|
446
449
|
return new PiMonoAdapter;
|
|
447
450
|
}
|
|
448
451
|
case "codex": {
|
|
449
|
-
const { CodexAdapter } = await import("./codex-adapter-
|
|
452
|
+
const { CodexAdapter } = await import("./codex-adapter-ebs12jef.js");
|
|
450
453
|
return new CodexAdapter;
|
|
451
454
|
}
|
|
452
455
|
case "claude-managed": {
|
|
453
|
-
const { ClaudeManagedAdapter } = await import("./claude-managed-adapter-
|
|
456
|
+
const { ClaudeManagedAdapter } = await import("./claude-managed-adapter-pv2nbqy4.js");
|
|
454
457
|
return new ClaudeManagedAdapter;
|
|
455
458
|
}
|
|
456
459
|
case "devin": {
|
|
@@ -458,7 +461,7 @@ async function createProviderAdapter(provider) {
|
|
|
458
461
|
return new DevinAdapter;
|
|
459
462
|
}
|
|
460
463
|
case "opencode": {
|
|
461
|
-
const { OpencodeAdapter } = await import("./opencode-adapter-
|
|
464
|
+
const { OpencodeAdapter } = await import("./opencode-adapter-mqsxr170.js");
|
|
462
465
|
return new OpencodeAdapter;
|
|
463
466
|
}
|
|
464
467
|
default:
|
|
@@ -856,20 +859,8 @@ async function fetchTaskContextForPreamble(apiUrl, apiKey, taskId) {
|
|
|
856
859
|
}
|
|
857
860
|
}
|
|
858
861
|
function formatAttachmentPointer(att) {
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
if (att.orgId && att.driveId) {
|
|
862
|
-
return `${liveHost}/file/~/${att.orgId}/${att.driveId}/${att.path}`;
|
|
863
|
-
}
|
|
864
|
-
return att.path;
|
|
865
|
-
}
|
|
866
|
-
if (att.kind === "url" && att.url)
|
|
867
|
-
return att.url;
|
|
868
|
-
if (att.kind === "page" && att.pageId)
|
|
869
|
-
return `(page:${att.pageId})`;
|
|
870
|
-
if (att.kind === "shared-fs" && att.path)
|
|
871
|
-
return att.path;
|
|
872
|
-
return "(no pointer)";
|
|
862
|
+
const pointer = taskAttachmentDisplayUrl(att);
|
|
863
|
+
return pointer || "(no pointer)";
|
|
873
864
|
}
|
|
874
865
|
async function buildContextPreamble(apiUrl, apiKey, parentTaskId) {
|
|
875
866
|
const ancestors = [];
|
|
@@ -1118,7 +1109,7 @@ async function checkProviderCredentials(provider, env, opts) {
|
|
|
1118
1109
|
case "opencode":
|
|
1119
1110
|
return checkOpencodeCredentials(env, opts);
|
|
1120
1111
|
case "pi": {
|
|
1121
|
-
const { checkPiMonoCredentials } = await import("./pi-mono-adapter-
|
|
1112
|
+
const { checkPiMonoCredentials } = await import("./pi-mono-adapter-ayr3akk8.js");
|
|
1122
1113
|
return checkPiMonoCredentials(env, opts);
|
|
1123
1114
|
}
|
|
1124
1115
|
default:
|
|
@@ -1720,6 +1711,33 @@ async function fetchResolvedEnv(apiUrl, apiKey, agentId, baseEnv = process.env,
|
|
|
1720
1711
|
});
|
|
1721
1712
|
return { env, credentialSelections, resolvedProvider };
|
|
1722
1713
|
}
|
|
1714
|
+
async function ensureAgentFsCredentials(apiUrl, apiKey, agentId) {
|
|
1715
|
+
if (!apiUrl || !apiKey || !agentId || agentId === "unknown")
|
|
1716
|
+
return;
|
|
1717
|
+
try {
|
|
1718
|
+
const response = await fetch(`${apiUrl}/api/fs/agent-credentials`, {
|
|
1719
|
+
method: "POST",
|
|
1720
|
+
headers: {
|
|
1721
|
+
Authorization: `Bearer ${apiKey}`,
|
|
1722
|
+
"X-Agent-ID": agentId,
|
|
1723
|
+
"Content-Type": "application/json"
|
|
1724
|
+
},
|
|
1725
|
+
body: "{}",
|
|
1726
|
+
signal: AbortSignal.timeout(1e4)
|
|
1727
|
+
});
|
|
1728
|
+
if (!response.ok) {
|
|
1729
|
+
const text = await response.text().catch(() => "");
|
|
1730
|
+
console.warn(scrubSecrets(`[agent-fs] credential provisioning skipped: HTTP ${response.status}${text ? ` ${text}` : ""}`));
|
|
1731
|
+
return;
|
|
1732
|
+
}
|
|
1733
|
+
const result = await response.json().catch(() => ({}));
|
|
1734
|
+
if (result.enabled) {
|
|
1735
|
+
console.log(`[agent-fs] ${result.created ? "created" : "confirmed"} agent-scoped credentials`);
|
|
1736
|
+
}
|
|
1737
|
+
} catch (error) {
|
|
1738
|
+
console.warn(scrubSecrets(`[agent-fs] credential provisioning skipped: ${error}`));
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1723
1741
|
var RELOADABLE_ENV_KEYS = new Set([
|
|
1724
1742
|
"MODEL_OVERRIDE",
|
|
1725
1743
|
"REASONING_EFFORT_OVERRIDE",
|
|
@@ -3880,6 +3898,7 @@ async function runAgent(config, opts) {
|
|
|
3880
3898
|
let bootModel = process.env.MODEL_OVERRIDE || "";
|
|
3881
3899
|
let bootCooldownMs = resolveCodexCreditsExhaustedCooldownMs(undefined);
|
|
3882
3900
|
try {
|
|
3901
|
+
await ensureAgentFsCredentials(apiUrl, apiKey, agentId);
|
|
3883
3902
|
const bootEnv = await fetchResolvedEnv(apiUrl, apiKey, agentId);
|
|
3884
3903
|
bootProvider = bootEnv.resolvedProvider;
|
|
3885
3904
|
bootModel = bootEnv.env.MODEL_OVERRIDE || bootModel;
|