@kitman-sh/cli 0.11.3 → 0.11.5

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.
@@ -105,7 +105,7 @@ import {
105
105
  KitDigest,
106
106
  KitSetup,
107
107
  RunnerRpcError
108
- } from "./chunk-5scsh754.js";
108
+ } from "./chunk-zbdnd7z7.js";
109
109
  import {
110
110
  runForEach,
111
111
  FileSystem
@@ -811,7 +811,9 @@ var TranscriptPoint = Struct({
811
811
  });
812
812
  var TranscriptsRequest = Struct({
813
813
  days: Int.check(isGreaterThanOrEqualTo(1), isLessThanOrEqualTo(31)),
814
- teamId: optionalKey(String4)
814
+ teamId: optionalKey(String4),
815
+ projectId: optionalKey(String4),
816
+ fileIntoProjectId: optionalKey(String4)
815
817
  });
816
818
  var TranscriptsResult = Struct({
817
819
  runs: ArraySchema(Struct({
@@ -846,6 +848,7 @@ var ProposeRequest = Union([
846
848
  title: String4,
847
849
  description: String4,
848
850
  teamId: optional(String4),
851
+ projectId: optionalKey(String4),
849
852
  key: optionalKey(String4.check(isPattern(/^[a-z0-9]+(?:-[a-z0-9]+)*$/), isMaxLength(80))),
850
853
  citations: Citations
851
854
  })
@@ -26,15 +26,15 @@ import {
26
26
  tomlKeyPath2,
27
27
  kitmanSkillEntry,
28
28
  isPathWithin2
29
- } from "./chunk-30jqf7ez.js";
29
+ } from "./chunk-y78nw5ty.js";
30
30
  import {
31
31
  instructionsStart,
32
32
  instructionsEnd,
33
33
  renderMcpServer,
34
34
  materializeKitSetup,
35
35
  tomlInline
36
- } from "./chunk-5scsh754.js";
37
- import"./chunk-pxrpwv4z.js";
36
+ } from "./chunk-zbdnd7z7.js";
37
+ import"./chunk-xadtvj2q.js";
38
38
  import"./chunk-sk6ceghr.js";
39
39
 
40
40
  // packages/agent-runtime/src/kit-setup-sync.ts
@@ -54,23 +54,23 @@ import {
54
54
  layer4,
55
55
  kitmanMcpServer,
56
56
  RunnerRpcProtocolVersion
57
- } from "./chunk-5scsh754.js";
57
+ } from "./chunk-zbdnd7z7.js";
58
58
  import {
59
59
  Packument,
60
60
  tarballMatches
61
- } from "./chunk-pxrpwv4z.js";
62
- import"./chunk-3466x4xq.js";
61
+ } from "./chunk-xadtvj2q.js";
62
+ import"./chunk-73rctgzy.js";
63
63
  import {
64
64
  AgentDeclaration,
65
65
  KitDeclarations,
66
66
  describeFlag,
67
67
  Described
68
- } from "./chunk-2t3beh6a.js";
68
+ } from "./chunk-0j0bncss.js";
69
69
  import {
70
70
  ChildProcessSpawner,
71
71
  make3
72
72
  } from "./chunk-sk6ceghr.js";
73
- import"./chunk-r2e1ke17.js";
73
+ import"./chunk-k004grgr.js";
74
74
 
75
75
  // packages/sdk/src/build/index.ts
76
76
  class DependencyInstallFailed extends TaggedError2()("DependencyInstallFailed", {
@@ -19,13 +19,13 @@ import {
19
19
  RunnerReplicaRpcs,
20
20
  RunnerRunFileRpcs,
21
21
  ProgramRpcs
22
- } from "./chunk-5scsh754.js";
22
+ } from "./chunk-zbdnd7z7.js";
23
23
  import {
24
24
  layerJson,
25
25
  make4,
26
26
  withHeaders,
27
27
  layerProtocolSocket
28
- } from "./chunk-r2e1ke17.js";
28
+ } from "./chunk-k004grgr.js";
29
29
 
30
30
  // packages/live/src/rpc/runner-client.ts
31
31
  var proxiedWebSocket = (proxy) => succeed5(WebSocketConstructor)((target) => {
@@ -159,7 +159,7 @@ import {
159
159
  runMcpEffect,
160
160
  createAgentAuthSignedFetch,
161
161
  setupMcpAgentCredential
162
- } from "./chunk-5scsh754.js";
162
+ } from "./chunk-zbdnd7z7.js";
163
163
  import {
164
164
  guard,
165
165
  Id,
@@ -202,7 +202,7 @@ import {
202
202
  withHeaders,
203
203
  layerProtocolSocket,
204
204
  ConnectionHooks
205
- } from "./chunk-r2e1ke17.js";
205
+ } from "./chunk-k004grgr.js";
206
206
 
207
207
  // apps/cli/src/mcp.ts
208
208
  import { tmpdir as tmpdir2 } from "os";
@@ -12,7 +12,7 @@ import {
12
12
  herdrCoreLayer2,
13
13
  herdrCoreTransportLayer2,
14
14
  updateHerdrCore2
15
- } from "./chunk-5scsh754.js";
15
+ } from "./chunk-zbdnd7z7.js";
16
16
  import"./chunk-3d4d52e5.js";
17
17
  import"./chunk-vtfwjhzh.js";
18
18
  export {
@@ -123,7 +123,7 @@ import {
123
123
  ParseOptions,
124
124
  RpcClientDefect,
125
125
  RpcClientError
126
- } from "./chunk-5scsh754.js";
126
+ } from "./chunk-zbdnd7z7.js";
127
127
 
128
128
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/workers/Transferable.js
129
129
  class Collector extends (/* @__PURE__ */ Service2()("effect/workers/Transferable/Collector")) {
@@ -246,7 +246,7 @@ import {
246
246
  installCommand,
247
247
  checkServicesFile,
248
248
  checkServices
249
- } from "./chunk-5scsh754.js";
249
+ } from "./chunk-zbdnd7z7.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-30jqf7ez.js";
306
- import"./chunk-pxrpwv4z.js";
305
+ } from "./chunk-y78nw5ty.js";
306
+ import"./chunk-xadtvj2q.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-2t3beh6a.js";
332
- import"./chunk-3466x4xq.js";
331
+ } from "./chunk-0j0bncss.js";
332
+ import"./chunk-73rctgzy.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-r2e1ke17.js";
340
+ import"./chunk-k004grgr.js";
341
341
 
342
342
  // packages/core/src/sync-kit.ts
343
343
  import { createHash } from "crypto";
@@ -3084,7 +3084,13 @@ var update = /* @__PURE__ */ dual(2, (self, update) => self.semaphore.withPermit
3084
3084
 
3085
3085
  // packages/agent-runtime/src/claude-workspace-trust.ts
3086
3086
  var withEntry = (object, key, value) => Object.fromEntries([...Object.entries(object), [key, value]]);
3087
- var trustClaudeWorkspace = (home, workspace) => gen(function* () {
3087
+ var writePermits = new Map;
3088
+ var trustClaudeWorkspace = (home, workspace) => {
3089
+ const permit = writePermits.get(home) ?? makeUnsafe3(1);
3090
+ writePermits.set(home, permit);
3091
+ return permit.withPermits(1)(trust(home, workspace));
3092
+ };
3093
+ var trust = (home, workspace) => gen(function* () {
3088
3094
  const fs = yield* FileSystem;
3089
3095
  const file = `${home}/.claude.json`;
3090
3096
  const text = yield* fs.readFileString(file).pipe(catchReason("PlatformError", "NotFound", () => succeed6("{}")));
@@ -4238,8 +4244,10 @@ var runAttempt = (request, options) => gen(function* () {
4238
4244
  }
4239
4245
  });
4240
4246
  const terminal = yield* result(call(run, (connection) => flatMap3(connection.list({ labels: { "kitman.attempt": attempt.id }, all: true }), ([started]) => started === undefined ? run(connection) : succeed6(started))));
4241
- if (isFailure(terminal))
4247
+ if (isFailure(terminal)) {
4248
+ yield* logWarning("agent_launch_failed", { attempt: attempt.id, error: terminal.failure.message });
4242
4249
  return isTagged(terminal.failure, "HerdrCoreRpcError") ? failed("harness_launch_failed", `herdr-core refused to start the Harness: ${terminal.failure.message}`) : { status: "unreported", reason: "herdr_unavailable" };
4250
+ }
4243
4251
  const { address } = terminal.success;
4244
4252
  const seen = yield* make({ status: null, turn: 0, end: undefined });
4245
4253
  yield* forkScoped(follow(options.core, attempt.id, address, seen));
@@ -4249,6 +4257,7 @@ var runAttempt = (request, options) => gen(function* () {
4249
4257
  yield* stopTerminal(call, address, options.teardownDelayMs);
4250
4258
  });
4251
4259
  const outputSubmitted = request.settled.pipe(orElseSucceed(() => false));
4260
+ const readScreen = map8(option2(call((connection) => connection.read(address))), (screen) => isSome(screen) ? redactCredentials(screen.value).trim() : "");
4252
4261
  const judge = (last) => gen(function* () {
4253
4262
  if (yield* outputSubmitted)
4254
4263
  return { status: "settled" };
@@ -4262,8 +4271,7 @@ var runAttempt = (request, options) => gen(function* () {
4262
4271
  case undefined: {
4263
4272
  if (last.status !== "blocked" && last.status !== "error")
4264
4273
  return failed("output_missing", "The agent finished without submitting its Output.");
4265
- const screen = yield* option2(call((connection) => connection.read(address)));
4266
- const shown = isSome(screen) ? redactCredentials(screen.value).trim() : "";
4274
+ const shown = yield* readScreen;
4267
4275
  if (last.status === "error") {
4268
4276
  yield* logWarning("agent_errored", { attempt: attempt.id, address, screen: shown });
4269
4277
  return failed("harness_error", `The Harness stopped in its error state before it submitted its Output.${shown === "" ? "" : ` Its screen ended: ${shown.slice(-blockedScreenChars)}`}`);
@@ -4280,8 +4288,11 @@ var runAttempt = (request, options) => gen(function* () {
4280
4288
  });
4281
4289
  const drive = gen(function* () {
4282
4290
  const ready = yield* until(seen, (last) => last.end !== undefined || last.status !== null && last.status !== "working").pipe(timeoutOption(launchTimeout));
4283
- if (isNone(ready))
4284
- return failed("harness_launch_timeout", "The Harness reported no status within 120 s of its launch.");
4291
+ if (isNone(ready)) {
4292
+ const shown = yield* readScreen;
4293
+ yield* logWarning("agent_launch_timeout", { attempt: attempt.id, address, screen: shown });
4294
+ return failed("harness_launch_timeout", `The Harness reported no status within 120 s of its launch.${shown === "" ? " Its screen was empty." : ` Its screen ended: ${shown.slice(-blockedScreenChars)}`}`);
4295
+ }
4285
4296
  if (ready.value.end !== undefined)
4286
4297
  return yield* judge(ready.value);
4287
4298
  const brief = firstMessage(request.launch, workspace, launch.systemBrief === true);
@@ -218,7 +218,7 @@ import {
218
218
  harnessNames,
219
219
  herdrRunnerCapabilities2,
220
220
  declaredChecks
221
- } from "./chunk-5scsh754.js";
221
+ } from "./chunk-zbdnd7z7.js";
222
222
  import {
223
223
  Id
224
224
  } from "./chunk-0qz10ek8.js";
@@ -530,10 +530,10 @@ var sandboxMissing = (sandbox, missing) => ({
530
530
  var personalCheckBackend = (agentSandbox, dockerAvailable) => agentSandbox === "srt" || agentSandbox === "docker" && dockerAvailable ? agentSandbox : undefined;
531
531
  var herdrCoreSession = (runnerId, personal) => personal ? undefined : `kitman-${sha2562(runnerId).slice(0, 16)}`;
532
532
  var OpenHerdrCore = Reference("kitman/cli/OpenHerdrCore", {
533
- defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-6f0sjc6r.js")), ({ HerdrCore, herdrCoreLayer }) => provide3(service(HerdrCore), herdrCoreLayer(options)))
533
+ defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-jhm247mx.js")), ({ HerdrCore, herdrCoreLayer }) => provide3(service(HerdrCore), herdrCoreLayer(options)))
534
534
  });
535
535
  var UpdateHerdrCore = Reference("kitman/cli/UpdateHerdrCore", {
536
- defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-6f0sjc6r.js")), (module) => module.updateHerdrCore(options))
536
+ defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-jhm247mx.js")), (module) => module.updateHerdrCore(options))
537
537
  });
538
538
  var herdrCoreMissing = (error) => {
539
539
  if (isTagged(error, "HerdrCoreMissing"))
@@ -953,7 +953,7 @@ var syncTargets = (harness) => gen(function* () {
953
953
  });
954
954
  var syncKits = (input) => gen(function* () {
955
955
  const fs = yield* FileSystem;
956
- const { syncKitSetup } = yield* promise(() => import("./chunk-rrg23eed.js"));
956
+ const { syncKitSetup } = yield* promise(() => import("./chunk-60vg33dt.js"));
957
957
  const harnesses = yield* syncTargets(input.harness);
958
958
  const chain = yield* input.client.getKitChain(input.workspaceId);
959
959
  for (const { name, problem } of chain.skipped)
@@ -1871,7 +1871,7 @@ var package_default = {
1871
1871
  };
1872
1872
 
1873
1873
  // apps/cli/src/scaffold.ts
1874
- var cliVersion = "0.11.3";
1874
+ var cliVersion = "0.11.5";
1875
1875
  var packageJson = (name, scaffold) => `${JSON.stringify({
1876
1876
  name,
1877
1877
  private: true,
@@ -2137,7 +2137,7 @@ var Usage = [
2137
2137
  "Every run, loop, agent, verify, constraint, secret, claim, deploy, dev and kit command takes --json."
2138
2138
  ].join(`
2139
2139
  `);
2140
- var agentRuntime = promise(() => import("./chunk-0ebt5ek2.js"));
2140
+ var agentRuntime = promise(() => import("./chunk-rj7c1m4z.js"));
2141
2141
  var TuiLauncher = Reference("kitman/cli/TuiLauncher", {
2142
2142
  defaultValue: () => gen(function* () {
2143
2143
  const tui = yield* tryPromise({
@@ -3134,7 +3134,7 @@ var SandboxHostProbe = Reference("kitman/cli/SandboxHostProbe", {
3134
3134
  });
3135
3135
  var OpenRunnerRpc = Reference("kitman/cli/OpenRunnerRpc", {
3136
3136
  defaultValue: () => (options) => gen(function* () {
3137
- const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-t2eqpjdk.js"));
3137
+ const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-t2sv5jhr.js"));
3138
3138
  return yield* makeRunnerRpcClient({
3139
3139
  runnerId: options.runnerId,
3140
3140
  bearer: options.bearer,
@@ -3658,7 +3658,7 @@ function mcpCommand(args) {
3658
3658
  if (command.action === "run") {
3659
3659
  if (command.args.length > 0)
3660
3660
  return yield* new CliError({ message: `Unknown command: ${args.join(" ")}` });
3661
- const { runMcpServerCommand } = yield* promise(() => import("./chunk-45fy4v4q.js"));
3661
+ const { runMcpServerCommand } = yield* promise(() => import("./chunk-gpk5ce9g.js"));
3662
3662
  return yield* runMcpServerCommand({ flags: command.flags });
3663
3663
  }
3664
3664
  if (command.action !== "setup")
@@ -4928,9 +4928,9 @@ function changeRequestCommand(args) {
4928
4928
  yield* log(command.action === "approve" ? `Approved ${short} of ${changeRequest.title}. A Run waiting on approval of ${short} resumes; one waiting on another head does not.` : `Requested changes to ${short} of ${changeRequest.title}`);
4929
4929
  });
4930
4930
  }
4931
- var KitWriter = map8(promise(() => import("./chunk-x8tn2md0.js")), (build) => build.writeKit);
4931
+ var KitWriter = map8(promise(() => import("./chunk-6cfskczm.js")), (build) => build.writeKit);
4932
4932
  var KitBuilder = Reference("kitman/cli/KitBuilder", {
4933
- defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-x8tn2md0.js")), (build) => build.buildKit(directory))
4933
+ defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-6cfskczm.js")), (build) => build.buildKit(directory))
4934
4934
  });
4935
4935
  var uploadKit = (client, workspaceId, built) => gen(function* () {
4936
4936
  yield* client.uploadKitBundle(workspaceId, built.digest, { bundle: encode2(built.bundle) });
@@ -4,9 +4,9 @@ import {
4
4
  runnerRpcUrl2,
5
5
  makeRunnerRpcClient2,
6
6
  makeProgramRpcClient2
7
- } from "./chunk-3466x4xq.js";
8
- import"./chunk-r2e1ke17.js";
9
- import"./chunk-5scsh754.js";
7
+ } from "./chunk-73rctgzy.js";
8
+ import"./chunk-k004grgr.js";
9
+ import"./chunk-zbdnd7z7.js";
10
10
  import"./chunk-0qz10ek8.js";
11
11
  import"./chunk-c6rbt85q.js";
12
12
  import"./chunk-3d4d52e5.js";
@@ -38,7 +38,7 @@ import {
38
38
  get2,
39
39
  layer4,
40
40
  KitDigest
41
- } from "./chunk-5scsh754.js";
41
+ } from "./chunk-zbdnd7z7.js";
42
42
 
43
43
  // packages/core/src/npm-registry.ts
44
44
  var KitManifest = Struct({
@@ -37,10 +37,10 @@ import {
37
37
  AgentHarnessIds,
38
38
  sha2562,
39
39
  runCommand2
40
- } from "./chunk-5scsh754.js";
40
+ } from "./chunk-zbdnd7z7.js";
41
41
  import {
42
42
  NpmRegistry
43
- } from "./chunk-pxrpwv4z.js";
43
+ } from "./chunk-xadtvj2q.js";
44
44
 
45
45
  // packages/agent-runtime/src/config-convergence.ts
46
46
  var writeAgentEnvironmentConfigFile2 = fnUntraced(function* (file, content, keep = {}) {
@@ -14465,7 +14465,14 @@ class RunnerCapabilityRpcs extends make7(make6("PutQuestion", {
14465
14465
  }),
14466
14466
  error: RunnerRpcError
14467
14467
  }), make6("ReadTranscripts", {
14468
- payload: { lease: ProgramLease, step: String4, days: Int, teamId: optionalKey(String4) },
14468
+ payload: {
14469
+ lease: ProgramLease,
14470
+ step: String4,
14471
+ days: Int,
14472
+ teamId: optionalKey(String4),
14473
+ projectId: optionalKey(String4),
14474
+ fileIntoProjectId: optionalKey(String4)
14475
+ },
14469
14476
  success: Struct({
14470
14477
  runs: ArraySchema(Struct({
14471
14478
  runId: String4,
@@ -14584,6 +14591,7 @@ class RunnerCapabilityRpcs extends make7(make6("PutQuestion", {
14584
14591
  title: String4,
14585
14592
  description: String4,
14586
14593
  teamId: optionalKey(String4),
14594
+ projectId: optionalKey(String4),
14587
14595
  key: optionalKey(String4),
14588
14596
  citations: NonEmptyArray(Struct({ runId: String4, stepAttemptId: String4, sequence: Int }))
14589
14597
  })
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-yqarnbky.js");
17
+ const { runCli } = await import("./chunk-sjsh7819.js");
18
18
  runCli(args);
19
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitman-sh/cli",
3
- "version": "0.11.3",
3
+ "version": "0.11.5",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {