@linzumi/cli 1.0.232 → 1.0.233

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.232",
3
+ "version": "1.0.233",
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": {
@@ -54,7 +54,10 @@ import {
54
54
  fetchThreadTranscriptForRehydrationForTest,
55
55
  resumeCodexThreadForReconnect,
56
56
  } from './src/runner';
57
- import { withCodexCompletionSnapshotRequestTimeout } from './src/channelSession';
57
+ import {
58
+ resumeOrRehydrateCodexThread,
59
+ withCodexCompletionSnapshotRequestTimeout,
60
+ } from './src/channelSession';
58
61
 
59
62
  // Scripted codex JSON-RPC request seam: replies are consumed in call
60
63
  // order; every call is traced with its params. An exhausted script
@@ -127,6 +130,62 @@ async function runResumeCase(input) {
127
130
  return { trace };
128
131
  }
129
132
 
133
+ // I200 hosted-agent narrow resume: the same shared core as reconnect, but
134
+ // with the deliberately narrow missing-rollout-only recovery gate and the
135
+ // path-specific loud error prefix/final log used by
136
+ // narrowExistingLinzumiAgentThread.
137
+ async function runNarrowCase(input) {
138
+ process.env.LINZUMI_CODEX_START_REQUEST_TIMEOUT_MS = String(
139
+ input.timeoutMs
140
+ );
141
+ const trace = [];
142
+ const request = scriptedRequest(input.requestScript ?? [], trace);
143
+ const rehydration = {
144
+ forceRehydrate: false,
145
+ buildRehydrationText: async (resumeFailure) => {
146
+ trace.push({ t: 'buildText', resumeFailure });
147
+ return input.textScript?.text;
148
+ },
149
+ buildRehydrationItems:
150
+ input.itemsScript === undefined
151
+ ? undefined
152
+ : async (resumeFailure) => {
153
+ trace.push({ t: 'buildItems', resumeFailure });
154
+ return input.itemsScript.items;
155
+ },
156
+ log: (event, payload) => trace.push({ t: 'log', event, payload }),
157
+ };
158
+ const outcome = await resumeOrRehydrateCodexThread({
159
+ codex: { request },
160
+ codexThreadId: input.codexThreadId,
161
+ resumeOverrides: input.resumeOverrides ?? {},
162
+ rebuildWhen: 'missing-rollout-only',
163
+ rehydration,
164
+ }).then(
165
+ (value) => {
166
+ trace.push({
167
+ t: 'log',
168
+ event: 'linzumi.agent_thread_narrowed',
169
+ payload: {
170
+ codex_thread_id: input.codexThreadId,
171
+ approval_policy: 'never',
172
+ sandbox: 'read-only',
173
+ rehydrated: value.mode === 'rehydrated',
174
+ },
175
+ });
176
+ return { ok: true, value };
177
+ },
178
+ (error) => ({
179
+ ok: false,
180
+ message:
181
+ 'failed to narrow existing @linzumi Codex thread: ' +
182
+ (error instanceof Error ? error.message : String(error)),
183
+ })
184
+ );
185
+ trace.push({ t: 'outcome', outcome });
186
+ return { trace };
187
+ }
188
+
130
189
  // Scripted Phoenix push seam shared by the two fetch legs.
131
190
  function scriptedPush(script, trace) {
132
191
  let index = 0;
@@ -223,6 +282,8 @@ async function runCase(input) {
223
282
  switch (input.kind) {
224
283
  case 'resumeRun':
225
284
  return runResumeCase(input);
285
+ case 'narrowRun':
286
+ return runNarrowCase(input);
226
287
  case 'fetchMessagesRun':
227
288
  return runFetchMessagesCase(input);
228
289
  case 'fetchTranscriptRun':
package/scripts/build.mjs CHANGED
@@ -296,6 +296,12 @@ try {
296
296
  ' ok: false,\n' +
297
297
  " failure: 'the cross-harness failover transpiler bridge was not bundled into this build',\n" +
298
298
  ' };\n' +
299
+ '}\n' +
300
+ 'export async function seedCanonicalTranscriptIntoClaudeSession() {\n' +
301
+ ' return {\n' +
302
+ ' ok: false,\n' +
303
+ " failure: 'the canonical Claude rehydration bridge was not bundled into this build',\n" +
304
+ ' };\n' +
299
305
  '}\n'
300
306
  );
301
307
  }