@decibelsystems/tools 2.2.0-beta.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +226 -0
- package/dist/agentCommands.d.ts +0 -1
- package/dist/agentCommands.d.ts.map +1 -1
- package/dist/agentCommands.js +19 -8
- package/dist/agentCommands.js.map +1 -1
- package/dist/agentPresence.d.ts +82 -0
- package/dist/agentPresence.d.ts.map +1 -1
- package/dist/agentPresence.js +194 -26
- package/dist/agentPresence.js.map +1 -1
- package/dist/agentic/index.d.ts +18 -8
- package/dist/agentic/index.d.ts.map +1 -1
- package/dist/agentic/index.js +18 -144
- package/dist/agentic/index.js.map +1 -1
- package/dist/agentic/types.d.ts +106 -0
- package/dist/agentic/types.d.ts.map +1 -1
- package/dist/agentic/types.js +77 -1
- package/dist/agentic/types.js.map +1 -1
- package/dist/architectAdrs.d.ts +27 -3
- package/dist/architectAdrs.d.ts.map +1 -1
- package/dist/architectAdrs.js +92 -4
- package/dist/architectAdrs.js.map +1 -1
- package/dist/artifacts.d.ts +60 -0
- package/dist/artifacts.d.ts.map +1 -0
- package/dist/artifacts.js +208 -0
- package/dist/artifacts.js.map +1 -0
- package/dist/asks.d.ts +93 -0
- package/dist/asks.d.ts.map +1 -0
- package/dist/asks.js +383 -0
- package/dist/asks.js.map +1 -0
- package/dist/chat.d.ts +47 -0
- package/dist/chat.d.ts.map +1 -0
- package/dist/chat.js +288 -0
- package/dist/chat.js.map +1 -0
- package/dist/client/transports.d.ts.map +1 -1
- package/dist/client/transports.js +13 -3
- package/dist/client/transports.js.map +1 -1
- package/dist/daemon.d.ts +33 -3
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +225 -52
- package/dist/daemon.js.map +1 -1
- package/dist/daemonConfig.d.ts +46 -0
- package/dist/daemonConfig.d.ts.map +1 -1
- package/dist/daemonConfig.js +57 -12
- package/dist/daemonConfig.js.map +1 -1
- package/dist/decibelPaths.d.ts.map +1 -1
- package/dist/decibelPaths.js +39 -6
- package/dist/decibelPaths.js.map +1 -1
- package/dist/domain/issue.d.ts +81 -0
- package/dist/domain/issue.d.ts.map +1 -0
- package/dist/domain/issue.js +106 -0
- package/dist/domain/issue.js.map +1 -0
- package/dist/domain/issueCodec.d.ts +39 -0
- package/dist/domain/issueCodec.d.ts.map +1 -0
- package/dist/domain/issueCodec.js +308 -0
- package/dist/domain/issueCodec.js.map +1 -0
- package/dist/domain/issueRepository.d.ts +124 -0
- package/dist/domain/issueRepository.d.ts.map +1 -0
- package/dist/domain/issueRepository.js +296 -0
- package/dist/domain/issueRepository.js.map +1 -0
- package/dist/domain/uid.d.ts +16 -0
- package/dist/domain/uid.d.ts.map +1 -0
- package/dist/domain/uid.js +43 -0
- package/dist/domain/uid.js.map +1 -0
- package/dist/facades/definitions.d.ts +0 -1
- package/dist/facades/definitions.d.ts.map +1 -1
- package/dist/facades/definitions.js +140 -116
- package/dist/facades/definitions.js.map +1 -1
- package/dist/facades/index.d.ts +2 -1
- package/dist/facades/index.d.ts.map +1 -1
- package/dist/facades/index.js +1 -1
- package/dist/facades/index.js.map +1 -1
- package/dist/facades/types.d.ts +17 -0
- package/dist/facades/types.d.ts.map +1 -1
- package/dist/hq/defineAgent.d.ts.map +1 -1
- package/dist/hq/defineAgent.js +7 -11
- package/dist/hq/defineAgent.js.map +1 -1
- package/dist/httpArgs.d.ts +11 -0
- package/dist/httpArgs.d.ts.map +1 -0
- package/dist/httpArgs.js +39 -0
- package/dist/httpArgs.js.map +1 -0
- package/dist/httpServer.d.ts +1 -12
- package/dist/httpServer.d.ts.map +1 -1
- package/dist/httpServer.js +298 -144
- package/dist/httpServer.js.map +1 -1
- package/dist/identity.d.ts +123 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +312 -0
- package/dist/identity.js.map +1 -0
- package/dist/kernel.d.ts +46 -1
- package/dist/kernel.d.ts.map +1 -1
- package/dist/kernel.js +334 -26
- package/dist/kernel.js.map +1 -1
- package/dist/killSwitch.d.ts +117 -0
- package/dist/killSwitch.d.ts.map +1 -0
- package/dist/killSwitch.js +161 -0
- package/dist/killSwitch.js.map +1 -0
- package/dist/lib/agent-services/assumptions.d.ts.map +1 -1
- package/dist/lib/agent-services/assumptions.js +8 -2
- package/dist/lib/agent-services/assumptions.js.map +1 -1
- package/dist/lib/atomicWrite.d.ts +49 -0
- package/dist/lib/atomicWrite.d.ts.map +1 -0
- package/dist/lib/atomicWrite.js +157 -0
- package/dist/lib/atomicWrite.js.map +1 -0
- package/dist/lib/envelope.d.ts +31 -0
- package/dist/lib/envelope.d.ts.map +1 -0
- package/dist/lib/envelope.js +80 -0
- package/dist/lib/envelope.js.map +1 -0
- package/dist/lib/fileLock.d.ts +38 -0
- package/dist/lib/fileLock.d.ts.map +1 -0
- package/dist/lib/fileLock.js +124 -0
- package/dist/lib/fileLock.js.map +1 -0
- package/dist/lib/recordIdAllocator.d.ts +102 -0
- package/dist/lib/recordIdAllocator.d.ts.map +1 -0
- package/dist/lib/recordIdAllocator.js +179 -0
- package/dist/lib/recordIdAllocator.js.map +1 -0
- package/dist/orgId.d.ts +23 -0
- package/dist/orgId.d.ts.map +1 -0
- package/dist/orgId.js +73 -0
- package/dist/orgId.js.map +1 -0
- package/dist/pairCli.d.ts +2 -0
- package/dist/pairCli.d.ts.map +1 -0
- package/dist/pairCli.js +97 -0
- package/dist/pairCli.js.map +1 -0
- package/dist/peerBroker.d.ts +40 -0
- package/dist/peerBroker.d.ts.map +1 -0
- package/dist/peerBroker.js +70 -0
- package/dist/peerBroker.js.map +1 -0
- package/dist/peerBrokerSupervisor.d.ts +21 -0
- package/dist/peerBrokerSupervisor.d.ts.map +1 -0
- package/dist/peerBrokerSupervisor.js +131 -0
- package/dist/peerBrokerSupervisor.js.map +1 -0
- package/dist/projectPaths.d.ts.map +1 -1
- package/dist/projectPaths.js +1 -19
- package/dist/projectPaths.js.map +1 -1
- package/dist/projectRegistry.d.ts +22 -0
- package/dist/projectRegistry.d.ts.map +1 -1
- package/dist/projectRegistry.js +69 -2
- package/dist/projectRegistry.js.map +1 -1
- package/dist/pty/boundary.d.ts +39 -0
- package/dist/pty/boundary.d.ts.map +1 -0
- package/dist/pty/boundary.js +100 -0
- package/dist/pty/boundary.js.map +1 -0
- package/dist/pty/errors.d.ts +6 -0
- package/dist/pty/errors.d.ts.map +1 -0
- package/dist/pty/errors.js +12 -0
- package/dist/pty/errors.js.map +1 -0
- package/dist/pty/fleet.d.ts +159 -0
- package/dist/pty/fleet.d.ts.map +1 -0
- package/dist/pty/fleet.js +543 -0
- package/dist/pty/fleet.js.map +1 -0
- package/dist/pty/launchProfile.d.ts +45 -0
- package/dist/pty/launchProfile.d.ts.map +1 -0
- package/dist/pty/launchProfile.js +149 -0
- package/dist/pty/launchProfile.js.map +1 -0
- package/dist/pty/openTerminal.d.ts +48 -0
- package/dist/pty/openTerminal.d.ts.map +1 -0
- package/dist/pty/openTerminal.js +185 -0
- package/dist/pty/openTerminal.js.map +1 -0
- package/dist/pty/pairDialog.d.ts +16 -0
- package/dist/pty/pairDialog.d.ts.map +1 -0
- package/dist/pty/pairDialog.js +121 -0
- package/dist/pty/pairDialog.js.map +1 -0
- package/dist/pty/pairing.d.ts +86 -0
- package/dist/pty/pairing.d.ts.map +1 -0
- package/dist/pty/pairing.js +351 -0
- package/dist/pty/pairing.js.map +1 -0
- package/dist/pty/routes.d.ts +49 -0
- package/dist/pty/routes.d.ts.map +1 -0
- package/dist/pty/routes.js +624 -0
- package/dist/pty/routes.js.map +1 -0
- package/dist/pty/sessions.d.ts +167 -0
- package/dist/pty/sessions.d.ts.map +1 -0
- package/dist/pty/sessions.js +513 -0
- package/dist/pty/sessions.js.map +1 -0
- package/dist/pty/tmux.d.ts +109 -0
- package/dist/pty/tmux.d.ts.map +1 -0
- package/dist/pty/tmux.js +271 -0
- package/dist/pty/tmux.js.map +1 -0
- package/dist/roster.d.ts +37 -0
- package/dist/roster.d.ts.map +1 -0
- package/dist/roster.js +126 -0
- package/dist/roster.js.map +1 -0
- package/dist/runtime/circuitBreaker.d.ts +95 -0
- package/dist/runtime/circuitBreaker.d.ts.map +1 -0
- package/dist/runtime/circuitBreaker.js +178 -0
- package/dist/runtime/circuitBreaker.js.map +1 -0
- package/dist/runtime/daemonMeta.d.ts +53 -0
- package/dist/runtime/daemonMeta.d.ts.map +1 -0
- package/dist/runtime/daemonMeta.js +121 -0
- package/dist/runtime/daemonMeta.js.map +1 -0
- package/dist/runtime/ensureRuntime.d.ts +103 -0
- package/dist/runtime/ensureRuntime.d.ts.map +1 -0
- package/dist/runtime/ensureRuntime.js +276 -0
- package/dist/runtime/ensureRuntime.js.map +1 -0
- package/dist/runtime/extensions.d.ts +57 -0
- package/dist/runtime/extensions.d.ts.map +1 -0
- package/dist/runtime/extensions.js +216 -0
- package/dist/runtime/extensions.js.map +1 -0
- package/dist/runtime/localHttp.d.ts +24 -0
- package/dist/runtime/localHttp.d.ts.map +1 -0
- package/dist/runtime/localHttp.js +84 -0
- package/dist/runtime/localHttp.js.map +1 -0
- package/dist/runtime/projectResolution.d.ts +29 -0
- package/dist/runtime/projectResolution.d.ts.map +1 -0
- package/dist/runtime/projectResolution.js +67 -0
- package/dist/runtime/projectResolution.js.map +1 -0
- package/dist/runtime/protocol.d.ts +62 -0
- package/dist/runtime/protocol.d.ts.map +1 -0
- package/dist/runtime/protocol.js +74 -0
- package/dist/runtime/protocol.js.map +1 -0
- package/dist/sentinelIssues.d.ts +42 -2
- package/dist/sentinelIssues.d.ts.map +1 -1
- package/dist/sentinelIssues.js +167 -65
- package/dist/sentinelIssues.js.map +1 -1
- package/dist/server.js +123 -15
- package/dist/server.js.map +1 -1
- package/dist/toolConfig.d.ts.map +1 -1
- package/dist/toolConfig.js +12 -0
- package/dist/toolConfig.js.map +1 -1
- package/dist/tools/agentic/agentQueue.d.ts.map +1 -1
- package/dist/tools/agentic/agentQueue.js +4 -0
- package/dist/tools/agentic/agentQueue.js.map +1 -1
- package/dist/tools/agentic/index.d.ts.map +1 -1
- package/dist/tools/agentic/index.js +28 -2
- package/dist/tools/agentic/index.js.map +1 -1
- package/dist/tools/architect/index.d.ts +1 -0
- package/dist/tools/architect/index.d.ts.map +1 -1
- package/dist/tools/architect/index.js +52 -3
- package/dist/tools/architect/index.js.map +1 -1
- package/dist/tools/architect.d.ts.map +1 -1
- package/dist/tools/architect.js +59 -8
- package/dist/tools/architect.js.map +1 -1
- package/dist/tools/artifacts.d.ts +5 -0
- package/dist/tools/artifacts.d.ts.map +1 -0
- package/dist/tools/artifacts.js +89 -0
- package/dist/tools/artifacts.js.map +1 -0
- package/dist/tools/asks.d.ts +6 -0
- package/dist/tools/asks.d.ts.map +1 -0
- package/dist/tools/asks.js +104 -0
- package/dist/tools/asks.js.map +1 -0
- package/dist/tools/context.d.ts +10 -5
- package/dist/tools/context.d.ts.map +1 -1
- package/dist/tools/context.js +45 -18
- package/dist/tools/context.js.map +1 -1
- package/dist/tools/coordinator/coordinator.d.ts.map +1 -1
- package/dist/tools/coordinator/coordinator.js +48 -19
- package/dist/tools/coordinator/coordinator.js.map +1 -1
- package/dist/tools/coordinator/index.d.ts +1 -0
- package/dist/tools/coordinator/index.d.ts.map +1 -1
- package/dist/tools/coordinator/index.js +42 -2
- package/dist/tools/coordinator/index.js.map +1 -1
- package/dist/tools/crit.d.ts +2 -1
- package/dist/tools/crit.d.ts.map +1 -1
- package/dist/tools/crit.js +19 -4
- package/dist/tools/crit.js.map +1 -1
- package/dist/tools/data-inspector.d.ts +1 -1
- package/dist/tools/data-inspector.d.ts.map +1 -1
- package/dist/tools/data-inspector.js +1 -1
- package/dist/tools/data-inspector.js.map +1 -1
- package/dist/tools/designer/index.d.ts.map +1 -1
- package/dist/tools/designer/index.js +4 -3
- package/dist/tools/designer/index.js.map +1 -1
- package/dist/tools/designer/lateral-tools.d.ts.map +1 -1
- package/dist/tools/designer/lateral-tools.js +4 -2
- package/dist/tools/designer/lateral-tools.js.map +1 -1
- package/dist/tools/designer.d.ts +2 -1
- package/dist/tools/designer.d.ts.map +1 -1
- package/dist/tools/designer.js +24 -12
- package/dist/tools/designer.js.map +1 -1
- package/dist/tools/dojo/index.d.ts.map +1 -1
- package/dist/tools/dojo/index.js +52 -3
- package/dist/tools/dojo/index.js.map +1 -1
- package/dist/tools/dojo.d.ts +65 -3
- package/dist/tools/dojo.d.ts.map +1 -1
- package/dist/tools/dojo.js +148 -23
- package/dist/tools/dojo.js.map +1 -1
- package/dist/tools/friction.d.ts.map +1 -1
- package/dist/tools/friction.js +16 -6
- package/dist/tools/friction.js.map +1 -1
- package/dist/tools/guardian.d.ts +7 -0
- package/dist/tools/guardian.d.ts.map +1 -1
- package/dist/tools/guardian.js +152 -11
- package/dist/tools/guardian.js.map +1 -1
- package/dist/tools/hygiene/oracle-hygiene.d.ts.map +1 -1
- package/dist/tools/hygiene/oracle-hygiene.js +8 -2
- package/dist/tools/hygiene/oracle-hygiene.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +33 -18
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/killswitch/index.d.ts +13 -0
- package/dist/tools/killswitch/index.d.ts.map +1 -0
- package/dist/tools/killswitch/index.js +138 -0
- package/dist/tools/killswitch/index.js.map +1 -0
- package/dist/tools/learnings.d.ts +2 -1
- package/dist/tools/learnings.d.ts.map +1 -1
- package/dist/tools/learnings.js +31 -15
- package/dist/tools/learnings.js.map +1 -1
- package/dist/tools/oracle/index.d.ts.map +1 -1
- package/dist/tools/oracle/index.js +8 -0
- package/dist/tools/oracle/index.js.map +1 -1
- package/dist/tools/oracle.d.ts +7 -0
- package/dist/tools/oracle.d.ts.map +1 -1
- package/dist/tools/oracle.js +41 -12
- package/dist/tools/oracle.js.map +1 -1
- package/dist/tools/policy.d.ts +2 -1
- package/dist/tools/policy.d.ts.map +1 -1
- package/dist/tools/policy.js +28 -9
- package/dist/tools/policy.js.map +1 -1
- package/dist/tools/postoffice/index.d.ts +10 -0
- package/dist/tools/postoffice/index.d.ts.map +1 -0
- package/dist/tools/postoffice/index.js +218 -0
- package/dist/tools/postoffice/index.js.map +1 -0
- package/dist/tools/postoffice.d.ts +78 -0
- package/dist/tools/postoffice.d.ts.map +1 -0
- package/dist/tools/postoffice.js +199 -0
- package/dist/tools/postoffice.js.map +1 -0
- package/dist/tools/provenance.d.ts +18 -2
- package/dist/tools/provenance.d.ts.map +1 -1
- package/dist/tools/provenance.js +68 -40
- package/dist/tools/provenance.js.map +1 -1
- package/dist/tools/registry/index.d.ts.map +1 -1
- package/dist/tools/registry/index.js +24 -0
- package/dist/tools/registry/index.js.map +1 -1
- package/dist/tools/sentinel/index.d.ts +1 -0
- package/dist/tools/sentinel/index.d.ts.map +1 -1
- package/dist/tools/sentinel/index.js +142 -6
- package/dist/tools/sentinel/index.js.map +1 -1
- package/dist/tools/sentinel.d.ts +152 -1
- package/dist/tools/sentinel.d.ts.map +1 -1
- package/dist/tools/sentinel.js +609 -328
- package/dist/tools/sentinel.js.map +1 -1
- package/dist/tools/shared/index.d.ts +2 -1
- package/dist/tools/shared/index.d.ts.map +1 -1
- package/dist/tools/shared/index.js +2 -1
- package/dist/tools/shared/index.js.map +1 -1
- package/dist/tools/shared/response.d.ts +24 -0
- package/dist/tools/shared/response.d.ts.map +1 -1
- package/dist/tools/shared/response.js +61 -7
- package/dist/tools/shared/response.js.map +1 -1
- package/dist/tools/shared/runTracker.d.ts +2 -0
- package/dist/tools/shared/runTracker.d.ts.map +1 -1
- package/dist/tools/shared/runTracker.js +38 -0
- package/dist/tools/shared/runTracker.js.map +1 -1
- package/dist/tools/shared/storeRead.d.ts +153 -0
- package/dist/tools/shared/storeRead.d.ts.map +1 -0
- package/dist/tools/shared/storeRead.js +242 -0
- package/dist/tools/shared/storeRead.js.map +1 -0
- package/dist/tools/swarm.d.ts +3 -1
- package/dist/tools/swarm.d.ts.map +1 -1
- package/dist/tools/swarm.js +6 -12
- package/dist/tools/swarm.js.map +1 -1
- package/dist/tools/testSpec.d.ts +3 -2
- package/dist/tools/testSpec.d.ts.map +1 -1
- package/dist/tools/testSpec.js +51 -14
- package/dist/tools/testSpec.js.map +1 -1
- package/dist/tools/vector.d.ts +33 -1
- package/dist/tools/vector.d.ts.map +1 -1
- package/dist/tools/vector.js +31 -5
- package/dist/tools/vector.js.map +1 -1
- package/dist/tools/voice/index.d.ts +1 -0
- package/dist/tools/voice/index.d.ts.map +1 -1
- package/dist/tools/voice/index.js +33 -2
- package/dist/tools/voice/index.js.map +1 -1
- package/dist/tools/voice.d.ts +48 -1
- package/dist/tools/voice.d.ts.map +1 -1
- package/dist/tools/voice.js +63 -3
- package/dist/tools/voice.js.map +1 -1
- package/dist/tools/zoom/index.d.ts +15 -0
- package/dist/tools/zoom/index.d.ts.map +1 -0
- package/dist/tools/zoom/index.js +174 -0
- package/dist/tools/zoom/index.js.map +1 -0
- package/dist/tools/zoom.d.ts +234 -0
- package/dist/tools/zoom.d.ts.map +1 -0
- package/dist/tools/zoom.js +627 -0
- package/dist/tools/zoom.js.map +1 -0
- package/dist/transports/bridge.d.ts +1 -1
- package/dist/transports/bridge.d.ts.map +1 -1
- package/dist/transports/bridge.js +4 -1
- package/dist/transports/bridge.js.map +1 -1
- package/dist/transports/http.d.ts +1 -1
- package/dist/transports/http.d.ts.map +1 -1
- package/dist/transports/http.js +3 -1
- package/dist/transports/http.js.map +1 -1
- package/dist/transports/index.d.ts +1 -0
- package/dist/transports/index.d.ts.map +1 -1
- package/dist/transports/index.js +1 -0
- package/dist/transports/index.js.map +1 -1
- package/dist/transports/mcp.d.ts +1 -1
- package/dist/transports/mcp.d.ts.map +1 -1
- package/dist/transports/mcp.js +9 -4
- package/dist/transports/mcp.js.map +1 -1
- package/dist/transports/stdio.d.ts +1 -1
- package/dist/transports/stdio.d.ts.map +1 -1
- package/dist/transports/stdio.js +2 -0
- package/dist/transports/stdio.js.map +1 -1
- package/dist/transports/thinStdio.d.ts +22 -0
- package/dist/transports/thinStdio.d.ts.map +1 -0
- package/dist/transports/thinStdio.js +218 -0
- package/dist/transports/thinStdio.js.map +1 -0
- package/dist/transports/types.d.ts +8 -1
- package/dist/transports/types.d.ts.map +1 -1
- package/dist/types/agent-services.d.ts +7 -0
- package/dist/types/agent-services.d.ts.map +1 -1
- package/dist/version.d.ts +5 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +23 -0
- package/dist/version.js.map +1 -0
- package/package.json +20 -4
- package/templates/AGENT.md +3 -0
- package/templates/CLAUDE-decibel.md +11 -0
- package/templates/com.decibel.daemon.plist +6 -1
- package/dist/tools/deck.d.ts +0 -11
- package/dist/tools/deck.d.ts.map +0 -1
- package/dist/tools/deck.js +0 -1656
- package/dist/tools/deck.js.map +0 -1
- package/dist/tools/mother.d.ts +0 -11
- package/dist/tools/mother.d.ts.map +0 -1
- package/dist/tools/mother.js +0 -503
- package/dist/tools/mother.js.map +0 -1
- package/dist/tools/registry.d.ts +0 -3
- package/dist/tools/registry.d.ts.map +0 -1
- package/dist/tools/registry.js +0 -189
- package/dist/tools/registry.js.map +0 -1
- package/dist/tools/senken.d.ts +0 -11
- package/dist/tools/senken.d.ts.map +0 -1
- package/dist/tools/senken.js +0 -482
- package/dist/tools/senken.js.map +0 -1
- package/dist/tools/terminal.d.ts +0 -17
- package/dist/tools/terminal.d.ts.map +0 -1
- package/dist/tools/terminal.js +0 -968
- package/dist/tools/terminal.js.map +0 -1
- package/dist/tools/toolsIndex.d.ts +0 -5
- package/dist/tools/toolsIndex.d.ts.map +0 -1
- package/dist/tools/toolsIndex.js +0 -37
- package/dist/tools/toolsIndex.js.map +0 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Loopback HTTP for the thin client
|
|
3
|
+
// ============================================================================
|
|
4
|
+
// Node's global fetch() is undici, and undici is initialised lazily on first
|
|
5
|
+
// use: touching fetch() once costs ~10.8 MB resident (measured — see
|
|
6
|
+
// scripts/measure-memory.mjs). node:http is already resident in every process
|
|
7
|
+
// and costs ~2.5 MB for the same work.
|
|
8
|
+
//
|
|
9
|
+
// That trade is only obviously correct because of what these requests are:
|
|
10
|
+
// loopback, plaintext, small JSON bodies, no redirects, no compression, no
|
|
11
|
+
// cookies, no keep-alive pooling worth having. None of undici's surface is in
|
|
12
|
+
// use here, so none of it is worth 10 MB in five client processes.
|
|
13
|
+
//
|
|
14
|
+
// This is deliberately NOT a fetch polyfill. It returns the response body as
|
|
15
|
+
// text and lets callers parse, so a non-JSON error page surfaces as the status
|
|
16
|
+
// code the server actually sent rather than a parse error.
|
|
17
|
+
// ============================================================================
|
|
18
|
+
import { request } from 'http';
|
|
19
|
+
/**
|
|
20
|
+
* Perform one loopback HTTP request. Rejects on transport failure (nothing
|
|
21
|
+
* listening, socket closed, timeout); resolves with the status for any
|
|
22
|
+
* response the server actually sent, including 4xx and 5xx.
|
|
23
|
+
*/
|
|
24
|
+
export function localRequest(url, opts) {
|
|
25
|
+
const { method = 'GET', headers = {}, body, timeoutMs } = opts;
|
|
26
|
+
return new Promise((resolve, reject) => {
|
|
27
|
+
let settled = false;
|
|
28
|
+
const finish = (fn) => {
|
|
29
|
+
if (settled)
|
|
30
|
+
return;
|
|
31
|
+
settled = true;
|
|
32
|
+
clearTimeout(timer);
|
|
33
|
+
fn();
|
|
34
|
+
};
|
|
35
|
+
const target = new URL(url);
|
|
36
|
+
const req = request({
|
|
37
|
+
protocol: target.protocol,
|
|
38
|
+
hostname: target.hostname,
|
|
39
|
+
port: target.port,
|
|
40
|
+
path: `${target.pathname}${target.search}`,
|
|
41
|
+
method,
|
|
42
|
+
headers: body === undefined
|
|
43
|
+
? headers
|
|
44
|
+
: { ...headers, 'Content-Length': String(Buffer.byteLength(body)) },
|
|
45
|
+
}, (res) => {
|
|
46
|
+
const chunks = [];
|
|
47
|
+
res.on('data', (c) => chunks.push(c));
|
|
48
|
+
res.on('error', (err) => finish(() => reject(err)));
|
|
49
|
+
res.on('end', () => finish(() => {
|
|
50
|
+
const status = res.statusCode ?? 0;
|
|
51
|
+
resolve({
|
|
52
|
+
status,
|
|
53
|
+
ok: status >= 200 && status < 300,
|
|
54
|
+
text: Buffer.concat(chunks).toString('utf-8'),
|
|
55
|
+
});
|
|
56
|
+
}));
|
|
57
|
+
});
|
|
58
|
+
// Timeout is enforced here rather than via req.setTimeout, which fires on
|
|
59
|
+
// socket inactivity and so cannot bound a slow-but-trickling response.
|
|
60
|
+
const timer = setTimeout(() => {
|
|
61
|
+
finish(() => {
|
|
62
|
+
req.destroy();
|
|
63
|
+
reject(new Error(`request to ${url} timed out after ${timeoutMs}ms`));
|
|
64
|
+
});
|
|
65
|
+
}, timeoutMs);
|
|
66
|
+
req.on('error', (err) => finish(() => reject(err)));
|
|
67
|
+
if (body !== undefined)
|
|
68
|
+
req.write(body);
|
|
69
|
+
req.end();
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/** localRequest + JSON.parse, with the status preserved for the caller. */
|
|
73
|
+
export async function localJson(url, opts) {
|
|
74
|
+
const res = await localRequest(url, opts);
|
|
75
|
+
let parsed;
|
|
76
|
+
try {
|
|
77
|
+
parsed = JSON.parse(res.text);
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
throw new Error(`${url} returned ${res.status} with a non-JSON body: ${res.text.slice(0, 200)}`);
|
|
81
|
+
}
|
|
82
|
+
return { status: res.status, ok: res.ok, body: parsed };
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=localHttp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localHttp.js","sourceRoot":"","sources":["../../src/runtime/localHttp.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,oCAAoC;AACpC,+EAA+E;AAC/E,6EAA6E;AAC7E,qEAAqE;AACrE,8EAA8E;AAC9E,uCAAuC;AACvC,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,8EAA8E;AAC9E,mEAAmE;AACnE,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,2DAA2D;A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C;IAC1C,IAAI,MAAS,CAAC;IACd,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAM,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,GAAG,GAAG,aAAa,GAAG,CAAC,MAAM,0BAA0B,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAChF,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which strategy answered. The `matched` flag is the part callers care about:
|
|
3
|
+
* strategies 1-5 and an explicit default all identify the project the caller
|
|
4
|
+
* meant; 6 and 7 substitute a different one.
|
|
5
|
+
*/
|
|
6
|
+
export type ResolutionStrategy = 'exact_id' | 'alias' | 'env_root_exact' | 'absolute_path' | 'cwd_exact' | 'env_root_fallback' | 'cwd_fallback' | 'default_project';
|
|
7
|
+
export interface ResolutionRecord {
|
|
8
|
+
/** What the caller asked for. Undefined when the call omitted a project id. */
|
|
9
|
+
requested?: string;
|
|
10
|
+
/** The id of the project actually served. */
|
|
11
|
+
resolvedId: string;
|
|
12
|
+
/** The path actually served — the field strategy 6 substitutes silently. */
|
|
13
|
+
resolvedPath: string;
|
|
14
|
+
strategy: ResolutionStrategy;
|
|
15
|
+
/** False when the resolver substituted a project the caller did not ask for. */
|
|
16
|
+
matched: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Run `fn` with resolution tracking active. Nested calls share the outermost
|
|
20
|
+
* slot, so a tool that resolves several projects reports the last one — good
|
|
21
|
+
* enough for the single-project calls this exists to protect, and honest about
|
|
22
|
+
* it rather than silently reporting the first.
|
|
23
|
+
*/
|
|
24
|
+
export declare function withResolutionTracking<T>(fn: () => Promise<T>): Promise<T>;
|
|
25
|
+
/** Called by the resolver at each of its exits. A no-op outside a tracked scope. */
|
|
26
|
+
export declare function recordResolution(requested: string | undefined, resolvedId: string, resolvedPath: string, strategy: ResolutionStrategy): void;
|
|
27
|
+
/** The resolution that happened during this dispatch, if any. */
|
|
28
|
+
export declare function currentResolution(): ResolutionRecord | undefined;
|
|
29
|
+
//# sourceMappingURL=projectResolution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projectResolution.d.ts","sourceRoot":"","sources":["../../src/runtime/projectResolution.ts"],"names":[],"mappings":"AAkCA;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAC1B,UAAU,GACV,OAAO,GACP,gBAAgB,GAChB,eAAe,GACf,WAAW,GACX,mBAAmB,GACnB,cAAc,GACd,iBAAiB,CAAC;AAOtB,MAAM,WAAW,gBAAgB;IAC/B,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,gFAAgF;IAChF,OAAO,EAAE,OAAO,CAAC;CAClB;AAQD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAI1E;AAED,oFAAoF;AACpF,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,kBAAkB,GAC3B,IAAI,CAUN;AAED,iEAAiE;AACjE,wBAAgB,iBAAiB,IAAI,gBAAgB,GAAG,SAAS,CAEhE"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Project resolution tracking — EPIC-0038 Phase 4
|
|
3
|
+
// ============================================================================
|
|
4
|
+
// Project resolution is forgiving by design. `resolveProject` has seven
|
|
5
|
+
// strategies, and the last two do not match the caller's request at all —
|
|
6
|
+
// they substitute a project discovered from the environment or the working
|
|
7
|
+
// directory so that an interactive agent's typo doesn't hard-fail:
|
|
8
|
+
//
|
|
9
|
+
// // Strategy 7: If we discovered a project from cwd but ID didn't match,
|
|
10
|
+
// // use it anyway. This prevents hard failures when Claude sends a
|
|
11
|
+
// // slightly wrong project ID.
|
|
12
|
+
//
|
|
13
|
+
// That is a reasonable trade for one agent guessing at a name. It is the
|
|
14
|
+
// wrong trade for a programmatic caller sweeping a list of known-good ids:
|
|
15
|
+
// HQ fans out across 34 projects and five facades, and an id that fails to
|
|
16
|
+
// resolve does not come back empty — it comes back carrying ANOTHER project's
|
|
17
|
+
// issues, actions and friction, wearing the requested project's name in the
|
|
18
|
+
// UI. Absence is visible. Misattribution is not.
|
|
19
|
+
//
|
|
20
|
+
// Strategy 6 is subtler still: it returns the REQUESTED id with a substituted
|
|
21
|
+
// path, so comparing the id you asked for against the id you got cannot
|
|
22
|
+
// detect it. Only the resolver knows, and until now it dropped that knowledge
|
|
23
|
+
// on the floor — it logs a line locally and returns a value indistinguishable
|
|
24
|
+
// from a real match.
|
|
25
|
+
//
|
|
26
|
+
// This module keeps the resolver's own account of what happened for the
|
|
27
|
+
// duration of one dispatch, so the runtime can tell the caller when the
|
|
28
|
+
// project it served is not the project that was asked for. It changes no
|
|
29
|
+
// resolution behaviour; whether strategy 6 and 7 should exist at all for a
|
|
30
|
+
// programmatic caller is a separate and larger question.
|
|
31
|
+
// ============================================================================
|
|
32
|
+
import { AsyncLocalStorage } from 'async_hooks';
|
|
33
|
+
const SUBSTITUTING = new Set([
|
|
34
|
+
'env_root_fallback',
|
|
35
|
+
'cwd_fallback',
|
|
36
|
+
]);
|
|
37
|
+
const storage = new AsyncLocalStorage();
|
|
38
|
+
/**
|
|
39
|
+
* Run `fn` with resolution tracking active. Nested calls share the outermost
|
|
40
|
+
* slot, so a tool that resolves several projects reports the last one — good
|
|
41
|
+
* enough for the single-project calls this exists to protect, and honest about
|
|
42
|
+
* it rather than silently reporting the first.
|
|
43
|
+
*/
|
|
44
|
+
export function withResolutionTracking(fn) {
|
|
45
|
+
const existing = storage.getStore();
|
|
46
|
+
if (existing)
|
|
47
|
+
return fn();
|
|
48
|
+
return storage.run({}, fn);
|
|
49
|
+
}
|
|
50
|
+
/** Called by the resolver at each of its exits. A no-op outside a tracked scope. */
|
|
51
|
+
export function recordResolution(requested, resolvedId, resolvedPath, strategy) {
|
|
52
|
+
const slot = storage.getStore();
|
|
53
|
+
if (!slot)
|
|
54
|
+
return;
|
|
55
|
+
slot.record = {
|
|
56
|
+
requested,
|
|
57
|
+
resolvedId,
|
|
58
|
+
resolvedPath,
|
|
59
|
+
strategy,
|
|
60
|
+
matched: !SUBSTITUTING.has(strategy),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/** The resolution that happened during this dispatch, if any. */
|
|
64
|
+
export function currentResolution() {
|
|
65
|
+
return storage.getStore()?.record;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=projectResolution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projectResolution.js","sourceRoot":"","sources":["../../src/runtime/projectResolution.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,kDAAkD;AAClD,+EAA+E;AAC/E,wEAAwE;AACxE,0EAA0E;AAC1E,2EAA2E;AAC3E,mEAAmE;AACnE,EAAE;AACF,8EAA8E;AAC9E,wEAAwE;AACxE,oCAAoC;AACpC,EAAE;AACF,yEAAyE;AACzE,2EAA2E;AAC3E,2EAA2E;AAC3E,8EAA8E;AAC9E,4EAA4E;AAC5E,iDAAiD;AACjD,EAAE;AACF,8EAA8E;AAC9E,wEAAwE;AACxE,8EAA8E;AAC9E,8EAA8E;AAC9E,qBAAqB;AACrB,EAAE;AACF,wEAAwE;AACxE,wEAAwE;AACxE,yEAAyE;AACzE,2EAA2E;AAC3E,yDAAyD;AACzD,+EAA+E;AAE/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAiBhD,MAAM,YAAY,GAAoC,IAAI,GAAG,CAAqB;IAChF,mBAAmB;IACnB,cAAc;CACf,CAAC,CAAC;AAkBH,MAAM,OAAO,GAAG,IAAI,iBAAiB,EAAQ,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAI,EAAoB;IAC5D,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IACpC,IAAI,QAAQ;QAAE,OAAO,EAAE,EAAE,CAAC;IAC1B,OAAO,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,gBAAgB,CAC9B,SAA6B,EAC7B,UAAkB,EAClB,YAAoB,EACpB,QAA4B;IAE5B,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAChC,IAAI,CAAC,IAAI;QAAE,OAAO;IAClB,IAAI,CAAC,MAAM,GAAG;QACZ,SAAS;QACT,UAAU;QACV,YAAY;QACZ,QAAQ;QACR,OAAO,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC;KACrC,CAAC;AACJ,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,iBAAiB;IAC/B,OAAO,OAAO,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime protocol version.
|
|
3
|
+
*
|
|
4
|
+
* A long-lived daemon can outlive the clients that connect to it — a terminal
|
|
5
|
+
* opened yesterday, an editor extension pinned to an older release, a hook
|
|
6
|
+
* script from a previous install. Without an explicit protocol handshake those
|
|
7
|
+
* clients fail in confusing ways (a missing facade, a renamed action, a changed
|
|
8
|
+
* envelope) rather than saying "we disagree about the contract".
|
|
9
|
+
*
|
|
10
|
+
* This version describes the **runtime wire contract**: the shape of `/call`,
|
|
11
|
+
* `/batch`, `/health`, and the dispatch envelope. It is deliberately separate
|
|
12
|
+
* from the package version — most releases do not change the contract, and a
|
|
13
|
+
* client should not be forced to restart a healthy daemon just because a patch
|
|
14
|
+
* shipped.
|
|
15
|
+
*
|
|
16
|
+
* Bump MAJOR when an existing client would break: a removed or renamed
|
|
17
|
+
* endpoint, a changed request/response envelope, changed error semantics.
|
|
18
|
+
* Bump MINOR for backward-compatible additions (a new endpoint, a new optional
|
|
19
|
+
* field). Clients require an exact MAJOR match and tolerate any MINOR at or
|
|
20
|
+
* above their own.
|
|
21
|
+
*/
|
|
22
|
+
export declare const RUNTIME_PROTOCOL_VERSION = "1.1";
|
|
23
|
+
/**
|
|
24
|
+
* 1.1 — adds `GET /mcp/tools?tier=`, serving MCP tool definitions verbatim.
|
|
25
|
+
* Additive, so an older client is unaffected. A 1.1 CLIENT against a 1.0
|
|
26
|
+
* runtime is not: the thin stdio adapter has no local kernel and cannot
|
|
27
|
+
* answer tools/list without that endpoint. The minor-version rule
|
|
28
|
+
* (server.minor >= client.minor) turns that into an actionable
|
|
29
|
+
* "restart the runtime" at handshake time rather than a bare 404 on the
|
|
30
|
+
* first request — which is exactly the confusion this file exists to
|
|
31
|
+
* prevent, and which it caught the first time it was exercised for real.
|
|
32
|
+
* 1.0 — initial contract: /call, /batch, /health, dispatch envelope.
|
|
33
|
+
*/
|
|
34
|
+
export interface ParsedProtocolVersion {
|
|
35
|
+
major: number;
|
|
36
|
+
minor: number;
|
|
37
|
+
}
|
|
38
|
+
/** Parse `"1.0"` into `{major: 1, minor: 0}`. Returns null if malformed. */
|
|
39
|
+
export declare function parseProtocolVersion(value: string): ParsedProtocolVersion | null;
|
|
40
|
+
export type CompatibilityResult = {
|
|
41
|
+
compatible: true;
|
|
42
|
+
} | {
|
|
43
|
+
compatible: false;
|
|
44
|
+
reason: string;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Is a runtime speaking `serverVersion` usable by a client requiring
|
|
48
|
+
* `clientVersion`?
|
|
49
|
+
*
|
|
50
|
+
* Rules:
|
|
51
|
+
* - MAJOR must match exactly. A different major is a breaking contract change
|
|
52
|
+
* in either direction, so we refuse rather than guess.
|
|
53
|
+
* - The server's MINOR must be >= the client's. A newer server has every
|
|
54
|
+
* endpoint an older client knows about (minor bumps are additive), but an
|
|
55
|
+
* older server may be missing something the client depends on.
|
|
56
|
+
*
|
|
57
|
+
* An unparseable version is treated as incompatible. That is deliberate: a
|
|
58
|
+
* daemon that cannot state its protocol is a daemon we cannot reason about, and
|
|
59
|
+
* failing loudly beats dispatching into an unknown contract.
|
|
60
|
+
*/
|
|
61
|
+
export declare function isProtocolCompatible(serverVersion: string | undefined, clientVersion?: string): CompatibilityResult;
|
|
62
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/runtime/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,wBAAwB,QAAQ,CAAC;AAE9C;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,4EAA4E;AAC5E,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,qBAAqB,GAAG,IAAI,CAIhF;AAED,MAAM,MAAM,mBAAmB,GAC3B;IAAE,UAAU,EAAE,IAAI,CAAA;CAAE,GACpB;IAAE,UAAU,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,aAAa,GAAE,MAAiC,GAC/C,mBAAmB,CAiCrB"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime protocol version.
|
|
3
|
+
*
|
|
4
|
+
* A long-lived daemon can outlive the clients that connect to it — a terminal
|
|
5
|
+
* opened yesterday, an editor extension pinned to an older release, a hook
|
|
6
|
+
* script from a previous install. Without an explicit protocol handshake those
|
|
7
|
+
* clients fail in confusing ways (a missing facade, a renamed action, a changed
|
|
8
|
+
* envelope) rather than saying "we disagree about the contract".
|
|
9
|
+
*
|
|
10
|
+
* This version describes the **runtime wire contract**: the shape of `/call`,
|
|
11
|
+
* `/batch`, `/health`, and the dispatch envelope. It is deliberately separate
|
|
12
|
+
* from the package version — most releases do not change the contract, and a
|
|
13
|
+
* client should not be forced to restart a healthy daemon just because a patch
|
|
14
|
+
* shipped.
|
|
15
|
+
*
|
|
16
|
+
* Bump MAJOR when an existing client would break: a removed or renamed
|
|
17
|
+
* endpoint, a changed request/response envelope, changed error semantics.
|
|
18
|
+
* Bump MINOR for backward-compatible additions (a new endpoint, a new optional
|
|
19
|
+
* field). Clients require an exact MAJOR match and tolerate any MINOR at or
|
|
20
|
+
* above their own.
|
|
21
|
+
*/
|
|
22
|
+
export const RUNTIME_PROTOCOL_VERSION = '1.1';
|
|
23
|
+
/** Parse `"1.0"` into `{major: 1, minor: 0}`. Returns null if malformed. */
|
|
24
|
+
export function parseProtocolVersion(value) {
|
|
25
|
+
const match = /^(\d+)\.(\d+)$/.exec(value.trim());
|
|
26
|
+
if (!match)
|
|
27
|
+
return null;
|
|
28
|
+
return { major: Number(match[1]), minor: Number(match[2]) };
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Is a runtime speaking `serverVersion` usable by a client requiring
|
|
32
|
+
* `clientVersion`?
|
|
33
|
+
*
|
|
34
|
+
* Rules:
|
|
35
|
+
* - MAJOR must match exactly. A different major is a breaking contract change
|
|
36
|
+
* in either direction, so we refuse rather than guess.
|
|
37
|
+
* - The server's MINOR must be >= the client's. A newer server has every
|
|
38
|
+
* endpoint an older client knows about (minor bumps are additive), but an
|
|
39
|
+
* older server may be missing something the client depends on.
|
|
40
|
+
*
|
|
41
|
+
* An unparseable version is treated as incompatible. That is deliberate: a
|
|
42
|
+
* daemon that cannot state its protocol is a daemon we cannot reason about, and
|
|
43
|
+
* failing loudly beats dispatching into an unknown contract.
|
|
44
|
+
*/
|
|
45
|
+
export function isProtocolCompatible(serverVersion, clientVersion = RUNTIME_PROTOCOL_VERSION) {
|
|
46
|
+
if (!serverVersion) {
|
|
47
|
+
return {
|
|
48
|
+
compatible: false,
|
|
49
|
+
reason: 'runtime did not report a protocol_version (it predates protocol negotiation)',
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const server = parseProtocolVersion(serverVersion);
|
|
53
|
+
const client = parseProtocolVersion(clientVersion);
|
|
54
|
+
if (!server) {
|
|
55
|
+
return { compatible: false, reason: `runtime reported an unparseable protocol_version "${serverVersion}"` };
|
|
56
|
+
}
|
|
57
|
+
if (!client) {
|
|
58
|
+
return { compatible: false, reason: `client requested an unparseable protocol version "${clientVersion}"` };
|
|
59
|
+
}
|
|
60
|
+
if (server.major !== client.major) {
|
|
61
|
+
return {
|
|
62
|
+
compatible: false,
|
|
63
|
+
reason: `runtime speaks protocol ${serverVersion}, client requires ${clientVersion} (major version mismatch)`,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (server.minor < client.minor) {
|
|
67
|
+
return {
|
|
68
|
+
compatible: false,
|
|
69
|
+
reason: `runtime speaks protocol ${serverVersion}, client requires at least ${clientVersion} (runtime is older)`,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
return { compatible: true };
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/runtime/protocol.ts"],"names":[],"mappings":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C,KAAK,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC;QAChC,OAAO;YACL,UAAU,EAAE,KAAK;YACjB,MAAM,EAAE,2BAA2B,aAAa,8BAA8B,aAAa,qBAAqB;SACjH,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;AAC9B,CAAC"}
|
package/dist/sentinelIssues.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export type
|
|
1
|
+
import type { IssueSeverity, IssueStatus as CanonicalIssueStatus, IssuePriority as CanonicalIssuePriority } from './domain/issue.js';
|
|
2
|
+
export type IssueStatus = CanonicalIssueStatus;
|
|
3
|
+
export type IssuePriority = CanonicalIssuePriority;
|
|
3
4
|
export interface SentinelIssue {
|
|
4
5
|
id: string;
|
|
5
6
|
title: string;
|
|
@@ -20,6 +21,15 @@ export interface CreateIssueInput {
|
|
|
20
21
|
epicId?: string;
|
|
21
22
|
priority?: IssuePriority;
|
|
22
23
|
tags?: string[];
|
|
24
|
+
/** Optional. Defaults to 'med'. Distinct from priority — see createIssue. */
|
|
25
|
+
severity?: IssueSeverity;
|
|
26
|
+
/**
|
|
27
|
+
* Who is working on it — EPIC-0040. A prefixed identity: user:<uuid>,
|
|
28
|
+
* agent:<uuid> or human:<name>. Rejected if it names a team.
|
|
29
|
+
*/
|
|
30
|
+
assignee?: string;
|
|
31
|
+
/** Which team owns it — EPIC-0040. `team:<uuid>`, minted by HQ. */
|
|
32
|
+
team?: string;
|
|
23
33
|
}
|
|
24
34
|
export interface CreateIssueOutput extends SentinelIssue {
|
|
25
35
|
filePath: string;
|
|
@@ -37,6 +47,27 @@ export declare function listIssuesForProject(projectId: string): Promise<Sentine
|
|
|
37
47
|
/**
|
|
38
48
|
* Create a new issue for a project
|
|
39
49
|
*/
|
|
50
|
+
/**
|
|
51
|
+
* Create an issue.
|
|
52
|
+
*
|
|
53
|
+
* EPIC-0038 Phase 5: this used to be the second writer. It emitted `.yml` while
|
|
54
|
+
* the facade path (src/tools/sentinel.ts -> FsIssueRepository) emitted `.md`,
|
|
55
|
+
* into the same directory, from the same ISS-NNNN space. Converging the files
|
|
56
|
+
* while both writers ran would have left this one re-emitting `.yml` behind the
|
|
57
|
+
* migration — which is why the epic sequences behaviour before representation.
|
|
58
|
+
*
|
|
59
|
+
* So it now delegates. The name, the input contract and the return shape are
|
|
60
|
+
* all preserved; only the bytes on disk change. `SentinelIssue` is a subset of
|
|
61
|
+
* the canonical `Issue`, so the mapping back is total rather than lossy:
|
|
62
|
+
* `details` carries what this API calls `description`, and everything else is
|
|
63
|
+
* the same field under the same name.
|
|
64
|
+
*
|
|
65
|
+
* One field needs a decision rather than a mapping. This API has no `severity`
|
|
66
|
+
* and the canonical model wants one, so callers may now pass it and it defaults
|
|
67
|
+
* to 'med' — the neutral middle of ['low','med','high','critical'] — rather
|
|
68
|
+
* than inventing a severity from `priority`, which answers a different question
|
|
69
|
+
* (how bad it is, versus when it gets worked on).
|
|
70
|
+
*/
|
|
40
71
|
export declare function createIssue(input: CreateIssueInput): Promise<CreateIssueOutput>;
|
|
41
72
|
/**
|
|
42
73
|
* Get a single issue by ID (e.g., "ISS-0005") with full content
|
|
@@ -49,6 +80,15 @@ export interface UpdateIssueInput {
|
|
|
49
80
|
priority?: IssuePriority;
|
|
50
81
|
tags?: string[];
|
|
51
82
|
note?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Reassign — EPIC-0040. A prefixed identity, or the empty string to
|
|
85
|
+
* UNASSIGN. The empty string is a deliberate part of the interface: without
|
|
86
|
+
* it there is no way to take an assignee off, and "leave it set forever" is
|
|
87
|
+
* not a reassignment model.
|
|
88
|
+
*/
|
|
89
|
+
assignee?: string;
|
|
90
|
+
/** Move to another team, or the empty string to clear it. */
|
|
91
|
+
team?: string;
|
|
52
92
|
}
|
|
53
93
|
export interface UpdateIssueOutput extends SentinelIssue {
|
|
54
94
|
filePath: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentinelIssues.d.ts","sourceRoot":"","sources":["../src/sentinelIssues.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sentinelIssues.d.ts","sourceRoot":"","sources":["../src/sentinelIssues.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,aAAa,EACb,WAAW,IAAI,oBAAoB,EACnC,aAAa,IAAI,sBAAsB,EACxC,MAAM,mBAAmB,CAAC;AAa3B,MAAM,MAAM,WAAW,GAAG,oBAAoB,CAAC;AAC/C,MAAM,MAAM,aAAa,GAAG,sBAAsB,CAAC;AAEnD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,QAAQ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