@kitman-sh/cli 0.10.78 → 0.10.79

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.
@@ -4,9 +4,9 @@ import {
4
4
  runnerRpcUrl2,
5
5
  makeRunnerRpcClient2,
6
6
  makeProgramRpcClient2
7
- } from "./chunk-nnq8d7k0.js";
8
- import"./chunk-cn6h21ar.js";
9
- import"./chunk-g4j97dv5.js";
7
+ } from "./chunk-774x1zm9.js";
8
+ import"./chunk-5mafe4g9.js";
9
+ import"./chunk-0znt4wky.js";
10
10
  import"./chunk-545b129z.js";
11
11
  import"./chunk-tzz4fv17.js";
12
12
  import"./chunk-xb70ys3n.js";
@@ -6456,6 +6456,7 @@ var RunList = Struct({
6456
6456
  items: ArraySchema(RunListItem),
6457
6457
  next: optionalKey(String4)
6458
6458
  });
6459
+ var RunWaitUntils = ["attention", "finished"];
6459
6460
  var RunWaitReasons = ["question", "completed", "failed", "stopped", "timeout"];
6460
6461
  var RunWaitResult = Struct({
6461
6462
  reason: Literals(RunWaitReasons),
@@ -15601,4 +15602,4 @@ function checkServices(declaration) {
15601
15602
  return isSome(decoded) ? [...new Set(decoded.value.services)] : undefined;
15602
15603
  }
15603
15604
 
15604
- export { Clock, currentTimeMillis, WebCrypto, SecureRandom, layerWebCrypto, makeUnsafe, formatIso, empty, fromInput, merge, runMain, layer, layer2, Stdio, Terminal, layer3, error, log, toDate, parseDate, toIso, currentDate, wallClockMillis, waitingOnWords, queueWords, scanDurableSurface, redactResponseSurface, redactCredentials, redactedOutputTail, SafeJson, AgentHarnessIds, AgentSkillRequirement, AgentMcpServerRequirement, AgentEnvironmentFragment, findForbiddenAgentEnvironmentSecretPath, RepoBindingProviders, RepoBindingCredentialProviderTypes, findForbiddenRepoBindingSecretPath, AgentSandboxNetwork, runnerAgentSandboxPolicy, agentNetworkAllowlist, verificationNetworkAllowlist, programNetworkHosts, ContextPackModes, DefaultContextPackMode, ProposalStatuses, ProposalTargetTypes, canonicalJson, canonicalSha256, AgentEfforts, AgentCapabilities, LoopDataSchemaRef, RunDisplayStates, LoopVersion, ProgramLoop, AgentFallback, isTestReportName, checkTests, ProgramWorkUnit, MeasureSample, MeasureEvidence, catchUpPathLimit, CatchUp, RunnerOwnership, defaultRunnerCapabilities, MemoryStatuses, MemoryScopes, MaxMemoryListLimit, DecisionStatuses, Session, SessionEnd, SessionUpdate, SessionUpdateCreate, FixFlowRecoveryActions, KitmanAgentCapabilityNames, sha2562, isRunFileRefusalReason, runFileRefusalWords, RunFileRefused, runFileContentType, repositoryKey, createId, digestSha256, digestSha512, digestWith, sha256Hasher, AgentEvent, raw, make5, get, post, put, setHeaders, acceptJson, bodyUint8Array, bodyJsonUnsafe, bodyUrlParams, schemaBodyJson, filterStatusOk, HttpClient, execute, get2, Fetch, layer4, Socket, SocketReadError, SocketError, WebSocketConstructor, layerWebSocketConstructorGlobal, layerWebSocket, runDisplayLabels, listedSummary, KitName, KitDigest, defaultKitName, KitSetup, SetupArchive, kitMcpSecretNames, kitmanMcpServer, KitmanClientError, KitmanEffectClient, CliError, DefaultApiUrl, resolveConfig, apiUrlFromEnv, stepCredentialFromEnv, stepWorkspaceFromEnv, stepSkillsDirFromEnv, stepFittingSkillsFromEnv, stepOutputOnlyFromEnv, mcpCredentialNameFromEnv, userConfigPath, userAuthPath, userHarnessSyncPath, kitSetupCacheDir, bundleCacheDir, localConfigPath, readUserConfig, writeUserConfig, sessionForApi, readAuthStore, storeSession, removeSession, removeAllSessions, agentCredentialForApi, storeAgentCredential, removeAgentCredential, normalizeApiUrl, isStoredAgentCredential, isStreamSchema, getStreamSchemas, make6, exitSchema, ParseOptions, RpcClientDefect, RpcClientError, make7, Service, RunnerHeaders, RunnerRpcProtocolVersion, RunnerRpcError, RunSettled, UpdateAvailable, RunnerReplicaRpcs, RunnerRunFileRpcs, ProgramRpcs, parseCallbackUrl, revokeToken, toStoredSession, browserLogin, openBrowser, shouldRefresh, createSdkClient, refreshSession, AgentAuthClientError, executeAgentCapability, createAgentAuthBearerToken, McpPlatformLive, runMcpEffect, createAgentAuthSignedFetch, setupMcpAgentCredential, generateAgentKeyPair, HERDR_CORE_GENERATION2, HERDR_CORE_INSTALL_COMMAND2, HerdrCoreMissing2, HerdrCoreIncompatible2, HerdrCoreConnectionLost2, HerdrCoreRpcError2, HerdrCoreUpdateFailed2, HerdrCore2, herdrCoreLayer2, herdrCoreTransportLayer2, updateHerdrCore2, CommandFailed2, runCommand2, withoutPreloads2, shellOutputTailChars2, runProcess2, CommandRunner2, runShell2, detectHarnesses2, kitHarnesses, isKitHarness, instructionsStart, instructionsEnd, harnessNames, renderMcpServer, materializeKitSetup, tomlInline, herdrExecutionExtension2, herdrNativeExtensionIds2, herdrRunnerCapabilitiesForRepoBinding2, herdrRunnerCapabilities2, assertHerdrRunnerCapability2, declaredChecks, installCommand, checkServicesFile, checkServices };
15605
+ export { Clock, currentTimeMillis, WebCrypto, SecureRandom, layerWebCrypto, makeUnsafe, formatIso, empty, fromInput, merge, runMain, layer, layer2, Stdio, Terminal, layer3, error, log, toDate, parseDate, toIso, currentDate, wallClockMillis, waitingOnWords, queueWords, scanDurableSurface, redactResponseSurface, redactCredentials, redactedOutputTail, SafeJson, AgentHarnessIds, AgentSkillRequirement, AgentMcpServerRequirement, AgentEnvironmentFragment, findForbiddenAgentEnvironmentSecretPath, RepoBindingProviders, RepoBindingCredentialProviderTypes, findForbiddenRepoBindingSecretPath, AgentSandboxNetwork, runnerAgentSandboxPolicy, agentNetworkAllowlist, verificationNetworkAllowlist, programNetworkHosts, ContextPackModes, DefaultContextPackMode, ProposalStatuses, ProposalTargetTypes, canonicalJson, canonicalSha256, AgentEfforts, AgentCapabilities, LoopDataSchemaRef, RunDisplayStates, LoopVersion, ProgramLoop, AgentFallback, RunWaitUntils, isTestReportName, checkTests, ProgramWorkUnit, MeasureSample, MeasureEvidence, catchUpPathLimit, CatchUp, RunnerOwnership, defaultRunnerCapabilities, MemoryStatuses, MemoryScopes, MaxMemoryListLimit, DecisionStatuses, Session, SessionEnd, SessionUpdate, SessionUpdateCreate, FixFlowRecoveryActions, KitmanAgentCapabilityNames, sha2562, isRunFileRefusalReason, runFileRefusalWords, RunFileRefused, runFileContentType, repositoryKey, createId, digestSha256, digestSha512, digestWith, sha256Hasher, AgentEvent, raw, make5, get, post, put, setHeaders, acceptJson, bodyUint8Array, bodyJsonUnsafe, bodyUrlParams, schemaBodyJson, filterStatusOk, HttpClient, execute, get2, Fetch, layer4, Socket, SocketReadError, SocketError, WebSocketConstructor, layerWebSocketConstructorGlobal, layerWebSocket, runDisplayLabels, listedSummary, KitName, KitDigest, defaultKitName, KitSetup, SetupArchive, kitMcpSecretNames, kitmanMcpServer, KitmanClientError, KitmanEffectClient, CliError, DefaultApiUrl, resolveConfig, apiUrlFromEnv, stepCredentialFromEnv, stepWorkspaceFromEnv, stepSkillsDirFromEnv, stepFittingSkillsFromEnv, stepOutputOnlyFromEnv, mcpCredentialNameFromEnv, userConfigPath, userAuthPath, userHarnessSyncPath, kitSetupCacheDir, bundleCacheDir, localConfigPath, readUserConfig, writeUserConfig, sessionForApi, readAuthStore, storeSession, removeSession, removeAllSessions, agentCredentialForApi, storeAgentCredential, removeAgentCredential, normalizeApiUrl, isStoredAgentCredential, isStreamSchema, getStreamSchemas, make6, exitSchema, ParseOptions, RpcClientDefect, RpcClientError, make7, Service, RunnerHeaders, RunnerRpcProtocolVersion, RunnerRpcError, RunSettled, UpdateAvailable, RunnerReplicaRpcs, RunnerRunFileRpcs, ProgramRpcs, parseCallbackUrl, revokeToken, toStoredSession, browserLogin, openBrowser, shouldRefresh, createSdkClient, refreshSession, AgentAuthClientError, executeAgentCapability, createAgentAuthBearerToken, McpPlatformLive, runMcpEffect, createAgentAuthSignedFetch, setupMcpAgentCredential, generateAgentKeyPair, HERDR_CORE_GENERATION2, HERDR_CORE_INSTALL_COMMAND2, HerdrCoreMissing2, HerdrCoreIncompatible2, HerdrCoreConnectionLost2, HerdrCoreRpcError2, HerdrCoreUpdateFailed2, HerdrCore2, herdrCoreLayer2, herdrCoreTransportLayer2, updateHerdrCore2, CommandFailed2, runCommand2, withoutPreloads2, shellOutputTailChars2, runProcess2, CommandRunner2, runShell2, detectHarnesses2, kitHarnesses, isKitHarness, instructionsStart, instructionsEnd, harnessNames, renderMcpServer, materializeKitSetup, tomlInline, herdrExecutionExtension2, herdrNativeExtensionIds2, herdrRunnerCapabilitiesForRepoBinding2, herdrRunnerCapabilities2, assertHerdrRunnerCapability2, declaredChecks, installCommand, checkServicesFile, checkServices };
@@ -123,7 +123,7 @@ import {
123
123
  ParseOptions,
124
124
  RpcClientDefect,
125
125
  RpcClientError
126
- } from "./chunk-g4j97dv5.js";
126
+ } from "./chunk-0znt4wky.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")) {
@@ -19,13 +19,13 @@ import {
19
19
  RunnerReplicaRpcs,
20
20
  RunnerRunFileRpcs,
21
21
  ProgramRpcs
22
- } from "./chunk-g4j97dv5.js";
22
+ } from "./chunk-0znt4wky.js";
23
23
  import {
24
24
  layerJson,
25
25
  make4,
26
26
  withHeaders,
27
27
  layerProtocolSocket
28
- } from "./chunk-cn6h21ar.js";
28
+ } from "./chunk-5mafe4g9.js";
29
29
 
