stitchkit 0.103.11 → 0.103.13

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 (64) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/darwin-native.cjs +12 -0
  3. package/darwin-native.d.cts +2 -0
  4. package/dist/agent-runtime/coding-shell-process.d.ts.map +1 -1
  5. package/dist/agent-runtime/sandbox-process-owner.d.ts +1 -1
  6. package/dist/agent-runtime/sandbox-process-owner.d.ts.map +1 -1
  7. package/dist/agent-runtime/store-conformance-support.d.ts +5 -5
  8. package/dist/durability/json.d.ts.map +1 -1
  9. package/dist/entrypoints/agent-runtime/coding-tools.js +4 -2
  10. package/dist/entrypoints/agent-runtime/harness.js +4 -3
  11. package/dist/entrypoints/agent-runtime/sandbox.js +22 -16
  12. package/dist/entrypoints/agent-runtime.js +2 -2
  13. package/dist/entrypoints/application/diagnostic-journal.js +3 -2
  14. package/dist/entrypoints/cli.js +1 -1
  15. package/dist/entrypoints/files.js +3 -2
  16. package/dist/entrypoints/primitives.js +4 -3
  17. package/dist/entrypoints/process.js +3 -2
  18. package/dist/entrypoints/tools.js +2 -2
  19. package/dist/{index-nybn2err.js → index-5csmzesf.js} +1 -1
  20. package/dist/{index-ary5s7k0.js → index-69nvze1q.js} +1 -2
  21. package/dist/{index-ahtnte39.js → index-8zfsgar0.js} +35 -30
  22. package/dist/{index-ttf0y7b8.js → index-9853ymwb.js} +38 -19
  23. package/dist/{index-g4jxe7ve.js → index-db2spkv1.js} +7 -6
  24. package/dist/{index-32jkwkdm.js → index-f330qqyg.js} +253 -165
  25. package/dist/index-fm1c1a08.js +138 -0
  26. package/dist/{index-ej331hah.js → index-gxm9rc97.js} +1 -1
  27. package/dist/index-v5ee8ath.js +88 -0
  28. package/dist/{index-9jb61j5a.js → index-zp4jpkp0.js} +1 -1
  29. package/dist/internal/darwin-binding-error.d.ts +24 -0
  30. package/dist/internal/darwin-binding-error.d.ts.map +1 -0
  31. package/dist/internal/darwin-binding.d.ts.map +1 -1
  32. package/dist/internal/exclusive-lock.d.ts +1 -1
  33. package/dist/internal/exclusive-lock.d.ts.map +1 -1
  34. package/dist/internal/json-data.d.ts +8 -2
  35. package/dist/internal/json-data.d.ts.map +1 -1
  36. package/dist/internal/json-string-size.d.ts +3 -0
  37. package/dist/internal/json-string-size.d.ts.map +1 -0
  38. package/dist/primitives/canonical-json.d.ts.map +1 -1
  39. package/dist/process/cleanup.d.ts +12 -0
  40. package/dist/process/cleanup.d.ts.map +1 -0
  41. package/dist/process/command-lifetime.d.ts +19 -0
  42. package/dist/process/command-lifetime.d.ts.map +1 -0
  43. package/dist/process/command-owner.d.ts +0 -3
  44. package/dist/process/command-owner.d.ts.map +1 -1
  45. package/dist/process/group.d.ts.map +1 -1
  46. package/dist/process/launch.d.ts +15 -6
  47. package/dist/process/launch.d.ts.map +1 -1
  48. package/dist/process/owned-child.d.ts +10 -0
  49. package/dist/process/owned-child.d.ts.map +1 -0
  50. package/dist/process/start-failure.d.ts +2 -5
  51. package/dist/process/start-failure.d.ts.map +1 -1
  52. package/dist/process/transport.d.ts +30 -0
  53. package/dist/process/transport.d.ts.map +1 -0
  54. package/dist/tools/cli/args-fields.d.ts +2 -0
  55. package/dist/tools/cli/args-fields.d.ts.map +1 -1
  56. package/dist/tools/cli/args.d.ts.map +1 -1
  57. package/llms/agent-runtime-sandbox.txt +9 -1
  58. package/llms/cli.txt +10 -0
  59. package/llms/process.txt +62 -8
  60. package/llms-full.txt +81 -9
  61. package/llms.txt +3 -3
  62. package/package.json +6 -1
  63. package/dist/index-c1jmtxa0.js +0 -74
  64. package/dist/index-d4pa2bgs.js +0 -42
