stitchkit 0.103.11 → 0.103.12
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/CHANGELOG.md +19 -0
- package/dist/agent-runtime/coding-shell-process.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox-process-owner.d.ts +1 -1
- package/dist/agent-runtime/sandbox-process-owner.d.ts.map +1 -1
- package/dist/durability/json.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/coding-tools.js +2 -2
- package/dist/entrypoints/agent-runtime/harness.js +2 -2
- package/dist/entrypoints/agent-runtime/sandbox.js +20 -16
- package/dist/entrypoints/agent-runtime.js +2 -2
- package/dist/entrypoints/application/diagnostic-journal.js +1 -1
- package/dist/entrypoints/files.js +1 -1
- package/dist/entrypoints/primitives.js +4 -3
- package/dist/entrypoints/process.js +1 -1
- package/dist/entrypoints/tools.js +1 -1
- package/dist/{index-ary5s7k0.js → index-69nvze1q.js} +1 -2
- package/dist/{index-g4jxe7ve.js → index-806d5phm.js} +3 -2
- package/dist/{index-32jkwkdm.js → index-f330qqyg.js} +253 -165
- package/dist/index-fm1c1a08.js +138 -0
- package/dist/{index-ttf0y7b8.js → index-xvdd2rbb.js} +37 -18
- package/dist/{index-9jb61j5a.js → index-zp4jpkp0.js} +1 -1
- package/dist/internal/exclusive-lock.d.ts +1 -1
- package/dist/internal/exclusive-lock.d.ts.map +1 -1
- package/dist/internal/json-data.d.ts +8 -2
- package/dist/internal/json-data.d.ts.map +1 -1
- package/dist/internal/json-string-size.d.ts +3 -0
- package/dist/internal/json-string-size.d.ts.map +1 -0
- package/dist/primitives/canonical-json.d.ts.map +1 -1
- package/dist/process/cleanup.d.ts +12 -0
- package/dist/process/cleanup.d.ts.map +1 -0
- package/dist/process/command-lifetime.d.ts +19 -0
- package/dist/process/command-lifetime.d.ts.map +1 -0
- package/dist/process/command-owner.d.ts +0 -3
- package/dist/process/command-owner.d.ts.map +1 -1
- package/dist/process/group.d.ts.map +1 -1
- package/dist/process/launch.d.ts +15 -6
- package/dist/process/launch.d.ts.map +1 -1
- package/dist/process/owned-child.d.ts +10 -0
- package/dist/process/owned-child.d.ts.map +1 -0
- package/dist/process/start-failure.d.ts +2 -5
- package/dist/process/start-failure.d.ts.map +1 -1
- package/dist/process/transport.d.ts +30 -0
- package/dist/process/transport.d.ts.map +1 -0
- package/llms/agent-runtime-sandbox.txt +9 -1
- package/llms/process.txt +29 -4
- package/llms-full.txt +38 -5
- package/llms.txt +2 -2
- package/package.json +1 -1
- package/dist/index-c1jmtxa0.js +0 -74
|
@@ -100,6 +100,7 @@ async function diagnose(owner, declaredIdentity) {
|
|
|
100
100
|
return { attribution, liveness: "not-probed", owner };
|
|
101
101
|
return { attribution, ...await probeProcessOwner2(owner.pid, owner.process), owner };
|
|
102
102
|
}
|
|
103
|
+
var MAX_RECLAIM_DEPTH = 16;
|
|
103
104
|
async function readLockFile(path, onFailure, signal) {
|
|
104
105
|
try {
|
|
105
106
|
const record = await readLockRecord(path, undefined, signal);
|
|
@@ -180,33 +181,45 @@ function reclaimable(state, diagnosis, graceMs) {
|
|
|
180
181
|
return diagnosis.liveness === "gone";
|
|
181
182
|
return typeof graceMs === "number" && Date.now() - state.mtimeMs >= graceMs;
|
|
182
183
|
}
|
|
183
|
-
async function reclaimUnderGuard(path, options) {
|
|
184
|
+
async function reclaimUnderGuard(path, options, depth) {
|
|
184
185
|
const guardPath = `${path}.reclaim`;
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
186
|
+
if (depth >= MAX_RECLAIM_DEPTH)
|
|
187
|
+
return {
|
|
188
|
+
refused: true,
|
|
189
|
+
cause: new Error(`Exclusive lock reclaim guard recovery depth exceeds ${MAX_RECLAIM_DEPTH}`)
|
|
190
|
+
};
|
|
191
|
+
let acquired;
|
|
192
|
+
try {
|
|
193
|
+
acquired = await attemptExclusiveLock(guardPath, {
|
|
194
|
+
...options,
|
|
195
|
+
ownerlessGraceMs: options.ownerlessGraceMs === undefined ? 5000 : options.ownerlessGraceMs
|
|
196
|
+
}, depth + 1);
|
|
197
|
+
} catch (cause) {
|
|
198
|
+
if (!isCode(cause, "ENAMETOOLONG"))
|
|
199
|
+
throw cause;
|
|
200
|
+
return { refused: true, cause };
|
|
201
|
+
}
|
|
189
202
|
if (!("held" in acquired))
|
|
190
|
-
return;
|
|
203
|
+
return { refused: true, cause: acquired.diagnosis?.cause ?? acquired.error };
|
|
191
204
|
const guard = acquired.held;
|
|
192
205
|
try {
|
|
193
|
-
let
|
|
194
|
-
const state = await readLockFile(path, () => {
|
|
195
|
-
|
|
206
|
+
let readFailure;
|
|
207
|
+
const state = await readLockFile(path, (cause) => {
|
|
208
|
+
readFailure = cause;
|
|
196
209
|
}, options.signal);
|
|
197
|
-
if (
|
|
198
|
-
return
|
|
210
|
+
if (readFailure !== undefined)
|
|
211
|
+
return { refused: true, cause: readFailure };
|
|
199
212
|
if (state) {
|
|
200
213
|
const diagnosis = await diagnose(state.owner, options.machineIdentity);
|
|
201
214
|
if (options.signal?.aborted)
|
|
202
|
-
return
|
|
215
|
+
return { refused: true };
|
|
203
216
|
if (!reclaimable(state, diagnosis, options.ownerlessGraceMs))
|
|
204
|
-
return
|
|
217
|
+
return { refused: true, cause: diagnosis.cause };
|
|
205
218
|
await unlinkIfSame(path, state.ino, state.dev);
|
|
206
219
|
}
|
|
207
220
|
return await createOwned(path, options, state !== undefined).catch((error) => {
|
|
208
221
|
if (isCode(error, "EEXIST"))
|
|
209
|
-
return
|
|
222
|
+
return { refused: true, cause: error };
|
|
210
223
|
throw error;
|
|
211
224
|
});
|
|
212
225
|
} finally {
|
|
@@ -215,7 +228,7 @@ async function reclaimUnderGuard(path, options) {
|
|
|
215
228
|
});
|
|
216
229
|
}
|
|
217
230
|
}
|
|
218
|
-
async function attemptExclusiveLock(path, options) {
|
|
231
|
+
async function attemptExclusiveLock(path, options, depth = 0) {
|
|
219
232
|
try {
|
|
220
233
|
return { held: await createOwned(path, options, false) };
|
|
221
234
|
} catch (error) {
|
|
@@ -236,10 +249,16 @@ async function attemptExclusiveLock(path, options) {
|
|
|
236
249
|
if (!state || !reclaimable(state, diagnosis, options.ownerlessGraceMs)) {
|
|
237
250
|
return { error, diagnosis };
|
|
238
251
|
}
|
|
239
|
-
const reclaimed = await reclaimUnderGuard(path, options);
|
|
240
|
-
if (
|
|
252
|
+
const reclaimed = await reclaimUnderGuard(path, options, depth);
|
|
253
|
+
if (!("refused" in reclaimed))
|
|
241
254
|
return { held: reclaimed };
|
|
242
|
-
return {
|
|
255
|
+
return {
|
|
256
|
+
error,
|
|
257
|
+
diagnosis: {
|
|
258
|
+
...diagnosis,
|
|
259
|
+
...reclaimed.cause !== undefined && { cause: reclaimed.cause }
|
|
260
|
+
}
|
|
261
|
+
};
|
|
243
262
|
}
|
|
244
263
|
}
|
|
245
264
|
|
|
@@ -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,wBAAw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C,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
|
-
/**
|
|
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
|
|
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":"
|
|
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 @@
|
|
|
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,
|
|
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;
|
|
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;
|
|
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"}
|
package/dist/process/launch.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
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<
|
|
62
|
+
released: Promise<void>;
|
|
60
63
|
pendingHandles: Set<string>;
|
|
61
|
-
|
|
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,
|
|
1
|
+
{"version":3,"file":"launch.d.ts","sourceRoot":"","sources":["../../src/process/launch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAsB,KAAK,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAEjF,OAAO,EAA0B,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAElF,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,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAA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;;;;;;;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 {
|
|
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,
|
|
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,
|
|
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"}
|
|
@@ -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.
|
|
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/process.txt
CHANGED
|
@@ -15,7 +15,7 @@ description: Native IO для Bun и Node, с явно выбранной durabi
|
|
|
15
15
|
type: guide
|
|
16
16
|
status: active
|
|
17
17
|
created: 2026-10-01 20:44 +07:00
|
|
18
|
-
updated: 2026-10-
|
|
18
|
+
updated: 2026-10-03 13:36 +07:00
|
|
19
19
|
participants:
|
|
20
20
|
- role: authored
|
|
21
21
|
harness: Codex
|
|
@@ -25,6 +25,10 @@ participants:
|
|
|
25
25
|
harness: Codex
|
|
26
26
|
model: GPT-6
|
|
27
27
|
at: 2026-10-02 00:08 +07:00
|
|
28
|
+
- role: implemented
|
|
29
|
+
harness: Codex
|
|
30
|
+
model: GPT-6
|
|
31
|
+
at: 2026-10-03 13:36 +07:00
|
|
28
32
|
---
|
|
29
33
|
|
|
30
34
|
# Native IO
|
|
@@ -227,9 +231,10 @@ independent of umask. Default `0600` stays private. Shared `0640` requires a com
|
|
|
227
231
|
traversable directories; another UID also needs directory write permission to reclaim a
|
|
228
232
|
proven-dead owner's file. Set `ownerlessGraceMs: null` to refuse every age-only reclaim,
|
|
229
233
|
including ownerless reclaim guards. The default remains 5000 ms for existing clients.
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
234
|
+
Stale reclaim guards use the same lock owner and a child guard for the inode check and
|
|
235
|
+
unlink. Recovery depth is capped at 16; a deeper stale chain refuses recovery with a depth diagnosis retained as the cause of
|
|
236
|
+
the bounded `LOCK_TIMEOUT`. Live owners, unknown process-lifetime evidence and unsafe records are never
|
|
237
|
+
reclaimed. Concurrent writers cannot bypass a guard while a prior unlink is paused.
|
|
233
238
|
|
|
234
239
|
## Libraries with a Zod-only runtime
|
|
235
240
|
|
|
@@ -259,6 +264,26 @@ Stitchkit leaf fails there. A separate schema-only entry must not import the nat
|
|
|
259
264
|
This delivery removes a runtime kernel installation; it does not remove the build-time
|
|
260
265
|
Stitchkit installation or create an independent lightweight npm package.
|
|
261
266
|
|
|
267
|
+
## Qualification boundaries
|
|
268
|
+
|
|
269
|
+
Native command cleanup owns the child before launch subscriptions are installed. Setup
|
|
270
|
+
refusal still settles leader closure and teardown within the cleanup budget; failure to
|
|
271
|
+
prove closure reports `COMMAND_CLEANUP` with the original failure retained. Process-group
|
|
272
|
+
signaling requires evidence from the actual detached launcher, not a structural PID field.
|
|
273
|
+
The built-in sandbox transport carries that ownership across the package's split entrypoints.
|
|
274
|
+
Internal finite deadlines and Darwin retry admission use monotonic elapsed time.
|
|
275
|
+
|
|
276
|
+
Linux UID-refusal qualification is a separate privileged installed-package proof in Bun
|
|
277
|
+
and real Node; an unsupported platform or insufficient UID reports an explicit skip.
|
|
278
|
+
A generic native-owner marker does not certify the privileged case. Real Darwin CI remains
|
|
279
|
+
the qualification for native Darwin behavior.
|
|
280
|
+
|
|
281
|
+
Local filesystem tests do not attest delayed NFS visibility, shared-volume microVM or gVisor
|
|
282
|
+
ownership, actual PGID reuse, power-loss durability or macOS full-sync behavior. Those
|
|
283
|
+
require their actual topology or failure environment. The default ownerless grace remains
|
|
284
|
+
5000 ms; stricter callers can retain `ownerlessGraceMs: null`. No age-only observation
|
|
285
|
+
proves a partially published owner's process dead.
|
|
286
|
+
|
|
262
287
|
==============================================================================
|
|
263
288
|
# API reference: `stitchkit/process` (docs/api/reference.md)
|
|
264
289
|
==============================================================================
|
package/llms-full.txt
CHANGED
|
@@ -7900,6 +7900,12 @@ boundary is required. Send and projection callbacks own their external deadlines
|
|
|
7900
7900
|
---
|
|
7901
7901
|
title: Optional process sandbox
|
|
7902
7902
|
description: Linux namespace isolation, durable workspaces and a host credential gateway.
|
|
7903
|
+
updated: 2026-10-03 14:47 +07:00
|
|
7904
|
+
participants:
|
|
7905
|
+
- role: implemented
|
|
7906
|
+
harness: Codex
|
|
7907
|
+
model: GPT-6
|
|
7908
|
+
at: 2026-10-03 14:47 +07:00
|
|
7903
7909
|
---
|
|
7904
7910
|
|
|
7905
7911
|
# Optional process sandbox
|
|
@@ -7969,7 +7975,9 @@ Unsupported backends omit the binding and the factory refuses explicitly.
|
|
|
7969
7975
|
Stop also kills coding commands. Both launch paths share the configured
|
|
7970
7976
|
`maxConcurrentCommands` admission limit (default 8); an occupied slot gives
|
|
7971
7977
|
`SANDBOX_BUSY` before another process starts. This counts direct commands, not
|
|
7972
|
-
guest descendants.
|
|
7978
|
+
guest descendants. A direct launch retains its slot through terminal group cleanup,
|
|
7979
|
+
including descendants that outlive the leader. Required restrictions are checked again
|
|
7980
|
+
during preparation;
|
|
7973
7981
|
a network-policy change invalidates an outstanding prepared launch. After
|
|
7974
7982
|
reconnect, create the coding profile from the new handle; old tools remain stopped.
|
|
7975
7983
|
|
|
@@ -8037,7 +8045,7 @@ description: Native IO для Bun и Node, с явно выбранной durabi
|
|
|
8037
8045
|
type: guide
|
|
8038
8046
|
status: active
|
|
8039
8047
|
created: 2026-10-01 20:44 +07:00
|
|
8040
|
-
updated: 2026-10-
|
|
8048
|
+
updated: 2026-10-03 13:36 +07:00
|
|
8041
8049
|
participants:
|
|
8042
8050
|
- role: authored
|
|
8043
8051
|
harness: Codex
|
|
@@ -8047,6 +8055,10 @@ participants:
|
|
|
8047
8055
|
harness: Codex
|
|
8048
8056
|
model: GPT-6
|
|
8049
8057
|
at: 2026-10-02 00:08 +07:00
|
|
8058
|
+
- role: implemented
|
|
8059
|
+
harness: Codex
|
|
8060
|
+
model: GPT-6
|
|
8061
|
+
at: 2026-10-03 13:36 +07:00
|
|
8050
8062
|
---
|
|
8051
8063
|
|
|
8052
8064
|
# Native IO
|
|
@@ -8249,9 +8261,10 @@ independent of umask. Default `0600` stays private. Shared `0640` requires a com
|
|
|
8249
8261
|
traversable directories; another UID also needs directory write permission to reclaim a
|
|
8250
8262
|
proven-dead owner's file. Set `ownerlessGraceMs: null` to refuse every age-only reclaim,
|
|
8251
8263
|
including ownerless reclaim guards. The default remains 5000 ms for existing clients.
|
|
8252
|
-
|
|
8253
|
-
|
|
8254
|
-
|
|
8264
|
+
Stale reclaim guards use the same lock owner and a child guard for the inode check and
|
|
8265
|
+
unlink. Recovery depth is capped at 16; a deeper stale chain refuses recovery with a depth diagnosis retained as the cause of
|
|
8266
|
+
the bounded `LOCK_TIMEOUT`. Live owners, unknown process-lifetime evidence and unsafe records are never
|
|
8267
|
+
reclaimed. Concurrent writers cannot bypass a guard while a prior unlink is paused.
|
|
8255
8268
|
|
|
8256
8269
|
## Libraries with a Zod-only runtime
|
|
8257
8270
|
|
|
@@ -8281,6 +8294,26 @@ Stitchkit leaf fails there. A separate schema-only entry must not import the nat
|
|
|
8281
8294
|
This delivery removes a runtime kernel installation; it does not remove the build-time
|
|
8282
8295
|
Stitchkit installation or create an independent lightweight npm package.
|
|
8283
8296
|
|
|
8297
|
+
## Qualification boundaries
|
|
8298
|
+
|
|
8299
|
+
Native command cleanup owns the child before launch subscriptions are installed. Setup
|
|
8300
|
+
refusal still settles leader closure and teardown within the cleanup budget; failure to
|
|
8301
|
+
prove closure reports `COMMAND_CLEANUP` with the original failure retained. Process-group
|
|
8302
|
+
signaling requires evidence from the actual detached launcher, not a structural PID field.
|
|
8303
|
+
The built-in sandbox transport carries that ownership across the package's split entrypoints.
|
|
8304
|
+
Internal finite deadlines and Darwin retry admission use monotonic elapsed time.
|
|
8305
|
+
|
|
8306
|
+
Linux UID-refusal qualification is a separate privileged installed-package proof in Bun
|
|
8307
|
+
and real Node; an unsupported platform or insufficient UID reports an explicit skip.
|
|
8308
|
+
A generic native-owner marker does not certify the privileged case. Real Darwin CI remains
|
|
8309
|
+
the qualification for native Darwin behavior.
|
|
8310
|
+
|
|
8311
|
+
Local filesystem tests do not attest delayed NFS visibility, shared-volume microVM or gVisor
|
|
8312
|
+
ownership, actual PGID reuse, power-loss durability or macOS full-sync behavior. Those
|
|
8313
|
+
require their actual topology or failure environment. The default ownerless grace remains
|
|
8314
|
+
5000 ms; stricter callers can retain `ownerlessGraceMs: null`. No age-only observation
|
|
8315
|
+
proves a partially published owner's process dead.
|
|
8316
|
+
|
|
8284
8317
|
|
|
8285
8318
|
==============================================================================
|
|
8286
8319
|
# Guide: Generic application primitives (docs/guide/primitives.md)
|
package/llms.txt
CHANGED
|
@@ -38,7 +38,7 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
|
|
|
38
38
|
- **stitchkit/application/diagnostic-journal**: [llms/application-diagnostic-journal.txt](llms/application-diagnostic-journal.txt) 1.8 KB
|
|
39
39
|
- **stitchkit/application/schemas**: [llms/application-schemas.txt](llms/application-schemas.txt) 1.8 KB
|
|
40
40
|
- **stitchkit/testing**: [llms/testing.txt](llms/testing.txt) 30.8 KB
|
|
41
|
-
- **stitchkit/agent-runtime/sandbox**: [llms/agent-runtime-sandbox.txt](llms/agent-runtime-sandbox.txt) 8.
|
|
41
|
+
- **stitchkit/agent-runtime/sandbox**: [llms/agent-runtime-sandbox.txt](llms/agent-runtime-sandbox.txt) 8.3 KB
|
|
42
42
|
- **stitchkit/files**: [llms/files.txt](llms/files.txt) 4.5 KB
|
|
43
43
|
- **stitchkit/telegram**: [llms/telegram.txt](llms/telegram.txt) 26.9 KB
|
|
44
44
|
- **stitchkit/telegram/html**: [llms/telegram-html.txt](llms/telegram-html.txt) 2.7 KB
|
|
@@ -55,7 +55,7 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
|
|
|
55
55
|
- **stitchkit/agent-runtime/react**: [llms/agent-runtime-react.txt](llms/agent-runtime-react.txt) 1.0 KB
|
|
56
56
|
- **stitchkit/agent-runtime/realtime**: [llms/agent-runtime-realtime.txt](llms/agent-runtime-realtime.txt) 1.8 KB
|
|
57
57
|
- **stitchkit/agent-runtime/harness-tools**: [llms/agent-runtime-harness-tools.txt](llms/agent-runtime-harness-tools.txt) 1.3 KB
|
|
58
|
-
- **stitchkit/process**: [llms/process.txt](llms/process.txt)
|
|
58
|
+
- **stitchkit/process**: [llms/process.txt](llms/process.txt) 20.0 KB
|
|
59
59
|
|
|
60
60
|
## Upgrading slices
|
|
61
61
|
- **Upgrading — how to move across versions**: [llms/upgrading.txt](llms/upgrading.txt) 10.3 KB
|
package/package.json
CHANGED