30
30
  // packages/live/src/rpc/runner-client.ts
31
31
  var proxiedWebSocket = (proxy) => succeed5(WebSocketConstructor)((target) => {
@@ -243,7 +243,7 @@ import {
243
243
  installCommand,
244
244
  checkServicesFile,
245
245
  checkServices
246
- } from "./chunk-g4j97dv5.js";
246
+ } from "./chunk-0znt4wky.js";
247
247
  import {
248
248
  join,
249
249
  interrupt,
@@ -299,8 +299,8 @@ import {
299
299
  applyAgentEnvironmentMaterialization2,
300
300
  isPathWithin2,
301
301
  skillIdentity2
302
- } from "./chunk-bqpj1be3.js";
303
- import"./chunk-qbsqc416.js";
302
+ } from "./chunk-wq91rwr2.js";
303
+ import"./chunk-gntbq9g8.js";
304
304
  import {
305
305
  egressAllowed,
306
306
  writeSecretRegistry,
@@ -325,8 +325,8 @@ import {
325
325
  rpcRunFiles,
326
326
  programHostsEnv,
327
327
  undeclaredHostsEnv
328
- } from "./chunk-6h16wtxk.js";
329
- import"./chunk-nnq8d7k0.js";
328
+ } from "./chunk-r3240g3z.js";
329
+ import"./chunk-774x1zm9.js";
330
330
  import {
331
331
  nextInt
332
332
  } from "./chunk-76ctrqm6.js";
@@ -334,7 +334,7 @@ import {
334
334
  ChildProcessSpawner,
335
335
  make3
336
336
  } from "./chunk-98sg1yyd.js";
337
- import"./chunk-cn6h21ar.js";
337
+ import"./chunk-5mafe4g9.js";
338
338
 
339
339
  // packages/core/src/sync-kit.ts
340
340
  import { createHash } from "crypto";
@@ -26,15 +26,15 @@ import {
26
26
  tomlKeyPath2,
27
27
  kitmanSkillEntry,
28
28
  isPathWithin2
29
- } from "./chunk-bqpj1be3.js";
29
+ } from "./chunk-wq91rwr2.js";
30
30
  import {
31
31
  instructionsStart,
32
32
  instructionsEnd,
33
33
  renderMcpServer,
34
34
  materializeKitSetup,
35
35
  tomlInline
36
- } from "./chunk-g4j97dv5.js";
37
- import"./chunk-qbsqc416.js";
36
+ } from "./chunk-0znt4wky.js";
37
+ import"./chunk-gntbq9g8.js";
38
38
  import"./chunk-98sg1yyd.js";
