@mnaimfaizy/agent-kit 1.0.0-beta.14 → 1.0.0-beta.16
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/README.md +22 -4
- package/custom-harness.schema.json +243 -0
- package/harnesses.json +244 -6
- package/package.json +3 -2
- package/src/checks/ci-workflow.mjs +105 -0
- package/src/checks/claude-app.mjs +11 -2
- package/src/checks/custom-harness.mjs +157 -0
- package/src/checks/github-app.mjs +214 -0
- package/src/checks/rulesets.mjs +9 -8
- package/src/checks/secrets-and-variables.mjs +27 -8
- package/src/checks/stages.mjs +705 -0
- package/src/cli.mjs +583 -36
- package/src/deep-scan/agent.mjs +88 -21
- package/src/deep-scan/credential.mjs +81 -32
- package/src/deep-scan/docker-driver.mjs +105 -42
- package/src/deep-scan/harness-text.mjs +99 -0
- package/src/deep-scan/lifecycle.mjs +68 -178
- package/src/deep-scan/limits.mjs +13 -7
- package/src/deep-scan/model-proxy.mjs +21 -10
- package/src/deep-scan/preflight.mjs +19 -6
- package/src/deep-scan/recipe.mjs +4 -0
- package/src/deep-scan/runtime.mjs +54 -6
- package/src/deep-scan/sandbox-run.mjs +232 -0
- package/src/deep-scan/sbx-driver.mjs +224 -39
- package/src/deep-scan/tar.mjs +69 -22
- package/src/deep-scan/verify.mjs +6 -1
- package/src/deep-scan.mjs +73 -13
- package/src/doctor.mjs +166 -5
- package/src/exec.mjs +14 -5
- package/src/factory/budget/budget.mjs +259 -0
- package/src/factory/build/command.mjs +321 -0
- package/src/factory/build/factory.mjs +473 -0
- package/src/factory/build/findings.mjs +55 -0
- package/src/factory/build/host.mjs +230 -0
- package/src/factory/build/notes.mjs +191 -0
- package/src/factory/build/pull-request.mjs +74 -0
- package/src/factory/bundle.mjs +146 -0
- package/src/factory/checks/allowed-paths.mjs +50 -0
- package/src/factory/checks/plan-header.mjs +296 -0
- package/src/factory/checks/qa.mjs +85 -0
- package/src/factory/checks/review.mjs +73 -0
- package/src/factory/checks/security.mjs +50 -0
- package/src/factory/checks/stage-check.mjs +89 -0
- package/src/factory/claims/command.mjs +187 -0
- package/src/factory/claims/release.mjs +111 -0
- package/src/factory/decision/answers.mjs +103 -0
- package/src/factory/decision/command.mjs +64 -0
- package/src/factory/decision/plan.mjs +99 -0
- package/src/factory/decision/request.mjs +116 -0
- package/src/factory/doctor/files.mjs +329 -0
- package/src/factory/doctor/index.mjs +56 -0
- package/src/factory/doctor/local.mjs +497 -0
- package/src/factory/doctor/orchestrate.mjs +146 -0
- package/src/factory/engine/lease.mjs +146 -0
- package/src/factory/engine/local-engine.mjs +177 -0
- package/src/factory/engine/lockfile.mjs +64 -0
- package/src/factory/engine/workflow-engine.mjs +124 -0
- package/src/factory/gate/comment.mjs +88 -0
- package/src/factory/gate/config.mjs +57 -0
- package/src/factory/gate/gate-core.mjs +250 -0
- package/src/factory/gate/guarded.mjs +17 -0
- package/src/factory/gate/reads.mjs +105 -0
- package/src/factory/gate/task.mjs +193 -0
- package/src/factory/gate/trip-reads.mjs +82 -0
- package/src/factory/gate/trip.mjs +87 -0
- package/src/factory/init/blueprint.mjs +174 -0
- package/src/factory/init/index.mjs +337 -0
- package/src/factory/labels/evidence.mjs +162 -0
- package/src/factory/labels/moves.mjs +32 -0
- package/src/factory/labels/reconcile.mjs +267 -0
- package/src/factory/labels/revert.mjs +87 -0
- package/src/factory/labels/timeline.mjs +72 -0
- package/src/factory/labels/voided.mjs +59 -0
- package/src/factory/limits/harness.mjs +39 -0
- package/src/factory/limits/limits.mjs +123 -0
- package/src/factory/merge/command.mjs +172 -0
- package/src/factory/outbox/check.mjs +240 -0
- package/src/factory/outbox/rulings.mjs +195 -0
- package/src/factory/plan/command.mjs +66 -0
- package/src/factory/plan/comment.mjs +156 -0
- package/src/factory/plan/publish.mjs +149 -0
- package/src/factory/plan/risk.mjs +153 -0
- package/src/factory/qa/command.mjs +163 -0
- package/src/factory/records/engine-record.mjs +133 -0
- package/src/factory/records/main.mjs +96 -0
- package/src/factory/records/record.mjs +226 -0
- package/src/factory/records/sink.mjs +57 -0
- package/src/factory/report/build.mjs +92 -0
- package/src/factory/report/command.mjs +80 -0
- package/src/factory/report/facts.mjs +226 -0
- package/src/factory/report/gate-section.mjs +122 -0
- package/src/factory/report/metrics.mjs +111 -0
- package/src/factory/report/reads.mjs +246 -0
- package/src/factory/report/render.mjs +121 -0
- package/src/factory/report/rollout.mjs +154 -0
- package/src/factory/review/command.mjs +182 -0
- package/src/factory/run/awake.mjs +70 -0
- package/src/factory/run/collect.mjs +77 -0
- package/src/factory/run/command.mjs +490 -0
- package/src/factory/run/gh.mjs +46 -0
- package/src/factory/run/launch.mjs +47 -0
- package/src/factory/run/pipelines.mjs +261 -0
- package/src/factory/run/raw.mjs +96 -0
- package/src/factory/run/restart.mjs +83 -0
- package/src/factory/run/s3.mjs +193 -0
- package/src/factory/run/secrets.mjs +142 -0
- package/src/factory/run/teardown.mjs +242 -0
- package/src/factory/run/token.mjs +68 -0
- package/src/factory/security/command.mjs +157 -0
- package/src/factory/setup/app.mjs +122 -0
- package/src/factory/setup/command.mjs +409 -0
- package/src/factory/setup/labels.mjs +25 -0
- package/src/factory/setup/reads.mjs +129 -0
- package/src/factory/setup/writes.mjs +126 -0
- package/src/factory/snapshot/write.mjs +176 -0
- package/src/factory/stop/command.mjs +136 -0
- package/src/factory/sweep/actions-main.mjs +117 -0
- package/src/factory/sweep/command.mjs +65 -0
- package/src/factory/sweep/knobs.mjs +78 -0
- package/src/factory/sweep/marker-version.mjs +15 -0
- package/src/factory/sweep/markers.mjs +112 -0
- package/src/factory/sweep/overlap.mjs +24 -0
- package/src/factory/sweep/run.mjs +198 -0
- package/src/factory/sweep/shell.mjs +394 -0
- package/src/factory/sweep/split.mjs +104 -0
- package/src/factory/sweep/states.mjs +87 -0
- package/src/factory/sweep/sweep-core.mjs +1781 -0
- package/src/factory/tracker/github.mjs +674 -0
- package/src/factory/tracker/operations.mjs +153 -0
- package/src/factory/upgrade/index.mjs +83 -0
- package/src/harness/adapters.mjs +30 -0
- package/src/harness/antigravity.mjs +187 -0
- package/src/harness/claude-code.mjs +8 -1
- package/src/harness/codex.mjs +219 -0
- package/src/harness/cursor.mjs +199 -0
- package/src/harness/custom/registry.mjs +21 -0
- package/src/harness/custom/schema.mjs +90 -0
- package/src/harness/custom.mjs +299 -0
- package/src/harness/facts.mjs +44 -7
- package/src/harness/gemini.mjs +164 -0
- package/src/harness/install-layer.mjs +86 -3
- package/src/harness/opencode.mjs +289 -0
- package/src/harness/resolve.mjs +156 -0
- package/src/harness/support-levels.mjs +151 -3
- package/src/harness-live/assess.mjs +29 -6
- package/src/harness-live/cursor-real.mjs +146 -0
- package/src/harness-live/cursor-version.mjs +70 -0
- package/src/harness-live/cursor.mjs +80 -0
- package/src/harness-live/custom.mjs +91 -0
- package/src/harness-live/fixture-harness.mjs +45 -0
- package/src/harness-live/harnesses.mjs +263 -0
- package/src/harness-live/host.mjs +113 -4
- package/src/harness-live/opencode.mjs +289 -0
- package/src/harness-live/probes.mjs +87 -7
- package/src/harness-live/run.mjs +101 -20
- package/src/harness-live/setup.mjs +126 -0
- package/src/harness-live/stage.mjs +25 -15
- package/src/harness-live/suite.mjs +276 -95
- package/src/harness-test.mjs +116 -0
- package/src/init.mjs +374 -36
- package/src/kit-owned-paths.mjs +1 -1
- package/src/model-proxy/core.mjs +128 -20
- package/src/model-proxy/profiles/anthropic.mjs +54 -10
- package/src/model-proxy/profiles/gemini-api.mjs +311 -0
- package/src/model-proxy/profiles/openai.mjs +327 -0
- package/src/model-proxy/stub-dialects/gemini-api.mjs +178 -0
- package/src/model-proxy/stub-dialects/openai.mjs +173 -0
- package/src/model-proxy/stub.mjs +9 -1
- package/src/stage/audit.mjs +79 -0
- package/src/stage/egress-route.mjs +207 -0
- package/src/stage/implement/carry.mjs +308 -0
- package/src/stage/implement/sandbox.mjs +271 -0
- package/src/stage/implement/verify.mjs +70 -0
- package/src/stage/implement.mjs +218 -0
- package/src/stage/plan.mjs +115 -0
- package/src/stage/review-response.mjs +172 -0
- package/src/stage/review.mjs +185 -0
- package/src/stage/workspace.mjs +274 -0
- package/src/stage.mjs +1087 -0
- package/src/upgrade.mjs +39 -7
package/src/upgrade.mjs
CHANGED
|
@@ -14,6 +14,8 @@ import { PinRewriteError, readWorkflows, rewriteKitPins } from "./callers.mjs";
|
|
|
14
14
|
import { checkPins } from "./checks/pins.mjs";
|
|
15
15
|
import { fileAndPinChecks, printFileAndPinChecks } from "./doctor.mjs";
|
|
16
16
|
import { firstLine } from "./exec.mjs";
|
|
17
|
+
import { hasFactory } from "./factory/doctor/index.mjs";
|
|
18
|
+
import { factoryNotes, withCliPins } from "./factory/upgrade/index.mjs";
|
|
17
19
|
import { openKitRepo, PreManifestTagError, serverFromEnv } from "./kit-tag.mjs";
|
|
18
20
|
import {
|
|
19
21
|
applyPlan,
|
|
@@ -69,7 +71,7 @@ export function planUpgrade({ runner, root, oldSnap, newSnap, files, force, pinn
|
|
|
69
71
|
const writes = kitFileWrites(newSnap);
|
|
70
72
|
for (const w of writes) checkLocalPath(root, w.path, { deleted: deletes });
|
|
71
73
|
|
|
72
|
-
const
|
|
74
|
+
const pinEditsSoFar = [];
|
|
73
75
|
if (pinnedTag !== newSnap.tag) {
|
|
74
76
|
for (const file of files) {
|
|
75
77
|
if (file.pins.length === 0) continue;
|
|
@@ -81,7 +83,7 @@ export function planUpgrade({ runner, root, oldSnap, newSnap, files, force, pinn
|
|
|
81
83
|
if (err instanceof PinRewriteError) throw new Refusal(`${file.path}: ${err.message}`);
|
|
82
84
|
throw err;
|
|
83
85
|
}
|
|
84
|
-
|
|
86
|
+
pinEditsSoFar.push({
|
|
85
87
|
path: file.path,
|
|
86
88
|
count: rewritten.count,
|
|
87
89
|
bytes: Buffer.from(rewritten.text, "utf8"),
|
|
@@ -89,6 +91,19 @@ export function planUpgrade({ runner, root, oldSnap, newSnap, files, force, pinn
|
|
|
89
91
|
}
|
|
90
92
|
}
|
|
91
93
|
|
|
94
|
+
// A Factory's Callers also pin the CLI they install: move that pin to the tag's version.
|
|
95
|
+
let cliPins = [];
|
|
96
|
+
let pinEdits = pinEditsSoFar;
|
|
97
|
+
const factory = hasFactory(root);
|
|
98
|
+
if (factory) {
|
|
99
|
+
({ edits: pinEdits, cli: cliPins } = withCliPins({
|
|
100
|
+
files,
|
|
101
|
+
edits: pinEditsSoFar,
|
|
102
|
+
readText: (path) => readWorkflowText(root, path),
|
|
103
|
+
newTag: newSnap.tag,
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
|
|
92
107
|
const { changed: dirty, ignored } = uncommittedChanges({ runner, root, paths: deletes });
|
|
93
108
|
if (dirty.length && !force) {
|
|
94
109
|
throw new Refusal(
|
|
@@ -98,7 +113,7 @@ export function planUpgrade({ runner, root, oldSnap, newSnap, files, force, pinn
|
|
|
98
113
|
);
|
|
99
114
|
}
|
|
100
115
|
|
|
101
|
-
return { deletes, removed, writes, pinEdits, dirty, ignored };
|
|
116
|
+
return { deletes, removed, writes, pinEdits, cliPins, factory, dirty, ignored };
|
|
102
117
|
}
|
|
103
118
|
|
|
104
119
|
/**
|
|
@@ -199,12 +214,17 @@ export async function runUpgrade({
|
|
|
199
214
|
out(`Delete (no longer in ${newTag}'s kit-owned-paths.txt):`);
|
|
200
215
|
for (const p of plan.removed) out(` ${p}`);
|
|
201
216
|
}
|
|
202
|
-
|
|
217
|
+
const usesEdits = plan.pinEdits.filter((e) => !e.cliOnly);
|
|
218
|
+
if (usesEdits.length) {
|
|
203
219
|
out(`Rewrite uses: pins to @${newTag}:`);
|
|
204
|
-
for (const e of
|
|
220
|
+
for (const e of usesEdits) out(` ${e.path} (${e.count} pin${e.count === 1 ? "" : "s"})`);
|
|
205
221
|
} else {
|
|
206
222
|
out(`The uses: pins already name ${newTag}.`);
|
|
207
223
|
}
|
|
224
|
+
if (plan.cliPins.length) {
|
|
225
|
+
out(`Rewrite the CLI pins of the Factory Callers to @${newTag.slice(1)}:`);
|
|
226
|
+
for (const e of plan.cliPins) out(` ${e.path} (${e.count} pin${e.count === 1 ? "" : "s"})`);
|
|
227
|
+
}
|
|
208
228
|
if (plan.dirty.length) {
|
|
209
229
|
out(`--force: discarding uncommitted changes in ${plan.dirty.length} file(s):`);
|
|
210
230
|
for (const d of listed(plan.dirty)) out(` ${d}`);
|
|
@@ -272,9 +292,21 @@ export async function runUpgrade({
|
|
|
272
292
|
}
|
|
273
293
|
}
|
|
274
294
|
|
|
275
|
-
// The
|
|
295
|
+
// The Factory is the Consumer's: say what upgrade left alone.
|
|
296
|
+
// Judged before the writes, from the Consumer's own Factory files, as the plan was.
|
|
297
|
+
const { factory } = plan;
|
|
298
|
+
if (factory) {
|
|
299
|
+
out("");
|
|
300
|
+
for (const line of factoryNotes({ newTag })) out(line);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// The same file and pin checks as `doctor --ci`, against the tag already fetched, and the
|
|
304
|
+
// Factory's file checks when the checkout has a Factory.
|
|
276
305
|
out("");
|
|
277
|
-
const failed = printFileAndPinChecks(
|
|
306
|
+
const failed = printFileAndPinChecks(
|
|
307
|
+
out,
|
|
308
|
+
fileAndPinChecks({ runner, root, snap: newSnap, factory }),
|
|
309
|
+
);
|
|
278
310
|
out("");
|
|
279
311
|
out(
|
|
280
312
|
failed
|