@kitman-sh/cli 0.13.6 → 0.13.8

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-s06x2ktk.js → chunk-08dyrk6y.js} +7 -7
  2. package/dist/{chunk-vktjb2p7.js → chunk-0h49y8gf.js} +164 -36
  3. package/dist/{chunk-2x1q8z5t.js → chunk-5zhh41gb.js} +4 -4
  4. package/dist/{chunk-27pv44t3.js → chunk-5zth85pj.js} +2 -2
  5. package/dist/{chunk-vmzr8xcg.js → chunk-7bytsxkf.js} +7 -5
  6. package/dist/{chunk-9t8afbrw.js → chunk-96svx416.js} +6 -6
  7. package/dist/{chunk-xc1grg7y.js → chunk-a24jc5rx.js} +69 -47
  8. package/dist/{chunk-cg3xstek.js → chunk-byeasm6x.js} +3 -3
  9. package/dist/{chunk-hg8wgm04.js → chunk-c4ccpwjy.js} +4 -4
  10. package/dist/{chunk-cabmcvy1.js → chunk-cbpb2rww.js} +7 -7
  11. package/dist/{chunk-at4e0xvg.js → chunk-cq2h8q9e.js} +7 -7
  12. package/dist/{chunk-xy7ze8dj.js → chunk-eg1n8wvf.js} +36 -22
  13. package/dist/{chunk-j974anp7.js → chunk-ff1r9vcq.js} +1 -1
  14. package/dist/{chunk-89hds8q4.js → chunk-gj1padza.js} +156 -89
  15. package/dist/{chunk-mm2m3bys.js → chunk-gq7y5v3e.js} +1 -1
  16. package/dist/{chunk-qj412x98.js → chunk-gr17n0z3.js} +11 -11
  17. package/dist/{chunk-bz4bp0q7.js → chunk-gy9rf14f.js} +3 -3
  18. package/dist/{chunk-r08sz4ry.js → chunk-h1rmw7yk.js} +6 -6
  19. package/dist/{chunk-4nfan8t6.js → chunk-mtkstrh3.js} +60 -14
  20. package/dist/{chunk-s8m2tzdr.js → chunk-q5w3v4k1.js} +1 -1
  21. package/dist/{chunk-mwkn1c5q.js → chunk-vm2qy986.js} +129 -111
  22. package/dist/{chunk-skqn4h13.js → chunk-y1krmnbv.js} +2 -2
  23. package/dist/{chunk-a0wt1r43.js → chunk-z68rzf0f.js} +23 -23
  24. package/dist/{chunk-x3cc7dfc.js → chunk-zw3gf6r5.js} +40 -226
  25. package/dist/{chunk-3teferzd.js → chunk-zz589n7a.js} +7 -7
  26. package/dist/index.js +4 -4
  27. package/package.json +1 -1
@@ -25,21 +25,21 @@ import {
25
25
  isString2,
26
26
  encodePrettyJsonString,
27
27
  decodeJsonStringSync
28
- } from "./chunk-x3cc7dfc.js";
28
+ } from "./chunk-zw3gf6r5.js";
29
29
  import {
30
30
  FileSystem,
31
31
  Path,
32
32
  optionalEnv,
33
33
  tempDirectoryScoped
34
- } from "./chunk-vktjb2p7.js";
34
+ } from "./chunk-0h49y8gf.js";
35
35
  import {
36
36
  AgentHarnessIds,
37
37
  sha2562,
38
38
  runCommand2
39
- } from "./chunk-mwkn1c5q.js";
39
+ } from "./chunk-vm2qy986.js";
40
40
  import {
41
41
  NpmRegistry
42
- } from "./chunk-cg3xstek.js";
42
+ } from "./chunk-byeasm6x.js";
43
43
 
44
44
  // packages/agent-runtime/src/config-convergence.ts