39
39
 
40
40
  // packages/agent-runtime/src/kit-setup-sync.ts
@@ -114,6 +114,7 @@ import {
114
114
  scanDurableSurface,
115
115
  redactResponseSurface,
116
116
  canonicalSha256,
117
+ RunWaitUntils,
117
118
  RunnerOwnership,
118
119
  Session,
119
120
  SessionEnd,
@@ -153,7 +154,7 @@ import {
153
154
  runMcpEffect,
154
155
  createAgentAuthSignedFetch,
155
156
  setupMcpAgentCredential
156
- } from "./chunk-g4j97dv5.js";
157
+ } from "./chunk-0znt4wky.js";
157
158
  import {
158
159
  guard,
159
160
  Id,
@@ -197,7 +198,7 @@ import {
197
198
  withHeaders,
198
199
  layerProtocolSocket,
199
200
  ConnectionHooks
200
- } from "./chunk-cn6h21ar.js";
201
+ } from "./chunk-5mafe4g9.js";
201
202
 
202
203
  // apps/cli/src/mcp.ts
203
204
  import { tmpdir } from "os";
@@ -3822,7 +3823,7 @@ var operationSpecs = [
3822
3823
  parameters: ["runId", ["options", false]],
3823
3824
  namespacePath: ["runs", "wait"],
3824
3825
  tags: ["runs"],
3825
- summary: "Wait until the Run needs attention (an open Question) or settles; `until: finished` ignores Questions. Returns reason `timeout` after `timeoutSeconds` (at most 8); call again to keep waiting."
3826
+ summary: "Wait until the Run needs attention (an open Question) or settles; `until: finished` ignores Questions. Returns reason `timeout` after `timeoutSeconds` (at most 8); call again to keep waiting, or use the `wait_run` MCP tool to wait in one call."
3826
3827
  },