@@ -0,0 +1,138 @@
1
+ // src/internal/json-string-size.ts
2
+ function jsonStringSize(text, budget) {
3
+ if (text.length + 2 > budget)
4
+ return budget + 1;
5
+ let bytes = 2;
6
+ for (let index = 0;index < text.length && bytes <= budget; index++) {
7
+ const unit = text.charCodeAt(index);
8
+ if (unit === 34 || unit === 92)
9
+ bytes += 2;
10
+ else if (unit < 32)
11
+ bytes += unit === 8 || unit === 9 || unit === 10 || unit === 12 || unit === 13 ? 2 : 6;
12
+ else if (unit < 128)
13
+ bytes++;
14
+ else if (unit < 2048)
15
+ bytes += 2;
16
+ else if (unit >= 55296 && unit <= 56319) {
17
+ const next = text.charCodeAt(index + 1);
18
+ if (next >= 56320 && next <= 57343) {
19
+ bytes += 4;
20
+ index++;
21
+ } else
22
+ bytes += 6;
23
+ } else if (unit >= 56320 && unit <= 57343)
24
+ bytes += 6;
25
+ else
26
+ bytes += 3;
27
+ }
28
+ return bytes;
29
+ }
30
+
31
+ // src/internal/json-data.ts
32
+ function isJsonData(value, limits, snapshot) {
33
+ const ancestors = new Set;
34
+ let nodes = 0;
35
+ let bytes = 0;
36
+ const byteLimit = limits.maxBytes;
37
+ const charge = (amount) => {
38
+ if (byteLimit === undefined)
39
+ return true;
40
+ bytes += amount;
41
+ return bytes <= byteLimit;
42
+ };
43
+ const chargeText = (text) => byteLimit === undefined || charge(jsonStringSize(text, byteLimit - bytes));
44
+ const visit = (item, depth, target, key) => {
45
+ if (++nodes > limits.maxNodes || depth > limits.maxDepth)
46
+ return false;
47
+ let captured = item;
48
+ if (item === null) {
49
+ if (!charge(4))
50
+ return false;
51
+ } else if (typeof item === "string") {
52
+ if (!chargeText(item))
53
+ return false;
54
+ } else if (typeof item === "boolean") {
55
+ if (!charge(item ? 4 : 5))
56
+ return false;
57
+ } else if (typeof item === "number") {
58
+ if (!Number.isFinite(item) || Object.is(item, -0))
59
+ return false;
60
+ if (byteLimit !== undefined && !charge(String(item).length))
61
+ return false;
62
+ } else {
63
+ if (typeof item !== "object" || ancestors.has(item))
64
+ return false;
65
+ const array = Array.isArray(item);
66
+ const prototype = Object.getPrototypeOf(item);
67
+ if (array ? prototype !== Array.prototype : prototype !== Object.prototype && prototype !== null)
68
+ return false;
69
+ let length = 0;
70
+ if (array) {
71
+ const descriptor = Object.getOwnPropertyDescriptor(item, "length");
72
+ if (!descriptor || !("value" in descriptor))
73
+ return false;
74
+ const capturedLength = descriptor.value;
75
+ if (typeof capturedLength !== "number" || !Number.isInteger(capturedLength) || capturedLength < 0 || capturedLength > 2 ** 32 - 1)
76
+ return false;
77
+ length = capturedLength;
78
+ if (length > limits.maxNodes - nodes)
79
+ return false;
80
+ if (byteLimit !== undefined && Math.max(2, length * 2 + 1) > byteLimit - bytes)
81
+ return false;
82
+ }
83
+ const keys = Reflect.ownKeys(item);
84
+ if (keys.length > limits.maxNodes - nodes + (array ? 1 : 0))
85
+ return false;
86
+ if (array && keys.length !== length + 1)
87
+ return false;
88
+ if (!charge(2))
89
+ return false;
90
+ const copy = target ? array ? [] : {} : undefined;
91
+ ancestors.add(item);
92
+ try {
93
+ let members = 0;
94
+ for (const memberKey of keys) {
95
+ if (array && memberKey === "length")
96
+ continue;
97
+ if (typeof memberKey !== "string")
98
+ return false;
99
+ if (array && (!/^(0|[1-9][0-9]*)$/.test(memberKey) || Number(memberKey) >= length))
100
+ return false;
101
+ const descriptor = Object.getOwnPropertyDescriptor(item, memberKey);
102
+ if (!descriptor?.enumerable || !("value" in descriptor))
103
+ return false;
104
+ const memberValue = descriptor.value;
105
+ if (!array && limits.omitObjectUndefined && memberValue === undefined) {
106
+ if (++nodes > limits.maxNodes)
107
+ return false;
108
+ continue;
109
+ }
110
+ if (members++ > 0 && !charge(1))
111
+ return false;
112
+ if (!array && (!chargeText(memberKey) || !charge(1)))
113
+ return false;
114
+ if (!visit(memberValue, depth + 1, copy, memberKey))
115
+ return false;
116
+ }
117
+ captured = copy;
118
+ } finally {
119
+ ancestors.delete(item);
120
+ }
121
+ }
122
+ if (target && key !== undefined)
123
+ Object.defineProperty(target, key, {
124
+ value: captured,
125
+ enumerable: true,
126
+ configurable: true,
127
+ writable: true
128
+ });
129
+ return true;
130
+ };
131
+ try {
132
+ return visit(value, 0, snapshot, "value");
133
+ } catch {
134
+ return false;
135
+ }
136
+ }
137
+
138
+ export { isJsonData };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  loadDarwinBinding
3
- } from "./index-d4pa2bgs.js";
3
+ } from "./index-v5ee8ath.js";
4
4
 