45
45
  var writeAgentEnvironmentConfigFile2 = fnUntraced(function* (file, content, keep = {}) {
@@ -459,7 +459,7 @@ For repeated queue-draining orchestration across many ready Tasks, use the separ
459
459
  - Treat runtime readiness as a full contract: RepoBinding, shared config, skills, plugins, MCP/service endpoints, provider tools such as \`gh\` or \`glab\`, credential references, and runtime health/capabilities must align for the selected local or remote runtime.
460
460
  - Use RepoBinding list/create operations for non-secret Team repository setup, including monorepo path prefixes when available; never store raw credentials or source snapshots.
461
461
  - Tasks live in Kitman, in Teams. Read and change a Task, its state and its blocks relations through Code Mode MCP; resolve it by any key it has had.
462
- - Capture new work as a Task in the right Team, or launch a Run from words; search Kitman first so you do not duplicate an existing Task.
462
+ - Capture new work as a Task in the right Team, or launch a Run from words; search Kitman first so you do not duplicate an existing Task. Before you create one, read how to scope it: \`skills({ name: 'scope-tasks' })\`, or \`kitman docs read scope-tasks\` in a terminal.
463
463
  - If MCP auth, DelegatedToolCredential, capability grant, Team resolution, Workspace membership, or runtime readiness is missing, use the documented recovery path or stop and report a blocker. Do not bypass Kitman with shell fallbacks, raw REST calls, global active Workspace fallbacks, local task docs, hidden files, or shadow state.
464
464
  - Do not create duplicate work outside Kitman when a Task already exists.
465
465
  - Do not approve Memory; agents can only propose Memory for human review.
@@ -472,7 +472,7 @@ For repeated queue-draining orchestration across many ready Tasks, use the separ
472
472
 
473
473
  ## In a Kitman Step
474
474
 
475
- A Loop's agent Step runs with the Agent its role resolves to. It receives its brief, the tools its Agent declares, and only the skills its Agent lists. Its Kitman MCP serves the step tools, not Code Mode: \`step_brief\`, \`submit_output\`, \`session_update\`, \`ask\`, \`attach_file\` and \`skills\`. \`skills\` lists the Run's other Kit skills, those that fit the repository first, and \`skills({ name })\` loads one; the brief's last line names the ones that fit, by the \`appliesTo\` their Kit declares. A loaded skill stays in context, so load it again only with \`reload: true\` after compaction.
475
+ A Loop's agent Step runs with the Agent its role resolves to. It receives its brief, the tools its Agent declares, and only the skills its Agent lists. Its Kitman MCP serves the step tools, not Code Mode: \`step_brief\`, \`submit_output\`, \`session_update\`, \`ask\`, \`attach_file\` and \`skills\`. \`skills\` lists the Run's other Kit skills, those that fit the repository first, and \`skills({ name })\` loads one; the brief's last line names the ones that fit, by the \`appliesTo\` their Kit declares. It also serves Kitman's \`scope-tasks\`. A loaded skill stays in context, so load it again only with \`reload: true\` after compaction.
476
476
 
477
477
  ## References
478
478
 
@@ -631,7 +631,7 @@ async ({ kitman }) => {
631
631
  }
632
632
  \`\`\`
633
633
  `,
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, path, sdk, inputTypeScript, approvalPolicy }) => ({\n name,\n call: `kitman.${path}({...})`,\n parameters: sdk.parameters,\n inputTypeScript,\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. Catalog entries and search items carry `name`, `summary`, `path`, `namespacePath`, `inputTypeScript`, `sdk`, `examples`, `tags`, `approvalPolicy`, `readOnly`, `idempotent` and `destructive`.\n\nFor the input JSON Schema, output TypeScript and auth notes, describe the operation:\n\n```execute\nconst details = await kitman.describe.operation({ path: \'runs.answer\' });\nreturn { inputSchema: details.inputSchema, outputTypeScript: details.outputTypeScript, auth: details.auth };\n```\n\n`describe.operation` takes a dotted `path` or an operation `name`, such as `name: \'answerRun\'`, and returns the descriptor itself, not an `{ ok, data }` envelope. Pass `full: true` for the output JSON Schema. An unknown operation returns `{ error: { code: \'operation_not_found\', message, suggestions } }`.\n\nThat descriptor output is the source of truth for Code Mode call shape. For example, if the descriptor says `path: \'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',
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" })`, and `skills({ name: "scope-tasks" })` before you create a Task.\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, path, sdk, inputTypeScript, approvalPolicy }) => ({\n name,\n call: `kitman.${path}({...})`,\n parameters: sdk.parameters,\n inputTypeScript,\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. Catalog entries and search items carry `name`, `summary`, `path`, `namespacePath`, `inputTypeScript`, `sdk`, `examples`, `tags`, `approvalPolicy`, `readOnly`, `idempotent` and `destructive`.\n\nFor the input JSON Schema, output TypeScript and auth notes, describe the operation:\n\n```execute\nconst details = await kitman.describe.operation({ path: \'runs.answer\' });\nreturn { inputSchema: details.inputSchema, outputTypeScript: details.outputTypeScript, auth: details.auth };\n```\n\n`describe.operation` takes a dotted `path` or an operation `name`, such as `name: \'answerRun\'`, and returns the descriptor itself, not an `{ ok, data }` envelope. Pass `full: true` for the output JSON Schema. An unknown operation returns `{ error: { code: \'operation_not_found\', message, suggestions } }`.\n\nThat descriptor output is the source of truth for Code Mode call shape. For example, if the descriptor says `path: \'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',
635
635
  "references/privacy-and-safety.md": `# Privacy And Safety
636
636
 
637
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
@@ -5,15 +5,15 @@
5
5
  var args = process.argv.slice(2);
6
6
  if (args[0] === "srt") {
7
7
  process.argv.splice(2, 1);
8
- const { runSrtCli } = await import("./chunk-27pv44t3.js");
8
+ const { runSrtCli } = await import("./chunk-5zth85pj.js");
9
9
  await runSrtCli();
10
10
  } else if (args[0] === "srt-step") {
11
- const { runSrtStep } = await import("./chunk-bz4bp0q7.js");
11
+ const { runSrtStep } = await import("./chunk-gy9rf14f.js");
12
12
  await runSrtStep(args.slice(1));
13
13
  } else if (args[0] === "opencode-read") {
14
- const { runOpencodeReader } = await import("./chunk-2x1q8z5t.js");
14
+ const { runOpencodeReader } = await import("./chunk-5zhh41gb.js");
15
15
  runOpencodeReader();
16
16
  } else {
17
- const { runCli } = await import("./chunk-xy7ze8dj.js");
17
+ const { runCli } = await import("./chunk-eg1n8wvf.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.13.6",
3
+ "version": "0.13.8",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {