wicked-crew 0.7.39 → 0.7.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/audit.d.ts +3 -0
- package/dist/api/audit.d.ts.map +1 -1
- package/dist/api/audit.js +2 -0
- package/dist/api/audit.js.map +1 -1
- package/dist/api/capture.d.ts +149 -0
- package/dist/api/capture.d.ts.map +1 -0
- package/dist/api/capture.js +330 -0
- package/dist/api/capture.js.map +1 -0
- package/dist/api/chat-citations.d.ts +174 -0
- package/dist/api/chat-citations.d.ts.map +1 -0
- package/dist/api/chat-citations.js +528 -0
- package/dist/api/chat-citations.js.map +1 -0
- package/dist/api/chat-scope.d.ts +37 -1
- package/dist/api/chat-scope.d.ts.map +1 -1
- package/dist/api/chat-scope.js +131 -7
- package/dist/api/chat-scope.js.map +1 -1
- package/dist/api/chat-transcripts.d.ts +20 -1
- package/dist/api/chat-transcripts.d.ts.map +1 -1
- package/dist/api/chat-transcripts.js +29 -0
- package/dist/api/chat-transcripts.js.map +1 -1
- package/dist/api/delivery-cache.d.ts +2 -2
- package/dist/api/delivery-freeze.d.ts +66 -0
- package/dist/api/delivery-freeze.d.ts.map +1 -0
- package/dist/api/delivery-freeze.js +104 -0
- package/dist/api/delivery-freeze.js.map +1 -0
- package/dist/api/delivery-index.d.ts +53 -9
- package/dist/api/delivery-index.d.ts.map +1 -1
- package/dist/api/delivery-index.js +115 -22
- package/dist/api/delivery-index.js.map +1 -1
- package/dist/api/demo.d.ts +90 -0
- package/dist/api/demo.d.ts.map +1 -0
- package/dist/api/demo.js +492 -0
- package/dist/api/demo.js.map +1 -0
- package/dist/api/diagnostics.d.ts +64 -1
- package/dist/api/diagnostics.d.ts.map +1 -1
- package/dist/api/diagnostics.js +129 -1
- package/dist/api/diagnostics.js.map +1 -1
- package/dist/api/eval-sample.d.ts +6 -6
- package/dist/api/governance-steering.d.ts +2 -2
- package/dist/api/mcp.d.ts +282 -0
- package/dist/api/mcp.d.ts.map +1 -0
- package/dist/api/mcp.js +521 -0
- package/dist/api/mcp.js.map +1 -0
- package/dist/api/plan-schema.d.ts +56 -0
- package/dist/api/plan-schema.d.ts.map +1 -0
- package/dist/api/plan-schema.js +26 -0
- package/dist/api/plan-schema.js.map +1 -0
- package/dist/api/roster-standing.d.ts +15 -2
- package/dist/api/roster-standing.d.ts.map +1 -1
- package/dist/api/roster-standing.js +55 -3
- package/dist/api/roster-standing.js.map +1 -1
- package/dist/api/routes.d.ts +647 -59
- package/dist/api/routes.d.ts.map +1 -1
- package/dist/api/routes.js +906 -146
- package/dist/api/routes.js.map +1 -1
- package/dist/api/run-files.d.ts.map +1 -1
- package/dist/api/run-files.js +31 -2
- package/dist/api/run-files.js.map +1 -1
- package/dist/api/run-liveness.d.ts +41 -0
- package/dist/api/run-liveness.d.ts.map +1 -0
- package/dist/api/run-liveness.js +166 -0
- package/dist/api/run-liveness.js.map +1 -0
- package/dist/api/run-timing-index.d.ts +10 -0
- package/dist/api/run-timing-index.d.ts.map +1 -1
- package/dist/api/run-timing-index.js +24 -0
- package/dist/api/run-timing-index.js.map +1 -1
- package/dist/api/seat-health.d.ts.map +1 -1
- package/dist/api/seat-health.js +20 -4
- package/dist/api/seat-health.js.map +1 -1
- package/dist/api/seat-probe.d.ts +141 -0
- package/dist/api/seat-probe.d.ts.map +1 -0
- package/dist/api/seat-probe.js +257 -0
- package/dist/api/seat-probe.js.map +1 -0
- package/dist/api/seat-record.d.ts +40 -0
- package/dist/api/seat-record.d.ts.map +1 -0
- package/dist/api/seat-record.js +218 -0
- package/dist/api/seat-record.js.map +1 -0
- package/dist/api/seat-signin.d.ts.map +1 -1
- package/dist/api/seat-signin.js +3 -1
- package/dist/api/seat-signin.js.map +1 -1
- package/dist/api/seat-standing.d.ts +24 -4
- package/dist/api/seat-standing.d.ts.map +1 -1
- package/dist/api/seat-standing.js +50 -3
- package/dist/api/seat-standing.js.map +1 -1
- package/dist/api/server.d.ts +34 -48
- package/dist/api/server.d.ts.map +1 -1
- package/dist/api/server.js +316 -116
- package/dist/api/server.js.map +1 -1
- package/dist/api/skills.d.ts +3 -1
- package/dist/api/skills.d.ts.map +1 -1
- package/dist/api/skills.js +7 -2
- package/dist/api/skills.js.map +1 -1
- package/dist/api/stall-watchdog.d.ts +34 -3
- package/dist/api/stall-watchdog.d.ts.map +1 -1
- package/dist/api/stall-watchdog.js +107 -8
- package/dist/api/stall-watchdog.js.map +1 -1
- package/dist/api/steering-landing.d.ts +6 -6
- package/dist/api/steering-landing.d.ts.map +1 -1
- package/dist/api/steering-landing.js +7 -9
- package/dist/api/steering-landing.js.map +1 -1
- package/dist/api/testing.d.ts +6 -4
- package/dist/api/testing.d.ts.map +1 -1
- package/dist/api/testing.js +82 -47
- package/dist/api/testing.js.map +1 -1
- package/dist/campaign/boot-resume.d.ts +34 -0
- package/dist/campaign/boot-resume.d.ts.map +1 -0
- package/dist/campaign/boot-resume.js +45 -0
- package/dist/campaign/boot-resume.js.map +1 -0
- package/dist/campaigns/rollup.d.ts +4 -1
- package/dist/campaigns/rollup.d.ts.map +1 -1
- package/dist/campaigns/rollup.js +6 -1
- package/dist/campaigns/rollup.js.map +1 -1
- package/dist/campaigns/routes.d.ts +2 -2
- package/dist/cli/bearer.d.ts +27 -1
- package/dist/cli/bearer.d.ts.map +1 -1
- package/dist/cli/bearer.js +62 -2
- package/dist/cli/bearer.js.map +1 -1
- package/dist/cli/governance.d.ts +11 -0
- package/dist/cli/governance.d.ts.map +1 -1
- package/dist/cli/governance.js +8 -2
- package/dist/cli/governance.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +140 -75
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/mcp.d.ts +11 -0
- package/dist/cli/mcp.d.ts.map +1 -1
- package/dist/cli/mcp.js +40 -9
- package/dist/cli/mcp.js.map +1 -1
- package/dist/cli/service.d.ts +78 -0
- package/dist/cli/service.d.ts.map +1 -0
- package/dist/cli/service.js +334 -0
- package/dist/cli/service.js.map +1 -0
- package/dist/core/adapter.d.ts +247 -14
- package/dist/core/adapter.d.ts.map +1 -1
- package/dist/core/adapter.js +638 -161
- package/dist/core/adapter.js.map +1 -1
- package/dist/core/bridge-reaper.d.ts +4 -1
- package/dist/core/bridge-reaper.d.ts.map +1 -1
- package/dist/core/bridge-reaper.js +15 -1
- package/dist/core/bridge-reaper.js.map +1 -1
- package/dist/core/bus-notice.d.ts +27 -0
- package/dist/core/bus-notice.d.ts.map +1 -0
- package/dist/core/bus-notice.js +24 -0
- package/dist/core/bus-notice.js.map +1 -0
- package/dist/core/bus.d.ts +99 -0
- package/dist/core/bus.d.ts.map +1 -0
- package/dist/core/bus.js +176 -0
- package/dist/core/bus.js.map +1 -0
- package/dist/core/deliver-exclusions.d.ts +71 -0
- package/dist/core/deliver-exclusions.d.ts.map +1 -0
- package/dist/core/deliver-exclusions.js +110 -0
- package/dist/core/deliver-exclusions.js.map +1 -0
- package/dist/core/deliver-text.d.ts +61 -14
- package/dist/core/deliver-text.d.ts.map +1 -1
- package/dist/core/deliver-text.js +178 -30
- package/dist/core/deliver-text.js.map +1 -1
- package/dist/core/deliver-triage.d.ts +11 -2
- package/dist/core/deliver-triage.d.ts.map +1 -1
- package/dist/core/deliver-triage.js +19 -1
- package/dist/core/deliver-triage.js.map +1 -1
- package/dist/core/deliver.d.ts +161 -3
- package/dist/core/deliver.d.ts.map +1 -1
- package/dist/core/deliver.js +463 -25
- package/dist/core/deliver.js.map +1 -1
- package/dist/core/deliverable-floor.d.ts.map +1 -1
- package/dist/core/deliverable-floor.js +5 -7
- package/dist/core/deliverable-floor.js.map +1 -1
- package/dist/core/engine-bus.d.ts +40 -0
- package/dist/core/engine-bus.d.ts.map +1 -0
- package/dist/core/engine-bus.js +27 -0
- package/dist/core/engine-bus.js.map +1 -0
- package/dist/core/estate-mcp-client.d.ts +87 -5
- package/dist/core/estate-mcp-client.d.ts.map +1 -1
- package/dist/core/estate-mcp-client.js +90 -11
- package/dist/core/estate-mcp-client.js.map +1 -1
- package/dist/core/linked-issues.d.ts +46 -0
- package/dist/core/linked-issues.d.ts.map +1 -0
- package/dist/core/linked-issues.js +123 -0
- package/dist/core/linked-issues.js.map +1 -0
- package/dist/core/run-identity.d.ts +100 -0
- package/dist/core/run-identity.d.ts.map +1 -0
- package/dist/core/run-identity.js +178 -0
- package/dist/core/run-identity.js.map +1 -0
- package/dist/core/shutdown.d.ts +16 -0
- package/dist/core/shutdown.d.ts.map +1 -0
- package/dist/core/shutdown.js +39 -0
- package/dist/core/shutdown.js.map +1 -0
- package/dist/core/types.d.ts +15 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +4 -0
- package/dist/core/types.js.map +1 -1
- package/dist/interactive/bridge-pool.d.ts +67 -3
- package/dist/interactive/bridge-pool.d.ts.map +1 -1
- package/dist/interactive/bridge-pool.js +129 -13
- package/dist/interactive/bridge-pool.js.map +1 -1
- package/dist/interactive/bridge-root.d.ts +9 -0
- package/dist/interactive/bridge-root.d.ts.map +1 -1
- package/dist/interactive/bridge-root.js +11 -4
- package/dist/interactive/bridge-root.js.map +1 -1
- package/dist/interactive/chat-events.d.ts +14 -9
- package/dist/interactive/chat-events.d.ts.map +1 -1
- package/dist/interactive/chat-events.js +55 -57
- package/dist/interactive/chat-events.js.map +1 -1
- package/dist/interactive/council-outcome.d.ts +1 -0
- package/dist/interactive/council-outcome.d.ts.map +1 -1
- package/dist/interactive/council-outcome.js +33 -0
- package/dist/interactive/council-outcome.js.map +1 -1
- package/dist/interactive/draft-events.d.ts +36 -17
- package/dist/interactive/draft-events.d.ts.map +1 -1
- package/dist/interactive/draft-events.js +121 -92
- package/dist/interactive/draft-events.js.map +1 -1
- package/dist/interactive/draft-skill.d.ts +59 -0
- package/dist/interactive/draft-skill.d.ts.map +1 -1
- package/dist/interactive/draft-skill.js +233 -0
- package/dist/interactive/draft-skill.js.map +1 -1
- package/dist/interactive/edit-events.d.ts +1 -14
- package/dist/interactive/edit-events.d.ts.map +1 -1
- package/dist/interactive/edit-events.js +37 -70
- package/dist/interactive/edit-events.js.map +1 -1
- package/dist/interactive/proxy-routes.d.ts +2 -2
- package/dist/interactive/proxy-routes.d.ts.map +1 -1
- package/dist/interactive/proxy-routes.js +4 -13
- package/dist/interactive/proxy-routes.js.map +1 -1
- package/dist/interactive/ws-relay.d.ts +9 -10
- package/dist/interactive/ws-relay.d.ts.map +1 -1
- package/dist/interactive/ws-relay.js +23 -50
- package/dist/interactive/ws-relay.js.map +1 -1
- package/dist/mcp/broker.d.ts +88 -0
- package/dist/mcp/broker.d.ts.map +1 -0
- package/dist/mcp/broker.js +307 -0
- package/dist/mcp/broker.js.map +1 -0
- package/dist/mcp/call-records.d.ts +61 -0
- package/dist/mcp/call-records.d.ts.map +1 -0
- package/dist/mcp/call-records.js +135 -0
- package/dist/mcp/call-records.js.map +1 -0
- package/dist/mcp/classify.d.ts +45 -0
- package/dist/mcp/classify.d.ts.map +1 -0
- package/dist/mcp/classify.js +83 -0
- package/dist/mcp/classify.js.map +1 -0
- package/dist/mcp/discovery.d.ts +24 -0
- package/dist/mcp/discovery.d.ts.map +1 -0
- package/dist/mcp/discovery.js +78 -0
- package/dist/mcp/discovery.js.map +1 -0
- package/dist/mcp/invoke.d.ts +36 -0
- package/dist/mcp/invoke.d.ts.map +1 -0
- package/dist/mcp/invoke.js +80 -0
- package/dist/mcp/invoke.js.map +1 -0
- package/dist/mcp/policies.d.ts +110 -0
- package/dist/mcp/policies.d.ts.map +1 -0
- package/dist/mcp/policies.js +400 -0
- package/dist/mcp/policies.js.map +1 -0
- package/dist/mcp/probe.d.ts +66 -0
- package/dist/mcp/probe.d.ts.map +1 -0
- package/dist/mcp/probe.js +116 -0
- package/dist/mcp/probe.js.map +1 -0
- package/dist/mcp/redact.d.ts +34 -0
- package/dist/mcp/redact.d.ts.map +1 -0
- package/dist/mcp/redact.js +84 -0
- package/dist/mcp/redact.js.map +1 -0
- package/dist/mcp/registry-store.d.ts +69 -0
- package/dist/mcp/registry-store.d.ts.map +1 -0
- package/dist/mcp/registry-store.js +82 -0
- package/dist/mcp/registry-store.js.map +1 -0
- package/dist/mcp/registry.d.ts +147 -0
- package/dist/mcp/registry.d.ts.map +1 -0
- package/dist/mcp/registry.js +509 -0
- package/dist/mcp/registry.js.map +1 -0
- package/dist/mcp/rest.d.ts +111 -0
- package/dist/mcp/rest.d.ts.map +1 -0
- package/dist/mcp/rest.js +606 -0
- package/dist/mcp/rest.js.map +1 -0
- package/dist/mcp/secrets.d.ts +66 -0
- package/dist/mcp/secrets.d.ts.map +1 -0
- package/dist/mcp/secrets.js +180 -0
- package/dist/mcp/secrets.js.map +1 -0
- package/dist/mcp/tool-list.d.ts +25 -0
- package/dist/mcp/tool-list.d.ts.map +1 -0
- package/dist/mcp/tool-list.js +62 -0
- package/dist/mcp/tool-list.js.map +1 -0
- package/dist/mcp/upstream-error.d.ts +12 -0
- package/dist/mcp/upstream-error.d.ts.map +1 -0
- package/dist/mcp/upstream-error.js +14 -0
- package/dist/mcp/upstream-error.js.map +1 -0
- package/dist/mcp/usage.d.ts +31 -0
- package/dist/mcp/usage.d.ts.map +1 -0
- package/dist/mcp/usage.js +159 -0
- package/dist/mcp/usage.js.map +1 -0
- package/dist/presets/routes.d.ts +53 -0
- package/dist/presets/routes.d.ts.map +1 -0
- package/dist/presets/routes.js +115 -0
- package/dist/presets/routes.js.map +1 -0
- package/dist/projects/activity.d.ts +6 -18
- package/dist/projects/activity.d.ts.map +1 -1
- package/dist/projects/activity.js +17 -60
- package/dist/projects/activity.js.map +1 -1
- package/dist/projects/events.d.ts +6 -5
- package/dist/projects/events.d.ts.map +1 -1
- package/dist/projects/events.js +33 -58
- package/dist/projects/events.js.map +1 -1
- package/dist/projects/graph.d.ts +11 -0
- package/dist/projects/graph.d.ts.map +1 -1
- package/dist/projects/graph.js +12 -0
- package/dist/projects/graph.js.map +1 -1
- package/dist/projects/routes.d.ts.map +1 -1
- package/dist/projects/routes.js +19 -0
- package/dist/projects/routes.js.map +1 -1
- package/dist/projects/state-home-preflight.d.ts.map +1 -1
- package/dist/projects/state-home-preflight.js +7 -0
- package/dist/projects/state-home-preflight.js.map +1 -1
- package/dist/projects/state-home-registry.d.ts.map +1 -1
- package/dist/projects/state-home-registry.js +9 -1
- package/dist/projects/state-home-registry.js.map +1 -1
- package/dist/qe/acceptance.d.ts +28 -28
- package/dist/qe/acceptance.d.ts.map +1 -1
- package/dist/qe/acceptance.js +60 -61
- package/dist/qe/acceptance.js.map +1 -1
- package/dist/qe/test-sets.d.ts +3 -5
- package/dist/qe/test-sets.d.ts.map +1 -1
- package/dist/qe/test-sets.js +5 -7
- package/dist/qe/test-sets.js.map +1 -1
- package/dist/skills/installed.d.ts +51 -0
- package/dist/skills/installed.d.ts.map +1 -0
- package/dist/skills/installed.js +46 -0
- package/dist/skills/installed.js.map +1 -0
- package/dist/skills/phase-skill-gaps.d.ts +108 -0
- package/dist/skills/phase-skill-gaps.d.ts.map +1 -0
- package/dist/skills/phase-skill-gaps.js +199 -0
- package/dist/skills/phase-skill-gaps.js.map +1 -0
- package/dist/skills/runtime.d.ts +1 -1
- package/dist/skills/runtime.d.ts.map +1 -1
- package/dist/skills/runtime.js +2 -1
- package/dist/skills/runtime.js.map +1 -1
- package/dist/standing-orders/evaluator.d.ts +113 -0
- package/dist/standing-orders/evaluator.d.ts.map +1 -0
- package/dist/standing-orders/evaluator.js +225 -0
- package/dist/standing-orders/evaluator.js.map +1 -0
- package/dist/standing-orders/history.d.ts +58 -0
- package/dist/standing-orders/history.d.ts.map +1 -0
- package/dist/standing-orders/history.js +117 -0
- package/dist/standing-orders/history.js.map +1 -0
- package/dist/standing-orders/parse.d.ts +19 -0
- package/dist/standing-orders/parse.d.ts.map +1 -0
- package/dist/standing-orders/parse.js +75 -0
- package/dist/standing-orders/parse.js.map +1 -0
- package/dist/standing-orders/routes.d.ts +180 -0
- package/dist/standing-orders/routes.d.ts.map +1 -0
- package/dist/standing-orders/routes.js +95 -0
- package/dist/standing-orders/routes.js.map +1 -0
- package/dist/standing-orders/store.d.ts +154 -0
- package/dist/standing-orders/store.d.ts.map +1 -0
- package/dist/standing-orders/store.js +189 -0
- package/dist/standing-orders/store.js.map +1 -0
- package/dist/studio/assets/index-CvV5qITf.css +32 -0
- package/dist/studio/assets/index-jCOy6Ns7.js +568 -0
- package/dist/studio/index.html +3 -3
- package/dist/studio/testid-inventory.json +3307 -897
- package/dist/team/key.d.ts +5 -0
- package/dist/team/key.d.ts.map +1 -0
- package/dist/team/key.js +21 -0
- package/dist/team/key.js.map +1 -0
- package/dist/team/routes.d.ts +196 -0
- package/dist/team/routes.d.ts.map +1 -0
- package/dist/team/routes.js +274 -0
- package/dist/team/routes.js.map +1 -0
- package/dist/team/ws-relay.d.ts +39 -0
- package/dist/team/ws-relay.d.ts.map +1 -0
- package/dist/team/ws-relay.js +63 -0
- package/dist/team/ws-relay.js.map +1 -0
- package/endpoint-manifest.json +502 -6
- package/package.json +6 -6
- package/dist/interactive/demo-events.d.ts +0 -367
- package/dist/interactive/demo-events.d.ts.map +0 -1
- package/dist/interactive/demo-events.js +0 -1293
- package/dist/interactive/demo-events.js.map +0 -1
- package/dist/qe/gate-events.d.ts +0 -113
- package/dist/qe/gate-events.d.ts.map +0 -1
- package/dist/qe/gate-events.js +0 -172
- package/dist/qe/gate-events.js.map +0 -1
- package/dist/studio/assets/index-BRDAN35i.js +0 -548
- package/dist/studio/assets/index-Drfcsy8b.css +0 -32
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chat citation verification (crew#561, F-RC1-117 — Wave 1 criterion 2).
|
|
3
|
+
*
|
|
4
|
+
* # The defect
|
|
5
|
+
*
|
|
6
|
+
* A chat seat answers with citations — repo-relative paths, `path:line` refs, `path:symbol` refs
|
|
7
|
+
* and commit SHAs — and the daemon relays that text UNTOUCHED. On the RC1 Phase 6 re-run the
|
|
8
|
+
* opencode seat answered "summarize the last 10 commits across all 9 repos" with 26 SHAs, of which
|
|
9
|
+
* **2 did not exist in any repo**, and three line refs were off by a few lines. Every citation
|
|
10
|
+
* rendered as plain text, so a reader could not tell a real SHA from an invented one — and these
|
|
11
|
+
* are exactly the tokens a reader pastes into `git show`, a PR or a commit message.
|
|
12
|
+
*
|
|
13
|
+
* The daemon is the ONE place that can tell: it already knows the chat's read roots (the scope it
|
|
14
|
+
* handed the seats), and `stat` + `git cat-file -e` are cheap. So it verifies, and says what it
|
|
15
|
+
* found — it never edits the seat's text. Mark, don't rewrite.
|
|
16
|
+
*
|
|
17
|
+
* # What is verified
|
|
18
|
+
*
|
|
19
|
+
* | kind | citation | check |
|
|
20
|
+
* |----------|-----------------------------------|-------|
|
|
21
|
+
* | `path` | `crew/src/api/routes.ts` | the file exists under a read root |
|
|
22
|
+
* | `line` | `routes.ts:2264`, `x.ts:80-90` | the file exists AND has that many lines; when a symbol is named right before the ref, that the symbol is ON that line — otherwise the line it IS on, as a CORRECTION |
|
|
23
|
+
* | `symbol` | `execute_wrapped.rs:build_worker_command` | the file exists AND contains the symbol |
|
|
24
|
+
* | `sha` | `6d77153`, 7–40 hex | `git rev-parse --verify --quiet <sha>^{commit}` in the repo the text names, else in any read root |
|
|
25
|
+
*
|
|
26
|
+
* # Why a false positive is worse than a miss
|
|
27
|
+
*
|
|
28
|
+
* Prose looks like a path (`e.g`, `something.this`) and words look like SHAs. Flagging prose
|
|
29
|
+
* UNVERIFIED would train the reader to ignore the marks, which is worse than not marking. So:
|
|
30
|
+
*
|
|
31
|
+
* - a bare `name.ext` token with no directory and no `:line`/`:symbol` suffix that resolves
|
|
32
|
+
* nowhere is DROPPED, not marked — it was probably never a citation;
|
|
33
|
+
* - a hex run with no digit or no `a-f` letter is not a SHA candidate (`effaced` is a word; the
|
|
34
|
+
* price is that an all-digit short SHA — ~4% of 7-char prefixes — is not checked);
|
|
35
|
+
* - a token WITH a separator or a `:line`/`:symbol` suffix IS a citation: unresolvable means
|
|
36
|
+
* `unverified`, because that shape is not prose.
|
|
37
|
+
*
|
|
38
|
+
* # Bounded, and never in the reply's way
|
|
39
|
+
*
|
|
40
|
+
* The pass runs AFTER the `chatReply` frame is broadcast (`server.ts`), so a reply is never delayed
|
|
41
|
+
* by verification, and it is bounded twice: at most {@link DEFAULT_MAX_ITEMS} citations and
|
|
42
|
+
* {@link DEFAULT_BUDGET_MS} of wall clock. Whatever the budget did not reach is reported
|
|
43
|
+
* `unchecked` — a state of its own, never silently "verified".
|
|
44
|
+
*
|
|
45
|
+
* The verdicts ride `/ws` as ONE `chatCitations` frame per reply, stamped with the same `turn_id`
|
|
46
|
+
* the reply carries, and the studio marks the reply from it (badge + counter). The text on the wire
|
|
47
|
+
* and in the transcript is the seat's own.
|
|
48
|
+
*/
|
|
49
|
+
/** One read root of a chat's scope: the registered repo root and the name the seats were given. */
|
|
50
|
+
export interface CitationRoot {
|
|
51
|
+
/** Resolved absolute path of the repo root. */
|
|
52
|
+
absRoot: string;
|
|
53
|
+
/** The repo's display name — the prefix the reply's rewritten paths carry (crew#618). */
|
|
54
|
+
name: string;
|
|
55
|
+
}
|
|
56
|
+
/** What class of thing a citation is. */
|
|
57
|
+
export type ChatCitationKind = 'path' | 'line' | 'symbol' | 'sha';
|
|
58
|
+
/**
|
|
59
|
+
* The verdict on one citation.
|
|
60
|
+
* - `verified` — it exists, exactly as cited;
|
|
61
|
+
* - `corrected` — the thing exists, but not where the reply said (the real place is `resolved`);
|
|
62
|
+
* - `unverified` — it does not exist in the chat's scope (the fabricated-SHA case);
|
|
63
|
+
* - `unchecked` — the bounded pass did not reach it. Not a claim either way.
|
|
64
|
+
*/
|
|
65
|
+
export type ChatCitationStatus = 'verified' | 'corrected' | 'unverified' | 'unchecked';
|
|
66
|
+
/** One citation, as verified. `raw` is the token EXACTLY as it appears in the reply. */
|
|
67
|
+
export interface ChatCitationItem {
|
|
68
|
+
raw: string;
|
|
69
|
+
kind: ChatCitationKind;
|
|
70
|
+
status: ChatCitationStatus;
|
|
71
|
+
/** Where the thing actually is, when the status is `corrected` (`routes.ts:2069`, `crew`). */
|
|
72
|
+
resolved?: string;
|
|
73
|
+
/** Why, in one short phrase — the hover text on the studio's badge. */
|
|
74
|
+
note?: string;
|
|
75
|
+
}
|
|
76
|
+
/** The `/ws` frame: one per verified `chatReply`, stamped with the reply's own `turn_id`. */
|
|
77
|
+
export interface ChatCitationsFrame {
|
|
78
|
+
type: 'chatCitations';
|
|
79
|
+
chat: string;
|
|
80
|
+
cliKey: string;
|
|
81
|
+
turn_id?: string;
|
|
82
|
+
/** Counts, so a skin renders the header without walking `items`. */
|
|
83
|
+
verified: number;
|
|
84
|
+
unverifiable: number;
|
|
85
|
+
corrected: number;
|
|
86
|
+
unchecked: number;
|
|
87
|
+
items: ChatCitationItem[];
|
|
88
|
+
project_id?: string;
|
|
89
|
+
}
|
|
90
|
+
/** At most this many citations are checked per reply; the rest are `unchecked`. */
|
|
91
|
+
export declare const DEFAULT_MAX_ITEMS = 80;
|
|
92
|
+
/**
|
|
93
|
+
* Wall-clock budget for one reply's pass, ms. Overrun ⇒ the remainder is `unchecked`.
|
|
94
|
+
*
|
|
95
|
+
* 15 s, not 3: the pass runs entirely off the reply's path (nothing waits on it but the marks
|
|
96
|
+
* appearing a moment later), and the number worth protecting is COVERAGE, not latency. The RC1
|
|
97
|
+
* Phase 6 answer cited 26 SHAs over 9 repos — a fabricated one sweeps every root — and on a loaded
|
|
98
|
+
* desktop a `git cat-file` spawn is not always instant, so a 3 s budget would have reported most of
|
|
99
|
+
* that answer `unchecked`, which reads like the feature is not working. The budget exists so the
|
|
100
|
+
* work is BOUNDED, not so it is fast; it is re-read between citations AND between roots.
|
|
101
|
+
*/
|
|
102
|
+
export declare const DEFAULT_BUDGET_MS = 15000;
|
|
103
|
+
/**
|
|
104
|
+
* The answer to "is this commit in this repo?" — THREE states, not two.
|
|
105
|
+
*
|
|
106
|
+
* `git cat-file -e` exits 1 for an object that is not there and something else (or nothing, on a
|
|
107
|
+
* timeout) when the CHECK failed. Collapsing those into `false` is how a real SHA gets branded
|
|
108
|
+
* UNVERIFIED on a loaded desktop, which is the one failure this feature must not have: a false mark
|
|
109
|
+
* teaches the reader to ignore marks.
|
|
110
|
+
*/
|
|
111
|
+
export type CommitCheck = 'present' | 'absent' | 'error';
|
|
112
|
+
/** The reads the pass needs — injected so the whole thing is testable without a repo or git. */
|
|
113
|
+
export interface ChatCitationDeps {
|
|
114
|
+
/** Does this absolute path exist as a FILE? */
|
|
115
|
+
fileExists(abs: string): boolean;
|
|
116
|
+
/** The file's lines, or `null` when it cannot be read (missing, too big, binary). */
|
|
117
|
+
readLines(abs: string): string[] | null;
|
|
118
|
+
/** Repo-relative paths tracked in the root, or `null` when the listing itself failed. */
|
|
119
|
+
listFiles(absRoot: string): Promise<string[] | null>;
|
|
120
|
+
/** `git cat-file -e <sha>^{commit}` in the root — see {@link CommitCheck}. */
|
|
121
|
+
commitExists(absRoot: string, sha: string): Promise<CommitCheck>;
|
|
122
|
+
now(): number;
|
|
123
|
+
}
|
|
124
|
+
/** A citation as EXTRACTED — before anything was checked. */
|
|
125
|
+
export interface RawCitation {
|
|
126
|
+
raw: string;
|
|
127
|
+
kind: ChatCitationKind;
|
|
128
|
+
/** The path part of a path/line/symbol citation (`crew/src/x.ts`). */
|
|
129
|
+
path?: string;
|
|
130
|
+
/** The first line of a `line` citation. */
|
|
131
|
+
line?: number;
|
|
132
|
+
/** The symbol of a `symbol` citation, or the one the sentence named before a `line` citation. */
|
|
133
|
+
symbol?: string;
|
|
134
|
+
/** The repo a `sha` citation's sentence named, when it named one. */
|
|
135
|
+
repo?: string;
|
|
136
|
+
}
|
|
137
|
+
/** `wicked-crew` is cited as `crew` as often as by its name: every alias a reply may use. */
|
|
138
|
+
export declare function repoAliases(root: CitationRoot): string[];
|
|
139
|
+
/**
|
|
140
|
+
* Every citation in a reply, in text order, deduplicated by (kind, raw).
|
|
141
|
+
*
|
|
142
|
+
* Pure: no filesystem, no git. `roots` is read only for the repo aliases a SHA's sentence may name.
|
|
143
|
+
*/
|
|
144
|
+
export declare function extractCitations(text: string, roots: readonly CitationRoot[]): RawCitation[];
|
|
145
|
+
/** The default deps: the real filesystem and the real git. */
|
|
146
|
+
export declare function chatCitationDeps(): ChatCitationDeps;
|
|
147
|
+
export interface VerifyOptions {
|
|
148
|
+
maxItems?: number;
|
|
149
|
+
budgetMs?: number;
|
|
150
|
+
}
|
|
151
|
+
/** The result of one reply's pass. `items` is in text order; the counts match it. */
|
|
152
|
+
export interface ChatCitationsResult {
|
|
153
|
+
verified: number;
|
|
154
|
+
unverifiable: number;
|
|
155
|
+
corrected: number;
|
|
156
|
+
unchecked: number;
|
|
157
|
+
items: ChatCitationItem[];
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Verify every citation in a reply, bounded. Never throws: a broken root, an unreadable file or a
|
|
161
|
+
* git that is not there is a verdict (`unverified` / `unchecked`), not an error.
|
|
162
|
+
*/
|
|
163
|
+
export declare function verifyCitations(text: string, roots: readonly CitationRoot[], deps?: ChatCitationDeps, opts?: VerifyOptions): Promise<ChatCitationsResult>;
|
|
164
|
+
/**
|
|
165
|
+
* The `/ws` frame for one reply's verdicts, or `null` when there is nothing to say (no citation
|
|
166
|
+
* survived extraction — a chatty reply with no references marks nothing).
|
|
167
|
+
*/
|
|
168
|
+
export declare function citationsFrame(reply: {
|
|
169
|
+
chat: string;
|
|
170
|
+
cliKey: string;
|
|
171
|
+
turn_id?: string;
|
|
172
|
+
project_id?: string;
|
|
173
|
+
}, result: ChatCitationsResult): ChatCitationsFrame | null;
|
|
174
|
+
//# sourceMappingURL=chat-citations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-citations.d.ts","sourceRoot":"","sources":["../../src/api/chat-citations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAOH,mGAAmG;AACnG,MAAM,WAAW,YAAY;IAC3B,+CAA+C;IAC/C,OAAO,EAAE,MA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