5
5
  // src/agent-runtime/contained-scan.ts
6
6
  import path2 from "node:path";
@@ -0,0 +1,88 @@
1
+ // src/internal/darwin-binding.ts
2
+ import loadDarwinAddon from "#stitchkit-darwin-native";
3
+
4
+ // src/internal/darwin-binding-error.ts
5
+ var messages = {
6
+ architecture: "The packaged Darwin backend does not support this architecture",
7
+ resolve: "The packaged Darwin backend is missing",
8
+ load: "The packaged Darwin backend could not be loaded",
9
+ surface: "The packaged Darwin backend has an invalid surface"
10
+ };
11
+ var nativeCodes = new Set([
12
+ "MODULE_NOT_FOUND",
13
+ "ERR_MODULE_NOT_FOUND",
14
+ "ERR_DLOPEN_FAILED",
15
+ "ENOENT",
16
+ "EINVAL",
17
+ "EPERM",
18
+ "EACCES",
19
+ "ENOTSUP"
20
+ ]);
21
+ function darwinNativeCode(cause) {
22
+ let current = cause;
23
+ for (let depth = 0;depth < 3 && current instanceof Error; depth++) {
24
+ if ("code" in current && typeof current.code === "string" && nativeCodes.has(current.code)) {
25
+ return current.code;
26
+ }
27
+ current = current.cause;
28
+ }
29
+ return;
30
+ }
31
+
32
+ class DarwinBackendError extends Error {
33
+ stage;
34
+ code = "DARWIN_BACKEND_UNAVAILABLE";
35
+ constructor(stage, cause) {
36
+ super(messages[stage], { cause });
37
+ this.stage = stage;
38
+ this.name = "DarwinBackendError";
39
+ }
40
+ toJSON() {
41
+ return {
42
+ name: this.name,
43
+ code: this.code,
44
+ stage: this.stage,
45
+ architecture: process.arch,
46
+ message: this.message,
47
+ nativeCode: darwinNativeCode(this.cause)
48
+ };
49
+ }
50
+ }
51
+
52
+ // src/internal/darwin-binding.ts
53
+ function hasFunctions(value, names) {
54
+ return typeof value === "object" && value !== null && names.every((name) => typeof Reflect.get(value, name) === "function");
55
+ }
56
+ var darwinBinding;
57
+ function loadDarwinBinding() {
58
+ if (darwinBinding)
59
+ return darwinBinding;
60
+ if (process.arch !== "arm64" && process.arch !== "x64") {
61
+ throw new DarwinBackendError("architecture");
62
+ }
63
+ let loaded;
64
+ try {
65
+ loaded = loadDarwinAddon();
66
+ } catch (cause) {
67
+ const code = darwinNativeCode(cause);
68
+ throw new DarwinBackendError(code === "MODULE_NOT_FOUND" || code === "ERR_MODULE_NOT_FOUND" || code === "ENOENT" ? "resolve" : "load", cause);
69
+ }
70
+ const methods = [
71
+ "openDirectoryAt",
72
+ "openFileAt",
73
+ "createFileAt",
74
+ "createDirectoryAt",
75
+ "statAt",
76
+ "listAt",
77
+ "renameAt",
78
+ "unlinkAt",
79
+ "processIdentity"
80
+ ];
81
+ if (!hasFunctions(loaded, methods)) {
82
+ throw new DarwinBackendError("surface");
83
+ }
84
+ darwinBinding = loaded;
85
+ return darwinBinding;
86
+ }
87
+
88
+ export { loadDarwinBinding };
@@ -20,7 +20,7 @@ import {
20
20
  } from "./index-mnkk1ffz.js";
