@xopcai/xopc 0.0.225 → 0.0.228
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-CtTYnku4.js → activity-store-M0nAY5XB.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-dizuqu_4.js → agent-avatar-dicebear-CjGZBs4C.js} +1 -1
- package/dist/gateway/static/root/assets/agents-B0NI4_NI.js +68 -0
- package/dist/gateway/static/root/assets/{api-CLRMz2BT.js → api-BywYxpaS.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-Cnk-DtQh.js → app-management-settings-panel--SjycrXk.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-wP0rogVI.js → appearance-settings-8G-TVUtg.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-2NiqD-YP.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-Cpzsm-DM.js → archive-plugin-7_DXaMTP.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-Bd2OOoEK.js → attachment-load-Bx44zSpz.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-DNqhguyk.js → automations-page-CrKAHqc0.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-Q3g9cf0h.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-Dcma5HdI.js → binary-plugins-DjDwnHAQ.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-D-B8ThwK.js → block-editor-7aMOKoZM.js} +3 -3
- package/dist/gateway/static/root/assets/browser-settings-page-DTwPkmAC.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-BAPZIXrs.js → browser-workflow-inputs-8NC2qDRF.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-DHtaSKEh.js → browser-workflows-page-DVLrWKz_.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-YcP4FbN7.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-zsZQ7im3.js → capability-presets-api-o0y9WgAI.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-AcPjHHia.js +3 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-Cp8iaaXp.js → channel-recipient-api-C5ABr73b.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-Ca94Q1D-.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-38FsOnR0.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-Dr6Rq2ln.js → chat-terminal-dock-BR-_7KC0.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-SGxfLTd6.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-BiXrpzmo.js → cron-expression-D8-c-Tkw.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-BPuRtwKt.js → date-picker-kV-Jyl9J.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-BNC_W7wI.js → dependency-picker-CwKcrfGj.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DzOpt5nI.js → desktop-pet-D9rnchu3.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BW0brCvH.js → desktop-pet-settings-CTs5WGzk.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-Baml0uTS.js → directory-picker-path-field-CCl0aaDm.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CBXyKmfS.js → extension-debug-page-Cau40SvC.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BBhcr_SZ.js → extension-page-BsJXdvIL.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-4rwWpN9_.js → extension-settings-page-qWqJyF7-.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-Dg-BlBe4.js → gateway-config-api-BI0SELXm.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-Du0MvK9s.js → gateway-config-swr-BWGjnmDl.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BOuYZOYe.js → gateway-settings-6ZdOIC7F.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-JbjcHCaN.js → gateway-startup-retry-B_zrtccP.js} +1 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-KBwhXeFD.js +1 -0
- package/dist/gateway/static/root/assets/home-page-BA2M4CLi.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-G2tfPvKP.js → image-generation-api-YKP2me5Z.js} +1 -1
- package/dist/gateway/static/root/assets/index-BX0dz1JK.js +70 -0
- package/dist/gateway/static/root/assets/index-D_hrEKXM.css +2 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-L1Vtxgp9.js → keyboard-shortcuts-settings-kHtpnyEm.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-D2nkn09R.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page--thlkBLS.js → local-apps-page-BCXa0oUa.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-DqJz-cOR.js → locale-store-CXhjfe4q.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-D3sNst0K.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-p55fR4XO.js → management-settings-tHnlfOAQ.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-DwMcRlBR.js → markdown-split-BMLqHHr5.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-DD_PgVue.css → markdown-view-CLzTdVLW.css} +1 -1
- package/dist/gateway/static/root/assets/markdown-view-DvM5PWEH.js +201 -0
- package/dist/gateway/static/root/assets/{media-plugins-O6H3GZn7.js → media-plugins-DybwqTgv.js} +1 -1
- package/dist/gateway/static/root/assets/messages-BMdD0LWk.js +3 -0
- package/dist/gateway/static/root/assets/{notes-api-CrjQbmk1.js → notes-api-BFsOGYkd.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-miO9ig9C.js → notes-page-C24SfF6r.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-CTdZc3ov.js +4 -0
- package/dist/gateway/static/root/assets/{product-open-page-BOu07nXf.js → product-open-page-DBfCVlJq.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-COHaEpbA.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-lMnST7D_.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-Bf_HDLUJ.js → registry-api-BFZrVYfy.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BIRKBvO_.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DthuRqUH.js → runtime-tools-settings-panel-BPEGTip5.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-8W8PhXxa.js → schema-form-Dxlu60Td.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-CATO9G3y.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cco_W41x.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-CrsKGYiG.js → settings-form-section-ChXh3Bwk.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-WJtI0AAq.js → settings-loading-skeleton-BCAUqIe2.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-PCjwRF47.js → settings-page-D25W9Okr.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-D65CwlNC.js → setup-status-panel-DsN7Z4Fl.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-BGtvLLeZ.js → share-preview-page-CRFnUaNb.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-CAX0eNaP.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-Doy1gghe.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-C_npyryI.js → skills-page-Cl7jjTK7.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-C46Sd78k.js → skills-page.utils-BiCl4nb5.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-DomTLwki.js → system-settings-panel-BuESR7ZT.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-BRiy8NL3.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-Ce7wq__X.js → theme-store-DOdCjyuw.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-Do9mCRcY.js → use-autosave-Dg1mgJ_l.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-CqoADNKu.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-Bc5p-0tX.js → voice-api-key-field-BDNexlVR.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BieqsmT1.js → work-discovery-overlay-BHTfeaWL.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DVj8iYvm.js → workflow-run-setup-panel-Cf_w-NZy.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-j0P-uECz.js +5 -0
- package/dist/gateway/static/root/index.html +12 -12
- package/dist/gateway/static/root/notification-sw.js +1 -1
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/notifications.js +56 -0
- package/dist/packages/gateway-contract/src/turn-outcome.js +114 -0
- package/dist/src/agent/agent-manager.d.ts +3 -1
- package/dist/src/agent/agent-manager.js +22 -5
- package/dist/src/agent/lifecycle/timeout-wrapper.d.ts +1 -0
- package/dist/src/agent/lifecycle/timeout-wrapper.js +7 -6
- package/dist/src/agent/mcp/mcp-transport-config.d.ts +1 -1
- package/dist/src/agent/mcp/mcp-transport-config.js +1 -1
- package/dist/src/agent/memory/understanding/service.js +1 -0
- package/dist/src/agent/memory/understanding/types.d.ts +1 -0
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.d.ts +2 -2
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.js +4 -4
- package/dist/src/agent/service.d.ts +2 -0
- package/dist/src/agent/service.js +6 -0
- package/dist/src/agent/skills/index.d.ts +22 -2
- package/dist/src/agent/skills/index.js +74 -32
- package/dist/src/agent/skills/skill-sources.d.ts +0 -1
- package/dist/src/agent/skills/skill-sources.js +1 -11
- package/dist/src/agent/tools/create-share-tool.js +14 -1
- package/dist/src/agent/tools/exec-command.js +3 -3
- package/dist/src/agent/tools/execute-code-tool.js +1 -1
- package/dist/src/agent/tools/executor.js +2 -2
- package/dist/src/agent/tools/image-generate-tool.js +12 -0
- package/dist/src/agent/tools/send-media.js +11 -0
- package/dist/src/agent/tools/xopc-use-tool.js +1 -1
- package/dist/src/cli/command-loaders.js +1 -0
- package/dist/src/cli/command-manifest.js +4 -0
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/history.d.ts +1 -0
- package/dist/src/cli/commands/history.js +50 -0
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/connectors/connected-source-understanding.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/chat-stream/protocol.d.ts +3 -2
- package/dist/src/gateway/chat-stream/turn-outcome-collector.d.ts +16 -0
- package/dist/src/gateway/chat-stream/turn-outcome-collector.js +111 -0
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/lib/static-ui.js +7 -5
- package/dist/src/gateway/hono/routes/connectors.js +18 -16
- package/dist/src/gateway/hono/routes/index.js +2 -0
- package/dist/src/gateway/hono/routes/mobile.js +18 -40
- package/dist/src/gateway/hono/routes/notifications.d.ts +3 -0
- package/dist/src/gateway/hono/routes/notifications.js +45 -0
- package/dist/src/gateway/hono/routes/project-skills.js +30 -2
- package/dist/src/gateway/hono/routes/sessions.js +31 -0
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/hono/routes/voice.js +1 -1
- package/dist/src/gateway/hono/routes/you.js +52 -0
- package/dist/src/gateway/service/agent-runner.js +6 -2
- package/dist/src/gateway/service/run-gateway-agent.js +53 -1
- package/dist/src/gateway/service/sessions-api.d.ts +6 -0
- package/dist/src/gateway/service/sessions-api.js +60 -3
- package/dist/src/gateway/service.d.ts +2 -2
- package/dist/src/gateway/service.js +8 -7
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/history/ctx/exporter.d.ts +14 -0
- package/dist/src/history/ctx/exporter.js +99 -0
- package/dist/src/history/ctx/format.d.ts +25 -0
- package/dist/src/history/ctx/format.js +282 -0
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/knowledge/connected-understanding-pipeline.js +12 -3
- package/dist/src/knowledge/index.d.ts +0 -1
- package/dist/src/knowledge/index.js +1 -2
- package/dist/src/media/session-references.d.ts +6 -0
- package/dist/src/media/session-references.js +24 -3
- package/dist/src/notifications/device-store.d.ts +16 -0
- package/dist/src/notifications/device-store.js +96 -0
- package/dist/src/notifications/planner.d.ts +6 -0
- package/dist/src/notifications/planner.js +156 -0
- package/dist/src/notifications/service.d.ts +18 -0
- package/dist/src/notifications/service.js +184 -0
- package/dist/src/notifications/store.d.ts +53 -0
- package/dist/src/notifications/store.js +184 -0
- package/dist/src/notifications/types.d.ts +29 -0
- package/dist/src/notifications/types.js +14 -0
- package/dist/src/projects/project-skill-service.d.ts +28 -6
- package/dist/src/projects/project-skill-service.js +76 -29
- package/dist/src/session/client-history.d.ts +3 -1
- package/dist/src/session/client-history.js +13 -0
- package/dist/src/session/index.d.ts +1 -1
- package/dist/src/session/manager.d.ts +1 -0
- package/dist/src/session/manager.js +6 -0
- package/dist/src/session/store.d.ts +15 -0
- package/dist/src/session/store.js +58 -0
- package/dist/src/storage/sqlite/index.d.ts +2 -1
- package/dist/src/storage/sqlite/index.js +3 -2
- package/dist/src/storage/sqlite/migrations/135_user_people.sql +59 -0
- package/dist/src/storage/sqlite/migrations/136_product_notifications.sql +79 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/session-input-repository.d.ts +5 -0
- package/dist/src/storage/sqlite/session-input-repository.js +9 -1
- package/dist/src/storage/sqlite/user-people-repository.d.ts +32 -0
- package/dist/src/storage/sqlite/user-people-repository.js +246 -0
- package/dist/src/tasks/index.js +2 -2
- package/dist/src/tasks/task-application-service.js +42 -6
- package/dist/src/tasks/task-change-events.d.ts +9 -0
- package/dist/src/tasks/task-change-events.js +17 -1
- package/dist/src/tasks/task-outbox-dispatcher.js +5 -1
- package/dist/src/tasks/task-run-dispatcher.js +4 -2
- package/dist/src/tasks/task-run-repository.js +13 -0
- package/dist/src/user-context/relationships/indexer.d.ts +13 -0
- package/dist/src/user-context/relationships/indexer.js +185 -0
- package/dist/src/user-context/relationships/service.d.ts +22 -0
- package/dist/src/user-context/relationships/service.js +50 -0
- package/dist/src/user-context/relationships/types.d.ts +55 -0
- package/dist/src/user-context/relationships/types.js +10 -0
- package/dist/src/user-context/sources/repository.d.ts +1 -1
- package/dist/src/user-context/sources/repository.js +8 -2
- package/dist/src/work-discovery/service.js +1 -1
- package/package.json +2 -2
- package/dist/gateway/static/root/assets/agents-DeEEFZJ4.js +0 -68
- package/dist/gateway/static/root/assets/apps-page-Db5YNHVM.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-CNT05YTb.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-UbDj3LIq.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CiO152QS.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-Bc_hRwfL.js +0 -3
- package/dist/gateway/static/root/assets/channels-settings-CFW7zBoT.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-5rNVq7iI.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DLBr5nre.js +0 -2
- package/dist/gateway/static/root/assets/heartbeat-settings-Dq4YAlSx.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BIXkO0Ck.js +0 -1
- package/dist/gateway/static/root/assets/index-Csccu8sa.js +0 -74
- package/dist/gateway/static/root/assets/index-D3_xSYKd.css +0 -2
- package/dist/gateway/static/root/assets/local-app-workbench-page-D-eacBcO.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-BRCglHvd.js +0 -2
- package/dist/gateway/static/root/assets/markdown-view-CTB9u15e.js +0 -69
- package/dist/gateway/static/root/assets/mermaid-render-BbqDc_LQ.js +0 -134
- package/dist/gateway/static/root/assets/messages-CeydamsI.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-_13lmvmF.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-BStRkOQr.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-CY03RxVr.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-B19llkld.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BDA2qbTd.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BONIDX4v.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-CdzVKrBl.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CsRWid5h.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-B6YFX7kK.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-CiCQA40E.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-AG04TTuH.js +0 -5
- package/dist/src/knowledge/people-graph.d.ts +0 -25
- package/dist/src/knowledge/people-graph.js +0 -92
- package/dist/src/mobile/notification-service.d.ts +0 -9
- package/dist/src/mobile/notification-service.js +0 -156
- package/dist/src/mobile/notification-store.d.ts +0 -28
- package/dist/src/mobile/notification-store.js +0 -132
- package/dist/src/mobile/notification-types.d.ts +0 -37
- package/dist/src/mobile/notification-types.js +0 -9
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const TurnOutcomeDeliverableKindSchema = z.enum([
|
|
3
|
+
"document",
|
|
4
|
+
"spreadsheet",
|
|
5
|
+
"presentation",
|
|
6
|
+
"pdf",
|
|
7
|
+
"image",
|
|
8
|
+
"video",
|
|
9
|
+
"audio",
|
|
10
|
+
"site",
|
|
11
|
+
"archive",
|
|
12
|
+
"file"
|
|
13
|
+
]);
|
|
14
|
+
const TurnOutcomeArtifactLocationSchema = z.enum([
|
|
15
|
+
"workspace",
|
|
16
|
+
"external_host",
|
|
17
|
+
"worktree",
|
|
18
|
+
"remote_runtime",
|
|
19
|
+
"artifact_store"
|
|
20
|
+
]);
|
|
21
|
+
const TurnOutcomeArtifactAvailabilitySchema = z.enum([
|
|
22
|
+
"materializing",
|
|
23
|
+
"available",
|
|
24
|
+
"expired",
|
|
25
|
+
"missing",
|
|
26
|
+
"failed"
|
|
27
|
+
]);
|
|
28
|
+
const TurnOutcomeArtifactCapabilitySchema = z.enum([
|
|
29
|
+
"preview",
|
|
30
|
+
"download",
|
|
31
|
+
"open",
|
|
32
|
+
"import",
|
|
33
|
+
"share",
|
|
34
|
+
"regenerate"
|
|
35
|
+
]);
|
|
36
|
+
const TurnOutcomeDeliverableSchema = z.object({
|
|
37
|
+
artifactId: z.string().min(1),
|
|
38
|
+
title: z.string().min(1),
|
|
39
|
+
kind: TurnOutcomeDeliverableKindSchema,
|
|
40
|
+
mimeType: z.string().optional(),
|
|
41
|
+
sizeBytes: z.number().nonnegative().optional(),
|
|
42
|
+
availability: TurnOutcomeArtifactAvailabilitySchema,
|
|
43
|
+
location: TurnOutcomeArtifactLocationSchema,
|
|
44
|
+
capabilities: z.array(TurnOutcomeArtifactCapabilitySchema),
|
|
45
|
+
uri: z.string().optional(),
|
|
46
|
+
workspaceRelativePath: z.string().optional(),
|
|
47
|
+
shareUrl: z.string().url().optional(),
|
|
48
|
+
thumbnailUrl: z.string().optional(),
|
|
49
|
+
expiresAt: z.string().optional()
|
|
50
|
+
});
|
|
51
|
+
const TurnOutcomeChangedFileSchema = z.object({
|
|
52
|
+
path: z.string().min(1),
|
|
53
|
+
status: z.enum([
|
|
54
|
+
"added",
|
|
55
|
+
"modified",
|
|
56
|
+
"deleted",
|
|
57
|
+
"renamed"
|
|
58
|
+
]).optional(),
|
|
59
|
+
added: z.number().nonnegative().optional(),
|
|
60
|
+
removed: z.number().nonnegative().optional()
|
|
61
|
+
});
|
|
62
|
+
const TurnOutcomeChangeSetSchema = z.object({
|
|
63
|
+
changeSetId: z.string().min(1),
|
|
64
|
+
files: z.array(TurnOutcomeChangedFileSchema),
|
|
65
|
+
added: z.number().nonnegative(),
|
|
66
|
+
removed: z.number().nonnegative(),
|
|
67
|
+
diff: z.string(),
|
|
68
|
+
diffTruncated: z.boolean().optional(),
|
|
69
|
+
environment: z.enum([
|
|
70
|
+
"workspace",
|
|
71
|
+
"worktree",
|
|
72
|
+
"remote_runtime"
|
|
73
|
+
])
|
|
74
|
+
});
|
|
75
|
+
const TurnOutcomeEvidenceSchema = z.object({
|
|
76
|
+
evidenceId: z.string().min(1),
|
|
77
|
+
kind: z.enum([
|
|
78
|
+
"check",
|
|
79
|
+
"screenshot",
|
|
80
|
+
"video",
|
|
81
|
+
"log"
|
|
82
|
+
]),
|
|
83
|
+
label: z.string().min(1),
|
|
84
|
+
status: z.enum([
|
|
85
|
+
"passed",
|
|
86
|
+
"failed",
|
|
87
|
+
"warning"
|
|
88
|
+
]),
|
|
89
|
+
durationMs: z.number().nonnegative().optional(),
|
|
90
|
+
command: z.string().optional(),
|
|
91
|
+
artifactId: z.string().optional()
|
|
92
|
+
});
|
|
93
|
+
const TurnOutcomeSchema = z.object({
|
|
94
|
+
version: z.literal(1),
|
|
95
|
+
outcomeId: z.string().min(1),
|
|
96
|
+
runId: z.string().min(1),
|
|
97
|
+
turnId: z.string().min(1),
|
|
98
|
+
status: z.enum([
|
|
99
|
+
"succeeded",
|
|
100
|
+
"partial",
|
|
101
|
+
"failed"
|
|
102
|
+
]),
|
|
103
|
+
summary: z.string().optional(),
|
|
104
|
+
deliverables: z.array(TurnOutcomeDeliverableSchema),
|
|
105
|
+
changeSet: TurnOutcomeChangeSetSchema.optional(),
|
|
106
|
+
evidence: z.array(TurnOutcomeEvidenceSchema),
|
|
107
|
+
createdAt: z.string()
|
|
108
|
+
});
|
|
109
|
+
function parseTurnOutcome(value) {
|
|
110
|
+
const parsed = TurnOutcomeSchema.safeParse(value);
|
|
111
|
+
return parsed.success ? parsed.data : null;
|
|
112
|
+
}
|
|
113
|
+
//#endregion
|
|
114
|
+
export { TurnOutcomeDeliverableSchema, parseTurnOutcome };
|
|
@@ -50,7 +50,7 @@ export interface SkillCatalogRuntimeMeta {
|
|
|
50
50
|
export interface SkillCatalogSnapshot extends SkillCatalogRuntimeMeta {
|
|
51
51
|
catalog: SkillCatalogEntry[];
|
|
52
52
|
}
|
|
53
|
-
export type AgentSkillUnavailableReason = 'agent-denied' | 'disabled' | 'requirements-unmet' | 'model-invocation-disabled';
|
|
53
|
+
export type AgentSkillUnavailableReason = 'agent-denied' | 'disabled' | 'requirements-unmet' | 'model-invocation-disabled' | 'tool-gated';
|
|
54
54
|
export interface AgentSkillAvailabilityEntry extends SkillCatalogEntry {
|
|
55
55
|
availableForCurrentAgent: boolean;
|
|
56
56
|
unavailableReason: AgentSkillUnavailableReason | null;
|
|
@@ -235,7 +235,9 @@ export declare class AgentManager implements AgentInstanceGateway {
|
|
|
235
235
|
getAgentSkillAvailability(agentId: string): AgentSkillAvailabilityPayload;
|
|
236
236
|
getSessionSkillAvailability(sessionKey: string): AgentSkillAvailabilityPayload;
|
|
237
237
|
getSessionWorkspaceTrust(sessionKey: string): WorkspaceTrustState;
|
|
238
|
+
getWorkspaceTrust(workspacePath: string): WorkspaceTrustState;
|
|
238
239
|
setSessionWorkspaceTrust(sessionKey: string, trusted: boolean): WorkspaceTrustState;
|
|
240
|
+
setWorkspaceTrust(workspacePath: string, trusted: boolean): WorkspaceTrustState;
|
|
239
241
|
/**
|
|
240
242
|
* After ~/.xopc/skills.json changes (enable/disable), refresh `<available_skills>` on active agents.
|
|
241
243
|
*/
|
|
@@ -505,7 +505,7 @@ var AgentManager = class {
|
|
|
505
505
|
status: rt.skillManager.getStatus()
|
|
506
506
|
};
|
|
507
507
|
}
|
|
508
|
-
buildAgentSkillAvailability(profile, workspaceDir) {
|
|
508
|
+
buildAgentSkillAvailability(profile, workspaceDir, registeredToolNames) {
|
|
509
509
|
const cfg = this.config.config;
|
|
510
510
|
const entry = Array.isArray(cfg.agents?.list) ? cfg.agents.list.find((a) => a && a.enabled !== false && a.id.toLowerCase() === profile.agentId.toLowerCase()) : void 0;
|
|
511
511
|
const rt = this.workspaceRuntimes.getOrCreate(workspaceDir, profile.agentId);
|
|
@@ -513,12 +513,25 @@ var AgentManager = class {
|
|
|
513
513
|
const lock = loadSkillsLock();
|
|
514
514
|
const workspaceLock = loadSkillsLock(resolveWorkspaceSkillsLockPath(workspaceDir));
|
|
515
515
|
const allow = profile.skillsAllowlist === void 0 ? void 0 : new Set(profile.skillsAllowlist.map((s) => s.toLowerCase()));
|
|
516
|
+
const tools = registeredToolNames ?? this.toolsFactory.createAllTools({
|
|
517
|
+
workspace: workspaceDir,
|
|
518
|
+
profileMarkdownRoot: resolveAgentProfileDir(cfg, profile.agentId),
|
|
519
|
+
agentId: profile.agentId,
|
|
520
|
+
disabledTools: profile.tools.denied,
|
|
521
|
+
getMemoryManager: () => rt.memoryManager,
|
|
522
|
+
getSkillManager: () => rt.skillManager
|
|
523
|
+
}).map((tool) => tool.name);
|
|
524
|
+
const visibleSkillNames = new Set(rt.skillManager.selectSkillsForAgentIndexing({
|
|
525
|
+
skillAllowlist: profile.skillsAllowlist,
|
|
526
|
+
registeredToolNames: tools
|
|
527
|
+
}).map((skill) => skill.name));
|
|
516
528
|
const skills = rt.skillManager.getSkills().map((s) => {
|
|
517
529
|
let unavailableReason = null;
|
|
518
530
|
if (resolveSkillConfig(s, skillsConfig).enabled === false) unavailableReason = "disabled";
|
|
519
531
|
else if (s.disableModelInvocation) unavailableReason = "model-invocation-disabled";
|
|
520
532
|
else if (!isSkillEnabled(s, skillsConfig)) unavailableReason = "requirements-unmet";
|
|
521
533
|
else if (allow !== void 0 && !allow.has(s.name.toLowerCase())) unavailableReason = "agent-denied";
|
|
534
|
+
else if (!visibleSkillNames.has(s.name)) unavailableReason = "tool-gated";
|
|
522
535
|
return {
|
|
523
536
|
...this.skillCatalogEntryFromSkill(s, skillsConfig, lock, workspaceLock, workspaceDir),
|
|
524
537
|
availableForCurrentAgent: unavailableReason === null,
|
|
@@ -543,10 +556,12 @@ var AgentManager = class {
|
|
|
543
556
|
}
|
|
544
557
|
getSessionSkillAvailability(sessionKey) {
|
|
545
558
|
const profile = resolveEffectiveAgentProfileForSession(this.config.config, sessionKey);
|
|
546
|
-
return this.buildAgentSkillAvailability(profile, this.getResolvedWorkspaceForSession(sessionKey));
|
|
559
|
+
return this.buildAgentSkillAvailability(profile, this.getResolvedWorkspaceForSession(sessionKey), this.agents.get(sessionKey)?.registeredToolNames);
|
|
547
560
|
}
|
|
548
561
|
getSessionWorkspaceTrust(sessionKey) {
|
|
549
|
-
|
|
562
|
+
return this.getWorkspaceTrust(this.getResolvedWorkspaceForSession(sessionKey));
|
|
563
|
+
}
|
|
564
|
+
getWorkspaceTrust(workspacePath) {
|
|
550
565
|
const required = hasTrustRequiringProjectResources(workspacePath);
|
|
551
566
|
return {
|
|
552
567
|
workspacePath,
|
|
@@ -556,7 +571,9 @@ var AgentManager = class {
|
|
|
556
571
|
};
|
|
557
572
|
}
|
|
558
573
|
setSessionWorkspaceTrust(sessionKey, trusted) {
|
|
559
|
-
|
|
574
|
+
return this.setWorkspaceTrust(this.getResolvedWorkspaceForSession(sessionKey), trusted);
|
|
575
|
+
}
|
|
576
|
+
setWorkspaceTrust(workspacePath, trusted) {
|
|
560
577
|
if (!hasTrustRequiringProjectResources(workspacePath)) return {
|
|
561
578
|
workspacePath,
|
|
562
579
|
required: false,
|
|
@@ -565,7 +582,7 @@ var AgentManager = class {
|
|
|
565
582
|
};
|
|
566
583
|
this.projectTrustStore.set(workspacePath, trusted);
|
|
567
584
|
this.refreshSkillsAfterTrustChange();
|
|
568
|
-
return this.
|
|
585
|
+
return this.getWorkspaceTrust(workspacePath);
|
|
569
586
|
}
|
|
570
587
|
/**
|
|
571
588
|
* After ~/.xopc/skills.json changes (enable/disable), refresh `<available_skills>` on active agents.
|
|
@@ -14,6 +14,7 @@ export interface TimeoutConfig {
|
|
|
14
14
|
networkTimeoutMs: number;
|
|
15
15
|
gracefulShutdownMs: number;
|
|
16
16
|
}
|
|
17
|
+
export declare const DEFAULT_TOOL_EXECUTION_TIMEOUT_MS: number;
|
|
17
18
|
declare const DEFAULT_CONFIG: TimeoutConfig;
|
|
18
19
|
export interface TimeoutResult<T> {
|
|
19
20
|
success: boolean;
|
|
@@ -3,12 +3,13 @@ import { init_logger } from "../../utils/logger.js";
|
|
|
3
3
|
//#region src/agent/lifecycle/timeout-wrapper.ts
|
|
4
4
|
init_logger();
|
|
5
5
|
const log = createLogger("TimeoutWrapper");
|
|
6
|
+
const DEFAULT_TOOL_EXECUTION_TIMEOUT_MS = 1800 * 1e3;
|
|
6
7
|
const DEFAULT_CONFIG = {
|
|
7
|
-
defaultTimeoutMs:
|
|
8
|
-
shellTimeoutMs:
|
|
9
|
-
readTimeoutMs:
|
|
10
|
-
writeTimeoutMs:
|
|
11
|
-
networkTimeoutMs:
|
|
8
|
+
defaultTimeoutMs: DEFAULT_TOOL_EXECUTION_TIMEOUT_MS,
|
|
9
|
+
shellTimeoutMs: DEFAULT_TOOL_EXECUTION_TIMEOUT_MS,
|
|
10
|
+
readTimeoutMs: DEFAULT_TOOL_EXECUTION_TIMEOUT_MS,
|
|
11
|
+
writeTimeoutMs: DEFAULT_TOOL_EXECUTION_TIMEOUT_MS,
|
|
12
|
+
networkTimeoutMs: DEFAULT_TOOL_EXECUTION_TIMEOUT_MS,
|
|
12
13
|
gracefulShutdownMs: 5e3
|
|
13
14
|
};
|
|
14
15
|
/**
|
|
@@ -254,4 +255,4 @@ var TimeoutManager = class {
|
|
|
254
255
|
}
|
|
255
256
|
};
|
|
256
257
|
//#endregion
|
|
257
|
-
export { DEFAULT_CONFIG as DEFAULT_TIMEOUT_CONFIG, TimeoutError, TimeoutManager, executeWithTimeout, executeWithTimeoutResult, withTimeout };
|
|
258
|
+
export { DEFAULT_CONFIG as DEFAULT_TIMEOUT_CONFIG, DEFAULT_TOOL_EXECUTION_TIMEOUT_MS, TimeoutError, TimeoutManager, executeWithTimeout, executeWithTimeoutResult, withTimeout };
|
|
@@ -23,6 +23,6 @@ export type ResolvedHttpMcpTransportConfig = ResolvedBaseMcpTransportConfig & {
|
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
25
|
export type ResolvedMcpTransportConfig = ResolvedStdioMcpTransportConfig | ResolvedHttpMcpTransportConfig;
|
|
26
|
-
export declare const DEFAULT_MCP_REQUEST_TIMEOUT_MS
|
|
26
|
+
export declare const DEFAULT_MCP_REQUEST_TIMEOUT_MS: number;
|
|
27
27
|
export declare function resolveMcpTransportConfig(serverName: string, rawServer: unknown): ResolvedMcpTransportConfig | null;
|
|
28
28
|
export {};
|
|
@@ -10,7 +10,7 @@ init_logger();
|
|
|
10
10
|
init_string_coerce();
|
|
11
11
|
const log = createLogger("Mcp:Bundle");
|
|
12
12
|
const DEFAULT_CONNECTION_TIMEOUT_MS = 3e4;
|
|
13
|
-
const DEFAULT_MCP_REQUEST_TIMEOUT_MS =
|
|
13
|
+
const DEFAULT_MCP_REQUEST_TIMEOUT_MS = 1800 * 1e3;
|
|
14
14
|
function getConnectionTimeoutMs(rawServer) {
|
|
15
15
|
if (rawServer && typeof rawServer === "object" && typeof rawServer.connectionTimeoutMs === "number" && rawServer.connectionTimeoutMs > 0) return rawServer.connectionTimeoutMs;
|
|
16
16
|
return DEFAULT_CONNECTION_TIMEOUT_MS;
|
|
@@ -304,6 +304,7 @@ var UserUnderstandingService = class {
|
|
|
304
304
|
disclosurePolicy: candidate.disclosurePolicy,
|
|
305
305
|
confidence: candidate.confidence,
|
|
306
306
|
statement: content,
|
|
307
|
+
payload: candidate.payload,
|
|
307
308
|
createdBy: context.reviewSource === "background" ? "consolidation" : "runtime",
|
|
308
309
|
changeReason: context.reviewSource === "background" ? "background synthesis" : "explicit user statement",
|
|
309
310
|
...validFrom !== void 0 ? { validFrom } : {},
|
|
@@ -2,6 +2,7 @@ import type { UnderstandingKind, UserUnderstanding } from '../../../user-context
|
|
|
2
2
|
export interface UnderstandingCandidate {
|
|
3
3
|
kind: UnderstandingKind;
|
|
4
4
|
content: string;
|
|
5
|
+
payload?: Record<string, unknown>;
|
|
5
6
|
canonicalKey?: string;
|
|
6
7
|
confidence: number;
|
|
7
8
|
importance: number;
|
|
@@ -6,9 +6,9 @@ import type { Agent } from '@earendil-works/pi-agent-core';
|
|
|
6
6
|
import type { Config } from '../../config/schema.js';
|
|
7
7
|
/** Minimum per-turn timeout (1 minute). */
|
|
8
8
|
export declare const MIN_AGENT_TURN_TIMEOUT_MS = 60000;
|
|
9
|
-
/** Maximum per-turn timeout (
|
|
9
|
+
/** Maximum configurable per-turn timeout (24 hours). */
|
|
10
10
|
export declare const MAX_AGENT_TURN_TIMEOUT_MS: number;
|
|
11
|
-
/** Default per-turn timeout (
|
|
11
|
+
/** Default per-turn timeout (4 hours). */
|
|
12
12
|
export declare const DEFAULT_AGENT_TURN_TIMEOUT_MS: number;
|
|
13
13
|
export declare const DEFAULT_AGENT_ABORT_GRACE_MS = 5000;
|
|
14
14
|
export declare class AgentTurnUnsettledError extends Error {
|
|
@@ -2,10 +2,10 @@ import { resolveEffectiveAgentManifestForSession } from "../../config/agent-prof
|
|
|
2
2
|
//#region src/agent/orchestration/run-agent-turn-with-timeout.ts
|
|
3
3
|
/** Minimum per-turn timeout (1 minute). */
|
|
4
4
|
const MIN_AGENT_TURN_TIMEOUT_MS = 6e4;
|
|
5
|
-
/** Maximum per-turn timeout (
|
|
6
|
-
const MAX_AGENT_TURN_TIMEOUT_MS =
|
|
7
|
-
/** Default per-turn timeout (
|
|
8
|
-
const DEFAULT_AGENT_TURN_TIMEOUT_MS =
|
|
5
|
+
/** Maximum configurable per-turn timeout (24 hours). */
|
|
6
|
+
const MAX_AGENT_TURN_TIMEOUT_MS = 1440 * 60 * 1e3;
|
|
7
|
+
/** Default per-turn timeout (4 hours). */
|
|
8
|
+
const DEFAULT_AGENT_TURN_TIMEOUT_MS = 14400 * 1e3;
|
|
9
9
|
const DEFAULT_AGENT_ABORT_GRACE_MS = 5e3;
|
|
10
10
|
var AgentTurnUnsettledError = class extends Error {
|
|
11
11
|
constructor(timeoutMs, abortGraceMs) {
|
|
@@ -109,6 +109,8 @@ export declare class AgentService {
|
|
|
109
109
|
getSessionSkillAvailability(sessionKey: string): Promise<AgentSkillAvailabilityPayload>;
|
|
110
110
|
getSessionWorkspaceTrust(sessionKey: string): Promise<WorkspaceTrustState>;
|
|
111
111
|
setSessionWorkspaceTrust(sessionKey: string, trusted: boolean): Promise<WorkspaceTrustState>;
|
|
112
|
+
getWorkspaceTrust(workspacePath: string): WorkspaceTrustState;
|
|
113
|
+
setWorkspaceTrust(workspacePath: string, trusted: boolean): WorkspaceTrustState;
|
|
112
114
|
getCapabilityCatalog(sessionKey?: string): AgentCapabilityCatalogEntry[];
|
|
113
115
|
getSkillMarkdownSource(skillName: string): SkillMarkdownPreviewPayload | null;
|
|
114
116
|
refreshSkillsAfterDiskChange(): void;
|
|
@@ -513,6 +513,12 @@ var AgentService = class {
|
|
|
513
513
|
await this.sessionHydrator.workspace(sessionKey);
|
|
514
514
|
return this.agentManager.setSessionWorkspaceTrust(sessionKey, trusted);
|
|
515
515
|
}
|
|
516
|
+
getWorkspaceTrust(workspacePath) {
|
|
517
|
+
return this.agentManager.getWorkspaceTrust(workspacePath);
|
|
518
|
+
}
|
|
519
|
+
setWorkspaceTrust(workspacePath, trusted) {
|
|
520
|
+
return this.agentManager.setWorkspaceTrust(workspacePath, trusted);
|
|
521
|
+
}
|
|
516
522
|
getCapabilityCatalog(sessionKey) {
|
|
517
523
|
return this.agentManager.getCapabilityCatalogForSession(sessionKey);
|
|
518
524
|
}
|
|
@@ -1,11 +1,31 @@
|
|
|
1
1
|
import { type ResolveSkillSourcesOptions } from './skill-sources.js';
|
|
2
2
|
import type { Skill, SkillConfig, SkillDiagnostic, LoadSkillsResult } from './types.js';
|
|
3
|
+
export type WorkspaceSkillSourceState = 'active' | 'missing' | 'disabled' | 'untrusted' | 'invalid';
|
|
4
|
+
export interface WorkspaceSkillSourceStatus {
|
|
5
|
+
origin: 'xopc-workspace' | 'agents-workspace';
|
|
6
|
+
rootDir: string;
|
|
7
|
+
managed: boolean;
|
|
8
|
+
writable: boolean;
|
|
9
|
+
state: WorkspaceSkillSourceState;
|
|
10
|
+
}
|
|
11
|
+
export interface WorkspaceSkillInventoryEntry {
|
|
12
|
+
skill: Skill;
|
|
13
|
+
effective: boolean;
|
|
14
|
+
shadowedBy?: Skill['origin']['id'];
|
|
15
|
+
}
|
|
16
|
+
export interface WorkspaceSkillInventoryResult {
|
|
17
|
+
entries: WorkspaceSkillInventoryEntry[];
|
|
18
|
+
sources: WorkspaceSkillSourceStatus[];
|
|
19
|
+
diagnostics: SkillDiagnostic[];
|
|
20
|
+
}
|
|
3
21
|
export declare function loadSkills(options: ResolveSkillSourcesOptions & {
|
|
4
22
|
/** Dependency-injection override for the ~/.agents/skills compatibility root. */
|
|
5
23
|
agentsDir?: string;
|
|
6
24
|
}): LoadSkillsResult;
|
|
7
|
-
/** Discover
|
|
8
|
-
export declare function
|
|
25
|
+
/** Discover project-owned XOPC and Agents skills with runtime-equivalent trust and precedence. */
|
|
26
|
+
export declare function loadWorkspaceSkillInventory(workspaceDir: string, options: {
|
|
27
|
+
workspaceTrust: 'trusted' | 'untrusted';
|
|
28
|
+
}): WorkspaceSkillInventoryResult;
|
|
9
29
|
export interface SkillLoader {
|
|
10
30
|
init: (workspace: string, builtin: string | null) => LoadSkillsResult;
|
|
11
31
|
load: () => LoadSkillsResult;
|
|
@@ -9,7 +9,8 @@ import { parseSkillToolConditions } from "./skill-tool-gating.js";
|
|
|
9
9
|
import { formatSkillsForPrompt } from "./format-skills-prompt.js";
|
|
10
10
|
import { parseRequiredEnvVarNames } from "./required-env-vars.js";
|
|
11
11
|
import { parseSkillMetadata } from "./parse-skill-metadata.js";
|
|
12
|
-
import {
|
|
12
|
+
import { resolveWorkspaceSkillsDir } from "./workspace-skills-dir.js";
|
|
13
|
+
import { resolveSkillSources, resolveWorkspaceAgentsSkillsDir } from "./skill-sources.js";
|
|
13
14
|
import { collectSkillInstallWarnings, formatScanSummary, scanSkillDirectory } from "./scanner.js";
|
|
14
15
|
import { SkillTestFramework, SkillTestRunner, formatTestResults, formatTestResultsJson, formatTestResultsTap } from "./test-framework.js";
|
|
15
16
|
import { basename, dirname, join, relative, sep } from "path";
|
|
@@ -119,6 +120,45 @@ function discoverSkills(source, maxSkillFileBytes) {
|
|
|
119
120
|
diagnostics
|
|
120
121
|
};
|
|
121
122
|
}
|
|
123
|
+
function discoverAndMergeSkills(sources, maxSkillFileBytes, initialDiagnostics = []) {
|
|
124
|
+
const skillMap = /* @__PURE__ */ new Map();
|
|
125
|
+
const discoveredSkills = [];
|
|
126
|
+
const diagnostics = [...initialDiagnostics];
|
|
127
|
+
for (const source of sources) {
|
|
128
|
+
const discovered = discoverSkills(source, maxSkillFileBytes);
|
|
129
|
+
diagnostics.push(...discovered.diagnostics);
|
|
130
|
+
for (const skill of discovered.skills) {
|
|
131
|
+
discoveredSkills.push(skill);
|
|
132
|
+
const previous = skillMap.get(skill.name);
|
|
133
|
+
if (previous) {
|
|
134
|
+
const winner = skill.origin.priority > previous.origin.priority ? skill : previous;
|
|
135
|
+
const shadowed = winner === skill ? previous : skill;
|
|
136
|
+
diagnostics.push({
|
|
137
|
+
type: "collision",
|
|
138
|
+
skillName: skill.name,
|
|
139
|
+
path: winner.filePath,
|
|
140
|
+
message: `Skill "${skill.name}" from ${winner.origin.id} (${winner.filePath}) shadows ${shadowed.origin.id} (${shadowed.filePath})`
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
if (!previous || skill.origin.priority > previous.origin.priority) skillMap.set(skill.name, skill);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
skills: [...skillMap.values()],
|
|
148
|
+
entries: discoveredSkills.map((skill) => {
|
|
149
|
+
const winner = skillMap.get(skill.name);
|
|
150
|
+
return winner === skill ? {
|
|
151
|
+
skill,
|
|
152
|
+
effective: true
|
|
153
|
+
} : {
|
|
154
|
+
skill,
|
|
155
|
+
effective: false,
|
|
156
|
+
shadowedBy: winner.origin.id
|
|
157
|
+
};
|
|
158
|
+
}),
|
|
159
|
+
diagnostics
|
|
160
|
+
};
|
|
161
|
+
}
|
|
122
162
|
function deriveDescriptionFromMarkdown(content) {
|
|
123
163
|
let fallbackHeading = "";
|
|
124
164
|
for (const rawLine of content.split(/\r?\n/)) {
|
|
@@ -197,40 +237,42 @@ function loadSkills(options) {
|
|
|
197
237
|
const skillsConfig = createSkillConfigManager(resolveStateDir()).load();
|
|
198
238
|
const resolvedSources = resolveSkillSources(options, skillsConfig);
|
|
199
239
|
const maxSkillFileBytes = resolveMaxSkillFileBytes(skillsConfig);
|
|
200
|
-
const
|
|
201
|
-
const diagnostics = [...resolvedSources.diagnostics];
|
|
202
|
-
for (const source of resolvedSources.sources) {
|
|
203
|
-
const discovered = discoverSkills(source, maxSkillFileBytes);
|
|
204
|
-
diagnostics.push(...discovered.diagnostics);
|
|
205
|
-
for (const skill of discovered.skills) {
|
|
206
|
-
const previous = skillMap.get(skill.name);
|
|
207
|
-
if (previous) {
|
|
208
|
-
const winner = skill.origin.priority > previous.origin.priority ? skill : previous;
|
|
209
|
-
const shadowed = winner === skill ? previous : skill;
|
|
210
|
-
diagnostics.push({
|
|
211
|
-
type: "collision",
|
|
212
|
-
skillName: skill.name,
|
|
213
|
-
path: winner.filePath,
|
|
214
|
-
message: `Skill "${skill.name}" from ${winner.origin.id} (${winner.filePath}) shadows ${shadowed.origin.id} (${shadowed.filePath})`
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
if (!previous || skill.origin.priority > previous.origin.priority) skillMap.set(skill.name, skill);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
const merged = Array.from(skillMap.values());
|
|
240
|
+
const merged = discoverAndMergeSkills(resolvedSources.sources, maxSkillFileBytes, resolvedSources.diagnostics);
|
|
221
241
|
return {
|
|
222
|
-
skills: merged,
|
|
223
|
-
prompt: formatSkillsForPrompt(merged, skillsConfig),
|
|
224
|
-
diagnostics
|
|
242
|
+
skills: merged.skills,
|
|
243
|
+
prompt: formatSkillsForPrompt(merged.skills, skillsConfig),
|
|
244
|
+
diagnostics: merged.diagnostics
|
|
225
245
|
};
|
|
226
246
|
}
|
|
227
|
-
/** Discover
|
|
228
|
-
function
|
|
229
|
-
const
|
|
230
|
-
const
|
|
247
|
+
/** Discover project-owned XOPC and Agents skills with runtime-equivalent trust and precedence. */
|
|
248
|
+
function loadWorkspaceSkillInventory(workspaceDir, options) {
|
|
249
|
+
const skillsConfig = createSkillConfigManager(resolveStateDir()).load();
|
|
250
|
+
const resolved = resolveSkillSources({
|
|
251
|
+
workspaceDir,
|
|
252
|
+
workspaceTrust: options.workspaceTrust
|
|
253
|
+
}, skillsConfig);
|
|
254
|
+
const maxSkillFileBytes = resolveMaxSkillFileBytes(skillsConfig);
|
|
255
|
+
const workspaceSources = resolved.sources.filter((source) => source.id === "xopc-workspace" || source.id === "agents-workspace");
|
|
256
|
+
const discovered = discoverAndMergeSkills(workspaceSources, maxSkillFileBytes, resolved.diagnostics);
|
|
257
|
+
const agentsRoot = resolveWorkspaceAgentsSkillsDir(workspaceDir);
|
|
258
|
+
const agentsDiagnostic = resolved.diagnostics.find((diagnostic) => diagnostic.type === "warning" && diagnostic.message.includes("agents-workspace"));
|
|
259
|
+
const agentsEnabled = skillsConfig.load?.sources?.agentsWorkspace?.enabled !== false;
|
|
260
|
+
const agentsSource = workspaceSources.find((source) => source.id === "agents-workspace");
|
|
231
261
|
return {
|
|
232
|
-
|
|
233
|
-
|
|
262
|
+
entries: discovered.entries,
|
|
263
|
+
sources: [{
|
|
264
|
+
origin: "xopc-workspace",
|
|
265
|
+
rootDir: resolveWorkspaceSkillsDir(workspaceDir),
|
|
266
|
+
managed: true,
|
|
267
|
+
writable: true,
|
|
268
|
+
state: "active"
|
|
269
|
+
}, {
|
|
270
|
+
origin: "agents-workspace",
|
|
271
|
+
rootDir: agentsRoot,
|
|
272
|
+
managed: false,
|
|
273
|
+
writable: false,
|
|
274
|
+
state: !agentsEnabled ? "disabled" : !existsSync(agentsRoot) ? "missing" : agentsSource ? "active" : agentsDiagnostic?.type === "warning" ? "invalid" : "untrusted"
|
|
275
|
+
}],
|
|
234
276
|
diagnostics: discovered.diagnostics
|
|
235
277
|
};
|
|
236
278
|
}
|
|
@@ -288,4 +330,4 @@ function createSkillLoader(options = {}) {
|
|
|
288
330
|
};
|
|
289
331
|
}
|
|
290
332
|
//#endregion
|
|
291
|
-
export { SkillTestFramework, SkillTestRunner, applySkillEnvOverrides, collectSkillInstallWarnings, createSkillConfigManager, createSkillLoader, findInstallSpec, formatScanSummary, formatTestResults, formatTestResultsJson, formatTestResultsTap, getSkillEnvironment, hasBinary, installSkill, isSkillEnabled, loadSkills,
|
|
333
|
+
export { SkillTestFramework, SkillTestRunner, applySkillEnvOverrides, collectSkillInstallWarnings, createSkillConfigManager, createSkillLoader, findInstallSpec, formatScanSummary, formatTestResults, formatTestResultsJson, formatTestResultsTap, getSkillEnvironment, hasBinary, installSkill, isSkillEnabled, loadSkills, loadWorkspaceSkillInventory, resolveSkillConfig, scanSkillDirectory, validateSkillConfig };
|
|
@@ -15,4 +15,3 @@ export interface ResolveSkillSourcesResult {
|
|
|
15
15
|
export declare function resolveSkillSources(options: ResolveSkillSourcesOptions, skillsConfig: SkillsConfig): ResolveSkillSourcesResult;
|
|
16
16
|
export declare function resolveAgentsSkillsDir(env?: NodeJS.ProcessEnv): string;
|
|
17
17
|
export declare function resolveWorkspaceAgentsSkillsDir(workspaceDir: string): string;
|
|
18
|
-
export declare function resolveWorkspaceSkillSource(workspaceDir: string): SkillSourceDescriptor;
|
|
@@ -129,15 +129,5 @@ function resolveAgentsSkillsDir(env = process.env) {
|
|
|
129
129
|
function resolveWorkspaceAgentsSkillsDir(workspaceDir) {
|
|
130
130
|
return join(workspaceDir, ".agents", "skills");
|
|
131
131
|
}
|
|
132
|
-
function resolveWorkspaceSkillSource(workspaceDir) {
|
|
133
|
-
return descriptor({
|
|
134
|
-
id: "xopc-workspace",
|
|
135
|
-
rootDir: resolveWorkspaceSkillsDir(workspaceDir),
|
|
136
|
-
priority: PRIORITY.xopcWorkspace,
|
|
137
|
-
scope: "workspace",
|
|
138
|
-
managed: true,
|
|
139
|
-
writable: true
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
132
|
//#endregion
|
|
143
|
-
export { resolveAgentsSkillsDir, resolveSkillSources, resolveWorkspaceAgentsSkillsDir
|
|
133
|
+
export { resolveAgentsSkillsDir, resolveSkillSources, resolveWorkspaceAgentsSkillsDir };
|
|
@@ -226,7 +226,20 @@ function successResult(locale, payload) {
|
|
|
226
226
|
isPublic: payload.reachability === "public"
|
|
227
227
|
}).filter(Boolean).join("\n")
|
|
228
228
|
}],
|
|
229
|
-
details:
|
|
229
|
+
details: {
|
|
230
|
+
...payload,
|
|
231
|
+
artifacts: [{
|
|
232
|
+
artifactId: `share:${String(payload.shareUrl ?? "")}`,
|
|
233
|
+
title: String(payload.title ?? "Shared result"),
|
|
234
|
+
kind: payload.kind === "site" ? "site" : payload.kind === "zip" ? "archive" : "file",
|
|
235
|
+
availability: "available",
|
|
236
|
+
location: "artifact_store",
|
|
237
|
+
capabilities: payload.kind === "site" ? ["preview", "share"] : ["download", "share"],
|
|
238
|
+
shareUrl: String(payload.shareUrl ?? ""),
|
|
239
|
+
...typeof payload.thumbnailUrl === "string" ? { thumbnailUrl: payload.thumbnailUrl } : {},
|
|
240
|
+
...typeof payload.expiresAt === "string" ? { expiresAt: payload.expiresAt } : {}
|
|
241
|
+
}]
|
|
242
|
+
}
|
|
230
243
|
};
|
|
231
244
|
}
|
|
232
245
|
function errorResult(locale, message) {
|
|
@@ -4,14 +4,14 @@ import { resolve } from "node:path";
|
|
|
4
4
|
import { spawn } from "node:child_process";
|
|
5
5
|
import { Type } from "@sinclair/typebox";
|
|
6
6
|
//#region src/agent/tools/exec-command.ts
|
|
7
|
-
const MAX_COMMAND_TIMEOUT_MS =
|
|
8
|
-
const DEFAULT_TIMEOUT_MS =
|
|
7
|
+
const MAX_COMMAND_TIMEOUT_MS = 14400 * 1e3;
|
|
8
|
+
const DEFAULT_TIMEOUT_MS = 1800 * 1e3;
|
|
9
9
|
const DEFAULT_MAX_OUTPUT_CHARS = 5e4;
|
|
10
10
|
const STREAM_DELTA_MAX_CHARS = 16e3;
|
|
11
11
|
const ExecCommandSchema = Type.Object({
|
|
12
12
|
cmd: Type.String({ description: "Shell command to execute." }),
|
|
13
13
|
cwd: Type.Optional(Type.String({ description: "Working directory. Relative paths are resolved under the agent workspace." })),
|
|
14
|
-
timeoutMs: Type.Optional(Type.Number({ description: "Command timeout in milliseconds. Defaults to
|
|
14
|
+
timeoutMs: Type.Optional(Type.Number({ description: "Command timeout in milliseconds. Defaults to 1800000 (30m) and is capped at 14400000 (4h)." })),
|
|
15
15
|
maxOutputChars: Type.Optional(Type.Number({ description: "Maximum characters returned to the model. UI streaming still receives output deltas." }))
|
|
16
16
|
});
|
|
17
17
|
function clampTimeoutMs(raw) {
|
|
@@ -12,7 +12,7 @@ const MAX_TIMEOUT_SEC = 14400;
|
|
|
12
12
|
const ExecuteCodeSchema = Type.Object({
|
|
13
13
|
code: Type.String({ description: "JavaScript to run. Exposed as `tools` (async functions) and `console`:\n await tools.web_search(query, count?)\n await tools.web_fetch(url, maxChars?)\n await tools.read_file(path, limit?)\n await tools.write_file(path, content)\n await tools.grep(pattern, { path?, glob?, ignoreCase?, literal?, context?, limit? })\n await tools.find(pattern, { path?, limit? })\n await tools.exec_command(cmd, cwd?)\n\nUse console.log() for output; combined stdout/stderr is returned." }),
|
|
14
14
|
timeout: Type.Optional(Type.Number({
|
|
15
|
-
description: "Execution timeout in seconds (default:
|
|
15
|
+
description: "Execution timeout in seconds (default: 1800 = 30m, max: 14400 = 4h)",
|
|
16
16
|
default: DEFAULT_TIMEOUT_SEC
|
|
17
17
|
}))
|
|
18
18
|
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { TimeoutError, executeWithTimeout } from "../lifecycle/timeout-wrapper.js";
|
|
3
|
+
import { DEFAULT_TOOL_EXECUTION_TIMEOUT_MS, TimeoutError, executeWithTimeout } from "../lifecycle/timeout-wrapper.js";
|
|
4
4
|
import { withRetry } from "../../infra/retry.js";
|
|
5
5
|
import { ToolConcurrencyController, resolveToolLockMode } from "./concurrency.js";
|
|
6
6
|
//#region src/agent/tools/executor.ts
|
|
7
7
|
init_logger();
|
|
8
8
|
const log = createLogger("ToolExecutor");
|
|
9
9
|
const DEFAULT_CONFIG = {
|
|
10
|
-
defaultTimeoutMs:
|
|
10
|
+
defaultTimeoutMs: DEFAULT_TOOL_EXECUTION_TIMEOUT_MS,
|
|
11
11
|
maxRetries: 2,
|
|
12
12
|
retryDelayMs: 1e3,
|
|
13
13
|
enableTimeout: true,
|
|
@@ -296,6 +296,18 @@ function createImageGenerateTool(options) {
|
|
|
296
296
|
paths,
|
|
297
297
|
workspaceRelativePaths,
|
|
298
298
|
media,
|
|
299
|
+
artifacts: media.map((item, index) => ({
|
|
300
|
+
artifactId: item.id,
|
|
301
|
+
title: item.name,
|
|
302
|
+
kind: "image",
|
|
303
|
+
mimeType: item.mimeType,
|
|
304
|
+
sizeBytes: item.size,
|
|
305
|
+
availability: "available",
|
|
306
|
+
location: "artifact_store",
|
|
307
|
+
capabilities: ["preview", "download"],
|
|
308
|
+
uri: item.uri,
|
|
309
|
+
workspaceRelativePath: workspaceRelativePaths[index]
|
|
310
|
+
})),
|
|
299
311
|
attempts: result.attempts,
|
|
300
312
|
...result.normalization ? { normalization: result.normalization } : {},
|
|
301
313
|
...result.ignoredOverrides.length > 0 ? { ignoredOverrides: result.ignoredOverrides } : {},
|
|
@@ -64,6 +64,17 @@ function createSendMediaTool(workspace, bus, getContext) {
|
|
|
64
64
|
}],
|
|
65
65
|
details: {
|
|
66
66
|
media: [media],
|
|
67
|
+
artifacts: [{
|
|
68
|
+
artifactId: media.id,
|
|
69
|
+
title: media.name,
|
|
70
|
+
kind: media.type === "photo" ? "image" : media.type === "video" ? "video" : media.type === "audio" ? "audio" : media.mimeType === "application/pdf" ? "pdf" : "file",
|
|
71
|
+
mimeType: media.mimeType,
|
|
72
|
+
sizeBytes: media.size,
|
|
73
|
+
availability: "available",
|
|
74
|
+
location: "artifact_store",
|
|
75
|
+
capabilities: ["preview", "download"],
|
|
76
|
+
uri: media.uri
|
|
77
|
+
}],
|
|
67
78
|
...p.caption ? { caption: p.caption } : {}
|
|
68
79
|
}
|
|
69
80
|
};
|
|
@@ -6,6 +6,7 @@ import { ObjectLinkService } from "../../activity/service.js";
|
|
|
6
6
|
import "../../activity/index.js";
|
|
7
7
|
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
8
8
|
import { TaskRepository } from "../../tasks/task-repository.js";
|
|
9
|
+
import { enqueueTaskChangedEvent } from "../../tasks/task-change-events.js";
|
|
9
10
|
import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
10
11
|
import { TaskReadModelProjector } from "../../tasks/task-read-model-projector.js";
|
|
11
12
|
import { TaskCommandSchema, TaskContextInputSchema } from "../../../packages/gateway-contract/src/tasks.js";
|
|
@@ -15,7 +16,6 @@ import "../../automations/index.js";
|
|
|
15
16
|
import { isValidProjectAgentId, normalizeProjectAgentId, resolveProjectAgentId } from "../../projects/project-agent.js";
|
|
16
17
|
import "../../projects/index.js";
|
|
17
18
|
import { TaskContextRepository } from "../../tasks/task-context-repository.js";
|
|
18
|
-
import { enqueueTaskChangedEvent } from "../../tasks/task-change-events.js";
|
|
19
19
|
import { TaskDependencyError, TaskDependencyService } from "../../tasks/task-dependency-service.js";
|
|
20
20
|
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
21
21
|
import { defineTaskContract } from "../../tasks/task-contract-definition.js";
|