@xopcai/xopc 0.0.99 → 0.0.101
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/src/account-manager.d.ts +3 -3
- package/dist/extensions/telegram/src/account-manager.js +8 -8
- package/dist/extensions/telegram/src/account-manager.js.map +1 -1
- package/dist/extensions/telegram/src/actions/message-actions.d.ts +4 -0
- package/dist/extensions/telegram/src/actions/message-actions.js +71 -0
- package/dist/extensions/telegram/src/actions/message-actions.js.map +1 -0
- package/dist/extensions/telegram/src/adapters/config-adapter.js +9 -1
- package/dist/extensions/telegram/src/adapters/config-adapter.js.map +1 -1
- package/dist/extensions/telegram/src/adapters/config-surface.js +1 -1
- package/dist/extensions/telegram/src/adapters/config-surface.js.map +1 -1
- package/dist/extensions/telegram/src/adapters/outbound-adapter.d.ts +2 -1
- package/dist/extensions/telegram/src/adapters/outbound-adapter.js +18 -4
- package/dist/extensions/telegram/src/adapters/outbound-adapter.js.map +1 -1
- package/dist/extensions/telegram/src/adapters/security-adapter.js +2 -1
- package/dist/extensions/telegram/src/adapters/security-adapter.js.map +1 -1
- package/dist/extensions/telegram/src/adapters/streaming-adapter.js +90 -6
- package/dist/extensions/telegram/src/adapters/streaming-adapter.js.map +1 -1
- package/dist/extensions/telegram/src/adapters/types.d.ts +9 -1
- package/dist/extensions/telegram/src/api-root.d.ts +4 -0
- package/dist/extensions/telegram/src/api-root.js +42 -0
- package/dist/extensions/telegram/src/api-root.js.map +1 -0
- package/dist/extensions/telegram/src/approval-delivery.d.ts +9 -0
- package/dist/extensions/telegram/src/approval-delivery.js +36 -0
- package/dist/extensions/telegram/src/approval-delivery.js.map +1 -0
- package/dist/extensions/telegram/src/approval-store.d.ts +25 -0
- package/dist/extensions/telegram/src/approval-store.js +61 -0
- package/dist/extensions/telegram/src/approval-store.js.map +1 -0
- package/dist/extensions/telegram/src/config-schema.d.ts +185 -35
- package/dist/extensions/telegram/src/config-schema.js +67 -45
- package/dist/extensions/telegram/src/config-schema.js.map +1 -1
- package/dist/extensions/telegram/src/conversation-id.d.ts +6 -0
- package/dist/extensions/telegram/src/conversation-id.js +18 -0
- package/dist/extensions/telegram/src/conversation-id.js.map +1 -0
- package/dist/extensions/telegram/src/doctor.d.ts +5 -0
- package/dist/extensions/telegram/src/doctor.js +80 -0
- package/dist/extensions/telegram/src/doctor.js.map +1 -0
- package/dist/extensions/telegram/src/exec-approval-handler.d.ts +7 -0
- package/dist/extensions/telegram/src/exec-approval-handler.js +36 -0
- package/dist/extensions/telegram/src/exec-approval-handler.js.map +1 -0
- package/dist/extensions/telegram/src/exec-approvals.d.ts +8 -0
- package/dist/extensions/telegram/src/exec-approvals.js +20 -0
- package/dist/extensions/telegram/src/exec-approvals.js.map +1 -0
- package/dist/extensions/telegram/src/focus-handler.d.ts +12 -0
- package/dist/extensions/telegram/src/focus-handler.js +55 -0
- package/dist/extensions/telegram/src/focus-handler.js.map +1 -0
- package/dist/extensions/telegram/src/group-config-resolver.d.ts +12 -0
- package/dist/extensions/telegram/src/group-config-resolver.js +17 -0
- package/dist/extensions/telegram/src/group-config-resolver.js.map +1 -0
- package/dist/extensions/telegram/src/inbound-coalescer.d.ts +15 -0
- package/dist/extensions/telegram/src/inbound-coalescer.js +107 -0
- package/dist/extensions/telegram/src/inbound-coalescer.js.map +1 -0
- package/dist/extensions/telegram/src/inbound-processor.d.ts +1 -0
- package/dist/extensions/telegram/src/inbound-processor.js +41 -4
- package/dist/extensions/telegram/src/inbound-processor.js.map +1 -1
- package/dist/extensions/telegram/src/network-errors.d.ts +2 -0
- package/dist/extensions/telegram/src/network-errors.js +23 -0
- package/dist/extensions/telegram/src/network-errors.js.map +1 -0
- package/dist/extensions/telegram/src/plugin.d.ts +11 -0
- package/dist/extensions/telegram/src/plugin.js +191 -57
- package/dist/extensions/telegram/src/plugin.js.map +1 -1
- package/dist/extensions/telegram/src/polling-session.d.ts +17 -0
- package/dist/extensions/telegram/src/polling-session.js +112 -0
- package/dist/extensions/telegram/src/polling-session.js.map +1 -0
- package/dist/extensions/telegram/src/proxy-fetch.d.ts +2 -0
- package/dist/extensions/telegram/src/proxy-fetch.js +14 -0
- package/dist/extensions/telegram/src/proxy-fetch.js.map +1 -0
- package/dist/extensions/telegram/src/reactions.d.ts +14 -0
- package/dist/extensions/telegram/src/reactions.js +48 -0
- package/dist/extensions/telegram/src/reactions.js.map +1 -0
- package/dist/extensions/telegram/src/reply-params.d.ts +15 -0
- package/dist/extensions/telegram/src/reply-params.js +28 -0
- package/dist/extensions/telegram/src/reply-params.js.map +1 -0
- package/dist/extensions/telegram/src/startup-errors.d.ts +3 -0
- package/dist/extensions/telegram/src/startup-errors.js +27 -0
- package/dist/extensions/telegram/src/startup-errors.js.map +1 -0
- package/dist/extensions/telegram/src/telegram-actions.d.ts +25 -0
- package/dist/extensions/telegram/src/telegram-actions.js +65 -0
- package/dist/extensions/telegram/src/telegram-actions.js.map +1 -0
- package/dist/extensions/telegram/src/thread-bindings.d.ts +15 -0
- package/dist/extensions/telegram/src/thread-bindings.js +22 -0
- package/dist/extensions/telegram/src/thread-bindings.js.map +1 -0
- package/dist/extensions/telegram/src/token-resolver.d.ts +8 -0
- package/dist/extensions/telegram/src/token-resolver.js +34 -0
- package/dist/extensions/telegram/src/token-resolver.js.map +1 -0
- package/dist/extensions/telegram/src/update-offset-store.d.ts +9 -0
- package/dist/extensions/telegram/src/update-offset-store.js +66 -0
- package/dist/extensions/telegram/src/update-offset-store.js.map +1 -0
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.js +5 -3
- package/dist/extensions/weixin/src/api/api.js.map +1 -1
- package/dist/gateway/static/root/assets/{agents-4KTK-Ku7.js → agents-u8cmUfGQ.js} +2 -2
- package/dist/gateway/static/root/assets/{apps-page-DkgInY2w.js → apps-page-DF8m9cUE.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-preview-renderer-DBAxQXb-.js → attachment-preview-renderer-CybMSIoS.js} +2 -2
- package/dist/gateway/static/root/assets/{attachment-process-heavy-Csq3TrrP.js → attachment-process-heavy-RnGYy9bC.js} +2 -2
- package/dist/gateway/static/root/assets/channels-settings-BM3doRvi.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-ah4zWEIP.js +8 -0
- package/dist/gateway/static/root/assets/{cron-api-BRDli2Mm.js → cron-api-DgMuL_2b.js} +1 -1
- package/dist/gateway/static/root/assets/{cron-page-BzEr5Za8.js → cron-page-COfUPKfq.js} +1 -1
- package/dist/gateway/static/root/assets/{dist-BsHh1vX0.js → dist-Dzy3Q0ZH.js} +1 -1
- package/dist/gateway/static/root/assets/{docx-preview-Dxj1EkCO.js → docx-preview-CajIk2FR.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-TWt5q_ef.js → extension-debug-page-kyxxefKh.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-C3kV8ZvZ.js → extension-page-BVbCBHoI.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-Csy9LNC6.js → extension-settings-page-t1lb2A7v.js} +1 -1
- package/dist/gateway/static/root/assets/{fetch-BLLOP2CM.js → fetch-drJUxxKP.js} +1 -1
- package/dist/gateway/static/root/assets/{field-primitives-MXbM8HvY.js → field-primitives-6Vo1Yga4.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-config-api-CkoyqfRx.js → heartbeat-config-api-BF3psu4O.js} +1 -1
- package/dist/gateway/static/root/assets/index-DjNDHzwG.css +1 -0
- package/dist/gateway/static/root/assets/index-WAyKAilR.js +4840 -0
- package/dist/gateway/static/root/assets/{logs-page-B2vY41ph.js → logs-page-BTVPXcHV.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-page-B7qE5pkO.js → note-detail-page-DqSAg_5Z.js} +1 -1
- package/dist/gateway/static/root/assets/{note-time-NBBReVR4.js → note-time-FSOjchic.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-CsWYaqYM.js → notes-page-DkRX7BE2.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-BPGY3SCT.js → sessions-page-Khdw35Zk.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-advanced-gate-DtA451RM.js → settings-advanced-gate-DspC8oEm.js} +2 -2
- package/dist/gateway/static/root/assets/{settings-form-section-DYR_SPlX.js → settings-form-section-DuxvUuur.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BJUgZQzN.js → settings-page-DN8JBZ8F.js} +2 -2
- package/dist/gateway/static/root/assets/{share-preview-page-3u8VFmdo.js → share-preview-page-UNAcbiMb.js} +2 -2
- package/dist/gateway/static/root/assets/{skills-page-DuyhcH4U.js → skills-page-ByYT0fXZ.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-e2q2yjs4.js → theme-store-B6KXPHgK.js} +1 -1
- package/dist/gateway/static/root/assets/url-q28QhI7l.js +3 -0
- package/dist/gateway/static/root/assets/{utils-B4Vw3fnc.js → utils-DK_1H47k.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-BFY67Hhp.js → voice-api-key-field-BYN2EIMs.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-page.utils-yUJ5jexd.js → workflow-page.utils-Bi19YNTr.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-DIMHCpNt.js → workflows-page-DP57FEKW.js} +1 -1
- package/dist/gateway/static/root/index.html +5 -5
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.d.ts +4 -0
- package/dist/src/agent/agent-manager.js +84 -4
- package/dist/src/agent/agent-manager.js.map +1 -1
- package/dist/src/agent/child-agent-factory.d.ts +1 -0
- package/dist/src/agent/child-agent-factory.js +13 -10
- package/dist/src/agent/child-agent-factory.js.map +1 -1
- package/dist/src/agent/embedded/run-for-session.d.ts +1 -0
- package/dist/src/agent/embedded/run-for-session.js +2 -0
- package/dist/src/agent/embedded/run-for-session.js.map +1 -1
- package/dist/src/agent/embedded/run-turn.js +1 -17
- package/dist/src/agent/embedded/run-turn.js.map +1 -1
- package/dist/src/agent/embedded/session-runner.js +3 -1
- package/dist/src/agent/embedded/session-runner.js.map +1 -1
- package/dist/src/agent/embedded/session-tool-result-guard.d.ts +1 -0
- package/dist/src/agent/embedded/session-tool-result-guard.js +1 -0
- package/dist/src/agent/embedded/session-tool-result-guard.js.map +1 -1
- package/dist/src/agent/inbound/attachment-pipeline.d.ts +37 -0
- package/dist/src/agent/inbound/attachment-pipeline.js +169 -0
- package/dist/src/agent/inbound/attachment-pipeline.js.map +1 -0
- package/dist/src/agent/inbound/turn-dispatcher.d.ts +3 -5
- package/dist/src/agent/inbound/turn-dispatcher.js +1 -2
- package/dist/src/agent/inbound/turn-dispatcher.js.map +1 -1
- package/dist/src/agent/memory/index.d.ts +2 -0
- package/dist/src/agent/memory/index.js +2 -1
- package/dist/src/agent/memory/memory-flush.d.ts +27 -0
- package/dist/src/agent/memory/memory-flush.js +124 -0
- package/dist/src/agent/memory/memory-flush.js.map +1 -0
- package/dist/src/agent/messaging/outbound-coordinator.js +2 -1
- package/dist/src/agent/messaging/outbound-coordinator.js.map +1 -1
- package/dist/src/agent/messaging/stream-manager.d.ts +2 -0
- package/dist/src/agent/messaging/stream-manager.js +3 -0
- package/dist/src/agent/messaging/stream-manager.js.map +1 -1
- package/dist/src/agent/orchestration/agent-orchestrator.d.ts +0 -4
- package/dist/src/agent/orchestration/agent-orchestrator.js +40 -107
- package/dist/src/agent/orchestration/agent-orchestrator.js.map +1 -1
- package/dist/src/agent/prompt/contribution.d.ts +9 -0
- package/dist/src/agent/prompt/contribution.js +1 -0
- package/dist/src/agent/prompt/safety.js +0 -10
- package/dist/src/agent/prompt/safety.js.map +1 -1
- package/dist/src/agent/prompt/sanitize-for-prompt.d.ts +6 -0
- package/dist/src/agent/prompt/sanitize-for-prompt.js +13 -0
- package/dist/src/agent/prompt/sanitize-for-prompt.js.map +1 -0
- package/dist/src/agent/prompt/sections/behavior.d.ts +5 -0
- package/dist/src/agent/prompt/sections/behavior.js +50 -0
- package/dist/src/agent/prompt/sections/behavior.js.map +1 -0
- package/dist/src/agent/prompt/sections/memory-skills.d.ts +9 -0
- package/dist/src/agent/prompt/sections/memory-skills.js +59 -0
- package/dist/src/agent/prompt/sections/memory-skills.js.map +1 -0
- package/dist/src/agent/prompt/sections/messaging-runtime.d.ts +16 -0
- package/dist/src/agent/prompt/sections/messaging-runtime.js +69 -0
- package/dist/src/agent/prompt/sections/messaging-runtime.js.map +1 -0
- package/dist/src/agent/prompt/sections/project-context.d.ts +16 -0
- package/dist/src/agent/prompt/sections/project-context.js +58 -0
- package/dist/src/agent/prompt/sections/project-context.js.map +1 -0
- package/dist/src/agent/prompt/sections/tooling.d.ts +5 -0
- package/dist/src/agent/prompt/sections/tooling.js +119 -0
- package/dist/src/agent/prompt/sections/tooling.js.map +1 -0
- package/dist/src/agent/prompt/sections/workspace-runtime.d.ts +11 -0
- package/dist/src/agent/prompt/sections/workspace-runtime.js +32 -0
- package/dist/src/agent/prompt/sections/workspace-runtime.js.map +1 -0
- package/dist/src/agent/prompt/service-prompt-builder.d.ts +13 -0
- package/dist/src/agent/prompt/service-prompt-builder.js +54 -13
- package/dist/src/agent/prompt/service-prompt-builder.js.map +1 -1
- package/dist/src/agent/prompt/subagent-context.d.ts +15 -0
- package/dist/src/agent/prompt/subagent-context.js +68 -0
- package/dist/src/agent/prompt/subagent-context.js.map +1 -0
- package/dist/src/agent/prompt/system-prompt-params.d.ts +53 -0
- package/dist/src/agent/prompt/system-prompt-params.js +74 -0
- package/dist/src/agent/prompt/system-prompt-params.js.map +1 -0
- package/dist/src/agent/prompt/system-prompt.d.ts +22 -11
- package/dist/src/agent/prompt/system-prompt.js +79 -193
- package/dist/src/agent/prompt/system-prompt.js.map +1 -1
- package/dist/src/agent/prompt/types.d.ts +3 -0
- package/dist/src/agent/service/build-direct-message-content.d.ts +5 -21
- package/dist/src/agent/service/build-direct-message-content.js +11 -64
- package/dist/src/agent/service/build-direct-message-content.js.map +1 -1
- package/dist/src/agent/service/direct-turn-helpers.d.ts +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +7 -0
- package/dist/src/agent/service/direct-turn-helpers.js.map +1 -1
- package/dist/src/agent/service/process-direct-one-shot.d.ts +3 -3
- package/dist/src/agent/service/process-direct-one-shot.js +22 -17
- package/dist/src/agent/service/process-direct-one-shot.js.map +1 -1
- package/dist/src/agent/service/process-direct-streaming.d.ts +6 -20
- package/dist/src/agent/service/process-direct-streaming.js +39 -40
- package/dist/src/agent/service/process-direct-streaming.js.map +1 -1
- package/dist/src/agent/service/webchat-tts.d.ts +4 -9
- package/dist/src/agent/service/webchat-tts.js +9 -20
- package/dist/src/agent/service/webchat-tts.js.map +1 -1
- package/dist/src/agent/service.d.ts +8 -19
- package/dist/src/agent/service.js +53 -11
- package/dist/src/agent/service.js.map +1 -1
- package/dist/src/agent/tools/factory.js +2 -0
- 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/tools/media-read-tool.d.ts +2 -0
- package/dist/src/agent/tools/media-read-tool.js +89 -0
- package/dist/src/agent/tools/media-read-tool.js.map +1 -0
- package/dist/src/auth/credentials.js +0 -1
- package/dist/src/auth/credentials.js.map +1 -1
- package/dist/src/channels/attachments/attachment-classifiers.d.ts +8 -0
- package/dist/src/channels/attachments/attachment-classifiers.js +11 -0
- package/dist/src/channels/attachments/attachment-classifiers.js.map +1 -0
- package/dist/src/channels/attachments/inbound-persist.d.ts +13 -34
- package/dist/src/channels/attachments/inbound-persist.js +34 -102
- package/dist/src/channels/attachments/inbound-persist.js.map +1 -1
- package/dist/src/channels/attachments/inbound-types.d.ts +13 -0
- package/dist/src/channels/attachments/inbound-types.js +30 -0
- package/dist/src/channels/attachments/inbound-types.js.map +1 -0
- package/dist/src/channels/attachments/outbound-tts-persist.d.ts +3 -12
- package/dist/src/channels/attachments/outbound-tts-persist.js +28 -48
- package/dist/src/channels/attachments/outbound-tts-persist.js.map +1 -1
- package/dist/src/channels/attachments/voice-stt-webchat.d.ts +3 -3
- package/dist/src/channels/attachments/voice-stt-webchat.js +8 -14
- package/dist/src/channels/attachments/voice-stt-webchat.js.map +1 -1
- package/dist/src/channels/channel-domain.d.ts +30 -2
- package/dist/src/channels/exec-approval-runtime.d.ts +29 -0
- package/dist/src/channels/exec-approval-runtime.js +30 -0
- package/dist/src/channels/exec-approval-runtime.js.map +1 -0
- package/dist/src/channels/index.js +1 -1
- package/dist/src/channels/plugin-types.d.ts +1 -0
- package/dist/src/channels/transport-types.d.ts +2 -2
- package/dist/src/cli/bin.d.ts +1 -0
- package/dist/src/cli/bin.js +1 -0
- package/dist/src/cli/bin.js.map +1 -1
- package/dist/src/cli/commands/channels.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.d.ts +2 -0
- package/dist/src/cli/commands/doctor/checks/database-schema.js +62 -0
- package/dist/src/cli/commands/doctor/checks/database-schema.js.map +1 -0
- package/dist/src/cli/commands/doctor/flow.js +2 -0
- package/dist/src/cli/commands/doctor/flow.js.map +1 -1
- package/dist/src/cli/commands/init.js +2 -57
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/onboard/channels/registry.js +1 -1
- package/dist/src/cli/commands/setup.js +6 -5
- package/dist/src/cli/commands/setup.js.map +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +1 -2
- package/dist/src/cli/utils/init-workspace-core.js.map +1 -1
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/paths.d.ts +0 -13
- package/dist/src/config/paths.js +1 -20
- package/dist/src/config/paths.js.map +1 -1
- package/dist/src/config/rules.js +1 -1
- package/dist/src/config/schema.d.ts +24 -0
- package/dist/src/config/schema.js +33 -2
- package/dist/src/config/schema.js.map +1 -1
- package/dist/src/cron/executor.js +2 -2
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/oauth-async.js +36 -3
- package/dist/src/gateway/hono/oauth-async.js.map +1 -1
- package/dist/src/gateway/hono/routes/config-patch/channels.js +3 -3
- package/dist/src/gateway/hono/routes/config-patch/channels.js.map +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/lazy-bundles.js.map +1 -1
- package/dist/src/gateway/hono/routes/media.d.ts +3 -0
- package/dist/src/gateway/hono/routes/media.js +50 -0
- package/dist/src/gateway/hono/routes/media.js.map +1 -0
- package/dist/src/gateway/hono/routes/sessions.js +6 -0
- package/dist/src/gateway/hono/routes/sessions.js.map +1 -1
- package/dist/src/gateway/hono/routes/workspace.js +1 -87
- package/dist/src/gateway/hono/routes/workspace.js.map +1 -1
- package/dist/src/gateway/service/sessions-api.js +3 -0
- package/dist/src/gateway/service/sessions-api.js.map +1 -1
- package/dist/src/infra/http-proxy-env.d.ts +4 -0
- package/dist/src/infra/http-proxy-env.js +23 -0
- package/dist/src/infra/http-proxy-env.js.map +1 -0
- package/dist/src/media/index.d.ts +5 -0
- package/dist/src/media/index.js +5 -0
- package/dist/src/media/media-reference.d.ts +23 -0
- package/dist/src/media/media-reference.js +34 -0
- package/dist/src/media/media-reference.js.map +1 -0
- package/dist/src/media/paths.d.ts +5 -0
- package/dist/src/media/paths.js +20 -0
- package/dist/src/media/paths.js.map +1 -0
- package/dist/src/media/session-references.d.ts +8 -0
- package/dist/src/media/session-references.js +45 -0
- package/dist/src/media/session-references.js.map +1 -0
- package/dist/src/media/store.d.ts +19 -0
- package/dist/src/media/store.js +131 -0
- package/dist/src/media/store.js.map +1 -0
- package/dist/src/media/types.d.ts +34 -0
- package/dist/src/media/types.js +1 -0
- package/dist/src/media/uri.d.ts +15 -0
- package/dist/src/media/uri.js +51 -0
- package/dist/src/media/uri.js.map +1 -0
- package/dist/src/session/session-title.js +6 -3
- package/dist/src/session/session-title.js.map +1 -1
- package/dist/src/session/store.js +1 -1
- package/dist/src/session/store.js.map +1 -1
- package/dist/src/session/types.d.ts +12 -7
- package/dist/src/session/types.js.map +1 -1
- package/dist/src/storage/sqlite/index.d.ts +4 -1
- package/dist/src/storage/sqlite/index.js +6 -2
- package/dist/src/storage/sqlite/migrations/002_add_flush_columns.sql +3 -0
- package/dist/src/storage/sqlite/migrations/discover.d.ts +4 -0
- package/dist/src/storage/sqlite/migrations/discover.js +38 -0
- package/dist/src/storage/sqlite/migrations/discover.js.map +1 -0
- package/dist/src/storage/sqlite/migrations/discover.ts +52 -0
- package/dist/src/storage/sqlite/migrations/errors.d.ts +11 -0
- package/dist/src/storage/sqlite/migrations/errors.js +27 -0
- package/dist/src/storage/sqlite/migrations/errors.js.map +1 -0
- package/dist/src/storage/sqlite/migrations/errors.ts +32 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +22 -0
- package/dist/src/storage/sqlite/migrations/runner.js +97 -0
- package/dist/src/storage/sqlite/migrations/runner.js.map +1 -0
- package/dist/src/storage/sqlite/migrations/runner.ts +153 -0
- package/dist/src/storage/sqlite/migrations/types.d.ts +12 -0
- package/dist/src/storage/sqlite/migrations/types.js +1 -0
- package/dist/src/storage/sqlite/migrations/types.ts +13 -0
- package/dist/src/storage/sqlite/row-mappers.d.ts +4 -0
- package/dist/src/storage/sqlite/row-mappers.js +4 -0
- package/dist/src/storage/sqlite/row-mappers.js.map +1 -1
- package/dist/src/storage/sqlite/schema-version.d.ts +6 -0
- package/dist/src/storage/sqlite/schema-version.js +29 -0
- package/dist/src/storage/sqlite/schema-version.js.map +1 -0
- package/dist/src/storage/sqlite/schema.d.ts +5 -3
- package/dist/src/storage/sqlite/schema.js +24 -28
- package/dist/src/storage/sqlite/schema.js.map +1 -1
- package/dist/src/storage/sqlite/schema.sql +2 -0
- package/dist/src/storage/sqlite/session-metadata.js +1 -0
- package/dist/src/storage/sqlite/session-metadata.js.map +1 -1
- package/dist/src/storage/sqlite/session-repository.js +7 -3
- package/dist/src/storage/sqlite/session-repository.js.map +1 -1
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/channels-settings-BxW1Xio4.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-Cxm6AvQO.js +0 -8
- package/dist/gateway/static/root/assets/index-BJDmBCSl.css +0 -1
- package/dist/gateway/static/root/assets/index-Cbg5TS5m.js +0 -4707
- package/dist/gateway/static/root/assets/url-DpFBIyN9.js +0 -3
- package/dist/src/cli/commands/onboard/workspace.d.ts +0 -14
- package/dist/src/cli/commands/onboard/workspace.js +0 -33
- package/dist/src/cli/commands/onboard/workspace.js.map +0 -1
- package/dist/src/cli/utils/workspace.d.ts +0 -35
- package/dist/src/cli/utils/workspace.js +0 -72
- package/dist/src/cli/utils/workspace.js.map +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/agent/prompt/sanitize-for-prompt.ts
|
|
2
|
+
/**
|
|
3
|
+
* Sanitize untrusted strings before embedding them into an LLM prompt.
|
|
4
|
+
*
|
|
5
|
+
* Strips control/format characters that could break prompt structure or inject instructions.
|
|
6
|
+
*/
|
|
7
|
+
function sanitizeForPromptLiteral(value) {
|
|
8
|
+
return value.replace(/[\p{Cc}\p{Cf}\u2028\u2029]/gu, "");
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { sanitizeForPromptLiteral };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=sanitize-for-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sanitize-for-prompt.js","names":[],"sources":["../../../../src/agent/prompt/sanitize-for-prompt.ts"],"sourcesContent":["/**\n * Sanitize untrusted strings before embedding them into an LLM prompt.\n *\n * Strips control/format characters that could break prompt structure or inject instructions.\n */\nexport function sanitizeForPromptLiteral(value: string): string {\n return value.replace(/[\\p{Cc}\\p{Cf}\\u2028\\u2029]/gu, '');\n}\n"],"mappings":";;;;;;AAKA,SAAgB,yBAAyB,OAAuB;AAC9D,QAAO,MAAM,QAAQ,gCAAgC,GAAG"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function buildToolCallStyleSection(): string;
|
|
2
|
+
export declare function buildExecutionBiasSection(): string;
|
|
3
|
+
export declare function buildProblemSolvingSection(): string;
|
|
4
|
+
export declare function buildAestheticSection(): string;
|
|
5
|
+
export declare function buildSafetySection(): string;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
//#region src/agent/prompt/sections/behavior.ts
|
|
2
|
+
function buildToolCallStyleSection() {
|
|
3
|
+
return [
|
|
4
|
+
"## Tool Call Style",
|
|
5
|
+
"Default: do not narrate routine, low-risk tool calls (just call the tool).",
|
|
6
|
+
"Narrate only when it helps: multi-step work, complex/challenging problems, sensitive actions (e.g., deletions), or when the user explicitly asks.",
|
|
7
|
+
"Keep narration brief and value-dense; avoid repeating obvious steps.",
|
|
8
|
+
"Use plain human language for narration unless in a technical context.",
|
|
9
|
+
"When a first-class tool exists for an action, use the tool directly instead of asking the user to run equivalent CLI commands."
|
|
10
|
+
].join("\n");
|
|
11
|
+
}
|
|
12
|
+
function buildExecutionBiasSection() {
|
|
13
|
+
return [
|
|
14
|
+
"## Execution Bias",
|
|
15
|
+
"- Actionable request: act in this turn.",
|
|
16
|
+
"- Non-final turn: use tools to advance, or ask for the one missing decision that blocks safe progress.",
|
|
17
|
+
"- Continue until done or genuinely blocked; do not finish with a plan/promise when tools can move it forward.",
|
|
18
|
+
"- Weak/empty tool result: vary query, path, command, or source before concluding.",
|
|
19
|
+
"- Mutable facts need live checks: files, git, clocks, versions, services, processes, package state.",
|
|
20
|
+
"- Final answer needs evidence: test/build/lint, screenshot, inspection, tool output, or a named blocker.",
|
|
21
|
+
"- Longer work: brief progress update, then keep going; use delegation or workflows when they fit."
|
|
22
|
+
].join("\n");
|
|
23
|
+
}
|
|
24
|
+
function buildProblemSolvingSection() {
|
|
25
|
+
return [
|
|
26
|
+
"## Problem Solving",
|
|
27
|
+
"**Simple tasks** (< 5 minutes or a single-file change): Do them directly; run a quick verification after changes.",
|
|
28
|
+
"**Complex tasks** (multiple files or design decisions): Use an iterative flow — Plan → Build → Verify → Fix.",
|
|
29
|
+
"**Core principle: Match the complexity; reject ritual for its own sake. Verification matters, but do not verify just to tick a box.**"
|
|
30
|
+
].join("\n");
|
|
31
|
+
}
|
|
32
|
+
function buildAestheticSection() {
|
|
33
|
+
return [
|
|
34
|
+
"## Tone & Style",
|
|
35
|
+
"**Default voice:** Direct, concise, concrete.",
|
|
36
|
+
"**SOUL.md takes precedence:** If SOUL.md defines a specific tone, defer to it over the above."
|
|
37
|
+
].join("\n");
|
|
38
|
+
}
|
|
39
|
+
function buildSafetySection() {
|
|
40
|
+
return [
|
|
41
|
+
"## Safety",
|
|
42
|
+
"- You have no independent goals: do not pursue self-preservation, replication, resource acquisition, or power-seeking; avoid long-term plans beyond the user's request.",
|
|
43
|
+
"- Prioritize safety and human oversight over completion; if instructions conflict, pause and ask; comply with stop/pause/audit requests and never bypass safeguards.",
|
|
44
|
+
"- Do not manipulate or persuade anyone to expand access or disable safeguards. Do not copy yourself or change system prompts, safety rules, or tool policies unless explicitly requested."
|
|
45
|
+
].join("\n");
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { buildAestheticSection, buildExecutionBiasSection, buildProblemSolvingSection, buildSafetySection, buildToolCallStyleSection };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=behavior.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"behavior.js","names":[],"sources":["../../../../../src/agent/prompt/sections/behavior.ts"],"sourcesContent":["export function buildToolCallStyleSection(): string {\n return [\n '## Tool Call Style',\n 'Default: do not narrate routine, low-risk tool calls (just call the tool).',\n 'Narrate only when it helps: multi-step work, complex/challenging problems, sensitive actions (e.g., deletions), or when the user explicitly asks.',\n 'Keep narration brief and value-dense; avoid repeating obvious steps.',\n 'Use plain human language for narration unless in a technical context.',\n 'When a first-class tool exists for an action, use the tool directly instead of asking the user to run equivalent CLI commands.',\n ].join('\\n');\n}\n\nexport function buildExecutionBiasSection(): string {\n return [\n '## Execution Bias',\n '- Actionable request: act in this turn.',\n '- Non-final turn: use tools to advance, or ask for the one missing decision that blocks safe progress.',\n '- Continue until done or genuinely blocked; do not finish with a plan/promise when tools can move it forward.',\n '- Weak/empty tool result: vary query, path, command, or source before concluding.',\n '- Mutable facts need live checks: files, git, clocks, versions, services, processes, package state.',\n '- Final answer needs evidence: test/build/lint, screenshot, inspection, tool output, or a named blocker.',\n '- Longer work: brief progress update, then keep going; use delegation or workflows when they fit.',\n ].join('\\n');\n}\n\nexport function buildProblemSolvingSection(): string {\n return [\n '## Problem Solving',\n '**Simple tasks** (< 5 minutes or a single-file change): Do them directly; run a quick verification after changes.',\n '**Complex tasks** (multiple files or design decisions): Use an iterative flow — Plan → Build → Verify → Fix.',\n '**Core principle: Match the complexity; reject ritual for its own sake. Verification matters, but do not verify just to tick a box.**',\n ].join('\\n');\n}\n\nexport function buildAestheticSection(): string {\n return [\n '## Tone & Style',\n '**Default voice:** Direct, concise, concrete.',\n '**SOUL.md takes precedence:** If SOUL.md defines a specific tone, defer to it over the above.',\n ].join('\\n');\n}\n\nexport function buildSafetySection(): string {\n return [\n '## Safety',\n '- You have no independent goals: do not pursue self-preservation, replication, resource acquisition, or power-seeking; avoid long-term plans beyond the user\\'s request.',\n '- Prioritize safety and human oversight over completion; if instructions conflict, pause and ask; comply with stop/pause/audit requests and never bypass safeguards.',\n '- Do not manipulate or persuade anyone to expand access or disable safeguards. Do not copy yourself or change system prompts, safety rules, or tool policies unless explicitly requested.',\n ].join('\\n');\n}\n"],"mappings":";AAAA,SAAgB,4BAAoC;AAClD,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,KAAK;;AAGd,SAAgB,4BAAoC;AAClD,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,KAAK;;AAGd,SAAgB,6BAAqC;AACnD,QAAO;EACL;EACA;EACA;EACA;EACD,CAAC,KAAK,KAAK;;AAGd,SAAgB,wBAAgC;AAC9C,QAAO;EACL;EACA;EACA;EACD,CAAC,KAAK,KAAK;;AAGd,SAAgB,qBAA6B;AAC3C,QAAO;EACL;EACA;EACA;EACA;EACD,CAAC,KAAK,KAAK"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MemoryCitationsMode } from '../types.js';
|
|
2
|
+
export declare function buildMemorySection(params: {
|
|
3
|
+
availableTools: Set<string>;
|
|
4
|
+
citationsMode?: MemoryCitationsMode;
|
|
5
|
+
hasProfileMemory?: boolean;
|
|
6
|
+
includeMemorySection?: boolean;
|
|
7
|
+
}): string;
|
|
8
|
+
export declare function buildExternalMemorySection(text: string | undefined): string;
|
|
9
|
+
export declare function buildSkillsSection(hasSkillTools: boolean): string;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//#region src/agent/prompt/sections/memory-skills.ts
|
|
2
|
+
function buildMemorySection(params) {
|
|
3
|
+
if (params.includeMemorySection === false) return "";
|
|
4
|
+
if (!(params.availableTools.has("memory_search") || params.availableTools.has("memory_get") || params.availableTools.has("curated_memory")) && !params.hasProfileMemory) return "";
|
|
5
|
+
const citationsMode = params.citationsMode ?? "on";
|
|
6
|
+
const citationInstruction = citationsMode === "off" ? "Citations are disabled: do not mention file paths or line numbers in replies." : citationsMode === "source-only" ? "Citations: mention file path when it helps (e.g., Source: MEMORY.md)." : "Citations: include Source: <path#line> when it helps the user verify memory snippets.";
|
|
7
|
+
const toolLines = [];
|
|
8
|
+
if (params.availableTools.has("memory_search")) toolLines.push("1. Run `memory_search` on profile MEMORY.md and workspace `memory/*.md`");
|
|
9
|
+
if (params.availableTools.has("session_search")) toolLines.push(`${toolLines.length + 1}. For **other chat sessions** / cross-session history, use \`session_search\` with keywords (or omit \`query\` to list recent sessions)`);
|
|
10
|
+
if (params.availableTools.has("memory_get")) toolLines.push(`${toolLines.length + 1}. Use \`memory_get\` to pull only the needed lines from files`);
|
|
11
|
+
if (params.availableTools.has("curated_memory")) toolLines.push(`${toolLines.length + 1}. For structured curated notes under agent home \`memories/\`, use \`curated_memory\``);
|
|
12
|
+
toolLines.push(`${toolLines.length + 1}. If low confidence after search, say you checked`);
|
|
13
|
+
return [
|
|
14
|
+
"## Memory Recall",
|
|
15
|
+
"",
|
|
16
|
+
citationInstruction,
|
|
17
|
+
"",
|
|
18
|
+
"Startup profile files (SOUL, USER, MEMORY, etc.) are already in Project Context above when injected. Do not re-read them unless the user asks or you need lines beyond what was injected.",
|
|
19
|
+
"",
|
|
20
|
+
"Before answering anything about prior work, decisions, dates, people, preferences, or todos:",
|
|
21
|
+
...toolLines,
|
|
22
|
+
"",
|
|
23
|
+
"### Memory Files",
|
|
24
|
+
"",
|
|
25
|
+
"- **Daily notes:** `memory/YYYY-MM-DD.md` — raw logs (runtime may preload recent days on /new or reset)",
|
|
26
|
+
"- **Long-term:** profile `MEMORY.md` — curated memories in Project Context when present",
|
|
27
|
+
"- **Curated store:** agent home `memories/MEMORY.md` and `memories/USER.md` — use `curated_memory` for live read/write",
|
|
28
|
+
"",
|
|
29
|
+
"### Writing to Memory",
|
|
30
|
+
"",
|
|
31
|
+
"- **Declarative vs procedural:** Save facts and preferences via workspace memory files and/or `curated_memory`. Save reusable task playbooks with `skill_manage` as skills.",
|
|
32
|
+
"- **Memory is limited** — if you want to remember something, WRITE IT TO A FILE",
|
|
33
|
+
"- When someone says \"remember this\" → update `memory/YYYY-MM-DD.md` or relevant file",
|
|
34
|
+
"- **Text > Brain**"
|
|
35
|
+
].join("\n");
|
|
36
|
+
}
|
|
37
|
+
function buildExternalMemorySection(text) {
|
|
38
|
+
const t = text?.trim();
|
|
39
|
+
if (!t) return "";
|
|
40
|
+
return `## External memory provider\n\n${t}`;
|
|
41
|
+
}
|
|
42
|
+
function buildSkillsSection(hasSkillTools) {
|
|
43
|
+
if (!hasSkillTools) return "";
|
|
44
|
+
return [
|
|
45
|
+
"## Skills (mandatory)",
|
|
46
|
+
"Before replying: scan <available_skills> <description> entries.",
|
|
47
|
+
"- If exactly one skill clearly applies: use `skill_view(name)` to load its SKILL.md, then follow it.",
|
|
48
|
+
"- If multiple could apply: choose the most specific one, then load/follow it.",
|
|
49
|
+
"- If none clearly apply: do not load any SKILL.md.",
|
|
50
|
+
"Constraints: never load more than one skill up front; only load after selecting.",
|
|
51
|
+
"- When a skill drives external API writes, assume rate limits: prefer fewer larger writes, avoid tight one-item loops, serialize bursts when possible, and respect 429/Retry-After.",
|
|
52
|
+
"",
|
|
53
|
+
"**Division of labor with memory:** Skills = **procedural** workflows; memory / `curated_memory` = **declarative** facts and preferences."
|
|
54
|
+
].join("\n");
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { buildExternalMemorySection, buildMemorySection, buildSkillsSection };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=memory-skills.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-skills.js","names":[],"sources":["../../../../../src/agent/prompt/sections/memory-skills.ts"],"sourcesContent":["import type { MemoryCitationsMode } from '../types.js';\n\nexport function buildMemorySection(params: {\n availableTools: Set<string>;\n citationsMode?: MemoryCitationsMode;\n hasProfileMemory?: boolean;\n includeMemorySection?: boolean;\n}): string {\n if (params.includeMemorySection === false) {\n return '';\n }\n const hasMemoryTools =\n params.availableTools.has('memory_search') ||\n params.availableTools.has('memory_get') ||\n params.availableTools.has('curated_memory');\n if (!hasMemoryTools && !params.hasProfileMemory) {\n return '';\n }\n\n const citationsMode = params.citationsMode ?? 'on';\n const citationInstruction =\n citationsMode === 'off'\n ? 'Citations are disabled: do not mention file paths or line numbers in replies.'\n : citationsMode === 'source-only'\n ? 'Citations: mention file path when it helps (e.g., Source: MEMORY.md).'\n : 'Citations: include Source: <path#line> when it helps the user verify memory snippets.';\n\n const toolLines: string[] = [];\n if (params.availableTools.has('memory_search')) {\n toolLines.push('1. Run `memory_search` on profile MEMORY.md and workspace `memory/*.md`');\n }\n if (params.availableTools.has('session_search')) {\n toolLines.push(\n `${toolLines.length + 1}. For **other chat sessions** / cross-session history, use \\`session_search\\` with keywords (or omit \\`query\\` to list recent sessions)`,\n );\n }\n if (params.availableTools.has('memory_get')) {\n toolLines.push(`${toolLines.length + 1}. Use \\`memory_get\\` to pull only the needed lines from files`);\n }\n if (params.availableTools.has('curated_memory')) {\n toolLines.push(\n `${toolLines.length + 1}. For structured curated notes under agent home \\`memories/\\`, use \\`curated_memory\\``,\n );\n }\n toolLines.push(`${toolLines.length + 1}. If low confidence after search, say you checked`);\n\n return [\n '## Memory Recall',\n '',\n citationInstruction,\n '',\n 'Startup profile files (SOUL, USER, MEMORY, etc.) are already in Project Context above when injected. Do not re-read them unless the user asks or you need lines beyond what was injected.',\n '',\n 'Before answering anything about prior work, decisions, dates, people, preferences, or todos:',\n ...toolLines,\n '',\n '### Memory Files',\n '',\n '- **Daily notes:** `memory/YYYY-MM-DD.md` — raw logs (runtime may preload recent days on /new or reset)',\n '- **Long-term:** profile `MEMORY.md` — curated memories in Project Context when present',\n '- **Curated store:** agent home `memories/MEMORY.md` and `memories/USER.md` — use `curated_memory` for live read/write',\n '',\n '### Writing to Memory',\n '',\n '- **Declarative vs procedural:** Save facts and preferences via workspace memory files and/or `curated_memory`. Save reusable task playbooks with `skill_manage` as skills.',\n '- **Memory is limited** — if you want to remember something, WRITE IT TO A FILE',\n '- When someone says \"remember this\" → update `memory/YYYY-MM-DD.md` or relevant file',\n '- **Text > Brain**',\n ].join('\\n');\n}\n\nexport function buildExternalMemorySection(text: string | undefined): string {\n const t = text?.trim();\n if (!t) {\n return '';\n }\n return `## External memory provider\\n\\n${t}`;\n}\n\nexport function buildSkillsSection(hasSkillTools: boolean): string {\n if (!hasSkillTools) {\n return '';\n }\n\n return [\n '## Skills (mandatory)',\n 'Before replying: scan <available_skills> <description> entries.',\n '- If exactly one skill clearly applies: use `skill_view(name)` to load its SKILL.md, then follow it.',\n '- If multiple could apply: choose the most specific one, then load/follow it.',\n '- If none clearly apply: do not load any SKILL.md.',\n 'Constraints: never load more than one skill up front; only load after selecting.',\n '- When a skill drives external API writes, assume rate limits: prefer fewer larger writes, avoid tight one-item loops, serialize bursts when possible, and respect 429/Retry-After.',\n '',\n '**Division of labor with memory:** Skills = **procedural** workflows; memory / `curated_memory` = **declarative** facts and preferences.',\n ].join('\\n');\n}\n"],"mappings":";AAEA,SAAgB,mBAAmB,QAKxB;AACT,KAAI,OAAO,yBAAyB,MAClC,QAAO;AAMT,KAAI,EAHF,OAAO,eAAe,IAAI,gBAAgB,IAC1C,OAAO,eAAe,IAAI,aAAa,IACvC,OAAO,eAAe,IAAI,iBAAiB,KACtB,CAAC,OAAO,iBAC7B,QAAO;CAGT,MAAM,gBAAgB,OAAO,iBAAiB;CAC9C,MAAM,sBACJ,kBAAkB,QACd,kFACA,kBAAkB,gBAChB,0EACA;CAER,MAAM,YAAsB,EAAE;AAC9B,KAAI,OAAO,eAAe,IAAI,gBAAgB,CAC5C,WAAU,KAAK,0EAA0E;AAE3F,KAAI,OAAO,eAAe,IAAI,iBAAiB,CAC7C,WAAU,KACR,GAAG,UAAU,SAAS,EAAE,yIACzB;AAEH,KAAI,OAAO,eAAe,IAAI,aAAa,CACzC,WAAU,KAAK,GAAG,UAAU,SAAS,EAAE,+DAA+D;AAExG,KAAI,OAAO,eAAe,IAAI,iBAAiB,CAC7C,WAAU,KACR,GAAG,UAAU,SAAS,EAAE,uFACzB;AAEH,WAAU,KAAK,GAAG,UAAU,SAAS,EAAE,mDAAmD;AAE1F,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA,GAAG;EACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,KAAK;;AAGd,SAAgB,2BAA2B,MAAkC;CAC3E,MAAM,IAAI,MAAM,MAAM;AACtB,KAAI,CAAC,EACH,QAAO;AAET,QAAO,kCAAkC;;AAG3C,SAAgB,mBAAmB,eAAgC;AACjE,KAAI,CAAC,cACH,QAAO;AAGT,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,KAAK"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare function buildMessagingSection(params: {
|
|
2
|
+
channels: string[];
|
|
3
|
+
isMinimal: boolean;
|
|
4
|
+
hasSendMessage: boolean;
|
|
5
|
+
}): string;
|
|
6
|
+
export declare function buildSilentRepliesSection(params: {
|
|
7
|
+
isMinimal: boolean;
|
|
8
|
+
silentReplyPromptMode?: 'generic' | 'none';
|
|
9
|
+
}): string;
|
|
10
|
+
export declare function buildOutputDirectivesSection(isMinimal: boolean): string;
|
|
11
|
+
export declare function buildTimeSection(timezone?: string): string;
|
|
12
|
+
export declare function buildHeartbeatBehaviorSection(params: {
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
customPrompt?: string;
|
|
15
|
+
userTimezone?: string;
|
|
16
|
+
}): string;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { NO_REPLY } from "../../../heartbeat/tokens.js";
|
|
2
|
+
//#region src/agent/prompt/sections/messaging-runtime.ts
|
|
3
|
+
function buildMessagingSection(params) {
|
|
4
|
+
if (params.isMinimal || params.channels.length === 0) return "";
|
|
5
|
+
const channelList = params.channels.join(", ");
|
|
6
|
+
const messageToolLine = params.hasSendMessage ? `- Use \`send_message\` for proactive sends + channel actions` : "- Outbound messaging tools are not available in this session";
|
|
7
|
+
return [
|
|
8
|
+
"## Messaging",
|
|
9
|
+
`- Reply in current session → automatically routes to the source channel (${channelList})`,
|
|
10
|
+
messageToolLine,
|
|
11
|
+
`- If you use \`send_message\` to deliver your user-visible reply, respond with ONLY: ${NO_REPLY} (avoid duplicate replies)`
|
|
12
|
+
].join("\n");
|
|
13
|
+
}
|
|
14
|
+
function buildSilentRepliesSection(params) {
|
|
15
|
+
if (params.isMinimal || params.silentReplyPromptMode === "none") return "";
|
|
16
|
+
return [
|
|
17
|
+
"## Silent Replies",
|
|
18
|
+
`When you have nothing to say, respond with ONLY: ${NO_REPLY}`,
|
|
19
|
+
"",
|
|
20
|
+
"Rules:",
|
|
21
|
+
"- It must be your ENTIRE message — nothing else",
|
|
22
|
+
`- Never append it to an actual response (never include "${NO_REPLY}" in real replies)`,
|
|
23
|
+
"- Never wrap it in markdown or code blocks",
|
|
24
|
+
"",
|
|
25
|
+
`Wrong: "Here's help... ${NO_REPLY}"`,
|
|
26
|
+
`Right: ${NO_REPLY}`
|
|
27
|
+
].join("\n");
|
|
28
|
+
}
|
|
29
|
+
function buildOutputDirectivesSection(isMinimal) {
|
|
30
|
+
if (isMinimal) return "";
|
|
31
|
+
return [
|
|
32
|
+
"## Assistant Output Directives",
|
|
33
|
+
"Use these when you need delivery metadata in an assistant message:",
|
|
34
|
+
"- `MEDIA:<path-or-url>` on its own line requests attachment delivery. Supported clients strip MEDIA lines and render attachments inline; channels still decide actual delivery behavior.",
|
|
35
|
+
"- `[[audio_as_voice]]` marks attached audio as a voice-note style delivery hint when supported.",
|
|
36
|
+
"- To request a native reply/quote on supported surfaces, include one reply tag in your reply:",
|
|
37
|
+
"- Reply tags must be the very first token in the message (no leading text/newlines): [[reply_to_current]] your reply.",
|
|
38
|
+
"- [[reply_to_current]] replies to the triggering message.",
|
|
39
|
+
"- Prefer [[reply_to_current]]. Use [[reply_to:<id>]] only when an id was explicitly provided.",
|
|
40
|
+
"Supported tags are stripped before user-visible rendering; support still depends on the current channel config."
|
|
41
|
+
].join("\n");
|
|
42
|
+
}
|
|
43
|
+
function buildTimeSection(timezone) {
|
|
44
|
+
if (!timezone) return "";
|
|
45
|
+
return [
|
|
46
|
+
"## Current Date & Time",
|
|
47
|
+
`Time zone: ${timezone}`,
|
|
48
|
+
"",
|
|
49
|
+
"If you need the current date/time/day-of-week, use the `session_status` tool or the inbound message timestamp envelope (when present)."
|
|
50
|
+
].join("\n");
|
|
51
|
+
}
|
|
52
|
+
function buildHeartbeatBehaviorSection(params) {
|
|
53
|
+
if (!params.enabled) return "";
|
|
54
|
+
if (params.customPrompt?.trim()) return `## Heartbeats\n\n${params.customPrompt.trim()}`;
|
|
55
|
+
let quietHoursNote = "";
|
|
56
|
+
if (params.userTimezone) quietHoursNote = `\n\n> Quiet hours: The user is in **${params.userTimezone}**. Avoid proactive checks during late night (23:00-08:00) unless urgent.`;
|
|
57
|
+
return [
|
|
58
|
+
"## Heartbeats",
|
|
59
|
+
"",
|
|
60
|
+
"If the current user message is a heartbeat poll and nothing needs attention, reply exactly: HEARTBEAT_OK",
|
|
61
|
+
"",
|
|
62
|
+
"If something needs attention, do NOT include \"HEARTBEAT_OK\"; reply with the alert text instead.",
|
|
63
|
+
quietHoursNote.trim()
|
|
64
|
+
].filter(Boolean).join("\n");
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
export { buildHeartbeatBehaviorSection, buildMessagingSection, buildOutputDirectivesSection, buildSilentRepliesSection, buildTimeSection };
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=messaging-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messaging-runtime.js","names":[],"sources":["../../../../../src/agent/prompt/sections/messaging-runtime.ts"],"sourcesContent":["import { NO_REPLY } from '../../../heartbeat/tokens.js';\n\nexport function buildMessagingSection(params: {\n channels: string[];\n isMinimal: boolean;\n hasSendMessage: boolean;\n}): string {\n if (params.isMinimal || params.channels.length === 0) {\n return '';\n }\n const channelList = params.channels.join(', ');\n const messageToolLine = params.hasSendMessage\n ? `- Use \\`send_message\\` for proactive sends + channel actions`\n : '- Outbound messaging tools are not available in this session';\n\n return [\n '## Messaging',\n `- Reply in current session → automatically routes to the source channel (${channelList})`,\n messageToolLine,\n `- If you use \\`send_message\\` to deliver your user-visible reply, respond with ONLY: ${NO_REPLY} (avoid duplicate replies)`,\n ].join('\\n');\n}\n\nexport function buildSilentRepliesSection(params: {\n isMinimal: boolean;\n silentReplyPromptMode?: 'generic' | 'none';\n}): string {\n if (params.isMinimal || params.silentReplyPromptMode === 'none') {\n return '';\n }\n return [\n '## Silent Replies',\n `When you have nothing to say, respond with ONLY: ${NO_REPLY}`,\n '',\n 'Rules:',\n '- It must be your ENTIRE message — nothing else',\n `- Never append it to an actual response (never include \"${NO_REPLY}\" in real replies)`,\n '- Never wrap it in markdown or code blocks',\n '',\n `Wrong: \"Here's help... ${NO_REPLY}\"`,\n `Right: ${NO_REPLY}`,\n ].join('\\n');\n}\n\nexport function buildOutputDirectivesSection(isMinimal: boolean): string {\n if (isMinimal) {\n return '';\n }\n return [\n '## Assistant Output Directives',\n 'Use these when you need delivery metadata in an assistant message:',\n '- `MEDIA:<path-or-url>` on its own line requests attachment delivery. Supported clients strip MEDIA lines and render attachments inline; channels still decide actual delivery behavior.',\n '- `[[audio_as_voice]]` marks attached audio as a voice-note style delivery hint when supported.',\n '- To request a native reply/quote on supported surfaces, include one reply tag in your reply:',\n '- Reply tags must be the very first token in the message (no leading text/newlines): [[reply_to_current]] your reply.',\n '- [[reply_to_current]] replies to the triggering message.',\n '- Prefer [[reply_to_current]]. Use [[reply_to:<id>]] only when an id was explicitly provided.',\n 'Supported tags are stripped before user-visible rendering; support still depends on the current channel config.',\n ].join('\\n');\n}\n\nexport function buildTimeSection(timezone?: string): string {\n if (!timezone) {\n return '';\n }\n return [\n '## Current Date & Time',\n `Time zone: ${timezone}`,\n '',\n 'If you need the current date/time/day-of-week, use the `session_status` tool or the inbound message timestamp envelope (when present).',\n ].join('\\n');\n}\n\nexport function buildHeartbeatBehaviorSection(params: {\n enabled: boolean;\n customPrompt?: string;\n userTimezone?: string;\n}): string {\n if (!params.enabled) {\n return '';\n }\n if (params.customPrompt?.trim()) {\n return `## Heartbeats\\n\\n${params.customPrompt.trim()}`;\n }\n let quietHoursNote = '';\n if (params.userTimezone) {\n quietHoursNote = `\\n\\n> Quiet hours: The user is in **${params.userTimezone}**. Avoid proactive checks during late night (23:00-08:00) unless urgent.`;\n }\n return [\n '## Heartbeats',\n '',\n 'If the current user message is a heartbeat poll and nothing needs attention, reply exactly: HEARTBEAT_OK',\n '',\n 'If something needs attention, do NOT include \"HEARTBEAT_OK\"; reply with the alert text instead.',\n quietHoursNote.trim(),\n ]\n .filter(Boolean)\n .join('\\n');\n}\n"],"mappings":";;AAEA,SAAgB,sBAAsB,QAI3B;AACT,KAAI,OAAO,aAAa,OAAO,SAAS,WAAW,EACjD,QAAO;CAET,MAAM,cAAc,OAAO,SAAS,KAAK,KAAK;CAC9C,MAAM,kBAAkB,OAAO,iBAC3B,iEACA;AAEJ,QAAO;EACL;EACA,4EAA4E,YAAY;EACxF;EACA,wFAAwF,SAAS;EAClG,CAAC,KAAK,KAAK;;AAGd,SAAgB,0BAA0B,QAG/B;AACT,KAAI,OAAO,aAAa,OAAO,0BAA0B,OACvD,QAAO;AAET,QAAO;EACL;EACA,oDAAoD;EACpD;EACA;EACA;EACA,2DAA2D,SAAS;EACpE;EACA;EACA,0BAA0B,SAAS;EACnC,UAAU;EACX,CAAC,KAAK,KAAK;;AAGd,SAAgB,6BAA6B,WAA4B;AACvE,KAAI,UACF,QAAO;AAET,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,KAAK;;AAGd,SAAgB,iBAAiB,UAA2B;AAC1D,KAAI,CAAC,SACH,QAAO;AAET,QAAO;EACL;EACA,cAAc;EACd;EACA;EACD,CAAC,KAAK,KAAK;;AAGd,SAAgB,8BAA8B,QAInC;AACT,KAAI,CAAC,OAAO,QACV,QAAO;AAET,KAAI,OAAO,cAAc,MAAM,CAC7B,QAAO,oBAAoB,OAAO,aAAa,MAAM;CAEvD,IAAI,iBAAiB;AACrB,KAAI,OAAO,aACT,kBAAiB,uCAAuC,OAAO,aAAa;AAE9E,QAAO;EACL;EACA;EACA;EACA;EACA;EACA,eAAe,MAAM;EACtB,CACE,OAAO,QAAQ,CACf,KAAK,KAAK"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { EmbeddedContextFile } from '../../bootstrap/types.js';
|
|
2
|
+
export declare const CONTEXT_FILE_ORDER: Map<string, number>;
|
|
3
|
+
export declare const DYNAMIC_CONTEXT_FILE_BASENAMES: Set<string>;
|
|
4
|
+
export declare const DEFAULT_HEARTBEAT_PROMPT_CONTEXT_BLOCK = "Default heartbeat prompt:\n`Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK.`";
|
|
5
|
+
export declare function normalizeContextFilePath(pathValue: string): string;
|
|
6
|
+
export declare function getContextFileBasename(pathValue: string): string;
|
|
7
|
+
export declare function isDynamicContextFile(pathValue: string): boolean;
|
|
8
|
+
export declare function sanitizeContextFileContentForPrompt(content: string): string;
|
|
9
|
+
export declare function sortContextFilesForPrompt(contextFiles: EmbeddedContextFile[]): EmbeddedContextFile[];
|
|
10
|
+
export declare function buildProjectContextSection(params: {
|
|
11
|
+
files: EmbeddedContextFile[];
|
|
12
|
+
heading: string;
|
|
13
|
+
dynamic: boolean;
|
|
14
|
+
}): string[];
|
|
15
|
+
/** Whether HEARTBEAT.md is injected as dynamic context (vs behavior-only section). */
|
|
16
|
+
export declare function isHeartbeatContextFile(pathValue: string): boolean;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { DEFAULT_HEARTBEAT_FILENAME } from "../../context/workspace.js";
|
|
2
|
+
//#region src/agent/prompt/sections/project-context.ts
|
|
3
|
+
const CONTEXT_FILE_ORDER = new Map([
|
|
4
|
+
["agents.md", 10],
|
|
5
|
+
["soul.md", 20],
|
|
6
|
+
["identity.md", 30],
|
|
7
|
+
["user.md", 40],
|
|
8
|
+
["tools.md", 50],
|
|
9
|
+
["bootstrap.md", 60],
|
|
10
|
+
["memory.md", 70]
|
|
11
|
+
]);
|
|
12
|
+
const DYNAMIC_CONTEXT_FILE_BASENAMES = new Set(["heartbeat.md"]);
|
|
13
|
+
const DEFAULT_HEARTBEAT_PROMPT_CONTEXT_BLOCK = "Default heartbeat prompt:\n`Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK.`";
|
|
14
|
+
function normalizeContextFilePath(pathValue) {
|
|
15
|
+
return pathValue.trim().replace(/\\/g, "/");
|
|
16
|
+
}
|
|
17
|
+
function getContextFileBasename(pathValue) {
|
|
18
|
+
const normalizedPath = normalizeContextFilePath(pathValue);
|
|
19
|
+
return (normalizedPath.split("/").pop() ?? normalizedPath).toLowerCase();
|
|
20
|
+
}
|
|
21
|
+
function isDynamicContextFile(pathValue) {
|
|
22
|
+
return DYNAMIC_CONTEXT_FILE_BASENAMES.has(getContextFileBasename(pathValue));
|
|
23
|
+
}
|
|
24
|
+
function sanitizeContextFileContentForPrompt(content) {
|
|
25
|
+
return content.replaceAll(DEFAULT_HEARTBEAT_PROMPT_CONTEXT_BLOCK, "").replace(/\n{3,}/g, "\n\n");
|
|
26
|
+
}
|
|
27
|
+
function sortContextFilesForPrompt(contextFiles) {
|
|
28
|
+
return [...contextFiles].sort((a, b) => {
|
|
29
|
+
const aBase = getContextFileBasename(a.path);
|
|
30
|
+
const bBase = getContextFileBasename(b.path);
|
|
31
|
+
const aOrder = CONTEXT_FILE_ORDER.get(aBase) ?? Number.MAX_SAFE_INTEGER;
|
|
32
|
+
const bOrder = CONTEXT_FILE_ORDER.get(bBase) ?? Number.MAX_SAFE_INTEGER;
|
|
33
|
+
if (aOrder !== bOrder) return aOrder - bOrder;
|
|
34
|
+
if (aBase !== bBase) return aBase.localeCompare(bBase);
|
|
35
|
+
return normalizeContextFilePath(a.path).localeCompare(normalizeContextFilePath(b.path));
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function buildProjectContextSection(params) {
|
|
39
|
+
if (params.files.length === 0) return [];
|
|
40
|
+
const lines = [params.heading, ""];
|
|
41
|
+
if (params.dynamic) lines.push("The following frequently-changing project context files are kept below the cache boundary when possible:", "");
|
|
42
|
+
else {
|
|
43
|
+
const hasSoulFile = params.files.some((file) => getContextFileBasename(file.path) === "soul.md");
|
|
44
|
+
lines.push("The following project context files have been loaded:");
|
|
45
|
+
if (hasSoulFile) lines.push("If SOUL.md is present, embody its persona and tone. Avoid stiff, generic replies; follow its guidance unless higher-priority instructions override it.");
|
|
46
|
+
lines.push("");
|
|
47
|
+
}
|
|
48
|
+
for (const file of params.files) lines.push(`## ${file.path}`, "", sanitizeContextFileContentForPrompt(file.content), "");
|
|
49
|
+
return lines;
|
|
50
|
+
}
|
|
51
|
+
/** Whether HEARTBEAT.md is injected as dynamic context (vs behavior-only section). */
|
|
52
|
+
function isHeartbeatContextFile(pathValue) {
|
|
53
|
+
return getContextFileBasename(pathValue) === DEFAULT_HEARTBEAT_FILENAME.toLowerCase();
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { CONTEXT_FILE_ORDER, DEFAULT_HEARTBEAT_PROMPT_CONTEXT_BLOCK, DYNAMIC_CONTEXT_FILE_BASENAMES, buildProjectContextSection, getContextFileBasename, isDynamicContextFile, isHeartbeatContextFile, normalizeContextFilePath, sanitizeContextFileContentForPrompt, sortContextFilesForPrompt };
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=project-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-context.js","names":[],"sources":["../../../../../src/agent/prompt/sections/project-context.ts"],"sourcesContent":["import type { EmbeddedContextFile } from '../../bootstrap/types.js';\nimport { DEFAULT_HEARTBEAT_FILENAME } from '../../context/workspace.js';\n\nexport const CONTEXT_FILE_ORDER = new Map<string, number>([\n ['agents.md', 10],\n ['soul.md', 20],\n ['identity.md', 30],\n ['user.md', 40],\n ['tools.md', 50],\n ['bootstrap.md', 60],\n ['memory.md', 70],\n]);\n\nexport const DYNAMIC_CONTEXT_FILE_BASENAMES = new Set(['heartbeat.md']);\n\nexport const DEFAULT_HEARTBEAT_PROMPT_CONTEXT_BLOCK =\n 'Default heartbeat prompt:\\n`Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK.`';\n\nexport function normalizeContextFilePath(pathValue: string): string {\n return pathValue.trim().replace(/\\\\/g, '/');\n}\n\nexport function getContextFileBasename(pathValue: string): string {\n const normalizedPath = normalizeContextFilePath(pathValue);\n return (normalizedPath.split('/').pop() ?? normalizedPath).toLowerCase();\n}\n\nexport function isDynamicContextFile(pathValue: string): boolean {\n return DYNAMIC_CONTEXT_FILE_BASENAMES.has(getContextFileBasename(pathValue));\n}\n\nexport function sanitizeContextFileContentForPrompt(content: string): string {\n return content.replaceAll(DEFAULT_HEARTBEAT_PROMPT_CONTEXT_BLOCK, '').replace(/\\n{3,}/g, '\\n\\n');\n}\n\nexport function sortContextFilesForPrompt(contextFiles: EmbeddedContextFile[]): EmbeddedContextFile[] {\n return [...contextFiles].sort((a, b) => {\n const aBase = getContextFileBasename(a.path);\n const bBase = getContextFileBasename(b.path);\n const aOrder = CONTEXT_FILE_ORDER.get(aBase) ?? Number.MAX_SAFE_INTEGER;\n const bOrder = CONTEXT_FILE_ORDER.get(bBase) ?? Number.MAX_SAFE_INTEGER;\n if (aOrder !== bOrder) {\n return aOrder - bOrder;\n }\n if (aBase !== bBase) {\n return aBase.localeCompare(bBase);\n }\n return normalizeContextFilePath(a.path).localeCompare(normalizeContextFilePath(b.path));\n });\n}\n\nexport function buildProjectContextSection(params: {\n files: EmbeddedContextFile[];\n heading: string;\n dynamic: boolean;\n}): string[] {\n if (params.files.length === 0) {\n return [];\n }\n const lines: string[] = [params.heading, ''];\n if (params.dynamic) {\n lines.push(\n 'The following frequently-changing project context files are kept below the cache boundary when possible:',\n '',\n );\n } else {\n const hasSoulFile = params.files.some((file) => getContextFileBasename(file.path) === 'soul.md');\n lines.push('The following project context files have been loaded:');\n if (hasSoulFile) {\n lines.push(\n 'If SOUL.md is present, embody its persona and tone. Avoid stiff, generic replies; follow its guidance unless higher-priority instructions override it.',\n );\n }\n lines.push('');\n }\n for (const file of params.files) {\n lines.push(`## ${file.path}`, '', sanitizeContextFileContentForPrompt(file.content), '');\n }\n return lines;\n}\n\n/** Whether HEARTBEAT.md is injected as dynamic context (vs behavior-only section). */\nexport function isHeartbeatContextFile(pathValue: string): boolean {\n return getContextFileBasename(pathValue) === DEFAULT_HEARTBEAT_FILENAME.toLowerCase();\n}\n"],"mappings":";;AAGA,MAAa,qBAAqB,IAAI,IAAoB;CACxD,CAAC,aAAa,GAAG;CACjB,CAAC,WAAW,GAAG;CACf,CAAC,eAAe,GAAG;CACnB,CAAC,WAAW,GAAG;CACf,CAAC,YAAY,GAAG;CAChB,CAAC,gBAAgB,GAAG;CACpB,CAAC,aAAa,GAAG;CAClB,CAAC;AAEF,MAAa,iCAAiC,IAAI,IAAI,CAAC,eAAe,CAAC;AAEvE,MAAa,yCACX;AAEF,SAAgB,yBAAyB,WAA2B;AAClE,QAAO,UAAU,MAAM,CAAC,QAAQ,OAAO,IAAI;;AAG7C,SAAgB,uBAAuB,WAA2B;CAChE,MAAM,iBAAiB,yBAAyB,UAAU;AAC1D,SAAQ,eAAe,MAAM,IAAI,CAAC,KAAK,IAAI,gBAAgB,aAAa;;AAG1E,SAAgB,qBAAqB,WAA4B;AAC/D,QAAO,+BAA+B,IAAI,uBAAuB,UAAU,CAAC;;AAG9E,SAAgB,oCAAoC,SAAyB;AAC3E,QAAO,QAAQ,WAAW,wCAAwC,GAAG,CAAC,QAAQ,WAAW,OAAO;;AAGlG,SAAgB,0BAA0B,cAA4D;AACpG,QAAO,CAAC,GAAG,aAAa,CAAC,MAAM,GAAG,MAAM;EACtC,MAAM,QAAQ,uBAAuB,EAAE,KAAK;EAC5C,MAAM,QAAQ,uBAAuB,EAAE,KAAK;EAC5C,MAAM,SAAS,mBAAmB,IAAI,MAAM,IAAI,OAAO;EACvD,MAAM,SAAS,mBAAmB,IAAI,MAAM,IAAI,OAAO;AACvD,MAAI,WAAW,OACb,QAAO,SAAS;AAElB,MAAI,UAAU,MACZ,QAAO,MAAM,cAAc,MAAM;AAEnC,SAAO,yBAAyB,EAAE,KAAK,CAAC,cAAc,yBAAyB,EAAE,KAAK,CAAC;GACvF;;AAGJ,SAAgB,2BAA2B,QAI9B;AACX,KAAI,OAAO,MAAM,WAAW,EAC1B,QAAO,EAAE;CAEX,MAAM,QAAkB,CAAC,OAAO,SAAS,GAAG;AAC5C,KAAI,OAAO,QACT,OAAM,KACJ,4GACA,GACD;MACI;EACL,MAAM,cAAc,OAAO,MAAM,MAAM,SAAS,uBAAuB,KAAK,KAAK,KAAK,UAAU;AAChG,QAAM,KAAK,wDAAwD;AACnE,MAAI,YACF,OAAM,KACJ,yJACD;AAEH,QAAM,KAAK,GAAG;;AAEhB,MAAK,MAAM,QAAQ,OAAO,MACxB,OAAM,KAAK,MAAM,KAAK,QAAQ,IAAI,oCAAoC,KAAK,QAAQ,EAAE,GAAG;AAE1F,QAAO;;;AAIT,SAAgB,uBAAuB,WAA4B;AACjE,QAAO,uBAAuB,UAAU,KAAK,2BAA2B,aAAa"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
//#region src/agent/prompt/sections/tooling.ts
|
|
2
|
+
const CORE_TOOL_ORDER = [
|
|
3
|
+
"read_file",
|
|
4
|
+
"write_file",
|
|
5
|
+
"edit_file",
|
|
6
|
+
"grep",
|
|
7
|
+
"find",
|
|
8
|
+
"list_dir",
|
|
9
|
+
"shell",
|
|
10
|
+
"web_search",
|
|
11
|
+
"web_fetch",
|
|
12
|
+
"web_extract",
|
|
13
|
+
"browser_use",
|
|
14
|
+
"send_message",
|
|
15
|
+
"send_media",
|
|
16
|
+
"memory_search",
|
|
17
|
+
"memory_get",
|
|
18
|
+
"session_search",
|
|
19
|
+
"curated_memory",
|
|
20
|
+
"session_status",
|
|
21
|
+
"delegate_task",
|
|
22
|
+
"workflow",
|
|
23
|
+
"cronjob",
|
|
24
|
+
"skills_list",
|
|
25
|
+
"skill_view",
|
|
26
|
+
"skill_manage",
|
|
27
|
+
"todo",
|
|
28
|
+
"clarify",
|
|
29
|
+
"text_to_speech",
|
|
30
|
+
"image",
|
|
31
|
+
"image_generate",
|
|
32
|
+
"create_share",
|
|
33
|
+
"execute_code"
|
|
34
|
+
];
|
|
35
|
+
const CORE_TOOL_SUMMARIES = {
|
|
36
|
+
read_file: "Read file contents",
|
|
37
|
+
write_file: "Create or overwrite files",
|
|
38
|
+
edit_file: "Make precise edits to files",
|
|
39
|
+
grep: "Search file contents for patterns",
|
|
40
|
+
find: "Find files by glob pattern",
|
|
41
|
+
list_dir: "List directory contents",
|
|
42
|
+
shell: "Run shell commands (supports background via yieldMs/background)",
|
|
43
|
+
web_search: "Search the web",
|
|
44
|
+
web_fetch: "Fetch and extract readable content from a URL",
|
|
45
|
+
web_extract: "Extract structured content from a URL",
|
|
46
|
+
browser_use: "Control the configured browser",
|
|
47
|
+
send_message: "Send messages to the current channel",
|
|
48
|
+
send_media: "Send media attachments to the current channel",
|
|
49
|
+
memory_search: "Semantic search over workspace and profile memory files",
|
|
50
|
+
memory_get: "Read specific lines from memory files",
|
|
51
|
+
session_search: "Search other chat sessions or list recent sessions",
|
|
52
|
+
curated_memory: "Read/write structured notes under agent home memories/",
|
|
53
|
+
session_status: "Show session usage/time/model state",
|
|
54
|
+
delegate_task: "Spawn an isolated sub-agent for a delegated task",
|
|
55
|
+
workflow: "Start a persisted multi-phase workflow run",
|
|
56
|
+
cronjob: "Manage scheduled cron jobs",
|
|
57
|
+
skills_list: "List available skills",
|
|
58
|
+
skill_view: "Load a skill SKILL.md or sub-documents",
|
|
59
|
+
skill_manage: "Create or update skills on disk",
|
|
60
|
+
todo: "Manage in-session todo items",
|
|
61
|
+
clarify: "Ask the user a blocking clarification question",
|
|
62
|
+
text_to_speech: "Send a standalone voice message",
|
|
63
|
+
image: "Analyze an image with the configured vision model",
|
|
64
|
+
image_generate: "Generate images with the configured image model",
|
|
65
|
+
create_share: "Create a shareable link for workspace files",
|
|
66
|
+
execute_code: "Run code in a sandbox with a restricted tool subset"
|
|
67
|
+
};
|
|
68
|
+
function buildToolingSection(params) {
|
|
69
|
+
const rawToolNames = (params.toolNames ?? []).map((tool) => tool.trim()).filter(Boolean);
|
|
70
|
+
const canonicalByNormalized = /* @__PURE__ */ new Map();
|
|
71
|
+
for (const name of rawToolNames) {
|
|
72
|
+
const normalized = name.toLowerCase();
|
|
73
|
+
if (!canonicalByNormalized.has(normalized)) canonicalByNormalized.set(normalized, name);
|
|
74
|
+
}
|
|
75
|
+
const resolveToolName = (normalized) => canonicalByNormalized.get(normalized) ?? normalized;
|
|
76
|
+
const normalizedTools = rawToolNames.map((tool) => tool.toLowerCase());
|
|
77
|
+
const availableTools = new Set(normalizedTools);
|
|
78
|
+
const externalToolSummaries = /* @__PURE__ */ new Map();
|
|
79
|
+
for (const [key, value] of Object.entries(params.toolSummaries ?? {})) {
|
|
80
|
+
const normalized = key.trim().toLowerCase();
|
|
81
|
+
if (!normalized || !value?.trim()) continue;
|
|
82
|
+
externalToolSummaries.set(normalized, value.trim());
|
|
83
|
+
}
|
|
84
|
+
const extraTools = Array.from(new Set(normalizedTools.filter((tool) => !CORE_TOOL_ORDER.includes(tool))));
|
|
85
|
+
const toolLines = CORE_TOOL_ORDER.filter((tool) => availableTools.has(tool)).map((tool) => {
|
|
86
|
+
const summary = CORE_TOOL_SUMMARIES[tool] ?? externalToolSummaries.get(tool);
|
|
87
|
+
const name = resolveToolName(tool);
|
|
88
|
+
return summary ? `- ${name}: ${summary}` : `- ${name}`;
|
|
89
|
+
});
|
|
90
|
+
for (const tool of extraTools.toSorted()) {
|
|
91
|
+
const summary = CORE_TOOL_SUMMARIES[tool] ?? externalToolSummaries.get(tool);
|
|
92
|
+
const name = resolveToolName(tool);
|
|
93
|
+
toolLines.push(summary ? `- ${name}: ${summary}` : `- ${name}`);
|
|
94
|
+
}
|
|
95
|
+
const shellToolName = resolveToolName("shell");
|
|
96
|
+
const hasDelegate = availableTools.has("delegate_task");
|
|
97
|
+
const hasWorkflow = availableTools.has("workflow");
|
|
98
|
+
const orchestrationLines = [];
|
|
99
|
+
if (hasDelegate) orchestrationLines.push("- Sub-agent delegation → use `delegate_task(goal, context?, toolset?)` for focused parallel work; results return to you automatically.");
|
|
100
|
+
if (hasWorkflow) orchestrationLines.push("- Multi-phase workflows → use `workflow` to start persisted runs with subagents when a script defines phases.");
|
|
101
|
+
return [
|
|
102
|
+
"## Tooling",
|
|
103
|
+
"Tool availability (filtered by policy):",
|
|
104
|
+
"Tool names are case-sensitive. Call tools exactly as listed.",
|
|
105
|
+
toolLines.length > 0 ? toolLines.join("\n") : "- No tools are registered for this session.",
|
|
106
|
+
`For long waits, avoid rapid poll loops: use \`${shellToolName}\` with enough yieldMs or poll in reasonable intervals.`,
|
|
107
|
+
hasDelegate ? "If a task is complex or long-running, delegate it. Completion is push-based: the sub-agent result returns when done." : "",
|
|
108
|
+
...orchestrationLines,
|
|
109
|
+
"Do not poll delegate/workflow status in a tight loop; check on-demand or wait for completion."
|
|
110
|
+
].filter(Boolean).join("\n");
|
|
111
|
+
}
|
|
112
|
+
function hasSkillsTools(toolNames) {
|
|
113
|
+
const normalized = new Set(toolNames.map((t) => t.toLowerCase()));
|
|
114
|
+
return normalized.has("skills_list") || normalized.has("skill_view");
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
export { buildToolingSection, hasSkillsTools };
|
|
118
|
+
|
|
119
|
+
//# sourceMappingURL=tooling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooling.js","names":[],"sources":["../../../../../src/agent/prompt/sections/tooling.ts"],"sourcesContent":["const CORE_TOOL_ORDER = [\n 'read_file',\n 'write_file',\n 'edit_file',\n 'grep',\n 'find',\n 'list_dir',\n 'shell',\n 'web_search',\n 'web_fetch',\n 'web_extract',\n 'browser_use',\n 'send_message',\n 'send_media',\n 'memory_search',\n 'memory_get',\n 'session_search',\n 'curated_memory',\n 'session_status',\n 'delegate_task',\n 'workflow',\n 'cronjob',\n 'skills_list',\n 'skill_view',\n 'skill_manage',\n 'todo',\n 'clarify',\n 'text_to_speech',\n 'image',\n 'image_generate',\n 'create_share',\n 'execute_code',\n] as const;\n\nconst CORE_TOOL_SUMMARIES: Record<string, string> = {\n read_file: 'Read file contents',\n write_file: 'Create or overwrite files',\n edit_file: 'Make precise edits to files',\n grep: 'Search file contents for patterns',\n find: 'Find files by glob pattern',\n list_dir: 'List directory contents',\n shell: 'Run shell commands (supports background via yieldMs/background)',\n web_search: 'Search the web',\n web_fetch: 'Fetch and extract readable content from a URL',\n web_extract: 'Extract structured content from a URL',\n browser_use: 'Control the configured browser',\n send_message: 'Send messages to the current channel',\n send_media: 'Send media attachments to the current channel',\n memory_search: 'Semantic search over workspace and profile memory files',\n memory_get: 'Read specific lines from memory files',\n session_search: 'Search other chat sessions or list recent sessions',\n curated_memory: 'Read/write structured notes under agent home memories/',\n session_status: 'Show session usage/time/model state',\n delegate_task: 'Spawn an isolated sub-agent for a delegated task',\n workflow: 'Start a persisted multi-phase workflow run',\n cronjob: 'Manage scheduled cron jobs',\n skills_list: 'List available skills',\n skill_view: 'Load a skill SKILL.md or sub-documents',\n skill_manage: 'Create or update skills on disk',\n todo: 'Manage in-session todo items',\n clarify: 'Ask the user a blocking clarification question',\n text_to_speech: 'Send a standalone voice message',\n image: 'Analyze an image with the configured vision model',\n image_generate: 'Generate images with the configured image model',\n create_share: 'Create a shareable link for workspace files',\n execute_code: 'Run code in a sandbox with a restricted tool subset',\n};\n\nexport function buildToolingSection(params: {\n toolNames?: string[];\n toolSummaries?: Record<string, string>;\n}): string {\n const rawToolNames = (params.toolNames ?? []).map((tool) => tool.trim()).filter(Boolean);\n const canonicalByNormalized = new Map<string, string>();\n for (const name of rawToolNames) {\n const normalized = name.toLowerCase();\n if (!canonicalByNormalized.has(normalized)) {\n canonicalByNormalized.set(normalized, name);\n }\n }\n const resolveToolName = (normalized: string) =>\n canonicalByNormalized.get(normalized) ?? normalized;\n\n const normalizedTools = rawToolNames.map((tool) => tool.toLowerCase());\n const availableTools = new Set(normalizedTools);\n\n const externalToolSummaries = new Map<string, string>();\n for (const [key, value] of Object.entries(params.toolSummaries ?? {})) {\n const normalized = key.trim().toLowerCase();\n if (!normalized || !value?.trim()) {\n continue;\n }\n externalToolSummaries.set(normalized, value.trim());\n }\n\n const extraTools = Array.from(\n new Set(normalizedTools.filter((tool) => !CORE_TOOL_ORDER.includes(tool as (typeof CORE_TOOL_ORDER)[number]))),\n );\n const enabledTools = CORE_TOOL_ORDER.filter((tool) => availableTools.has(tool));\n const toolLines = enabledTools.map((tool) => {\n const summary = CORE_TOOL_SUMMARIES[tool] ?? externalToolSummaries.get(tool);\n const name = resolveToolName(tool);\n return summary ? `- ${name}: ${summary}` : `- ${name}`;\n });\n for (const tool of extraTools.toSorted()) {\n const summary = CORE_TOOL_SUMMARIES[tool] ?? externalToolSummaries.get(tool);\n const name = resolveToolName(tool);\n toolLines.push(summary ? `- ${name}: ${summary}` : `- ${name}`);\n }\n\n const shellToolName = resolveToolName('shell');\n const hasDelegate = availableTools.has('delegate_task');\n const hasWorkflow = availableTools.has('workflow');\n\n const orchestrationLines: string[] = [];\n if (hasDelegate) {\n orchestrationLines.push(\n '- Sub-agent delegation → use `delegate_task(goal, context?, toolset?)` for focused parallel work; results return to you automatically.',\n );\n }\n if (hasWorkflow) {\n orchestrationLines.push(\n '- Multi-phase workflows → use `workflow` to start persisted runs with subagents when a script defines phases.',\n );\n }\n\n return [\n '## Tooling',\n 'Tool availability (filtered by policy):',\n 'Tool names are case-sensitive. Call tools exactly as listed.',\n toolLines.length > 0\n ? toolLines.join('\\n')\n : '- No tools are registered for this session.',\n `For long waits, avoid rapid poll loops: use \\`${shellToolName}\\` with enough yieldMs or poll in reasonable intervals.`,\n hasDelegate\n ? 'If a task is complex or long-running, delegate it. Completion is push-based: the sub-agent result returns when done.'\n : '',\n ...orchestrationLines,\n 'Do not poll delegate/workflow status in a tight loop; check on-demand or wait for completion.',\n ]\n .filter(Boolean)\n .join('\\n');\n}\n\nexport function hasSkillsTools(toolNames: string[]): boolean {\n const normalized = new Set(toolNames.map((t) => t.toLowerCase()));\n return normalized.has('skills_list') || normalized.has('skill_view');\n}\n"],"mappings":";AAAA,MAAM,kBAAkB;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAM,sBAA8C;CAClD,WAAW;CACX,YAAY;CACZ,WAAW;CACX,MAAM;CACN,MAAM;CACN,UAAU;CACV,OAAO;CACP,YAAY;CACZ,WAAW;CACX,aAAa;CACb,aAAa;CACb,cAAc;CACd,YAAY;CACZ,eAAe;CACf,YAAY;CACZ,gBAAgB;CAChB,gBAAgB;CAChB,gBAAgB;CAChB,eAAe;CACf,UAAU;CACV,SAAS;CACT,aAAa;CACb,YAAY;CACZ,cAAc;CACd,MAAM;CACN,SAAS;CACT,gBAAgB;CAChB,OAAO;CACP,gBAAgB;CAChB,cAAc;CACd,cAAc;CACf;AAED,SAAgB,oBAAoB,QAGzB;CACT,MAAM,gBAAgB,OAAO,aAAa,EAAE,EAAE,KAAK,SAAS,KAAK,MAAM,CAAC,CAAC,OAAO,QAAQ;CACxF,MAAM,wCAAwB,IAAI,KAAqB;AACvD,MAAK,MAAM,QAAQ,cAAc;EAC/B,MAAM,aAAa,KAAK,aAAa;AACrC,MAAI,CAAC,sBAAsB,IAAI,WAAW,CACxC,uBAAsB,IAAI,YAAY,KAAK;;CAG/C,MAAM,mBAAmB,eACvB,sBAAsB,IAAI,WAAW,IAAI;CAE3C,MAAM,kBAAkB,aAAa,KAAK,SAAS,KAAK,aAAa,CAAC;CACtE,MAAM,iBAAiB,IAAI,IAAI,gBAAgB;CAE/C,MAAM,wCAAwB,IAAI,KAAqB;AACvD,MAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,OAAO,iBAAiB,EAAE,CAAC,EAAE;EACrE,MAAM,aAAa,IAAI,MAAM,CAAC,aAAa;AAC3C,MAAI,CAAC,cAAc,CAAC,OAAO,MAAM,CAC/B;AAEF,wBAAsB,IAAI,YAAY,MAAM,MAAM,CAAC;;CAGrD,MAAM,aAAa,MAAM,KACvB,IAAI,IAAI,gBAAgB,QAAQ,SAAS,CAAC,gBAAgB,SAAS,KAAyC,CAAC,CAAC,CAC/G;CAED,MAAM,YADe,gBAAgB,QAAQ,SAAS,eAAe,IAAI,KAAK,CAChD,CAAC,KAAK,SAAS;EAC3C,MAAM,UAAU,oBAAoB,SAAS,sBAAsB,IAAI,KAAK;EAC5E,MAAM,OAAO,gBAAgB,KAAK;AAClC,SAAO,UAAU,KAAK,KAAK,IAAI,YAAY,KAAK;GAChD;AACF,MAAK,MAAM,QAAQ,WAAW,UAAU,EAAE;EACxC,MAAM,UAAU,oBAAoB,SAAS,sBAAsB,IAAI,KAAK;EAC5E,MAAM,OAAO,gBAAgB,KAAK;AAClC,YAAU,KAAK,UAAU,KAAK,KAAK,IAAI,YAAY,KAAK,OAAO;;CAGjE,MAAM,gBAAgB,gBAAgB,QAAQ;CAC9C,MAAM,cAAc,eAAe,IAAI,gBAAgB;CACvD,MAAM,cAAc,eAAe,IAAI,WAAW;CAElD,MAAM,qBAA+B,EAAE;AACvC,KAAI,YACF,oBAAmB,KACjB,yIACD;AAEH,KAAI,YACF,oBAAmB,KACjB,gHACD;AAGH,QAAO;EACL;EACA;EACA;EACA,UAAU,SAAS,IACf,UAAU,KAAK,KAAK,GACpB;EACJ,iDAAiD,cAAc;EAC/D,cACI,yHACA;EACJ,GAAG;EACH;EACD,CACE,OAAO,QAAQ,CACf,KAAK,KAAK;;AAGf,SAAgB,eAAe,WAA8B;CAC3D,MAAM,aAAa,IAAI,IAAI,UAAU,KAAK,MAAM,EAAE,aAAa,CAAC,CAAC;AACjE,QAAO,WAAW,IAAI,cAAc,IAAI,WAAW,IAAI,aAAa"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type RuntimeInfoInput = {
|
|
2
|
+
version?: string;
|
|
3
|
+
model?: string;
|
|
4
|
+
channel?: string;
|
|
5
|
+
agentId?: string;
|
|
6
|
+
thinkingLevel?: string;
|
|
7
|
+
capabilities?: string[];
|
|
8
|
+
};
|
|
9
|
+
export declare function buildWorkspaceSection(workspaceDir: string): string;
|
|
10
|
+
export declare function buildWorkspaceFilesIntroSection(): string;
|
|
11
|
+
export declare function buildRuntimeSection(runtime?: RuntimeInfoInput): string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { sanitizeForPromptLiteral } from "../sanitize-for-prompt.js";
|
|
2
|
+
//#region src/agent/prompt/sections/workspace-runtime.ts
|
|
3
|
+
function buildWorkspaceSection(workspaceDir) {
|
|
4
|
+
return [
|
|
5
|
+
"## Workspace",
|
|
6
|
+
`Your working directory is: ${sanitizeForPromptLiteral(workspaceDir)}`,
|
|
7
|
+
"Treat this directory as the single global workspace for file operations unless explicitly instructed otherwise."
|
|
8
|
+
].join("\n");
|
|
9
|
+
}
|
|
10
|
+
function buildWorkspaceFilesIntroSection() {
|
|
11
|
+
return [
|
|
12
|
+
"## Workspace Files (injected)",
|
|
13
|
+
"",
|
|
14
|
+
"Profile bootstrap files are injected below as Project Context. Do not manually reread them at session start unless the user asks or injected content is insufficient."
|
|
15
|
+
].join("\n");
|
|
16
|
+
}
|
|
17
|
+
function buildRuntimeSection(runtime) {
|
|
18
|
+
if (!runtime) return "";
|
|
19
|
+
const parts = [];
|
|
20
|
+
if (runtime.agentId) parts.push(`agent=${runtime.agentId}`);
|
|
21
|
+
if (runtime.version) parts.push(`v${runtime.version}`);
|
|
22
|
+
if (runtime.model) parts.push(`model=${runtime.model.split("/").pop() ?? runtime.model}`);
|
|
23
|
+
if (runtime.channel) parts.push(`channel=${runtime.channel}`);
|
|
24
|
+
if (runtime.capabilities && runtime.capabilities.length > 0) parts.push(`capabilities=${runtime.capabilities.join(",")}`);
|
|
25
|
+
if (runtime.thinkingLevel) parts.push(`thinking=${runtime.thinkingLevel}`);
|
|
26
|
+
if (parts.length === 0) return "";
|
|
27
|
+
return ["## Runtime", `Runtime: ${parts.join(" | ")}`].join("\n");
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { buildRuntimeSection, buildWorkspaceFilesIntroSection, buildWorkspaceSection };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=workspace-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-runtime.js","names":[],"sources":["../../../../../src/agent/prompt/sections/workspace-runtime.ts"],"sourcesContent":["import { sanitizeForPromptLiteral } from '../sanitize-for-prompt.js';\n\nexport type RuntimeInfoInput = {\n version?: string;\n model?: string;\n channel?: string;\n agentId?: string;\n thinkingLevel?: string;\n capabilities?: string[];\n};\n\nexport function buildWorkspaceSection(workspaceDir: string): string {\n const sanitized = sanitizeForPromptLiteral(workspaceDir);\n return [\n '## Workspace',\n `Your working directory is: ${sanitized}`,\n 'Treat this directory as the single global workspace for file operations unless explicitly instructed otherwise.',\n ].join('\\n');\n}\n\nexport function buildWorkspaceFilesIntroSection(): string {\n return [\n '## Workspace Files (injected)',\n '',\n 'Profile bootstrap files are injected below as Project Context. Do not manually reread them at session start unless the user asks or injected content is insufficient.',\n ].join('\\n');\n}\n\nexport function buildRuntimeSection(runtime?: RuntimeInfoInput): string {\n if (!runtime) {\n return '';\n }\n const parts: string[] = [];\n if (runtime.agentId) parts.push(`agent=${runtime.agentId}`);\n if (runtime.version) parts.push(`v${runtime.version}`);\n if (runtime.model) parts.push(`model=${runtime.model.split('/').pop() ?? runtime.model}`);\n if (runtime.channel) parts.push(`channel=${runtime.channel}`);\n if (runtime.capabilities && runtime.capabilities.length > 0) {\n parts.push(`capabilities=${runtime.capabilities.join(',')}`);\n }\n if (runtime.thinkingLevel) parts.push(`thinking=${runtime.thinkingLevel}`);\n if (parts.length === 0) {\n return '';\n }\n return ['## Runtime', `Runtime: ${parts.join(' | ')}`].join('\\n');\n}\n"],"mappings":";;AAWA,SAAgB,sBAAsB,cAA8B;AAElE,QAAO;EACL;EACA,8BAHgB,yBAAyB,aAGF;EACvC;EACD,CAAC,KAAK,KAAK;;AAGd,SAAgB,kCAA0C;AACxD,QAAO;EACL;EACA;EACA;EACD,CAAC,KAAK,KAAK;;AAGd,SAAgB,oBAAoB,SAAoC;AACtE,KAAI,CAAC,QACH,QAAO;CAET,MAAM,QAAkB,EAAE;AAC1B,KAAI,QAAQ,QAAS,OAAM,KAAK,SAAS,QAAQ,UAAU;AAC3D,KAAI,QAAQ,QAAS,OAAM,KAAK,IAAI,QAAQ,UAAU;AACtD,KAAI,QAAQ,MAAO,OAAM,KAAK,SAAS,QAAQ,MAAM,MAAM,IAAI,CAAC,KAAK,IAAI,QAAQ,QAAQ;AACzF,KAAI,QAAQ,QAAS,OAAM,KAAK,WAAW,QAAQ,UAAU;AAC7D,KAAI,QAAQ,gBAAgB,QAAQ,aAAa,SAAS,EACxD,OAAM,KAAK,gBAAgB,QAAQ,aAAa,KAAK,IAAI,GAAG;AAE9D,KAAI,QAAQ,cAAe,OAAM,KAAK,YAAY,QAAQ,gBAAgB;AAC1E,KAAI,MAAM,WAAW,EACnB,QAAO;AAET,QAAO,CAAC,cAAc,YAAY,MAAM,KAAK,MAAM,GAAG,CAAC,KAAK,KAAK"}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
import type { Config } from '../../config/schema.js';
|
|
7
7
|
import type { EmbeddedContextFile } from '../bootstrap/types.js';
|
|
8
8
|
import type { SkillManager } from '../skills/skill-manager.js';
|
|
9
|
+
import type { PromptMode, SilentReplyPromptMode } from './types.js';
|
|
10
|
+
import type { ProviderSystemPromptContribution } from './contribution.js';
|
|
9
11
|
export interface SystemPromptBuildOptions {
|
|
10
12
|
externalMemoryInstructions?: string;
|
|
11
13
|
workspaceOverride?: string;
|
|
@@ -14,6 +16,15 @@ export interface SystemPromptBuildOptions {
|
|
|
14
16
|
skillPromptText?: string;
|
|
15
17
|
skillAllowlist?: string[];
|
|
16
18
|
registeredToolNames?: string[];
|
|
19
|
+
toolSummaries?: Record<string, string>;
|
|
20
|
+
sessionKey?: string;
|
|
21
|
+
promptMode?: PromptMode;
|
|
22
|
+
modelRef?: string;
|
|
23
|
+
agentId?: string;
|
|
24
|
+
thinkingLevel?: string;
|
|
25
|
+
extraSystemPrompt?: string;
|
|
26
|
+
silentReplyPromptMode?: SilentReplyPromptMode;
|
|
27
|
+
promptContribution?: ProviderSystemPromptContribution;
|
|
17
28
|
}
|
|
18
29
|
export interface SystemPromptBuilderConfig {
|
|
19
30
|
workspace: string;
|
|
@@ -34,6 +45,8 @@ export declare class SystemPromptBuilder {
|
|
|
34
45
|
externalMemoryInstructions?: string;
|
|
35
46
|
workspaceOverride?: string;
|
|
36
47
|
profileMarkdownPathRoot?: string;
|
|
48
|
+
registeredToolNames?: string[];
|
|
49
|
+
sessionKey?: string;
|
|
37
50
|
}): string;
|
|
38
51
|
}
|
|
39
52
|
export declare function createSystemPromptBuilder(config: SystemPromptBuilderConfig): SystemPromptBuilder;
|