21
21
  import {
22
22
  createLocalStepDurability2
23
- } from "./index-ary5s7k0.js";
23
+ } from "./index-69nvze1q.js";
24
24
  import {
25
25
  isAgentToolError2,
26
26
  createToolDurabilityContext
@@ -0,0 +1,24 @@
1
+ declare const messages: {
2
+ architecture: string;
3
+ resolve: string;
4
+ load: string;
5
+ surface: string;
6
+ };
7
+ type Stage = keyof typeof messages;
8
+ export declare function darwinNativeCode(cause: unknown): string | undefined;
9
+ /** Live callers retain the original Error; operator JSON only carries safe loader evidence. */
10
+ export declare class DarwinBackendError extends Error {
11
+ readonly stage: Stage;
12
+ readonly code = "DARWIN_BACKEND_UNAVAILABLE";
13
+ constructor(stage: Stage, cause?: unknown);
14
+ toJSON(): {
15
+ name: string;
16
+ code: string;
17
+ stage: "architecture" | "load" | "resolve" | "surface";
18
+ architecture: NodeJS.Architecture;
19
+ message: string;
20
+ nativeCode: string | undefined;
21
+ };
22
+ }
23
+ export {};
24
+ //# sourceMappingURL=darwin-binding-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"darwin-binding-error.d.ts","sourceRoot":"","sources":["../../src/internal/darwin-binding-error.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,QAAQ;IACZ,YAAY;IACZ,OAAO;IACP,IAAI;IACJ,OAAO;CACR,CAAC;AACF,KAAK,KAAK,GAAG,MAAM,OAAO,QAAQ,CAAC;AAYnC,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAanE;AAED,+FAA+F;AAC/F,qBAAa,kBAAmB,SAAQ,KAAK;IAGzC,QAAQ,CAAC,KAAK,EAAE,KAAK;IAFvB,QAAQ,CAAC,IAAI,gCAAgC;IAC7C,YACW,KAAK,EAAE,KAAK,EACrB,KAAK,CAAC,EAAE,OAAO,EAIhB;IACD,MAAM;;;;;;;MASL;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"darwin-binding.d.ts","sourceRoot":"","sources":["../../src/internal/darwin-binding.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACzD,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACpD,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACpE,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1E,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,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1E,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,WAAW,EAAE,CAAC;IAClD,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAClE,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACjD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAM9E;AAID,wBAAgB,iBAAiB,IAAI,aAAa,CAkCjD"}
@@ -59,7 +59,7 @@ export type ExclusiveLockAttempt = {
59
59
  * its owner is provably gone. A refusal returns the create's own `EEXIST`, so a
60
60
  * caller that surfaced that error keeps surfacing the identical one.
61
61
  */
62
- export declare function attemptExclusiveLock(path: string, options: ExclusiveLockAttemptOptions): Promise<ExclusiveLockAttempt>;
62
+ export declare function attemptExclusiveLock(path: string, options: ExclusiveLockAttemptOptions, depth?: number): Promise<ExclusiveLockAttempt>;
63
63
  /** Read the owner a present lock records, for a refusal that has to name it. */
64
64
  export declare function readExclusiveLockOwner(path: string): Promise<ExclusiveLockOwner | null>;
65
65
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"exclusive-lock.d.ts","sourceRoot":"","sources":["../../src/internal/exclusive-lock.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAEL,KAAK,oBAAoB,EAG1B,MAAM,oBAAoB,CAAC;AAG5B,gDAAgD;AAChD,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;iBAO5B,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,wCAAwC;AACxC,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,WAAW,EAAE,cAAc,GAAG,iBAAiB,GA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,CAAC;IAC1B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3C;AAED,MAAM,MAAM,oBAAoB,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAA;CAAE,GACpC;IACE,kDAAkD;IAClD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,6CAA6C;IAC7C,QAAQ,CAAC,SAAS,CAAC,EAAE,sBAAsB,CAAC;CAC7C,CAAC;AAgON;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,2BAA2B,EACpC,KAAK,SAAI,GACR,OAAO,CAAC,oBAAoB,CAAC,CAgC/B;AAED,gFAAgF;AAChF,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAEpC"}
@@ -1,8 +1,14 @@
1
- /** Validation shared by durable JSON and canonical JSON; serialization has one separate owner. */
1
+ /**
2
+ * Shared descriptor traversal. A snapshot sink captures admitted data without rereading the caller;
3
+ * predicate-only validation allocates no payload copy and skips absent byte accounting.
4
+ * Limits bound admitted data, not arbitrary JavaScript executed inside Proxy traps.
5
+ */
2
6
  export declare function isJsonData(value: unknown, limits: {
3
7
  maxDepth: number;
4
8
  maxNodes: number;
5
- maxBytes: number;
9
+ maxBytes?: number;
6
10
  omitObjectUndefined: boolean;
11
+ }, snapshot?: {
12
+ value?: unknown;
7
13
  }): boolean;
8
14
  //# sourceMappingURL=json-data.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"json-data.d.ts","sourceRoot":"","sources":["../../src/internal/json-data.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,wBAAgB,UAAU,CACxB,KAAK,EAAE,OAAO,EACd,MAAM,EAAE;IACN,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,EAAE,OAAO,CAAC;CAC9B,GACA,OAAO,CA0DT"}
1
+ {"version":3,"file":"json-data.d.ts","sourceRoot":"","sources":["../../src/internal/json-data.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,OAAO,EACd,MAAM,EAAE;IACN,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,OAAO,CAAC;CAC9B,EACD,QAAQ,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAC7B,OAAO,CAgGT"}
@@ -0,0 +1,3 @@
1
+ /** Escaped JSON string size in UTF-8, stopping as soon as the byte budget is exceeded. */
2
+ export declare function jsonStringSize(text: string, budget: number): number;
3
+ //# sourceMappingURL=json-string-size.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-string-size.d.ts","sourceRoot":"","sources":["../../src/internal/json-string-size.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAoBnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"canonical-json.d.ts","sourceRoot":"","sources":["../../src/primitives/canonical-json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,QAAA,MAAM,0BAA0B;;;;kBAQ9B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,oFAAoF;AACpF,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,GAAE,oBAAyB,GAAG,MAAM,CAOxF"}
1
+ {"version":3,"file":"canonical-json.d.ts","sourceRoot":"","sources":["../../src/primitives/canonical-json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,QAAA,MAAM,0BAA0B;;;;kBAQ9B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,oFAAoF;AACpF,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,GAAE,oBAAyB,GAAG,MAAM,CAQxF"}
@@ -0,0 +1,12 @@
1
+ import type { NativeCommandSettlement } from './contract.js';
2
+ import type { NativeCommandTransport } from './transport.js';
3
+ /** One failure barrier, including a child whose transport setup never completed. */
4
+ export declare function cleanupNativeCommand(input: {
5
+ error: unknown;
6
+ transport?: NativeCommandTransport;
7
+ settle: (event: NativeCommandSettlement) => Promise<void>;
8
+ event?: NativeCommandSettlement;
9
+ signal: () => Promise<void>;
10
+ timeoutMs: number;
11
+ }): Promise<void>;
12
+ //# sourceMappingURL=cleanup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanup.d.ts","sourceRoot":"","sources":["../../src/process/cleanup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D,oFAAoF;AACpF,wBAAsB,oBAAoB,CAAC,KAAK,EAAE;IAChD,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,sBAAsB,CAAC;IACnC,MAAM,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,KAAK,CAAC,EAAE,uBAAuB,CAAC;IAChC,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBhB"}
@@ -0,0 +1,19 @@
1
+ import { type NativeCommandResult } from './contract.js';
2
+ /** Admission sees the same owner before transport setup and through terminal cleanup. */
3
+ export declare function createCommandLifetime(input: {
4
+ result: Promise<NativeCommandResult>;
5
+ controller: AbortController;
6
+ finished: () => boolean;
7
+ signal: () => Promise<void>;
8
+ cleanupTimeoutMs: number;
9
+ }): {
10
+ result: Promise<{
11
+ exitCode: number | null;
12
+ signal: string | null;
13
+ stdout: Uint8Array<ArrayBuffer>;
14
+ stderr: Uint8Array<ArrayBuffer>;
15
+ }>;
16
+ terminate(): Promise<void>;
17
+ stop(): Promise<void>;
18
+ };
19
+ //# sourceMappingURL=command-lifetime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-lifetime.d.ts","sourceRoot":"","sources":["../../src/process/command-lifetime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAG1E,yFAAyF;AACzF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC3C,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACrC,UAAU,EAAE,eAAe,CAAC;IAC5B,QAAQ,EAAE,MAAM,OAAO,CAAC;IACxB,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;CAC1B;IAKG,MAAM;;;;;;IACA,SAAS;IAoBT,IAAI;EAMb"}
@@ -3,9 +3,6 @@ import { type NativeCommandOptions } from './contract.js';
3
3
  import { type NativeCommandLaunchDriver } from './launch.js';
4
4
  /** One-shot native execution; sandbox policy/admission is composed above this owner. */
5
5
  export declare function startNativeCommand(input: NativeCommandOptions, onSpawn?: (child: ChildProcessWithoutNullStreams) => void, driver?: NativeCommandLaunchDriver): {
6
- result: Promise<never>;
7
- stop(): Promise<void>;
8
- } | {
9
6
  result: Promise<{
10
7
  exitCode: number | null;
11
8
  signal: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"command-owner.d.ts","sourceRoot":"","sources":["../../src/process/command-owner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAEzE,OAAO,EAEL,KAAK,oBAAoB,EAG1B,MAAM,YAAY,CAAC;AAOpB,OAAO,EAEL,KAAK,yBAAyB,EAG/B,MAAM,UAAU,CAAC;AAIlB,wFAAwF;AACxF,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,oBAAoB,EAC3B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,8BAA8B,KAAK,IAAI,EACzD,MAAM,CAAC,EAAE,yBAAyB;;;;;;;;;;;;EA+LnC"}
1
+ {"version":3,"file":"command-owner.d.ts","sourceRoot":"","sources":["../../src/process/command-owner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAIzE,OAAO,EAEL,KAAK,oBAAoB,EAG1B,MAAM,YAAY,CAAC;AAEpB,OAAO,EAEL,KAAK,yBAAyB,EAG/B,MAAM,UAAU,CAAC;AAMlB,wFAAwF;AACxF,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,oBAAoB,EAC3B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,8BAA8B,KAAK,IAAI,EACzD,MAAM,CAAC,EAAE,yBAAyB;;;;;;;;;EA4JnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../../src/process/group.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,+FAA+F;AAC/F,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO;IAapE,MAAM;IACN,MAAM;EAIT;AAWD,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAOjF;AAiCD,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,OAAO,EAAE,MAAM,EACf,gBAAgB,SAAO,EACvB,KAAK,UAAQ,GACZ,OAAO,CAAC,IAAI,CAAC,CAaf;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,kBAAkB,CAItE;AAED,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAMxF"}
1
+ {"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../../src/process/group.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,+FAA+F;AAC/F,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO;IAapE,MAAM;IACN,MAAM;EAIT;AAWD,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAOjF;AAmCD,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,OAAO,EAAE,MAAM,EACf,gBAAgB,SAAO,EACvB,KAAK,UAAQ,GACZ,OAAO,CAAC,IAAI,CAAC,CAef;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,kBAAkB,CAItE;AAED,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAMxF"}
@@ -1,5 +1,7 @@
1
- import { type ChildProcessWithoutNullStreams } from 'node:child_process';
1
+ import type { ChildProcessWithoutNullStreams } from 'node:child_process';
2
+ import { Readable } from 'node:stream';
2
3
  import { type ParsedNativeCommandOptions } from './contract.js';
4
+ import { type NativeCommandTransport } from './transport.js';
3
5
  /** A structural host launcher may supply pipes without importing Node ambient types. */
4
6
  export interface NativeCommandLaunchedProcess {
5
7
  readonly pid?: number;
@@ -11,7 +13,7 @@ export interface NativeCommandLaunchedProcess {
11
13
  on(event: 'error', listener: (error: Error) => void): unknown;
12
14
  on(event: 'exit' | 'close', listener: (code: number | null, signal: string | null) => void): unknown;
13
15
  }
14
- interface NativeCommandLaunchedOutput {
16
+ export interface NativeCommandLaunchedOutput {
15
17
  readonly destroyed: boolean;
16
18
  on(event: 'data', listener: (chunk: Uint8Array) => void): unknown;
17
19
  destroy(): unknown;
@@ -40,10 +42,11 @@ interface NativeCommandOwner {
40
42
  export declare function registerNativeCommandOwner(child: object, owner: NativeCommandOwner): void;
41
43
  export declare function nativeCommandOwner(child: object): NativeCommandOwner | undefined;
42
44
  /** Install every observation before starting stdin or invoking an admission callback. */
43
- export declare function launchNativeCommand(options: ParsedNativeCommandOptions, driver: NativeCommandLaunchDriver | undefined, onSpawn: ((child: ChildProcessWithoutNullStreams) => void) | undefined, onFailure: (error: Error) => void, onInputFailure: (error: Error) => void): {
44
- child: NativeCommandLaunchedProcess;
45
+ export declare function launchNativeCommand(options: ParsedNativeCommandOptions, driver: NativeCommandLaunchDriver | undefined, onSpawn: ((child: ChildProcessWithoutNullStreams) => void) | undefined, onFailure: (error: Error) => void, onInputFailure: (error: Error) => void, onAcquired: (transport: NativeCommandTransport) => void): {
45
46
  stdout: AsyncIterable<Uint8Array<ArrayBufferLike>>;
46
47
  stderr: AsyncIterable<Uint8Array<ArrayBufferLike>>;
48
+ start(): void;
49
+ child: NativeCommandLaunchedProcess;
47
50
  leader: Promise<{
48
51
  kind: "exit";
49
52
  exitCode: number | null;
@@ -56,9 +59,15 @@ export declare function launchNativeCommand(options: ParsedNativeCommandOptions,
56
59
  exitCode: number | null;
57
60
  signal: string | null;
58
61
  }>;
59
- released: Promise<[boolean, ...boolean[]]>;
62
+ released: Promise<void>;
60
63
  pendingHandles: Set<string>;
61
- start(): void;
64
+ stdin: import("node:stream").Writable | undefined;
65
+ observe(onFailure: (cause: Error) => void): void;
66
+ capture(): {
67
+ stdout: NativeCommandLaunchedOutput | Readable;
68
+ stderr: NativeCommandLaunchedOutput | Readable;
69
+ };
70
+ pipeDestructor(name: 'stdout' | 'stderr', destroy: () => unknown): void;
62
71
  destroy(): void;
63
72
  };
64
73
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"launch.d.ts","sourceRoot":"","sources":["../../src/process/launch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,8BAA8B,EAAS,MAAM,oBAAoB,CAAC;AAEhF,OAAO,EAGL,KAAK,0BAA0B,EAChC,MAAM,YAAY,CAAC;AAEpB,wFAAwF;AACxF,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,2BAA2B,CAAC;IAC7C,QAAQ,CAAC,MAAM,EAAE,2BAA2B,CAAC;IAC7C,IAAI,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;IACjC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,OAAO,CAAC;IAC9D,EAAE,CACA,KAAK,EAAE,MAAM,GAAG,OAAO,EACvB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,GAC7D,OAAO,CAAC;CACZ;AAED,UAAU,2BAA2B;IACnC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,K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,4BAA4B,CAAC;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,8EAA8E;AAC9E,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,0BAA0B,EACnC,MAAM,EAAE,yBAAyB,GAAG,SAAS;;;EAY9C;AAED,UAAU,kBAAkB;IAC1B,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACzB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B;AAGD,uFAAuF;AACvF,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAEzF;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAEhF;AAwED,yFAAyF;AACzF,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,0BAA0B,EACnC,MAAM,EAAE,yBAAyB,GAAG,SAAS,EAC7C,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,8BAA8B,KAAK,IAAI,CAAC,GAAG,SAAS,EACtE,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,EACjC,cAAc,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,EACtC,UAAU,EAAE,CAAC,SAAS,EAAE,sBAAsB,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8CxD"}
@@ -0,0 +1,10 @@
1
+ /** Only this native spawn can establish group ownership; structural PIDs cannot. */
2
+ export declare function spawnOwnedCommand(input: {
3
+ executable: string;
4
+ args: readonly string[];
5
+ cwd?: string;
6
+ env?: NodeJS.ProcessEnv;
7
+ group: boolean;
8
+ }): import("node:child_process").ChildProcessWithoutNullStreams;
9
+ export declare function ownsCommandGroup(child: object): boolean;
10
+ //# sourceMappingURL=owned-child.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"owned-child.d.ts","sourceRoot":"","sources":["../../src/process/owned-child.ts"],"names":[],"mappings":"AAIA,oFAAoF;AACpF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,KAAK,EAAE,OAAO,CAAC;CAChB,+DASA;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEvD"}
@@ -1,7 +1,4 @@
1
- import { type NativeCommandSettlement } from './contract.js';
1
+ import { NativeCommandError } from './contract.js';
2
2
  /** A failed native admission still owns one bounded external-resource settlement. */
3
- export declare function failedCommandStart(cause: unknown, settle: (event: NativeCommandSettlement) => Promise<void>): {
4
- result: Promise<never>;
5
- stop(): Promise<void>;
6
- };
3
+ export declare function failedCommandStart(cause: unknown, cleanup: (error: NativeCommandError) => Promise<void>): Promise<never>;
7
4
  //# sourceMappingURL=start-failure.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"start-failure.d.ts","sourceRoot":"","sources":["../../src/process/start-failure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAG9E,qFAAqF;AACrF,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,OAAO,CAAC,IAAI,CAAC;;;EAyB1D"}
1
+ {"version":3,"file":"start-failure.d.ts","sourceRoot":"","sources":["../../src/process/start-failure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,qFAAqF;AACrF,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,GACpD,OAAO,CAAC,KAAK,CAAC,CAMhB"}
@@ -0,0 +1,30 @@
1
+ import { Readable, Writable } from 'node:stream';
2
+ import type { NativeCommandLaunchedOutput, NativeCommandLaunchedProcess } from './launch.js';
3
+ /** Acquired before subscriptions: failed setup and normal execution own the same handles. */
4
+ export declare function createCommandTransport(child: NativeCommandLaunchedProcess): {
5
+ child: NativeCommandLaunchedProcess;
6
+ leader: Promise<{
7
+ kind: "exit";
8
+ exitCode: number | null;
9
+ signal: string | null;
10
+ } | {
11
+ kind: "error";
12
+ cause: unknown;
13
+ }>;
14
+ closed: Promise<{
15
+ exitCode: number | null;
16
+ signal: string | null;
17
+ }>;
18
+ released: Promise<void>;
19
+ pendingHandles: Set<string>;
20
+ readonly stdin: Writable | undefined;
21
+ observe(onFailure: (cause: Error) => void): void;
22
+ capture(): {
23
+ stdout: NativeCommandLaunchedOutput | Readable;
24
+ stderr: NativeCommandLaunchedOutput | Readable;
25
+ };
26
+ pipeDestructor(name: 'stdout' | 'stderr', destroy: () => unknown): void;
27
+ destroy(): void;
28
+ };
29
+ export type NativeCommandTransport = ReturnType<typeof createCommandTransport>;
30
+ //# sourceMappingURL=transport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/process/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,KAAK,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAE1F,6FAA6F;AAC7F,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,4BAA4B;;;;;;;;;;;kBAEvB,MAAM,GAAG,IAAI;gBAAU,MAAM,GAAG,IAAI;;;;;uBA6BhE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI;;;;;yBAkCpB,QAAQ,GAAG,QAAQ,WAAW,MAAM,OAAO;;EAmBnE;AAED,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -12,6 +12,8 @@ export interface FieldInfo {
12
12
  /** A `number` field that only accepts integers — named in its coercion error. */
13
13
  integer?: boolean;
14
14
  }
15
+ /** Admit each raw occurrence before scalar coercion can discard a value. */
16
+ export declare function appendCliOptionValue(raw: Map<string, string[]>, name: string, value: string, info: FieldInfo | undefined): void;
15
17
  /**
16
18
  * Map a merged tool schema to per-field kind info — what each `--flag` should
17
19
  * coerce to. Object members of unions and intersections contribute their
@@ -1 +1 @@
1
- {"version":3,"file":"args-fields.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/args-fields.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,MAAM,GACN,OAAO,GACP,QAAQ,GACR,OAAO,CAAC;AAEZ,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,uEAAuE;IACvE,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,iFAAiF;IACjF,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AA6ED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,SAAS,GAAG,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAI1F;AAKD,4GAA4G;AAC5G;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAI/E;AA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
@@ -15,6 +15,12 @@ Also read:
15
15
  ---
16
16
  title: Optional process sandbox
17
17
  description: Linux namespace isolation, durable workspaces and a host credential gateway.
18
+ updated: 2026-10-03 14:47 +07:00
19
+ participants:
20
+ - role: implemented
21
+ harness: Codex
22
+ model: GPT-6
23
+ at: 2026-10-03 14:47 +07:00
18
24
  ---
19
25
 
20
26
  # Optional process sandbox
@@ -84,7 +90,9 @@ Unsupported backends omit the binding and the factory refuses explicitly.
84
90
  Stop also kills coding commands. Both launch paths share the configured
85
91
  `maxConcurrentCommands` admission limit (default 8); an occupied slot gives
86
92
  `SANDBOX_BUSY` before another process starts. This counts direct commands, not
87
- guest descendants. Required restrictions are checked again during preparation;
93
+ guest descendants. A direct launch retains its slot through terminal group cleanup,
94
+ including descendants that outlive the leader. Required restrictions are checked again
95
+ during preparation;
88
96
  a network-policy change invalidates an outstanding prepared launch. After
89
97
  reconnect, create the coding profile from the new handle; old tools remain stopped.
90
98
 
package/llms/cli.txt CHANGED
@@ -206,6 +206,16 @@ there stays a positional, and `--` makes a literal `false` one too. The same
206
206
  holds for a short alias, a framework flag such as `--json false` and an
207
207
  application option.
208
208
 
209
+ Every declared non-array option is single-use, including framework and
210
+ application globals. Bare, separate-value, inline, negative and short-alias
211
+ forms of a command option count as the same name: `--active=false --active`,
212
+ `--active false --no-active` and `-f --active` are argument errors even when
213
+ the values agree. Duplicates are refused before command execution. Array
214
+ options accumulate across long and short forms; unknown non-dotted passthrough
215
+ options retain their raw-list grammar. Tokens after `--` are literal data.
216
+ Command `--help` and `-h` keep their diagnostic precedence over malformed
217
+ operation arguments; application globals are validated before routing.
218
+
209
219
  Without presentation configuration, positional arguments fill non-boolean
210
220
  fields in declaration order, so `myapp generate "a fox"` is
211
221
  `--prompt "a fox"`. A piped value fills the first required unset field: