@wrongstack/core 0.313.1 → 0.316.2
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/chronicle/index.js +31 -31
- package/dist/chronicle/legacy-journal-import.d.ts +0 -6
- package/dist/chronicle/metrics-ingest.d.ts +14 -0
- package/dist/chronicle/metrics-schema.d.ts +10 -1
- package/dist/chronicle/metrics-store.d.ts +20 -2
- package/dist/chronicle/project-server.js +39 -31
- package/dist/chronicle/sink.d.ts +13 -0
- package/dist/chronicle/sqlite-journal.d.ts +20 -2
- package/dist/{chunk-WOEZV3Q4.js → chunk-25LSLC3G.js} +2 -1
- package/dist/{chunk-AI4LLQ2U.js → chunk-27QIURLN.js} +229 -12
- package/dist/{chunk-I45KAW2N.js → chunk-3AGWVSS7.js} +38 -450
- package/dist/chunk-3BDV7RL3.js +211 -0
- package/dist/{chunk-NFAYHPRH.js → chunk-3ECENVHL.js} +10 -8
- package/dist/{chunk-FW5LDDMJ.js → chunk-45WI72ZB.js} +1576 -1156
- package/dist/{chunk-AT4V4XGI.js → chunk-4BMVPOHO.js} +539 -313
- package/dist/{chunk-YBUJCZ57.js → chunk-4I7HGVVA.js} +17 -5
- package/dist/{chunk-JVGPR3TS.js → chunk-4LCZVJVF.js} +7 -55
- package/dist/{chunk-4ZHTKJHM.js → chunk-4SJNS7OB.js} +36 -2
- package/dist/{chunk-AD7ZFZCS.js → chunk-5BMIE7QG.js} +3 -3
- package/dist/{chunk-IQ35HMQL.js → chunk-5YPSXQXM.js} +71 -24
- package/dist/chunk-6FHWXLPT.js +10 -0
- package/dist/{chunk-FIV4IJL7.js → chunk-6H5GEOET.js} +163 -20
- package/dist/{chunk-VB3H5WWB.js → chunk-6NWEVFEL.js} +2 -2
- package/dist/{chunk-E6I5RXVK.js → chunk-AYW5YINX.js} +2 -2
- package/dist/{chunk-DEIQMBD2.js → chunk-B7F4WVP4.js} +2 -2
- package/dist/{chunk-XQ2XGIBF.js → chunk-BPBKKBUK.js} +6 -7
- package/dist/{chunk-K4YUNKU7.js → chunk-BYD345OX.js} +2 -2
- package/dist/{chunk-LZDDLNCZ.js → chunk-C27KDLOX.js} +4 -4
- package/dist/{chunk-6AKOTGLM.js → chunk-CU546ESW.js} +7 -7
- package/dist/{chunk-ZZ4V3WIZ.js → chunk-DLHHXUAM.js} +10 -1
- package/dist/{chunk-BAKVJLEV.js → chunk-DOTHQSJ2.js} +28 -16
- package/dist/{chunk-KBZGE6LN.js → chunk-DYLPMV4Q.js} +4 -3
- package/dist/{chunk-52RTVH4M.js → chunk-F3JWNST7.js} +2 -2
- package/dist/{chunk-WEBMSQP2.js → chunk-FC2ZGRF3.js} +21 -4
- package/dist/{chunk-FHAMQS7Q.js → chunk-FCBTO76Z.js} +76 -146
- package/dist/{chunk-4LJJYBAU.js → chunk-FHZVFYSL.js} +9 -1
- package/dist/{chunk-W4A6QA3D.js → chunk-FWNLEZYG.js} +4 -3
- package/dist/{chunk-OJZEX73F.js → chunk-GDQ7CZRQ.js} +5 -1
- package/dist/{chunk-QVOVMXJR.js → chunk-GJJGJB2R.js} +32 -9
- package/dist/{chunk-4XV6IR37.js → chunk-HI3JGZR2.js} +7 -6
- package/dist/{chunk-FSWCWSTS.js → chunk-HMLIGAU7.js} +26 -26
- package/dist/{chunk-PFXFQQRT.js → chunk-HXKZ7OBQ.js} +7 -43
- package/dist/{chunk-2FQL4PDC.js → chunk-I7DALG7J.js} +5 -5
- package/dist/{chunk-GM54GJBU.js → chunk-IRUTEHCE.js} +3 -3
- package/dist/{chunk-TYW2GI5I.js → chunk-J2WRWR37.js} +40 -13
- package/dist/{chunk-ZEHUCJHY.js → chunk-JFPJ6LLQ.js} +2 -2
- package/dist/chunk-JMULFFLN.js +9 -0
- package/dist/{chunk-RD6DEE36.js → chunk-JO4MGB6Z.js} +94 -8
- package/dist/{chunk-5DSMEVA4.js → chunk-K6BXGITA.js} +7 -7
- package/dist/{chunk-O74MJHXU.js → chunk-KZMSZV32.js} +2 -2
- package/dist/{chunk-GFJOMSHG.js → chunk-LA7CLDRW.js} +6 -2
- package/dist/{chunk-M2WF6AXG.js → chunk-LSMMOS2Z.js} +7 -3
- package/dist/{chunk-ASX6AW36.js → chunk-LXWCMQNJ.js} +3 -3
- package/dist/{chunk-WZO23AWO.js → chunk-M27LIEKV.js} +72 -22
- package/dist/{chunk-JTHKOYWU.js → chunk-MJPHJRAL.js} +15 -15
- package/dist/{chunk-G5AAKEEZ.js → chunk-MTL4O5YR.js} +5 -5
- package/dist/chunk-NHJ75HXY.js +1 -0
- package/dist/{chunk-ZYU2YOJ6.js → chunk-NIOAGFPB.js} +29 -15
- package/dist/{chunk-Y2GE5TSI.js → chunk-NS52ISWS.js} +2 -2
- package/dist/{chunk-UIWONWVG.js → chunk-NSOFPKGT.js} +541 -148
- package/dist/{chunk-RCQYT2I4.js → chunk-NVIZG63R.js} +2 -2
- package/dist/{chunk-EPC3GZD4.js → chunk-OOYZPOXM.js} +2 -2
- package/dist/{chunk-7ZHZE5EO.js → chunk-OSGLYW5J.js} +2 -2
- package/dist/{chunk-CE4ZOCOI.js → chunk-PFCMSSUF.js} +9 -9
- package/dist/{chunk-GFXZTHNI.js → chunk-PGRVXIMY.js} +5 -5
- package/dist/{chunk-JJPMWPB6.js → chunk-PISBFBJN.js} +6 -6
- package/dist/chunk-POOOIWE5.js +9 -0
- package/dist/{chunk-5RP3QTRL.js → chunk-PQNS3U7Z.js} +20 -3
- package/dist/{chunk-3E244UDA.js → chunk-QSTSJOCK.js} +52 -6
- package/dist/{chunk-YUPMXOGP.js → chunk-RFQMOKWK.js} +3 -3
- package/dist/chunk-RTOTNK3P.js +484 -0
- package/dist/{chunk-SN2DQRL6.js → chunk-RXKSDUAU.js} +7 -7
- package/dist/{chunk-T3KGZBU5.js → chunk-S45JPKQN.js} +189 -43
- package/dist/{chunk-YNCVSFGF.js → chunk-SAFHACFA.js} +4 -1
- package/dist/{chunk-KI4L2DUL.js → chunk-TCCHINEF.js} +114 -19
- package/dist/{chunk-AWNQ6ED6.js → chunk-THEGTRAG.js} +7 -2
- package/dist/{chunk-2KKODIQU.js → chunk-TR4LQE7L.js} +15 -15
- package/dist/{chunk-GPQ3NJPR.js → chunk-TWJMGXCI.js} +3 -3
- package/dist/{chunk-H72H4XDU.js → chunk-U45AXT5D.js} +9 -9
- package/dist/{chunk-62V2AFVG.js → chunk-U4FWBSO3.js} +160 -73
- package/dist/{chunk-A455ATZB.js → chunk-UBGDX6FI.js} +8 -1
- package/dist/chunk-UJILKYES.js +75 -0
- package/dist/{chunk-KSJ5UTP7.js → chunk-ULMAQV3T.js} +84 -4
- package/dist/{chunk-CB2HFKTP.js → chunk-VVBP6KGT.js} +1 -1
- package/dist/{chunk-RPOA7IAE.js → chunk-W5VITDM2.js} +43 -25
- package/dist/{chunk-QRTG4XTI.js → chunk-WAHQVNWT.js} +7 -1
- package/dist/{chunk-SQP64RCS.js → chunk-WGGYRBXH.js} +3019 -2976
- package/dist/{chunk-K3G6JBUC.js → chunk-WLYKU45P.js} +679 -141
- package/dist/chunk-WP7BVANJ.js +53 -0
- package/dist/{chunk-GAZEWQEZ.js → chunk-XF4VUMKW.js} +2 -2
- package/dist/{chunk-PAAWLLZX.js → chunk-Y5YXDM7D.js} +2 -2
- package/dist/{chunk-65RDIOR2.js → chunk-YOPAUVU4.js} +162 -44
- package/dist/{chunk-FFSX2QDQ.js → chunk-YPT4A46F.js} +3 -3
- package/dist/chunk-YWXT3JNM.js +425 -0
- package/dist/{chunk-EFEHDQGY.js → chunk-ZHZ2Y2DH.js} +64 -10
- package/dist/{chunk-CQQL4ZOQ.js → chunk-ZT7JNIGX.js} +4 -3
- package/dist/coordination/agent-monitor.d.ts +9 -1
- package/dist/coordination/agent-subagent-runner.d.ts +1 -1
- package/dist/coordination/agents/agent-prompts.d.ts +8 -0
- package/dist/coordination/agents/index.d.ts +33 -1
- package/dist/coordination/agents/index.js +52 -22
- package/dist/coordination/agents/phase3-wave1-platform.d.ts +1 -3
- package/dist/coordination/agents/phase3-wave2-meta.d.ts +1 -3
- package/dist/coordination/agents/phase8-wave3-products.d.ts +1 -3
- package/dist/coordination/agents/phase9-wave4-platform-meta.d.ts +1 -3
- package/dist/coordination/agents/project-agent-identity.d.ts +11 -11
- package/dist/coordination/agents/types.d.ts +13 -2
- package/dist/coordination/brain-monitor.d.ts +30 -7
- package/dist/coordination/collab-debug.d.ts +1 -1
- package/dist/coordination/collab-pause.d.ts +1 -1
- package/dist/coordination/delegate-tool.d.ts +7 -5
- package/dist/coordination/director-kanban-queue-helpers.d.ts +1 -0
- package/dist/coordination/director-options.d.ts +7 -0
- package/dist/coordination/director-spawn-model.d.ts +17 -0
- package/dist/coordination/director-tools.d.ts +2 -2
- package/dist/coordination/director.d.ts +12 -0
- package/dist/coordination/dispatcher.d.ts +8 -0
- package/dist/coordination/fleet-bus.d.ts +35 -4
- package/dist/coordination/fleet-supervisor.d.ts +10 -2
- package/dist/coordination/fleet.d.ts +16 -7
- package/dist/coordination/index.d.ts +4 -0
- package/dist/coordination/index.js +86 -49
- package/dist/coordination/kanban-dispatch-port.d.ts +2 -2
- package/dist/coordination/mailbox-http-router.d.ts +4 -3
- package/dist/coordination/mailbox-http-validation.d.ts +1 -1
- package/dist/coordination/mailbox-project-server.js +15 -15
- package/dist/coordination/mailbox-types.d.ts +24 -6
- package/dist/coordination/model-tier-leader.d.ts +122 -0
- package/dist/coordination/model-tier.d.ts +122 -0
- package/dist/coordination/multi-agent-coordinator.d.ts +24 -0
- package/dist/coordination/origin-session.d.ts +16 -0
- package/dist/coordination/provider-status-tracker.d.ts +37 -5
- package/dist/coordination/session-note-hub.d.ts +44 -0
- package/dist/coordination/session-note-tool.d.ts +10 -0
- package/dist/core/agent.d.ts +1 -1
- package/dist/core/context.d.ts +22 -3
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +130 -38
- package/dist/core/request-conversation-binding.d.ts +37 -0
- package/dist/core/session-notes.d.ts +25 -0
- package/dist/core/system-prompt-builder.d.ts +11 -2
- package/dist/core/system-prompt-variants.d.ts +78 -0
- package/dist/design/index.js +3 -3
- package/dist/execution/auto-compaction-middleware.d.ts +11 -0
- package/dist/execution/autonomy-brain.d.ts +2 -1
- package/dist/execution/autonomy-prompt-contributor.d.ts +7 -2
- package/dist/execution/compaction-core.d.ts +4 -4
- package/dist/execution/eternal-autonomy.d.ts +1 -1
- package/dist/execution/index.js +138 -129
- package/dist/execution/model-runtime.d.ts +0 -7
- package/dist/execution/parallel-eternal-engine.d.ts +7 -7
- package/dist/extension/index.js +3 -3
- package/dist/goal/index.js +6 -6
- package/dist/hooks/index.js +3 -3
- package/dist/hq/index.js +14 -12
- package/dist/hq/persistence/event-log.d.ts +0 -1
- package/dist/hq/persistence.d.ts +4 -4
- package/dist/hq/publisher.d.ts +2 -0
- package/dist/index.d.ts +14 -11
- package/dist/index.js +728 -635
- package/dist/infrastructure/index.d.ts +4 -4
- package/dist/infrastructure/index.js +281 -260
- package/dist/infrastructure/token-counter.d.ts +9 -0
- package/dist/kernel/events/agent-events.d.ts +77 -3
- package/dist/kernel/events/brain-events.d.ts +12 -0
- package/dist/kernel/events/provider-events.d.ts +7 -1
- package/dist/kernel/events/session-events.d.ts +14 -0
- package/dist/kernel/events/tool-events.d.ts +13 -0
- package/dist/kernel/index.js +4 -4
- package/dist/mailbox-attach.d.ts +1 -1
- package/dist/models/index.js +10 -9
- package/dist/observability/event-bridge.d.ts +25 -5
- package/dist/observability/index.d.ts +9 -8
- package/dist/observability/index.js +459 -351
- package/dist/observability/tool-usage-source.d.ts +65 -0
- package/dist/plugin/index.d.ts +5 -0
- package/dist/plugin/index.js +66 -50
- package/dist/plugins/auto-review-plugin.d.ts +3 -2
- package/dist/plugins/review-finding-commands.d.ts +0 -8
- package/dist/{review-finding-store-DKAV3AS6.js → plugins/review-finding-store.js} +7 -6
- package/dist/plugins/review-finding-types.js +19 -0
- package/dist/plugins/review-report-integration.js +21 -0
- package/dist/{review-report-store-OWY3EC3N.js → plugins/review-report-store.js} +7 -6
- package/dist/plugins/review-report-types.js +13 -0
- package/dist/prompts/index.js +5 -5
- package/dist/registry/index.js +3 -3
- package/dist/registry/tool-registry.d.ts +59 -9
- package/dist/{registry-R23UBE7H.js → registry-7N4O3E7W.js} +5 -5
- package/dist/security/capabilities.d.ts +6 -0
- package/dist/security/file-permissions.d.ts +1 -1
- package/dist/security/index.js +47 -33
- package/dist/security/permission-policy.d.ts +12 -1
- package/dist/security/secret-scrubber.d.ts +15 -0
- package/dist/session-catalog/index.d.ts +1 -0
- package/dist/session-catalog/index.js +19 -14
- package/dist/session-catalog/project-server.js +30 -13
- package/dist/session-catalog/protocol.d.ts +32 -1
- package/dist/session-catalog/registry.d.ts +17 -1
- package/dist/session-catalog/session-agents.d.ts +56 -0
- package/dist/session-catalog/store-rebuild.d.ts +14 -0
- package/dist/session-catalog/store-schema.d.ts +26 -0
- package/dist/session-catalog/store.d.ts +27 -1
- package/dist/session-note-attach.d.ts +9 -0
- package/dist/skills/index.js +5 -5
- package/dist/statusline/index.d.ts +43 -0
- package/dist/statusline/index.js +102 -0
- package/dist/storage/board-store-port.d.ts +2 -2
- package/dist/storage/config-loader/in-project-policy.d.ts +29 -0
- package/dist/storage/config-loader.d.ts +3 -2
- package/dist/storage/file-session-writer.d.ts +4 -2
- package/dist/storage/goal-coordination.d.ts +6 -1
- package/dist/storage/goal-kanban.d.ts +4 -1
- package/dist/storage/index.d.ts +12 -4
- package/dist/storage/index.js +76 -61
- package/dist/storage/input-history-store.d.ts +2 -4
- package/dist/storage/memory-curator.d.ts +133 -0
- package/dist/storage/session-agent-attribution.d.ts +39 -0
- package/dist/storage/session-doctor.d.ts +109 -0
- package/dist/storage/session-event-bridge.d.ts +5 -7
- package/dist/storage/session-outcome.d.ts +42 -0
- package/dist/storage/session-recovery.d.ts +55 -0
- package/dist/storage/session-store/load-session-data.d.ts +11 -0
- package/dist/storage/session-store/prune-helpers.d.ts +1 -1
- package/dist/storage/session-store/resume-session.d.ts +0 -2
- package/dist/storage/session-store/types.d.ts +8 -0
- package/dist/storage/session-store.d.ts +3 -3
- package/dist/storage/session-summary-tracker.d.ts +8 -1
- package/dist/storage/session-write-buffer.d.ts +18 -0
- package/dist/storage/session-writer-truncate.d.ts +2 -0
- package/dist/tasking/index.js +2 -2
- package/dist/tools/fallback-manage-tools.d.ts +6 -4
- package/dist/tools/index.js +21 -21
- package/dist/tools/model-tier-set-tool.d.ts +66 -0
- package/dist/types/agent-bridge.d.ts +2 -1
- package/dist/types/config/mcp-features.d.ts +7 -0
- package/dist/types/config/model-tiers.d.ts +148 -0
- package/dist/types/config/root.d.ts +9 -0
- package/dist/types/config/tools.d.ts +73 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/context.d.ts +2 -0
- package/dist/types/default-config.d.ts +6 -0
- package/dist/types/errors.d.ts +2 -1
- package/dist/types/index.d.ts +11 -9
- package/dist/types/index.js +25 -15
- package/dist/types/multi-agent.d.ts +43 -0
- package/dist/types/plugin.d.ts +1 -1
- package/dist/types/provider.d.ts +15 -0
- package/dist/types/runtime-capability-manifest.d.ts +1 -1
- package/dist/types/secret-scrubber.d.ts +15 -0
- package/dist/types/session-markers.d.ts +37 -10
- package/dist/types/session-markers.js +1 -1
- package/dist/types/session-timeline.d.ts +197 -0
- package/dist/types/session-timeline.js +12 -0
- package/dist/types/session.d.ts +172 -11
- package/dist/types/system-prompt.d.ts +27 -0
- package/dist/utils/config-backup.d.ts +9 -1
- package/dist/utils/heap-watchdog.js +2 -2
- package/dist/utils/index.js +50 -48
- package/dist/utils/message-invariants.d.ts +4 -1
- package/dist/utils/regex-guard.d.ts +1 -1
- package/dist/utils/socket-path.d.ts +1 -1
- package/dist/utils/token-estimate.d.ts +6 -2
- package/dist/utils/wstack-paths.d.ts +2 -0
- package/dist/wiring/proxy-rewrite.d.ts +28 -0
- package/dist/wiring/proxy-rewrite.js +7 -1
- package/dist/worktree/index.js +2 -2
- package/instructions/agents/explore-companion.md +45 -18
- package/instructions/agents/memory-curator.md +34 -22
- package/instructions/coordination/director-preamble.md +12 -7
- package/instructions/coordination/subagent-baseline.md +26 -5
- package/instructions/leader-after-task.md +4 -1
- package/instructions/llm/chimera-review.md +30 -9
- package/instructions/llm/memory-curator.md +31 -0
- package/instructions/sections/tool/delegation-compact.md +2 -0
- package/instructions/sections/tool/delegation-full.md +5 -1
- package/instructions/sections/tool/mailbox-compact.md +5 -1
- package/instructions/sections/tool/mailbox-full.md +3 -0
- package/instructions/sections/tool/session-note-compact.md +3 -0
- package/instructions/sections/tool/session-note-full.md +15 -0
- package/instructions/system-lite.md +9 -4
- package/instructions/system-pro.md +66 -143
- package/instructions/system.md +73 -175
- package/package.json +33 -5
- package/dist/chunk-2BUUIMQB.js +0 -225
- package/dist/chunk-FAYRX2AD.js +0 -13
- package/dist/chunk-H5E77KUJ.js +0 -15
- package/dist/chunk-M7BS2K6U.js +0 -1
- package/dist/coordination/agents.d.ts +0 -8
- package/dist/coordination/transport.d.ts +0 -2
- package/dist/storage/session-writer/session-writer-summary-tracker.d.ts +0 -28
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pre-built subagent role configurations for the WrongStack fleet.
|
|
3
|
-
* These can be passed to `MultiAgentHost.spawn()` or used as templates
|
|
4
|
-
* for the director's roster.
|
|
5
|
-
*/
|
|
6
1
|
import type { SubagentConfig } from '../types/multi-agent.js';
|
|
7
2
|
/**
|
|
8
3
|
* Audit Log Agent — analyzes session logs, event streams, and traces.
|
|
@@ -24,12 +19,26 @@ export declare const REFACTOR_PLANNER_AGENT: SubagentConfig;
|
|
|
24
19
|
* Use for: CI checks, pre-release audits, dependency vulnerability scanning.
|
|
25
20
|
*/
|
|
26
21
|
export declare const SECURITY_SCANNER_AGENT: SubagentConfig;
|
|
22
|
+
/**
|
|
23
|
+
* Read-only discovery surface for the Explore Companion.
|
|
24
|
+
*
|
|
25
|
+
* Index tools first (the point of the role: save the leader those calls).
|
|
26
|
+
* `codebase-impact-analysis` is read-only blast radius — the leader is about
|
|
27
|
+
* to edit; the companion should say who breaks. File tools are fallbacks
|
|
28
|
+
* when the index is cold or the probe needs a cited `file:line`.
|
|
29
|
+
*
|
|
30
|
+
* Deliberately omitted from `TOOLS.read`:
|
|
31
|
+
* - `search` — web search, not codebase search
|
|
32
|
+
* - `mailbox` — cross-session mail; same-session talk is `session_note`
|
|
33
|
+
* (injected by the host, like `submit_result`)
|
|
34
|
+
*/
|
|
35
|
+
export declare const EXPLORE_COMPANION_TOOLS: readonly string[];
|
|
27
36
|
/**
|
|
28
37
|
* Explore Companion — state-triggered background codebase explorer.
|
|
29
38
|
* Runs behind a leader agent: triggered by the in-progress state of the
|
|
30
39
|
* work (unread-file edits, zero-hit searches, todo flips, explicit asks),
|
|
31
|
-
* scans the codebase read-only, and feeds findings back via
|
|
32
|
-
*
|
|
40
|
+
* scans the codebase read-only, and feeds findings back via `submit_result`
|
|
41
|
+
* (the host mails a compact copy to the leader). See
|
|
33
42
|
* docs/architecture/explore-companion-subagent.md.
|
|
34
43
|
*
|
|
35
44
|
* Operational role — deliberately NOT in ALL_AGENT_DEFINITIONS (like
|
|
@@ -28,6 +28,8 @@ export type { ICoordinator } from './icoordinator.js';
|
|
|
28
28
|
export type { IFleetManager } from './ifleet-manager.js';
|
|
29
29
|
export { LargeAnswerStore } from './large-answer-store.js';
|
|
30
30
|
export { type MailToolsOptions, makeMailInboxTool, makeMailSendTool } from './mail-tools.js';
|
|
31
|
+
export { postSessionNote, SessionNoteHub, sessionNoteHub, type SessionNoteInbox, type SessionNotePost, type SessionNotePostResult, } from './session-note-hub.js';
|
|
32
|
+
export { makeSessionNoteTool } from './session-note-tool.js';
|
|
31
33
|
export type { MailboxActionInput, MailboxActionResult, MailboxMessageAction, } from './mailbox-actions.js';
|
|
32
34
|
export { actionToAckInput } from './mailbox-actions.js';
|
|
33
35
|
export { parseMailboxAckInput, parseMailboxQueryInput, parseMailboxSendInput, } from './mailbox-codecs.js';
|
|
@@ -46,6 +48,8 @@ export { applyMailboxSendPolicy, type MailboxResolver, type MailboxToolOptions,
|
|
|
46
48
|
export type { AgentHeartbeatInput, AgentRegistrationInput, ClientHeartbeatInput, ClientRegistrationInput, ClientSource, ClientStatus, Mailbox, MailboxAckBatchInput, MailboxAckInput, MailboxAgentStatus, MailboxAudience, MailboxMessage, MailboxMessageProjection, MailboxMessageType, MailboxQuery, MailboxRecipientState, MailboxSendInput, MailboxTaskContext, PurgeOptions, PurgeResult, ReadReceipts, RegisteredAgent, } from './mailbox-types.js';
|
|
47
49
|
export { isMailboxLeader, isMailboxMessageVisibleTo, MAILBOX_TYPE_PROPERTIES, mailboxIdentityBase, normalizeRecipient, SESSION_RECIPIENT_PREFIX, sessionRecipient, } from './mailbox-types.js';
|
|
48
50
|
export { isValidMatrixKey, MATRIX_PHASE_KEYS, type MatrixKeyKind, type ModelMatrixResolution, type ModelMatrixResolutionSource, type ModelReference, matrixKeyKind, phaseForRole, type ResolvedModelTarget, type ResolvedSubagentModelTarget, resolveImplementationModelTarget, resolveModelMatrix, resolveModelMatrixResolution, resolveModelTargetFromEntry, resolveSubagentModelTarget, roleNeedsIndependentReviewModel, sameModelReference, } from './model-matrix.js';
|
|
51
|
+
export { activeTierConfig, applyTierToSubagentConfig, classifyTier, DEFAULT_TIER_ID, isConfiguredTier, listTierIds, type ModelTierBudget, type ModelTierDecision, type ModelTierSource, type ResolvedTierTarget, resolveTier, tierBudget, tierLevel, tierModelTarget, } from './model-tier.js';
|
|
52
|
+
export { evaluateLeaderTierSwitch, evaluateSwitchEconomics, type LeaderTierRefusalCode, type LeaderTierSwitchRequest, type LeaderTierVerdict, leaderTierPolicy, type ResolvedLeaderTierPolicy, type TierModelEconomics, tierRank, } from './model-tier-leader.js';
|
|
49
53
|
export { DefaultMultiAgentCoordinator, type MultiAgentCoordinatorOptions, } from './multi-agent-coordinator.js';
|
|
50
54
|
export { NULL_FLEET_BUS } from './null-fleet-bus.js';
|
|
51
55
|
export { detectEcosystem, getFullPackageLog, getManifestPackages, getPackageAuthor, getPackagesByAgent, type PackageAuthorEntry, type PackageAuthorLog, type PackageAuthorTrackerOptions, recordPackageAction, updatePackageOutdatedStatus, } from './package-author-tracker.js';
|
|
@@ -100,6 +100,7 @@ import {
|
|
|
100
100
|
makeMutationTestTool,
|
|
101
101
|
makeQualityGateTool,
|
|
102
102
|
makeRollUpTool,
|
|
103
|
+
makeSessionNoteTool,
|
|
103
104
|
makeSpawnTool,
|
|
104
105
|
makeTerminateAllTool,
|
|
105
106
|
makeTerminateTool,
|
|
@@ -125,11 +126,20 @@ import {
|
|
|
125
126
|
updatePackageOutdatedStatus,
|
|
126
127
|
validateWatchdogOptions,
|
|
127
128
|
wrapSubagentRunnerWithWorktrees
|
|
128
|
-
} from "../chunk-
|
|
129
|
-
import "../chunk-
|
|
129
|
+
} from "../chunk-45WI72ZB.js";
|
|
130
|
+
import "../chunk-NSOFPKGT.js";
|
|
130
131
|
import {
|
|
132
|
+
DEFAULT_TIER_ID,
|
|
131
133
|
MATRIX_PHASE_KEYS,
|
|
134
|
+
activeTierConfig,
|
|
135
|
+
applyTierToSubagentConfig,
|
|
136
|
+
classifyTier,
|
|
137
|
+
evaluateLeaderTierSwitch,
|
|
138
|
+
evaluateSwitchEconomics,
|
|
139
|
+
isConfiguredTier,
|
|
132
140
|
isValidMatrixKey,
|
|
141
|
+
leaderTierPolicy,
|
|
142
|
+
listTierIds,
|
|
133
143
|
matrixKeyKind,
|
|
134
144
|
phaseForRole,
|
|
135
145
|
resolveImplementationModelTarget,
|
|
@@ -137,15 +147,21 @@ import {
|
|
|
137
147
|
resolveModelMatrixResolution,
|
|
138
148
|
resolveModelTargetFromEntry,
|
|
139
149
|
resolveSubagentModelTarget,
|
|
150
|
+
resolveTier,
|
|
140
151
|
roleNeedsIndependentReviewModel,
|
|
141
|
-
sameModelReference
|
|
142
|
-
|
|
152
|
+
sameModelReference,
|
|
153
|
+
tierBudget,
|
|
154
|
+
tierLevel,
|
|
155
|
+
tierModelTarget,
|
|
156
|
+
tierRank
|
|
157
|
+
} from "../chunk-RTOTNK3P.js";
|
|
143
158
|
import {
|
|
144
159
|
MailboxEventEmitter
|
|
145
160
|
} from "../chunk-JX7VBZDK.js";
|
|
146
161
|
import "../chunk-SZ6AYUIZ.js";
|
|
147
|
-
import "../chunk-
|
|
148
|
-
import "../chunk-
|
|
162
|
+
import "../chunk-F3JWNST7.js";
|
|
163
|
+
import "../chunk-JMULFFLN.js";
|
|
164
|
+
import "../chunk-AYW5YINX.js";
|
|
149
165
|
import {
|
|
150
166
|
ACP_AGENTS,
|
|
151
167
|
ALL_FLEET_AGENTS,
|
|
@@ -187,7 +203,7 @@ import {
|
|
|
187
203
|
scoreAgents,
|
|
188
204
|
terminalPolicyDecision,
|
|
189
205
|
withDisabledToolFiltering
|
|
190
|
-
} from "../chunk-
|
|
206
|
+
} from "../chunk-S45JPKQN.js";
|
|
191
207
|
import {
|
|
192
208
|
AGENTS_BY_PHASE,
|
|
193
209
|
AGENT_CATALOG,
|
|
@@ -281,18 +297,35 @@ import {
|
|
|
281
297
|
updateProjectAgentLearned,
|
|
282
298
|
updateProjectAgentLearningPolicy,
|
|
283
299
|
validateProjectAgentConfig
|
|
284
|
-
} from "../chunk-
|
|
300
|
+
} from "../chunk-FCBTO76Z.js";
|
|
301
|
+
import "../chunk-J2WRWR37.js";
|
|
302
|
+
import "../chunk-LHOA5DWA.js";
|
|
303
|
+
import "../chunk-LA7CLDRW.js";
|
|
304
|
+
import "../chunk-WAHQVNWT.js";
|
|
305
|
+
import "../chunk-EODDVJBM.js";
|
|
306
|
+
import "../chunk-ZT7JNIGX.js";
|
|
307
|
+
import "../chunk-W5VITDM2.js";
|
|
308
|
+
import "../chunk-YPT4A46F.js";
|
|
309
|
+
import "../chunk-B7F4WVP4.js";
|
|
310
|
+
import "../chunk-WQTOVMGV.js";
|
|
311
|
+
import "../chunk-FNXVT7HF.js";
|
|
312
|
+
import "../chunk-5BMIE7QG.js";
|
|
313
|
+
import "../chunk-DYLPMV4Q.js";
|
|
314
|
+
import "../chunk-5S437PRC.js";
|
|
285
315
|
import {
|
|
286
316
|
MailboxProjectServerConnection,
|
|
287
317
|
RemoteMailbox,
|
|
318
|
+
SessionNoteHub,
|
|
288
319
|
applyMailboxSendPolicy,
|
|
289
320
|
createProjectMailbox,
|
|
290
321
|
getSharedProjectMailbox,
|
|
291
322
|
isMailboxProjectServerAvailable,
|
|
292
323
|
mailboxSessionTag,
|
|
293
324
|
makeMailboxTool,
|
|
294
|
-
|
|
295
|
-
|
|
325
|
+
postSessionNote,
|
|
326
|
+
resolveMailboxIdentity,
|
|
327
|
+
sessionNoteHub
|
|
328
|
+
} from "../chunk-JO4MGB6Z.js";
|
|
296
329
|
import {
|
|
297
330
|
CREDENTIAL_VERIFY_COOLDOWN_MS,
|
|
298
331
|
CREDENTIAL_VERIFY_MAX_FAILURES,
|
|
@@ -301,13 +334,13 @@ import {
|
|
|
301
334
|
credentialVerifyThrottle,
|
|
302
335
|
mailboxProjectServerEndpoint,
|
|
303
336
|
mailboxProjectServerMetadataPath
|
|
304
|
-
} from "../chunk-
|
|
337
|
+
} from "../chunk-PQNS3U7Z.js";
|
|
305
338
|
import {
|
|
306
339
|
MAILBOX_MAX_ACK_BATCH,
|
|
307
340
|
MAILBOX_MAX_QUERY_LIMIT,
|
|
308
341
|
redactMailboxCredential,
|
|
309
342
|
resolveProjectDir
|
|
310
|
-
} from "../chunk-
|
|
343
|
+
} from "../chunk-IRUTEHCE.js";
|
|
311
344
|
import {
|
|
312
345
|
MAILBOX_TYPE_PROPERTIES,
|
|
313
346
|
SESSION_RECIPIENT_PREFIX,
|
|
@@ -316,56 +349,42 @@ import {
|
|
|
316
349
|
mailboxIdentityBase,
|
|
317
350
|
normalizeRecipient,
|
|
318
351
|
sessionRecipient
|
|
319
|
-
} from "../chunk-
|
|
352
|
+
} from "../chunk-FWNLEZYG.js";
|
|
320
353
|
import "../chunk-SQJVFEBV.js";
|
|
321
|
-
import "../chunk-
|
|
322
|
-
import "../chunk-
|
|
323
|
-
import "../chunk-
|
|
354
|
+
import "../chunk-U45AXT5D.js";
|
|
355
|
+
import "../chunk-4SJNS7OB.js";
|
|
356
|
+
import "../chunk-Y5YXDM7D.js";
|
|
324
357
|
import "../chunk-HA4ZYA6T.js";
|
|
325
|
-
import "../chunk-A455ATZB.js";
|
|
326
358
|
import "../chunk-WQQON3SV.js";
|
|
327
359
|
import "../chunk-2YU4WVBW.js";
|
|
328
|
-
import "../chunk-
|
|
329
|
-
import "../chunk-
|
|
330
|
-
import "../chunk-
|
|
331
|
-
import "../chunk-
|
|
332
|
-
import "../chunk-TYW2GI5I.js";
|
|
333
|
-
import "../chunk-LHOA5DWA.js";
|
|
334
|
-
import "../chunk-GFJOMSHG.js";
|
|
335
|
-
import "../chunk-QRTG4XTI.js";
|
|
336
|
-
import "../chunk-EODDVJBM.js";
|
|
337
|
-
import "../chunk-CQQL4ZOQ.js";
|
|
338
|
-
import "../chunk-RPOA7IAE.js";
|
|
339
|
-
import "../chunk-FFSX2QDQ.js";
|
|
340
|
-
import "../chunk-DEIQMBD2.js";
|
|
341
|
-
import "../chunk-FNXVT7HF.js";
|
|
342
|
-
import "../chunk-WQTOVMGV.js";
|
|
343
|
-
import "../chunk-AD7ZFZCS.js";
|
|
344
|
-
import "../chunk-KBZGE6LN.js";
|
|
345
|
-
import "../chunk-5S437PRC.js";
|
|
346
|
-
import "../chunk-WZO23AWO.js";
|
|
360
|
+
import "../chunk-QSTSJOCK.js";
|
|
361
|
+
import "../chunk-6FHWXLPT.js";
|
|
362
|
+
import "../chunk-UBGDX6FI.js";
|
|
363
|
+
import "../chunk-M27LIEKV.js";
|
|
347
364
|
import "../chunk-XEBHSJLT.js";
|
|
348
|
-
import "../chunk-
|
|
349
|
-
import "../chunk-
|
|
350
|
-
import "../chunk-4XV6IR37.js";
|
|
365
|
+
import "../chunk-6NWEVFEL.js";
|
|
366
|
+
import "../chunk-LSMMOS2Z.js";
|
|
351
367
|
import "../chunk-4VWO3ZXL.js";
|
|
352
|
-
import "../chunk-
|
|
353
|
-
import "../chunk-
|
|
354
|
-
import "../chunk-
|
|
368
|
+
import "../chunk-ZHZ2Y2DH.js";
|
|
369
|
+
import "../chunk-HI3JGZR2.js";
|
|
370
|
+
import "../chunk-HMLIGAU7.js";
|
|
355
371
|
import "../chunk-TRT2HRWZ.js";
|
|
356
372
|
import "../chunk-LX5QWLBL.js";
|
|
357
|
-
import "../chunk-
|
|
358
|
-
import "../chunk-
|
|
373
|
+
import "../chunk-POOOIWE5.js";
|
|
374
|
+
import "../chunk-OSGLYW5J.js";
|
|
375
|
+
import "../chunk-FC2ZGRF3.js";
|
|
376
|
+
import "../chunk-THEGTRAG.js";
|
|
359
377
|
import "../chunk-SVT4RNTR.js";
|
|
360
|
-
import "../chunk-
|
|
361
|
-
import "../chunk-
|
|
362
|
-
import "../chunk-
|
|
378
|
+
import "../chunk-SAFHACFA.js";
|
|
379
|
+
import "../chunk-RJIZEJ42.js";
|
|
380
|
+
import "../chunk-3ECENVHL.js";
|
|
381
|
+
import "../chunk-VVBP6KGT.js";
|
|
363
382
|
import "../chunk-KJ2ZTQSL.js";
|
|
364
383
|
import "../chunk-B4AMLZPB.js";
|
|
384
|
+
import "../chunk-PFZO3C6H.js";
|
|
365
385
|
import "../chunk-O37BQ65S.js";
|
|
366
|
-
import "../chunk-
|
|
386
|
+
import "../chunk-25LSLC3G.js";
|
|
367
387
|
import "../chunk-TBRL2RCC.js";
|
|
368
|
-
import "../chunk-PFZO3C6H.js";
|
|
369
388
|
export {
|
|
370
389
|
ACP_AGENTS,
|
|
371
390
|
AGENTS_BY_PHASE,
|
|
@@ -411,6 +430,7 @@ export {
|
|
|
411
430
|
DEFAULT_PROBE_COOLDOWN_MS,
|
|
412
431
|
DEFAULT_QUALITY_CHECKS,
|
|
413
432
|
DEFAULT_SUBAGENT_BASELINE,
|
|
433
|
+
DEFAULT_TIER_ID,
|
|
414
434
|
DELIVERY_AGENTS,
|
|
415
435
|
DEPENDENCY_FILE_PATTERNS,
|
|
416
436
|
DIRECTIVE_QUARANTINE_MAX_UTILITY,
|
|
@@ -481,6 +501,7 @@ export {
|
|
|
481
501
|
SESSION_RECIPIENT_PREFIX,
|
|
482
502
|
SKILL_AUGMENTATION_MAX_BYTES,
|
|
483
503
|
SUBAGENT_STRUCTURED_REPORT_META_KEY,
|
|
504
|
+
SessionNoteHub,
|
|
484
505
|
SubagentBudget,
|
|
485
506
|
TIMEOUT_PREEMPT_FRACTION,
|
|
486
507
|
TaskAuctioneer,
|
|
@@ -489,9 +510,11 @@ export {
|
|
|
489
510
|
WorktreeIntegrationError,
|
|
490
511
|
acquireOrJoin,
|
|
491
512
|
actionToAckInput,
|
|
513
|
+
activeTierConfig,
|
|
492
514
|
applyMailboxSendPolicy,
|
|
493
515
|
applyProjectAgentConfig,
|
|
494
516
|
applyRosterBudget,
|
|
517
|
+
applyTierToSubagentConfig,
|
|
495
518
|
assertProjectAgentRole,
|
|
496
519
|
assessCommitSafety,
|
|
497
520
|
assignNickname,
|
|
@@ -509,6 +532,7 @@ export {
|
|
|
509
532
|
canCaptureNewLearned,
|
|
510
533
|
captureLearnedFromAgentOutput,
|
|
511
534
|
captureLearnedFromAgentOutputDetailed,
|
|
535
|
+
classifyTier,
|
|
512
536
|
clearProjectAgentConsolidated,
|
|
513
537
|
clearProjectSkillAugmentation,
|
|
514
538
|
collabInjectMiddleware,
|
|
@@ -534,6 +558,8 @@ export {
|
|
|
534
558
|
directiveWasApplied,
|
|
535
559
|
dispatchAgent,
|
|
536
560
|
evaluateAutoOptimize,
|
|
561
|
+
evaluateLeaderTierSwitch,
|
|
562
|
+
evaluateSwitchEconomics,
|
|
537
563
|
finalize,
|
|
538
564
|
formatHumanPrompt,
|
|
539
565
|
formatSubagentStructuredReport,
|
|
@@ -545,6 +571,7 @@ export {
|
|
|
545
571
|
getProjectAgentLearnStats,
|
|
546
572
|
getSharedProjectMailbox,
|
|
547
573
|
hintLearnedNeedsSummarization,
|
|
574
|
+
isConfiguredTier,
|
|
548
575
|
isConsolidated,
|
|
549
576
|
isMailboxLeader,
|
|
550
577
|
isMailboxMessageVisibleTo,
|
|
@@ -553,9 +580,11 @@ export {
|
|
|
553
580
|
isValidMatrixKey,
|
|
554
581
|
kanbanBoundaryOps,
|
|
555
582
|
kanbanDispatch,
|
|
583
|
+
leaderTierPolicy,
|
|
556
584
|
listProjectAgentLearnedEntries,
|
|
557
585
|
listProjectAgentRoles,
|
|
558
586
|
listProjectSkillAugmentations,
|
|
587
|
+
listTierIds,
|
|
559
588
|
loadConsolidationMetadata,
|
|
560
589
|
loadProjectAgentConfig,
|
|
561
590
|
loadProjectAgentConsolidated,
|
|
@@ -589,6 +618,7 @@ export {
|
|
|
589
618
|
makeMutationTestTool,
|
|
590
619
|
makeQualityGateTool,
|
|
591
620
|
makeRollUpTool,
|
|
621
|
+
makeSessionNoteTool,
|
|
592
622
|
makeSpawnTool,
|
|
593
623
|
makeSubagentResultTool,
|
|
594
624
|
makeTerminateAllTool,
|
|
@@ -603,6 +633,7 @@ export {
|
|
|
603
633
|
parseMailboxSendInput,
|
|
604
634
|
parseTaskBoundary,
|
|
605
635
|
phaseForRole,
|
|
636
|
+
postSessionNote,
|
|
606
637
|
quarantinePath,
|
|
607
638
|
rankRoleSkills,
|
|
608
639
|
readLiveLock,
|
|
@@ -633,6 +664,7 @@ export {
|
|
|
633
664
|
resolveRoleSkillCandidates,
|
|
634
665
|
resolveSubagentModelTarget,
|
|
635
666
|
resolveSubagentWorktreeDecision,
|
|
667
|
+
resolveTier,
|
|
636
668
|
retiredDirectivesToWarnAbout,
|
|
637
669
|
roleNeedsIndependentReviewModel,
|
|
638
670
|
rosterSummaryFromConfigs,
|
|
@@ -643,6 +675,7 @@ export {
|
|
|
643
675
|
scoreAgents,
|
|
644
676
|
scoreSkillAffinity,
|
|
645
677
|
scrubRetiredLines,
|
|
678
|
+
sessionNoteHub,
|
|
646
679
|
sessionRecipient,
|
|
647
680
|
setKanbanBoundaryOps,
|
|
648
681
|
setKanbanDispatch,
|
|
@@ -653,6 +686,10 @@ export {
|
|
|
653
686
|
subagentNeedsWorktree,
|
|
654
687
|
taskBoundarySchemaProperties,
|
|
655
688
|
terminalPolicyDecision,
|
|
689
|
+
tierBudget,
|
|
690
|
+
tierLevel,
|
|
691
|
+
tierModelTarget,
|
|
692
|
+
tierRank,
|
|
656
693
|
unwrapWholeDocumentFence,
|
|
657
694
|
updatePackageOutdatedStatus,
|
|
658
695
|
updateProjectAgentConfig,
|
|
@@ -20,8 +20,8 @@ export interface KanbanDispatchPort {
|
|
|
20
20
|
failKanbanDispatch(projectRoot: string, input: FailDispatchInput): Promise<KanbanBoard | null>;
|
|
21
21
|
updateTaskAssignment(projectRoot: string, boardId: string, taskId: string, patch: Partial<KanbanAgentAssignment> & {
|
|
22
22
|
status?: KanbanAgentRunStatus | undefined;
|
|
23
|
-
}, eventContext
|
|
24
|
-
heartbeatTaskAssignment(projectRoot: string, boardId: string, taskId: string, input
|
|
23
|
+
}, eventContext: KanbanEventContext): Promise<KanbanBoard | null>;
|
|
24
|
+
heartbeatTaskAssignment(projectRoot: string, boardId: string, taskId: string, input: HeartbeatKanbanTaskAssignmentInput, eventContext: KanbanEventContext): Promise<KanbanBoard | null>;
|
|
25
25
|
}
|
|
26
26
|
/** Composition-root hook: register the real kanban-backed implementation. */
|
|
27
27
|
export declare function setKanbanDispatch(impl: KanbanDispatchPort): void;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
|
-
import type { MailboxEventEmitter } from './mailbox-events.js';
|
|
3
2
|
import type { MailboxCredentialVerifier } from './mailbox-credential-store.js';
|
|
3
|
+
import type { MailboxEventEmitter } from './mailbox-events.js';
|
|
4
4
|
import { type MailboxHttpAccessDecision } from './mailbox-http-auth.js';
|
|
5
|
+
export type { MailboxHttpAccessDecision };
|
|
6
|
+
import type { MailboxHttpRateLimiter } from './mailbox-http-rate-limit.js';
|
|
5
7
|
import { MAILBOX_HTTP_MAX_AGE_CEILING_MS } from './mailbox-http-validation.js';
|
|
6
8
|
import type { Mailbox } from './mailbox-types.js';
|
|
7
|
-
import type { MailboxHttpRateLimiter } from './mailbox-http-rate-limit.js';
|
|
8
9
|
export { MAILBOX_HTTP_RATE_LIMIT_PER_MINUTE, MAILBOX_HTTP_RATE_LIMIT_WINDOW_MS, MailboxHttpRateLimiter, } from './mailbox-http-rate-limit.js';
|
|
9
10
|
export declare const MAILBOX_HTTP_MAX_BODY_BYTES: number;
|
|
10
11
|
export declare const MAILBOX_HTTP_DEFAULT_MAX_AGE_MS: number;
|
|
12
|
+
export { authorizeMailboxBearerToken, authorizePersistedMailboxCredential } from './mailbox-http-auth.js';
|
|
11
13
|
export { MAILBOX_HTTP_MAX_AGE_CEILING_MS };
|
|
12
|
-
export { authorizeMailboxBearerToken, authorizePersistedMailboxCredential, type MailboxHttpAccessDecision, type MailboxHttpCredentialDecision, } from './mailbox-http-auth.js';
|
|
13
14
|
export interface MailboxHttpRouterOptions {
|
|
14
15
|
mailbox: Mailbox;
|
|
15
16
|
eventEmitter?: MailboxEventEmitter;
|
|
@@ -47,7 +47,7 @@ export declare function validateCheck(body: unknown, actorId?: string): MailboxC
|
|
|
47
47
|
export declare function validateAck(body: unknown, actorId?: string): MailboxAckInput;
|
|
48
48
|
export declare function validateAckMany(body: unknown, actorId?: string): MailboxAckBatchInput;
|
|
49
49
|
export declare function validateAgentRegistration(body: unknown, actor?: MailboxActorContext): AgentRegistrationInput;
|
|
50
|
-
export declare function validateAgentHeartbeat(body: unknown,
|
|
50
|
+
export declare function validateAgentHeartbeat(body: unknown, actor?: MailboxActorContext): AgentHeartbeatInput;
|
|
51
51
|
export declare function validateClientRegistration(body: unknown): ClientRegistrationInput;
|
|
52
52
|
export declare function validateClientHeartbeat(body: unknown): ClientHeartbeatInput;
|
|
53
53
|
//# sourceMappingURL=mailbox-http-validation.d.ts.map
|
|
@@ -2,9 +2,15 @@
|
|
|
2
2
|
import {
|
|
3
3
|
MailboxEventEmitter
|
|
4
4
|
} from "../chunk-JX7VBZDK.js";
|
|
5
|
+
import {
|
|
6
|
+
useDaemonPerfDefaults
|
|
7
|
+
} from "../chunk-FNXVT7HF.js";
|
|
8
|
+
import {
|
|
9
|
+
startSharedHeapWatchdog
|
|
10
|
+
} from "../chunk-DYLPMV4Q.js";
|
|
5
11
|
import {
|
|
6
12
|
EventBus
|
|
7
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-FHZVFYSL.js";
|
|
8
14
|
import {
|
|
9
15
|
MAILBOX_PROJECT_SERVER_MAX_FRAME_CHARS,
|
|
10
16
|
MAILBOX_PROJECT_SERVER_PROTOCOL_VERSION,
|
|
@@ -14,27 +20,21 @@ import {
|
|
|
14
20
|
isMailboxProjectServerClientMessage,
|
|
15
21
|
mailboxProjectServerEndpoint,
|
|
16
22
|
mailboxProjectServerMetadataPath
|
|
17
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-PQNS3U7Z.js";
|
|
18
24
|
import {
|
|
19
25
|
redactMailboxCredential
|
|
20
|
-
} from "../chunk-
|
|
21
|
-
import "../chunk-
|
|
26
|
+
} from "../chunk-IRUTEHCE.js";
|
|
27
|
+
import "../chunk-FWNLEZYG.js";
|
|
22
28
|
import {
|
|
23
29
|
restrictFilePermissions
|
|
24
|
-
} from "../chunk-
|
|
25
|
-
import {
|
|
26
|
-
useDaemonPerfDefaults
|
|
27
|
-
} from "../chunk-FNXVT7HF.js";
|
|
28
|
-
import {
|
|
29
|
-
startSharedHeapWatchdog
|
|
30
|
-
} from "../chunk-KBZGE6LN.js";
|
|
30
|
+
} from "../chunk-6FHWXLPT.js";
|
|
31
31
|
import "../chunk-LX5QWLBL.js";
|
|
32
|
-
import "../chunk-
|
|
32
|
+
import "../chunk-POOOIWE5.js";
|
|
33
33
|
import {
|
|
34
34
|
atomicWrite
|
|
35
|
-
} from "../chunk-
|
|
36
|
-
import "../chunk-
|
|
37
|
-
import "../chunk-
|
|
35
|
+
} from "../chunk-OSGLYW5J.js";
|
|
36
|
+
import "../chunk-SAFHACFA.js";
|
|
37
|
+
import "../chunk-25LSLC3G.js";
|
|
38
38
|
import "../chunk-TBRL2RCC.js";
|
|
39
39
|
|
|
40
40
|
// src/coordination/mailbox-project-server.ts
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import type { MailboxMessageType } from './mailbox-type-properties.js';
|
|
2
1
|
import type { MailboxAudience, MailboxMessage, MailboxSessionAffinity, MailboxTaskContext } from './mailbox-message-types.js';
|
|
3
|
-
|
|
4
|
-
export { expandMailboxCapabilities, hasMailboxCapability, MAILBOX_CAPABILITY_IMPLICATIONS, type MailboxActorContext, type MailboxAuthMode, type MailboxCapability, type MailboxPrincipalKind, } from './mailbox-auth-types.js';
|
|
5
|
-
export { isActionRequiredForActor, isMailboxLeader, isMailboxMessageVisibleTo, isMailboxReceiptRecordV2, isMailboxSenderInFamily, mailboxIdentityBase, normalizeRecipient, SESSION_RECIPIENT_PREFIX, sessionRecipient, validateSendType, } from './mailbox-predicates.js';
|
|
2
|
+
import type { MailboxMessageType } from './mailbox-type-properties.js';
|
|
6
3
|
import type { MailboxSessionAffinityContext } from './mailbox-session-sync.js';
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
4
|
+
export type { MailboxActorContext, MailboxAuthMode, MailboxCapability, MailboxPrincipalKind, } from './mailbox-auth-types.js';
|
|
5
|
+
export { expandMailboxCapabilities, hasMailboxCapability, MAILBOX_CAPABILITY_IMPLICATIONS } from './mailbox-auth-types.js';
|
|
6
|
+
export { isActionRequiredForActor, isMailboxLeader, isMailboxMessageVisibleTo, isMailboxReceiptRecordV2, isMailboxSenderInFamily, mailboxIdentityBase, normalizeRecipient, SESSION_RECIPIENT_PREFIX, sessionRecipient, validateSendType, } from './mailbox-predicates.js';
|
|
7
|
+
export type { MailboxMessageType } from './mailbox-type-properties.js';
|
|
8
|
+
export { MAILBOX_TYPE_PROPERTIES } from './mailbox-type-properties.js';
|
|
9
|
+
export type { MailboxSessionAffinityContext } from './mailbox-session-sync.js';
|
|
10
|
+
export type { ActorMailboxMessage, MailboxAudience, MailboxLegacyReportSessionAffinity, MailboxMessage, MailboxReceiptRecordV2, MailboxScopedSessionAffinity, MailboxSessionAffinity, MailboxTaskContext, ReadReceipts, } from './mailbox-message-types.js';
|
|
11
|
+
export { acceptMailboxMessageForSession, acceptMailboxMessageForSessionSync } from './mailbox-session-sync.js';
|
|
9
12
|
export interface RegisteredAgent {
|
|
10
13
|
agentId: string;
|
|
11
14
|
sessionId: string;
|
|
@@ -145,6 +148,21 @@ export interface AgentHeartbeatInput {
|
|
|
145
148
|
currentTask?: string | undefined;
|
|
146
149
|
iterations?: number | undefined;
|
|
147
150
|
toolCalls?: number | undefined;
|
|
151
|
+
/**
|
|
152
|
+
* Identity fields, carried so a heartbeat can REBUILD a pruned row.
|
|
153
|
+
*
|
|
154
|
+
* A registry row is deleted once it is older than AGENT_STALE_MS — either by
|
|
155
|
+
* the agent's own prune or by any observer calling getAgentStatuses(). Without
|
|
156
|
+
* these, `heartbeat` can only refresh a row that still exists, so a live agent
|
|
157
|
+
* that lost its row stays invisible forever (it never calls registerAgent
|
|
158
|
+
* again). They are optional to keep the RPC wire-compatible: a caller that
|
|
159
|
+
* omits them gets the previous refresh-only behavior.
|
|
160
|
+
*/
|
|
161
|
+
sessionId?: string | undefined;
|
|
162
|
+
name?: string | undefined;
|
|
163
|
+
role?: string | undefined;
|
|
164
|
+
pid?: number | undefined;
|
|
165
|
+
source?: 'cli' | 'webui' | 'mcp' | 'acp' | 'http' | undefined;
|
|
148
166
|
}
|
|
149
167
|
export interface PurgeOptions {
|
|
150
168
|
completedMaxAgeMs?: number | undefined;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Leader tier self-switching policy.
|
|
3
|
+
*
|
|
4
|
+
* The leader may notice mid-session that it is doing cheap work on an
|
|
5
|
+
* expensive model (or the reverse) and want to move itself to another tier.
|
|
6
|
+
* That is genuinely useful and genuinely dangerous, so every decision goes
|
|
7
|
+
* through the pure guards in this module.
|
|
8
|
+
*
|
|
9
|
+
* Why guards at all — a tier switch is NOT free:
|
|
10
|
+
*
|
|
11
|
+
* 1. It invalidates the provider prompt cache. The next turn re-reads the
|
|
12
|
+
* whole conversation at full input price on the new model. A switch that
|
|
13
|
+
* saves $0.002/turn but costs $0.40 to re-warm is a loss, and a switch
|
|
14
|
+
* that happens every time a heuristic wobbles across a threshold is a
|
|
15
|
+
* permanent tax. Hence {@link ModelTierLeaderConfig.dwellTurns} and the
|
|
16
|
+
* break-even test.
|
|
17
|
+
* 2. A downgrade can land on a model with a SMALLER context window. If the
|
|
18
|
+
* conversation already exceeds it, the session is stranded. Hence the
|
|
19
|
+
* context-fill gate.
|
|
20
|
+
* 3. Spending authority belongs to the user. The leader may never raise
|
|
21
|
+
* itself above `maxTier`, and in the default 'propose' mode it may not
|
|
22
|
+
* switch at all without a human accepting.
|
|
23
|
+
*
|
|
24
|
+
* Everything here is pure: prices, window sizes and turn counts are injected,
|
|
25
|
+
* so the policy is unit-testable and holds no I/O or layer dependencies.
|
|
26
|
+
*/
|
|
27
|
+
import type { Config, ModelTierLeaderMode } from '../types/config.js';
|
|
28
|
+
/** Per-1M-token prices and window for one model, as published by models.dev. */
|
|
29
|
+
export interface TierModelEconomics {
|
|
30
|
+
/** USD per 1M uncached input tokens. */
|
|
31
|
+
inputPerMTok?: number | undefined;
|
|
32
|
+
/** USD per 1M output tokens. */
|
|
33
|
+
outputPerMTok?: number | undefined;
|
|
34
|
+
/** USD per 1M cache-read input tokens. */
|
|
35
|
+
cacheReadPerMTok?: number | undefined;
|
|
36
|
+
/** USD per 1M cache-write input tokens. */
|
|
37
|
+
cacheWritePerMTok?: number | undefined;
|
|
38
|
+
/** Context window in tokens. */
|
|
39
|
+
maxContext?: number | undefined;
|
|
40
|
+
}
|
|
41
|
+
export interface LeaderTierSwitchRequest {
|
|
42
|
+
/** Tier the leader is on now (undefined when it has never been set). */
|
|
43
|
+
fromTier?: string | undefined;
|
|
44
|
+
/** Tier the leader wants to move to. */
|
|
45
|
+
toTier: string;
|
|
46
|
+
/** Current conversation size in tokens — what a switch would have to re-read. */
|
|
47
|
+
contextTokens: number;
|
|
48
|
+
/** Turns elapsed since the last tier switch. Large when there has been none. */
|
|
49
|
+
turnsSinceSwitch: number;
|
|
50
|
+
/** Economics of the current and target models. */
|
|
51
|
+
economics: {
|
|
52
|
+
from: TierModelEconomics;
|
|
53
|
+
to: TierModelEconomics;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* How many further turns to amortize the re-warm cost over. Defaults to the
|
|
57
|
+
* configured `dwellTurns`, which is the minimum the session is committed to
|
|
58
|
+
* staying on the new tier anyway — deliberately conservative.
|
|
59
|
+
*/
|
|
60
|
+
projectedTurns?: number | undefined;
|
|
61
|
+
}
|
|
62
|
+
export type LeaderTierRefusalCode = 'disabled' | 'same-tier' | 'unknown-tier' | 'dwell' | 'context-window' | 'ceiling' | 'not-worth-it';
|
|
63
|
+
export interface LeaderTierEconomicsSummary {
|
|
64
|
+
/** One-off cost of re-reading the context on the target model. */
|
|
65
|
+
reWarmCostUsd: number;
|
|
66
|
+
/** Per-turn context cost on the current model. */
|
|
67
|
+
stayCostPerTurnUsd: number;
|
|
68
|
+
/** Per-turn context cost on the target model. */
|
|
69
|
+
switchCostPerTurnUsd: number;
|
|
70
|
+
/** Net saving over `projectedTurns`, after paying the re-warm cost. */
|
|
71
|
+
projectedSavingsUsd: number;
|
|
72
|
+
/** True when the target is cheaper per input token than the current model. */
|
|
73
|
+
isDowngrade: boolean;
|
|
74
|
+
}
|
|
75
|
+
export type LeaderTierVerdict = {
|
|
76
|
+
allowed: true;
|
|
77
|
+
/** 'auto' means apply now; 'propose' means ask a human first. */
|
|
78
|
+
mode: Extract<ModelTierLeaderMode, 'auto' | 'propose'>;
|
|
79
|
+
economics: LeaderTierEconomicsSummary;
|
|
80
|
+
reason: string;
|
|
81
|
+
} | {
|
|
82
|
+
allowed: false;
|
|
83
|
+
code: LeaderTierRefusalCode;
|
|
84
|
+
economics?: LeaderTierEconomicsSummary | undefined;
|
|
85
|
+
reason: string;
|
|
86
|
+
};
|
|
87
|
+
/** The leader policy with every default resolved to a concrete value. */
|
|
88
|
+
export interface ResolvedLeaderTierPolicy {
|
|
89
|
+
mode: ModelTierLeaderMode;
|
|
90
|
+
dwellTurns: number;
|
|
91
|
+
minSavingsUsd: number;
|
|
92
|
+
maxContextFillForSwitch: number;
|
|
93
|
+
maxTier?: string | undefined;
|
|
94
|
+
}
|
|
95
|
+
/** Read the leader policy with defaults applied. */
|
|
96
|
+
export declare function leaderTierPolicy(config: Config): ResolvedLeaderTierPolicy;
|
|
97
|
+
/**
|
|
98
|
+
* Rank of a tier within the configured ladder. Config declaration order IS the
|
|
99
|
+
* ladder — the first declared level is the cheapest rung. Ranking by name would
|
|
100
|
+
* mean guessing at user-defined level names, and ranking by live price would
|
|
101
|
+
* make a ceiling flip whenever a provider changed its price list.
|
|
102
|
+
*/
|
|
103
|
+
export declare function tierRank(config: Config, tier: string | undefined): number;
|
|
104
|
+
/**
|
|
105
|
+
* Cost model for the switch.
|
|
106
|
+
*
|
|
107
|
+
* `contextTokens` is the quantity that actually matters: it is re-read on every
|
|
108
|
+
* turn, cached on the current model and uncached on the first turn of the new
|
|
109
|
+
* one. Output tokens are not modeled — they do not change with the switch
|
|
110
|
+
* decision and would only add noise to the comparison.
|
|
111
|
+
*/
|
|
112
|
+
export declare function evaluateSwitchEconomics(request: LeaderTierSwitchRequest, projectedTurns: number): LeaderTierEconomicsSummary;
|
|
113
|
+
/**
|
|
114
|
+
* The full decision. Returns whether the switch may happen, and — in 'propose'
|
|
115
|
+
* mode — that a human has to accept it first.
|
|
116
|
+
*
|
|
117
|
+
* Guard order is deliberate: the cheap structural checks run before the
|
|
118
|
+
* economics, so a refusal reason is always the most fundamental one rather than
|
|
119
|
+
* whichever gate happened to be evaluated first.
|
|
120
|
+
*/
|
|
121
|
+
export declare function evaluateLeaderTierSwitch(config: Config, request: LeaderTierSwitchRequest): LeaderTierVerdict;
|
|
122
|
+
//# sourceMappingURL=model-tier-leader.d.ts.map
|