@foldrun/core 18.2.0 → 18.3.0
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/dist/src/platform.d.ts +5 -0
- package/dist/src/run-container.d.ts +12 -0
- package/dist/src/run-container.js +6 -0
- package/dist/src/runner.d.ts +4 -1
- package/dist/src/runner.js +24 -2
- package/dist/src/scan.js +3 -0
- package/dist/src/snapshot-archive.js +4 -0
- package/dist/src/store.d.ts +7 -0
- package/package.json +1 -1
- package/src/platform.ts +5 -0
- package/src/run-container.ts +14 -0
- package/src/runner.ts +25 -1
- package/src/scan.ts +3 -0
- package/src/snapshot-archive.ts +3 -0
- package/src/store.ts +5 -0
package/dist/src/platform.d.ts
CHANGED
|
@@ -163,6 +163,11 @@ export interface PlatformHooks {
|
|
|
163
163
|
* trace as not enforced.
|
|
164
164
|
*/
|
|
165
165
|
confinesBrowsing?(isolation: string): boolean;
|
|
166
|
+
/** Can this executor run a snapshot step (RunInContainerArgs.snapshot:
|
|
167
|
+
* stage the folder, give back outputs/ alone, make the patch)? A run with a
|
|
168
|
+
* snapshot on any executor that cannot fails before anything starts.
|
|
169
|
+
* Default: none can. */
|
|
170
|
+
holdsSnapshot?(isolation: string): boolean;
|
|
166
171
|
/**
|
|
167
172
|
* Does this isolation mode wall a step whose `network:` is restricted and
|
|
168
173
|
* enforced to the egress proxy alone (a `filtered` pod)? True: such a
|
|
@@ -279,6 +279,10 @@ export declare const APPLY_MTIMES_JS: string;
|
|
|
279
279
|
*/
|
|
280
280
|
export declare function mergeAppends(was: Buffer | string | null, host: Buffer, next: Buffer): Buffer | null;
|
|
281
281
|
export interface ApplyOptions {
|
|
282
|
+
/** Take back only what is under this workspace-relative folder (with its
|
|
283
|
+
* trailing `/`) — a snapshot run's outputs (Part B3): the folder it was
|
|
284
|
+
* given, and anything it copied anywhere else, never reach the workspace. */
|
|
285
|
+
keepOnly?: string;
|
|
282
286
|
/** What the host handed back into this sandbox mid-step — a `sandbox: own`
|
|
283
287
|
* job's files (delegate-tools.ts), path → sha256 — as the HOST recorded
|
|
284
288
|
* it (StepRecord.handedBack). The sandbox's own note of the same is only
|
|
@@ -576,6 +580,14 @@ export declare function dockerCpus(cpus: string, available?: number): string | n
|
|
|
576
580
|
export declare function heldCores(cpus: string, isolation: string | undefined, available?: number): number;
|
|
577
581
|
export interface RunInContainerArgs {
|
|
578
582
|
workspaceRoot: string;
|
|
583
|
+
/** A snapshot run (Part B3): the folder a person sent, by id, for this
|
|
584
|
+
* step to work on. Only an executor that says it can (`supportsSnapshot`
|
|
585
|
+
* on its IsolatedStepRunner) is ever given one: it stages the folder at
|
|
586
|
+
* agents/<name>/snapshot/, takes back only that agent's outputs/, and
|
|
587
|
+
* leaves the patch there as outputs/snapshot.patch. */
|
|
588
|
+
snapshot?: {
|
|
589
|
+
id: string;
|
|
590
|
+
};
|
|
579
591
|
/** A person approved this step before it ran: configuration and code it
|
|
580
592
|
* changed are kept, not refused (copy-back.ts, FOL-96). */
|
|
581
593
|
configWrites?: boolean;
|
|
@@ -365,11 +365,17 @@ export function applyContainerChanges(hostWs, containerWs, baseline, note, diver
|
|
|
365
365
|
// (kubectl cp already skips symlinks; this makes the two tiers agree.)
|
|
366
366
|
if (entry.isSymbolicLink())
|
|
367
367
|
continue;
|
|
368
|
+
const posix = rel.replaceAll("\\", "/");
|
|
368
369
|
if (entry.isDirectory()) {
|
|
370
|
+
const d = posix + "/";
|
|
371
|
+
if (opts.keepOnly && !(d.startsWith(opts.keepOnly) || opts.keepOnly.startsWith(d)))
|
|
372
|
+
continue;
|
|
369
373
|
if (allowedBack(rel + "/"))
|
|
370
374
|
walk(abs);
|
|
371
375
|
continue;
|
|
372
376
|
}
|
|
377
|
+
if (opts.keepOnly && !posix.startsWith(opts.keepOnly))
|
|
378
|
+
continue;
|
|
373
379
|
if (!allowedBack(rel))
|
|
374
380
|
continue;
|
|
375
381
|
let next = fs.readFileSync(abs);
|
package/dist/src/runner.d.ts
CHANGED
|
@@ -592,7 +592,10 @@ export declare function createFlowRun(tenant: string, workspace: string, steps:
|
|
|
592
592
|
a2a?: {
|
|
593
593
|
task: string;
|
|
594
594
|
key: string;
|
|
595
|
-
}
|
|
595
|
+
},
|
|
596
|
+
/** A snapshot run's folder (Part B3): the id POST …/snapshots answered.
|
|
597
|
+
* Its own trailing argument, as a2a is, so the signature only widened. */
|
|
598
|
+
snapshot?: string): RunRecord;
|
|
596
599
|
export declare function startFlowRun(tenant: string, workspace: string, steps: FlowStep[], flowName: string, modelOverride?: string | null, tags?: string[], effortOverride?: string | null, startedBy?: string | null, opts?: {
|
|
597
600
|
test?: boolean;
|
|
598
601
|
}): RunRecord;
|
package/dist/src/runner.js
CHANGED
|
@@ -388,6 +388,11 @@ export function readAgentsMd(dir) {
|
|
|
388
388
|
return null;
|
|
389
389
|
}
|
|
390
390
|
const workspaceRootOf = (agentDir) => path.join(agentDir, "..", "..");
|
|
391
|
+
/** What a snapshot step is told (Part B3). */
|
|
392
|
+
const SNAPSHOT_NOTE = "The folder you were sent to work on is in snapshot/ (inside your working directory). Make your changes there, as files: " +
|
|
393
|
+
"when you finish, foldrun turns what changed in snapshot/ into a patch the person applies. " +
|
|
394
|
+
"Only snapshot/ (as that patch) and your outputs/ come back from this step; anything you write elsewhere is not kept. " +
|
|
395
|
+
"Do not create links or a .git folder in snapshot/ — links make the patch refused, and .git is left out.";
|
|
391
396
|
/**
|
|
392
397
|
* Configuration from AGENTS.md, nearest-wins: the workspace's overrides the
|
|
393
398
|
* account's, key by key.
|
|
@@ -2704,6 +2709,17 @@ mayDefer) {
|
|
|
2704
2709
|
if (stepHookNames.length)
|
|
2705
2710
|
push("info", `hooks: ${stepHookNames.join(", ")}`);
|
|
2706
2711
|
const isolation = process.env.FOLDRUN_RUN_ISOLATION;
|
|
2712
|
+
// A snapshot run (Part B3): the folder is on the run record, set when the
|
|
2713
|
+
// run was made. Only an executor that says it can hold one may run it —
|
|
2714
|
+
// in-process, the step would work in the real workspace folder, and no
|
|
2715
|
+
// copy-back stands between what it writes and the workspace (Codex).
|
|
2716
|
+
const snapshotId = runId ? readRun(tenant, path.basename(workspaceRootOf(agentDir)), runId)?.snapshot?.id : undefined;
|
|
2717
|
+
if (snapshotId) {
|
|
2718
|
+
const able = isolatedRun() && isolation !== "container" && Boolean(platform.isolation[isolation]) && platform.holdsSnapshot?.(isolation) === true;
|
|
2719
|
+
if (!able) {
|
|
2720
|
+
throw new Error("this run has a snapshot (a folder sent to work on), and this install cannot hold one: it needs the k8s sandbox (FOLDRUN_RUN_ISOLATION=k8s). Nothing was run.");
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2707
2723
|
if (isolatedRun()) {
|
|
2708
2724
|
// The isolated path: the whole loop — model, built-in tools, scripts —
|
|
2709
2725
|
// runs inside a throwaway container (a docker sibling, or a pod), and
|
|
@@ -3077,6 +3093,7 @@ mayDefer) {
|
|
|
3077
3093
|
const runIsolated = isolation === "container" ? runStepInContainer : platform.isolation[isolation];
|
|
3078
3094
|
const isolatedArgs = (modelEnv, keyName = MODEL_KEY_NAME) => ({
|
|
3079
3095
|
workspaceRoot,
|
|
3096
|
+
...(snapshotId ? { snapshot: { id: snapshotId } } : {}),
|
|
3080
3097
|
libraryRoot: libraryDir(tenant),
|
|
3081
3098
|
galleryRoot: platform.galleryDir() ?? undefined,
|
|
3082
3099
|
// Keys this step's dependency cache. Per-account by design — see
|
|
@@ -3086,7 +3103,8 @@ mayDefer) {
|
|
|
3086
3103
|
agentRel: path.relative(workspaceRoot, agentDir).replaceAll("\\", "/"),
|
|
3087
3104
|
// Its file tools inside the sandbox get the same allowance (FOL-96).
|
|
3088
3105
|
configWrites: step.approve === true && Boolean(step.approvedAt),
|
|
3089
|
-
|
|
3106
|
+
// A snapshot step is told where its folder is, and what comes back.
|
|
3107
|
+
prompt: snapshotId ? `${prompt}\n\n${SNAPSHOT_NOTE}` : prompt,
|
|
3090
3108
|
model,
|
|
3091
3109
|
effort,
|
|
3092
3110
|
systemPrompt,
|
|
@@ -4285,7 +4303,10 @@ export function readSchemaFile(workspaceRoot, rel) {
|
|
|
4285
4303
|
export function createFlowRun(tenant, workspace, steps, flowName, status, tags = [], startedBy = null, opts = {},
|
|
4286
4304
|
/** An A2A task's correlation (foldrun-platform flow-admission.ts) — its
|
|
4287
4305
|
* own trailing argument, so the signature only widened. */
|
|
4288
|
-
a2a
|
|
4306
|
+
a2a,
|
|
4307
|
+
/** A snapshot run's folder (Part B3): the id POST …/snapshots answered.
|
|
4308
|
+
* Its own trailing argument, as a2a is, so the signature only widened. */
|
|
4309
|
+
snapshot) {
|
|
4289
4310
|
let flowMaxOut;
|
|
4290
4311
|
try {
|
|
4291
4312
|
flowMaxOut = readFlow(tenant, workspace, flowName)?.maxOutputTokens;
|
|
@@ -4302,6 +4323,7 @@ a2a) {
|
|
|
4302
4323
|
...(opts.test ? { test: true } : {}),
|
|
4303
4324
|
// An outside agent asked, over A2A: the task it serves, and whose key.
|
|
4304
4325
|
...(a2a ? { trigger: "a2a", a2a: { task: a2a.task, key: a2a.key } } : {}),
|
|
4326
|
+
...(snapshot ? { snapshot: { id: snapshot } } : {}),
|
|
4305
4327
|
startedAt: new Date().toISOString(),
|
|
4306
4328
|
finishedAt: null,
|
|
4307
4329
|
steps: steps.map((s) => ({
|
package/dist/src/scan.js
CHANGED
|
@@ -388,6 +388,9 @@ const SECRET_SHAPES = [
|
|
|
388
388
|
[/\bnpm_[A-Za-z0-9]{36}\b/g, "an npm token"],
|
|
389
389
|
[/\bhf_[A-Za-z0-9]{34,}\b/g, "a Hugging Face token"],
|
|
390
390
|
[/\blin_api_[A-Za-z0-9]{40}\b/g, "a Linear key"],
|
|
391
|
+
// foldrun's own (FOL-154): API, gateway, A2A and deploy keys, and the
|
|
392
|
+
// prefixes before them. 48 hex: the exact shape minted, never `fr_api_…`.
|
|
393
|
+
[/\b(?:fr_(?:api|gw|a2a|dep)|md[ak])_[0-9a-f]{48}\b/g, "a foldrun key"],
|
|
391
394
|
[/\bdop_v1_[a-f0-9]{64}\b/g, "a DigitalOcean token"],
|
|
392
395
|
[/\bshp(?:at|ca|pa|ss)_[a-fA-F0-9]{32}\b/g, "a Shopify token"],
|
|
393
396
|
[/\bre_[A-Za-z0-9]{8,}_[A-Za-z0-9]{16,}\b/g, "a Resend key"],
|
|
@@ -50,6 +50,10 @@ export function snapshotPathProblem(p) {
|
|
|
50
50
|
return `a path deeper than ${MAX_DEPTH} folders`;
|
|
51
51
|
if (parts.some((s) => s === "" || s === "." || s === ".."))
|
|
52
52
|
return "an empty, `.` or `..` segment";
|
|
53
|
+
// The files, never a repository: a `.git` sent in could become git's own
|
|
54
|
+
// configuration (hooks, fsmonitor) wherever git later reads the folder.
|
|
55
|
+
if (parts.some((s) => s.toLowerCase() === ".git"))
|
|
56
|
+
return "a `.git` folder or file — send the files, not the repository";
|
|
53
57
|
return null;
|
|
54
58
|
}
|
|
55
59
|
/**
|
package/dist/src/store.d.ts
CHANGED
|
@@ -1635,6 +1635,13 @@ export interface RunRecord {
|
|
|
1635
1635
|
task: string;
|
|
1636
1636
|
key: string;
|
|
1637
1637
|
};
|
|
1638
|
+
/** A snapshot run (Part B3): the folder a person sent (its sha256), staged
|
|
1639
|
+
* for the step at agents/<name>/snapshot/; the patch of what the step
|
|
1640
|
+
* changed is outputs/snapshot.patch. Set when the run is made, never by a
|
|
1641
|
+
* step. */
|
|
1642
|
+
snapshot?: {
|
|
1643
|
+
id: string;
|
|
1644
|
+
};
|
|
1638
1645
|
steps: StepRecord[];
|
|
1639
1646
|
}
|
|
1640
1647
|
/** Merge one part (the input, on the call; the output, on its completion)
|
package/package.json
CHANGED
package/src/platform.ts
CHANGED
|
@@ -168,6 +168,11 @@ export interface PlatformHooks {
|
|
|
168
168
|
* trace as not enforced.
|
|
169
169
|
*/
|
|
170
170
|
confinesBrowsing?(isolation: string): boolean;
|
|
171
|
+
/** Can this executor run a snapshot step (RunInContainerArgs.snapshot:
|
|
172
|
+
* stage the folder, give back outputs/ alone, make the patch)? A run with a
|
|
173
|
+
* snapshot on any executor that cannot fails before anything starts.
|
|
174
|
+
* Default: none can. */
|
|
175
|
+
holdsSnapshot?(isolation: string): boolean;
|
|
171
176
|
/**
|
|
172
177
|
* Does this isolation mode wall a step whose `network:` is restricted and
|
|
173
178
|
* enforced to the egress proxy alone (a `filtered` pod)? True: such a
|
package/src/run-container.ts
CHANGED
|
@@ -482,6 +482,10 @@ export function mergeAppends(was: Buffer | string | null, host: Buffer, next: Bu
|
|
|
482
482
|
}
|
|
483
483
|
|
|
484
484
|
export interface ApplyOptions {
|
|
485
|
+
/** Take back only what is under this workspace-relative folder (with its
|
|
486
|
+
* trailing `/`) — a snapshot run's outputs (Part B3): the folder it was
|
|
487
|
+
* given, and anything it copied anywhere else, never reach the workspace. */
|
|
488
|
+
keepOnly?: string;
|
|
485
489
|
/** What the host handed back into this sandbox mid-step — a `sandbox: own`
|
|
486
490
|
* job's files (delegate-tools.ts), path → sha256 — as the HOST recorded
|
|
487
491
|
* it (StepRecord.handedBack). The sandbox's own note of the same is only
|
|
@@ -552,10 +556,14 @@ export function applyContainerChanges(
|
|
|
552
556
|
// A link to a directory threw EISDIR and aborted the whole copy-out.
|
|
553
557
|
// (kubectl cp already skips symlinks; this makes the two tiers agree.)
|
|
554
558
|
if (entry.isSymbolicLink()) continue;
|
|
559
|
+
const posix = rel.replaceAll("\\", "/");
|
|
555
560
|
if (entry.isDirectory()) {
|
|
561
|
+
const d = posix + "/";
|
|
562
|
+
if (opts.keepOnly && !(d.startsWith(opts.keepOnly) || opts.keepOnly.startsWith(d))) continue;
|
|
556
563
|
if (allowedBack(rel + "/")) walk(abs);
|
|
557
564
|
continue;
|
|
558
565
|
}
|
|
566
|
+
if (opts.keepOnly && !posix.startsWith(opts.keepOnly)) continue;
|
|
559
567
|
if (!allowedBack(rel)) continue;
|
|
560
568
|
let next: Buffer = fs.readFileSync(abs);
|
|
561
569
|
// What the step was handed: its bytes (a staging dir) or its hash.
|
|
@@ -1861,6 +1869,12 @@ export function heldCores(cpus: string, isolation: string | undefined, available
|
|
|
1861
1869
|
|
|
1862
1870
|
export interface RunInContainerArgs {
|
|
1863
1871
|
workspaceRoot: string;
|
|
1872
|
+
/** A snapshot run (Part B3): the folder a person sent, by id, for this
|
|
1873
|
+
* step to work on. Only an executor that says it can (`supportsSnapshot`
|
|
1874
|
+
* on its IsolatedStepRunner) is ever given one: it stages the folder at
|
|
1875
|
+
* agents/<name>/snapshot/, takes back only that agent's outputs/, and
|
|
1876
|
+
* leaves the patch there as outputs/snapshot.patch. */
|
|
1877
|
+
snapshot?: { id: string };
|
|
1864
1878
|
/** A person approved this step before it ran: configuration and code it
|
|
1865
1879
|
* changed are kept, not refused (copy-back.ts, FOL-96). */
|
|
1866
1880
|
configWrites?: boolean;
|
package/src/runner.ts
CHANGED
|
@@ -460,6 +460,13 @@ export function readAgentsMd(dir: string): { data: Record<string, unknown>; body
|
|
|
460
460
|
|
|
461
461
|
const workspaceRootOf = (agentDir: string) => path.join(agentDir, "..", "..");
|
|
462
462
|
|
|
463
|
+
/** What a snapshot step is told (Part B3). */
|
|
464
|
+
const SNAPSHOT_NOTE =
|
|
465
|
+
"The folder you were sent to work on is in snapshot/ (inside your working directory). Make your changes there, as files: " +
|
|
466
|
+
"when you finish, foldrun turns what changed in snapshot/ into a patch the person applies. " +
|
|
467
|
+
"Only snapshot/ (as that patch) and your outputs/ come back from this step; anything you write elsewhere is not kept. " +
|
|
468
|
+
"Do not create links or a .git folder in snapshot/ — links make the patch refused, and .git is left out.";
|
|
469
|
+
|
|
463
470
|
/**
|
|
464
471
|
* Configuration from AGENTS.md, nearest-wins: the workspace's overrides the
|
|
465
472
|
* account's, key by key.
|
|
@@ -2904,6 +2911,17 @@ async function runStep(
|
|
|
2904
2911
|
if (stepHookNames.length) push("info", `hooks: ${stepHookNames.join(", ")}`);
|
|
2905
2912
|
|
|
2906
2913
|
const isolation = process.env.FOLDRUN_RUN_ISOLATION;
|
|
2914
|
+
// A snapshot run (Part B3): the folder is on the run record, set when the
|
|
2915
|
+
// run was made. Only an executor that says it can hold one may run it —
|
|
2916
|
+
// in-process, the step would work in the real workspace folder, and no
|
|
2917
|
+
// copy-back stands between what it writes and the workspace (Codex).
|
|
2918
|
+
const snapshotId = runId ? readRun(tenant, path.basename(workspaceRootOf(agentDir)), runId)?.snapshot?.id : undefined;
|
|
2919
|
+
if (snapshotId) {
|
|
2920
|
+
const able = isolatedRun() && isolation !== "container" && Boolean(platform.isolation[isolation!]) && platform.holdsSnapshot?.(isolation!) === true;
|
|
2921
|
+
if (!able) {
|
|
2922
|
+
throw new Error("this run has a snapshot (a folder sent to work on), and this install cannot hold one: it needs the k8s sandbox (FOLDRUN_RUN_ISOLATION=k8s). Nothing was run.");
|
|
2923
|
+
}
|
|
2924
|
+
}
|
|
2907
2925
|
if (isolatedRun()) {
|
|
2908
2926
|
// The isolated path: the whole loop — model, built-in tools, scripts —
|
|
2909
2927
|
// runs inside a throwaway container (a docker sibling, or a pod), and
|
|
@@ -3285,6 +3303,7 @@ async function runStep(
|
|
|
3285
3303
|
const runIsolated = isolation === "container" ? runStepInContainer : platform.isolation[isolation!]!;
|
|
3286
3304
|
const isolatedArgs = (modelEnv: Record<string, string | undefined>, keyName = MODEL_KEY_NAME) => ({
|
|
3287
3305
|
workspaceRoot,
|
|
3306
|
+
...(snapshotId ? { snapshot: { id: snapshotId } } : {}),
|
|
3288
3307
|
libraryRoot: libraryDir(tenant),
|
|
3289
3308
|
galleryRoot: platform.galleryDir() ?? undefined,
|
|
3290
3309
|
// Keys this step's dependency cache. Per-account by design — see
|
|
@@ -3294,7 +3313,8 @@ async function runStep(
|
|
|
3294
3313
|
agentRel: path.relative(workspaceRoot, agentDir).replaceAll("\\", "/"),
|
|
3295
3314
|
// Its file tools inside the sandbox get the same allowance (FOL-96).
|
|
3296
3315
|
configWrites: step.approve === true && Boolean(step.approvedAt),
|
|
3297
|
-
|
|
3316
|
+
// A snapshot step is told where its folder is, and what comes back.
|
|
3317
|
+
prompt: snapshotId ? `${prompt}\n\n${SNAPSHOT_NOTE}` : prompt,
|
|
3298
3318
|
model,
|
|
3299
3319
|
effort,
|
|
3300
3320
|
systemPrompt,
|
|
@@ -4499,6 +4519,9 @@ export function createFlowRun(
|
|
|
4499
4519
|
/** An A2A task's correlation (foldrun-platform flow-admission.ts) — its
|
|
4500
4520
|
* own trailing argument, so the signature only widened. */
|
|
4501
4521
|
a2a?: { task: string; key: string },
|
|
4522
|
+
/** A snapshot run's folder (Part B3): the id POST …/snapshots answered.
|
|
4523
|
+
* Its own trailing argument, as a2a is, so the signature only widened. */
|
|
4524
|
+
snapshot?: string,
|
|
4502
4525
|
): RunRecord {
|
|
4503
4526
|
let flowMaxOut: number | undefined;
|
|
4504
4527
|
try {
|
|
@@ -4515,6 +4538,7 @@ export function createFlowRun(
|
|
|
4515
4538
|
...(opts.test ? { test: true } : {}),
|
|
4516
4539
|
// An outside agent asked, over A2A: the task it serves, and whose key.
|
|
4517
4540
|
...(a2a ? { trigger: "a2a" as const, a2a: { task: a2a.task, key: a2a.key } } : {}),
|
|
4541
|
+
...(snapshot ? { snapshot: { id: snapshot } } : {}),
|
|
4518
4542
|
startedAt: new Date().toISOString(),
|
|
4519
4543
|
finishedAt: null,
|
|
4520
4544
|
steps: steps.map((s) => ({
|
package/src/scan.ts
CHANGED
|
@@ -481,6 +481,9 @@ const SECRET_SHAPES: [RegExp, string][] = [
|
|
|
481
481
|
[/\bnpm_[A-Za-z0-9]{36}\b/g, "an npm token"],
|
|
482
482
|
[/\bhf_[A-Za-z0-9]{34,}\b/g, "a Hugging Face token"],
|
|
483
483
|
[/\blin_api_[A-Za-z0-9]{40}\b/g, "a Linear key"],
|
|
484
|
+
// foldrun's own (FOL-154): API, gateway, A2A and deploy keys, and the
|
|
485
|
+
// prefixes before them. 48 hex: the exact shape minted, never `fr_api_…`.
|
|
486
|
+
[/\b(?:fr_(?:api|gw|a2a|dep)|md[ak])_[0-9a-f]{48}\b/g, "a foldrun key"],
|
|
484
487
|
[/\bdop_v1_[a-f0-9]{64}\b/g, "a DigitalOcean token"],
|
|
485
488
|
[/\bshp(?:at|ca|pa|ss)_[a-fA-F0-9]{32}\b/g, "a Shopify token"],
|
|
486
489
|
[/\bre_[A-Za-z0-9]{8,}_[A-Za-z0-9]{16,}\b/g, "a Resend key"],
|
package/src/snapshot-archive.ts
CHANGED
|
@@ -64,6 +64,9 @@ export function snapshotPathProblem(p: string): string | null {
|
|
|
64
64
|
const parts = p.split("/");
|
|
65
65
|
if (parts.length > MAX_DEPTH) return `a path deeper than ${MAX_DEPTH} folders`;
|
|
66
66
|
if (parts.some((s) => s === "" || s === "." || s === "..")) return "an empty, `.` or `..` segment";
|
|
67
|
+
// The files, never a repository: a `.git` sent in could become git's own
|
|
68
|
+
// configuration (hooks, fsmonitor) wherever git later reads the folder.
|
|
69
|
+
if (parts.some((s) => s.toLowerCase() === ".git")) return "a `.git` folder or file — send the files, not the repository";
|
|
67
70
|
return null;
|
|
68
71
|
}
|
|
69
72
|
|
package/src/store.ts
CHANGED
|
@@ -4002,6 +4002,11 @@ export interface RunRecord {
|
|
|
4002
4002
|
* first id, kept across rotations) that asked. A correlation only — the
|
|
4003
4003
|
* protocol's own state lives in the platform's a2a_tasks. */
|
|
4004
4004
|
a2a?: { task: string; key: string };
|
|
4005
|
+
/** A snapshot run (Part B3): the folder a person sent (its sha256), staged
|
|
4006
|
+
* for the step at agents/<name>/snapshot/; the patch of what the step
|
|
4007
|
+
* changed is outputs/snapshot.patch. Set when the run is made, never by a
|
|
4008
|
+
* step. */
|
|
4009
|
+
snapshot?: { id: string };
|
|
4005
4010
|
steps: StepRecord[];
|
|
4006
4011
|
}
|
|
4007
4012
|
|