@xopcai/xopc 0.0.137 → 0.0.138
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 +4 -0
- package/README.zh-CN.md +4 -0
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/demo-memory/src/index.js +4 -0
- package/dist/extensions/demo-memory/src/index.js.map +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BVGEvspi.js → agent-avatar-dicebear-CIsGDJzd.js} +1 -1
- package/dist/gateway/static/root/assets/agents-fX97A6iN.js +2 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BmdZifqk.js → app-management-settings-panel-ByM4Bzwm.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CI-Cony7.js → appearance-settings-BF_poRd3.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-8yKgtRah.js → apps-page-BssdA5Qc.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-hMye7wu9.js → archive-plugin-DJaYoyGn.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-qKR5CPYj.js → attachment-load-xx6dBaZU.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-suggestion-card-BrtqTkO2.js → automation-suggestion-card-BMvGqYob.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CTbY1_xq.js → automations-page-Dip8ZFmx.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-DURU6npf.js → binary-plugins-CuPLWibr.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BQIHfg8Q.js → block-editor-bzfvlJnh.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-BTlEo9yH.js → browser-settings-page-lbx_8Dku.js} +4 -4
- package/dist/gateway/static/root/assets/{capability-presets-api-DowJXE85.js → capability-presets-api-X4Imbf8n.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-settings-panel-CUBsiEWT.js → capability-presets-settings-panel-v9JgKjJu.js} +1 -1
- package/dist/gateway/static/root/assets/{channel-recipient-api-BqbZNCJJ.js → channel-recipient-api-DllrPmp-.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-BzPicGm_.js → channels-settings-CED7Oy5Y.js} +1 -1
- package/dist/gateway/static/root/assets/channels-status-swr-EUwWYx8l.js +1 -0
- package/dist/gateway/static/root/assets/{connectors-page-BryXzajG.js → connectors-page-BMfp0jWL.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DxLTNBD2.js → desktop-pet-oTig6qFO.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-D_EgKbEB.js → desktop-pet-settings-DXJiPL_H.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-DmzW9Mwg.js → directory-picker-path-field-CltkXSR2.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-D3DNPePf.js → dreaming-settings-CYrZQxoL.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-hUg0oHQR.js → extension-debug-page-C-4BOy1R.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Bl1aQuV_.js → extension-page-C8nMpXqh.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BghvkAL8.js → extension-settings-page-CXWYOwka.js} +1 -1
- package/dist/gateway/static/root/assets/{fetch-hvbCiP2J.js → fetch-BID89uCH.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-Dk4b3f7r.js → gateway-config-api-B3TGdim5.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-DKNhpqYg.js → gateway-settings-D7tOnGAJ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-BzbrcQLJ.js → gateway-startup-retry-BkrLLlpE.js} +1 -1
- package/dist/gateway/static/root/assets/{goal-create-dialog-Z_oEJXTZ.js → goal-create-dialog-BL_cRshf.js} +1 -1
- package/dist/gateway/static/root/assets/{goal-detail-page-CIFnmZ2W.js → goal-detail-page-T1vg6Ng_.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-config-api-DpQ3Hj8X.js → goals-config-api-D-WZWhP2.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-page-BYWfLxSr.js → goals-page-1vzWXl5W.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-settings-DW6d-W79.js → goals-settings-DgGwvLVC.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-CSGeVzW8.js → heartbeat-settings-yh0bEIwQ.js} +1 -1
- package/dist/gateway/static/root/assets/index-B8s8Pq5U.css +1 -0
- package/dist/gateway/static/root/assets/{index-B-SGXAZ7.js → index-NwiCnzI-.js} +23 -23
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-Bh85DLbN.js → keyboard-shortcuts-settings-CnxRFbgA.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-BYG_JKr5.js → logs-page-DebnvTpD.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-BLOUZPDJ.js → markdown-split-BU69Nof8.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-vlqpbsN0.js → media-plugins-CDs7OvWt.js} +1 -1
- package/dist/gateway/static/root/assets/messages-DbNQuFdA.js +3 -0
- package/dist/gateway/static/root/assets/{models-hub-panel-BihK16QP.js → models-hub-panel-Ca_jy26S.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-DJGOihcg.js → notes-page-DTpeaI65.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-workbench-CtdxRaAk.js → notes-workbench-uKMYsjUU.js} +2 -2
- package/dist/gateway/static/root/assets/{page-tabs-BOKnavua.js → page-tabs-CROo8Vgz.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-07J39ZIq.js → preview-open-alternatives-BxsS9i1G.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-BC26Zx8C.js → project-detail-page-BWKOhshy.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-kQNhzpLr.js → projects-page-CoowiCLe.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-CN1ioJ0X.js → remote-access-hub-CiOaX1wd.js} +1 -1
- package/dist/gateway/static/root/assets/{save-bar-controls-CDGmAkP7.js → save-bar-controls-B4N17dMG.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-7Cvi7W5t.js → schedule-field-ClJzQ2vz.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-xobSdD8a.js → schema-form-oZvQUfDg.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-DEGTTMvU.js → sessions-page-Sx9Gc0cv.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CnbVdze4.js +1 -0
- package/dist/gateway/static/root/assets/{settings-collapsible-section-CnqjZAfV.js → settings-collapsible-section-B0kOLXUf.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-form-section-DRzUUAOA.js → settings-form-section-DoVPlVFd.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-ke39n0bn.js → settings-loading-skeleton-C7J96bLc.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BDP9GD1j.js → settings-page-CXiAByF0.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-CIf2rF-q.js → settings-page-layout-R-6ArlMI.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-CiiWlcKj.js → setup-status-panel-Drz23n9l.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-CwJ2tj2j.js → share-preview-page-Bn1umseg.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-dm7VKGsi.js → shares-settings-Bb-pcMWg.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DE9HCHct.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-Bc0rxqmf.js → skills-page-B6cDPqkk.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-1a3I3zIl.js → system-settings-panel-CtEddAy-.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-C3NCA3Nd.js → typed-models-lib-BkhSnYq7.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-DUOMGhwc.js → use-channel-catalog-EA4hfbsP.js} +1 -1
- package/dist/gateway/static/root/assets/{user-profile-settings-panel-dKptBh4U.js → user-profile-settings-panel-BssTVOBS.js} +1 -1
- package/dist/gateway/static/root/assets/{utils-BqnHAm5O.js → utils-CI3ywKLT.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-D4dtA6k3.js → voice-api-key-field-DXMEGw9O.js} +1 -1
- package/dist/gateway/static/root/assets/{work-item-detail-page-DpUYYeDf.js → work-item-detail-page-DsFqU0tK.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BQ8aBXA1.js → workflow-run-setup-panel-DImBi-m6.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-start-dialog-jHmIHxTR.js → workflow-start-dialog-DuPpKAAc.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-DzjPClwt.js → workflows-page-DfTVzTNY.js} +1 -1
- package/dist/gateway/static/root/index.html +5 -5
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-instance-gateway.d.ts +3 -3
- package/dist/src/agent/agent-manager.d.ts +7 -8
- package/dist/src/agent/agent-manager.js +24 -25
- package/dist/src/agent/agent-manager.js.map +1 -1
- package/dist/src/agent/background-review/coordinator.d.ts +9 -23
- package/dist/src/agent/background-review/coordinator.js +45 -54
- package/dist/src/agent/background-review/coordinator.js.map +1 -1
- package/dist/src/agent/background-review/prompts.d.ts +2 -4
- package/dist/src/agent/background-review/prompts.js +7 -19
- package/dist/src/agent/background-review/prompts.js.map +1 -1
- package/dist/src/agent/background-review/run-background-review.d.ts +0 -8
- package/dist/src/agent/background-review/run-background-review.js +87 -72
- package/dist/src/agent/background-review/run-background-review.js.map +1 -1
- package/dist/src/agent/background-review/settings.d.ts +4 -4
- package/dist/src/agent/background-review/settings.js +25 -10
- package/dist/src/agent/background-review/settings.js.map +1 -1
- package/dist/src/agent/code-intelligence/binary.d.ts +1 -0
- package/dist/src/agent/code-intelligence/binary.js +42 -0
- package/dist/src/agent/code-intelligence/binary.js.map +1 -0
- package/dist/src/agent/code-intelligence/index.d.ts +4 -0
- package/dist/src/agent/code-intelligence/index.js +4 -0
- package/dist/src/agent/code-intelligence/runtime.d.ts +34 -0
- package/dist/src/agent/code-intelligence/runtime.js +282 -0
- package/dist/src/agent/code-intelligence/runtime.js.map +1 -0
- package/dist/src/agent/code-intelligence/tools.d.ts +6 -0
- package/dist/src/agent/code-intelligence/tools.js +268 -0
- package/dist/src/agent/code-intelligence/tools.js.map +1 -0
- package/dist/src/agent/code-intelligence/types.d.ts +22 -0
- package/dist/src/agent/code-intelligence/types.js +1 -0
- package/dist/src/agent/memory/builtin-provider.d.ts +1 -2
- package/dist/src/agent/memory/builtin-provider.js +31 -12
- package/dist/src/agent/memory/builtin-provider.js.map +1 -1
- package/dist/src/agent/memory/context/planner.d.ts +11 -0
- package/dist/src/agent/memory/context/planner.js +163 -0
- package/dist/src/agent/memory/context/planner.js.map +1 -0
- package/dist/src/agent/memory/context/types.d.ts +19 -0
- package/dist/src/agent/memory/context/types.js +1 -0
- package/dist/src/agent/memory/context-fence.d.ts +3 -3
- package/dist/src/agent/memory/context-fence.js +9 -9
- package/dist/src/agent/memory/context-fence.js.map +1 -1
- package/dist/src/agent/memory/index.d.ts +6 -4
- package/dist/src/agent/memory/index.js +5 -5
- package/dist/src/agent/memory/manager.d.ts +16 -4
- package/dist/src/agent/memory/manager.js +32 -34
- package/dist/src/agent/memory/manager.js.map +1 -1
- package/dist/src/agent/memory/memory-config.d.ts +1 -1
- package/dist/src/agent/memory/memory-config.js +2 -2
- package/dist/src/agent/memory/memory-config.js.map +1 -1
- package/dist/src/agent/memory/provider.d.ts +1 -3
- package/dist/src/agent/memory/stub-memory-provider.d.ts +0 -1
- package/dist/src/agent/memory/stub-memory-provider.js +0 -5
- package/dist/src/agent/memory/stub-memory-provider.js.map +1 -1
- package/dist/src/agent/memory/types.d.ts +31 -2
- package/dist/src/agent/memory/understanding/correction.d.ts +3 -0
- package/dist/src/agent/memory/understanding/correction.js +41 -0
- package/dist/src/agent/memory/understanding/correction.js.map +1 -0
- package/dist/src/agent/memory/understanding/quality.d.ts +8 -0
- package/dist/src/agent/memory/understanding/quality.js +20 -0
- package/dist/src/agent/memory/understanding/quality.js.map +1 -0
- package/dist/src/agent/memory/understanding/service.d.ts +26 -0
- package/dist/src/agent/memory/understanding/service.js +233 -0
- package/dist/src/agent/memory/understanding/service.js.map +1 -0
- package/dist/src/agent/memory/understanding/types.d.ts +22 -0
- package/dist/src/agent/memory/understanding/types.js +1 -0
- package/dist/src/agent/memory/user-context-coordinator.d.ts +21 -0
- package/dist/src/agent/memory/user-context-coordinator.js +90 -0
- package/dist/src/agent/memory/user-context-coordinator.js.map +1 -0
- package/dist/src/agent/orchestration/agent-event-handler.d.ts +1 -0
- package/dist/src/agent/orchestration/agent-event-handler.js +1 -1
- package/dist/src/agent/orchestration/agent-event-handler.js.map +1 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js +2 -2
- package/dist/src/agent/orchestration/agent-orchestrator.js.map +1 -1
- package/dist/src/agent/orchestration/index.d.ts +1 -1
- package/dist/src/agent/orchestration/index.js +2 -2
- package/dist/src/agent/prompt/sections/tooling.js +10 -0
- package/dist/src/agent/prompt/sections/tooling.js.map +1 -1
- package/dist/src/agent/prompt/system-prompt.js +2 -0
- package/dist/src/agent/prompt/system-prompt.js.map +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +2 -2
- package/dist/src/agent/service/direct-turn-helpers.js.map +1 -1
- package/dist/src/agent/service.js +7 -1
- package/dist/src/agent/service.js.map +1 -1
- package/dist/src/agent/tools/factory.d.ts +3 -0
- package/dist/src/agent/tools/factory.js +17 -10
- package/dist/src/agent/tools/factory.js.map +1 -1
- package/dist/src/agent/tools/index.d.ts +1 -0
- package/dist/src/agent/tools/index.js +2 -1
- package/dist/src/agent/workspace-runtime/registry.d.ts +2 -0
- package/dist/src/agent/workspace-runtime/registry.js +11 -3
- package/dist/src/agent/workspace-runtime/registry.js.map +1 -1
- package/dist/src/agent-manifest/index.js +2 -2
- package/dist/src/agent-manifest/schema.d.ts +91 -0
- package/dist/src/agent-manifest/schema.js +27 -5
- package/dist/src/agent-manifest/schema.js.map +1 -1
- package/dist/src/agent-runtime/memory-runtime.d.ts +1 -1
- package/dist/src/agent-runtime/memory-runtime.js.map +1 -1
- package/dist/src/automations/domain/validation.d.ts +22 -22
- package/dist/src/automations/draft/automation-draft-validator.d.ts +4 -4
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/schema.d.ts +115 -0
- package/dist/src/config/schema.js +53 -4
- package/dist/src/config/schema.js.map +1 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agent-builtin-tools.js +5 -0
- package/dist/src/gateway/agent-builtin-tools.js.map +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +18 -4
- package/dist/src/gateway/hono/routes/memory.js +129 -4
- package/dist/src/gateway/hono/routes/memory.js.map +1 -1
- package/dist/src/knowledge/index.d.ts +2 -0
- package/dist/src/knowledge/index.js +2 -0
- package/dist/src/knowledge/ingestion-service.d.ts +20 -0
- package/dist/src/knowledge/ingestion-service.js +75 -0
- package/dist/src/knowledge/ingestion-service.js.map +1 -0
- package/dist/src/knowledge/types.d.ts +70 -0
- package/dist/src/knowledge/types.js +1 -0
- package/dist/src/providers/presentation.js +1 -1
- package/dist/src/providers/presentation.js.map +1 -1
- package/dist/src/storage/sqlite/index.d.ts +2 -1
- package/dist/src/storage/sqlite/index.js +3 -2
- package/dist/src/storage/sqlite/knowledge-repository.d.ts +50 -0
- package/dist/src/storage/sqlite/knowledge-repository.js +237 -0
- package/dist/src/storage/sqlite/knowledge-repository.js.map +1 -0
- package/dist/src/storage/sqlite/memory-records-repository.d.ts +80 -2
- package/dist/src/storage/sqlite/memory-records-repository.js +271 -9
- package/dist/src/storage/sqlite/memory-records-repository.js.map +1 -1
- package/dist/src/storage/sqlite/migrations/029_user_understanding.sql +133 -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.js.map +1 -1
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/package.json +2 -1
- package/dist/gateway/static/root/assets/agents-Bmfl5l9o.js +0 -2
- package/dist/gateway/static/root/assets/channels-status-swr-BCkcagDP.js +0 -1
- package/dist/gateway/static/root/assets/index-CPwVzi9x.css +0 -1
- package/dist/gateway/static/root/assets/messages-CD-qhazm.js +0 -3
- package/dist/gateway/static/root/assets/settings-advanced-gate-DgMxVBrX.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-ZzOv59qM.js +0 -1
- package/dist/src/agent/memory/candidate-extractor.d.ts +0 -6
- package/dist/src/agent/memory/candidate-extractor.js +0 -60
- package/dist/src/agent/memory/candidate-extractor.js.map +0 -1
- package/dist/src/agent/memory/context-assembler.d.ts +0 -10
- package/dist/src/agent/memory/context-assembler.js +0 -26
- package/dist/src/agent/memory/context-assembler.js.map +0 -1
- package/dist/src/agent/memory/inject-prefetch.d.ts +0 -6
- package/dist/src/agent/memory/inject-prefetch.js +0 -48
- package/dist/src/agent/memory/inject-prefetch.js.map +0 -1
- package/dist/src/agent/memory/prefetch-coordinator.d.ts +0 -37
- package/dist/src/agent/memory/prefetch-coordinator.js +0 -45
- package/dist/src/agent/memory/prefetch-coordinator.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","names":[],"sources":["../../../../src/agent/workspace-runtime/registry.ts"],"sourcesContent":["/**\n * WorkspaceRuntimeRegistry — lazy per-workspace cache of skill/memory/prompt-builder runtimes.\n *\n * Previously these four collaborators (`SkillManager`, `SystemPromptBuilder`,\n * `BuiltinMemoryStore`, `MemoryManager`) were created inline inside\n * `AgentManager.getWorkspaceRuntime` and cached in a private Map. They live\n * outside `AgentInstance` because multiple session keys may share a workspace\n * (the runtime is keyed by **resolved workspace path**, not session key).\n *\n * Extracted so:\n * - `AgentManager` no longer juggles four sibling caches.\n * - Hot-reload teardown (`clearAll`) lives in one place — there are now no\n * callers that forget to shut down `memoryManager`.\n * - Future per-workspace runtimes (e.g. embedding store, vector cache) plug in\n * through `getOrCreate` without touching `AgentManager`.\n */\n\nimport type { Config } from '../../config/schema.js';\nimport { BuiltinMemoryStore } from '../memory/builtin-memory-store.js';\nimport { createMemoryManagerFromConfig } from '../memory/create-memory-manager.js';\nimport { resolveBuiltinMemoryStoreConfig } from '../memory/memory-config.js';\nimport type { MemoryManager } from '../memory/manager.js';\nimport { SkillManager } from '../skills/skill-manager.js';\nimport { SystemPromptBuilder } from '../prompt/service-prompt-builder.js';\nimport { createLogger } from '../../utils/logger.js';\n\nconst log = createLogger('WorkspaceRuntimeRegistry');\n\nexport interface WorkspaceRuntime {\n skillManager: SkillManager;\n systemPromptBuilder: SystemPromptBuilder;\n builtinMemoryStore: BuiltinMemoryStore;\n memoryManager: MemoryManager;\n}\n\nexport interface WorkspaceRuntimeRegistryOptions {\n /** Effective config snapshot accessor (must always return a value when called). */\n getConfig: () => Config;\n /** Absolute path to the bundled skills directory shared by every workspace. */\n bundledSkillsDir: string;\n /** Called after a runtime is first created for a workspace. */\n onRuntimeCreated?: (resolvedPath: string) => void;\n}\n\nexport class WorkspaceRuntimeRegistry {\n private readonly runtimes = new Map<string, WorkspaceRuntime>();\n private readonly getConfig: () => Config;\n private readonly bundledSkillsDir: string;\n private readonly onRuntimeCreated?: (resolvedPath: string) => void;\n\n constructor(opts: WorkspaceRuntimeRegistryOptions) {\n this.getConfig = opts.getConfig;\n this.bundledSkillsDir = opts.bundledSkillsDir;\n this.onRuntimeCreated = opts.onRuntimeCreated;\n }\n\n /** Lazily construct (and cache) the runtime for a resolved workspace path. */\n getOrCreate(resolvedPath: string): WorkspaceRuntime {\n const existing = this.runtimes.get(resolvedPath);\n if (existing) {\n return existing;\n }\n\n const cfg = this.getConfig();\n const builtinMemoryStore = new BuiltinMemoryStore(\n resolveBuiltinMemoryStoreConfig(resolvedPath, cfg),\n );\n const memoryManager = createMemoryManagerFromConfig(resolvedPath, builtinMemoryStore, cfg);\n const skillManager = new SkillManager(resolvedPath, this.bundledSkillsDir);\n const systemPromptBuilder = new SystemPromptBuilder({\n workspace: resolvedPath,\n config: cfg,\n skillManager,\n });\n\n const rt: WorkspaceRuntime = {\n skillManager,\n systemPromptBuilder,\n builtinMemoryStore,\n memoryManager,\n };\n this.runtimes.set(resolvedPath, rt);\n this.onRuntimeCreated?.(resolvedPath);\n return rt;\n }\n\n /** Iterate every live workspace runtime (used by skill / config hot-reload). */\n values(): IterableIterator<WorkspaceRuntime> {\n return this.runtimes.values();\n }\n\n /** Iterate live workspace runtime entries keyed by resolved workspace path. */\n entries(): IterableIterator<[string, WorkspaceRuntime]> {\n return this.runtimes.entries();\n }\n\n /**\n * Tear down every runtime (shutdown memory providers) and forget the cache.\n * Used by `AgentManager.updateAgentDefaults` and `AgentManager.dispose`.\n */\n async clearAll(): Promise<void> {\n const toShutdown = [...this.runtimes.values()];\n this.runtimes.clear();\n await Promise.allSettled(\n toShutdown.
|
|
1
|
+
{"version":3,"file":"registry.js","names":[],"sources":["../../../../src/agent/workspace-runtime/registry.ts"],"sourcesContent":["/**\n * WorkspaceRuntimeRegistry — lazy per-workspace cache of skill/memory/prompt-builder runtimes.\n *\n * Previously these four collaborators (`SkillManager`, `SystemPromptBuilder`,\n * `BuiltinMemoryStore`, `MemoryManager`) were created inline inside\n * `AgentManager.getWorkspaceRuntime` and cached in a private Map. They live\n * outside `AgentInstance` because multiple session keys may share a workspace\n * (the runtime is keyed by **resolved workspace path**, not session key).\n *\n * Extracted so:\n * - `AgentManager` no longer juggles four sibling caches.\n * - Hot-reload teardown (`clearAll`) lives in one place — there are now no\n * callers that forget to shut down `memoryManager`.\n * - Future per-workspace runtimes (e.g. embedding store, vector cache) plug in\n * through `getOrCreate` without touching `AgentManager`.\n */\n\nimport type { Config } from '../../config/schema.js';\nimport { BuiltinMemoryStore } from '../memory/builtin-memory-store.js';\nimport { createMemoryManagerFromConfig } from '../memory/create-memory-manager.js';\nimport { resolveBuiltinMemoryStoreConfig } from '../memory/memory-config.js';\nimport type { MemoryManager } from '../memory/manager.js';\nimport { SkillManager } from '../skills/skill-manager.js';\nimport { SystemPromptBuilder } from '../prompt/service-prompt-builder.js';\nimport { CodeIntelligenceRuntime } from '../code-intelligence/index.js';\nimport { createLogger } from '../../utils/logger.js';\n\nconst log = createLogger('WorkspaceRuntimeRegistry');\n\nexport interface WorkspaceRuntime {\n skillManager: SkillManager;\n systemPromptBuilder: SystemPromptBuilder;\n builtinMemoryStore: BuiltinMemoryStore;\n memoryManager: MemoryManager;\n codeIntelligence: CodeIntelligenceRuntime;\n}\n\nexport interface WorkspaceRuntimeRegistryOptions {\n /** Effective config snapshot accessor (must always return a value when called). */\n getConfig: () => Config;\n /** Absolute path to the bundled skills directory shared by every workspace. */\n bundledSkillsDir: string;\n /** Called after a runtime is first created for a workspace. */\n onRuntimeCreated?: (resolvedPath: string) => void;\n}\n\nexport class WorkspaceRuntimeRegistry {\n private readonly runtimes = new Map<string, WorkspaceRuntime>();\n private readonly getConfig: () => Config;\n private readonly bundledSkillsDir: string;\n private readonly onRuntimeCreated?: (resolvedPath: string) => void;\n\n constructor(opts: WorkspaceRuntimeRegistryOptions) {\n this.getConfig = opts.getConfig;\n this.bundledSkillsDir = opts.bundledSkillsDir;\n this.onRuntimeCreated = opts.onRuntimeCreated;\n }\n\n /** Lazily construct (and cache) the runtime for a resolved workspace path. */\n getOrCreate(resolvedPath: string): WorkspaceRuntime {\n const existing = this.runtimes.get(resolvedPath);\n if (existing) {\n return existing;\n }\n\n const cfg = this.getConfig();\n const builtinMemoryStore = new BuiltinMemoryStore(\n resolveBuiltinMemoryStoreConfig(resolvedPath, cfg),\n );\n const memoryManager = createMemoryManagerFromConfig(resolvedPath, builtinMemoryStore, cfg);\n const skillManager = new SkillManager(resolvedPath, this.bundledSkillsDir);\n const systemPromptBuilder = new SystemPromptBuilder({\n workspace: resolvedPath,\n config: cfg,\n skillManager,\n });\n const codeIntelligence = new CodeIntelligenceRuntime({\n workspace: resolvedPath,\n getConfig: this.getConfig,\n });\n\n const rt: WorkspaceRuntime = {\n skillManager,\n systemPromptBuilder,\n builtinMemoryStore,\n memoryManager,\n codeIntelligence,\n };\n this.runtimes.set(resolvedPath, rt);\n this.onRuntimeCreated?.(resolvedPath);\n return rt;\n }\n\n /** Iterate every live workspace runtime (used by skill / config hot-reload). */\n values(): IterableIterator<WorkspaceRuntime> {\n return this.runtimes.values();\n }\n\n /** Iterate live workspace runtime entries keyed by resolved workspace path. */\n entries(): IterableIterator<[string, WorkspaceRuntime]> {\n return this.runtimes.entries();\n }\n\n /**\n * Tear down every runtime (shutdown memory providers) and forget the cache.\n * Used by `AgentManager.updateAgentDefaults` and `AgentManager.dispose`.\n */\n async clearAll(): Promise<void> {\n const toShutdown = [...this.runtimes.values()];\n this.runtimes.clear();\n await Promise.allSettled(\n toShutdown.flatMap((rt) => [\n rt.memoryManager.shutdownAll().catch((err) => {\n log.warn({ err }, 'memoryManager.shutdownAll failed');\n }),\n rt.codeIntelligence.dispose().catch((err) => {\n log.warn({ err }, 'codeIntelligence.dispose failed');\n }),\n ]),\n );\n }\n}\n"],"mappings":";;;;;;;;;;aAyBqD;AAErD,MAAM,MAAM,aAAa,2BAA2B;AAmBpD,IAAa,2BAAb,MAAsC;CACpC,2BAA4B,IAAI,KAA+B;CAC/D;CACA;CACA;CAEA,YAAY,MAAuC;AACjD,OAAK,YAAY,KAAK;AACtB,OAAK,mBAAmB,KAAK;AAC7B,OAAK,mBAAmB,KAAK;;;CAI/B,YAAY,cAAwC;EAClD,MAAM,WAAW,KAAK,SAAS,IAAI,aAAa;AAChD,MAAI,SACF,QAAO;EAGT,MAAM,MAAM,KAAK,WAAW;EAC5B,MAAM,qBAAqB,IAAI,mBAC7B,gCAAgC,cAAc,IAAI,CACnD;EACD,MAAM,gBAAgB,8BAA8B,cAAc,oBAAoB,IAAI;EAC1F,MAAM,eAAe,IAAI,aAAa,cAAc,KAAK,iBAAiB;EAW1E,MAAM,KAAuB;GAC3B;GACA,qBAAA,IAZ8B,oBAAoB;IAClD,WAAW;IACX,QAAQ;IACR;IACD,CAQoB;GACnB;GACA;GACA,kBAAA,IAV2B,wBAAwB;IACnD,WAAW;IACX,WAAW,KAAK;IACjB,CAOiB;GACjB;AACD,OAAK,SAAS,IAAI,cAAc,GAAG;AACnC,OAAK,mBAAmB,aAAa;AACrC,SAAO;;;CAIT,SAA6C;AAC3C,SAAO,KAAK,SAAS,QAAQ;;;CAI/B,UAAwD;AACtD,SAAO,KAAK,SAAS,SAAS;;;;;;CAOhC,MAAM,WAA0B;EAC9B,MAAM,aAAa,CAAC,GAAG,KAAK,SAAS,QAAQ,CAAC;AAC9C,OAAK,SAAS,OAAO;AACrB,QAAM,QAAQ,WACZ,WAAW,SAAS,OAAO,CACzB,GAAG,cAAc,aAAa,CAAC,OAAO,QAAQ;AAC5C,OAAI,KAAK,EAAE,KAAK,EAAE,mCAAmC;IACrD,EACF,GAAG,iBAAiB,SAAS,CAAC,OAAO,QAAQ;AAC3C,OAAI,KAAK,EAAE,KAAK,EAAE,kCAAkC;IACpD,CACH,CAAC,CACH"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AgentConfigEntrySchema, AgentIdentitySchema, AgentManifestSchema, AgentResponsibilitiesSchema, AgentToolModelSchema, BoundaryPolicySchema, CapabilityPresetSchema, DEFAULT_CAPABILITY_PRESET_ID, DreamingDeepPolicySchema, DreamingLightPolicySchema, DreamingPhasePolicySchema, DreamingPolicySchema, DreamingRemPolicySchema, ManifestModelRoleSchema, MemoryPolicySchema, ModelPolicyPatchSchema, ModelPolicySchema, PromptPolicySchema, RuntimePolicySchema, SkillPolicySchema, ToolModeSchema, ToolPolicySchema, ToolPolicySetSchema, ToolScopeSchema, WorkflowPolicySchema, WorkspacePolicySchema, init_schema } from "./schema.js";
|
|
1
|
+
import { AgentConfigEntrySchema, AgentIdentitySchema, AgentManifestSchema, AgentResponsibilitiesSchema, AgentToolModelSchema, BoundaryPolicySchema, CapabilityPresetSchema, DEFAULT_CAPABILITY_PRESET_ID, DreamingDeepPolicySchema, DreamingLightPolicySchema, DreamingPhasePolicySchema, DreamingPolicySchema, DreamingRemPolicySchema, ManifestModelRoleSchema, MemoryPolicySchema, ModelPolicyPatchSchema, ModelPolicySchema, PromptPolicySchema, RuntimePolicySchema, SkillPolicySchema, ToolModeSchema, ToolPolicySchema, ToolPolicySetSchema, ToolScopeSchema, UserUnderstandingPolicySchema, WorkflowPolicySchema, WorkspacePolicySchema, init_schema } from "./schema.js";
|
|
2
2
|
import { getManifestSource, resolveEffectiveAgentManifest } from "./resolver.js";
|
|
3
3
|
import { validateAgentManifest } from "./validator.js";
|
|
4
4
|
import { buildAgentManifestPromptSection } from "./prompt.js";
|
|
5
5
|
//#region src/agent-manifest/index.ts
|
|
6
6
|
init_schema();
|
|
7
7
|
//#endregion
|
|
8
|
-
export { AgentConfigEntrySchema, AgentIdentitySchema, AgentManifestSchema, AgentResponsibilitiesSchema, AgentToolModelSchema, BoundaryPolicySchema, CapabilityPresetSchema, DEFAULT_CAPABILITY_PRESET_ID, DreamingDeepPolicySchema, DreamingLightPolicySchema, DreamingPhasePolicySchema, DreamingPolicySchema, DreamingRemPolicySchema, ManifestModelRoleSchema, MemoryPolicySchema, ModelPolicyPatchSchema, ModelPolicySchema, PromptPolicySchema, RuntimePolicySchema, SkillPolicySchema, ToolModeSchema, ToolPolicySchema, ToolPolicySetSchema, ToolScopeSchema, WorkflowPolicySchema, WorkspacePolicySchema, buildAgentManifestPromptSection, getManifestSource, resolveEffectiveAgentManifest, validateAgentManifest };
|
|
8
|
+
export { AgentConfigEntrySchema, AgentIdentitySchema, AgentManifestSchema, AgentResponsibilitiesSchema, AgentToolModelSchema, BoundaryPolicySchema, CapabilityPresetSchema, DEFAULT_CAPABILITY_PRESET_ID, DreamingDeepPolicySchema, DreamingLightPolicySchema, DreamingPhasePolicySchema, DreamingPolicySchema, DreamingRemPolicySchema, ManifestModelRoleSchema, MemoryPolicySchema, ModelPolicyPatchSchema, ModelPolicySchema, PromptPolicySchema, RuntimePolicySchema, SkillPolicySchema, ToolModeSchema, ToolPolicySchema, ToolPolicySetSchema, ToolScopeSchema, UserUnderstandingPolicySchema, WorkflowPolicySchema, WorkspacePolicySchema, buildAgentManifestPromptSection, getManifestSource, resolveEffectiveAgentManifest, validateAgentManifest };
|
|
9
9
|
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -214,6 +214,13 @@ export declare const DreamingPolicySchema: z.ZodOptional<z.ZodObject<{
|
|
|
214
214
|
}, z.core.$strict>>;
|
|
215
215
|
}, z.core.$strict>>;
|
|
216
216
|
}, z.core.$strict>>;
|
|
217
|
+
export declare const UserUnderstandingPolicySchema: z.ZodObject<{
|
|
218
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
219
|
+
adaptiveCadence: z.ZodOptional<z.ZodBoolean>;
|
|
220
|
+
reviewIntervalTurns: z.ZodOptional<z.ZodNumber>;
|
|
221
|
+
maxHistoryMessages: z.ZodOptional<z.ZodNumber>;
|
|
222
|
+
maxDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
223
|
+
}, z.core.$strict>;
|
|
217
224
|
export declare const MemoryPolicySchema: z.ZodDefault<z.ZodObject<{
|
|
218
225
|
mode: z.ZodDefault<z.ZodEnum<{
|
|
219
226
|
off: "off";
|
|
@@ -227,6 +234,7 @@ export declare const MemoryPolicySchema: z.ZodDefault<z.ZodObject<{
|
|
|
227
234
|
userProfile: "userProfile";
|
|
228
235
|
agentProfile: "agentProfile";
|
|
229
236
|
curated: "curated";
|
|
237
|
+
connectedSources: "connectedSources";
|
|
230
238
|
}>>>;
|
|
231
239
|
writePolicy: z.ZodOptional<z.ZodObject<{
|
|
232
240
|
userProfile: z.ZodOptional<z.ZodEnum<{
|
|
@@ -286,11 +294,24 @@ export declare const MemoryPolicySchema: z.ZodDefault<z.ZodObject<{
|
|
|
286
294
|
allowedProviderIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
287
295
|
autoWriteKinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
288
296
|
user_profile: "user_profile";
|
|
297
|
+
preference: "preference";
|
|
298
|
+
boundary: "boundary";
|
|
299
|
+
relationship: "relationship";
|
|
300
|
+
project_context: "project_context";
|
|
301
|
+
commitment: "commitment";
|
|
302
|
+
routine: "routine";
|
|
303
|
+
personal_logistics: "personal_logistics";
|
|
304
|
+
open_question: "open_question";
|
|
305
|
+
milestone: "milestone";
|
|
306
|
+
current_state: "current_state";
|
|
289
307
|
agent_note: "agent_note";
|
|
290
308
|
workspace_fact: "workspace_fact";
|
|
291
309
|
daily_note: "daily_note";
|
|
292
310
|
session_summary: "session_summary";
|
|
293
311
|
derived_insight: "derived_insight";
|
|
312
|
+
task_lesson: "task_lesson";
|
|
313
|
+
tool_preference: "tool_preference";
|
|
314
|
+
long_term_goal: "long_term_goal";
|
|
294
315
|
}>>>;
|
|
295
316
|
}, z.core.$strict>>;
|
|
296
317
|
dreaming: z.ZodOptional<z.ZodObject<{
|
|
@@ -324,6 +345,13 @@ export declare const MemoryPolicySchema: z.ZodDefault<z.ZodObject<{
|
|
|
324
345
|
}, z.core.$strict>>;
|
|
325
346
|
}, z.core.$strict>>;
|
|
326
347
|
}, z.core.$strict>>;
|
|
348
|
+
understanding: z.ZodOptional<z.ZodObject<{
|
|
349
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
350
|
+
adaptiveCadence: z.ZodOptional<z.ZodBoolean>;
|
|
351
|
+
reviewIntervalTurns: z.ZodOptional<z.ZodNumber>;
|
|
352
|
+
maxHistoryMessages: z.ZodOptional<z.ZodNumber>;
|
|
353
|
+
maxDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
354
|
+
}, z.core.$strict>>;
|
|
327
355
|
}, z.core.$strict>>;
|
|
328
356
|
export declare const WorkflowPolicySchema: z.ZodDefault<z.ZodObject<{
|
|
329
357
|
default: z.ZodOptional<z.ZodString>;
|
|
@@ -485,6 +513,7 @@ export declare const AgentManifestSchema: z.ZodObject<{
|
|
|
485
513
|
userProfile: "userProfile";
|
|
486
514
|
agentProfile: "agentProfile";
|
|
487
515
|
curated: "curated";
|
|
516
|
+
connectedSources: "connectedSources";
|
|
488
517
|
}>>>;
|
|
489
518
|
writePolicy: z.ZodOptional<z.ZodObject<{
|
|
490
519
|
userProfile: z.ZodOptional<z.ZodEnum<{
|
|
@@ -544,11 +573,24 @@ export declare const AgentManifestSchema: z.ZodObject<{
|
|
|
544
573
|
allowedProviderIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
545
574
|
autoWriteKinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
546
575
|
user_profile: "user_profile";
|
|
576
|
+
preference: "preference";
|
|
577
|
+
boundary: "boundary";
|
|
578
|
+
relationship: "relationship";
|
|
579
|
+
project_context: "project_context";
|
|
580
|
+
commitment: "commitment";
|
|
581
|
+
routine: "routine";
|
|
582
|
+
personal_logistics: "personal_logistics";
|
|
583
|
+
open_question: "open_question";
|
|
584
|
+
milestone: "milestone";
|
|
585
|
+
current_state: "current_state";
|
|
547
586
|
agent_note: "agent_note";
|
|
548
587
|
workspace_fact: "workspace_fact";
|
|
549
588
|
daily_note: "daily_note";
|
|
550
589
|
session_summary: "session_summary";
|
|
551
590
|
derived_insight: "derived_insight";
|
|
591
|
+
task_lesson: "task_lesson";
|
|
592
|
+
tool_preference: "tool_preference";
|
|
593
|
+
long_term_goal: "long_term_goal";
|
|
552
594
|
}>>>;
|
|
553
595
|
}, z.core.$strict>>;
|
|
554
596
|
dreaming: z.ZodOptional<z.ZodObject<{
|
|
@@ -582,6 +624,13 @@ export declare const AgentManifestSchema: z.ZodObject<{
|
|
|
582
624
|
}, z.core.$strict>>;
|
|
583
625
|
}, z.core.$strict>>;
|
|
584
626
|
}, z.core.$strict>>;
|
|
627
|
+
understanding: z.ZodOptional<z.ZodObject<{
|
|
628
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
629
|
+
adaptiveCadence: z.ZodOptional<z.ZodBoolean>;
|
|
630
|
+
reviewIntervalTurns: z.ZodOptional<z.ZodNumber>;
|
|
631
|
+
maxHistoryMessages: z.ZodOptional<z.ZodNumber>;
|
|
632
|
+
maxDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
633
|
+
}, z.core.$strict>>;
|
|
585
634
|
}, z.core.$strict>>;
|
|
586
635
|
workflows: z.ZodDefault<z.ZodObject<{
|
|
587
636
|
default: z.ZodOptional<z.ZodString>;
|
|
@@ -700,6 +749,7 @@ export declare const AgentConfigEntrySchema: z.ZodObject<{
|
|
|
700
749
|
userProfile: "userProfile";
|
|
701
750
|
agentProfile: "agentProfile";
|
|
702
751
|
curated: "curated";
|
|
752
|
+
connectedSources: "connectedSources";
|
|
703
753
|
}>>>;
|
|
704
754
|
writePolicy: z.ZodOptional<z.ZodObject<{
|
|
705
755
|
userProfile: z.ZodOptional<z.ZodEnum<{
|
|
@@ -759,11 +809,24 @@ export declare const AgentConfigEntrySchema: z.ZodObject<{
|
|
|
759
809
|
allowedProviderIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
760
810
|
autoWriteKinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
761
811
|
user_profile: "user_profile";
|
|
812
|
+
preference: "preference";
|
|
813
|
+
boundary: "boundary";
|
|
814
|
+
relationship: "relationship";
|
|
815
|
+
project_context: "project_context";
|
|
816
|
+
commitment: "commitment";
|
|
817
|
+
routine: "routine";
|
|
818
|
+
personal_logistics: "personal_logistics";
|
|
819
|
+
open_question: "open_question";
|
|
820
|
+
milestone: "milestone";
|
|
821
|
+
current_state: "current_state";
|
|
762
822
|
agent_note: "agent_note";
|
|
763
823
|
workspace_fact: "workspace_fact";
|
|
764
824
|
daily_note: "daily_note";
|
|
765
825
|
session_summary: "session_summary";
|
|
766
826
|
derived_insight: "derived_insight";
|
|
827
|
+
task_lesson: "task_lesson";
|
|
828
|
+
tool_preference: "tool_preference";
|
|
829
|
+
long_term_goal: "long_term_goal";
|
|
767
830
|
}>>>;
|
|
768
831
|
}, z.core.$strict>>;
|
|
769
832
|
dreaming: z.ZodOptional<z.ZodObject<{
|
|
@@ -797,6 +860,13 @@ export declare const AgentConfigEntrySchema: z.ZodObject<{
|
|
|
797
860
|
}, z.core.$strict>>;
|
|
798
861
|
}, z.core.$strict>>;
|
|
799
862
|
}, z.core.$strict>>;
|
|
863
|
+
understanding: z.ZodOptional<z.ZodObject<{
|
|
864
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
865
|
+
adaptiveCadence: z.ZodOptional<z.ZodBoolean>;
|
|
866
|
+
reviewIntervalTurns: z.ZodOptional<z.ZodNumber>;
|
|
867
|
+
maxHistoryMessages: z.ZodOptional<z.ZodNumber>;
|
|
868
|
+
maxDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
869
|
+
}, z.core.$strict>>;
|
|
800
870
|
}, z.core.$strict>>;
|
|
801
871
|
workflows: z.ZodDefault<z.ZodObject<{
|
|
802
872
|
default: z.ZodOptional<z.ZodString>;
|
|
@@ -957,6 +1027,7 @@ export declare const CapabilityPresetSchema: z.ZodObject<{
|
|
|
957
1027
|
userProfile: "userProfile";
|
|
958
1028
|
agentProfile: "agentProfile";
|
|
959
1029
|
curated: "curated";
|
|
1030
|
+
connectedSources: "connectedSources";
|
|
960
1031
|
}>>>;
|
|
961
1032
|
writePolicy: z.ZodOptional<z.ZodObject<{
|
|
962
1033
|
userProfile: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1016,11 +1087,24 @@ export declare const CapabilityPresetSchema: z.ZodObject<{
|
|
|
1016
1087
|
allowedProviderIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1017
1088
|
autoWriteKinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1018
1089
|
user_profile: "user_profile";
|
|
1090
|
+
preference: "preference";
|
|
1091
|
+
boundary: "boundary";
|
|
1092
|
+
relationship: "relationship";
|
|
1093
|
+
project_context: "project_context";
|
|
1094
|
+
commitment: "commitment";
|
|
1095
|
+
routine: "routine";
|
|
1096
|
+
personal_logistics: "personal_logistics";
|
|
1097
|
+
open_question: "open_question";
|
|
1098
|
+
milestone: "milestone";
|
|
1099
|
+
current_state: "current_state";
|
|
1019
1100
|
agent_note: "agent_note";
|
|
1020
1101
|
workspace_fact: "workspace_fact";
|
|
1021
1102
|
daily_note: "daily_note";
|
|
1022
1103
|
session_summary: "session_summary";
|
|
1023
1104
|
derived_insight: "derived_insight";
|
|
1105
|
+
task_lesson: "task_lesson";
|
|
1106
|
+
tool_preference: "tool_preference";
|
|
1107
|
+
long_term_goal: "long_term_goal";
|
|
1024
1108
|
}>>>;
|
|
1025
1109
|
}, z.core.$strict>>;
|
|
1026
1110
|
dreaming: z.ZodOptional<z.ZodObject<{
|
|
@@ -1054,6 +1138,13 @@ export declare const CapabilityPresetSchema: z.ZodObject<{
|
|
|
1054
1138
|
}, z.core.$strict>>;
|
|
1055
1139
|
}, z.core.$strict>>;
|
|
1056
1140
|
}, z.core.$strict>>;
|
|
1141
|
+
understanding: z.ZodOptional<z.ZodObject<{
|
|
1142
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1143
|
+
adaptiveCadence: z.ZodOptional<z.ZodBoolean>;
|
|
1144
|
+
reviewIntervalTurns: z.ZodOptional<z.ZodNumber>;
|
|
1145
|
+
maxHistoryMessages: z.ZodOptional<z.ZodNumber>;
|
|
1146
|
+
maxDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
1147
|
+
}, z.core.$strict>>;
|
|
1057
1148
|
}, z.core.$strict>>>;
|
|
1058
1149
|
workflows: z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
1059
1150
|
default: z.ZodOptional<z.ZodString>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/agent-manifest/schema.ts
|
|
4
|
-
var IdSchema, DEFAULT_CAPABILITY_PRESET_ID, ManifestModelRoleSchema, AgentToolModelSchema, ModelPolicySchema, ModelPolicyPatchSchema, ToolModeSchema, ToolScopeSchema, ToolPolicySchema, ToolPolicySetSchema, SkillPolicySchema, DreamingPhasePolicySchema, DreamingLightPolicySchema, DreamingDeepPolicySchema, DreamingRemPolicySchema, DreamingPolicySchema, MemoryPolicySchema, WorkflowPolicySchema, BoundaryPolicySchema, WorkspacePolicySchema, RuntimePolicySchema, PromptPolicySchema, AgentIdentitySchema, AgentResponsibilitiesSchema, AgentManifestSchema, AgentConfigEntrySchema, CapabilityPresetSchema;
|
|
4
|
+
var IdSchema, DEFAULT_CAPABILITY_PRESET_ID, ManifestModelRoleSchema, AgentToolModelSchema, ModelPolicySchema, ModelPolicyPatchSchema, ToolModeSchema, ToolScopeSchema, ToolPolicySchema, ToolPolicySetSchema, SkillPolicySchema, DreamingPhasePolicySchema, DreamingLightPolicySchema, DreamingDeepPolicySchema, DreamingRemPolicySchema, DreamingPolicySchema, UserUnderstandingPolicySchema, MemoryPolicySchema, WorkflowPolicySchema, BoundaryPolicySchema, WorkspacePolicySchema, RuntimePolicySchema, PromptPolicySchema, AgentIdentitySchema, AgentResponsibilitiesSchema, AgentManifestSchema, AgentConfigEntrySchema, CapabilityPresetSchema;
|
|
5
5
|
var init_schema = __esmMin((() => {
|
|
6
6
|
IdSchema = z.string().regex(/^[a-z][a-z0-9_-]{0,63}$/);
|
|
7
7
|
DEFAULT_CAPABILITY_PRESET_ID = "default";
|
|
@@ -143,6 +143,13 @@ var init_schema = __esmMin((() => {
|
|
|
143
143
|
rem: DreamingRemPolicySchema.optional()
|
|
144
144
|
}).strict().optional()
|
|
145
145
|
}).strict().optional();
|
|
146
|
+
UserUnderstandingPolicySchema = z.object({
|
|
147
|
+
enabled: z.boolean().optional(),
|
|
148
|
+
adaptiveCadence: z.boolean().optional(),
|
|
149
|
+
reviewIntervalTurns: z.number().int().min(1).max(1e3).optional(),
|
|
150
|
+
maxHistoryMessages: z.number().int().min(1).max(200).optional(),
|
|
151
|
+
maxDurationMs: z.number().int().min(1e3).max(6e5).optional()
|
|
152
|
+
}).strict();
|
|
146
153
|
MemoryPolicySchema = z.object({
|
|
147
154
|
mode: z.enum([
|
|
148
155
|
"off",
|
|
@@ -155,7 +162,8 @@ var init_schema = __esmMin((() => {
|
|
|
155
162
|
"userProfile",
|
|
156
163
|
"agentProfile",
|
|
157
164
|
"curated",
|
|
158
|
-
"workspace"
|
|
165
|
+
"workspace",
|
|
166
|
+
"connectedSources"
|
|
159
167
|
])).default(["session"]),
|
|
160
168
|
writePolicy: z.object({
|
|
161
169
|
userProfile: z.enum([
|
|
@@ -215,14 +223,28 @@ var init_schema = __esmMin((() => {
|
|
|
215
223
|
allowedProviderIds: z.array(z.string().min(1)).optional(),
|
|
216
224
|
autoWriteKinds: z.array(z.enum([
|
|
217
225
|
"user_profile",
|
|
226
|
+
"preference",
|
|
227
|
+
"boundary",
|
|
228
|
+
"relationship",
|
|
229
|
+
"project_context",
|
|
230
|
+
"commitment",
|
|
231
|
+
"routine",
|
|
232
|
+
"personal_logistics",
|
|
233
|
+
"open_question",
|
|
234
|
+
"milestone",
|
|
235
|
+
"current_state",
|
|
218
236
|
"agent_note",
|
|
219
237
|
"workspace_fact",
|
|
220
238
|
"daily_note",
|
|
221
239
|
"session_summary",
|
|
222
|
-
"derived_insight"
|
|
240
|
+
"derived_insight",
|
|
241
|
+
"task_lesson",
|
|
242
|
+
"tool_preference",
|
|
243
|
+
"long_term_goal"
|
|
223
244
|
])).optional()
|
|
224
245
|
}).strict().optional(),
|
|
225
|
-
dreaming: DreamingPolicySchema
|
|
246
|
+
dreaming: DreamingPolicySchema,
|
|
247
|
+
understanding: UserUnderstandingPolicySchema.optional()
|
|
226
248
|
}).strict().default({
|
|
227
249
|
mode: "off",
|
|
228
250
|
sources: ["session"]
|
|
@@ -299,6 +321,6 @@ var init_schema = __esmMin((() => {
|
|
|
299
321
|
}));
|
|
300
322
|
//#endregion
|
|
301
323
|
init_schema();
|
|
302
|
-
export { AgentConfigEntrySchema, AgentIdentitySchema, AgentManifestSchema, AgentResponsibilitiesSchema, AgentToolModelSchema, BoundaryPolicySchema, CapabilityPresetSchema, DEFAULT_CAPABILITY_PRESET_ID, DreamingDeepPolicySchema, DreamingLightPolicySchema, DreamingPhasePolicySchema, DreamingPolicySchema, DreamingRemPolicySchema, ManifestModelRoleSchema, MemoryPolicySchema, ModelPolicyPatchSchema, ModelPolicySchema, PromptPolicySchema, RuntimePolicySchema, SkillPolicySchema, ToolModeSchema, ToolPolicySchema, ToolPolicySetSchema, ToolScopeSchema, WorkflowPolicySchema, WorkspacePolicySchema, init_schema };
|
|
324
|
+
export { AgentConfigEntrySchema, AgentIdentitySchema, AgentManifestSchema, AgentResponsibilitiesSchema, AgentToolModelSchema, BoundaryPolicySchema, CapabilityPresetSchema, DEFAULT_CAPABILITY_PRESET_ID, DreamingDeepPolicySchema, DreamingLightPolicySchema, DreamingPhasePolicySchema, DreamingPolicySchema, DreamingRemPolicySchema, ManifestModelRoleSchema, MemoryPolicySchema, ModelPolicyPatchSchema, ModelPolicySchema, PromptPolicySchema, RuntimePolicySchema, SkillPolicySchema, ToolModeSchema, ToolPolicySchema, ToolPolicySetSchema, ToolScopeSchema, UserUnderstandingPolicySchema, WorkflowPolicySchema, WorkspacePolicySchema, init_schema };
|
|
303
325
|
|
|
304
326
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","names":[],"sources":["../../../src/agent-manifest/schema.ts"],"sourcesContent":["import { z } from 'zod';\n\nconst IdSchema = z.string().regex(/^[a-z][a-z0-9_-]{0,63}$/);\n\nexport const DEFAULT_CAPABILITY_PRESET_ID = 'default';\n\nexport const ManifestModelRoleSchema = z\n .object({\n model: z.string().min(1),\n fallbacks: z.array(z.string().min(1)).optional(),\n description: z.string().max(500).optional(),\n })\n .strict()\n .superRefine((entry, ctx) => {\n const validateRef = (ref: string) => {\n const trimmed = ref.trim();\n const idx = trimmed.indexOf('/');\n return idx > 0 && idx < trimmed.length - 1;\n };\n if (!validateRef(entry.model)) {\n ctx.addIssue({\n code: 'custom',\n message: `model must be provider/model format (got '${entry.model}')`,\n path: ['model'],\n });\n }\n for (const [index, fallback] of (entry.fallbacks ?? []).entries()) {\n if (!validateRef(fallback)) {\n ctx.addIssue({\n code: 'custom',\n message: `fallback must be provider/model format (got '${fallback}')`,\n path: ['fallbacks', index],\n });\n }\n }\n });\n\nexport const AgentToolModelSchema = z\n .object({\n primary: z.string().min(1),\n fallbacks: z.array(z.string().min(1)).optional(),\n timeoutMs: z.number().int().positive().optional(),\n autoProviderFallback: z.boolean().optional(),\n })\n .strict()\n .superRefine((entry, ctx) => {\n const validateRef = (ref: string) => {\n const trimmed = ref.trim();\n const idx = trimmed.indexOf('/');\n return idx > 0 && idx < trimmed.length - 1;\n };\n if (!validateRef(entry.primary)) {\n ctx.addIssue({\n code: 'custom',\n message: `primary must be provider/model format (got '${entry.primary}')`,\n path: ['primary'],\n });\n }\n for (const [index, fallback] of (entry.fallbacks ?? []).entries()) {\n if (!validateRef(fallback)) {\n ctx.addIssue({\n code: 'custom',\n message: `fallback must be provider/model format (got '${fallback}')`,\n path: ['fallbacks', index],\n });\n }\n }\n });\n\nexport const ModelPolicySchema = z\n .object({\n defaultRole: IdSchema,\n roles: z.record(IdSchema, ManifestModelRoleSchema).default({}),\n imageModel: AgentToolModelSchema.optional(),\n imageGenerationModel: AgentToolModelSchema.optional(),\n policy: z\n .object({\n allowFallbacks: z.boolean().optional(),\n maxCostTier: z.enum(['low', 'medium', 'high']).optional(),\n })\n .strict()\n .optional(),\n })\n .strict();\n\nexport const ModelPolicyPatchSchema = z\n .object({\n defaultRole: IdSchema.optional(),\n roles: z.record(IdSchema, ManifestModelRoleSchema).optional(),\n imageModel: AgentToolModelSchema.optional(),\n imageGenerationModel: AgentToolModelSchema.optional(),\n policy: z\n .object({\n allowFallbacks: z.boolean().optional(),\n maxCostTier: z.enum(['low', 'medium', 'high']).optional(),\n })\n .strict()\n .optional(),\n })\n .strict();\n\nexport const ToolModeSchema = z.enum(['allow', 'confirm', 'deny']);\nexport const ToolScopeSchema = z.enum(['readonly', 'workspace', 'unrestricted']);\n\nexport const ToolPolicySchema = z\n .object({\n mode: ToolModeSchema,\n scope: ToolScopeSchema.optional(),\n limits: z\n .object({\n maxCallsPerTurn: z.number().int().positive().optional(),\n timeoutMs: z.number().int().positive().optional(),\n })\n .strict()\n .optional(),\n })\n .strict();\n\nexport const ToolPolicySetSchema = z\n .object({\n builtin: z.record(z.string().min(1), ToolPolicySchema).default({}),\n mcp: z\n .object({\n servers: z.record(z.string().min(1), ToolPolicySchema).optional(),\n tools: z.record(z.string().min(1), ToolPolicySchema).optional(),\n })\n .strict()\n .optional(),\n })\n .strict()\n .default({ builtin: {} });\n\nexport const SkillPolicySchema = z\n .object({\n mode: z.enum(['all', 'allowlist', 'denylist', 'off']).default('all'),\n allow: z.array(z.string().min(1)).optional(),\n deny: z.array(z.string().min(1)).optional(),\n })\n .strict()\n .default({ mode: 'all' });\n\nexport const DreamingPhasePolicySchema = z\n .object({\n enabled: z.boolean().optional(),\n cron: z.string().min(1).optional(),\n })\n .strict();\n\nexport const DreamingLightPolicySchema = DreamingPhasePolicySchema.extend({\n lookbackDays: z.number().int().positive().optional(),\n limit: z.number().int().nonnegative().optional(),\n dedupeSimilarity: z.number().min(0).max(1).optional(),\n}).strict();\n\nexport const DreamingDeepPolicySchema = DreamingPhasePolicySchema.extend({\n minScore: z.number().min(0).max(1).optional(),\n minRecallCount: z.number().int().positive().optional(),\n minUniqueQueries: z.number().int().positive().optional(),\n limit: z.number().int().nonnegative().optional(),\n recencyHalfLifeDays: z.number().positive().optional(),\n maxAgeDays: z.number().positive().optional(),\n}).strict();\n\nexport const DreamingRemPolicySchema = DreamingPhasePolicySchema.extend({\n lookbackDays: z.number().int().positive().optional(),\n limit: z.number().int().nonnegative().optional(),\n minPatternStrength: z.number().min(0).max(1).optional(),\n}).strict();\n\nexport const DreamingPolicySchema = z\n .object({\n enabled: z.boolean().default(false),\n frequency: z.string().min(1).optional(),\n timezone: z.string().optional(),\n phases: z\n .object({\n light: DreamingLightPolicySchema.optional(),\n deep: DreamingDeepPolicySchema.optional(),\n rem: DreamingRemPolicySchema.optional(),\n })\n .strict()\n .optional(),\n })\n .strict()\n .optional();\n\nexport const MemoryPolicySchema = z\n .object({\n mode: z.enum(['off', 'readOnly', 'confirmWrite', 'auto']).default('off'),\n sources: z\n .array(z.enum(['session', 'userProfile', 'agentProfile', 'curated', 'workspace']))\n .default(['session']),\n writePolicy: z\n .object({\n userProfile: z.enum(['deny', 'confirm', 'allow']).optional(),\n agentProfile: z.enum(['deny', 'confirm', 'allow']).optional(),\n curated: z.enum(['deny', 'confirm', 'allow']).optional(),\n workspace: z.enum(['deny', 'confirm', 'allow']).optional(),\n })\n .strict()\n .optional(),\n retention: z\n .object({\n compaction: z.boolean().default(true),\n maxAgeDays: z.number().int().positive().optional(),\n maxItems: z.number().int().positive().optional(),\n })\n .strict()\n .optional(),\n privacy: z\n .object({\n crossAgentSharing: z.enum(['deny', 'readOnly', 'allow']).default('deny'),\n sensitiveWritePolicy: z.enum(['deny', 'confirm', 'allow']).default('confirm'),\n })\n .strict()\n .optional(),\n providerRouting: z\n .object({\n searchStrategy: z\n .enum(['local-first', 'external-first', 'fanout', 'local-only', 'external-only'])\n .default('fanout'),\n writeStrategy: z\n .enum(['local-first', 'external-first', 'write-through', 'local-only', 'external-only'])\n .default('local-first'),\n allowExternalWrites: z.boolean().default(false),\n allowedProviderIds: z.array(z.string().min(1)).optional(),\n autoWriteKinds: z\n .array(\n z.enum([\n 'user_profile',\n 'agent_note',\n 'workspace_fact',\n 'daily_note',\n 'session_summary',\n 'derived_insight',\n ]),\n )\n .optional(),\n })\n .strict()\n .optional(),\n dreaming: DreamingPolicySchema,\n })\n .strict()\n .default({ mode: 'off', sources: ['session'] });\n\nexport const WorkflowPolicySchema = z\n .object({\n default: z.string().min(1).optional(),\n allowed: z.array(z.string().min(1)).optional(),\n suggested: z\n .array(\n z\n .object({\n intent: z.string().min(1),\n workflow: z.string().min(1),\n })\n .strict(),\n )\n .optional(),\n })\n .strict()\n .default({});\n\nexport const BoundaryPolicySchema = z\n .object({\n requiresConfirmation: z.array(z.string().min(1)).default([]),\n forbidden: z.array(z.string().min(1)).default([]),\n escalation: z.array(z.string().min(1)).default([]),\n })\n .strict()\n .default({ requiresConfirmation: [], forbidden: [], escalation: [] });\n\nexport const WorkspacePolicySchema = z\n .object({\n root: z.string().min(1),\n })\n .strict();\n\nexport const RuntimePolicySchema = z\n .object({\n maxTurns: z.number().int().positive().optional(),\n timeoutMs: z.number().int().positive().optional(),\n maxToolFailuresPerTurn: z.number().int().positive().optional(),\n })\n .strict()\n .optional();\n\nexport const PromptPolicySchema = z\n .object({\n customInstructions: z.string().optional(),\n })\n .strict()\n .optional();\n\nexport const AgentIdentitySchema = z\n .object({\n name: z.string().min(1),\n description: z.string().optional(),\n role: z.string().min(1),\n language: z.string().min(1).default('en'),\n tone: z.string().min(1).default('direct'),\n avatar: z.string().optional(),\n })\n .strict();\n\nexport const AgentResponsibilitiesSchema = z\n .object({\n primary: z.array(z.string().min(1)).min(1),\n secondary: z.array(z.string().min(1)).optional(),\n outOfScope: z.array(z.string().min(1)).optional(),\n })\n .strict();\n\nexport const AgentManifestSchema = z\n .object({\n id: IdSchema,\n enabled: z.boolean().default(true),\n extends: z.array(IdSchema).optional(),\n identity: AgentIdentitySchema,\n responsibilities: AgentResponsibilitiesSchema,\n workspace: WorkspacePolicySchema,\n models: ModelPolicySchema,\n tools: ToolPolicySetSchema,\n skills: SkillPolicySchema,\n memory: MemoryPolicySchema,\n workflows: WorkflowPolicySchema,\n boundaries: BoundaryPolicySchema,\n runtime: RuntimePolicySchema,\n prompt: PromptPolicySchema,\n })\n .strict();\n\nexport const AgentConfigEntrySchema = AgentManifestSchema.extend({\n models: ModelPolicySchema.optional(),\n}).strict();\n\nexport const CapabilityPresetSchema = z\n .object({\n id: IdSchema,\n name: z.string().min(1),\n description: z.string().optional(),\n version: z.number().int().positive().default(1),\n extends: z.array(IdSchema).optional(),\n models: ModelPolicyPatchSchema.optional(),\n tools: ToolPolicySetSchema.optional(),\n skills: SkillPolicySchema.optional(),\n memory: MemoryPolicySchema.optional(),\n workflows: WorkflowPolicySchema.optional(),\n boundaries: BoundaryPolicySchema.optional(),\n runtime: RuntimePolicySchema,\n locks: z.array(z.string().min(1)).optional(),\n })\n .strict();\n\nexport type AgentManifest = z.infer<typeof AgentManifestSchema>;\nexport type AgentConfigEntry = z.infer<typeof AgentConfigEntrySchema>;\nexport type CapabilityPreset = z.infer<typeof CapabilityPresetSchema>;\nexport type EffectiveAgentManifest = AgentManifest;\nexport type ToolPolicy = z.infer<typeof ToolPolicySchema>;\n"],"mappings":";;;;;AAEM,YAAW,EAAE,QAAQ,CAAC,MAAM,0BAA0B;AAE/C,gCAA+B;AAE/B,2BAA0B,EACpC,OAAO;EACN,OAAO,EAAE,QAAQ,CAAC,IAAI,EAAE;EACxB,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,UAAU;EAChD,aAAa,EAAE,QAAQ,CAAC,IAAI,IAAI,CAAC,UAAU;EAC5C,CAAC,CACD,QAAQ,CACR,aAAa,OAAO,QAAQ;EAC3B,MAAM,eAAe,QAAgB;GACnC,MAAM,UAAU,IAAI,MAAM;GAC1B,MAAM,MAAM,QAAQ,QAAQ,IAAI;AAChC,UAAO,MAAM,KAAK,MAAM,QAAQ,SAAS;;AA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C,OAAO;EACN,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE;EAC1C,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,UAAU;EAChD,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,UAAU;EAClD,CAAC,CACD,QAAQ;AAEE,uBAAsB,EAChC,OAAO;EACN,IAAI;EACJ,SAAS,EAAE,SAAS,CAAC,QAAQ,KAAK;EAClC,SAAS,EAAE,MAAM,SAAS,CAAC,UAAU;EACrC,UAAU;EACV,kBAAkB;EAClB,WAAW;EACX,QAAQ;EACR,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,WAAW;EACX,YAAY;EACZ,SAAS;EACT,QAAQ;EACT,CAAC,CACD,QAAQ;AAEE,0BAAyB,oBAAoB,OAAO,EAC/D,QAAQ,kBAAkB,UAAU,EACrC,CAAC,CAAC,QAAQ;AAEE,0BAAyB,EACnC,OAAO;EACN,IAAI;EACJ,MAAM,EAAE,QAAQ,CAAC,IAAI,EAAE;EACvB,aAAa,EAAE,QAAQ,CAAC,UAAU;EAClC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE;EAC/C,SAAS,EAAE,MAAM,SAAS,CAAC,UAAU;EACrC,QAAQ,uBAAuB,UAAU;EACzC,OAAO,oBAAoB,UAAU;EACrC,QAAQ,kBAAkB,UAAU;EACpC,QAAQ,mBAAmB,UAAU;EACrC,WAAW,qBAAqB,UAAU;EAC1C,YAAY,qBAAqB,UAAU;EAC3C,SAAS;EACT,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,UAAU;EAC7C,CAAC,CACD,QAAQ"}
|
|
1
|
+
{"version":3,"file":"schema.js","names":[],"sources":["../../../src/agent-manifest/schema.ts"],"sourcesContent":["import { z } from 'zod';\n\nconst IdSchema = z.string().regex(/^[a-z][a-z0-9_-]{0,63}$/);\n\nexport const DEFAULT_CAPABILITY_PRESET_ID = 'default';\n\nexport const ManifestModelRoleSchema = z\n .object({\n model: z.string().min(1),\n fallbacks: z.array(z.string().min(1)).optional(),\n description: z.string().max(500).optional(),\n })\n .strict()\n .superRefine((entry, ctx) => {\n const validateRef = (ref: string) => {\n const trimmed = ref.trim();\n const idx = trimmed.indexOf('/');\n return idx > 0 && idx < trimmed.length - 1;\n };\n if (!validateRef(entry.model)) {\n ctx.addIssue({\n code: 'custom',\n message: `model must be provider/model format (got '${entry.model}')`,\n path: ['model'],\n });\n }\n for (const [index, fallback] of (entry.fallbacks ?? []).entries()) {\n if (!validateRef(fallback)) {\n ctx.addIssue({\n code: 'custom',\n message: `fallback must be provider/model format (got '${fallback}')`,\n path: ['fallbacks', index],\n });\n }\n }\n });\n\nexport const AgentToolModelSchema = z\n .object({\n primary: z.string().min(1),\n fallbacks: z.array(z.string().min(1)).optional(),\n timeoutMs: z.number().int().positive().optional(),\n autoProviderFallback: z.boolean().optional(),\n })\n .strict()\n .superRefine((entry, ctx) => {\n const validateRef = (ref: string) => {\n const trimmed = ref.trim();\n const idx = trimmed.indexOf('/');\n return idx > 0 && idx < trimmed.length - 1;\n };\n if (!validateRef(entry.primary)) {\n ctx.addIssue({\n code: 'custom',\n message: `primary must be provider/model format (got '${entry.primary}')`,\n path: ['primary'],\n });\n }\n for (const [index, fallback] of (entry.fallbacks ?? []).entries()) {\n if (!validateRef(fallback)) {\n ctx.addIssue({\n code: 'custom',\n message: `fallback must be provider/model format (got '${fallback}')`,\n path: ['fallbacks', index],\n });\n }\n }\n });\n\nexport const ModelPolicySchema = z\n .object({\n defaultRole: IdSchema,\n roles: z.record(IdSchema, ManifestModelRoleSchema).default({}),\n imageModel: AgentToolModelSchema.optional(),\n imageGenerationModel: AgentToolModelSchema.optional(),\n policy: z\n .object({\n allowFallbacks: z.boolean().optional(),\n maxCostTier: z.enum(['low', 'medium', 'high']).optional(),\n })\n .strict()\n .optional(),\n })\n .strict();\n\nexport const ModelPolicyPatchSchema = z\n .object({\n defaultRole: IdSchema.optional(),\n roles: z.record(IdSchema, ManifestModelRoleSchema).optional(),\n imageModel: AgentToolModelSchema.optional(),\n imageGenerationModel: AgentToolModelSchema.optional(),\n policy: z\n .object({\n allowFallbacks: z.boolean().optional(),\n maxCostTier: z.enum(['low', 'medium', 'high']).optional(),\n })\n .strict()\n .optional(),\n })\n .strict();\n\nexport const ToolModeSchema = z.enum(['allow', 'confirm', 'deny']);\nexport const ToolScopeSchema = z.enum(['readonly', 'workspace', 'unrestricted']);\n\nexport const ToolPolicySchema = z\n .object({\n mode: ToolModeSchema,\n scope: ToolScopeSchema.optional(),\n limits: z\n .object({\n maxCallsPerTurn: z.number().int().positive().optional(),\n timeoutMs: z.number().int().positive().optional(),\n })\n .strict()\n .optional(),\n })\n .strict();\n\nexport const ToolPolicySetSchema = z\n .object({\n builtin: z.record(z.string().min(1), ToolPolicySchema).default({}),\n mcp: z\n .object({\n servers: z.record(z.string().min(1), ToolPolicySchema).optional(),\n tools: z.record(z.string().min(1), ToolPolicySchema).optional(),\n })\n .strict()\n .optional(),\n })\n .strict()\n .default({ builtin: {} });\n\nexport const SkillPolicySchema = z\n .object({\n mode: z.enum(['all', 'allowlist', 'denylist', 'off']).default('all'),\n allow: z.array(z.string().min(1)).optional(),\n deny: z.array(z.string().min(1)).optional(),\n })\n .strict()\n .default({ mode: 'all' });\n\nexport const DreamingPhasePolicySchema = z\n .object({\n enabled: z.boolean().optional(),\n cron: z.string().min(1).optional(),\n })\n .strict();\n\nexport const DreamingLightPolicySchema = DreamingPhasePolicySchema.extend({\n lookbackDays: z.number().int().positive().optional(),\n limit: z.number().int().nonnegative().optional(),\n dedupeSimilarity: z.number().min(0).max(1).optional(),\n}).strict();\n\nexport const DreamingDeepPolicySchema = DreamingPhasePolicySchema.extend({\n minScore: z.number().min(0).max(1).optional(),\n minRecallCount: z.number().int().positive().optional(),\n minUniqueQueries: z.number().int().positive().optional(),\n limit: z.number().int().nonnegative().optional(),\n recencyHalfLifeDays: z.number().positive().optional(),\n maxAgeDays: z.number().positive().optional(),\n}).strict();\n\nexport const DreamingRemPolicySchema = DreamingPhasePolicySchema.extend({\n lookbackDays: z.number().int().positive().optional(),\n limit: z.number().int().nonnegative().optional(),\n minPatternStrength: z.number().min(0).max(1).optional(),\n}).strict();\n\nexport const DreamingPolicySchema = z\n .object({\n enabled: z.boolean().default(false),\n frequency: z.string().min(1).optional(),\n timezone: z.string().optional(),\n phases: z\n .object({\n light: DreamingLightPolicySchema.optional(),\n deep: DreamingDeepPolicySchema.optional(),\n rem: DreamingRemPolicySchema.optional(),\n })\n .strict()\n .optional(),\n })\n .strict()\n .optional();\n\nexport const UserUnderstandingPolicySchema = z\n .object({\n enabled: z.boolean().optional(),\n adaptiveCadence: z.boolean().optional(),\n reviewIntervalTurns: z.number().int().min(1).max(1_000).optional(),\n maxHistoryMessages: z.number().int().min(1).max(200).optional(),\n maxDurationMs: z.number().int().min(1_000).max(600_000).optional(),\n })\n .strict();\n\nexport const MemoryPolicySchema = z\n .object({\n mode: z.enum(['off', 'readOnly', 'confirmWrite', 'auto']).default('off'),\n sources: z\n .array(z.enum(['session', 'userProfile', 'agentProfile', 'curated', 'workspace', 'connectedSources']))\n .default(['session']),\n writePolicy: z\n .object({\n userProfile: z.enum(['deny', 'confirm', 'allow']).optional(),\n agentProfile: z.enum(['deny', 'confirm', 'allow']).optional(),\n curated: z.enum(['deny', 'confirm', 'allow']).optional(),\n workspace: z.enum(['deny', 'confirm', 'allow']).optional(),\n })\n .strict()\n .optional(),\n retention: z\n .object({\n compaction: z.boolean().default(true),\n maxAgeDays: z.number().int().positive().optional(),\n maxItems: z.number().int().positive().optional(),\n })\n .strict()\n .optional(),\n privacy: z\n .object({\n crossAgentSharing: z.enum(['deny', 'readOnly', 'allow']).default('deny'),\n sensitiveWritePolicy: z.enum(['deny', 'confirm', 'allow']).default('confirm'),\n })\n .strict()\n .optional(),\n providerRouting: z\n .object({\n searchStrategy: z\n .enum(['local-first', 'external-first', 'fanout', 'local-only', 'external-only'])\n .default('fanout'),\n writeStrategy: z\n .enum(['local-first', 'external-first', 'write-through', 'local-only', 'external-only'])\n .default('local-first'),\n allowExternalWrites: z.boolean().default(false),\n allowedProviderIds: z.array(z.string().min(1)).optional(),\n autoWriteKinds: z\n .array(\n z.enum([\n 'user_profile',\n 'preference',\n 'boundary',\n 'relationship',\n 'project_context',\n 'commitment',\n 'routine',\n 'personal_logistics',\n 'open_question',\n 'milestone',\n 'current_state',\n 'agent_note',\n 'workspace_fact',\n 'daily_note',\n 'session_summary',\n 'derived_insight',\n 'task_lesson',\n 'tool_preference',\n 'long_term_goal',\n ]),\n )\n .optional(),\n })\n .strict()\n .optional(),\n dreaming: DreamingPolicySchema,\n understanding: UserUnderstandingPolicySchema.optional(),\n })\n .strict()\n .default({ mode: 'off', sources: ['session'] });\n\nexport const WorkflowPolicySchema = z\n .object({\n default: z.string().min(1).optional(),\n allowed: z.array(z.string().min(1)).optional(),\n suggested: z\n .array(\n z\n .object({\n intent: z.string().min(1),\n workflow: z.string().min(1),\n })\n .strict(),\n )\n .optional(),\n })\n .strict()\n .default({});\n\nexport const BoundaryPolicySchema = z\n .object({\n requiresConfirmation: z.array(z.string().min(1)).default([]),\n forbidden: z.array(z.string().min(1)).default([]),\n escalation: z.array(z.string().min(1)).default([]),\n })\n .strict()\n .default({ requiresConfirmation: [], forbidden: [], escalation: [] });\n\nexport const WorkspacePolicySchema = z\n .object({\n root: z.string().min(1),\n })\n .strict();\n\nexport const RuntimePolicySchema = z\n .object({\n maxTurns: z.number().int().positive().optional(),\n timeoutMs: z.number().int().positive().optional(),\n maxToolFailuresPerTurn: z.number().int().positive().optional(),\n })\n .strict()\n .optional();\n\nexport const PromptPolicySchema = z\n .object({\n customInstructions: z.string().optional(),\n })\n .strict()\n .optional();\n\nexport const AgentIdentitySchema = z\n .object({\n name: z.string().min(1),\n description: z.string().optional(),\n role: z.string().min(1),\n language: z.string().min(1).default('en'),\n tone: z.string().min(1).default('direct'),\n avatar: z.string().optional(),\n })\n .strict();\n\nexport const AgentResponsibilitiesSchema = z\n .object({\n primary: z.array(z.string().min(1)).min(1),\n secondary: z.array(z.string().min(1)).optional(),\n outOfScope: z.array(z.string().min(1)).optional(),\n })\n .strict();\n\nexport const AgentManifestSchema = z\n .object({\n id: IdSchema,\n enabled: z.boolean().default(true),\n extends: z.array(IdSchema).optional(),\n identity: AgentIdentitySchema,\n responsibilities: AgentResponsibilitiesSchema,\n workspace: WorkspacePolicySchema,\n models: ModelPolicySchema,\n tools: ToolPolicySetSchema,\n skills: SkillPolicySchema,\n memory: MemoryPolicySchema,\n workflows: WorkflowPolicySchema,\n boundaries: BoundaryPolicySchema,\n runtime: RuntimePolicySchema,\n prompt: PromptPolicySchema,\n })\n .strict();\n\nexport const AgentConfigEntrySchema = AgentManifestSchema.extend({\n models: ModelPolicySchema.optional(),\n}).strict();\n\nexport const CapabilityPresetSchema = z\n .object({\n id: IdSchema,\n name: z.string().min(1),\n description: z.string().optional(),\n version: z.number().int().positive().default(1),\n extends: z.array(IdSchema).optional(),\n models: ModelPolicyPatchSchema.optional(),\n tools: ToolPolicySetSchema.optional(),\n skills: SkillPolicySchema.optional(),\n memory: MemoryPolicySchema.optional(),\n workflows: WorkflowPolicySchema.optional(),\n boundaries: BoundaryPolicySchema.optional(),\n runtime: RuntimePolicySchema,\n locks: z.array(z.string().min(1)).optional(),\n })\n .strict();\n\nexport type AgentManifest = z.infer<typeof AgentManifestSchema>;\nexport type AgentConfigEntry = z.infer<typeof AgentConfigEntrySchema>;\nexport type CapabilityPreset = z.infer<typeof CapabilityPresetSchema>;\nexport type EffectiveAgentManifest = AgentManifest;\nexport type ToolPolicy = z.infer<typeof ToolPolicySchema>;\n"],"mappings":";;;;;AAEM,YAAW,EAAE,QAAQ,CAAC,MAAM,0BAA0B;AAE/C,gCAA+B;AAE/B,2BAA0B,EACpC,OAAO;EACN,OAAO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;EACV,kBAAkB;EAClB,WAAW;EACX,QAAQ;EACR,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,WAAW;EACX,YAAY;EACZ,SAAS;EACT,QAAQ;EACT,CAAC,CACD,QAAQ;AAEE,0BAAyB,oBAAoB,OAAO,EAC/D,QAAQ,kBAAkB,UAAU,EACrC,CAAC,CAAC,QAAQ;AAEE,0BAAyB,EACnC,OAAO;EACN,IAAI;EACJ,MAAM,EAAE,QAAQ,CAAC,IAAI,EAAE;EACvB,aAAa,EAAE,QAAQ,CAAC,UAAU;EAClC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE;EAC/C,SAAS,EAAE,MAAM,SAAS,CAAC,UAAU;EACrC,QAAQ,uBAAuB,UAAU;EACzC,OAAO,oBAAoB,UAAU;EACrC,QAAQ,kBAAkB,UAAU;EACpC,QAAQ,mBAAmB,UAAU;EACrC,WAAW,qBAAqB,UAAU;EAC1C,YAAY,qBAAqB,UAAU;EAC3C,SAAS;EACT,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,UAAU;EAC7C,CAAC,CACD,QAAQ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EffectiveAgentManifest } from '../agent-manifest/schema.js';
|
|
2
|
-
export type MemorySource = 'session' | 'userProfile' | 'agentProfile' | 'curated' | 'workspace';
|
|
2
|
+
export type MemorySource = 'session' | 'userProfile' | 'agentProfile' | 'curated' | 'workspace' | 'connectedSources';
|
|
3
3
|
export type MemoryWriteTarget = 'userProfile' | 'agentProfile' | 'curated' | 'workspace';
|
|
4
4
|
export type MemoryWriteDecision = 'allow' | 'confirm' | 'deny';
|
|
5
5
|
export interface MemoryCandidate {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-runtime.js","names":[],"sources":["../../../src/agent-runtime/memory-runtime.ts"],"sourcesContent":["import type { EffectiveAgentManifest } from '../agent-manifest/schema.js';\n\nexport type MemorySource
|
|
1
|
+
{"version":3,"file":"memory-runtime.js","names":[],"sources":["../../../src/agent-runtime/memory-runtime.ts"],"sourcesContent":["import type { EffectiveAgentManifest } from '../agent-manifest/schema.js';\n\nexport type MemorySource =\n | 'session'\n | 'userProfile'\n | 'agentProfile'\n | 'curated'\n | 'workspace'\n | 'connectedSources';\nexport type MemoryWriteTarget = 'userProfile' | 'agentProfile' | 'curated' | 'workspace';\nexport type MemoryWriteDecision = 'allow' | 'confirm' | 'deny';\n\nexport interface MemoryCandidate {\n target: MemoryWriteTarget;\n content: string;\n source: string;\n confidence?: number;\n sensitive?: boolean;\n}\n\nexport interface MemoryWriteCheckResult {\n decision: MemoryWriteDecision;\n reason: string;\n}\n\nexport interface MemoryRuntime {\n readableSources: MemorySource[];\n canRead: (source: MemorySource) => boolean;\n checkWrite: (candidate: MemoryCandidate) => MemoryWriteCheckResult;\n}\n\nconst READ_ONLY_MODES = new Set(['readOnly']);\n\nfunction normalizeConfidence(value: number | undefined): number {\n if (typeof value !== 'number' || !Number.isFinite(value)) return 0.5;\n return Math.max(0, Math.min(1, value));\n}\n\nexport function buildMemoryRuntime(manifest: EffectiveAgentManifest): MemoryRuntime {\n const readableSources = manifest.memory.mode === 'off' ? [] : [...manifest.memory.sources];\n const sourceSet = new Set<MemorySource>(readableSources);\n\n return {\n readableSources,\n canRead: (source) => sourceSet.has(source),\n checkWrite: (candidate) => {\n if (manifest.memory.mode === 'off') {\n return { decision: 'deny', reason: 'memory is disabled' };\n }\n if (READ_ONLY_MODES.has(manifest.memory.mode)) {\n return { decision: 'deny', reason: 'memory is read-only' };\n }\n if (!candidate.content.trim()) {\n return { decision: 'deny', reason: 'memory content is empty' };\n }\n const confidence = normalizeConfidence(candidate.confidence);\n if (confidence < 0.3) {\n return { decision: 'deny', reason: 'memory confidence is too low' };\n }\n const sensitivePolicy = manifest.memory.privacy?.sensitiveWritePolicy ?? 'confirm';\n if (candidate.sensitive && sensitivePolicy !== 'allow') {\n return {\n decision: sensitivePolicy,\n reason: 'memory candidate is sensitive',\n };\n }\n const targetPolicy = manifest.memory.writePolicy?.[candidate.target] ?? 'deny';\n if (manifest.memory.mode === 'confirmWrite' && targetPolicy === 'allow') {\n return { decision: 'confirm', reason: 'agent memory mode requires confirmation' };\n }\n return {\n decision: targetPolicy,\n reason: `target policy is ${targetPolicy}`,\n };\n },\n };\n}\n"],"mappings":";AA+BA,MAAM,kBAAkB,IAAI,IAAI,CAAC,WAAW,CAAC;AAE7C,SAAS,oBAAoB,OAAmC;AAC9D,KAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,MAAM,CAAE,QAAO;AACjE,QAAO,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,MAAM,CAAC;;AAGxC,SAAgB,mBAAmB,UAAiD;CAClF,MAAM,kBAAkB,SAAS,OAAO,SAAS,QAAQ,EAAE,GAAG,CAAC,GAAG,SAAS,OAAO,QAAQ;CAC1F,MAAM,YAAY,IAAI,IAAkB,gBAAgB;AAExD,QAAO;EACL;EACA,UAAU,WAAW,UAAU,IAAI,OAAO;EAC1C,aAAa,cAAc;AACzB,OAAI,SAAS,OAAO,SAAS,MAC3B,QAAO;IAAE,UAAU;IAAQ,QAAQ;IAAsB;AAE3D,OAAI,gBAAgB,IAAI,SAAS,OAAO,KAAK,CAC3C,QAAO;IAAE,UAAU;IAAQ,QAAQ;IAAuB;AAE5D,OAAI,CAAC,UAAU,QAAQ,MAAM,CAC3B,QAAO;IAAE,UAAU;IAAQ,QAAQ;IAA2B;AAGhE,OADmB,oBAAoB,UAAU,WACnC,GAAG,GACf,QAAO;IAAE,UAAU;IAAQ,QAAQ;IAAgC;GAErE,MAAM,kBAAkB,SAAS,OAAO,SAAS,wBAAwB;AACzE,OAAI,UAAU,aAAa,oBAAoB,QAC7C,QAAO;IACL,UAAU;IACV,QAAQ;IACT;GAEH,MAAM,eAAe,SAAS,OAAO,cAAc,UAAU,WAAW;AACxE,OAAI,SAAS,OAAO,SAAS,kBAAkB,iBAAiB,QAC9D,QAAO;IAAE,UAAU;IAAW,QAAQ;IAA2C;AAEnF,UAAO;IACL,UAAU;IACV,QAAQ,oBAAoB;IAC7B;;EAEJ"}
|
|
@@ -86,11 +86,11 @@ export declare const AutomationStateSchema: z.ZodObject<{
|
|
|
86
86
|
lastRunAtMs: z.ZodOptional<z.ZodNumber>;
|
|
87
87
|
lastRunStatus: z.ZodOptional<z.ZodEnum<{
|
|
88
88
|
queued: "queued";
|
|
89
|
-
timeout: "timeout";
|
|
90
|
-
failed: "failed";
|
|
91
89
|
running: "running";
|
|
92
90
|
succeeded: "succeeded";
|
|
91
|
+
failed: "failed";
|
|
93
92
|
cancelled: "cancelled";
|
|
93
|
+
timeout: "timeout";
|
|
94
94
|
}>>;
|
|
95
95
|
lastError: z.ZodOptional<z.ZodString>;
|
|
96
96
|
consecutiveFailures: z.ZodOptional<z.ZodNumber>;
|
|
@@ -176,11 +176,11 @@ export declare const AutomationSchema: z.ZodObject<{
|
|
|
176
176
|
lastRunAtMs: z.ZodOptional<z.ZodNumber>;
|
|
177
177
|
lastRunStatus: z.ZodOptional<z.ZodEnum<{
|
|
178
178
|
queued: "queued";
|
|
179
|
-
timeout: "timeout";
|
|
180
|
-
failed: "failed";
|
|
181
179
|
running: "running";
|
|
182
180
|
succeeded: "succeeded";
|
|
181
|
+
failed: "failed";
|
|
183
182
|
cancelled: "cancelled";
|
|
183
|
+
timeout: "timeout";
|
|
184
184
|
}>>;
|
|
185
185
|
lastError: z.ZodOptional<z.ZodString>;
|
|
186
186
|
consecutiveFailures: z.ZodOptional<z.ZodNumber>;
|
|
@@ -214,6 +214,13 @@ export declare const CreateAutomationSchema: z.ZodObject<{
|
|
|
214
214
|
maxSubagents: z.ZodOptional<z.ZodNumber>;
|
|
215
215
|
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
216
216
|
}, z.core.$strict>], "kind">;
|
|
217
|
+
safety: z.ZodOptional<z.ZodObject<{
|
|
218
|
+
mode: z.ZodEnum<{
|
|
219
|
+
suggest_only: "suggest_only";
|
|
220
|
+
ask_before_apply: "ask_before_apply";
|
|
221
|
+
auto_apply: "auto_apply";
|
|
222
|
+
}>;
|
|
223
|
+
}, z.core.$strict>>;
|
|
217
224
|
description: z.ZodOptional<z.ZodString>;
|
|
218
225
|
trigger: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
219
226
|
kind: z.ZodLiteral<"manual">;
|
|
@@ -240,13 +247,6 @@ export declare const CreateAutomationSchema: z.ZodObject<{
|
|
|
240
247
|
source: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
241
248
|
payloadMatch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
242
249
|
}, z.core.$strict>], "kind">;
|
|
243
|
-
safety: z.ZodOptional<z.ZodObject<{
|
|
244
|
-
mode: z.ZodEnum<{
|
|
245
|
-
suggest_only: "suggest_only";
|
|
246
|
-
ask_before_apply: "ask_before_apply";
|
|
247
|
-
auto_apply: "auto_apply";
|
|
248
|
-
}>;
|
|
249
|
-
}, z.core.$strict>>;
|
|
250
250
|
afterRun: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
251
251
|
kind: z.ZodLiteral<"none">;
|
|
252
252
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -269,11 +269,11 @@ export declare const CreateAutomationSchema: z.ZodObject<{
|
|
|
269
269
|
lastRunAtMs: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
270
270
|
lastRunStatus: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
|
|
271
271
|
queued: "queued";
|
|
272
|
-
timeout: "timeout";
|
|
273
|
-
failed: "failed";
|
|
274
272
|
running: "running";
|
|
275
273
|
succeeded: "succeeded";
|
|
274
|
+
failed: "failed";
|
|
276
275
|
cancelled: "cancelled";
|
|
276
|
+
timeout: "timeout";
|
|
277
277
|
}>>>;
|
|
278
278
|
lastError: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
279
279
|
consecutiveFailures: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -306,6 +306,13 @@ export declare const UpdateAutomationSchema: z.ZodObject<{
|
|
|
306
306
|
maxSubagents: z.ZodOptional<z.ZodNumber>;
|
|
307
307
|
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
308
308
|
}, z.core.$strict>], "kind">>;
|
|
309
|
+
safety: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
310
|
+
mode: z.ZodEnum<{
|
|
311
|
+
suggest_only: "suggest_only";
|
|
312
|
+
ask_before_apply: "ask_before_apply";
|
|
313
|
+
auto_apply: "auto_apply";
|
|
314
|
+
}>;
|
|
315
|
+
}, z.core.$strict>>>;
|
|
309
316
|
description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
310
317
|
trigger: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
311
318
|
kind: z.ZodLiteral<"manual">;
|
|
@@ -338,22 +345,15 @@ export declare const UpdateAutomationSchema: z.ZodObject<{
|
|
|
338
345
|
lastRunAtMs: z.ZodOptional<z.ZodNumber>;
|
|
339
346
|
lastRunStatus: z.ZodOptional<z.ZodEnum<{
|
|
340
347
|
queued: "queued";
|
|
341
|
-
timeout: "timeout";
|
|
342
|
-
failed: "failed";
|
|
343
348
|
running: "running";
|
|
344
349
|
succeeded: "succeeded";
|
|
350
|
+
failed: "failed";
|
|
345
351
|
cancelled: "cancelled";
|
|
352
|
+
timeout: "timeout";
|
|
346
353
|
}>>;
|
|
347
354
|
lastError: z.ZodOptional<z.ZodString>;
|
|
348
355
|
consecutiveFailures: z.ZodOptional<z.ZodNumber>;
|
|
349
356
|
}, z.core.$strict>>>;
|
|
350
|
-
safety: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
351
|
-
mode: z.ZodEnum<{
|
|
352
|
-
suggest_only: "suggest_only";
|
|
353
|
-
ask_before_apply: "ask_before_apply";
|
|
354
|
-
auto_apply: "auto_apply";
|
|
355
|
-
}>;
|
|
356
|
-
}, z.core.$strict>>>;
|
|
357
357
|
afterRun: z.ZodOptional<z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
358
358
|
kind: z.ZodLiteral<"none">;
|
|
359
359
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -35,6 +35,9 @@ export declare function buildAutomationDraftResponse(draft: GeneratedAutomationD
|
|
|
35
35
|
maxSubagents?: number;
|
|
36
36
|
timeoutSeconds?: number;
|
|
37
37
|
};
|
|
38
|
+
safety?: {
|
|
39
|
+
mode: "suggest_only" | "ask_before_apply" | "auto_apply";
|
|
40
|
+
};
|
|
38
41
|
description?: string;
|
|
39
42
|
trigger?: {
|
|
40
43
|
kind: "manual";
|
|
@@ -61,9 +64,6 @@ export declare function buildAutomationDraftResponse(draft: GeneratedAutomationD
|
|
|
61
64
|
source?: string;
|
|
62
65
|
payloadMatch?: Record<string, string | number | boolean>;
|
|
63
66
|
};
|
|
64
|
-
safety?: {
|
|
65
|
-
mode: "suggest_only" | "ask_before_apply" | "auto_apply";
|
|
66
|
-
};
|
|
67
67
|
afterRun?: {
|
|
68
68
|
kind: "none";
|
|
69
69
|
} | {
|
|
@@ -84,7 +84,7 @@ export declare function buildAutomationDraftResponse(draft: GeneratedAutomationD
|
|
|
84
84
|
nextRunAtMs?: number;
|
|
85
85
|
runningRunId?: string;
|
|
86
86
|
lastRunAtMs?: number;
|
|
87
|
-
lastRunStatus?: "queued" | "
|
|
87
|
+
lastRunStatus?: "queued" | "running" | "succeeded" | "failed" | "cancelled" | "timeout";
|
|
88
88
|
lastError?: string;
|
|
89
89
|
consecutiveFailures?: number;
|
|
90
90
|
};
|
|
@@ -52,7 +52,7 @@ async function checkDatabaseSchema(ctx) {
|
|
|
52
52
|
id: "database-schema",
|
|
53
53
|
label: "Database schema",
|
|
54
54
|
status: "pass",
|
|
55
|
-
message: `SQLite schema v${status.dbVersion} (current release
|
|
55
|
+
message: `SQLite schema v${status.dbVersion} (current release v29).`,
|
|
56
56
|
hints: []
|
|
57
57
|
};
|
|
58
58
|
}
|