3827
3828
  {
3828
3829
  name: "answerRun",
@@ -5655,6 +5656,86 @@ function positiveInteger(value, label) {
5655
5656
  return value;
5656
5657
  }
5657
5658
 
5659
+ // apps/mcp/src/run-wait-tool.ts
5660
+ var RunWaitMaxSeconds = 8;
5661
+ var runWaiterFromOperations = (dispatch) => (request) => dispatch("waitRun", {
5662
+ runId: request.runId,
5663
+ options: { until: request.until, timeoutSeconds: request.timeoutSeconds }
5664
+ });
5665
+ var WaitRunInputSchema = {
5666
+ type: "object",
5667
+ required: ["run"],
5668
+ additionalProperties: false,
5669
+ properties: {
5670
+ run: { type: "string", minLength: 1, description: "The Run\u2019s id." },
5671
+ until: {
5672
+ type: "string",
5673
+ enum: [...RunWaitUntils],
5674
+ description: "`attention` (default) returns on an open Question or when the Run settles; `finished` only when it settles."
5675
+ },
5676
+ timeoutSeconds: {
5677
+ type: "number",
5678
+ minimum: 0,
5679
+ description: "Return reason `timeout` once this many seconds pass. Leave out to wait as long as the Run takes."
5680
+ }
5681
+ }
5682
+ };
5683
+ var ToolOutputSchema = { type: "object", additionalProperties: true };
5684
+ function registerWaitRunTool(server, adapt, waitOnce) {
5685
+ server.registerTool("wait_run", {
5686
+ description: 'Wait on a Run, as `kitman run wait` does, until it needs attention (an open Question) or settles; `until: "finished"` ignores Questions. Returns `{ reason, run, questions }` with reason question, completed, failed, stopped, or timeout once `timeoutSeconds` passes. Use it instead of looping `runs.wait` in `execute`.',
5687
+ inputSchema: adapt(WaitRunInputSchema),
5688
+ outputSchema: adapt(ToolOutputSchema),
5689
+ annotations: { readOnlyHint: true, idempotentHint: true }
5690
+ }, (args, context) => runMcpEffect(gen(function* () {
5691
+ if (waitOnce === undefined)
5692
+ return yield* new McpToolInputError({ message: "wait_run requires a Kitman API connection." });
5693
+ return formatMcpToolSuccess("wait_run", yield* waitRun(waitOnce, yield* waitInput(args), context));
5694
+ }).pipe(catch_((error) => succeed6(formatMcpToolError(error))))));
5695
+ }
5696
+ var waitRun = (waitOnce, input, context) => gen(function* () {
5697
+ const deadline = (yield* currentTimeMillis) + input.timeoutMillis;
5698
+ const progressToken = context?.mcpReq?._meta?.progressToken;
5699
+ let rounds = 0;
5700
+ while (true) {
5701
+ const remainingMillis = Math.max(0, deadline - (yield* currentTimeMillis));
5702
+ const waited = yield* waitOnce({
5703
+ runId: input.runId,
5704
+ until: input.until,
5705
+ timeoutSeconds: Math.min(RunWaitMaxSeconds, remainingMillis / 1000)
5706
+ });
5707
+ rounds += 1;
5708
+ if (reasonOf(waited) !== "timeout")
5709
+ return waited;
5710
+ if ((yield* currentTimeMillis) >= deadline || context?.mcpReq?.signal.aborted === true)
5711
+ return waited;
5712
+ if (progressToken !== undefined && context?.mcpReq !== undefined)
5713
+ yield* promise(() => context.mcpReq.notify({
5714
+ method: "notifications/progress",
5715
+ params: { progressToken, progress: rounds, message: `Run ${input.runId} is ${runStatusOf(waited)}` }
5716
+ }));
5717
+ }
5718
+ });
5719
+ var waitInput = (args) => gen(function* () {
5720
+ const { run, until = "attention", timeoutSeconds } = args;
5721
+ if (!isString(run) || run.length === 0)
5722
+ return yield* new McpToolInputError({ message: "run is required." });
5723
+ if (!isOneOf(RunWaitUntils, until))
5724
+ return yield* new McpToolInputError({ message: `until must be ${RunWaitUntils.join(" or ")}.` });
5725
+ if (timeoutSeconds !== undefined && (!isNumber(timeoutSeconds) || timeoutSeconds < 0))
5726
+ return yield* new McpToolInputError({ message: "timeoutSeconds must be a number of seconds, 0 or more." });
5727
+ return {
5728
+ runId: run,
5729
+ until,
5730
+ timeoutMillis: timeoutSeconds === undefined ? Number.POSITIVE_INFINITY : timeoutSeconds * 1000
5731
+ };
5732
+ });
5733
+ var reasonOf = (waited) => isJsonObject(waited) ? waited.reason : undefined;
5734
+ var runStatusOf = (waited) => {
5735
+ const run = isJsonObject(waited) ? waited.run : undefined;
5736
+ return isJsonObject(run) && isString(run.status) ? run.status : "still running";
5737
+ };
5738
+
5658
5739
  // apps/mcp/src/code-mode.ts
5659
5740
  var SkillsInputSchema = {
5660
5741
  type: "object",
@@ -5683,7 +5764,7 @@ var ExecuteInputSchema = {
5683
5764
  reason: { type: "string", minLength: 1 }
5684
5765
  }
5685
5766
  };
5686
- var ToolOutputSchema = {
5767
+ var ToolOutputSchema2 = {
5687
5768
  type: "object",
5688
5769
  additionalProperties: true
5689
5770
  };
@@ -5786,7 +5867,7 @@ function registerCodeModeTools(server, options = {}) {
5786
5867
  ].join(`
5787
5868
  `),
5788
5869
  inputSchema: adapt(ExecuteInputSchema),
5789
- outputSchema: adapt(ToolOutputSchema),
5870
+ outputSchema: adapt(ToolOutputSchema2),
5790
5871
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false }
5791
5872
  }, (args) => runMcpEffect(gen(function* () {
5792
5873
  const reason = yield* optionalStringArg(args, "reason");
@@ -5800,7 +5881,7 @@ function registerCodeModeTools(server, options = {}) {
5800
5881
  server.registerTool("skills", {
5801
5882
  description: 'Fetch an on-demand Code Mode skill. Call with no name to list skills; call with name "execute" before using execute.',
5802
5883
  inputSchema: adapt(SkillsInputSchema),
5803
- outputSchema: adapt(ToolOutputSchema),
5884
+ outputSchema: adapt(ToolOutputSchema2),
5804
5885
  annotations: { readOnlyHint: true, idempotentHint: true }
5805
5886
  }, (args) => runMcpEffect(gen(function* () {
5806
5887
  const name = yield* optionalStringArg(args, "name");
@@ -5814,9 +5895,10 @@ function registerCodeModeTools(server, options = {}) {
5814
5895
  server.registerTool("resume", {
5815
5896
  description: "Resume a paused Code Mode execution. If the execution is unknown, expired, forbidden, or already settled, a structured unavailable status is returned.",
5816
5897
  inputSchema: adapt(ResumeInputSchema),
5817
- outputSchema: adapt(ToolOutputSchema),
5898
+ outputSchema: adapt(ToolOutputSchema2),
5818
5899
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true }
5819
5900
  }, (args) => runMcpEffect(resumeExecution(args).pipe(catch_((error) => succeed6(formatMcpToolError(error))))));
5901
+ registerWaitRunTool(server, adapt, options.waitRun ?? (dispatchOperation === undefined ? undefined : runWaiterFromOperations(dispatchOperation)));
5820
5902
  function resumeExecution(args) {
5821
5903
  return gen(function* () {
5822
5904
  let executionId = yield* optionalStringArg(args, "executionId");
@@ -7365,6 +7447,7 @@ function createKitmanMcpServer(options = {}) {
7365
7447
  ...options.adaptJsonSchema ? { adaptJsonSchema: options.adaptJsonSchema } : undefined,
7366
7448
  ...executeCapability ? { executeCapability } : undefined,
7367
7449
  ...codeModeDispatchOperation ? { dispatchOperation: codeModeDispatchOperation, operations: CodeModeOperationDescriptors } : undefined,
7450
+ ...options.waitRun ? { waitRun: options.waitRun } : undefined,
7368
7451
  prepareOperationInput: codeModePrepareOperationInput,
7369
7452
  ...options.executionStore ? { executionStore: options.executionStore } : undefined,
7370
7453
  ...options.executionOwner ? { executionOwner: options.executionOwner } : undefined,
@@ -7379,6 +7462,7 @@ function registerKitmanCodeModeTools(server, options = {}) {
7379
7462
  adaptJsonSchema: options.adaptJsonSchema ?? defaultSchemaAdapter,
7380
7463
  ...options.executeCapability ? { executeCapability: options.executeCapability } : undefined,
7381
7464
  ...options.dispatchOperation ? { dispatchOperation: options.dispatchOperation } : undefined,
7465
+ ...options.waitRun ? { waitRun: options.waitRun } : undefined,
7382
7466
  ...options.prepareOperationInput ? { prepareOperationInput: options.prepareOperationInput } : undefined,
7383
7467
  ...options.operations ? { operations: options.operations } : undefined,
7384
7468
  ...options.executionStore ? { executionStore: options.executionStore } : undefined,
@@ -38,7 +38,7 @@ import {
38
38
  get2,
39
39
  layer4,
40
40
  KitDigest
41
- } from "./chunk-g4j97dv5.js";
41
+ } from "./chunk-0znt4wky.js";
42
42
 
43
43
  // packages/core/src/npm-registry.ts
44
44
  var KitManifest = Struct({
@@ -12,7 +12,7 @@ import {
12
12
  herdrCoreLayer2,
13
13
  herdrCoreTransportLayer2,
14
14
  updateHerdrCore2
15
- } from "./chunk-g4j97dv5.js";
15
+ } from "./chunk-0znt4wky.js";
16
16
  import"./chunk-xb70ys3n.js";
17
17
  import"./chunk-jbwk6k6m.js";
18
18
  export {
@@ -35,14 +35,6 @@ import {
35
35
  } from "./chunk-jbwk6k6m.js";
36
36
  import"./chunk-545b129z.js";
37
37
  import"./chunk-tzz4fv17.js";
38
- import {
39
- decodeText,
40
- mkString,
41
- FileSystem,
42
- Path,
43
- withDefault,
44
- String2
45
- } from "./chunk-xb70ys3n.js";
46
38
  import {
47
39
  SecureRandom,
48
40
  layerWebCrypto,
@@ -54,23 +46,31 @@ import {
54
46
  layer4,
55
47
  kitmanMcpServer,
56
48
  RunnerRpcProtocolVersion
57
- } from "./chunk-g4j97dv5.js";
49
+ } from "./chunk-0znt4wky.js";
50
+ import {
51
+ decodeText,
52
+ mkString,
53
+ FileSystem,
54
+ Path,
55
+ withDefault,
56
+ String2
57
+ } from "./chunk-xb70ys3n.js";
58
58
  import {
59
59
  Packument,
60
60
  tarballMatches
61
- } from "./chunk-qbsqc416.js";
62
- import"./chunk-nnq8d7k0.js";
61
+ } from "./chunk-gntbq9g8.js";
62
+ import"./chunk-774x1zm9.js";
63
63
  import {
64
64
  AgentDeclaration,
65
65
  KitDeclarations,
66
66
  describeFlag,
67
67
  Described
68
- } from "./chunk-6h16wtxk.js";
68
+ } from "./chunk-r3240g3z.js";
69
69
  import {
70
70
  ChildProcessSpawner,
71
71
  make3
72
72
  } from "./chunk-98sg1yyd.js";
73
- import"./chunk-cn6h21ar.js";
73
+ import"./chunk-5mafe4g9.js";
74
74
 
75
75
  // packages/sdk/src/build/index.ts
76
76
  class DependencyInstallFailed extends TaggedError2()("DependencyInstallFailed", {
@@ -105,7 +105,7 @@ import {
105
105
  KitDigest,
106
106
  KitSetup,
107
107
  RunnerRpcError
108
- } from "./chunk-g4j97dv5.js";
108
+ } from "./chunk-0znt4wky.js";
109
109
  import {
110
110
  runForEach,
111
111
  FileSystem
@@ -197,7 +197,7 @@ import {
197
197
  harnessNames,
198
198
  herdrRunnerCapabilities2,
199
199
  declaredChecks
200
- } from "./chunk-g4j97dv5.js";
200
+ } from "./chunk-0znt4wky.js";
201
201
  import {
202
202
  Id
203
203
  } from "./chunk-545b129z.js";
@@ -504,10 +504,10 @@ var checkDockerImageSetting = pinnedImage;
504
504
  var checkRegistryImageSetting = pinnedImage;
505
505
  var herdrCoreSession = (runnerId, personal) => personal ? undefined : `kitman-${sha2562(runnerId).slice(0, 16)}`;
506
506
  var OpenHerdrCore = Reference("kitman/cli/OpenHerdrCore", {
507
- defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-5sdw5ws3.js")), ({ HerdrCore, herdrCoreLayer }) => provide3(service(HerdrCore), herdrCoreLayer(options)))
507
+ defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-kvv8n1nq.js")), ({ HerdrCore, herdrCoreLayer }) => provide3(service(HerdrCore), herdrCoreLayer(options)))
508
508
  });
509
509
  var UpdateHerdrCore = Reference("kitman/cli/UpdateHerdrCore", {
510
- defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-5sdw5ws3.js")), (module) => module.updateHerdrCore(options))
510
+ defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-kvv8n1nq.js")), (module) => module.updateHerdrCore(options))
511
511
  });
512
512
  var herdrCoreMissing = (error) => {
513
513
  if (isTagged(error, "HerdrCoreMissing"))
@@ -733,7 +733,7 @@ var syncTargets = (harness) => gen(function* () {
733
733
  });
734
734
  var syncKits = (input) => gen(function* () {
735
735
  const fs = yield* FileSystem;
736
- const { syncKitSetup } = yield* promise(() => import("./chunk-k0bjhj9m.js"));
736
+ const { syncKitSetup } = yield* promise(() => import("./chunk-ambnfp64.js"));
737
737
  const harnesses = yield* syncTargets(input.harness);
738
738
  const chain = yield* input.client.getKitChain(input.workspaceId);
739
739
  for (const { name, problem } of chain.skipped)
@@ -1651,7 +1651,7 @@ var package_default = {
1651
1651
  };
1652
1652
 
1653
1653
  // apps/cli/src/scaffold.ts
1654
- var cliVersion = "0.10.78";
1654
+ var cliVersion = "0.10.79";
1655
1655
  var packageJson = (name, scaffold) => `${JSON.stringify({
1656
1656
  name,
1657
1657
  private: true,
@@ -1901,7 +1901,7 @@ var Usage = [
1901
1901
  "Every run, loop, agent, verify, constraint, secret, claim, deploy, dev and kit command takes --json."
1902
1902
  ].join(`
1903
1903
  `);
1904
- var agentRuntime = promise(() => import("./chunk-whyjvrf2.js"));
1904
+ var agentRuntime = promise(() => import("./chunk-agmt5yte.js"));
1905
1905
  var TuiLauncher = Reference("kitman/cli/TuiLauncher", {
1906
1906
  defaultValue: () => gen(function* () {
1907
1907
  const tui = yield* tryPromise({
@@ -2777,7 +2777,7 @@ var SandboxHostProbe = Reference("kitman/cli/SandboxHostProbe", {
2777
2777
  });
2778
2778
  var OpenRunnerRpc = Reference("kitman/cli/OpenRunnerRpc", {
2779
2779
  defaultValue: () => (options) => gen(function* () {
2780
- const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-697qeg1j.js"));
2780
+ const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-04h76486.js"));
2781
2781
  return yield* makeRunnerRpcClient({
2782
2782
  runnerId: options.runnerId,
2783
2783
  bearer: options.bearer,
@@ -3161,7 +3161,7 @@ function mcpCommand(args) {
3161
3161
  if (command.action === "run") {
3162
3162
  if (command.args.length > 0)
3163
3163
  return yield* new CliError({ message: `Unknown command: ${args.join(" ")}` });
3164
- const { runMcpServerCommand } = yield* promise(() => import("./chunk-apjzbve5.js"));
3164
+ const { runMcpServerCommand } = yield* promise(() => import("./chunk-fh762fzy.js"));
3165
3165
  return yield* runMcpServerCommand({ flags: command.flags });
3166
3166
  }
3167
3167
  if (command.action !== "setup")
@@ -4372,9 +4372,9 @@ function claimCommand(args) {
4372
4372
  }
4373
4373
  });
4374
4374
  }
4375
- var KitWriter = map8(promise(() => import("./chunk-bj8jqwk3.js")), (build) => build.writeKit);
4375
+ var KitWriter = map8(promise(() => import("./chunk-msejjzvq.js")), (build) => build.writeKit);
4376
4376
  var KitBuilder = Reference("kitman/cli/KitBuilder", {
4377
- defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-bj8jqwk3.js")), (build) => build.buildKit(directory))
4377
+ defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-msejjzvq.js")), (build) => build.buildKit(directory))
4378
4378
  });
4379
4379
  var uploadKit = (client, workspaceId, built) => gen(function* () {
4380
4380
  yield* client.uploadKitBundle(workspaceId, built.digest, { bundle: encode2(built.bundle) });
@@ -37,10 +37,10 @@ import {
37
37
  AgentHarnessIds,
38
38
  sha2562,
39
39
  runCommand2
40
- } from "./chunk-g4j97dv5.js";
40
+ } from "./chunk-0znt4wky.js";
41
41
  import {
42
42
  NpmRegistry
43
- } from "./chunk-qbsqc416.js";
43
+ } from "./chunk-gntbq9g8.js";
44
44
 
45
45
  // packages/agent-runtime/src/config-convergence.ts
46
46
  var writeAgentEnvironmentConfigFile2 = fnUntraced(function* (file, content, keep = {}) {
@@ -631,133 +631,7 @@ async ({ kitman }) => {
631
631
  }
632
632
  \`\`\`
633
633
  `,
634
- "references/mcp-tools.md": `# Kitman Code Mode MCP
635
-
636
- Kitman MCP uses Code Mode as its only interface. The MCP context stays compact, but the reachable capability should match the public Kitman CLI/API when the authenticated Actor is authorized.
637
-
638
- ## Default Tools
639
-
640
- Use these as the normal MCP entry points:
641
-
642
- - \`execute\`: execute JavaScript that calls typed \`kitman.*\` public operations through a host-side SDK/API proxy.
643
- - \`skills\`: fetch on-demand Code Mode guidance, especially \`skills({ name: "execute" })\`.
644
- - \`resume\`: resume paused approval or elicitation flows when the MCP session exposes it.
645
-
646
- ## Auth, Grants, And Fallbacks
647
-
648
- Local MCP authenticates through a human-scoped DelegatedToolCredential created by \`kitman mcp setup --name <tool>\`. Hosted MCP resolves the hosted request ActorContext. Autonomous AgentIdentities authenticate as Agent Actors.
649
-
650
- The Code Mode sandbox must not receive AgentCredential private keys, bearer tokens, raw auth-store contents, runner secrets, or raw environment variables by default. The host signs SDK/API requests and Kitman Cloud enforces normal authorization, Team privacy, audit, Memory visibility, asset access, and admin checks.
651
-
652
- If Code Mode MCP lacks an operation that exists through the public CLI/API, record or report a Kitman MCP parity bug. Do not silently shell out to the CLI, call raw REST manually, create hidden local state, or keep local task files as a substitute.
653
-
654
- Use only customer-visible Kitman surfaces for operation discovery: MCP descriptors, CLI help, the Kitman skill, and published API docs. Do not inspect Kitman implementation source to learn operation names, schemas, or input shapes. If those surfaces do not provide enough detail, record a Kitman docs/discoverability blocker.
655
-
656
- ## Team Context
657
-
658
- Repo-local \`.kitman/config.json\`, CWD, and Git remotes are hints, not canonical state. Kitman Cloud remains canonical for Workspace, Team, Task, RepoBinding, Session, and audit state.
659
-
660
- When the user asks for the current Team ID or Team context, use Code Mode MCP resolution before inspecting local files or searching the repository:
661
-
662
- \`\`\`execute
663
- async ({ kitman }) => await kitman.context.resolveTeam({})
664
- \`\`\`
665
-
666
- Answer from \`preferredTeamId\` and include \`workspaceId\` when useful. If resolution returns warnings or no unambiguous Team, report that result and ask only for the missing explicit ID needed to proceed.
667
-
668
- Local MCP may sanitize the nearest CWD Git \`origin\` remote to repository identity plus repository-relative path and ask Kitman Cloud to resolve authorized Team context from RepoBindings.
669
-
670
- Workspace and Team RepoBindings may describe a whole repository or a repository-relative \`pathPrefix\` for monorepos. A CWD inside a monorepo should resolve by longest matching path prefix. A CWD at a monorepo root can resolve to the Teams that own the repository for reads and live updates. Mutations still require one explicit or subpath-resolved Team.
671
-
672
- When a mutation is ambiguous, retry with explicit canonical IDs such as \`workspaceId\`, \`teamId\`, \`taskId\`, \`sessionId\`, \`dependencyId\`, or \`assetId\`.
673
-
674
- ## Code Mode Patterns
675
-
676
- Search when you do not know the operation:
677
-
678
- \`\`\`execute
679
- const query = 'session update';
680
- return kitman.search({ query }).items
681
- .map(({ name, summary, namespacePath, sdk, inputSchema, outputSchema, inputTypeScript, outputTypeScript, examples, auth, approvalPolicy }) => ({
682
- name,
683
- call: \`kitman.\${namespacePath.join('.')}({...})\`,
684
- parameters: sdk.parameters,
685
- inputSchema,
686
- outputSchema,
687
- inputTypeScript,
688
- outputTypeScript,
689
- examples,
690
- auth,
691
- approvalPolicy,
692
- summary
693
- }));
694
- \`\`\`
695
-
696
- Descriptor search snippets receive \`operations\` and its shorthand alias \`ops\` as the public operation catalog. The same catalog is searchable through \`kitman.search({ query })\`; no other descriptor globals are required.
697
-
698
- That descriptor output is the source of truth for Code Mode call shape. For example, if the descriptor says \`namespacePath: ['sessions', 'recordUpdate']\` and parameters \`sessionId\` and \`input\`, call \`kitman.sessions.recordUpdate({ sessionId, input })\` through \`execute\`.
699
-
700
- Execute related work through typed operations:
701
-
702
- \`\`\`execute
703
- async ({ kitman }) => {
704
- const team = await kitman.teams.get({ workspaceId: 'workspace_123', teamId: 'team_123' });
705
- if (!team.ok) return team.error;
706
-
707
- const tasks = await kitman.tasks.list({ teamId: 'team_123', options: { statuses: ['ready', 'in_progress'] } });
708
- if (!tasks.ok) return tasks.error;
709
-
710
- return {
711
- team: team.data,
712
- tasks: tasks.data.items.map((task) => ({ id: task.id, teamId: task.teamId, title: task.title, status: task.status }))
713
- };
714
- }
715
- \`\`\`
716
-
717
- Use one execution when the calls are tightly related, especially for read-filter-map flows or read-then-record workflows. Use separate executions when a human decision is needed between steps.
718
-
719
- Parallel calls are appropriate for independent reads:
720
-
721
- \`\`\`execute
722
- async ({ kitman }) => {
723
- const [task, dependencies, sessions] = await Promise.all([
724
- kitman.tasks.get({ taskId: 'task_123' }),
725
- kitman.taskDependencies.list({ taskId: 'task_123' }),
726
- kitman.sessions.listForTask({ taskId: 'task_123' })
727
- ]);
728
-
729
- return { task, dependencies, sessions };
730
- }
731
- \`\`\`
732
-
733
- ## Required Work Discipline
734
-
735
- Use Code Mode operations to keep normal Kitman workflow discipline:
736
-
737
- - Resolve or identify the Task before starting work.
738
- - Read TaskDependencies for build order when relevant.
739
- - Generate or read the appropriate ContextPack before implementation or review work.
740
- - Record meaningful findings, decisions, blockers, test results, and file references as SessionUpdates or Task thread entries.
741
- - Propose Memory only when the learning is durable and reusable.
742
- - Link delivery artifacts such as merge requests with \`kitman.taskLinks.create\` and verify them with \`kitman.taskLinks.list\`.
743
- - Generate a handoff before stopping.
744
-
745
- ## Safety Rules
746
-
747
- Never put these in Memory, SessionUpdates, handoffs, examples, or cloud audit metadata:
748
-
749
- - secrets,
750
- - private keys,
751
- - bearer tokens,
752
- - raw auth-store contents,
753
- - raw terminal logs,
754
- - raw source snapshots,
755
- - raw diffs,
756
- - private customer data,
757
- - presigned upload or download URLs.
758
-
759
- Do not use Code Mode to bypass Kitman authorization, Team privacy, human review, Memory approval, Proposal approval, or AgentIdentity lifecycle restrictions.
760
- `,
634
+ "references/mcp-tools.md": '# Kitman Code Mode MCP\n\nKitman MCP uses Code Mode as its only interface. The MCP context stays compact, but the reachable capability should match the public Kitman CLI/API when the authenticated Actor is authorized.\n\n## Default Tools\n\nUse these as the normal MCP entry points:\n\n- `execute`: execute JavaScript that calls typed `kitman.*` public operations through a host-side SDK/API proxy.\n- `skills`: fetch on-demand Code Mode guidance, especially `skills({ name: "execute" })`.\n- `resume`: resume paused approval or elicitation flows when the MCP session exposes it.\n- `wait_run`: wait on a Run until it needs attention or settles, in one call however long that takes; use it instead of looping `runs.wait` in `execute`.\n\n## Auth, Grants, And Fallbacks\n\nLocal MCP authenticates through a human-scoped DelegatedToolCredential created by `kitman mcp setup --name <tool>`. Hosted MCP resolves the hosted request ActorContext. Autonomous AgentIdentities authenticate as Agent Actors.\n\nThe Code Mode sandbox must not receive AgentCredential private keys, bearer tokens, raw auth-store contents, runner secrets, or raw environment variables by default. The host signs SDK/API requests and Kitman Cloud enforces normal authorization, Team privacy, audit, Memory visibility, asset access, and admin checks.\n\nIf Code Mode MCP lacks an operation that exists through the public CLI/API, record or report a Kitman MCP parity bug. Do not silently shell out to the CLI, call raw REST manually, create hidden local state, or keep local task files as a substitute.\n\nUse only customer-visible Kitman surfaces for operation discovery: MCP descriptors, CLI help, the Kitman skill, and published API docs. Do not inspect Kitman implementation source to learn operation names, schemas, or input shapes. If those surfaces do not provide enough detail, record a Kitman docs/discoverability blocker.\n\n## Team Context\n\nRepo-local `.kitman/config.json`, CWD, and Git remotes are hints, not canonical state. Kitman Cloud remains canonical for Workspace, Team, Task, RepoBinding, Session, and audit state.\n\nWhen the user asks for the current Team ID or Team context, use Code Mode MCP resolution before inspecting local files or searching the repository:\n\n```execute\nasync ({ kitman }) => await kitman.context.resolveTeam({})\n```\n\nAnswer from `preferredTeamId` and include `workspaceId` when useful. If resolution returns warnings or no unambiguous Team, report that result and ask only for the missing explicit ID needed to proceed.\n\nLocal MCP may sanitize the nearest CWD Git `origin` remote to repository identity plus repository-relative path and ask Kitman Cloud to resolve authorized Team context from RepoBindings.\n\nWorkspace and Team RepoBindings may describe a whole repository or a repository-relative `pathPrefix` for monorepos. A CWD inside a monorepo should resolve by longest matching path prefix. A CWD at a monorepo root can resolve to the Teams that own the repository for reads and live updates. Mutations still require one explicit or subpath-resolved Team.\n\nWhen a mutation is ambiguous, retry with explicit canonical IDs such as `workspaceId`, `teamId`, `taskId`, `sessionId`, `dependencyId`, or `assetId`.\n\n## Code Mode Patterns\n\nSearch when you do not know the operation:\n\n```execute\nconst query = \'session update\';\nreturn kitman.search({ query }).items\n .map(({ name, summary, namespacePath, sdk, inputSchema, outputSchema, inputTypeScript, outputTypeScript, examples, auth, approvalPolicy }) => ({\n name,\n call: `kitman.${namespacePath.join(\'.\')}({...})`,\n parameters: sdk.parameters,\n inputSchema,\n outputSchema,\n inputTypeScript,\n outputTypeScript,\n examples,\n auth,\n approvalPolicy,\n summary\n }));\n```\n\nDescriptor search snippets receive `operations` and its shorthand alias `ops` as the public operation catalog. The same catalog is searchable through `kitman.search({ query })`; no other descriptor globals are required.\n\nThat descriptor output is the source of truth for Code Mode call shape. For example, if the descriptor says `namespacePath: [\'sessions\', \'recordUpdate\']` and parameters `sessionId` and `input`, call `kitman.sessions.recordUpdate({ sessionId, input })` through `execute`.\n\nExecute related work through typed operations:\n\n```execute\nasync ({ kitman }) => {\n const team = await kitman.teams.get({ workspaceId: \'workspace_123\', teamId: \'team_123\' });\n if (!team.ok) return team.error;\n\n const tasks = await kitman.tasks.list({ teamId: \'team_123\', options: { statuses: [\'ready\', \'in_progress\'] } });\n if (!tasks.ok) return tasks.error;\n\n return {\n team: team.data,\n tasks: tasks.data.items.map((task) => ({ id: task.id, teamId: task.teamId, title: task.title, status: task.status }))\n };\n}\n```\n\nUse one execution when the calls are tightly related, especially for read-filter-map flows or read-then-record workflows. Use separate executions when a human decision is needed between steps.\n\nParallel calls are appropriate for independent reads:\n\n```execute\nasync ({ kitman }) => {\n const [task, dependencies, sessions] = await Promise.all([\n kitman.tasks.get({ taskId: \'task_123\' }),\n kitman.taskDependencies.list({ taskId: \'task_123\' }),\n kitman.sessions.listForTask({ taskId: \'task_123\' })\n ]);\n\n return { task, dependencies, sessions };\n}\n```\n\n## Required Work Discipline\n\nUse Code Mode operations to keep normal Kitman workflow discipline:\n\n- Resolve or identify the Task before starting work.\n- Read TaskDependencies for build order when relevant.\n- Generate or read the appropriate ContextPack before implementation or review work.\n- Record meaningful findings, decisions, blockers, test results, and file references as SessionUpdates or Task thread entries.\n- Propose Memory only when the learning is durable and reusable.\n- Link delivery artifacts such as merge requests with `kitman.taskLinks.create` and verify them with `kitman.taskLinks.list`.\n- Generate a handoff before stopping.\n\n## Safety Rules\n\nNever put these in Memory, SessionUpdates, handoffs, examples, or cloud audit metadata:\n\n- secrets,\n- private keys,\n- bearer tokens,\n- raw auth-store contents,\n- raw terminal logs,\n- raw source snapshots,\n- raw diffs,\n- private customer data,\n- presigned upload or download URLs.\n\nDo not use Code Mode to bypass Kitman authorization, Team privacy, human review, Memory approval, Proposal approval, or AgentIdentity lifecycle restrictions.\n',
761
635
  "references/privacy-and-safety.md": `# Privacy And Safety
762
636
 
763
637
  Kitman is durable shared state. Treat every SessionUpdate, Memory proposal, ContextPack, and handoff as something future humans and Agents may read.
package/dist/index.js CHANGED
@@ -14,6 +14,6 @@ if (args[0] === "srt") {
14
14
  const { runOpencodeReader } = await import("./chunk-9zd52pda.js");
15
15
  runOpencodeReader();
16
16
  } else {
17
- const { runCli } = await import("./chunk-5aebee0q.js");
17
+ const { runCli } = await import("./chunk-vt7p2dqj.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.10.78",
3
+ "version": "0.10.79",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {