@quantiya/codevibe-codex-plugin 2.0.11 → 2.0.14

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.
Files changed (23) hide show
  1. package/dist/server.js +36 -27
  2. package/hooks/common.sh +21 -9
  3. package/libexec/codex-hook-config.js +190 -0
  4. package/libexec/companion-launcher +9 -158
  5. package/node_modules/@quantiya/codevibe-core/dist/__tests__/gate-ux-regressions.test.d.ts +1 -0
  6. package/node_modules/@quantiya/codevibe-core/dist/index.d.ts +1 -1
  7. package/node_modules/@quantiya/codevibe-core/dist/index.js +240 -240
  8. package/node_modules/@quantiya/codevibe-core/dist/local-executor/workspace-shadow.d.ts +7 -0
  9. package/node_modules/@quantiya/codevibe-core/dist/local-model/manager.d.ts +1 -1
  10. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/audit-runner.d.ts +2 -3
  11. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/cli.d.ts +2 -2
  12. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/cli.js +158 -28
  13. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/quorum-loop.d.ts +22 -3
  14. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/task-progress.d.ts +3 -0
  15. package/node_modules/@quantiya/codevibe-core/dist/reduced-trust-notice.d.ts +44 -0
  16. package/node_modules/@quantiya/codevibe-core/dist/tool-activity/consolidator.d.ts +7 -0
  17. package/node_modules/@quantiya/codevibe-core/dist/tool-activity/ledger.d.ts +33 -13
  18. package/node_modules/@quantiya/codevibe-core/package.json +1 -1
  19. package/node_modules/fs-ext/build/Makefile +2 -2
  20. package/node_modules/fs-ext/build/Release/fs_ext.node +0 -0
  21. package/node_modules/fs-ext/build/Release/obj.target/fs_ext/fs-ext.o +0 -0
  22. package/node_modules/fs-ext/build/config.gypi +1 -1
  23. package/package.json +5 -2
@@ -12,13 +12,13 @@ export declare const LedgerEntrySchema: z.ZodObject<{
12
12
  * rewind falls back to session start, which is still SAFE.
13
13
  */
14
14
  byteOffset: z.ZodNumber;
15
- state: z.ZodEnum<["durably-outboxed", "acked"]>;
15
+ state: z.ZodEnum<["durably-outboxed", "acked", "terminal"]>;
16
16
  }, "strip", z.ZodTypeAny, {
17
- state: "durably-outboxed" | "acked";
17
+ state: "terminal" | "durably-outboxed" | "acked";
18
18
  byteOffset: number;
19
19
  clientEventId: string;
20
20
  }, {
21
- state: "durably-outboxed" | "acked";
21
+ state: "terminal" | "durably-outboxed" | "acked";
22
22
  byteOffset: number;
23
23
  clientEventId: string;
24
24
  }>;
@@ -36,30 +36,37 @@ export declare const LedgerFileSchema: z.ZodObject<{
36
36
  * rewind falls back to session start, which is still SAFE.
37
37
  */
38
38
  byteOffset: z.ZodNumber;
39
- state: z.ZodEnum<["durably-outboxed", "acked"]>;
39
+ state: z.ZodEnum<["durably-outboxed", "acked", "terminal"]>;
40
40
  }, "strip", z.ZodTypeAny, {
41
- state: "durably-outboxed" | "acked";
41
+ state: "terminal" | "durably-outboxed" | "acked";
42
42
  byteOffset: number;
43
43
  clientEventId: string;
44
44
  }, {
45
- state: "durably-outboxed" | "acked";
45
+ state: "terminal" | "durably-outboxed" | "acked";
46
46
  byteOffset: number;
47
47
  clientEventId: string;
48
48
  }>>;
49
+ /**
50
+ * Permanently rejected outbox windows. Optional for backwards compatibility
51
+ * with version-1 ledgers written before per-window terminal authority existed.
52
+ */
53
+ terminalClientEventIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
49
54
  }, "strip", z.ZodTypeAny, {
50
55
  entries: Record<string, {
51
- state: "durably-outboxed" | "acked";
56
+ state: "terminal" | "durably-outboxed" | "acked";
52
57
  byteOffset: number;
53
58
  clientEventId: string;
54
59
  }>;
55
60
  version: 1;
61
+ terminalClientEventIds: string[];
56
62
  }, {
57
63
  entries: Record<string, {
58
- state: "durably-outboxed" | "acked";
64
+ state: "terminal" | "durably-outboxed" | "acked";
59
65
  byteOffset: number;
60
66
  clientEventId: string;
61
67
  }>;
62
68
  version: 1;
69
+ terminalClientEventIds?: string[] | undefined;
63
70
  }>;
64
71
  export type LedgerFile = z.infer<typeof LedgerFileSchema>;
65
72
  /**
@@ -111,7 +118,9 @@ export declare class ToolActivityLedger {
111
118
  private readonly logger;
112
119
  private readonly rootDir;
113
120
  private entries;
121
+ private terminalWindows;
114
122
  private loaded;
123
+ private mutationChain;
115
124
  constructor(opts: ToolActivityLedgerOptions);
116
125
  private filePath;
117
126
  private legacyOwnedFilePath;
@@ -133,7 +142,7 @@ export declare class ToolActivityLedger {
133
142
  * rebuildability) — used after a ledger loss so a still-pending window is not
134
143
  * re-observed as new. The outbox does not carry per-occurrence byteOffsets, so
135
144
  * they default to 0 (rewind falls back to the safe session-start bound).
136
- * Never DOWNGRADES an existing `acked` entry.
145
+ * Never DOWNGRADES an existing `acked` or `terminal` entry.
137
146
  */
138
147
  rebuildFromOutbox(outboxEntries: ToolActivityOutboxEnvelope[]): void;
139
148
  /**
@@ -168,7 +177,9 @@ export declare class ToolActivityLedger {
168
177
  * (`entries`/`owned`) deferral is permanent, so the cursor advances freely.
169
178
  */
170
179
  isLegacyInFlight(id: string): boolean;
171
- getState(id: string): 'durably-outboxed' | 'acked' | undefined;
180
+ getState(id: string): 'durably-outboxed' | 'acked' | 'terminal' | undefined;
181
+ /** True when a window has been durably settled as permanently undeliverable. */
182
+ isTerminalWindow(clientEventId: string): boolean;
172
183
  /**
173
184
  * Unique `clientEventId`s still in the `durably-outboxed` state (sealed, not yet
174
185
  * acked). The §4.5 N4 startup cross-check compares these against the surviving
@@ -192,6 +203,11 @@ export declare class ToolActivityLedger {
192
203
  markDurablyOutboxed(occurrences: OccurrenceRef[], clientEventId: string): Promise<void>;
193
204
  /** Mark every id of an acked window `acked` (retained for the pruning horizon). */
194
205
  markAcked(clientEventId: string): Promise<void>;
206
+ /**
207
+ * Mark every id of a permanently rejected window `terminal`. This must be
208
+ * persisted before its outbox file is pruned so restart cannot resend it.
209
+ */
210
+ markTerminal(clientEventId: string, invocationIds?: string[]): Promise<void>;
195
211
  /**
196
212
  * Crash-ordered repair step (2) (§4.5 V3/W2): DEMOTE/remove every mapping
197
213
  * referencing a quarantined or missing `clientEventId` so its occurrences are
@@ -265,10 +281,14 @@ export declare class ToolActivityLedger {
265
281
  /** Test/diagnostic: a snapshot of the in-memory legacy IN-FLIGHT id set. */
266
282
  legacyInFlightSnapshot(): string[];
267
283
  /**
268
- * Bound ledger growth: drop `acked` entries whose source position is strictly
269
- * BELOW a safe horizon (§4.5 — max(replay cursor, Stop turn-start)). Never
270
- * prunes `durably-outboxed` (still pending an ack). Persists if anything changed.
284
+ * Bound ledger growth: drop settled (`acked` or `terminal`) entries whose
285
+ * source position is strictly BELOW a safe horizon (§4.5 — max(replay cursor,
286
+ * Stop turn-start)). Never prunes `durably-outboxed` or a terminal tombstone
287
+ * whose outbox file still exists: the latter may be an interrupted prune and
288
+ * must remain terminal across restart. Persists if anything changed.
271
289
  */
272
290
  prune(beforeByteOffset: number): Promise<void>;
291
+ private mutateAndPersist;
292
+ private outboxEntryExists;
273
293
  private persist;
274
294
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantiya/codevibe-core",
3
- "version": "2.0.9",
3
+ "version": "2.0.10",
4
4
  "description": "Core library for CodeVibe plugins - shared keychain, crypto, AppSync, and auth functionality",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -331,8 +331,8 @@ ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
331
331
  endif
332
332
 
333
333
  quiet_cmd_regen_makefile = ACTION Regenerating $@
