@cleocode/cant 2026.11.9 → 2026.11.10
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/README.md +38 -11
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -63,16 +63,18 @@ interface CantValidationResult {
|
|
|
63
63
|
}
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
Used by `
|
|
67
|
-
|
|
66
|
+
Used by `cleo cant validate` (and by the deprecated `caamp pi cant validate`
|
|
67
|
+
and `caamp pi cant install`, which retire with the Pi harness under ADR-098) to
|
|
68
|
+
reject invalid `.cant` files before they hit the runtime.
|
|
68
69
|
|
|
69
70
|
### `executePipeline(filePath: string, pipelineName: string): Promise<JsPipelineResult>`
|
|
70
71
|
|
|
71
72
|
Runs a deterministic pipeline by name from a `.cant` file. Pipelines are
|
|
72
73
|
the executable subset of CANT — declarative steps with explicit inputs,
|
|
73
74
|
outputs, and exit codes. Workflow constructs (sessions, parallel arms,
|
|
74
|
-
conditionals, etc.) are
|
|
75
|
-
|
|
75
|
+
conditionals, etc.) are not executed by this package; the only interpreter is
|
|
76
|
+
the [`cant-bridge.ts`](../cleo/templates/cleoos-hub/pi-extensions/cant-bridge.ts)
|
|
77
|
+
Pi extension, which retires with the Pi/CleoOS harness (ADR-098).
|
|
76
78
|
|
|
77
79
|
### `migrateMarkdown(input: string): MigrateResult`
|
|
78
80
|
|
|
@@ -85,6 +87,28 @@ new format without losing semantics.
|
|
|
85
87
|
Parses an inline CANT message embedded in agent transcripts (used by the
|
|
86
88
|
brain memory bridge for cross-provider transcript hooks).
|
|
87
89
|
|
|
90
|
+
```ts
|
|
91
|
+
interface ParsedCANTMessage {
|
|
92
|
+
directive?: string; // e.g. 'done', 'action', 'info'
|
|
93
|
+
directive_type: 'actionable' | 'routing' | 'informational';
|
|
94
|
+
addresses: string[]; // without the @
|
|
95
|
+
task_refs: string[]; // e.g. ['T1234']
|
|
96
|
+
tags: string[]; // without the #
|
|
97
|
+
header_raw: string; // first line
|
|
98
|
+
body: string; // everything after the header
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
parseCANTMessage('/done @all T1234 #shipped');
|
|
102
|
+
// { directive: 'done', directive_type: 'actionable', addresses: ['all'],
|
|
103
|
+
// task_refs: ['T1234'], tags: ['shipped'], ... }
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Parsing goes through the cant-core addon (native or WebAssembly, see below).
|
|
107
|
+
When neither backend loads, the call throws; set
|
|
108
|
+
`CLEO_CANT_ALLOW_JS_FALLBACK=1` to use the degraded regex parser instead, which
|
|
109
|
+
warns on every use. `initCantParser()` is a no-op kept for compatibility: the
|
|
110
|
+
addon loads synchronously.
|
|
111
|
+
|
|
88
112
|
## Architecture
|
|
89
113
|
|
|
90
114
|
```
|
|
@@ -121,16 +145,18 @@ validation rules. The TypeScript surface is a thin async wrapper.
|
|
|
121
145
|
|
|
122
146
|
## CANT execution paths
|
|
123
147
|
|
|
124
|
-
There are two execution paths
|
|
148
|
+
There are two execution paths. Path A retires with the Pi/CleoOS harness (ADR-098, which supersedes ADR-035); Path B is the one CLEO keeps:
|
|
125
149
|
|
|
126
150
|
| Path | Engine | Use case |
|
|
127
151
|
|---|---|---|
|
|
128
|
-
| **Path A — Pi-interactive** | `cant-bridge.ts` Pi extension | User opens a Pi session and runs `/cant:load <file>` then `/cant:run <file> <workflow>` for interactive workflow execution. The Pi extension reuses this package for parsing and validation, then interprets workflow constructs (Session, Parallel, Conditional, ApprovalGate, Repeat, ForLoop, LoopUntil, TryCatch) in TypeScript using Pi's native subagent spawning. |
|
|
152
|
+
| **Path A — Pi-interactive (deprecated, ADR-098)** | `cant-bridge.ts` Pi extension | User opens a Pi session and runs `/cant:load <file>` then `/cant:run <file> <workflow>` for interactive workflow execution. The Pi extension reuses this package for parsing and validation, then interprets workflow constructs (Session, Parallel, Conditional, ApprovalGate, Repeat, ForLoop, LoopUntil, TryCatch) in TypeScript using Pi's native subagent spawning. |
|
|
129
153
|
| **Path B — Deterministic pipelines** | `executePipeline()` (this package) | Pure-data pipelines with explicit inputs and outputs. Runs synchronously inside the napi binding without LLM involvement. Used for build steps, migration scripts, validation gates. |
|
|
130
154
|
|
|
131
|
-
There is no third execution engine
|
|
132
|
-
WorkflowExecutor was deleted in v2026.4.7 per [ADR-035 §D5](../../docs/adr/adr-035-pi-v2-v3-harness.md)
|
|
133
|
-
|
|
155
|
+
There is no third execution engine: the legacy `@cleocode/core/cant`
|
|
156
|
+
WorkflowExecutor was deleted in v2026.4.7 per [ADR-035 §D5](../../docs/adr/adr-035-pi-v2-v3-harness.md).
|
|
157
|
+
ADR-098 supersedes ADR-035: once Path A retires, CLEO runs only deterministic
|
|
158
|
+
pipelines (`cleo cant execute <file> --pipeline <name>`); CLEO Goal (ADR-097)
|
|
159
|
+
is the autonomous driver.
|
|
134
160
|
|
|
135
161
|
## Testing
|
|
136
162
|
|
|
@@ -194,8 +220,9 @@ stamped with the released commit.
|
|
|
194
220
|
|
|
195
221
|
- [`crates/cant-core`](../../crates/cant-core) — Rust SSoT (parser, validator, pipeline executor)
|
|
196
222
|
- [`crates/cant-napi`](../../crates/cant-napi) — napi-rs bindings (cdylib)
|
|
197
|
-
- [`packages/cleo/templates/cleoos-hub/pi-extensions/cant-bridge.ts`](../cleo/templates/cleoos-hub/pi-extensions/cant-bridge.ts) — Pi-interactive runtime (Path A)
|
|
198
|
-
- [`docs/adr/adr-035-pi-v2-v3-harness.md`](../../docs/adr/adr-035-pi-v2-v3-harness.md) —
|
|
223
|
+
- [`packages/cleo/templates/cleoos-hub/pi-extensions/cant-bridge.ts`](../cleo/templates/cleoos-hub/pi-extensions/cant-bridge.ts) — Pi-interactive runtime (Path A, deprecated)
|
|
224
|
+
- [`docs/adr/adr-035-pi-v2-v3-harness.md`](../../docs/adr/adr-035-pi-v2-v3-harness.md) — the original CANT execution model (superseded by ADR-098)
|
|
225
|
+
- [CANT DSL spec §7](../../docs/spec/cant-dsl.md) — what `cant-runtime` implements
|
|
199
226
|
|
|
200
227
|
## License
|
|
201
228
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cleocode/cant",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.10",
|
|
4
4
|
"description": "CANT DSL — cant-core (SSoT) parser, validator, and pipeline executor via napi-rs; agent identity, message parsing, and migration utilities",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"@emnapi/core": "1.11.3",
|
|
17
17
|
"@emnapi/runtime": "1.11.3",
|
|
18
18
|
"@napi-rs/wasm-runtime": "1.2.4",
|
|
19
|
-
"@cleocode/contracts": "2026.11.
|
|
20
|
-
"@cleocode/
|
|
21
|
-
"@cleocode/
|
|
19
|
+
"@cleocode/contracts": "2026.11.10",
|
|
20
|
+
"@cleocode/core": "2026.11.10",
|
|
21
|
+
"@cleocode/lafs": "2026.11.10"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"typescript": "^6.0.2",
|