@kitman-sh/cli 0.11.0-rc.5 → 0.11.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/{chunk-9a2r12ye.js → chunk-0ca9dqh5.js} +1 -1
- package/dist/{chunk-5hx3j5x8.js → chunk-3y7j2s7v.js} +2 -2
- package/dist/{chunk-egb7pjjz.js → chunk-5326a9ks.js} +1 -1
- package/dist/{chunk-7fbpsnt7.js → chunk-5tp7y1kc.js} +3 -3
- package/dist/{chunk-6pyxykt1.js → chunk-6jceaa1q.js} +18 -10
- package/dist/{chunk-vf1aatbh.js → chunk-7bktb38f.js} +104 -17
- package/dist/{chunk-rtqdqr0v.js → chunk-9z371t6k.js} +131 -10
- package/dist/{chunk-248msks2.js → chunk-bm7hjnrx.js} +3 -2
- package/dist/{chunk-vkgqtwqm.js → chunk-gjt5m6xc.js} +3 -3
- package/dist/{chunk-bs81bt3q.js → chunk-hvr790k3.js} +74 -4
- package/dist/{chunk-x7b9bwk6.js → chunk-ryed23pv.js} +1 -1
- package/dist/{chunk-cnzz61ta.js → chunk-vpee5tme.js} +90 -6
- package/dist/{chunk-b6m9rfzj.js → chunk-vxv1v337.js} +13 -13
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -246,7 +246,7 @@ import {
|
|
|
246
246
|
installCommand,
|
|
247
247
|
checkServicesFile,
|
|
248
248
|
checkServices
|
|
249
|
-
} from "./chunk-
|
|
249
|
+
} from "./chunk-9z371t6k.js";
|
|
250
250
|
import {
|
|
251
251
|
join,
|
|
252
252
|
interrupt,
|
|
@@ -302,8 +302,8 @@ import {
|
|
|
302
302
|
applyAgentEnvironmentMaterialization2,
|
|
303
303
|
isPathWithin2,
|
|
304
304
|
skillIdentity2
|
|
305
|
-
} from "./chunk-
|
|
306
|
-
import"./chunk-
|
|
305
|
+
} from "./chunk-3y7j2s7v.js";
|
|
306
|
+
import"./chunk-0ca9dqh5.js";
|
|
307
307
|
import {
|
|
308
308
|
egressAllowed,
|
|
309
309
|
writeSecretRegistry,
|
|
@@ -328,8 +328,8 @@ import {
|
|
|
328
328
|
rpcRunFiles,
|
|
329
329
|
programHostsEnv,
|
|
330
330
|
undeclaredHostsEnv
|
|
331
|
-
} from "./chunk-
|
|
332
|
-
import"./chunk-
|
|
331
|
+
} from "./chunk-6jceaa1q.js";
|
|
332
|
+
import"./chunk-bm7hjnrx.js";
|
|
333
333
|
import {
|
|
334
334
|
nextInt
|
|
335
335
|
} from "./chunk-nzjb36ad.js";
|
|
@@ -337,7 +337,7 @@ import {
|
|
|
337
337
|
ChildProcessSpawner,
|
|
338
338
|
make3
|
|
339
339
|
} from "./chunk-sk6ceghr.js";
|
|
340
|
-
import"./chunk-
|
|
340
|
+
import"./chunk-5326a9ks.js";
|
|
341
341
|
|
|
342
342
|
// packages/core/src/sync-kit.ts
|
|
343
343
|
import { createHash } from "crypto";
|
|
@@ -7091,6 +7091,81 @@ var programProcessExecutor = (input) => (work) => gen(function* () {
|
|
|
7091
7091
|
status: "deferred",
|
|
7092
7092
|
crashed: `it did not start: ${error.message}`.slice(0, 500)
|
|
7093
7093
|
})));
|
|
7094
|
+
// packages/agent-runtime/src/deploy-script.ts
|
|
7095
|
+
var deployScript = ".kitman/deploy";
|
|
7096
|
+
var deployTimeout = "3 hours";
|
|
7097
|
+
var detailLimit = 1200;
|
|
7098
|
+
var statusOfExit = (exitCode) => {
|
|
7099
|
+
switch (exitCode) {
|
|
7100
|
+
case 0:
|
|
7101
|
+
return "deployed";
|
|
7102
|
+
case 2:
|
|
7103
|
+
return "rolled_back";
|
|
7104
|
+
case 3:
|
|
7105
|
+
return "rollback_failed";
|
|
7106
|
+
default:
|
|
7107
|
+
return "failed";
|
|
7108
|
+
}
|
|
7109
|
+
};
|
|
7110
|
+
var executableAt = (checkout, revision) => map8(runCommand2("git", ["-C", checkout, "ls-tree", "--end-of-options", revision, "--", deployScript]), (listed) => listed.startsWith("100755 "));
|
|
7111
|
+
var tagCommit = (checkout, tagRef) => exit(runCommand2("git", ["-C", checkout, "rev-parse", "--verify", "--quiet", "--end-of-options", `${tagRef}^{commit}`]));
|
|
7112
|
+
var headOf = (checkout) => map8(all3([
|
|
7113
|
+
runCommand2("git", ["-C", checkout, "rev-parse", "HEAD"]),
|
|
7114
|
+
runCommand2("git", ["-C", checkout, "rev-parse", "HEAD^{tree}"])
|
|
7115
|
+
]), ([revision, tree]) => ({ revision: revision.trim(), tree: tree.trim(), checks: [] }));
|
|
7116
|
+
var deployDetail = (output, exitCode) => {
|
|
7117
|
+
const last = output.trimEnd().split(`
|
|
7118
|
+
`).at(-1) ?? "";
|
|
7119
|
+
const reported = /^kitman-deploy: \S+ (.+)$/u.exec(last)?.[1]?.trim();
|
|
7120
|
+
if (reported !== undefined && reported !== "")
|
|
7121
|
+
return redactedOutputTail(reported, detailLimit);
|
|
7122
|
+
const ended = exitCode === undefined ? `${deployScript} did not exit in time` : `${deployScript} exited with exit code ${exitCode}`;
|
|
7123
|
+
return `${ended}: ${redactedOutputTail(output, detailLimit - ended.length - 2)}`;
|
|
7124
|
+
};
|
|
7125
|
+
var deployTag = (work, deploy, checkouts, mayRun, timeout = deployTimeout) => gen(function* () {
|
|
7126
|
+
const checkout = yield* checkouts.checkout({ runId: work.runId, id: work.id, baseRevision: work.revision }, work.repoBinding);
|
|
7127
|
+
const tagRef = `refs/tags/${deploy.tag}`;
|
|
7128
|
+
if (!(yield* executableAt(checkout, "HEAD"))) {
|
|
7129
|
+
let tagged = yield* tagCommit(checkout, tagRef);
|
|
7130
|
+
if (isFailure2(tagged)) {
|
|
7131
|
+
yield* ignore(runCommand2("git", ["-C", checkout, "fetch", "--quiet", "origin", `+${tagRef}:${tagRef}`], {
|
|
7132
|
+
env: yield* checkouts.transferEnv(work.repoBinding),
|
|
7133
|
+
timeout: "5 minutes"
|
|
7134
|
+
}));
|
|
7135
|
+
tagged = yield* tagCommit(checkout, tagRef);
|
|
7136
|
+
}
|
|
7137
|
+
if (isFailure2(tagged))
|
|
7138
|
+
return { failed: `The tag ${deploy.tag} is not in ${work.repoBinding.id}'s clone` };
|
|
7139
|
+
if (!(yield* executableAt(checkout, tagRef))) {
|
|
7140
|
+
const none = {
|
|
7141
|
+
status: "none",
|
|
7142
|
+
detail: `Neither ${work.revision} nor ${deploy.tag} has an executable ${deployScript}`
|
|
7143
|
+
};
|
|
7144
|
+
return { ranAt: yield* headOf(checkout), deployed: none };
|
|
7145
|
+
}
|
|
7146
|
+
yield* runCommand2("git", ["-C", checkout, "checkout", "--quiet", "--detach", tagRef]);
|
|
7147
|
+
}
|
|
7148
|
+
if (!mayRun)
|
|
7149
|
+
return { ranAt: yield* headOf(checkout), found: true };
|
|
7150
|
+
const decoder = new TextDecoder;
|
|
7151
|
+
let printed = "";
|
|
7152
|
+
const ran = yield* runProcess2([`${checkout}/${deployScript}`, deploy.tag, ...deploy.previousTag === undefined ? [] : [deploy.previousTag]], {
|
|
7153
|
+
cwd: checkout,
|
|
7154
|
+
env: { GIT_TERMINAL_PROMPT: "0" },
|
|
7155
|
+
timeout,
|
|
7156
|
+
onOutput: (chunk) => sync2(() => {
|
|
7157
|
+
printed = (printed + decoder.decode(chunk, { stream: true })).slice(-shellOutputTailChars2);
|
|
7158
|
+
})
|
|
7159
|
+
});
|
|
7160
|
+
const output = ran.exitCode === undefined ? printed : ran.output;
|
|
7161
|
+
const deployed = {
|
|
7162
|
+
status: statusOfExit(ran.exitCode),
|
|
7163
|
+
...ran.exitCode === undefined ? undefined : { exitCode: ran.exitCode },
|
|
7164
|
+
detail: deployDetail(output, ran.exitCode)
|
|
7165
|
+
};
|
|
7166
|
+
return { ranAt: yield* headOf(checkout), deployed };
|
|
7167
|
+
});
|
|
7168
|
+
|
|
7094
7169
|
// packages/agent-runtime/src/half-close-relay.ts
|
|
7095
7170
|
import { once } from "events";
|
|
7096
7171
|
import { connect as connect2, createServer as createServer2 } from "net";
|
|
@@ -7702,6 +7777,15 @@ var verificationExecutor = (input) => (work) => gen(function* () {
|
|
|
7702
7777
|
const checkouts = runCheckouts(input.rootDir, input.gitCredentials);
|
|
7703
7778
|
if (work.resolve !== undefined)
|
|
7704
7779
|
return yield* resolveRevisions(work, work.resolve.revisions, checkouts);
|
|
7780
|
+
if (work.deploy !== undefined) {
|
|
7781
|
+
const ran = yield* deployTag(work, work.deploy, checkouts, input.runsDeployScripts === true && work.deploy.runsScript === true, input.deployTimeout);
|
|
7782
|
+
if ("failed" in ran)
|
|
7783
|
+
return { status: "failed", failureSummary: ran.failed };
|
|
7784
|
+
return {
|
|
7785
|
+
status: "completed",
|
|
7786
|
+
evidence: "found" in ran ? { head: ran.ranAt, deployScriptFound: true } : { head: ran.ranAt, deployed: ran.deployed }
|
|
7787
|
+
};
|
|
7788
|
+
}
|
|
7705
7789
|
if (work.measure !== undefined) {
|
|
7706
7790
|
const measured = yield* measureRevisions(work, work.measure, checkouts, runIn);
|
|
7707
7791
|
const outcome = "failed" in measured ? { status: "failed", failureSummary: measured.failed } : { status: "completed", evidence: measured.measured };
|
|
@@ -35,6 +35,14 @@ import {
|
|
|
35
35
|
} from "./chunk-vtfwjhzh.js";
|
|
36
36
|
import"./chunk-0qz10ek8.js";
|
|
37
37
|
import"./chunk-c6rbt85q.js";
|
|
38
|
+
import {
|
|
39
|
+
decodeText,
|
|
40
|
+
mkString,
|
|
41
|
+
FileSystem,
|
|
42
|
+
Path,
|
|
43
|
+
withDefault,
|
|
44
|
+
String2
|
|
45
|
+
} from "./chunk-3d4d52e5.js";
|
|
38
46
|
import {
|
|
39
47
|
SecureRandom,
|
|
40
48
|
layerWebCrypto,
|
|
@@ -46,31 +54,23 @@ import {
|
|
|
46
54
|
layer4,
|
|
47
55
|
kitmanMcpServer,
|
|
48
56
|
RunnerRpcProtocolVersion
|
|
49
|
-
} from "./chunk-
|
|
50
|
-
import {
|
|
51
|
-
decodeText,
|
|
52
|
-
mkString,
|
|
53
|
-
FileSystem,
|
|
54
|
-
Path,
|
|
55
|
-
withDefault,
|
|
56
|
-
String2
|
|
57
|
-
} from "./chunk-3d4d52e5.js";
|
|
57
|
+
} from "./chunk-9z371t6k.js";
|
|
58
58
|
import {
|
|
59
59
|
Packument,
|
|
60
60
|
tarballMatches
|
|
61
|
-
} from "./chunk-
|
|
62
|
-
import"./chunk-
|
|
61
|
+
} from "./chunk-0ca9dqh5.js";
|
|
62
|
+
import"./chunk-bm7hjnrx.js";
|
|
63
63
|
import {
|
|
64
64
|
AgentDeclaration,
|
|
65
65
|
KitDeclarations,
|
|
66
66
|
describeFlag,
|
|
67
67
|
Described
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-6jceaa1q.js";
|
|
69
69
|
import {
|
|
70
70
|
ChildProcessSpawner,
|
|
71
71
|
make3
|
|
72
72
|
} from "./chunk-sk6ceghr.js";
|
|
73
|
-
import"./chunk-
|
|
73
|
+
import"./chunk-5326a9ks.js";
|
|
74
74
|
|
|
75
75
|
// packages/sdk/src/build/index.ts
|
|
76
76
|
class DependencyInstallFailed extends TaggedError2()("DependencyInstallFailed", {
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,6 @@ if (args[0] === "srt") {
|
|
|
14
14
|
const { runOpencodeReader } = await import("./chunk-d9bv70qb.js");
|
|
15
15
|
runOpencodeReader();
|
|
16
16
|
} else {
|
|
17
|
-
const { runCli } = await import("./chunk-
|
|
17
|
+
const { runCli } = await import("./chunk-7bktb38f.js");
|
|
18
18
|
runCli(args);
|
|
19
19
|
}
|