@descryy/mcp 0.11.4 → 0.11.5
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/package.json +7 -7
- package/dist/action-handshake.d.ts +0 -38
- package/dist/action-handshake.d.ts.map +0 -1
- package/dist/action-handshake.js +0 -127
- package/dist/action-handshake.js.map +0 -1
- package/dist/bin/descry-mcp.d.ts +0 -7
- package/dist/bin/descry-mcp.d.ts.map +0 -1
- package/dist/bin/descry-mcp.js +0 -72
- package/dist/bin/descry-mcp.js.map +0 -1
- package/dist/browser/auth.d.ts +0 -84
- package/dist/browser/auth.d.ts.map +0 -1
- package/dist/browser/auth.js +0 -233
- package/dist/browser/auth.js.map +0 -1
- package/dist/browser/capability-probe.d.ts +0 -109
- package/dist/browser/capability-probe.d.ts.map +0 -1
- package/dist/browser/capability-probe.js +0 -201
- package/dist/browser/capability-probe.js.map +0 -1
- package/dist/browser/driver.d.ts +0 -591
- package/dist/browser/driver.d.ts.map +0 -1
- package/dist/browser/driver.js +0 -116
- package/dist/browser/driver.js.map +0 -1
- package/dist/browser/evidence.d.ts +0 -28
- package/dist/browser/evidence.d.ts.map +0 -1
- package/dist/browser/evidence.js +0 -82
- package/dist/browser/evidence.js.map +0 -1
- package/dist/browser/fake-driver.d.ts +0 -116
- package/dist/browser/fake-driver.d.ts.map +0 -1
- package/dist/browser/fake-driver.js +0 -416
- package/dist/browser/fake-driver.js.map +0 -1
- package/dist/browser/fault-attribution.d.ts +0 -178
- package/dist/browser/fault-attribution.d.ts.map +0 -1
- package/dist/browser/fault-attribution.js +0 -266
- package/dist/browser/fault-attribution.js.map +0 -1
- package/dist/browser/graph-write.d.ts +0 -45
- package/dist/browser/graph-write.d.ts.map +0 -1
- package/dist/browser/graph-write.js +0 -103
- package/dist/browser/graph-write.js.map +0 -1
- package/dist/browser/identity-graph-write.d.ts +0 -55
- package/dist/browser/identity-graph-write.d.ts.map +0 -1
- package/dist/browser/identity-graph-write.js +0 -45
- package/dist/browser/identity-graph-write.js.map +0 -1
- package/dist/browser/page-probe.d.ts +0 -81
- package/dist/browser/page-probe.d.ts.map +0 -1
- package/dist/browser/page-probe.js +0 -202
- package/dist/browser/page-probe.js.map +0 -1
- package/dist/browser/playwright-driver.d.ts +0 -114
- package/dist/browser/playwright-driver.d.ts.map +0 -1
- package/dist/browser/playwright-driver.js +0 -1518
- package/dist/browser/playwright-driver.js.map +0 -1
- package/dist/browser/provider.d.ts +0 -26
- package/dist/browser/provider.d.ts.map +0 -1
- package/dist/browser/provider.js +0 -14
- package/dist/browser/provider.js.map +0 -1
- package/dist/browser/reach-recording-session.d.ts +0 -44
- package/dist/browser/reach-recording-session.d.ts.map +0 -1
- package/dist/browser/reach-recording-session.js +0 -151
- package/dist/browser/reach-recording-session.js.map +0 -1
- package/dist/browser/reachability.d.ts +0 -168
- package/dist/browser/reachability.d.ts.map +0 -1
- package/dist/browser/reachability.js +0 -294
- package/dist/browser/reachability.js.map +0 -1
- package/dist/browser/registry.d.ts +0 -126
- package/dist/browser/registry.d.ts.map +0 -1
- package/dist/browser/registry.js +0 -177
- package/dist/browser/registry.js.map +0 -1
- package/dist/browser/scenario-provenance.d.ts +0 -23
- package/dist/browser/scenario-provenance.d.ts.map +0 -1
- package/dist/browser/scenario-provenance.js +0 -73
- package/dist/browser/scenario-provenance.js.map +0 -1
- package/dist/browser/scenario-resolve.d.ts +0 -28
- package/dist/browser/scenario-resolve.d.ts.map +0 -1
- package/dist/browser/scenario-resolve.js +0 -96
- package/dist/browser/scenario-resolve.js.map +0 -1
- package/dist/browser/scenario-runner.d.ts +0 -72
- package/dist/browser/scenario-runner.d.ts.map +0 -1
- package/dist/browser/scenario-runner.js +0 -353
- package/dist/browser/scenario-runner.js.map +0 -1
- package/dist/browser/stack-parser.d.ts +0 -19
- package/dist/browser/stack-parser.d.ts.map +0 -1
- package/dist/browser/stack-parser.js +0 -85
- package/dist/browser/stack-parser.js.map +0 -1
- package/dist/browser/tool-support.d.ts +0 -71
- package/dist/browser/tool-support.d.ts.map +0 -1
- package/dist/browser/tool-support.js +0 -216
- package/dist/browser/tool-support.js.map +0 -1
- package/dist/browser/url-scheme.d.ts +0 -14
- package/dist/browser/url-scheme.d.ts.map +0 -1
- package/dist/browser/url-scheme.js +0 -38
- package/dist/browser/url-scheme.js.map +0 -1
- package/dist/browser/wait-target.d.ts +0 -37
- package/dist/browser/wait-target.d.ts.map +0 -1
- package/dist/browser/wait-target.js +0 -54
- package/dist/browser/wait-target.js.map +0 -1
- package/dist/cancellation.d.ts +0 -20
- package/dist/cancellation.d.ts.map +0 -1
- package/dist/cancellation.js +0 -41
- package/dist/cancellation.js.map +0 -1
- package/dist/capped.d.ts +0 -39
- package/dist/capped.d.ts.map +0 -1
- package/dist/capped.js +0 -43
- package/dist/capped.js.map +0 -1
- package/dist/credential-store.d.ts +0 -22
- package/dist/credential-store.d.ts.map +0 -1
- package/dist/credential-store.js +0 -33
- package/dist/credential-store.js.map +0 -1
- package/dist/disclosure-ledger.d.ts +0 -14
- package/dist/disclosure-ledger.d.ts.map +0 -1
- package/dist/disclosure-ledger.js +0 -18
- package/dist/disclosure-ledger.js.map +0 -1
- package/dist/evidence/observed-route-evidence.d.ts +0 -25
- package/dist/evidence/observed-route-evidence.d.ts.map +0 -1
- package/dist/evidence/observed-route-evidence.js +0 -76
- package/dist/evidence/observed-route-evidence.js.map +0 -1
- package/dist/heap.d.ts +0 -61
- package/dist/heap.d.ts.map +0 -1
- package/dist/heap.js +0 -82
- package/dist/heap.js.map +0 -1
- package/dist/heartbeat.d.ts +0 -46
- package/dist/heartbeat.d.ts.map +0 -1
- package/dist/heartbeat.js +0 -66
- package/dist/heartbeat.js.map +0 -1
- package/dist/index.d.ts +0 -32
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -19
- package/dist/index.js.map +0 -1
- package/dist/module-trust.d.ts +0 -37
- package/dist/module-trust.d.ts.map +0 -1
- package/dist/module-trust.js +0 -77
- package/dist/module-trust.js.map +0 -1
- package/dist/path-confinement.d.ts +0 -31
- package/dist/path-confinement.d.ts.map +0 -1
- package/dist/path-confinement.js +0 -44
- package/dist/path-confinement.js.map +0 -1
- package/dist/planner/predict-then-propose.d.ts +0 -134
- package/dist/planner/predict-then-propose.d.ts.map +0 -1
- package/dist/planner/predict-then-propose.js +0 -138
- package/dist/planner/predict-then-propose.js.map +0 -1
- package/dist/planner/propose-journey.d.ts +0 -75
- package/dist/planner/propose-journey.d.ts.map +0 -1
- package/dist/planner/propose-journey.js +0 -96
- package/dist/planner/propose-journey.js.map +0 -1
- package/dist/protocol.d.ts +0 -57
- package/dist/protocol.d.ts.map +0 -1
- package/dist/protocol.js +0 -90
- package/dist/protocol.js.map +0 -1
- package/dist/registry.d.ts +0 -103
- package/dist/registry.d.ts.map +0 -1
- package/dist/registry.js +0 -327
- package/dist/registry.js.map +0 -1
- package/dist/render.d.ts +0 -623
- package/dist/render.d.ts.map +0 -1
- package/dist/render.js +0 -968
- package/dist/render.js.map +0 -1
- package/dist/runtime-registry.d.ts +0 -22
- package/dist/runtime-registry.d.ts.map +0 -1
- package/dist/runtime-registry.js +0 -142
- package/dist/runtime-registry.js.map +0 -1
- package/dist/sandbox-defaults.d.ts +0 -41
- package/dist/sandbox-defaults.d.ts.map +0 -1
- package/dist/sandbox-defaults.js +0 -14
- package/dist/sandbox-defaults.js.map +0 -1
- package/dist/scenarios/browser-run-plan-projection.d.ts +0 -161
- package/dist/scenarios/browser-run-plan-projection.d.ts.map +0 -1
- package/dist/scenarios/browser-run-plan-projection.js +0 -264
- package/dist/scenarios/browser-run-plan-projection.js.map +0 -1
- package/dist/scenarios/credential-ref.d.ts +0 -102
- package/dist/scenarios/credential-ref.d.ts.map +0 -1
- package/dist/scenarios/credential-ref.js +0 -148
- package/dist/scenarios/credential-ref.js.map +0 -1
- package/dist/scenarios/index.d.ts +0 -7
- package/dist/scenarios/index.d.ts.map +0 -1
- package/dist/scenarios/index.js +0 -7
- package/dist/scenarios/index.js.map +0 -1
- package/dist/scenarios/parse.d.ts +0 -18
- package/dist/scenarios/parse.d.ts.map +0 -1
- package/dist/scenarios/parse.js +0 -212
- package/dist/scenarios/parse.js.map +0 -1
- package/dist/scenarios/scenario.d.ts +0 -93
- package/dist/scenarios/scenario.d.ts.map +0 -1
- package/dist/scenarios/scenario.js +0 -27
- package/dist/scenarios/scenario.js.map +0 -1
- package/dist/scenarios/secret-ref.d.ts +0 -86
- package/dist/scenarios/secret-ref.d.ts.map +0 -1
- package/dist/scenarios/secret-ref.js +0 -125
- package/dist/scenarios/secret-ref.js.map +0 -1
- package/dist/scenarios/storage.d.ts +0 -21
- package/dist/scenarios/storage.d.ts.map +0 -1
- package/dist/scenarios/storage.js +0 -103
- package/dist/scenarios/storage.js.map +0 -1
- package/dist/server.d.ts +0 -61
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js +0 -651
- package/dist/server.js.map +0 -1
- package/dist/session.d.ts +0 -356
- package/dist/session.d.ts.map +0 -1
- package/dist/session.js +0 -779
- package/dist/session.js.map +0 -1
- package/dist/tools/alias-kit.d.ts +0 -29
- package/dist/tools/alias-kit.d.ts.map +0 -1
- package/dist/tools/alias-kit.js +0 -21
- package/dist/tools/alias-kit.js.map +0 -1
- package/dist/tools/aliases.d.ts +0 -42
- package/dist/tools/aliases.d.ts.map +0 -1
- package/dist/tools/aliases.js +0 -52
- package/dist/tools/aliases.js.map +0 -1
- package/dist/tools/analyze-workspace.d.ts +0 -52
- package/dist/tools/analyze-workspace.d.ts.map +0 -1
- package/dist/tools/analyze-workspace.js +0 -207
- package/dist/tools/analyze-workspace.js.map +0 -1
- package/dist/tools/analyze.d.ts +0 -163
- package/dist/tools/analyze.d.ts.map +0 -1
- package/dist/tools/analyze.js +0 -724
- package/dist/tools/analyze.js.map +0 -1
- package/dist/tools/browser-click.d.ts +0 -18
- package/dist/tools/browser-click.d.ts.map +0 -1
- package/dist/tools/browser-click.js +0 -110
- package/dist/tools/browser-click.js.map +0 -1
- package/dist/tools/browser-close-session.d.ts +0 -39
- package/dist/tools/browser-close-session.d.ts.map +0 -1
- package/dist/tools/browser-close-session.js +0 -120
- package/dist/tools/browser-close-session.js.map +0 -1
- package/dist/tools/browser-fill.d.ts +0 -18
- package/dist/tools/browser-fill.d.ts.map +0 -1
- package/dist/tools/browser-fill.js +0 -117
- package/dist/tools/browser-fill.js.map +0 -1
- package/dist/tools/browser-navigate.d.ts +0 -15
- package/dist/tools/browser-navigate.d.ts.map +0 -1
- package/dist/tools/browser-navigate.js +0 -104
- package/dist/tools/browser-navigate.js.map +0 -1
- package/dist/tools/browser-read.d.ts +0 -33
- package/dist/tools/browser-read.d.ts.map +0 -1
- package/dist/tools/browser-read.js +0 -113
- package/dist/tools/browser-read.js.map +0 -1
- package/dist/tools/browser-run-scenario.d.ts +0 -28
- package/dist/tools/browser-run-scenario.d.ts.map +0 -1
- package/dist/tools/browser-run-scenario.js +0 -225
- package/dist/tools/browser-run-scenario.js.map +0 -1
- package/dist/tools/browser-save-scenario.d.ts +0 -19
- package/dist/tools/browser-save-scenario.d.ts.map +0 -1
- package/dist/tools/browser-save-scenario.js +0 -447
- package/dist/tools/browser-save-scenario.js.map +0 -1
- package/dist/tools/browser-select.d.ts +0 -20
- package/dist/tools/browser-select.d.ts.map +0 -1
- package/dist/tools/browser-select.js +0 -120
- package/dist/tools/browser-select.js.map +0 -1
- package/dist/tools/browser-snapshot.d.ts +0 -46
- package/dist/tools/browser-snapshot.d.ts.map +0 -1
- package/dist/tools/browser-snapshot.js +0 -127
- package/dist/tools/browser-snapshot.js.map +0 -1
- package/dist/tools/browser-start-session.d.ts +0 -24
- package/dist/tools/browser-start-session.d.ts.map +0 -1
- package/dist/tools/browser-start-session.js +0 -640
- package/dist/tools/browser-start-session.js.map +0 -1
- package/dist/tools/browser-submit.d.ts +0 -18
- package/dist/tools/browser-submit.d.ts.map +0 -1
- package/dist/tools/browser-submit.js +0 -106
- package/dist/tools/browser-submit.js.map +0 -1
- package/dist/tools/browser-type.d.ts +0 -18
- package/dist/tools/browser-type.d.ts.map +0 -1
- package/dist/tools/browser-type.js +0 -115
- package/dist/tools/browser-type.js.map +0 -1
- package/dist/tools/browser-wait-for.d.ts +0 -45
- package/dist/tools/browser-wait-for.d.ts.map +0 -1
- package/dist/tools/browser-wait-for.js +0 -150
- package/dist/tools/browser-wait-for.js.map +0 -1
- package/dist/tools/browser.d.ts +0 -69
- package/dist/tools/browser.d.ts.map +0 -1
- package/dist/tools/browser.js +0 -386
- package/dist/tools/browser.js.map +0 -1
- package/dist/tools/chain.d.ts +0 -41
- package/dist/tools/chain.d.ts.map +0 -1
- package/dist/tools/chain.js +0 -105
- package/dist/tools/chain.js.map +0 -1
- package/dist/tools/change-scope.d.ts +0 -25
- package/dist/tools/change-scope.d.ts.map +0 -1
- package/dist/tools/change-scope.js +0 -110
- package/dist/tools/change-scope.js.map +0 -1
- package/dist/tools/code-context.d.ts +0 -83
- package/dist/tools/code-context.d.ts.map +0 -1
- package/dist/tools/code-context.js +0 -444
- package/dist/tools/code-context.js.map +0 -1
- package/dist/tools/contracts.d.ts +0 -74
- package/dist/tools/contracts.d.ts.map +0 -1
- package/dist/tools/contracts.js +0 -196
- package/dist/tools/contracts.js.map +0 -1
- package/dist/tools/cross-pr.d.ts +0 -178
- package/dist/tools/cross-pr.d.ts.map +0 -1
- package/dist/tools/cross-pr.js +0 -370
- package/dist/tools/cross-pr.js.map +0 -1
- package/dist/tools/disclosure.d.ts +0 -75
- package/dist/tools/disclosure.d.ts.map +0 -1
- package/dist/tools/disclosure.js +0 -307
- package/dist/tools/disclosure.js.map +0 -1
- package/dist/tools/draw-conclusion.d.ts +0 -55
- package/dist/tools/draw-conclusion.d.ts.map +0 -1
- package/dist/tools/draw-conclusion.js +0 -259
- package/dist/tools/draw-conclusion.js.map +0 -1
- package/dist/tools/git-context.d.ts +0 -39
- package/dist/tools/git-context.d.ts.map +0 -1
- package/dist/tools/git-context.js +0 -385
- package/dist/tools/git-context.js.map +0 -1
- package/dist/tools/git-diff.d.ts +0 -45
- package/dist/tools/git-diff.d.ts.map +0 -1
- package/dist/tools/git-diff.js +0 -338
- package/dist/tools/git-diff.js.map +0 -1
- package/dist/tools/git-history.d.ts +0 -16
- package/dist/tools/git-history.d.ts.map +0 -1
- package/dist/tools/git-history.js +0 -106
- package/dist/tools/git-history.js.map +0 -1
- package/dist/tools/history.d.ts +0 -34
- package/dist/tools/history.d.ts.map +0 -1
- package/dist/tools/history.js +0 -121
- package/dist/tools/history.js.map +0 -1
- package/dist/tools/impact.d.ts +0 -46
- package/dist/tools/impact.d.ts.map +0 -1
- package/dist/tools/impact.js +0 -225
- package/dist/tools/impact.js.map +0 -1
- package/dist/tools/index.d.ts +0 -59
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -70
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/kit.d.ts +0 -165
- package/dist/tools/kit.d.ts.map +0 -1
- package/dist/tools/kit.js +0 -153
- package/dist/tools/kit.js.map +0 -1
- package/dist/tools/link-workspace.d.ts +0 -24
- package/dist/tools/link-workspace.d.ts.map +0 -1
- package/dist/tools/link-workspace.js +0 -131
- package/dist/tools/link-workspace.js.map +0 -1
- package/dist/tools/lookup.d.ts +0 -19
- package/dist/tools/lookup.d.ts.map +0 -1
- package/dist/tools/lookup.js +0 -63
- package/dist/tools/lookup.js.map +0 -1
- package/dist/tools/mark-incident.d.ts +0 -28
- package/dist/tools/mark-incident.d.ts.map +0 -1
- package/dist/tools/mark-incident.js +0 -188
- package/dist/tools/mark-incident.js.map +0 -1
- package/dist/tools/merged-browser.d.ts +0 -11
- package/dist/tools/merged-browser.d.ts.map +0 -1
- package/dist/tools/merged-browser.js +0 -20
- package/dist/tools/merged-browser.js.map +0 -1
- package/dist/tools/merged-context.d.ts +0 -11
- package/dist/tools/merged-context.d.ts.map +0 -1
- package/dist/tools/merged-context.js +0 -21
- package/dist/tools/merged-context.js.map +0 -1
- package/dist/tools/merged-observe.d.ts +0 -13
- package/dist/tools/merged-observe.d.ts.map +0 -1
- package/dist/tools/merged-observe.js +0 -21
- package/dist/tools/merged-observe.js.map +0 -1
- package/dist/tools/merged-workspace.d.ts +0 -14
- package/dist/tools/merged-workspace.d.ts.map +0 -1
- package/dist/tools/merged-workspace.js +0 -21
- package/dist/tools/merged-workspace.js.map +0 -1
- package/dist/tools/observe-runtime.d.ts +0 -262
- package/dist/tools/observe-runtime.d.ts.map +0 -1
- package/dist/tools/observe-runtime.js +0 -1901
- package/dist/tools/observe-runtime.js.map +0 -1
- package/dist/tools/observe-tests.d.ts +0 -57
- package/dist/tools/observe-tests.d.ts.map +0 -1
- package/dist/tools/observe-tests.js +0 -368
- package/dist/tools/observe-tests.js.map +0 -1
- package/dist/tools/observe.d.ts +0 -28
- package/dist/tools/observe.d.ts.map +0 -1
- package/dist/tools/observe.js +0 -330
- package/dist/tools/observe.js.map +0 -1
- package/dist/tools/pr-analysis.d.ts +0 -189
- package/dist/tools/pr-analysis.d.ts.map +0 -1
- package/dist/tools/pr-analysis.js +0 -374
- package/dist/tools/pr-analysis.js.map +0 -1
- package/dist/tools/pre-push.d.ts +0 -168
- package/dist/tools/pre-push.d.ts.map +0 -1
- package/dist/tools/pre-push.js +0 -416
- package/dist/tools/pre-push.js.map +0 -1
- package/dist/tools/predict-reach.d.ts +0 -57
- package/dist/tools/predict-reach.d.ts.map +0 -1
- package/dist/tools/predict-reach.js +0 -159
- package/dist/tools/predict-reach.js.map +0 -1
- package/dist/tools/propagation.d.ts +0 -37
- package/dist/tools/propagation.d.ts.map +0 -1
- package/dist/tools/propagation.js +0 -162
- package/dist/tools/propagation.js.map +0 -1
- package/dist/tools/propose-journey.d.ts +0 -16
- package/dist/tools/propose-journey.d.ts.map +0 -1
- package/dist/tools/propose-journey.js +0 -121
- package/dist/tools/propose-journey.js.map +0 -1
- package/dist/tools/prove-reach.d.ts +0 -74
- package/dist/tools/prove-reach.d.ts.map +0 -1
- package/dist/tools/prove-reach.js +0 -286
- package/dist/tools/prove-reach.js.map +0 -1
- package/dist/tools/questions.d.ts +0 -30
- package/dist/tools/questions.d.ts.map +0 -1
- package/dist/tools/questions.js +0 -232
- package/dist/tools/questions.js.map +0 -1
- package/dist/tools/refusal-fetch.d.ts +0 -35
- package/dist/tools/refusal-fetch.d.ts.map +0 -1
- package/dist/tools/refusal-fetch.js +0 -123
- package/dist/tools/refusal-fetch.js.map +0 -1
- package/dist/tools/runtime-incident.d.ts +0 -33
- package/dist/tools/runtime-incident.d.ts.map +0 -1
- package/dist/tools/runtime-incident.js +0 -67
- package/dist/tools/runtime-incident.js.map +0 -1
- package/dist/tools/runtime-journey-drive.d.ts +0 -102
- package/dist/tools/runtime-journey-drive.d.ts.map +0 -1
- package/dist/tools/runtime-journey-drive.js +0 -247
- package/dist/tools/runtime-journey-drive.js.map +0 -1
- package/dist/tools/scope.d.ts +0 -45
- package/dist/tools/scope.d.ts.map +0 -1
- package/dist/tools/scope.js +0 -217
- package/dist/tools/scope.js.map +0 -1
- package/dist/tools/similar-incidents.d.ts +0 -43
- package/dist/tools/similar-incidents.d.ts.map +0 -1
- package/dist/tools/similar-incidents.js +0 -203
- package/dist/tools/similar-incidents.js.map +0 -1
- package/dist/tools/validate.d.ts +0 -133
- package/dist/tools/validate.d.ts.map +0 -1
- package/dist/tools/validate.js +0 -520
- package/dist/tools/validate.js.map +0 -1
- package/dist/tools/verb.d.ts +0 -46
- package/dist/tools/verb.d.ts.map +0 -1
- package/dist/tools/verb.js +0 -78
- package/dist/tools/verb.js.map +0 -1
- package/dist/tools/verification-status.d.ts +0 -38
- package/dist/tools/verification-status.d.ts.map +0 -1
- package/dist/tools/verification-status.js +0 -203
- package/dist/tools/verification-status.js.map +0 -1
- package/dist/tools/verify-claim.d.ts +0 -29
- package/dist/tools/verify-claim.d.ts.map +0 -1
- package/dist/tools/verify-claim.js +0 -220
- package/dist/tools/verify-claim.js.map +0 -1
- package/dist/tools/workspace.d.ts +0 -28
- package/dist/tools/workspace.d.ts.map +0 -1
- package/dist/tools/workspace.js +0 -101
- package/dist/tools/workspace.js.map +0 -1
- package/dist/transport.d.ts +0 -32
- package/dist/transport.d.ts.map +0 -1
- package/dist/transport.js +0 -85
- package/dist/transport.js.map +0 -1
- package/dist/workspace-index.d.ts +0 -164
- package/dist/workspace-index.d.ts.map +0 -1
- package/dist/workspace-index.js +0 -381
- package/dist/workspace-index.js.map +0 -1
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
/** `verify_claim`, MK-12: offers G1/G2 (`ai-governance-spec.md` §2/§3) as a voluntary lookup — the
|
|
2
|
-
* full pipeline doesn't run here (MK-11). `path` checks a dot-path resolves in a recorded call's
|
|
3
|
-
* result (G1); `target` is a plain substring search (G2-shaped, disclosed as weaker — it can't
|
|
4
|
-
* see whether the string was accepted or rejected). Never returns `confirmed` (MK-11): it
|
|
5
|
-
* enforces nothing, just converts "we cannot check" into "we offered and it declined." */
|
|
6
|
-
import { answer, requiredString, ToolInputError, } from "./kit.js";
|
|
7
|
-
const SCHEMA = {
|
|
8
|
-
type: "object",
|
|
9
|
-
properties: {
|
|
10
|
-
claims: {
|
|
11
|
-
type: "array",
|
|
12
|
-
minItems: 1,
|
|
13
|
-
items: {
|
|
14
|
-
type: "object",
|
|
15
|
-
properties: {
|
|
16
|
-
statement: {
|
|
17
|
-
type: "string",
|
|
18
|
-
description: "The claim's own text, carried through unexamined — this tool checks its citation, not its wording.",
|
|
19
|
-
},
|
|
20
|
-
callId: {
|
|
21
|
-
type: "string",
|
|
22
|
-
description: 'The recorded call id this claim rests on — the "id" field from an earlier reply this session.',
|
|
23
|
-
},
|
|
24
|
-
path: {
|
|
25
|
-
type: "string",
|
|
26
|
-
description: 'A dot-path into that call\'s structuredContent, e.g. "data.affected.0.id" — checked to actually resolve, not just be well-formed.',
|
|
27
|
-
},
|
|
28
|
-
target: {
|
|
29
|
-
type: "string",
|
|
30
|
-
description: "A literal string (typically a node id or file path) that must appear somewhere in that call's recorded result — a plain substring search, not a structural check.",
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
required: ["statement", "callId"],
|
|
34
|
-
additionalProperties: false,
|
|
35
|
-
},
|
|
36
|
-
description: "Draft claims to check. Each must give a path, a target, or both — a callId alone with neither checks nothing.",
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
required: ["claims"],
|
|
40
|
-
additionalProperties: false,
|
|
41
|
-
};
|
|
42
|
-
function readClaims(args) {
|
|
43
|
-
const raw = args["claims"];
|
|
44
|
-
if (!Array.isArray(raw) || raw.length === 0) {
|
|
45
|
-
throw new ToolInputError('"claims" must be a non-empty array — with none, there is nothing to verify');
|
|
46
|
-
}
|
|
47
|
-
return raw.map((entry, index) => {
|
|
48
|
-
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
|
|
49
|
-
throw new ToolInputError(`claims[${index}] must be an object`);
|
|
50
|
-
}
|
|
51
|
-
const claim = entry;
|
|
52
|
-
const statement = requiredString(claim, "statement");
|
|
53
|
-
const callId = requiredString(claim, "callId");
|
|
54
|
-
const path = claim["path"];
|
|
55
|
-
const target = claim["target"];
|
|
56
|
-
if (path !== undefined && typeof path !== "string")
|
|
57
|
-
throw new ToolInputError(`claims[${index}].path must be a string`);
|
|
58
|
-
if (target !== undefined && typeof target !== "string")
|
|
59
|
-
throw new ToolInputError(`claims[${index}].target must be a string`);
|
|
60
|
-
return {
|
|
61
|
-
statement,
|
|
62
|
-
callId,
|
|
63
|
-
...(path === undefined ? {} : { path }),
|
|
64
|
-
...(target === undefined ? {} : { target }),
|
|
65
|
-
};
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
/** Dot-path resolution, numeric segments indexing into an array. `undefined` means "does not resolve" — never thrown. */
|
|
69
|
-
function resolvePath(root, path) {
|
|
70
|
-
let current = root;
|
|
71
|
-
for (const segment of path.split(".")) {
|
|
72
|
-
if (current === null || current === undefined)
|
|
73
|
-
return { found: false };
|
|
74
|
-
if (Array.isArray(current)) {
|
|
75
|
-
const index = Number(segment);
|
|
76
|
-
if (!Number.isInteger(index) || index < 0 || index >= current.length)
|
|
77
|
-
return { found: false };
|
|
78
|
-
current = current[index];
|
|
79
|
-
continue;
|
|
80
|
-
}
|
|
81
|
-
if (typeof current !== "object")
|
|
82
|
-
return { found: false };
|
|
83
|
-
if (!Object.hasOwn(current, segment))
|
|
84
|
-
return { found: false };
|
|
85
|
-
current = current[segment];
|
|
86
|
-
}
|
|
87
|
-
return { found: true, value: current };
|
|
88
|
-
}
|
|
89
|
-
/** A target string only ever matches a leaf value, never a key name — so a match inside
|
|
90
|
-
* a node id used as an object key does not count as the target having been "returned". */
|
|
91
|
-
function containsTargetAtValuePosition(node, target) {
|
|
92
|
-
if (node === null || node === undefined)
|
|
93
|
-
return false;
|
|
94
|
-
if (typeof node === "string")
|
|
95
|
-
return node.includes(target);
|
|
96
|
-
if (typeof node === "number" || typeof node === "boolean")
|
|
97
|
-
return String(node) === target || String(node).includes(target);
|
|
98
|
-
if (Array.isArray(node))
|
|
99
|
-
return node.some((item) => containsTargetAtValuePosition(item, target));
|
|
100
|
-
if (typeof node === "object")
|
|
101
|
-
return Object.values(node).some((v) => containsTargetAtValuePosition(v, target));
|
|
102
|
-
return false;
|
|
103
|
-
}
|
|
104
|
-
/** Structural comparison for the case where a claim names both a path and a target: the
|
|
105
|
-
* value actually found at that path must equal the target, not merely co-occur with it
|
|
106
|
-
* somewhere in the same serialized result (F1 — this is the join that was missing). Only
|
|
107
|
-
* scalars can match a string target; an object or array resolved at the path never does,
|
|
108
|
-
* because a single string cannot faithfully assert "this whole structure". */
|
|
109
|
-
function valueMatchesTarget(value, target) {
|
|
110
|
-
if (typeof value === "string")
|
|
111
|
-
return value === target;
|
|
112
|
-
if (typeof value === "number" || typeof value === "boolean")
|
|
113
|
-
return String(value) === target;
|
|
114
|
-
return false;
|
|
115
|
-
}
|
|
116
|
-
function checkClaim(call, claim) {
|
|
117
|
-
if (claim.path !== undefined && claim.target !== undefined) {
|
|
118
|
-
const resolved = resolvePath(call.result, claim.path);
|
|
119
|
-
if (!resolved.found) {
|
|
120
|
-
return { ok: false, reason: `"${claim.path}" does not resolve in ${call.tool}'s recorded result` };
|
|
121
|
-
}
|
|
122
|
-
if (!valueMatchesTarget(resolved.value, claim.target)) {
|
|
123
|
-
return {
|
|
124
|
-
ok: false,
|
|
125
|
-
reason: `"${claim.path}" resolves to ${JSON.stringify(resolved.value)} in ${call.tool}'s recorded result, not "${claim.target}"`,
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
return { ok: true, reason: `cites ${call.tool}'s recorded result, where "${claim.path}" resolves to "${claim.target}"` };
|
|
129
|
-
}
|
|
130
|
-
if (claim.path !== undefined) {
|
|
131
|
-
const resolved = resolvePath(call.result, claim.path);
|
|
132
|
-
if (!resolved.found) {
|
|
133
|
-
return { ok: false, reason: `"${claim.path}" does not resolve in ${call.tool}'s recorded result` };
|
|
134
|
-
}
|
|
135
|
-
return { ok: true, reason: `cites ${call.tool}'s recorded result, which has "${claim.path}"` };
|
|
136
|
-
}
|
|
137
|
-
// target only: a substring search, weaker than a path check, and the reason says so —
|
|
138
|
-
// this is not a structural claim about which field the value came from (F1, part 2).
|
|
139
|
-
const target = claim.target;
|
|
140
|
-
if (!containsTargetAtValuePosition(call.result, target)) {
|
|
141
|
-
return { ok: false, reason: `"${target}" does not appear anywhere in ${call.tool}'s recorded result — not part of what that call returned` };
|
|
142
|
-
}
|
|
143
|
-
return {
|
|
144
|
-
ok: true,
|
|
145
|
-
reason: `cites ${call.tool}'s recorded result, which contains "${target}" (a substring match only — no specific field was checked)`,
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
function headlineFor(checked, grounded, notGrounded, unverifiable) {
|
|
149
|
-
if (grounded === checked)
|
|
150
|
-
return `All ${checked} claim(s) cite this session's own recorded facts.`;
|
|
151
|
-
const parts = [`${grounded} of ${checked} claim(s) are grounded`];
|
|
152
|
-
if (notGrounded > 0)
|
|
153
|
-
parts.push(`${notGrounded} cite something this session never actually returned`);
|
|
154
|
-
if (unverifiable > 0)
|
|
155
|
-
parts.push(`${unverifiable} could not be checked — no path or target was given`);
|
|
156
|
-
return `${parts.join("; ")}.`;
|
|
157
|
-
}
|
|
158
|
-
async function run(args, ctx) {
|
|
159
|
-
const claims = readClaims(args);
|
|
160
|
-
ctx.progress(`Checking ${claims.length} claim(s) against this session's recorded tool calls`);
|
|
161
|
-
const results = claims.map((claim) => {
|
|
162
|
-
if (claim.path === undefined && claim.target === undefined) {
|
|
163
|
-
return {
|
|
164
|
-
statement: claim.statement,
|
|
165
|
-
callId: claim.callId,
|
|
166
|
-
verdict: "unverifiable",
|
|
167
|
-
reason: 'neither "path" nor "target" was given — a callId alone checks nothing, so this claim was never checked either way',
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
const call = ctx.session.recordedCall(claim.callId);
|
|
171
|
-
if (call === undefined) {
|
|
172
|
-
return {
|
|
173
|
-
statement: claim.statement,
|
|
174
|
-
callId: claim.callId,
|
|
175
|
-
verdict: "notGrounded",
|
|
176
|
-
reason: `no recorded tool call with id "${claim.callId}" in this session — either it was never made, or it belongs to a different session's run (G1's own negative control)`,
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
const outcome = checkClaim(call, claim);
|
|
180
|
-
return { statement: claim.statement, callId: claim.callId, verdict: outcome.ok ? "grounded" : "notGrounded", reason: outcome.reason };
|
|
181
|
-
});
|
|
182
|
-
const grounded = results.filter((r) => r.verdict === "grounded").length;
|
|
183
|
-
const notGrounded = results.filter((r) => r.verdict === "notGrounded").length;
|
|
184
|
-
const unverifiable = results.filter((r) => r.verdict === "unverifiable").length;
|
|
185
|
-
return answer({
|
|
186
|
-
headline: headlineFor(results.length, grounded, notGrounded, unverifiable),
|
|
187
|
-
data: { checked: results.length, grounded, notGrounded, unverifiable, results },
|
|
188
|
-
// Not a graph query — no resolution level, no commit, no schema version
|
|
189
|
-
// applies. `nameLevel: true` because this checks presence (did this
|
|
190
|
-
// exact text appear), the same axis `verification_status` reports on.
|
|
191
|
-
resolutionFloor: 0,
|
|
192
|
-
commitSha: null,
|
|
193
|
-
graphBuiltAt: null,
|
|
194
|
-
irSchemaVersion: 0,
|
|
195
|
-
// No graph consulted, so no commit spread — 0 says "not a graph question," not a hidden spread.
|
|
196
|
-
commitSpread: 0,
|
|
197
|
-
repoCount: 0,
|
|
198
|
-
nameLevel: true,
|
|
199
|
-
notes: [
|
|
200
|
-
"This tool checks citations against calls made earlier in this same session only — it has no " +
|
|
201
|
-
"memory across separate server processes, and it does not run the full governance pipeline " +
|
|
202
|
-
'(MK-11): "grounded" here means "cites a real, recorded fact," never "confirmed."',
|
|
203
|
-
],
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
export const verifyClaimTool = {
|
|
207
|
-
name: "verify_claim",
|
|
208
|
-
class: "read",
|
|
209
|
-
tier: "evidence",
|
|
210
|
-
version: "1.0.0",
|
|
211
|
-
title: "Does this claim actually cite something this session returned?",
|
|
212
|
-
description: "Given draft claims, each citing an earlier call in this session by its callId and a path and/or " +
|
|
213
|
-
"a target string, report which are grounded in that call's real recorded result and which are not " +
|
|
214
|
-
"— catching an invented path, a citation to a call that never happened, or a target string this " +
|
|
215
|
-
"session never actually returned. Voluntary: nothing else in this surface reads or enforces the " +
|
|
216
|
-
'result. Never returns "confirmed" — see the tool\'s own module doc for why.',
|
|
217
|
-
inputSchema: SCHEMA,
|
|
218
|
-
run,
|
|
219
|
-
};
|
|
220
|
-
//# sourceMappingURL=verify-claim.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verify-claim.js","sourceRoot":"","sources":["../../src/tools/verify-claim.ts"],"names":[],"mappings":"AAAA;;;;2FAI2F;AAE3F,OAAO,EACL,MAAM,EACN,cAAc,EACd,cAAc,GAGf,MAAM,UAAU,CAAC;AAGlB,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,MAAM,EAAE;YACN,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,CAAC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|
1
|
-
/**
|
|
2
|
-
* `workspace` — merges `analyze`, `analyze_workspace` and `link_workspace`
|
|
3
|
-
* behind one `verb` (documents/plans/mcp-surface-consolidation.md §2, group 1).
|
|
4
|
-
* All three are `stateful-read`/`evidence`, so the merge crosses neither
|
|
5
|
-
* boundary.
|
|
6
|
-
*
|
|
7
|
-
* Dispatch only. Each verb's own `run()` body is untouched and stays in its
|
|
8
|
-
* own module (`analyze.ts` / `analyze-workspace.ts` / `link-workspace.ts`) —
|
|
9
|
-
* this file never holds a second copy of that logic, it only routes to it
|
|
10
|
-
* after `selectVerb` has re-established, per verb, the argument strength a
|
|
11
|
-
* flat union schema loses (`verb.ts`'s own header explains why that is
|
|
12
|
-
* mandatory once a schema covers more than one verb).
|
|
13
|
-
*/
|
|
14
|
-
import type { ToolDefinition } from "./kit.ts";
|
|
15
|
-
import type { AnalyzeData } from "./analyze.ts";
|
|
16
|
-
import type { AnalyzeWorkspaceData } from "./analyze-workspace.ts";
|
|
17
|
-
import type { LinkWorkspaceData } from "./link-workspace.ts";
|
|
18
|
-
/**
|
|
19
|
-
* What this tool answers with: one verb's shape, never a merged one.
|
|
20
|
-
*
|
|
21
|
-
* The merge cost this its single concrete output type, and `unknown` would have
|
|
22
|
-
* silently retired `output-shapes.test.ts`'s check that a declared shape is tied
|
|
23
|
-
* to the code producing it. A union keeps that tie: a verb added without its
|
|
24
|
-
* shape here stops compiling.
|
|
25
|
-
*/
|
|
26
|
-
export type WorkspaceData = AnalyzeData | AnalyzeWorkspaceData | LinkWorkspaceData;
|
|
27
|
-
export declare const workspaceTool: ToolDefinition;
|
|
28
|
-
//# sourceMappingURL=workspace.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/tools/workspace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,UAAU,CAAC;AAM5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GACrB,WAAW,GACX,oBAAoB,GACpB,iBAAiB,CAAC;AAiFtB,eAAO,MAAM,aAAa,EAAE,cAa3B,CAAC"}
|
package/dist/tools/workspace.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `workspace` — merges `analyze`, `analyze_workspace` and `link_workspace`
|
|
3
|
-
* behind one `verb` (documents/plans/mcp-surface-consolidation.md §2, group 1).
|
|
4
|
-
* All three are `stateful-read`/`evidence`, so the merge crosses neither
|
|
5
|
-
* boundary.
|
|
6
|
-
*
|
|
7
|
-
* Dispatch only. Each verb's own `run()` body is untouched and stays in its
|
|
8
|
-
* own module (`analyze.ts` / `analyze-workspace.ts` / `link-workspace.ts`) —
|
|
9
|
-
* this file never holds a second copy of that logic, it only routes to it
|
|
10
|
-
* after `selectVerb` has re-established, per verb, the argument strength a
|
|
11
|
-
* flat union schema loses (`verb.ts`'s own header explains why that is
|
|
12
|
-
* mandatory once a schema covers more than one verb).
|
|
13
|
-
*/
|
|
14
|
-
import { selectVerb } from "./verb.js";
|
|
15
|
-
import { analyzeTool } from "./analyze.js";
|
|
16
|
-
import { analyzeWorkspaceTool } from "./analyze-workspace.js";
|
|
17
|
-
import { linkWorkspaceTool } from "./link-workspace.js";
|
|
18
|
-
const VERBS = ["analyze", "index", "link"];
|
|
19
|
-
const VERB_SPECS = [
|
|
20
|
-
{ verb: "analyze", accepts: ["includeHistory", "maxCommits", "reload"] },
|
|
21
|
-
{ verb: "index", accepts: ["includeHistory", "maxCommits"] },
|
|
22
|
-
{ verb: "link", accepts: ["workspace", "repos"] },
|
|
23
|
-
];
|
|
24
|
-
const SCHEMA = {
|
|
25
|
-
type: "object",
|
|
26
|
-
properties: {
|
|
27
|
-
verb: {
|
|
28
|
-
type: "string",
|
|
29
|
-
enum: [...VERBS],
|
|
30
|
-
description: '"analyze" — read this repository into the code graph. "index" — read every repository a ' +
|
|
31
|
-
'prior "link" declared into one shared graph. "link" — declare which repositories share a ' +
|
|
32
|
-
"workspace.",
|
|
33
|
-
},
|
|
34
|
-
includeHistory: {
|
|
35
|
-
type: "boolean",
|
|
36
|
-
description: "analyze/index. Read git history for co-change coupling. Default true.",
|
|
37
|
-
},
|
|
38
|
-
maxCommits: {
|
|
39
|
-
type: "integer",
|
|
40
|
-
minimum: 1,
|
|
41
|
-
description: "analyze/index. Cap on commits read from history. Default 2000.",
|
|
42
|
-
},
|
|
43
|
-
reload: {
|
|
44
|
-
type: "boolean",
|
|
45
|
-
description: "analyze only. Re-read .descry/config.json from disk before this run, instead of the " +
|
|
46
|
-
"configuration this server started with.",
|
|
47
|
-
},
|
|
48
|
-
workspace: {
|
|
49
|
-
type: "string",
|
|
50
|
-
description: 'link only. The workspace id to write into every repository in "repos", byte-identical.',
|
|
51
|
-
},
|
|
52
|
-
repos: {
|
|
53
|
-
type: "array",
|
|
54
|
-
minItems: 2,
|
|
55
|
-
items: {
|
|
56
|
-
type: "object",
|
|
57
|
-
properties: {
|
|
58
|
-
path: { type: "string", description: "Absolute path to the repository on disk." },
|
|
59
|
-
repo: { type: "string", description: "This repository's identity, written explicitly." },
|
|
60
|
-
},
|
|
61
|
-
required: ["path", "repo"],
|
|
62
|
-
additionalProperties: false,
|
|
63
|
-
},
|
|
64
|
-
description: "link only. Every repository that should share this workspace, including the current one " +
|
|
65
|
-
"if it should join. Only ones the user has explicitly confirmed belong together — never " +
|
|
66
|
-
"inferred.",
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
required: ["verb"],
|
|
70
|
-
additionalProperties: false,
|
|
71
|
-
};
|
|
72
|
-
const DISPATCH = {
|
|
73
|
-
analyze: analyzeTool,
|
|
74
|
-
index: analyzeWorkspaceTool,
|
|
75
|
-
link: linkWorkspaceTool,
|
|
76
|
-
};
|
|
77
|
-
async function run(args, ctx) {
|
|
78
|
-
const verb = selectVerb(args, "verb", VERB_SPECS);
|
|
79
|
-
// `ToolDefinition` erases its answer's type parameter — it has to, the
|
|
80
|
-
// registry is one array of many shapes — so the delegated call comes back as
|
|
81
|
-
// an erased answer type. The verb table is what makes the union true: every
|
|
82
|
-
// entry's own `run` is declared against one of WorkspaceData's members, and a verb
|
|
83
|
-
// added without its shape stops compiling at the union. The assertion
|
|
84
|
-
// re-applies what the table already guarantees rather than asserting
|
|
85
|
-
// something unchecked.
|
|
86
|
-
return (await DISPATCH[verb].run(args, ctx));
|
|
87
|
-
}
|
|
88
|
-
export const workspaceTool = {
|
|
89
|
-
name: "workspace",
|
|
90
|
-
class: "stateful-read",
|
|
91
|
-
tier: "evidence",
|
|
92
|
-
version: "1.0.0",
|
|
93
|
-
title: "Analyse a repository or workspace into the code graph",
|
|
94
|
-
description: "Read source into the code graph, or declare which repositories share a workspace, by verb: " +
|
|
95
|
-
'"analyze" (one repository, with its configured adapters), "index" (every repository a prior ' +
|
|
96
|
-
'"link" call declared, into one shared graph), "link" (write a workspace id into each named ' +
|
|
97
|
-
"repository's config — only after the user has explicitly confirmed they belong together).",
|
|
98
|
-
inputSchema: SCHEMA,
|
|
99
|
-
run,
|
|
100
|
-
};
|
|
101
|
-
//# sourceMappingURL=workspace.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../src/tools/workspace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAiB,MAAM,WAAW,CAAC;AAItD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAkBx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AE,MAAM,CAAC;gBAC1B,oBAAoB,EAAE,KAAK;aAC5B;YACD,WAAW,EACT,0FAA0F;gBAC1F,yFAAyF;gBACzF,WAAW;SACd;KACF;IACD,QAAQ,EAAE,CAAC,MAAM,CAAC;IAClB,oBAAoB,EAAE,KAAK;CACnB,CAAC;AAEX,MAAM,QAAQ,GAA2C;IACvD,OAAO,EAAE,WAAW;IACpB,KAAK,EAAE,oBAAoB;IAC3B,IAAI,EAAE,iBAAiB;CACxB,CAAC;AAEF,KAAK,UAAU,GAAG,CAAC,IAA6B,EAAE,GAAgB;IAChE,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAClD,uEAAuE;IACvE,6EAA6E;IAC7E,4EAA4E;IAC5E,mFAAmF;IACnF,sEAAsE;IACtE,qEAAqE;IACrE,uBAAuB;IACvB,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAA8B,CAAC;AAC5E,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAmB;IAC3C,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,eAAe;IACtB,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,uDAAuD;IAC9D,WAAW,EACT,6FAA6F;QAC7F,8FAA8F;QAC9F,6FAA6F;QAC7F,2FAA2F;IAC7F,WAAW,EAAE,MAA4C;IACzD,GAAG;CACJ,CAAC"}
|
package/dist/transport.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/** stdio transport: newline-delimited JSON over stdin/stdout. Stdout is the protocol
|
|
2
|
-
* channel and nothing else may write to it — a stray `console.log` anywhere (engine,
|
|
3
|
-
* adapter, dependency) corrupts a frame and kills the session with a misleading error;
|
|
4
|
-
* `guardStdout()` redirects console.* to stderr instead. Framing: one JSON object per
|
|
5
|
-
* line, UTF-8, no embedded newlines; reads use `StringDecoder` since a chunk boundary can split a multibyte character. */
|
|
6
|
-
import type { Readable, Writable } from "node:stream";
|
|
7
|
-
export interface Transport {
|
|
8
|
-
/** Write one frame. Must never be called with anything but a JSON-RPC message. */
|
|
9
|
-
send(frame: unknown): void;
|
|
10
|
-
}
|
|
11
|
-
/** Redirects every console channel to stderr and returns the real stdout writer. Called
|
|
12
|
-
* once, before any handler runs — the returned function is the only sanctioned path to stdout. */
|
|
13
|
-
export declare function guardStdout(stdout: Writable, stderr: Writable): (line: string) => void;
|
|
14
|
-
/** Splits a byte stream into lines, decoding correctly across chunk boundaries. Returned as
|
|
15
|
-
* a function, not a class — the buffer is the entire state, nothing else to hang on an object. */
|
|
16
|
-
export declare function createLineReader(onLine: (line: string) => void): (chunk: Buffer) => void;
|
|
17
|
-
export interface StdioOptions {
|
|
18
|
-
readonly stdin: Readable;
|
|
19
|
-
readonly stdout: Writable;
|
|
20
|
-
readonly stderr: Writable;
|
|
21
|
-
}
|
|
22
|
-
/** Runs a dispatcher over stdio until stdin closes. Resolves on end-of-input — how an MCP
|
|
23
|
-
* host asks a stdio server to shut down. Anything the server holds open (DB handle, worker
|
|
24
|
-
* pool) is disposed by the caller after, not here — this function knows only about bytes. */
|
|
25
|
-
export interface ServeOptions {
|
|
26
|
-
/** Frames that must not wait behind an in-flight call. Supplied by the caller — which
|
|
27
|
-
* methods mean what is the server's knowledge; `server.ts`'s `isOutOfBand` answers true
|
|
28
|
-
* only for `notifications/cancelled`. */
|
|
29
|
-
readonly isOutOfBand?: (line: string) => boolean;
|
|
30
|
-
}
|
|
31
|
-
export declare function serveStdio(options: StdioOptions, dispatch: (line: string, transport: Transport) => Promise<void>, serveOptions?: ServeOptions): Promise<void>;
|
|
32
|
-
//# sourceMappingURL=transport.d.ts.map
|
package/dist/transport.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAAA;;;;2HAI2H;AAG3H,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,WAAW,SAAS;IACxB,kFAAkF;IAClF,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CAC5B;AAED;mGACmG;AACnG,wBAAgB,WAAW,CACzB,MAAM,EAAE,QAAQ,EAChB,MAAM,EAAE,QAAQ,GACf,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAiBxB;AAWD;mGACmG;AACnG,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAcxF;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;CAC3B;AAED;;8FAE8F;AAC9F,MAAM,WAAW,YAAY;IAC3B;;8CAE0C;IAC1C,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CAClD;AAED,wBAAgB,UAAU,CACxB,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,EAC/D,YAAY,GAAE,YAAiB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAqCf"}
|
package/dist/transport.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/** stdio transport: newline-delimited JSON over stdin/stdout. Stdout is the protocol
|
|
2
|
-
* channel and nothing else may write to it — a stray `console.log` anywhere (engine,
|
|
3
|
-
* adapter, dependency) corrupts a frame and kills the session with a misleading error;
|
|
4
|
-
* `guardStdout()` redirects console.* to stderr instead. Framing: one JSON object per
|
|
5
|
-
* line, UTF-8, no embedded newlines; reads use `StringDecoder` since a chunk boundary can split a multibyte character. */
|
|
6
|
-
import { StringDecoder } from "node:string_decoder";
|
|
7
|
-
/** Redirects every console channel to stderr and returns the real stdout writer. Called
|
|
8
|
-
* once, before any handler runs — the returned function is the only sanctioned path to stdout. */
|
|
9
|
-
export function guardStdout(stdout, stderr) {
|
|
10
|
-
const toStderr = (...args) => {
|
|
11
|
-
stderr.write(`${args
|
|
12
|
-
.map((a) => (typeof a === "string" ? a : inspectish(a)))
|
|
13
|
-
.join(" ")}\n`);
|
|
14
|
-
};
|
|
15
|
-
console.log = toStderr;
|
|
16
|
-
console.info = toStderr;
|
|
17
|
-
console.warn = toStderr;
|
|
18
|
-
console.debug = toStderr;
|
|
19
|
-
console.error = toStderr;
|
|
20
|
-
return (line) => {
|
|
21
|
-
stdout.write(line);
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
function inspectish(value) {
|
|
25
|
-
if (value instanceof Error)
|
|
26
|
-
return `${value.name}: ${value.message}`;
|
|
27
|
-
try {
|
|
28
|
-
return JSON.stringify(value) ?? String(value);
|
|
29
|
-
}
|
|
30
|
-
catch {
|
|
31
|
-
return String(value);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
/** Splits a byte stream into lines, decoding correctly across chunk boundaries. Returned as
|
|
35
|
-
* a function, not a class — the buffer is the entire state, nothing else to hang on an object. */
|
|
36
|
-
export function createLineReader(onLine) {
|
|
37
|
-
const decoder = new StringDecoder("utf8");
|
|
38
|
-
let buffer = "";
|
|
39
|
-
return (chunk) => {
|
|
40
|
-
buffer += decoder.write(chunk);
|
|
41
|
-
let index = buffer.indexOf("\n");
|
|
42
|
-
while (index !== -1) {
|
|
43
|
-
const line = buffer.slice(0, index).replace(/\r$/, "");
|
|
44
|
-
buffer = buffer.slice(index + 1);
|
|
45
|
-
if (line.trim() !== "")
|
|
46
|
-
onLine(line);
|
|
47
|
-
index = buffer.indexOf("\n");
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
export function serveStdio(options, dispatch, serveOptions = {}) {
|
|
52
|
-
const write = guardStdout(options.stdout, options.stderr);
|
|
53
|
-
const transport = {
|
|
54
|
-
send: (frame) => {
|
|
55
|
-
write(`${JSON.stringify(frame)}\n`);
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
// Frames handled strictly in order — concurrency would let a fast `tools/list` overtake a
|
|
59
|
-
// slow `analyze` and read a half-built graph. Exempt: `notifications/cancelled` alone (useless
|
|
60
|
-
// if queued, does no graph work) — narrowly scoped so a future notification doesn't inherit this silently.
|
|
61
|
-
const isOutOfBand = serveOptions.isOutOfBand ?? (() => false);
|
|
62
|
-
let chain = Promise.resolve();
|
|
63
|
-
return new Promise((resolve, reject) => {
|
|
64
|
-
const onError = (error) => {
|
|
65
|
-
// A dispatcher that throws is a bug here — `dispatch` should turn every failure into
|
|
66
|
-
// an error frame. Report on stderr and keep the session alive rather than killing the editor integration.
|
|
67
|
-
options.stderr.write(`descry-mcp: dispatch failed: ${inspectish(error)}\n`);
|
|
68
|
-
};
|
|
69
|
-
const feed = createLineReader((line) => {
|
|
70
|
-
if (isOutOfBand(line)) {
|
|
71
|
-
// Deliberately not joined to `chain` or awaited — an out-of-band frame must not
|
|
72
|
-
// delay ordered work; its rejection is still handled so it can't surface as unhandled and crash the process.
|
|
73
|
-
void dispatch(line, transport).catch(onError);
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
chain = chain.then(() => dispatch(line, transport)).catch(onError);
|
|
77
|
-
});
|
|
78
|
-
options.stdin.on("data", feed);
|
|
79
|
-
options.stdin.on("error", reject);
|
|
80
|
-
options.stdin.on("end", () => {
|
|
81
|
-
chain.then(resolve, resolve);
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=transport.js.map
|
package/dist/transport.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transport.js","sourceRoot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