@kitman-sh/cli 0.13.14 → 0.13.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.
Files changed (27) hide show
  1. package/dist/{chunk-hmt2egsx.js → chunk-49gbakce.js} +6 -6
  2. package/dist/{chunk-d4kmyv5h.js → chunk-4zh7qxck.js} +4 -4
  3. package/dist/{chunk-dwxqp8ez.js → chunk-5cevjkrb.js} +16 -16
  4. package/dist/{chunk-vmww6hnk.js → chunk-5w6r4mw6.js} +30 -30
  5. package/dist/{chunk-5ba08a9e.js → chunk-at5dh2te.js} +18 -18
  6. package/dist/{chunk-5mxvqg32.js → chunk-bt22cd13.js} +15 -10
  7. package/dist/{chunk-fk5238tn.js → chunk-c9rvst3x.js} +4 -4
  8. package/dist/{chunk-hw9fcfs0.js → chunk-cbzqfz1k.js} +9 -9
  9. package/dist/{chunk-vjsqg4a5.js → chunk-d9z9cyzt.js} +32 -32
  10. package/dist/{chunk-aa30tt6t.js → chunk-fc2bhh5v.js} +2 -2
  11. package/dist/{chunk-24h0y27w.js → chunk-gq7y5v3e.js} +1 -1
  12. package/dist/{chunk-4142qeg3.js → chunk-mbqb40ev.js} +16 -16
  13. package/dist/{chunk-hgfphycc.js → chunk-nf9gdnsf.js} +17 -26
  14. package/dist/{chunk-pxvd8w2v.js → chunk-q5w3v4k1.js} +1 -1
  15. package/dist/{chunk-mmd7mjv0.js → chunk-s88vcvtd.js} +3 -3
  16. package/dist/{chunk-6agcvxbj.js → chunk-sjdze64n.js} +10 -10
  17. package/dist/{chunk-06dwvzv0.js → chunk-t4xwk14b.js} +152 -107
  18. package/dist/{chunk-89rpg6j9.js → chunk-tntbdpmy.js} +86 -86
  19. package/dist/{chunk-st8ggqv1.js → chunk-ttk3d0z2.js} +154 -142
  20. package/dist/{chunk-zencwg2t.js → chunk-v1e4g2re.js} +1 -1
  21. package/dist/{chunk-8xpdkxr7.js → chunk-vsrjg9nm.js} +68 -22
  22. package/dist/{chunk-ggmwpwhf.js → chunk-x7acexnm.js} +5 -5
  23. package/dist/{chunk-ef3nzqng.js → chunk-y7p4d14b.js} +3 -3
  24. package/dist/{chunk-3vbs995s.js → chunk-zd6y6ka8.js} +167 -123
  25. package/dist/{chunk-zgraq2y3.js → chunk-zw3gf6r5.js} +28 -70
  26. package/dist/index.js +4 -4
  27. package/package.json +1 -1
@@ -1,4 +1,123 @@
1
1
  // @bun