334
- cmd_regen_makefile = cd $(srcdir); /opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/hendryyeh/Library/Caches/node-gyp/24.4.0" "-Dnode_gyp_dir=/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp" "-Dnode_lib_file=/Users/hendryyeh/Library/Caches/node-gyp/24.4.0/<(target_arch)/node.lib" "-Dmodule_root_dir=/Users/hendryyeh/Workspace/CodeVibe/codevibe-codex-plugin/node_modules/fs-ext" "-Dnode_engine=v8" "--depth=." "-Goutput_dir=." "--generator-output=build" -I/Users/hendryyeh/Workspace/CodeVibe/codevibe-codex-plugin/node_modules/fs-ext/build/config.gypi -I/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/Users/hendryyeh/Library/Caches/node-gyp/24.4.0/include/node/common.gypi "--toplevel-dir=." binding.gyp
335
- Makefile: $(srcdir)/binding.gyp $(srcdir)/../../../../../Library/Caches/node-gyp/24.4.0/include/node/common.gypi $(srcdir)/build/config.gypi $(srcdir)/../../../../../../../opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/addon.gypi
334
+ cmd_regen_makefile = cd $(srcdir); /opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/hendryyeh/Library/Caches/node-gyp/24.4.0" "-Dnode_gyp_dir=/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp" "-Dnode_lib_file=/Users/hendryyeh/Library/Caches/node-gyp/24.4.0/<(target_arch)/node.lib" "-Dmodule_root_dir=/Users/hendryyeh/Workspace/CodeVibe/.agent-worktrees/codex-1/p17-retry-containment/codevibe-codex-plugin/node_modules/fs-ext" "-Dnode_engine=v8" "--depth=." "-Goutput_dir=." "--generator-output=build" -I/Users/hendryyeh/Workspace/CodeVibe/.agent-worktrees/codex-1/p17-retry-containment/codevibe-codex-plugin/node_modules/fs-ext/build/config.gypi -I/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/Users/hendryyeh/Library/Caches/node-gyp/24.4.0/include/node/common.gypi "--toplevel-dir=." binding.gyp
335
+ Makefile: $(srcdir)/../../../../../../../../Library/Caches/node-gyp/24.4.0/include/node/common.gypi $(srcdir)/build/config.gypi $(srcdir)/../../../../../../../../../../opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/binding.gyp
336
336
  $(call do_cmd,regen_makefile)
337
337
 
338
338
  # "all" is a concatenation of the "all" targets from all the included
@@ -490,7 +490,7 @@
490
490
  "python": "/opt/homebrew/opt/python@3.14/bin/python3.14",
491
491
  "standalone_static_library": 1,
492
492
  "global_prefix": "/opt/homebrew",
493
- "local_prefix": "/Users/hendryyeh/Workspace/CodeVibe/codevibe-codex-plugin",
493
+ "local_prefix": "/Users/hendryyeh/Workspace/CodeVibe/.agent-worktrees/codex-1/p17-retry-containment/codevibe-codex-plugin",
494
494
  "globalconfig": "/opt/homebrew/etc/npmrc",
495
495
  "init_module": "/Users/hendryyeh/.npm-init.js",
496
496
  "userconfig": "/Users/hendryyeh/.npmrc",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantiya/codevibe-codex-plugin",
3
- "version": "2.0.11",
3
+ "version": "2.0.14",
4
4
  "description": "Control OpenAI Codex CLI from your iPhone and Android — real-time sync, approve file edits, send prompts by voice. Part of CodeVibe.",
5
5
  "main": "dist/server.js",
6
6
  "codevibe": {
@@ -47,12 +47,13 @@
47
47
  "node": ">=22.0.0"
48
48
  },
49
49
  "dependencies": {
50
- "@quantiya/codevibe-core": "2.0.9",
50
+ "@quantiya/codevibe-core": "2.0.10",
51
51
  "@quantiya/quorum-core": "^1.0.1",
52
52
  "chokidar": "^4.0.0",
53
53
  "dotenv": "^16.6.1",
54
54
  "express": "^5.1.0",
55
55
  "graphql": "^16.12.0",
56
+ "shell-quote": "1.9.0",
56
57
  "uuid": "^13.0.0",
57
58
  "ws": "^8.18.3"
58
59
  },
@@ -63,6 +64,7 @@
63
64
  "dotenv",
64
65
  "express",
65
66
  "graphql",
67
+ "shell-quote",
66
68
  "uuid",
67
69
  "ws"
68
70
  ],
@@ -85,6 +87,7 @@
85
87
  "dotenv",
86
88
  "express",
87
89
  "graphql",
90
+ "shell-quote",
88
91
  "uuid",
89
92
  "ws"
90
93
  ]