@flyingrobots/graft 0.8.0 → 0.10.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 +116 -0
- package/GUIDE.md +8 -3
- package/README.md +134 -100
- package/dist/adapters/colorful-cli-prose-projector.d.ts +13 -0
- package/dist/adapters/colorful-cli-prose-projector.d.ts.map +1 -0
- package/dist/adapters/colorful-cli-prose-projector.js +89 -0
- package/dist/adapters/colorful-cli-prose-projector.js.map +1 -0
- package/dist/adapters/fake-echo-kernel-transport.d.ts +33 -0
- package/dist/adapters/fake-echo-kernel-transport.d.ts.map +1 -0
- package/dist/adapters/fake-echo-kernel-transport.js +208 -0
- package/dist/adapters/fake-echo-kernel-transport.js.map +1 -0
- package/dist/adapters/node-process-runner.d.ts.map +1 -1
- package/dist/adapters/node-process-runner.js +1 -0
- package/dist/adapters/node-process-runner.js.map +1 -1
- package/dist/api/index.d.ts +7 -2
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +14 -3
- package/dist/api/index.js.map +1 -1
- package/dist/cli/structural-blame-render.d.ts.map +1 -1
- package/dist/cli/structural-blame-render.js +4 -1
- package/dist/cli/structural-blame-render.js.map +1 -1
- package/dist/contracts/capabilities.d.ts +2 -2
- package/dist/contracts/capabilities.d.ts.map +1 -1
- package/dist/contracts/capabilities.js +14 -0
- package/dist/contracts/capabilities.js.map +1 -1
- package/dist/contracts/output-schema-cli.d.ts +3 -0
- package/dist/contracts/output-schema-cli.d.ts.map +1 -1
- package/dist/contracts/output-schema-fragments.d.ts +183 -0
- package/dist/contracts/output-schema-fragments.d.ts.map +1 -1
- package/dist/contracts/output-schema-fragments.js +38 -0
- package/dist/contracts/output-schema-fragments.js.map +1 -1
- package/dist/contracts/output-schema-mcp.d.ts +91 -0
- package/dist/contracts/output-schema-mcp.d.ts.map +1 -1
- package/dist/contracts/output-schema-mcp.js +6 -1
- package/dist/contracts/output-schema-mcp.js.map +1 -1
- package/dist/contracts/output-schema-meta.d.ts +1 -1
- package/dist/contracts/output-schema-meta.d.ts.map +1 -1
- package/dist/contracts/output-schemas.d.ts.map +1 -1
- package/dist/contracts/output-schemas.js +43 -0
- package/dist/contracts/output-schemas.js.map +1 -1
- package/dist/echo/canonical-cbor.d.ts +10 -0
- package/dist/echo/canonical-cbor.d.ts.map +1 -0
- package/dist/echo/canonical-cbor.js +213 -0
- package/dist/echo/canonical-cbor.js.map +1 -0
- package/dist/echo/codec-runtime.d.ts +72 -0
- package/dist/echo/codec-runtime.d.ts.map +1 -0
- package/dist/echo/codec-runtime.js +259 -0
- package/dist/echo/codec-runtime.js.map +1 -0
- package/dist/echo/structural-history-client.d.ts +68 -0
- package/dist/echo/structural-history-client.d.ts.map +1 -0
- package/dist/echo/structural-history-client.js +149 -0
- package/dist/echo/structural-history-client.js.map +1 -0
- package/dist/echo/structural-history-envelope-codec.d.ts +46 -0
- package/dist/echo/structural-history-envelope-codec.d.ts.map +1 -0
- package/dist/echo/structural-history-envelope-codec.js +121 -0
- package/dist/echo/structural-history-envelope-codec.js.map +1 -0
- package/dist/echo/structural-reading-adapter.d.ts +13 -0
- package/dist/echo/structural-reading-adapter.d.ts.map +1 -0
- package/dist/echo/structural-reading-adapter.js +120 -0
- package/dist/echo/structural-reading-adapter.js.map +1 -0
- package/dist/echo/structural-reading-generated-model.d.ts +18 -0
- package/dist/echo/structural-reading-generated-model.d.ts.map +1 -0
- package/dist/echo/structural-reading-generated-model.js +324 -0
- package/dist/echo/structural-reading-generated-model.js.map +1 -0
- package/dist/generated/graft-structural-history.codec.generated.d.ts +135 -0
- package/dist/generated/graft-structural-history.codec.generated.d.ts.map +1 -0
- package/dist/generated/graft-structural-history.codec.generated.js +549 -0
- package/dist/generated/graft-structural-history.codec.generated.js.map +1 -0
- package/dist/generated/graft-structural-history.d.ts +331 -0
- package/dist/generated/graft-structural-history.d.ts.map +1 -0
- package/dist/generated/graft-structural-history.js +47 -0
- package/dist/generated/graft-structural-history.js.map +1 -0
- package/dist/mcp/burden.d.ts.map +1 -1
- package/dist/mcp/burden.js +2 -0
- package/dist/mcp/burden.js.map +1 -1
- package/dist/mcp/context.d.ts +5 -1
- package/dist/mcp/context.d.ts.map +1 -1
- package/dist/mcp/context.js +11 -1
- package/dist/mcp/context.js.map +1 -1
- package/dist/mcp/control-plane/types.d.ts +8 -0
- package/dist/mcp/control-plane/types.d.ts.map +1 -1
- package/dist/mcp/daemon-control-plane.d.ts +2 -1
- package/dist/mcp/daemon-control-plane.d.ts.map +1 -1
- package/dist/mcp/daemon-control-plane.js +49 -0
- package/dist/mcp/daemon-control-plane.js.map +1 -1
- package/dist/mcp/repo-tool-worker-context.d.ts.map +1 -1
- package/dist/mcp/repo-tool-worker-context.js +19 -0
- package/dist/mcp/repo-tool-worker-context.js.map +1 -1
- package/dist/mcp/repo-workspace.d.ts +1 -1
- package/dist/mcp/repo-workspace.d.ts.map +1 -1
- package/dist/mcp/repo-workspace.js +5 -0
- package/dist/mcp/repo-workspace.js.map +1 -1
- package/dist/mcp/server-context.d.ts.map +1 -1
- package/dist/mcp/server-context.js +17 -0
- package/dist/mcp/server-context.js.map +1 -1
- package/dist/mcp/server-tool-access.d.ts.map +1 -1
- package/dist/mcp/server-tool-access.js +4 -0
- package/dist/mcp/server-tool-access.js.map +1 -1
- package/dist/mcp/tool-registry.d.ts.map +1 -1
- package/dist/mcp/tool-registry.js +5 -1
- package/dist/mcp/tool-registry.js.map +1 -1
- package/dist/mcp/tools/changed-since.d.ts.map +1 -1
- package/dist/mcp/tools/changed-since.js +24 -10
- package/dist/mcp/tools/changed-since.js.map +1 -1
- package/dist/mcp/tools/dead-symbols.d.ts.map +1 -1
- package/dist/mcp/tools/dead-symbols.js +2 -3
- package/dist/mcp/tools/dead-symbols.js.map +1 -1
- package/dist/mcp/tools/file-outline.d.ts.map +1 -1
- package/dist/mcp/tools/file-outline.js +10 -5
- package/dist/mcp/tools/file-outline.js.map +1 -1
- package/dist/mcp/tools/structural-blame.d.ts.map +1 -1
- package/dist/mcp/tools/structural-blame.js +3 -0
- package/dist/mcp/tools/structural-blame.js.map +1 -1
- package/dist/mcp/tools/structural-review.d.ts.map +1 -1
- package/dist/mcp/tools/structural-review.js +9 -22
- package/dist/mcp/tools/structural-review.js.map +1 -1
- package/dist/mcp/tools/workspace-list-opened.d.ts +3 -0
- package/dist/mcp/tools/workspace-list-opened.d.ts.map +1 -0
- package/dist/mcp/tools/workspace-list-opened.js +10 -0
- package/dist/mcp/tools/workspace-list-opened.js.map +1 -0
- package/dist/mcp/tools/workspace-open.d.ts +3 -0
- package/dist/mcp/tools/workspace-open.d.ts.map +1 -0
- package/dist/mcp/tools/workspace-open.js +34 -0
- package/dist/mcp/tools/workspace-open.js.map +1 -0
- package/dist/mcp/workspace-registry.d.ts +83 -0
- package/dist/mcp/workspace-registry.d.ts.map +1 -0
- package/dist/mcp/workspace-registry.js +542 -0
- package/dist/mcp/workspace-registry.js.map +1 -0
- package/dist/mcp/workspace-router-model.d.ts +27 -0
- package/dist/mcp/workspace-router-model.d.ts.map +1 -1
- package/dist/mcp/workspace-router-model.js.map +1 -1
- package/dist/mcp/workspace-router.d.ts +9 -2
- package/dist/mcp/workspace-router.d.ts.map +1 -1
- package/dist/mcp/workspace-router.js +145 -1
- package/dist/mcp/workspace-router.js.map +1 -1
- package/dist/operations/colorful-prose-projection.d.ts +32 -0
- package/dist/operations/colorful-prose-projection.d.ts.map +1 -0
- package/dist/operations/colorful-prose-projection.js +344 -0
- package/dist/operations/colorful-prose-projection.js.map +1 -0
- package/dist/operations/file-outline.d.ts +10 -0
- package/dist/operations/file-outline.d.ts.map +1 -1
- package/dist/operations/file-outline.js +29 -3
- package/dist/operations/file-outline.js.map +1 -1
- package/dist/operations/repo-workspace.d.ts +4 -0
- package/dist/operations/repo-workspace.d.ts.map +1 -1
- package/dist/operations/repo-workspace.js +57 -21
- package/dist/operations/repo-workspace.js.map +1 -1
- package/dist/operations/safe-read.d.ts +2 -0
- package/dist/operations/safe-read.d.ts.map +1 -1
- package/dist/operations/safe-read.js +20 -0
- package/dist/operations/safe-read.js.map +1 -1
- package/dist/operations/structured-buffer-model.d.ts +19 -15
- package/dist/operations/structured-buffer-model.d.ts.map +1 -1
- package/dist/operations/structured-buffer-model.js +6 -4
- package/dist/operations/structured-buffer-model.js.map +1 -1
- package/dist/operations/structured-buffer-query.d.ts.map +1 -1
- package/dist/operations/structured-buffer-query.js +64 -1
- package/dist/operations/structured-buffer-query.js.map +1 -1
- package/dist/operations/structured-buffer.d.ts +3 -1
- package/dist/operations/structured-buffer.d.ts.map +1 -1
- package/dist/operations/structured-buffer.js.map +1 -1
- package/dist/parser/types.d.ts +1 -1
- package/dist/parser/types.d.ts.map +1 -1
- package/dist/parser/types.js.map +1 -1
- package/dist/ports/echo-kernel-transport.d.ts +12 -0
- package/dist/ports/echo-kernel-transport.d.ts.map +1 -0
- package/dist/ports/echo-kernel-transport.js +13 -0
- package/dist/ports/echo-kernel-transport.js.map +1 -0
- package/dist/ports/process-runner.d.ts +1 -0
- package/dist/ports/process-runner.d.ts.map +1 -1
- package/dist/ports/structural-history.d.ts +23 -0
- package/dist/ports/structural-history.d.ts.map +1 -0
- package/dist/ports/structural-history.js +22 -0
- package/dist/ports/structural-history.js.map +1 -0
- package/dist/ports/structural-reading.d.ts +100 -0
- package/dist/ports/structural-reading.d.ts.map +1 -0
- package/dist/ports/structural-reading.js +41 -0
- package/dist/ports/structural-reading.js.map +1 -0
- package/dist/warp/structural-reading-adapter.d.ts +28 -0
- package/dist/warp/structural-reading-adapter.d.ts.map +1 -0
- package/dist/warp/structural-reading-adapter.js +98 -0
- package/dist/warp/structural-reading-adapter.js.map +1 -0
- package/docs/CLI.md +4 -4
- package/docs/MCP.md +10 -5
- package/docs/SETUP.md +12 -6
- package/package.json +13 -6
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,122 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.10.0] - 2026-06-24
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Colorful prose projection seam**: buffer-native projections can now opt into
|
|
15
|
+
a `ProseProjectionProvider`, and Graft exports a Colorful CLI adapter for
|
|
16
|
+
hosts that want `.txt` buffers projected through `colorful ir -` from
|
|
17
|
+
`colorful >= 0.2.1`. The projector validates `colorful.syntax/v1`, the pinned
|
|
18
|
+
vocabulary hash, the source content hash, and UTF-8 byte ranges before
|
|
19
|
+
returning normal Graft syntax spans, paragraph/sentence outlines, and jump
|
|
20
|
+
tables. MCP `file_outline` and large-file `safe_read` calls now use that
|
|
21
|
+
adapter when `colorful >= 0.2.1` is available on `PATH`, while unsupported
|
|
22
|
+
`.txt` behavior remains unchanged when no projector is configured or the CLI
|
|
23
|
+
is unavailable.
|
|
24
|
+
- **Structural basis kind for unpinned committed history**: structural-history
|
|
25
|
+
schema v0.2 adds `UNPINNED_COMMITTED` so committed git-warp readings with no
|
|
26
|
+
`ref` and no `head` no longer masquerade as `GIT_REF` rows with a null
|
|
27
|
+
`refName`. Wesley-generated declarations, LE-binary codecs, manifest hashes,
|
|
28
|
+
the Echo package descriptor, and generated-model parity tests now pin that
|
|
29
|
+
`GIT_REF` means a named ref basis.
|
|
30
|
+
- **Generated-model parity for structural readings** (slice 4, last
|
|
31
|
+
Graft-only pre-Echo slice): `src/echo/structural-reading-generated-model.ts`
|
|
32
|
+
maps git-warp-backed `StructuralReadingResult` values onto the
|
|
33
|
+
Wesley-generated `StructuralReading`/`StructuralReadingEvidence`/
|
|
34
|
+
`StructuralBasis` triple and back, loss-free. Ids and payload digests are
|
|
35
|
+
sha256 over canonical JSON (deterministic, no clock, no randomness); the
|
|
36
|
+
mapping refuses to emit `ECHO_NATIVE` from translated substrates with a
|
|
37
|
+
typed error naming the `fallback_translated_is_not_native_continuum`
|
|
38
|
+
invariant, and the reverse path raises typed obstructions for
|
|
39
|
+
generated-only enum values, digest mismatches, and mismatched pairs.
|
|
40
|
+
Parity fixtures prove `graft_dead_symbols` and the `graft_review`
|
|
41
|
+
reference-count path produce deep-equal output through the
|
|
42
|
+
generated-model round-trip. Public behavior is unchanged.
|
|
43
|
+
|
|
44
|
+
### Changed
|
|
45
|
+
|
|
46
|
+
- **Release security floor**: release packaging now resolves Vite and Hono to
|
|
47
|
+
patched versions required by the release security gate.
|
|
48
|
+
- **Graft-managed workspace registry hardening**: workspace observation now
|
|
49
|
+
serializes first-time installation ID creation, fails closed when managed
|
|
50
|
+
storage cannot be made private, rejects symlinked or unsafe registry storage
|
|
51
|
+
records before reading them, quarantines unsupported registry metadata instead
|
|
52
|
+
of reusing it, rejects malformed installation IDs, recovers stale first-time
|
|
53
|
+
installation locks, caps remote collection during daemon authorization, strips
|
|
54
|
+
userinfo from scp-like and malformed URL-style remote URLs, preserves spaces
|
|
55
|
+
in daemon-collected remote paths, serializes concurrent first workspace
|
|
56
|
+
observation, and only lets observations without explicit repository evidence
|
|
57
|
+
reuse unknown incarnations that have no durable cache or history attachments.
|
|
58
|
+
Strong same-path replacement evidence now quarantines the prior incarnation
|
|
59
|
+
directory before advancing the workspace pointer.
|
|
60
|
+
- **Workspace-store contract taxonomy**: Slice 0 conformance failure codes are
|
|
61
|
+
now all included in the frozen `errorTaxonomy`, and the contract test rejects
|
|
62
|
+
covered conformance rows whose failure codes are absent from that taxonomy.
|
|
63
|
+
|
|
64
|
+
## [0.9.0] - 2026-06-10
|
|
65
|
+
|
|
66
|
+
### Added
|
|
67
|
+
|
|
68
|
+
- **Fake Echo-shaped TypeScript witness**: Graft proves its Echo-facing seam
|
|
69
|
+
before any real Echo runtime exists. The canonical schema gains its first
|
|
70
|
+
Intent (`recordGitWarpImportBatch`), Wesley 0.0.5 emits LE-binary var
|
|
71
|
+
codecs (`src/generated/graft-structural-history.codec.generated.ts`), and
|
|
72
|
+
a new app-safe stack — `EchoKernelTransport` byte seam, EINT v1 +
|
|
73
|
+
canonical-CBOR envelope codec, typed structural-history client, and an
|
|
74
|
+
Echo-backed `StructuralReadingPort` adapter mapping Echo's
|
|
75
|
+
`ContractObstructionKind` taxonomy into Graft freshness/residual posture —
|
|
76
|
+
is exercised end to end by a deterministic fake transport. The fake
|
|
77
|
+
mirrors Echo's wire-level authority enforcement (`FORBIDDEN_CONTROL_INTENT`
|
|
78
|
+
for the reserved control op id), and guard tests keep the Echo adapter out
|
|
79
|
+
of production contexts. No public surface changes.
|
|
80
|
+
- **Structural-history Echo package descriptor**: Graft now carries a
|
|
81
|
+
deterministic descriptor for the structural-history package it expects Echo
|
|
82
|
+
to host later, with repo-root-relative schema and generated-artifact
|
|
83
|
+
identities, descriptor-only Echo posture, and a local drift check wired into
|
|
84
|
+
`pnpm schema:structural-history:check`.
|
|
85
|
+
- **Structural history schema authority**: Graft now carries a canonical
|
|
86
|
+
`schemas/graft-structural-history.graphql` schema with Wesley-generated
|
|
87
|
+
TypeScript contracts and a deterministic artifact drift check, establishing
|
|
88
|
+
the schema-first Echo migration boundary without changing Echo or Wesley.
|
|
89
|
+
- **Structural source span invariants**: The canonical structural-history schema
|
|
90
|
+
now rejects source spans whose end offsets or present end lines precede their
|
|
91
|
+
starts.
|
|
92
|
+
- **Opened workspace paths**: MCP sessions can now call `workspace_open` to
|
|
93
|
+
open another git worktree path, activate it by default, and inspect opened
|
|
94
|
+
paths through `workspace_list_opened` without adding per-tool `cwd` routing.
|
|
95
|
+
- **Symbol history locations**: `graft_blame` and `graft symbol history`
|
|
96
|
+
now carry per-version path and available line-range facts from WARP symbol
|
|
97
|
+
timelines without adding a second `code_show` history response shape.
|
|
98
|
+
|
|
99
|
+
### Changed
|
|
100
|
+
|
|
101
|
+
- **Structural history generation gate**: `pnpm schema:structural-history:check`
|
|
102
|
+
now requires a configured Wesley CLI, verifies the pinned CLI version and L1
|
|
103
|
+
registry hash, regenerates the TypeScript artifact from GraphQL, and
|
|
104
|
+
byte-compares it with the committed generated file. CI and release workflows
|
|
105
|
+
install Wesley from a pinned release commit before running the check, and
|
|
106
|
+
`pnpm release:check` includes the same gate.
|
|
107
|
+
- **Structural reading boundary**: `graft_review` impact counts and
|
|
108
|
+
`graft_dead_symbols` now read through a Graft-owned
|
|
109
|
+
`StructuralReadingPort` with explicit `echo-native`,
|
|
110
|
+
`git-warp-imported`, and `fallback-translated` evidence labels, preserving
|
|
111
|
+
existing public response shapes while preventing current git-warp readings
|
|
112
|
+
from masquerading as Echo-native witnesshood.
|
|
113
|
+
|
|
114
|
+
### Fixed
|
|
115
|
+
|
|
116
|
+
- **Structural reading residual posture**: Reference-count readings now
|
|
117
|
+
report a partial residual posture when committed import-scan fallback
|
|
118
|
+
evidence is unavailable after a zero-count WARP graph reading.
|
|
119
|
+
|
|
120
|
+
### Security
|
|
121
|
+
|
|
122
|
+
- **Dependency audit posture**: Patched audited transitive dependencies through
|
|
123
|
+
pnpm overrides for `brace-expansion` and `qs`, preserving a clean release
|
|
124
|
+
security gate.
|
|
125
|
+
|
|
10
126
|
## [0.8.0] - 2026-05-13
|
|
11
127
|
|
|
12
128
|
### Added
|
package/GUIDE.md
CHANGED
|
@@ -18,7 +18,7 @@ Manually enforce policies or inspect structural history from your terminal.
|
|
|
18
18
|
### 3. Shared Daemon Mode
|
|
19
19
|
Run the central execution authority for multi-repo work and persistent monitors.
|
|
20
20
|
- **Run**: `npx @flyingrobots/graft daemon`
|
|
21
|
-
- **Read**: [docs/SETUP.md](./docs/SETUP.md) (Daemon bootstrap and `
|
|
21
|
+
- **Read**: [docs/SETUP.md](./docs/SETUP.md) (Daemon bootstrap and `workspace_open`)
|
|
22
22
|
- **Read**: [Architecture](./ARCHITECTURE.md) (Daemon section)
|
|
23
23
|
|
|
24
24
|
## Big Picture: System Orchestration
|
|
@@ -33,9 +33,9 @@ Graft is a tiered governor. It manages the context burden across three layers:
|
|
|
33
33
|
|
|
34
34
|
- [ ] **I am setting up a new project**: Start with `README.md` Quick Start.
|
|
35
35
|
- [ ] **I am configuring Claude Code**: Use `npx graft init --write-claude-hooks`.
|
|
36
|
-
- [ ] **I am using daemon mode in a generic MCP client**: Read [docs/SETUP.md](./docs/SETUP.md) and expect
|
|
36
|
+
- [ ] **I am using daemon mode in a generic MCP client**: Read [docs/SETUP.md](./docs/SETUP.md) and expect `workspace_open` as the normal agent-facing path.
|
|
37
37
|
- [ ] **I am debugging a structural diff**: Use `npx graft struct diff --json`.
|
|
38
|
-
- [ ] **I am contributing to Graft**: Read `METHOD.md
|
|
38
|
+
- [ ] **I am contributing to Graft**: Read `CONTRIBUTING.md`, `METHOD.md`, and [docs/github-issues-mirroring.md](./docs/github-issues-mirroring.md).
|
|
39
39
|
|
|
40
40
|
## Rule of Thumb
|
|
41
41
|
|
|
@@ -49,5 +49,10 @@ If you need to know "what's true right now," use [docs/BEARING.md](./docs/BEARIN
|
|
|
49
49
|
|
|
50
50
|
If you are just starting, use the [README.md](./README.md) and the setup instructions in [docs/SETUP.md](./docs/SETUP.md).
|
|
51
51
|
|
|
52
|
+
If you are reporting a bug or feature idea as a newcomer, use
|
|
53
|
+
[GitHub Issues](https://github.com/flyingrobots/graft/issues). Issues are
|
|
54
|
+
the public discovery surface; execution details stay in Method backlog and
|
|
55
|
+
design packets.
|
|
56
|
+
|
|
52
57
|
---
|
|
53
58
|
**The goal is inevitably. Every feature is defined by its tests.**
|
package/README.md
CHANGED
|
@@ -2,117 +2,141 @@
|
|
|
2
2
|
|
|
3
3
|
A context governor for coding agents. Graft enforces read policy so agents consume the smallest structurally correct view of a codebase instead of dumping raw files into their context window.
|
|
4
4
|
|
|
5
|
-
Graft is designed for the operator who demands precision and the architect who needs a stable foundation for agentic work. It scales from simple policy-aware reads to high-fidelity causal provenance tracking across multi-session worktrees. Parser-backed structural views currently cover JavaScript, TypeScript, Rust, GraphQL, Python, Go, JSON, TOML, YAML, and Markdown.
|
|
6
|
-
|
|
7
5
|
[](https://www.npmjs.com/package/@flyingrobots/graft)
|
|
8
6
|
|
|
9
7
|

|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Unlike simple file-scraping tools, Graft treats the repository as a layered worldline of code structure and causal activity.
|
|
14
|
-
|
|
15
|
-
- **Policy-Enforced Reads**: Automatically degrades large files to structural outlines and jump tables. Refuses binaries, secrets, and lockfiles with machine-readable reasons.
|
|
16
|
-
- **Machine-Readable Contracts**: Responses carry versioned `_schema` metadata and decision receipts so agents can reason about outcomes without scraping prose.
|
|
17
|
-
- **Structural Memory**: Uses WARP (Structural Worldline Memory) to track AST evolution across Git commits. Query what changed structurally without reading a single byte of source code.
|
|
18
|
-
- **Causal Provenance**: Tracks the *why* behind structural changes by logging read, stage, and transition activity into strand-scoped causal workspaces.
|
|
19
|
-
- **Industrial-Grade Daemon**: A same-user local runtime that manages multi-repo authorization, background indexing, and shared-machine worker pools.
|
|
9
|
+
---
|
|
20
10
|
|
|
21
|
-
##
|
|
11
|
+
## TL;DR — Up and Running in 30 Seconds
|
|
22
12
|
|
|
23
|
-
Graft
|
|
13
|
+
**What it is**: Graft sits between your AI coding agent and the filesystem. Instead of dumping entire files into the context window, it returns the minimum structurally correct view — full content for small files, AST-derived outlines for large ones, hard refusals for secrets and binaries. Tool responses carry receipts so agents know exactly how much context they've consumed.
|
|
24
14
|
|
|
25
|
-
|
|
26
|
-
- **CLI** for operator and debugging workflows
|
|
27
|
-
- **MCP** for agent transport integration
|
|
15
|
+
**Why you want it**: Agents that read files naively fill their context window with lockfiles, minified output, and 2,000-line modules they only needed 10 lines of. Graft fixes that automatically.
|
|
28
16
|
|
|
29
|
-
### 1. Bootstrap a Repo
|
|
30
|
-
Scaffold `.graftignore`, setup git hooks, and seed agent instructions.
|
|
31
17
|
```bash
|
|
18
|
+
# Install and bootstrap your repo
|
|
32
19
|
npx @flyingrobots/graft init --write-claude-hooks --write-codex-mcp
|
|
33
|
-
```
|
|
34
20
|
|
|
35
|
-
|
|
36
|
-
This is the simplest per-repo path for most clients. The current
|
|
37
|
-
checkout is the authority, and there is no separate workspace binding
|
|
38
|
-
step.
|
|
39
|
-
```bash
|
|
21
|
+
# Start serving (MCP over stdio — point your agent at this)
|
|
40
22
|
npx @flyingrobots/graft serve
|
|
23
|
+
|
|
24
|
+
# Or try a governed read from the CLI right now
|
|
25
|
+
npx @flyingrobots/graft read safe src/app.ts
|
|
41
26
|
```
|
|
42
27
|
|
|
43
|
-
|
|
44
|
-
|
|
28
|
+
That's it. `init` scaffolds `.graftignore`, appends agent read guidance, and writes the client config requested by the flags you pass. `serve` starts listening on stdio. Your agent calls `safe_read` instead of reading files directly, and Graft handles the rest.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## The Problem
|
|
33
|
+
|
|
34
|
+
AI coding agents read files the same way a first-year developer does: grab the whole thing, every time. A 2,000-line module goes straight into the context window. So does the lockfile. So does the compiled output. So does the `.env`.
|
|
35
|
+
|
|
36
|
+
Context windows are finite. Once they fill up, the agent starts forgetting what it already read. Performance degrades. Hallucinations increase. You burn tokens on noise.
|
|
37
|
+
|
|
38
|
+
Graft sits between the agent and the filesystem and enforces a simple rule: **return the minimum structurally correct view**.
|
|
39
|
+
|
|
40
|
+
- Small file? Full content.
|
|
41
|
+
- Large file? A structural outline — function names, signatures, line ranges. The agent can drill in with a range read if it needs a specific function body.
|
|
42
|
+
- Binary, secret, or lockfile? Hard refusal with a machine-readable reason code and a suggested alternative.
|
|
43
|
+
|
|
44
|
+
Tool responses carry receipts: bytes consumed, bytes avoided, session depth, policy decision. Agents can self-regulate. Operators can audit.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Why Graft?
|
|
49
|
+
|
|
50
|
+
- **Parser-backed outlines.** Outlines come from Tree-Sitter ASTs, not heuristic line-scanning. Function signatures, class hierarchies, and jump tables are structurally accurate across JavaScript, TypeScript, Rust, Python, Go, GraphQL, JSON, TOML, YAML, Markdown, and more.
|
|
51
|
+
|
|
52
|
+
- **Machine-readable contracts.** Tool responses carry versioned `_schema` metadata and decision receipts. Agents reason about outcomes without scraping prose. Receipts accumulate cumulative session stats so agents know when they're burning budget.
|
|
53
|
+
|
|
54
|
+
- **Structural memory across Git history.** WARP (Structural Worldline Memory) is the current git-warp-backed structural history layer. Query what changed structurally — which symbols were added, removed, or renamed — without dumping source into the agent context. Graft is converging on a `StructuralReadingPort` boundary so Echo can become the primary causal-history substrate after parity is proven.
|
|
55
|
+
|
|
56
|
+
- **Session governance.** The `GovernorTracker` watches for anti-patterns: runaway tool loops, late-session large reads, edit/bash thrash. Tripwire signals surface in receipts so agents and operators can act before context is exhausted.
|
|
57
|
+
|
|
58
|
+
- **Industrial-grade daemon.** A same-user local runtime manages multi-repo authorization, persistent monitors, and shared worker pools. Current git-warp contexts stay warm in memory across sessions, while the public contract is moving behind substrate-neutral structural-history ports.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Three Official Entry Points
|
|
63
|
+
|
|
64
|
+
Graft exposes capabilities through three official product entry points: CLI, MCP, and API. MCP has two runtimes: repo-local stdio for a single checkout and daemon-backed stdio for multi-repo sessions.
|
|
65
|
+
|
|
66
|
+
### 1. CLI — Operator and Debugging Workflows
|
|
67
|
+
|
|
45
68
|
```bash
|
|
46
69
|
npx @flyingrobots/graft read safe src/app.ts
|
|
47
|
-
npx @flyingrobots/graft review --base HEAD~1
|
|
48
|
-
npx @flyingrobots/graft review cooldown --pr 48
|
|
49
70
|
npx @flyingrobots/graft struct since HEAD~3
|
|
50
71
|
npx @flyingrobots/graft struct dead-symbols --limit 20
|
|
51
72
|
npx @flyingrobots/graft symbol history createUser --path src/users.ts
|
|
73
|
+
npx @flyingrobots/graft review --base HEAD~1
|
|
74
|
+
npx @flyingrobots/graft review cooldown --pr 48
|
|
52
75
|
```
|
|
53
76
|
|
|
54
|
-
|
|
55
|
-
Embed Graft in-process when you want direct access without MCP transport
|
|
56
|
-
or CLI process orchestration.
|
|
57
|
-
```ts
|
|
58
|
-
import { createRepoLocalGraft, callGraftTool } from "@flyingrobots/graft";
|
|
77
|
+
Stateless. Print and exit. Good for scripting, spot-checking policy decisions, and inspecting structural history.
|
|
59
78
|
|
|
60
|
-
|
|
61
|
-
|
|
79
|
+
### 2. MCP — Agent Sessions
|
|
80
|
+
|
|
81
|
+
#### Repo-Local Stdio
|
|
82
|
+
|
|
83
|
+
The simplest path for single-repo agent work. The current checkout is the authority. No workspace binding required.
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
npx @flyingrobots/graft serve
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Point your MCP client at this process. Graft speaks JSON-RPC over stdin/stdout. The same binary auto-detects non-TTY stdio and enters serve mode automatically — so `npx @flyingrobots/graft` with no arguments works as an MCP server when piped.
|
|
90
|
+
|
|
91
|
+
#### Daemon-Backed Stdio
|
|
92
|
+
|
|
93
|
+
A persistent same-user runtime for long-running or multi-repo agent work. Current git-warp contexts stay warm between sessions and persistent monitors can keep structural history current.
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Start the daemon explicitly
|
|
97
|
+
npx @flyingrobots/graft daemon
|
|
98
|
+
|
|
99
|
+
# Or let the stdio bridge auto-start/connect to the daemon
|
|
100
|
+
npx @flyingrobots/graft serve --runtime daemon
|
|
62
101
|
```
|
|
63
102
|
|
|
64
|
-
|
|
65
|
-
|
|
103
|
+
Daemon sessions start unbound. The normal agent flow is:
|
|
104
|
+
|
|
105
|
+
1. `workspace_open` with the target repo's `cwd`; in daemon mode this authorizes the workspace before opening it.
|
|
106
|
+
2. Optionally `workspace_list_opened` to inspect active workspaces
|
|
107
|
+
3. Use repository-scoped tools: `safe_read`, `file_outline`, `graft_diff`, etc.
|
|
66
108
|
|
|
67
|
-
|
|
68
|
-
|
|
109
|
+
For explicit control-plane posture, use `workspace_authorize` followed by `workspace_bind`.
|
|
110
|
+
|
|
111
|
+
See [docs/SETUP.md](./docs/SETUP.md) for client-specific bootstrap and daemon control-plane configuration.
|
|
112
|
+
|
|
113
|
+
### 3. API — In-Process Integration
|
|
114
|
+
|
|
115
|
+
Embed Graft directly when you want structural reads or syntax data without spawning a subprocess or going through MCP transport.
|
|
116
|
+
|
|
117
|
+
**Governed repo reads** (same policy enforcement as MCP, no receipts):
|
|
69
118
|
```ts
|
|
70
119
|
import { createRepoWorkspace } from "@flyingrobots/graft";
|
|
71
120
|
|
|
72
121
|
const workspace = await createRepoWorkspace({ cwd: process.cwd() });
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
const outline = await workspace.fileOutline({ path: "src/app.ts" });
|
|
122
|
+
const result = await workspace.safeRead({ path: "src/app.ts" });
|
|
123
|
+
// result.projection: "content" | "outline" | "refused" | "cache_hit" | "diff"
|
|
76
124
|
```
|
|
77
125
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
126
|
+
**In-process tool calls with receipts** (full MCP behavior, no subprocess):
|
|
127
|
+
```ts
|
|
128
|
+
import { createRepoLocalGraft, callGraftTool } from "@flyingrobots/graft";
|
|
129
|
+
|
|
130
|
+
const graft = createRepoLocalGraft({ cwd: process.cwd() });
|
|
131
|
+
const outline = await callGraftTool(graft, "file_outline", { path: "src/app.ts" });
|
|
132
|
+
```
|
|
81
133
|
|
|
82
|
-
|
|
134
|
+
**Editor-native syntax highlighting** (Tree-Sitter WASM, no I/O, viewport-aware):
|
|
83
135
|
```ts
|
|
84
|
-
import {
|
|
85
|
-
createProjectionBundle,
|
|
86
|
-
createStructuredBuffer,
|
|
87
|
-
ensureParserReady,
|
|
88
|
-
} from "@flyingrobots/graft";
|
|
136
|
+
import { createProjectionBundle, ensureParserReady } from "@flyingrobots/graft";
|
|
89
137
|
|
|
90
138
|
await ensureParserReady();
|
|
91
139
|
|
|
92
|
-
const buffer = createStructuredBuffer("src/app.tsx", liveEditorText, {
|
|
93
|
-
basis: { kind: "editor_head", headId: "head-42", tick: 17 },
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
try {
|
|
97
|
-
const spans = buffer.syntaxSpans({
|
|
98
|
-
viewport: {
|
|
99
|
-
start: { row: 0, column: 0 },
|
|
100
|
-
end: { row: 80, column: 0 },
|
|
101
|
-
},
|
|
102
|
-
});
|
|
103
|
-
const context = buffer.nodeAt({ row: 24, column: 12 });
|
|
104
|
-
const rename = buffer.renamePreview({
|
|
105
|
-
position: { row: 24, column: 12 },
|
|
106
|
-
nextName: "nextValue",
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
// Every warm result now carries the basis it was derived from.
|
|
110
|
-
console.log(spans.basis, context.kind, rename.edits.length);
|
|
111
|
-
} finally {
|
|
112
|
-
buffer.dispose();
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// createProjectionBundle owns the temporary StructuredBuffer lifecycle.
|
|
116
140
|
const bundle = createProjectionBundle("src/app.tsx", liveEditorText, {
|
|
117
141
|
basis: { kind: "editor_head", headId: "head-42", tick: 17 },
|
|
118
142
|
viewport: {
|
|
@@ -120,41 +144,51 @@ const bundle = createProjectionBundle("src/app.tsx", liveEditorText, {
|
|
|
120
144
|
end: { row: 80, column: 0 },
|
|
121
145
|
},
|
|
122
146
|
});
|
|
123
|
-
|
|
124
|
-
console.log(bundle.parseStatus.status);
|
|
147
|
+
// bundle.syntax.spans — highlight ranges for the visible viewport only
|
|
125
148
|
```
|
|
126
149
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
150
|
+
`createProjectionBundle` owns the WASM buffer lifecycle internally. Use `createStructuredBuffer` directly if you need to hold a buffer across multiple operations and manage `dispose()` yourself.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Quick Start
|
|
155
|
+
|
|
130
156
|
```bash
|
|
131
|
-
|
|
157
|
+
# 1. Bootstrap the repo: scaffold .graftignore, seed agent instructions
|
|
158
|
+
npx @flyingrobots/graft init --write-claude-hooks --write-codex-mcp
|
|
159
|
+
|
|
160
|
+
# 2. Start serving (repo-local stdio MCP)
|
|
161
|
+
npx @flyingrobots/graft serve
|
|
132
162
|
```
|
|
133
163
|
|
|
134
|
-
|
|
135
|
-
daemon instead of repo-local stdio, the first repo-scoped flow is:
|
|
164
|
+
## Contributing with public visibility
|
|
136
165
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
166
|
+
For bugs, capability requests, and ideas, start at
|
|
167
|
+
[GitHub Issues](https://github.com/flyingrobots/graft/issues).
|
|
168
|
+
That queue is the public view for priorities and discussion. Internal execution and design rigor still lives in
|
|
169
|
+
`docs/method/backlog/` and `docs/design/` so details remain deterministic for contributors.
|
|
140
170
|
|
|
141
|
-
|
|
142
|
-
daemon control-plane posture.
|
|
171
|
+
---
|
|
143
172
|
|
|
144
173
|
## Documentation
|
|
145
174
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
175
|
+
| Document | What it covers |
|
|
176
|
+
|----------|---------------|
|
|
177
|
+
| [Technical Teardown](./docs/TECHNICAL_TEARDOWN.md) | Zero-to-hero deep dive: entry points, golden paths, data schemas, policy engine, WARP, session governance, trade-offs |
|
|
178
|
+
| [Guide](./GUIDE.md) | Orientation, the fast path, and agent bootstrap |
|
|
179
|
+
| [Setup Guide](./docs/SETUP.md) | Client-specific MCP setup, daemon posture, and workspace binding |
|
|
180
|
+
| [Advanced Guide](./ADVANCED_GUIDE.md) | Pipeline internals, worldlines, and daemon mechanics |
|
|
181
|
+
| [Architecture](./ARCHITECTURE.md) | Authoritative structural reference: Ports, Adapters, WARP |
|
|
182
|
+
| [Public API Contract](./docs/public-api.md) | Semver-public root import surface and stability policy |
|
|
183
|
+
| [Three-Surface Capability Matrix](./docs/three-surface-capability-matrix.md) | API / CLI / MCP feature baseline and peer posture |
|
|
184
|
+
| [Repo Topology](./docs/repo-topology.md) | Where API, CLI, MCP, and core live in the source tree |
|
|
185
|
+
| [Security Model](./docs/strategy/security-model.md) | Same-user daemon trust boundaries, authz, and observability |
|
|
186
|
+
| [Causal Provenance](./docs/strategy/causal-provenance.md) | Transport sessions, causal workspaces, strands, and handoff truth |
|
|
187
|
+
| [North Star](./NORTHSTAR.md) | Long-term stack position and Continuum-shaped direction |
|
|
188
|
+
| [Vision](./docs/VISION.md) | Core tenets and the provenance-aware mission |
|
|
189
|
+
| [Method](./METHOD.md) | Repo work doctrine and the cycle loop |
|
|
190
|
+
| [Issue visibility and backlog mapping](./docs/github-issues-mirroring.md) | Public issue triage plus internal backlog synchronization |
|
|
158
191
|
|
|
159
192
|
---
|
|
193
|
+
|
|
160
194
|
Built with precision by [FLYING ROBOTS](https://github.com/flyingrobots)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ProcessRunner } from "../ports/process-runner.js";
|
|
2
|
+
import type { ProseProjectionProvider } from "../operations/colorful-prose-projection.js";
|
|
3
|
+
export declare const COLORFUL_CLI_MINIMUM_VERSION = "0.2.1";
|
|
4
|
+
export interface CreateColorfulCliProseProjectorOptions {
|
|
5
|
+
readonly processRunner: ProcessRunner;
|
|
6
|
+
readonly cwd: string;
|
|
7
|
+
readonly command?: string | undefined;
|
|
8
|
+
readonly includeMarkdown?: boolean | undefined;
|
|
9
|
+
readonly timeoutMs?: number | undefined;
|
|
10
|
+
readonly maxBufferBytes?: number | undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare function createColorfulCliProseProjector(options: CreateColorfulCliProseProjectorOptions): ProseProjectionProvider;
|
|
13
|
+
//# sourceMappingURL=colorful-cli-prose-projector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorful-cli-prose-projector.d.ts","sourceRoot":"","sources":["../../src/adapters/colorful-cli-prose-projector.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAKhE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AAE1F,eAAO,MAAM,4BAA4B,UAAU,CAAC;AAEpD,MAAM,WAAW,sCAAsC;IACrD,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9C;AA4BD,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,sCAAsC,GAC9C,uBAAuB,CAgEzB"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { isColorfulProsePath, projectColorfulIr, } from "../operations/colorful-prose-projection.js";
|
|
3
|
+
export const COLORFUL_CLI_MINIMUM_VERSION = "0.2.1";
|
|
4
|
+
function sha256ContentHash(source) {
|
|
5
|
+
return `sha256:${createHash("sha256").update(source).digest("hex")}`;
|
|
6
|
+
}
|
|
7
|
+
function parseSemver(value) {
|
|
8
|
+
const match = /\b(\d+)\.(\d+)\.(\d+)(?:[-+][0-9A-Za-z.-]+)?\b/u.exec(value);
|
|
9
|
+
if (match === null) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
return [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
13
|
+
}
|
|
14
|
+
function versionAtLeast(actual, minimum) {
|
|
15
|
+
for (let index = 0; index < minimum.length; index += 1) {
|
|
16
|
+
const actualPart = actual[index] ?? 0;
|
|
17
|
+
const minimumPart = minimum[index] ?? 0;
|
|
18
|
+
if (actualPart > minimumPart) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
if (actualPart < minimumPart) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
export function createColorfulCliProseProjector(options) {
|
|
28
|
+
const command = options.command ?? "colorful";
|
|
29
|
+
const timeoutMs = options.timeoutMs ?? 5_000;
|
|
30
|
+
const maxBufferBytes = options.maxBufferBytes ?? 8 * 1024 * 1024;
|
|
31
|
+
const minimumVersion = parseSemver(COLORFUL_CLI_MINIMUM_VERSION);
|
|
32
|
+
let versionSupported;
|
|
33
|
+
const supportsMinimumVersion = () => {
|
|
34
|
+
if (versionSupported !== undefined) {
|
|
35
|
+
return versionSupported;
|
|
36
|
+
}
|
|
37
|
+
const result = options.processRunner.run({
|
|
38
|
+
command,
|
|
39
|
+
args: ["--version"],
|
|
40
|
+
cwd: options.cwd,
|
|
41
|
+
timeoutMs,
|
|
42
|
+
maxBufferBytes: Math.min(maxBufferBytes, 64 * 1024),
|
|
43
|
+
});
|
|
44
|
+
if (result.error !== undefined || result.status !== 0 || minimumVersion === null) {
|
|
45
|
+
versionSupported = false;
|
|
46
|
+
return versionSupported;
|
|
47
|
+
}
|
|
48
|
+
const actualVersion = parseSemver(`${result.stdout}\n${result.stderr}`);
|
|
49
|
+
versionSupported = actualVersion !== null && versionAtLeast(actualVersion, minimumVersion);
|
|
50
|
+
return versionSupported;
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
project(input) {
|
|
54
|
+
if (!isColorfulProsePath(input.path, { includeMarkdown: options.includeMarkdown })) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
if (!supportsMinimumVersion()) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
const source = Buffer.from(input.content, "utf8");
|
|
61
|
+
const result = options.processRunner.run({
|
|
62
|
+
command,
|
|
63
|
+
args: ["ir", "-"],
|
|
64
|
+
cwd: options.cwd,
|
|
65
|
+
stdin: input.content,
|
|
66
|
+
timeoutMs,
|
|
67
|
+
maxBufferBytes,
|
|
68
|
+
});
|
|
69
|
+
if (result.error !== undefined || result.status !== 0) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
let ir;
|
|
73
|
+
try {
|
|
74
|
+
ir = JSON.parse(result.stdout);
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
const message = error instanceof Error ? error.message : "unknown parse error";
|
|
78
|
+
throw new Error(`Colorful CLI returned invalid JSON: ${message}`, { cause: error });
|
|
79
|
+
}
|
|
80
|
+
return projectColorfulIr({
|
|
81
|
+
path: input.path,
|
|
82
|
+
source,
|
|
83
|
+
sourceHash: sha256ContentHash(source),
|
|
84
|
+
ir,
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=colorful-cli-prose-projector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorful-cli-prose-projector.js","sourceRoot":"","sources":["../../src/adapters/colorful-cli-prose-projector.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type EchoKernelTransport } from "../ports/echo-kernel-transport.js";
|
|
2
|
+
export interface FakeDeadSymbolFixture {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly kind: string;
|
|
5
|
+
readonly filePath: string;
|
|
6
|
+
readonly exported: boolean;
|
|
7
|
+
readonly removedInCommit: string;
|
|
8
|
+
}
|
|
9
|
+
export interface FakeSymbolReferenceFixture {
|
|
10
|
+
readonly symbol: string;
|
|
11
|
+
readonly filePath: string;
|
|
12
|
+
readonly referenceCount: number;
|
|
13
|
+
readonly referencingFiles: readonly string[];
|
|
14
|
+
}
|
|
15
|
+
export interface FakeQueryObstructionFixture {
|
|
16
|
+
readonly code: string;
|
|
17
|
+
readonly message: string;
|
|
18
|
+
readonly recovery?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface FakeEchoFixture {
|
|
21
|
+
readonly basisId?: string;
|
|
22
|
+
readonly deadSymbols?: readonly FakeDeadSymbolFixture[];
|
|
23
|
+
readonly symbolReferences?: readonly FakeSymbolReferenceFixture[];
|
|
24
|
+
readonly rejectImportBatchIds?: readonly string[];
|
|
25
|
+
readonly admissionObstructedBatchIds?: readonly string[];
|
|
26
|
+
readonly queryObstruction?: FakeQueryObstructionFixture;
|
|
27
|
+
readonly retainedEvidencePosture?: "retained" | "missing" | "obstructed";
|
|
28
|
+
}
|
|
29
|
+
export interface CreateFakeEchoKernelTransportOptions {
|
|
30
|
+
readonly fixture?: FakeEchoFixture;
|
|
31
|
+
}
|
|
32
|
+
export declare function createFakeEchoKernelTransport(options?: CreateFakeEchoKernelTransportOptions): EchoKernelTransport;
|
|
33
|
+
//# sourceMappingURL=fake-echo-kernel-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fake-echo-kernel-transport.d.ts","sourceRoot":"","sources":["../../src/adapters/fake-echo-kernel-transport.ts"],"names":[],"mappings":"AAUA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,mCAAmC,CAAC;AA0B3C,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9C;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACxD,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,0BAA0B,EAAE,CAAC;IAClE,QAAQ,CAAC,oBAAoB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClD,QAAQ,CAAC,2BAA2B,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACzD,QAAQ,CAAC,gBAAgB,CAAC,EAAE,2BAA2B,CAAC;IACxD,QAAQ,CAAC,uBAAuB,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,YAAY,CAAC;CAC1E;AAED,MAAM,WAAW,oCAAoC;IACnD,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,CAAC;CACpC;AAkDD,wBAAgB,6BAA6B,CAC3C,OAAO,GAAE,oCAAyC,GACjD,mBAAmB,CA6JrB"}
|