2
+ import {
3
+ currentTimeMillis,
4
+ SecureRandom,
5
+ layerWebCrypto,
6
+ runMain,
7
+ Stdio,
8
+ Terminal,
9
+ layer3,
10
+ error,
11
+ log,
12
+ toIso,
13
+ currentDate,
14
+ waitingOnWords,
15
+ queueWords,
16
+ redactResponseSurface,
17
+ ReleaseChannels,
18
+ DefaultReleaseChannel,
19
+ newerKitmanVersion,
20
+ releaseChannelOffers,
21
+ NetworkHost,
22
+ RepoBindingProviders,
23
+ RepoBindingCredentialProviderTypes,
24
+ ContextPackModes,
25
+ DefaultContextPackMode,
26
+ ProposalStatuses,
27
+ ProposalTargetTypes,
28
+ tokenCountWords,
29
+ RunDisplayStates,
30
+ RunnerExecutionBackend,
31
+ MaxRunnerConcurrency,
32
+ PinnedImage,
33
+ RunnerSettingNames,
34
+ RunnerSettingsUpdate,
35
+ defaultRunnerSettings,
36
+ shownRunnerSetting,
37
+ defaultRunnerCapabilities,
38
+ deliveryProviderActions,
39
+ MemoryStatuses,
40
+ MemoryScopes,
41
+ MaxMemoryListLimit,
42
+ DecisionStatuses,
43
+ FixFlowRecoveryActions,
44
+ KitmanAgentCapabilityNames,
45
+ sha2562,
46
+ isRunFileRefusalReason,
47
+ runFileRefusalWords,
48
+ repositoryKey,
49
+ createId,
50
+ digestSha256,
51
+ sha256Hasher,
52
+ raw,
53
+ make5,
54
+ get,
55
+ put,
56
+ HttpClient,
57
+ execute,
58
+ Fetch,
59
+ layer4,
60
+ runDisplayLabels,
61
+ listedSummary,
62
+ stepFallbackWords,
63
+ defaultKitName,
64
+ SetupArchive,
65
+ KitmanClientError,
66
+ KitmanEffectClient,
67
+ CliError,
68
+ DefaultApiUrl,
69
+ resolveConfig,
70
+ apiUrlFromEnv,
71
+ stepCredentialFromEnv,
72
+ mcpCredentialNameFromEnv,
73
+ userConfigPath,
74
+ userAuthPath,
75
+ userHarnessSyncPath,
76
+ kitSetupCacheDir,
77
+ bundleCacheDir,
78
+ runnerReleaseChannelPath,
79
+ localConfigPath,
80
+ readUserConfig,
81
+ writeUserConfig,
82
+ sessionForApi,
83
+ readAuthStore,
84
+ storeSession,
85
+ removeSession,
86
+ removeAllSessions,
87
+ agentCredentialForApi,
88
+ storeAgentCredential,
89
+ removeAgentCredential,
90
+ normalizeApiUrl,
91
+ isStoredAgentCredential,
92
+ RpcClientError,
93
+ RunnerHeaders,
94
+ RunnerRpcError,
95
+ parseCallbackUrl,
96
+ revokeToken,
97
+ toStoredSession,
98
+ browserLogin,
99
+ openBrowser,
100
+ shouldRefresh,
101
+ createSdkClient,
102
+ refreshSession,
103
+ createAgentAuthBearerToken,
104
+ createAgentAuthSignedFetch,
105
+ setupMcpAgentCredential,
106
+ generateAgentKeyPair,
107
+ HERDR_CORE_GENERATION2,
108
+ HERDR_CORE_INSTALL_COMMAND2,
109
+ CommandFailed2,
110
+ runCommand2,
111
+ detectHarnesses2,
112
+ kitHarnesses,
113
+ isKitHarness,
114
+ harnessNames,
115
+ herdrRunnerCapabilities2,
116
+ declaredChecks
117
+ } from "./chunk-zd6y6ka8.js";
118
+ import {
119
+ Id
120
+ } from "./chunk-q5w3v4k1.js";
2
121
  import {
3
122
  isTagged,
4
123
  none,
@@ -12,7 +131,7 @@ import {
12
131
  succeed,
13
132
  isSuccess,
14
133
  TaggedError,
15
- make15,
134
+ make16,
16
135
  _await,
17
136
  fail5,
18
137
  succeed5,
@@ -104,7 +223,7 @@ import {
104
223
  decodeJsonString,
105
224
  encodeJsonStringSync,
106
225
  encodePrettyJsonString
107
- } from "./chunk-zgraq2y3.js";
226
+ } from "./chunk-zw3gf6r5.js";
108
227
  import {
109
228
  tap,
110
229
  mapError,
@@ -116,128 +235,11 @@ import {
116
235
  withDefault,
117
236
  option,
118
237
  String2
119
- } from "./chunk-hgfphycc.js";
120
- import {
121
- currentTimeMillis,
122
- SecureRandom,
123
- layerWebCrypto,
124
- runMain,
125
- Stdio,
126
- Terminal,
127
- layer3,
128
- error,
129
- log,
130
- toIso,
131
- currentDate,
132
- waitingOnWords,
133
- queueWords,
134
- redactResponseSurface,
135
- ReleaseChannels,
136
- DefaultReleaseChannel,
137
- newerKitmanVersion,
138
- releaseChannelOffers,
139
- NetworkHost,
140
- RepoBindingProviders,
141
- RepoBindingCredentialProviderTypes,
142
- ContextPackModes,
143
- DefaultContextPackMode,
144
- ProposalStatuses,
145
- ProposalTargetTypes,
146
- RunDisplayStates,
147
- RunnerExecutionBackend,
148
- MaxRunnerConcurrency,
149
- PinnedImage,
150
- RunnerSettingNames,
151
- RunnerSettingsUpdate,
152
- defaultRunnerSettings,
153
- shownRunnerSetting,
154
- defaultRunnerCapabilities,
155
- deliveryProviderActions,
156
- MemoryStatuses,
157
- MemoryScopes,
158
- MaxMemoryListLimit,
159
- DecisionStatuses,
160
- FixFlowRecoveryActions,
161
- KitmanAgentCapabilityNames,
162
- sha2562,
163
- isRunFileRefusalReason,
164
- runFileRefusalWords,
165
- repositoryKey,
166
- createId,
167
- digestSha256,
168
- sha256Hasher,
169
- raw,
170
- make4,
171
- get,
172
- put,
173
- HttpClient,
174
- execute,
175
- Fetch,
176
- layer4,
177
- runDisplayLabels,
178
- listedSummary,
179
- defaultKitName,
180
- SetupArchive,
181
- KitmanClientError,
182
- KitmanEffectClient,
183
- CliError,
184
- DefaultApiUrl,
185
- resolveConfig,
186
- apiUrlFromEnv,
187
- stepCredentialFromEnv,
188
- mcpCredentialNameFromEnv,
189
- userConfigPath,
190
- userAuthPath,
191
- userHarnessSyncPath,
192
- kitSetupCacheDir,
193
- bundleCacheDir,
194
- runnerReleaseChannelPath,
195
- localConfigPath,
196
- readUserConfig,
197
- writeUserConfig,
198
- sessionForApi,
199
- readAuthStore,
200
- storeSession,
201
- removeSession,
202
- removeAllSessions,
203
- agentCredentialForApi,
204
- storeAgentCredential,
205
- removeAgentCredential,
206
- normalizeApiUrl,
207
- isStoredAgentCredential,
208
- RpcClientError,
209
- RunnerHeaders,
210
- RunnerRpcError,
211
- parseCallbackUrl,
212
- revokeToken,
213
- toStoredSession,
214
- browserLogin,
215
- openBrowser,
216
- shouldRefresh,
217
- createSdkClient,
218
- refreshSession,
219
- createAgentAuthBearerToken,
220
- createAgentAuthSignedFetch,
221
- setupMcpAgentCredential,
222
- generateAgentKeyPair,
223
- HERDR_CORE_GENERATION2,
224
- HERDR_CORE_INSTALL_COMMAND2,
225
- CommandFailed2,
226
- runCommand2,
227
- detectHarnesses2,
228
- kitHarnesses,
229
- isKitHarness,
230
- harnessNames,
231
- herdrRunnerCapabilities2,
232
- declaredChecks
233
- } from "./chunk-3vbs995s.js";
234
- import {
235
- Id
236
- } from "./chunk-pxvd8w2v.js";
238
+ } from "./chunk-nf9gdnsf.js";
237
239
  import {
238
240
  ChildProcessSpawner,
239
- make2
240
- } from "./chunk-8xpdkxr7.js";
241
+ make3
242
+ } from "./chunk-vsrjg9nm.js";
241
243
 
