@linzumi/cli 1.0.107 → 1.0.109

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linzumi/cli",
3
- "version": "1.0.107",
3
+ "version": "1.0.109",
4
4
  "description": "Linzumi CLI \u2014 point a Codex agent at the real code on your laptop, with your team watching and steering from shared threads.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,93 @@
1
+ // Spec: kandan/plans/2026-07-13-t1-canonical-activity-format-spec.md
2
+ // (section 11, the T.2 amendment; compute-nodes program, workstream T,
3
+ // task T.2).
4
+ // Relationship: Builds the TS-side ORACLE for the codex transpiler's
5
+ // live-injection leg. T.2's ReScript module
6
+ // (packages/linzumi-cli-rescript/src/transpile/HarnessCodexTranspiler.res)
7
+ // owns the codex SESSION-FORMAT directions; canonical -> codex
8
+ // `thread/inject_items` stays THE one implementation here in
9
+ // src/transcriptCompiler.ts (`transpileCanonicalToCodexInjectItems`, the
10
+ // T.1 re-expressed rebuild path). This oracle bundles that REAL
11
+ // implementation behind a one-shot stdin/stdout driver so the T.2
12
+ // conformance
13
+ // (packages/linzumi-cli-rescript/src/parity/HarnessCodexTranspilerConformance.res)
14
+ // can prove a T.2 foreign-export page parses through the real consumer and
15
+ // feeds the real inject_items emission - one implementation, never a
16
+ // ReScript re-expression.
17
+ //
18
+ // Like build-protocol-parity-oracle.mjs, the output is a local test
19
+ // artifact (.differential/ is gitignored, never published) and stays
20
+ // unminified for debuggability.
21
+ import { mkdir } from 'node:fs/promises';
22
+ import { dirname, join } from 'node:path';
23
+ import { fileURLToPath } from 'node:url';
24
+ import { build } from 'esbuild';
25
+
26
+ const packageRoot = dirname(dirname(fileURLToPath(import.meta.url)));
27
+
28
+ const driverSource = `
29
+ import {
30
+ parseCanonicalActivityPage,
31
+ transpileCanonicalToCodexInjectItems,
32
+ } from './src/transcriptCompiler';
33
+
34
+ let stdin = '';
35
+ process.stdin.setEncoding('utf8');
36
+ for await (const chunk of process.stdin) {
37
+ stdin += chunk;
38
+ }
39
+ const input = JSON.parse(stdin);
40
+ const page = parseCanonicalActivityPage(input.page);
41
+
42
+ if (page === undefined) {
43
+ process.stdout.write(JSON.stringify({ parsed: false }));
44
+ } else {
45
+ const emission = transpileCanonicalToCodexInjectItems({
46
+ nodes: page.nodes,
47
+ budget: page.budget,
48
+ resumeFailure:
49
+ typeof input.resume_failure === 'string' ? input.resume_failure : '',
50
+ threadTitle: page.threadTitle,
51
+ });
52
+ process.stdout.write(
53
+ JSON.stringify({
54
+ parsed: true,
55
+ ir_version: page.irVersion,
56
+ node_count: page.nodes.length,
57
+ node_kinds: page.nodes.map((node) => node.kind),
58
+ emission: {
59
+ items: emission.items,
60
+ emitted_node_count: emission.emittedNodeCount,
61
+ omitted_node_count: emission.omittedNodeCount,
62
+ redacted_reasoning_count: emission.redactedReasoningCount,
63
+ max_emission_tokens: emission.maxEmissionTokens,
64
+ },
65
+ })
66
+ );
67
+ }
68
+ `;
69
+
70
+ await mkdir(join(packageRoot, '.differential'), { recursive: true });
71
+
72
+ await build({
73
+ stdin: {
74
+ contents: driverSource,
75
+ resolveDir: packageRoot,
76
+ sourcefile: 'canonical-codex-transpiler-driver.ts',
77
+ loader: 'ts',
78
+ },
79
+ bundle: true,
80
+ platform: 'node',
81
+ target: 'node20',
82
+ format: 'esm',
83
+ outfile: join(
84
+ packageRoot,
85
+ '.differential/canonical-codex-transpiler-oracle.mjs'
86
+ ),
87
+ minify: false,
88
+ sourcemap: false,
89
+ legalComments: 'none',
90
+ // transcriptCompiler is dependency-light; anything leaking in from the
91
+ // wider commander graph stays external exactly like the entry build.
92
+ external: ['ws', 'undici', 'blessed', '@anthropic-ai/claude-agent-sdk'],
93
+ });