@tomflow/chatloop-context 0.1.4 → 0.6.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/README.md +240 -271
- package/bin/cli.mjs +25 -250
- package/capabilities/approval.mjs +151 -0
- package/capabilities/context.mjs +376 -0
- package/capabilities/document.mjs +266 -0
- package/capabilities/evidence.mjs +134 -0
- package/capabilities/presentation.mjs +82 -0
- package/capabilities/project.mjs +349 -0
- package/capabilities/sdk.mjs +72 -0
- package/capabilities/start.mjs +73 -0
- package/capabilities/task.mjs +507 -0
- package/capabilities.generated.mjs +11 -0
- package/docs/interfaces.md +182 -0
- package/docs/operator-and-migration.md +277 -0
- package/index.mjs +236 -0
- package/lib/api-aspect.mjs +190 -0
- package/lib/api-log.mjs +161 -0
- package/lib/approval-policy.mjs +24 -0
- package/lib/capability-catalog.generated.json +1989 -0
- package/lib/capability-router.mjs +67 -0
- package/lib/cli-commands.mjs +280 -0
- package/lib/context-cli.mjs +16 -19
- package/lib/context-migration.mjs +17 -9
- package/lib/core/context.mjs +115 -0
- package/lib/core/evidence.mjs +51 -0
- package/lib/core/health.mjs +55 -0
- package/lib/core/migration.mjs +262 -0
- package/lib/core/project.mjs +246 -0
- package/lib/core/review.mjs +147 -0
- package/lib/core/run.mjs +343 -0
- package/lib/core/store.mjs +391 -0
- package/lib/core/task.mjs +166 -0
- package/lib/line-review.mjs +13 -0
- package/lib/methods.mjs +49 -202
- package/lib/operations.mjs +33 -145
- package/lib/orphan-operator.mjs +117 -0
- package/lib/process-inventory.mjs +20 -0
- package/lib/project-branch.mjs +312 -0
- package/lib/project-diagnostic.mjs +26 -328
- package/lib/project-guards.mjs +19 -0
- package/lib/project-store.mjs +115 -0
- package/lib/trusted-run.mjs +86 -0
- package/lib/workspace-operator.mjs +12 -2
- package/package.json +32 -14
- package/scripts/build-capabilities.mjs +114 -0
- package/lib/context-protocol.mjs +0 -1617
package/README.md
CHANGED
|
@@ -1,271 +1,240 @@
|
|
|
1
|
-
# @tomflow/chatloop-context
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
##
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
a
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
The
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
If publication fails after sealing, preserve the sealed source, existing
|
|
243
|
-
private backup and seal receipt for offline recovery; never copy/rename a
|
|
244
|
-
`DIAGNOSTIC_ONLY` Store into production or flip `storeMode` directly.
|
|
245
|
-
The CLI rejects non-TTY callers and the module is not exposed via ordinary
|
|
246
|
-
MCP. Same-UID local terminal confirmation alone is **not** proof of an
|
|
247
|
-
independent ChatGPT user authorization. Exception: a current explicit user
|
|
248
|
-
instruction can delegate a specific Project cutover to an Agent, which may
|
|
249
|
-
operate the local TTY as `USER_DELEGATED_AGENT` after recording the source
|
|
250
|
-
identities, hashes, revisions, physical writer fence, backup and restoration
|
|
251
|
-
evidence. The resulting review is delegated, **not independently human-verified**.
|
|
252
|
-
Do not weaken the actual Core CAS, offline backup, old-writer check, Legacy
|
|
253
|
-
fence, R/P approval, UNKNOWN-send or browser Owner guards.
|
|
254
|
-
|
|
255
|
-
**Production remains BLOCKED** until the physical source hashes, mixed
|
|
256
|
-
CURRENT ownership, old writers and true operator approval have been reviewed,
|
|
257
|
-
old app/Native/Registry clients fenced, fresh backup plus recovery tested and
|
|
258
|
-
the release/real Chrome E2E gates passed. See P0-02 in
|
|
259
|
-
`docs/research/chat-loop-context-cli-architecture-20261109.md`.
|
|
260
|
-
|
|
261
|
-
## Safety
|
|
262
|
-
|
|
263
|
-
Writes use expectedStoreEpoch, revision CAS and durable writeRequestId.
|
|
264
|
-
Unknown results must be checked with the SAME request ID; never blindly
|
|
265
|
-
resubmit with another ID. Active-run holder controls live outside ordinary
|
|
266
|
-
MCP/CLI mutations in the restricted Worker→Native adapter. An SDK business
|
|
267
|
-
checkpoint never grants Browser Owner. One OS UID is not per-Chat isolation.
|
|
268
|
-
|
|
269
|
-
No serve, Socket, HTTP API, second Tunnel or per-project daemon. The real
|
|
270
|
-
legacy Context and UNKNOWN Chrome Owner remain unchanged until explicit
|
|
271
|
-
migration and recovery approval.
|
|
1
|
+
# @tomflow/chatloop-context
|
|
2
|
+
|
|
3
|
+
One authoritative per-Project SQLite Context Store for **Project / Task / R/P Review /
|
|
4
|
+
Run Permit / Checkpoint / CAS / Receipt**. This package does **not** own the
|
|
5
|
+
Chrome Session Owner, user-message evidence collection, Trace, MCP Supervisor,
|
|
6
|
+
execution workflow or external source discovery.
|
|
7
|
+
|
|
8
|
+
## Exactly two npm access points
|
|
9
|
+
|
|
10
|
+
| Entry | npm declaration | Who uses it | Purpose |
|
|
11
|
+
| --- | --- | --- | --- |
|
|
12
|
+
| **Module entry** | `exports["."] = "./index.mjs"` | SDK clients, Tools MCP, Native/Operator adapters | All importable functions, clearly separated by role |
|
|
13
|
+
| **Executable entry** | `bin["chatloop-context"] = "./bin/cli.mjs"` | Pinned Tools CLI process or explicitly authorized local operator | Bounded `request --json`, method discovery and reviewed operator commands |
|
|
14
|
+
|
|
15
|
+
**No `./protocol`, `./methods`, `./operations`, `./migration`,
|
|
16
|
+
`./admin` or `./cli` npm subpath is exported.** Internal files in
|
|
17
|
+
`lib/` are implementation, not an integration contract. The installed CLI
|
|
18
|
+
comes from npm `bin`, not a second importable npm module.
|
|
19
|
+
|
|
20
|
+
**Implementation boundary:** No module in `lib/**` imports another `lib/**`
|
|
21
|
+
implementation. The sole SDK root `index.mjs` injects named API capabilities
|
|
22
|
+
through three lazy compositions: Business, Trusted Native and Local Operator.
|
|
23
|
+
`bin/cli.mjs` imports only `index.mjs` and invokes the reviewed operator
|
|
24
|
+
`runLocalCliCommand()` API; it does not import implementation files.
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
index.mjs (sole SDK entry and dependency assembler)
|
|
28
|
+
|-- Build manifest -> capability contracts and generic dispatcher
|
|
29
|
+
|-- Business API -> Core / Project / Task / Review / Context
|
|
30
|
+
|-- Trusted API -> Run / Permit (signed-IPC consumer)
|
|
31
|
+
+-- Operator API -> Workspace / Migration / CLI commands
|
|
32
|
+
bin/cli.mjs (sole executable entry) -> index.mjs -> Operator API
|
|
33
|
+
lib/** (private implementations) <- named capabilities injected by index.mjs
|
|
34
|
+
Core -> one SQLite handle, CAS transaction and durable receipt owner
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
A module knows only its injected API contract, never the source file or internal
|
|
38
|
+
structure of the provider. Modules do not import `index.mjs` in reverse, so
|
|
39
|
+
no circular npm import is created. An import, `npx` invocation or module loader
|
|
40
|
+
alone **does not grant** Project ACL, Native Permit or operator permission.
|
|
41
|
+
|
|
42
|
+
## Module exports: always import only from the package root
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
import {
|
|
46
|
+
CONTEXT_CONTRACT, CONTEXT_PACKAGE_VERSION,
|
|
47
|
+
requestContext, contextGateway, loadTrustedRuntime, loadLocalOperator,
|
|
48
|
+
subscribeContextApiLog
|
|
49
|
+
} from '@tomflow/chatloop-context';
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
| Surface | Exact exported names | Trust boundary |
|
|
53
|
+
| --- | --- | --- |
|
|
54
|
+
| **Public SDK** | `CONTEXT_CONTRACT`, `CONTEXT_PACKAGE_VERSION`, `requestContext` | Strict Method Catalog; Project ACL; CAS / receipt |
|
|
55
|
+
| **Tools MCP adapter** | `contextGateway` namespace (`tools`, `validate`, `allowedProjects`, `cliPath`) | The pinned package owns its own CLI path; caller cannot select arbitrary executable |
|
|
56
|
+
| **Trusted Native adapter** | `loadTrustedRuntime()` → `execute(command,args,native)` | Only a signed IPC verified Native projection is accepted by its consumer; Context validates domain command, Native fields, Project grant and CAS |
|
|
57
|
+
| **Local operator** | `loadLocalOperator()` → only `runLocalCliCommand` (CLI consumer) | Explicit reviewed CLI/TTY and verified Project/SourceUnit / backups |
|
|
58
|
+
| **Observability** | `subscribeContextApiLog(listener)` → `unsubscribe()` | Tools routes non-authoritative events to the existing Supervisor Trace writer |
|
|
59
|
+
|
|
60
|
+
`loadTrustedRuntime` and `loadLocalOperator` do not themselves authorize any
|
|
61
|
+
action. They organize trusted integrators behind **the same root**; they are
|
|
62
|
+
not ordinary model/MCP operations.
|
|
63
|
+
|
|
64
|
+
See [provider / consumer / dependency matrix](docs/interfaces.md) for the
|
|
65
|
+
**complete** cross-module reference. For exact method IDs, schemas and
|
|
66
|
+
semantics, use `sdk.methods.list` / `sdk.methods.describe` on the connected SDK.
|
|
67
|
+
|
|
68
|
+
## External API minimization (no compatibility surface)
|
|
69
|
+
|
|
70
|
+
The npm module exposes exactly seven names, and the ordinary Method Catalog
|
|
71
|
+
contains **34 current business operations** (no Legacy aliases). Public
|
|
72
|
+
JavaScript consumers must use `requestContext(args)`; discovery also uses
|
|
73
|
+
that same operation with `sdk.methods.list` / `sdk.methods.describe`.
|
|
74
|
+
There are no separately exported `listMethods` / `describeMethod` helpers.
|
|
75
|
+
|
|
76
|
+
The CLI is the *only* consumer of `loadLocalOperator()`, whose returned
|
|
77
|
+
namespace contains only `runLocalCliCommand`. Its migration, workspace,
|
|
78
|
+
SourceUnit and orphan-fence utilities stay private to the `index.mjs`
|
|
79
|
+
composition. `project.create`, `project.registryAuthority`, `project.get`,
|
|
80
|
+
`project.archive`, `task.get`, `task.archive`, and `evidence.detach` are **not**
|
|
81
|
+
public operations. For new projects use reviewed `chatloop-context project
|
|
82
|
+
register/init`; for Project/Task detail use `project.open` / `task.open`.
|
|
83
|
+
There is no version-1 forwarding or fallback. Clients must upgrade together
|
|
84
|
+
and verify the `chat-loop.context-sdk.v2` contract before use.
|
|
85
|
+
`project.list` and `task.list` always return a bounded page object,
|
|
86
|
+
respectively `{projects,incomplete,nextCursor,limit}` and
|
|
87
|
+
`{tasks,incomplete,nextCursor,limit}`, with `limit=30` by default. There is
|
|
88
|
+
no implicit full-array result when pagination arguments are omitted.
|
|
89
|
+
|
|
90
|
+
## Capability-based build composition
|
|
91
|
+
|
|
92
|
+
The stable npm/CLI/MCP entrypoints now compose **34 existing methods from
|
|
93
|
+
nine independent capability descriptors** in `capabilities/<group>.mjs`.
|
|
94
|
+
Each descriptor owns its method IDs, Schema, mode, version, and dispatch route.
|
|
95
|
+
To add an independent capability, create one new descriptor with a unique
|
|
96
|
+
group name; no edits to existing capabilities or the central router are needed.
|
|
97
|
+
|
|
98
|
+
`npm run build:capabilities` produces the deterministic
|
|
99
|
+
`capabilities.generated.mjs` (static imports) and
|
|
100
|
+
`lib/capability-catalog.generated.json` (strict metadata). The generated
|
|
101
|
+
catalog drives `sdk.methods.list/describe`, SDK validation, both MCP tool
|
|
102
|
+
schemas and CLI discovery. Build/check/pack fail when outputs
|
|
103
|
+
are missing or stale; runtime never scans arbitrary directories.
|
|
104
|
+
|
|
105
|
+
Existing Core writes continue to require the original Project authority,
|
|
106
|
+
MANAGED_RW, CAS and durable receipts. The new `module` route is limited to
|
|
107
|
+
authorized **read-only** Project access with a restricted document/material
|
|
108
|
+
read port; it does not expose a raw database, writer credential or Owner.
|
|
109
|
+
The scoped Store remains open until an asynchronous capability Promise settles,
|
|
110
|
+
then closes on both success and failure.
|
|
111
|
+
A future independently writable capability requires a separately reviewed
|
|
112
|
+
transaction/receipt contract, not a security bypass. No RAG implementation
|
|
113
|
+
or new business feature is included in this refactor.
|
|
114
|
+
|
|
115
|
+
The isolated additive `probe` test builds and routes a 35th method, verifies
|
|
116
|
+
its Project boundary, then removes it to recover the original 34 methods.
|
|
117
|
+
The compiler rejects unsafe writes and conflicting capability declarations.
|
|
118
|
+
|
|
119
|
+
## Context API logging — Proxy/AOP, no domain instrumentation
|
|
120
|
+
|
|
121
|
+
The exported `requestContext` intercepts **all 34 business operations**.
|
|
122
|
+
The same reusable `Proxy` intercepts `contextGateway.validate`,
|
|
123
|
+
`contextGateway.allowedProjects`, Trusted Native `execute`, and Local
|
|
124
|
+
Operator `runLocalCliCommand`. The package exports one consumed hook,
|
|
125
|
+
`subscribeContextApiLog(listener)`, for Tools to attach a best-effort sink.
|
|
126
|
+
|
|
127
|
+
Each call emits a sanitized
|
|
128
|
+
`{contract,callId,traceId,spanId,parentSpanId,api,surface,mode,projectRef,taskRef,phase,time,durationMs,errorCode}`
|
|
129
|
+
event with `BEGIN` followed by `OK` or `FAILED`. API calls
|
|
130
|
+
within one asynchronous chain inherit a soft `traceId`; every API gets its
|
|
131
|
+
own `spanId` and optional parent. The pinned child CLI inherits only an
|
|
132
|
+
opaque sanitized parent reference, never a permission or Owner credential.
|
|
133
|
+
Input bodies, credentials, paths and output values are never logged. Callbacks and CLI STDERR output
|
|
134
|
+
are deferred through a bounded best-effort queue (up to 4096 pending events),
|
|
135
|
+
so an observer cannot synchronously delay a business API. Log failures and
|
|
136
|
+
queue saturation cannot change the original result, Promise rejection,
|
|
137
|
+
CAS transaction or business receipt; they must not trigger retries.
|
|
138
|
+
Observations can be dropped when overloaded and are not durable evidence.
|
|
139
|
+
|
|
140
|
+
Context CLI emits structured STDERR log records without polluting its
|
|
141
|
+
single JSON stdout response. For a Context-authorized single Project, Tools
|
|
142
|
+
routes these observations into **one** existing Supervisor Trace v2
|
|
143
|
+
`events.jsonl` file even when the public Trace MCP is disabled. Reading via
|
|
144
|
+
`chat_loop_trace_diagnose` still requires independent Trace opt-in.
|
|
145
|
+
Records use fixed `event=context.api`, typed `api={name,surface,mode}`,
|
|
146
|
+
and correlated `traceId/spanId/parentSpanId` for nested API calls. For
|
|
147
|
+
root calls without an inherited parent, `traceId=callId`.
|
|
148
|
+
No second logging database or daemon is created. Without a connected Trace
|
|
149
|
+
sink, CLI STDERR remains observable but no permanent retention is claimed.
|
|
150
|
+
These are soft execution observations, never R/P approval, browser-send
|
|
151
|
+
proof or Native Owner evidence.
|
|
152
|
+
|
|
153
|
+
## Minimal usage
|
|
154
|
+
|
|
155
|
+
Node **20+** may import the root and discover methods; SQLite access, runtime
|
|
156
|
+
and operator work require **Node 24+**. The package does not create a daemon.
|
|
157
|
+
|
|
158
|
+
```js
|
|
159
|
+
import {requestContext} from '@tomflow/chatloop-context';
|
|
160
|
+
|
|
161
|
+
const capabilities=await requestContext({operation:'sdk.methods.list',view:'groups'});
|
|
162
|
+
const schema=(await requestContext({operation:'sdk.methods.describe',
|
|
163
|
+
methodId:'project.open'})).inputSchema;
|
|
164
|
+
const project=await requestContext({operation:'project.open',projectId:'demo'});
|
|
165
|
+
console.log(project.authority,project.storeEpoch);
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
A public SDK call is accepted only for configured, explicitly authorized
|
|
169
|
+
Project IDs. A normal adapter uses `CHAT_LOOP_CONTEXT_ALLOWED_PROJECTS` plus
|
|
170
|
+
**exactly one** of `CHAT_LOOP_CONTEXT_ROOT` (one SQLite per Project) or the
|
|
171
|
+
explicitly controlled legacy `CHAT_LOOP_CONTEXT_DB` migration mode. Never
|
|
172
|
+
set both roots.
|
|
173
|
+
|
|
174
|
+
Write operations require relevant `expectedStoreEpoch`, revision CAS,
|
|
175
|
+
`writeRequestId`, and for active-run updates the real RunRef/credential.
|
|
176
|
+
**UNKNOWN** result: check `context.request.status` using the **original**
|
|
177
|
+
request ID; never invent a second write attempt.
|
|
178
|
+
|
|
179
|
+
## CLI lifecycle
|
|
180
|
+
|
|
181
|
+
The npm executable is `chatloop-context`, installed by a fixed dependency
|
|
182
|
+
or invoked separately through a **pinned, available** npm version:
|
|
183
|
+
|
|
184
|
+
```sh
|
|
185
|
+
npm install --save-exact @tomflow/chatloop-context@0.6.0
|
|
186
|
+
chatloop-context methods groups
|
|
187
|
+
chatloop-context methods list project
|
|
188
|
+
chatloop-context methods describe project.open
|
|
189
|
+
printf '%s
|
|
190
|
+
' '{"operation":"sdk.methods.list","view":"groups"}' | chatloop-context request --json
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
The CLI emits a **single structured result**:
|
|
194
|
+
`{contract,packageVersion,ok,result}` or
|
|
195
|
+
`{contract,packageVersion,ok:false,error:{code}}`. The binary is an
|
|
196
|
+
independent one-shot process; Tools starts its **pinned** CLI with
|
|
197
|
+
`shell:false` and does not resolve a new `npx` release per request.
|
|
198
|
+
|
|
199
|
+
Operator-only commands (`project register/bind/receipt/init`, `admin <action>`, recovery,
|
|
200
|
+
source audit and sealing, orphan fence, etc.) enforce separate local
|
|
201
|
+
authorization, exact input/revision and where required real TTY review.
|
|
202
|
+
See [operator and migration procedures](docs/operator-and-migration.md).
|
|
203
|
+
|
|
204
|
+
## Actual consumers and dependencies
|
|
205
|
+
|
|
206
|
+
- **Consumers:** Project/Delivery/Continuity → Tools MCP
|
|
207
|
+
`chat_loop_context_get/mutate` → pinned Context CLI; Tools Registry
|
|
208
|
+
adapter → Context authority/Task reads; Extension Worker → Native Host
|
|
209
|
+
→ signed Tools Supervisor → Context trusted runtime; local reviewed
|
|
210
|
+
operator → CLI.
|
|
211
|
+
- **npm dependencies:** `@tomflow/chatloop-extension` (official verified
|
|
212
|
+
Owner evidence API) and `ps-list` (cross-platform process enumeration).
|
|
213
|
+
Both are declared, pinned, and consumed through named APIs; SQLite,
|
|
214
|
+
filesystem and crypto remain Node built-ins.
|
|
215
|
+
- **Owner boundary:** Context no longer constructs the Extension installation
|
|
216
|
+
path or reads the private Native Session file. Its `fence-orphan`
|
|
217
|
+
operator asks Extension to independently verify terminal IDLE and Owner
|
|
218
|
+
mismatch before and after review. The process observation API is not
|
|
219
|
+
itself a durable stop receipt.
|
|
220
|
+
|
|
221
|
+
Read [interfaces.md](docs/interfaces.md) for the exact source files, calls,
|
|
222
|
+
ownership boundaries and known coupling risks.
|
|
223
|
+
|
|
224
|
+
## Deployment is separate from source
|
|
225
|
+
|
|
226
|
+
Local npm source version `0.6.0` does **not** establish the connected MCP
|
|
227
|
+
version. Verify the real `sdk.methods.list` response, Node runtime,
|
|
228
|
+
pinned Tools dependency, package bytes and Project authority before any
|
|
229
|
+
separately authorized installation. Source refactoring does **not** migrate
|
|
230
|
+
production SQLite, change Chrome Owner or approve R/P.
|
|
231
|
+
|
|
232
|
+
```sh
|
|
233
|
+
npm run build:capabilities:check
|
|
234
|
+
npm test
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Each capability owns its API contract in `capabilities/<group>.mjs`;
|
|
238
|
+
there is no separate API inventory document. To discover exact available
|
|
239
|
+
methods and their schemas, use `sdk.methods.list` / `sdk.methods.describe`
|
|
240
|
+
from the installed SDK. Never substitute local source docs for deployed contracts.
|