242
244
  // apps/cli/src/cli-error.ts
243
245
  function cliErrorCode(error, status) {
@@ -1018,10 +1020,10 @@ var sandboxMissing = (sandbox, missing) => ({
1018
1020
  var personalCheckBackend = (agentSandbox, dockerAvailable) => agentSandbox === "srt" || agentSandbox === "docker" && dockerAvailable ? agentSandbox : undefined;
1019
1021
  var herdrCoreSession = (runnerId, personal) => personal ? undefined : `kitman-${sha2562(runnerId).slice(0, 16)}`;
1020
1022
  var OpenHerdrCore = Reference("kitman/cli/OpenHerdrCore", {
1021
- defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-fk5238tn.js")), ({ HerdrCore, herdrCoreLayer }) => provide3(service(HerdrCore), herdrCoreLayer(options)))
1023
+ defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-c9rvst3x.js")), ({ HerdrCore, herdrCoreLayer }) => provide3(service(HerdrCore), herdrCoreLayer(options)))
1022
1024
  });
1023
1025
  var UpdateHerdrCore = Reference("kitman/cli/UpdateHerdrCore", {
1024
- defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-fk5238tn.js")), (module) => module.updateHerdrCore(options))
1026
+ defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-c9rvst3x.js")), (module) => module.updateHerdrCore(options))
1025
1027
  });
1026
1028
  var herdrCoreMissing = (error) => {
1027
1029
  if (isTagged(error, "HerdrCoreMissing"))
@@ -1447,7 +1449,7 @@ var syncTargets = (harness) => gen(function* () {
1447
1449
  });
1448
1450
  var syncKits = (input) => gen(function* () {
1449
1451
  const fs = yield* FileSystem;
1450
- const { syncKitSetup } = yield* promise(() => import("./chunk-6agcvxbj.js"));
1452
+ const { syncKitSetup } = yield* promise(() => import("./chunk-sjdze64n.js"));
1451
1453
  const harnesses = yield* syncTargets(input.harness);
1452
1454
  const chain = yield* input.client.getKitChain(input.workspaceId);
1453
1455
  for (const { name, problem } of chain.skipped)
@@ -1964,7 +1966,7 @@ var ServiceManager = Reference("kitman/cli/ServiceManager", {
1964
1966
  run: (command, args) => runCommand2(command, args),
1965
1967
  attach: (command, args) => gen(function* () {
1966
1968
  const spawner = yield* ChildProcessSpawner;
1967
- const handle = yield* spawner.spawn(make2(command, args, { stdin: "inherit", stdout: "inherit", stderr: "inherit" }));
1969
+ const handle = yield* spawner.spawn(make3(command, args, { stdin: "inherit", stdout: "inherit", stderr: "inherit" }));
1968
1970
  const exitCode = yield* handle.exitCode;
1969
1971
  if (exitCode !== 0)
1970
1972
  return yield* new CommandFailed2({ command, reason: `exit code ${exitCode}` });
@@ -2366,7 +2368,7 @@ var package_default = {
2366
2368
  };
2367
2369
 
2368
2370
  // apps/cli/src/scaffold.ts
2369
- var cliVersion = "0.13.14";
2371
+ var cliVersion = "0.13.16";
2370
2372
  var packageJson = (name, scaffold) => `${JSON.stringify({
2371
2373
  name,
2372
2374
  private: true,
@@ -2518,7 +2520,7 @@ var scaffoldKit = (directory, scaffold = {}) => gen(function* () {
2518
2520
 
2519
2521
  // apps/cli/src/commands.ts
2520
2522
  var ClientId = "kitman-cli";
2521
- var agentRuntime = promise(() => import("./chunk-06dwvzv0.js"));
2523
+ var agentRuntime = promise(() => import("./chunk-t4xwk14b.js"));
2522
2524
  var TuiLauncher = Reference("kitman/cli/TuiLauncher", {
2523
2525
  defaultValue: () => gen(function* () {
2524
2526
  const tui = yield* tryPromise({
@@ -3554,7 +3556,7 @@ var SandboxHostProbe = Reference("kitman/cli/SandboxHostProbe", {
3554
3556
  });
3555
3557
  var OpenRunnerRpc = Reference("kitman/cli/OpenRunnerRpc", {
3556
3558
  defaultValue: () => (options) => gen(function* () {
3557
- const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-hmt2egsx.js"));
3559
+ const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-49gbakce.js"));
3558
3560
  return yield* makeRunnerRpcClient({
3559
3561
  runnerId: options.runnerId,
3560
3562
  bearer: options.bearer,
@@ -3866,7 +3868,7 @@ function startCanonicalHerdrRunnerCommand(input) {
3866
3868
  yield* controlPlane.client.listRepoBindings(runner.workspaceId).pipe(flatMap3(({ items }) => forEach(items.filter((binding) => binding.status === "active" && (teamId === undefined || binding.teamId === teamId)), (repoBinding) => map8(checkouts.reaches(repoBinding), (reachable) => ({ repoBinding, reachable })), { concurrency: 4 })), tap2((probed) => sync2(() => reached = probed)), catch_((error) => logWarning("runner_repository_probe_failed", error.message)), flatMap3(() => sleep(reached.some((probe) => !probe.reachable) ? repositoryRetryInterval : repositoryProbeInterval)), forever, forkScoped);
3867
3869
  yield* suspend3(() => sleep(ownerLogin.expired() ? ownerLoginRetryInterval : ownerLoginInterval)).pipe(andThen2(checkOwnerLogin), forever, forkScoped);
3868
3870
  const platform = yield* context();
3869
- const updated = yield* make15();
3871
+ const updated = yield* make16();
3870
3872
  const scope = yield* scope2;
3871
3873
  const startUpdate = (update) => update.pipe(catch_((error) => andThen2(restartOntoUpdate(input.runnerId), fail5(updated, error))), provideContext2(platform), forkIn(scope), asVoid);
3872
3874
  const refusedForProtocol = container ? updater.stopWhenDrained(new RunnerStopped({ problem: updateRequired })).pipe(catch_((stopped) => fail5(updated, stopped)), forkIn(scope), asVoid) : startUpdate(updater.updateRequired);
@@ -3958,11 +3960,12 @@ function startCanonicalHerdrRunnerCommand(input) {
3958
3960
  spending,
3959
3961
  sandbox: sandboxOf,
3960
3962
  heartbeat: heartbeatOf,
3963
+ harnessStarted: (work) => asVoid(rpc.heartbeat({ workUnitId: work.id, lease: leaseOf(work), harnessStarted: true })),
3961
3964
  gitCredentials: rpc.gitCredential,
3962
3965
  checkpoints: rpcStepCheckpoints(rpc, signals, storage),
3963
3966
  transcripts: (work, entries) => rpc.appendTranscript({ workUnitId: work.id, entries }),
3964
3967
  runnerScope: scope,
3965
- runAgent: (work, worktree, session, steered, refused) => flatMap3(currentTimeMillis, (now) => agentBackend.execute({
3968
+ runAgent: (work, worktree, session, steered, refused, launched) => flatMap3(currentTimeMillis, (now) => agentBackend.execute({
3966
3969
  runnerId: input.runnerId,
3967
3970
  sharedRunner: !personal,
3968
3971
  attempt: runnerStepAttemptFromAgentStep(work),
@@ -3974,6 +3977,7 @@ function startCanonicalHerdrRunnerCommand(input) {
3974
3977
  ...work.secretDestinations === undefined ? undefined : { secretDestinations: work.secretDestinations }
3975
3978
  },
3976
3979
  recordRefusal: refused,
3980
+ launched,
3977
3981
  revokedSecrets: heartbeatOf(work).pipe(map8((state) => state.revokedSecrets ?? [])),
3978
3982
  sandbox: {
3979
3983
  backend: work.sandbox ?? sandboxOf(work),
@@ -4049,11 +4053,12 @@ function startCanonicalHerdrRunnerCommand(input) {
4049
4053
  }).pipe(asVoid)), tapError2(onProtocolRefusal)),
4050
4054
  heartbeatWork: (workUnitId, lease) => rpc.heartbeat({ workUnitId, lease }),
4051
4055
  complete: (completion) => rpc.complete(completion),
4052
- release: (workUnitId, lease, crashed, tokens) => rpc.release({
4056
+ release: (workUnitId, lease, crashed, tokens, ranModel) => rpc.release({
4053
4057
  workUnitId,
4054
4058
  lease,
4055
4059
  ...crashed === undefined ? undefined : { crashed: { reason: crashed } },
4056
- ...tokens === undefined ? undefined : { tokens }
4060
+ ...tokens === undefined ? undefined : { tokens },
4061
+ ...ranModel === undefined ? undefined : { ranModel }
4057
4062
  })
4058
4063
  };
4059
4064
  };
@@ -4076,9 +4081,9 @@ function startCanonicalHerdrRunnerCommand(input) {
4076
4081
  }
4077
4082
  },
4078
4083
  spent: (workUnitId) => sync2(() => {
4079
- const tokens = spending.get(workUnitId);
4084
+ const spend = spending.get(workUnitId);
4080
4085
  spending.delete(workUnitId);
4081
- return tokens;
4086
+ return spend;
4082
4087
  })
4083
4088
  },
4084
4089
  signals
@@ -4118,7 +4123,7 @@ function mcpCommand(args) {
4118
4123
  if (command.action === "run") {
4119
4124
  if (command.args.length > 0)
4120
4125
  return yield* new CliError({ message: `Unknown command: ${args.join(" ")}` });
4121
- const { runMcpServerCommand } = yield* promise(() => import("./chunk-89rpg6j9.js"));
4126
+ const { runMcpServerCommand } = yield* promise(() => import("./chunk-tntbdpmy.js"));
4122
4127
  return yield* runMcpServerCommand({ flags: command.flags });
4123
4128
  }
4124
4129
  if (command.action !== "setup")
@@ -4606,7 +4611,7 @@ function programLoopCommand(command) {
4606
4611
  return yield* new CliError({ message: `Unknown loop command: ${command.action}` });
4607
4612
  });
4608
4613
  }
4609
- var docsModule = promise(() => import("./chunk-zencwg2t.js"));
4614
+ var docsModule = promise(() => import("./chunk-v1e4g2re.js"));
4610
4615
  function docsCommand(args) {
4611
4616
  return gen(function* () {
4612
4617
  const command = parseCommand(args);
@@ -4846,8 +4851,14 @@ var runListLine = (item) => [
4846
4851
  item.display.summary === undefined ? "" : listedSummary(item.display.summary),
4847
4852
  item.run.id
4848
4853
  ].filter((part) => part !== "").join(" ");
4849
- var tokenWords = (tokens) => `${tokens.input.toLocaleString("en-US")} input, ${tokens.output.toLocaleString("en-US")} output, ${tokens.cached.toLocaleString("en-US")} cached`;
4854
+ var tokenWords = (tokens) => `${tokenCountWords(tokens.input)} input, ${tokenCountWords(tokens.output)} output, ${tokenCountWords(tokens.cached)} cached`;
4850
4855
  var stepTokenLines = (step) => step.tokens !== undefined ? [` Tokens: ${tokenWords(step.tokens)}`] : step.attempts.some((attempt) => attempt.tokens === "none") ? [" Tokens: none reported"] : [];
4856
+ var terminalText = (text) => text.replace(/[\u0000-\u001f\u007f-\u009f]/gu, (char) => `\\u${char.charCodeAt(0).toString(16).padStart(4, "0")}`);
4857
+ var reportedTokenWords = (tokens) => tokens === undefined ? "none reported" : tokenWords(tokens);
4858
+ var runTokenLines = ({ tokens, tokensWithChildRuns }) => [
4859
+ `Tokens with Child Runs: ${reportedTokenWords(tokensWithChildRuns)}`,
4860
+ `Tokens, the Run\u2019s own: ${reportedTokenWords(tokens)}`
4861
+ ];
4851
4862
  var runShowLines = (shown) => [
4852
4863
  `Run ${shown.run.id}: ${runDisplayLabels[shown.display.state]}${shown.display.retried ? " \xB7 Retried" : ""}`,
4853
4864
  ...shown.display.summary === undefined ? [] : [`Now: ${shown.display.summary}`],
@@ -4858,9 +4869,10 @@ var runShowLines = (shown) => [
4858
4869
  `Loop${shown.run.loopVersion === undefined ? "" : ` ${shown.run.loopVersion}`}${shown.run.loopLayer === undefined ? "" : ` from the ${shown.run.loopLayer} layer`}, digest ${shown.run.loopDigest}`
4859
4870
  ],
4860
4871
  ...shown.run.failureSummary === undefined ? [] : [`Failure: ${shown.run.failureSummary}`],
4861
- ...shown.tokens === undefined ? [] : [`Tokens: ${tokenWords(shown.tokens)}`],
4872
+ ...runTokenLines(shown),
4862
4873
  ...shown.steps.flatMap((step) => [
4863
4874
  `Step ${step.name}: ${step.status} (attempt ${step.attempts.length})`,
4875
+ ...step.fallback === undefined ? [] : [` ${terminalText(stepFallbackWords(step.fallback))}`],
4864
4876
  ...stepTokenLines(step),
4865
4877
  ...claimLines(step)
4866
4878
  ]),
@@ -5441,9 +5453,9 @@ function changeRequestCommand(args) {
5441
5453
  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}`);
5442
5454
  });
5443
5455
  }
5444
- var KitWriter = map8(promise(() => import("./chunk-5ba08a9e.js")), (build) => build.writeKit);
5456
+ var KitWriter = map8(promise(() => import("./chunk-at5dh2te.js")), (build) => build.writeKit);
5445
5457
  var KitBuilder = Reference("kitman/cli/KitBuilder", {
5446
- defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-5ba08a9e.js")), (build) => build.buildKit(directory))
5458
+ defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-at5dh2te.js")), (build) => build.buildKit(directory))
5447
5459
  });
5448
5460
  var uploadKit = (client, workspaceId, built) => gen(function* () {
5449
5461
  yield* client.uploadKitBundle(workspaceId, built.digest, { bundle: encode2(built.bundle) });
@@ -6220,7 +6232,7 @@ function downloadPresignedAsset(download, outputPath) {
6220
6232
  return gen(function* () {
6221
6233
  const fs = yield* FileSystem;
6222
6234
  const failed = (cause) => new CliError({ message: `Asset download failed: ${String(cause)}` });
6223
- const response = yield* send(make4(download.method)(download.url), failed);
6235
+ const response = yield* send(make5(download.method)(download.url), failed);
6224
6236
  if (response.status < 200 || response.status >= 300)
6225
6237
  return yield* new CliError({ message: `Asset download failed with ${response.status}` });
6226
6238
  const body = yield* response.arrayBuffer.pipe(mapError2((error) => failed(error.message)));
@@ -4,7 +4,7 @@ import {
4
4
  searchDocs2,
5
5
  readDoc2,
6
6
  pinnedLink2
7
- } from "./chunk-ef3nzqng.js";
7
+ } from "./chunk-y7p4d14b.js";
8
8
  export {
9
9
  DefaultDocsSearchLimit2 as DefaultDocsSearchLimit,
10
10
  pinnedLink2 as pinnedLink,
@@ -1,6 +1,22 @@
1
1
  // @bun
2
2
  import {
3
+ unwrap,
4
+ drainFork,
5
+ decodeText,
6
+ splitLines,
7
+ runCollect,
8
+ runDrain,
9
+ mkString
10
+ } from "./chunk-nf9gdnsf.js";
11
+ import {
12
+ isString,
13
+ hasProperty,
14
+ symbol,
15
+ hash,
16
+ symbol2,
17
+ equals,
3
18
  BaseProto,
19
+ PipeInspectableProto,
4
20
  Prototype,
5
21
  some,
6
22
  Service2,
@@ -14,20 +30,50 @@ import {
14
30
  andThen2,
15
31
  map8,
16
32
  raceFirst,
17
- scoped,
18
- isRedacted,
19
- make16,
20
- value
21
- } from "./chunk-zgraq2y3.js";
22
- import {
23
- unwrap,
24
- drainFork,
25
- decodeText,
26
- splitLines,
27
- runCollect,
28
- runDrain,
29
- mkString
30
- } from "./chunk-hgfphycc.js";
33
+ scoped
34
+ } from "./chunk-zw3gf6r5.js";
35
+
36
+ // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/internal/redacted.js
37
+ var redactedRegistry = /* @__PURE__ */ new WeakMap;
38
+ var value2 = (self) => {
39
+ if (redactedRegistry.has(self)) {
40
+ return redactedRegistry.get(self);
41
+ } else {
42
+ throw new Error("Unable to get redacted value" + (self.label ? ` with label: "${self.label}"` : ""));
43
+ }
44
+ };
45
+
46
+ // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Redacted.js
47
+ var TypeId = "~effect/Redacted";
48
+ var isRedacted = (u) => hasProperty(u, TypeId);
49
+ var make = (value, options) => {
50
+ const self = Object.create(Proto);
51
+ if (options?.label) {
52
+ self.label = options.label;
53
+ }
54
+ redactedRegistry.set(self, value);
55
+ return self;
56
+ };
57
+ var Proto = {
58
+ [TypeId]: {
59
+ _A: (_) => _
60
+ },
61
+ label: undefined,
62
+ ...PipeInspectableProto,
63
+ toJSON() {
64
+ return this.toString();
65
+ },
66
+ toString() {
67
+ return `<redacted${isString(this.label) ? ":" + this.label : ""}>`;
68
+ },
69
+ [symbol]() {
70
+ return hash(redactedRegistry.get(this));
71
+ },
72
+ [symbol2](that) {
73
+ return isRedacted(that) && equals(redactedRegistry.get(this), redactedRegistry.get(that));
74
+ }
75
+ };
76
+ var value = value2;
31
77
 
32
78
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Brand.js
33
79
  function nominal() {
@@ -55,7 +101,7 @@ var HandleProto = {
55
101
  var makeHandle = (params) => Object.setPrototypeOf({
56
102
  ...params
57
103
  }, HandleProto);
58
- var make = (spawn) => {
104
+ var make2 = (spawn) => {
59
105
  const streamString = (command, options) => spawn(command).pipe(map8((handle) => decodeText(options?.includeStderr === true ? handle.all : drainFork(handle.stdout, handle.stderr))), unwrap);
60
106
  const streamLines = (command, options) => splitLines(streamString(command, options));
61
107
  return ChildProcessSpawner.of({
@@ -176,7 +222,7 @@ var parseTemplate = (texts, values) => {
176
222
  if (word.length === 0)
177
223
  return;
178
224
  const value = word.map(unwrap2).join("");
179
- words.push(word.length === 1 && isRedacted(word[0]) ? word[0] : word.some(isRedacted) ? make16(value) : value);
225
+ words.push(word.length === 1 && isRedacted(word[0]) ? word[0] : word.some(isRedacted) ? make(value) : value);
180
226
  word = [];
181
227
  plain = true;
182
228
  braceDepth = 0;
@@ -266,23 +312,23 @@ var parseTemplate = (texts, values) => {
266
312
  };
267
313
 
268
314
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/process/ChildProcess.js
269
- var TypeId = "~effect/process/ChildProcess";
270
- var Proto = {
315
+ var TypeId2 = "~effect/process/ChildProcess";
316
+ var Proto2 = {
271
317
  .../* @__PURE__ */ Prototype({
272
318
  label: "Command",
273
319
  evaluate(fiber) {
274
320
  return getUnsafe(fiber.context, ChildProcessSpawner).spawn(this);
275
321
  }
276
322
  }),
277
- [TypeId]: TypeId
323
+ [TypeId2]: TypeId2
278
324
  };
279
- var makeStandardCommand = (command, args, options) => Object.assign(Object.create(Proto), {
325
+ var makeStandardCommand = (command, args, options) => Object.assign(Object.create(Proto2), {
280
326
  _tag: "StandardCommand",
281
327
  command,
282
328
  args,
283
329
  options
284
330
  });
285
- var make2 = function make(...args) {
331
+ var make3 = function make(...args) {
286
332
  if (isTemplateString(args[0])) {
287
333
  const [templates, ...expressions] = args;
288
334
  const [command, cmdArgs] = parseTemplate2(templates, expressions);
@@ -340,4 +386,4 @@ var shellScript = (templates, expressions) => {
340
386
  }
341
387
  return script;
342
388
  };
343
- export { ExitCode, ProcessId, makeHandle, make, ChildProcessSpawner, display, make2, parseFdName, fdName };
389
+ export { isRedacted, make, value, ExitCode, ProcessId, makeHandle, make2, ChildProcessSpawner, display, make3, parseFdName, fdName };
@@ -1,4 +1,8 @@
1
1
  // @bun
2
+ import {
3
+ replaceSecretReferences,
4
+ secretReferencesIn
5
+ } from "./chunk-q5w3v4k1.js";
2
6
  import {
3
7
  getOrElse,
4
8
  getOrUndefined,
@@ -13,11 +17,7 @@ import {
13
17
  ArraySchema,
14
18
  decodeJsonStringOption,
15
19
  encodeUnknownJsonStringSync
16
- } from "./chunk-zgraq2y3.js";
17
- import {
18
- replaceSecretReferences,
19
- secretReferencesIn
20
- } from "./chunk-pxvd8w2v.js";
20
+ } from "./chunk-zw3gf6r5.js";
21
21
 
22
22
  // packages/agent-runtime/src/srt-step.ts
23
23
  import { SandboxRuntimeConfigSchema } from "@anthropic-ai/sandbox-runtime";
@@ -594,7 +594,7 @@ kitman run drift <run> --dismiss <constraint> --reason "fixtures, not released m
594
594
  path: "loop-operations#tokens",
595
595
  level: 2,
596
596
  link: "https://kitman.sh/knowledge/docs/loop-operations#tokens",
597
- text: "## Tokens\n\nEach attempt of an agent Step records the input, output and cached tokens its Harness reported in its session: Claude Code, Codex and Pi do. Input counts tokens read fresh or written to the cache; cached counts tokens read from it. Claude Code's subagents write their own session files, and their tokens count with the attempt that ran them. An attempt parked on a Question and resumed adds both parts, and one that ran past its time budget or whose Run was stopped still records what its Harness spent. An attempt whose Harness wrote no usage records that it reported none. `runs.show` and `kitman run show` give the Run's total and each Step's. `runs.show` also gives the Harness each started attempt launched on and the model its launch named; an attempt left to its Harness's default model gives no model. A Child Run shows its own."
597
+ text: "## Tokens\n\nEach attempt of an agent Step records the input, output and cached tokens its Harness reported in its session: Claude Code, Codex and Pi do. OpenCode names the model it ran but no tokens. Input counts tokens read fresh or written to the cache; cached counts tokens read from it. Claude Code's subagents write their own session files, and their tokens count with the attempt that ran them. An attempt parked on a Question and resumed adds both parts, and one that ran past its time budget or whose Run was stopped still records what its Harness spent. An attempt whose Harness wrote no usage records that it reported none. `runs.show`, `kitman run show` and the Run page give the Run's total with its Child Runs at any depth, and the Run's own. The total follows the branches the reader may read: a Child Run they may not read is left out with every Run below it. `runs.show` gives that total's counts as decimal digit strings, since one can pass what a JSON number holds exactly. `runs.show` and `kitman run show` also give each Step's. `runs.show` also gives the Harness each started attempt launched on and the model it ran: the one its Harness's session named, else the one its launch named. A session's name that is not a bare model identifier, or that holds a credential or one of the Run's Secrets, is not stored. An attempt left to its Harness's default model whose session named none gives no model. With no usage reported anywhere in the tree, both totals say none was reported."
598
598
  },
599
599
  {
600
600
  title: "Loop Operations Guide \u203A Automatic starts",
@@ -624,7 +624,7 @@ Turning a start off stops new Runs from it. Runs it already started go on. \`kit
624
624
  path: "loop-operations#agents-and-effort",
625
625
  level: 2,
626
626
  link: "https://kitman.sh/knowledge/docs/loop-operations#agents-and-effort",
627
- text: "## Agents and effort\n\nKitman ships the Agents `implementer`, `planned-implementer`, `reviewer`, `plan-reviewer`, `planner`, `releaser`, `investigator` and `judge`. The `reviewer` runs on Pi with GPT-6.2 Sol, then Claude Opus at `medium` effort; the `plan-reviewer` runs on the same, with Opus at `high` effort; and the `planner` runs on Claude Fable 5.2 at `high` effort. The `planned-implementer` extends `implementer` at `low` effort: Build runs it for the first implementation of a Task that plan review passed, and `implementer` at `medium` for everything else. The others name no model, so a Step runs on whatever model the Runner's harness is logged in to. A Workspace or Team overrides one, such as its harness, model or effort, by declaring an Agent of the same id that extends it, in a Kit it deploys. Each declaration is a layer over the Agent it extends:\n\n```ts\nexport default defineKit({\n agents: {\n reviewer: {\n extends: 'reviewer',\n instructions: `## House rules\nNever approve a migration that edits a released one.`,\n effort: 'high'\n }\n }\n})\n```\n\nA declared Agent replaces only the fields it names. Its instructions merge by `## ` heading:\n\n- A section it names replaces the parent's section with that heading.\n- A new heading is appended.\n- Any text before its first heading replaces the parent's.\n\nAn Agent can list fallbacks for a Runner that does not offer its Harness:\n\n```ts\nexport default defineKit({\n agents: {\n reviewer: {\n extends: 'reviewer',\n harness: 'claude',\n effort: 'high',\n fallbacks: [\n { harness: 'codex', model: 'gpt-5.5' },\n { harness: 'pi', effort: 'medium' }\n ]\n }\n }\n})\n```\n\nA Step launches the first choice the claiming Runner offers, and the Run page's Step view shows the choices it skipped and why. A fallback with no effort runs at the Agent's effort, and one with no model runs on the Harness's own model. An Agent that extends another inherits its fallbacks; naming `fallbacks` replaces them, and `fallbacks: []` clears them.\n\nEffort (`low`, `medium`, `high` or `xhigh`) is recorded on each StepAttempt. `kitman agent list --team <team>` shows each Agent merged as that Team's Runs resolve it, with the layer each field came from, so a Team Kit's override reads `claude (team)`. Without `--team` it uses the active Team, or only the workspace layer when there is none, and its first line says which."
627
+ text: "## Agents and effort\n\nKitman ships the Agents `implementer`, `planned-implementer`, `reviewer`, `plan-reviewer`, `planner`, `releaser`, `investigator` and `judge`. The `reviewer` runs on Pi with GPT-6.2 Sol, then Claude Opus at `medium` effort; the `plan-reviewer` runs on the same, with Opus at `high` effort; the `planner` runs on Claude Fable 5.2 at `high` effort; and the `implementer` runs on Claude alone, waiting out a known quota reset rather than falling back to Pi. The `planned-implementer` extends `implementer` at `low` effort: Build runs it for the first implementation of a Task that plan review passed, and `implementer` at `medium` for everything else. The implementers and the others name no model, so a Step runs on whatever model the Runner's harness is logged in to. A Workspace or Team overrides one, such as its harness, model or effort, by declaring an Agent of the same id that extends it, in a Kit it deploys. Each declaration is a layer over the Agent it extends:\n\n```ts\nexport default defineKit({\n agents: {\n reviewer: {\n extends: 'reviewer',\n instructions: `## House rules\nNever approve a migration that edits a released one.`,\n effort: 'high'\n }\n }\n})\n```\n\nA declared Agent replaces only the fields it names. Its instructions merge by `## ` heading:\n\n- A section it names replaces the parent's section with that heading.\n- A new heading is appended.\n- Any text before its first heading replaces the parent's.\n\nAn Agent can list fallbacks for a Runner that does not offer its Harness:\n\n```ts\nexport default defineKit({\n agents: {\n reviewer: {\n extends: 'reviewer',\n harness: 'claude',\n effort: 'high',\n fallbacks: [\n { harness: 'codex', model: 'gpt-5.5' },\n { harness: 'pi', effort: 'medium' }\n ]\n }\n }\n})\n```\n\nA Step launches the first choice the claiming Runner offers, and the Run page's Step view shows the choices it skipped and why. A Step that ran on a later choice than its first is marked on the Run page and in `kitman run show` with the Harness and model it ran on and why its first choice was passed over. The mark follows the latest attempt whose Harness started, which its Runner shows by reporting what the Harness spent or its agent by submitting an Output. A claim alone does not move it: a retry on the first choice clears it once its Harness starts, and an attempt given back before its Harness started, one whose Harness failed to start, and a base sync the Runner found up to date ran no agent and are not marked. A fallback with no effort runs at the Agent's effort, and one with no model runs on the Harness's own model. An Agent that extends another inherits its fallbacks; naming `fallbacks` replaces them, and `fallbacks: []` clears them.\n\nEffort (`low`, `medium`, `high` or `xhigh`) is recorded on each StepAttempt. `kitman agent list --team <team>` shows each Agent merged as that Team's Runs resolve it, with the layer each field came from, so a Team Kit's override reads `claude (team)`. Without `--team` it uses the active Team, or only the workspace layer when there is none, and its first line says which."
628
628
  },
629
629
  {
630
630
  title: "Projects and Saved Views",
@@ -1555,7 +1555,7 @@ var pathOfLink = (link) => {
1555
1555
  return page === null ? link : page[1] || "index";
1556
1556
  };
1557
1557
  var UnpinnedSdkLink = "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/";
1558
- var pinnedLink2 = (link, version = "0.13.14") => version === undefined || !link.startsWith(UnpinnedSdkLink) ? link : link.replace(UnpinnedSdkLink, `https://cdn.jsdelivr.net/npm/@kitman-sh/sdk@${version}/`);
1558
+ var pinnedLink2 = (link, version = "0.13.16") => version === undefined || !link.startsWith(UnpinnedSdkLink) ? link : link.replace(UnpinnedSdkLink, `https://cdn.jsdelivr.net/npm/@kitman-sh/sdk@${version}/`);
1559
1559
  var pageOf = (path) => path.split("#")[0];
1560
1560
  var exportName = (section) => section.path.startsWith("sdk/") ? section.path.split("#")[1] ?? "" : "";
1561
1561
  function excerpt(text, queryTerms) {