@kitman-sh/cli 0.52.0 → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/{chunk-qsbq9gvr.js → chunk-1zvfqdby.js} +193 -350
  2. package/dist/{chunk-eqh0h088.js → chunk-38prvh9d.js} +28 -25
  3. package/dist/{chunk-a40yta1r.js → chunk-5bpp6k0h.js} +3 -3
  4. package/dist/{chunk-wxg9k10v.js → chunk-5tgpa02q.js} +1 -1
  5. package/dist/{chunk-pppryg54.js → chunk-72ht3484.js} +6 -6
  6. package/dist/{chunk-wb04fv2s.js → chunk-7enqpa5x.js} +34 -34
  7. package/dist/{chunk-9hde8p6b.js → chunk-7y50jhm7.js} +6 -6
  8. package/dist/{chunk-2nq80r46.js → chunk-8r9k7pqk.js} +19 -59
  9. package/dist/{chunk-2t1hcdeq.js → chunk-ab7r6p1s.js} +21 -19
  10. package/dist/{chunk-q2z8rct0.js → chunk-ag79vvjy.js} +4 -4
  11. package/dist/{chunk-5yygjn0k.js → chunk-apv9h5tz.js} +1 -1
  12. package/dist/{chunk-mmt6xq48.js → chunk-brbym443.js} +2 -2
  13. package/dist/{chunk-trtgab3h.js → chunk-c6yxzkz2.js} +11 -19
  14. package/dist/{chunk-h5ydhdhx.js → chunk-c9vcvseh.js} +23 -23
  15. package/dist/{chunk-my9db578.js → chunk-cy13pst5.js} +4 -4
  16. package/dist/{chunk-chbdcf34.js → chunk-e627b064.js} +15 -9
  17. package/dist/{chunk-bj0zchck.js → chunk-hyaq30ne.js} +188 -179
  18. package/dist/{chunk-84qb67e2.js → chunk-jh5vjc8h.js} +1 -1
  19. package/dist/{chunk-xbqd3kqc.js → chunk-jwr750jd.js} +21 -21
  20. package/dist/{chunk-tqspx38s.js → chunk-k1fdsn2c.js} +1 -1
  21. package/dist/{chunk-tfznw549.js → chunk-n00cpb86.js} +2 -2
  22. package/dist/{chunk-zb4t1yrt.js → chunk-n381rqax.js} +257 -71
  23. package/dist/{chunk-bhz25x76.js → chunk-qfwhsqej.js} +3 -3
  24. package/dist/{chunk-kt26vpwf.js → chunk-stx87en6.js} +9 -9
  25. package/dist/{chunk-axfp5tzk.js → chunk-vdaq7292.js} +7 -7
  26. package/dist/{chunk-qjfzcrv5.js → chunk-y52g539d.js} +4 -4
  27. package/dist/index.js +4 -4
  28. package/package.json +1 -1
@@ -529,24 +529,7 @@ Agents should record implementation evidence, verification, and delivery artifac
529
529
  path: "loop-operations#intent",
530
530
  level: 2,
531
531
  link: "https://kitman.sh/knowledge/docs/loop-operations#intent",
532
- text: `## Intent
533
-
534
- Every Run is held to an Intent, seeded when Kitman admits it:
535
-
536
- - **Goal:** the launch words, or the Task's title, Promise, description and Out of scope list. A Child Run, such as the Review or Shepherd a Build calls, is held instead to doing the work its parent's call input asks for and reporting the result in its Output, naming the parent's Task.
537
- - **Done when:** the Task's Acceptance Criteria. A Child Run has none: its parent's evidence settles them.
538
- - **Constraints:** see below.
539
-
540
- Each agent Step's brief states the Intent. While the Run is going, its Delivery Owner amends it on the Run page or with:
541
-
542
- \`\`\`sh
543
- kitman run intent <run> --set-goal "<text>"
544
- kitman run intent <run> --add-constraint "<text>"
545
- kitman run intent <run> --remove-constraint <id>
546
- kitman run intent <run> --corrections off
547
- \`\`\`
548
-
549
- Each amendment is a new version with its author, and \`kitman run intent <run>\` lists them all. On the Run page's Intent tab, edit the goal or a constraint in place: each save is one new version. An edited constraint takes the old one's place under a new id, so Drift Reports against the old wording stay with it. A constraint a person removed or reworded never comes back. A settled or closed Run refuses amendments.`
532
+ text: "## Intent\n\nEvery Run is held to an Intent, seeded when Kitman admits it from what its Loop declares:\n\n- **Goal:** for a Loop that does its Task's work, as Build and Hillclimb do, the launch words, or the Task's title, Promise, description and Out of scope list, or `Run the <loop> Loop` with neither. Any other Loop's Run is held to the goal its Loop declares, `Run the <loop> Loop` when it declares none, and nothing of its Task; launch words replace that goal. A Loop from a Kit built before Loops declared an Intent is seeded from its Task. A Run that pins a private Team's Kit while it is in another Team gets `Run the <loop> Loop` instead of that Kit's declared goal and list.\n- **Child Runs:** a Child Run, such as the Review or Shepherd a Build calls, is held instead to doing the work its parent's call input asks for and reporting the result in its Output, quoting its parent's current goal and nothing of its own Task. It quotes no goal when its parent was admitted before Runs had an Intent, and then inherits no constraint, or when its parent's goal is private to a Team the Child Run is not in. Launch words given to a Child Run are its goal.\n- **Done when:** for a Loop that does its Task's work, the Task's Acceptance Criteria, also when launch words set the goal. Any other Loop's Run has the list its Loop declares, and none when launch words set its goal. A Child Run has none, whatever its Loop declares: its parent's evidence settles them.\n- **Constraints:** see below.\n\nEach agent Step's brief states the Intent. While the Run is going, its Delivery Owner amends it on the Run page or with:\n\n```sh\nkitman run intent <run> --set-goal \"<text>\"\nkitman run intent <run> --add-constraint \"<text>\"\nkitman run intent <run> --remove-constraint <id>\nkitman run intent <run> --corrections off\n```\n\nEach amendment is a new version with its author, and `kitman run intent <run>` lists them all. On the Run page's Intent tab, edit the goal or a constraint in place: each save is one new version. An edited constraint takes the old one's place under a new id, so Drift Reports against the old wording stay with it. A constraint a person removed or reworded never comes back. A settled or closed Run refuses amendments."
550
533
  },
551
534
  {
552
535
  title: "Loop Operations Guide \u203A Steering, pausing and resuming",
@@ -1450,6 +1433,7 @@ Read this before you create a Task or write a plan's ticket.`
1450
1433
  text: `## One Promise per Task
1451
1434
 
1452
1435
  - Give a Task one Promise: one sentence that says what is true once it is done. Write it in the Task's \`promise\`. Two Promises are two Tasks.
1436
+ - Every Acceptance Criterion serves the Task's Promise. One that serves another Promise belongs to another Task.
1453
1437
  - A Promise is open-ended when it covers cases nobody can list, such as every path, any input or all source code. Reviews of it keep finding one more case. Split it into a first Task with a bounded case, whose cases you list, and later Tasks that each widen it.
1454
1438
  - Size a Task to fit one agent session under 200k tokens of context, from reading the code to a verified change. Split one that does not fit.`
1455
1439
  },
@@ -1929,6 +1913,11 @@ export type LoopDefinition<In, Out, E> = {
1929
1913
  readonly input: LoopSchema<In>
1930
1914
  readonly output: LoopSchema<Out>
1931
1915
  readonly outcome?: LoopOutcome
1916
+ /**
1917
+ * What a top-level Run is held to: \`task\` takes the goal and done-when list from the Run's Task; otherwise the
1918
+ * declared non-blank goal and list. Left out, the goal is \`Run the <id> Loop\`.
1919
+ */
1920
+ readonly intent?: 'task' | { readonly goal: string; readonly doneWhen?: readonly string[] }
1932
1921
  /**
1933
1922
  * The role it plays, whose powers the control plane gives any Loop that declares it: \`review\` approves a
1934
1923
  * ChangeRequest's head, is reused and covers a fix, as Kitman's Review does; \`release\` delivers a Project, as
@@ -2068,6 +2057,8 @@ export const loopManifest = <In, Out, E>(
2068
2057
  message: 'description must be one line of 1 to 160 characters'
2069
2058
  })
2070
2059
 
2060
+ const intent = yield* declaredIntent(definition)
2061
+
2071
2062
  const input = yield* jsonSchemaOf(definition.id, definition.input)
2072
2063
  const output = yield* jsonSchemaOf(definition.id, definition.output)
2073
2064
 
@@ -2082,6 +2073,7 @@ export const loopManifest = <In, Out, E>(
2082
2073
  output,
2083
2074
  ...(definition.outcome === undefined ? undefined : { outcome: definition.outcome }),
2084
2075
  ...(definition.role === undefined ? undefined : { role: definition.role }),
2076
+ intent,
2085
2077
  agents: definition.agents,
2086
2078
  checkout: definition.checkout,
2087
2079
  when: yield* namedWhenClauses(definition.id, definition.when ?? []),
@@ -2230,7 +2222,7 @@ var pathOfLink = (link) => {
2230
2222
  return page === null ? link : page[1] || "index";
2231
2223
  };
2232
2224
  var UnpinnedSdkLink = "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/";
2233
- var pinnedLink2 = (link, version = "0.52.0") => version === undefined || !link.startsWith(UnpinnedSdkLink) ? link : link.replace(UnpinnedSdkLink, `https://cdn.jsdelivr.net/npm/@kitman-sh/sdk@${version}/`);
2225
+ var pinnedLink2 = (link, version = "0.53.0") => version === undefined || !link.startsWith(UnpinnedSdkLink) ? link : link.replace(UnpinnedSdkLink, `https://cdn.jsdelivr.net/npm/@kitman-sh/sdk@${version}/`);
2234
2226
  var pageOf = (path) => path.split("#")[0];
2235
2227
  var exportName = (section) => section.path.startsWith("sdk/") ? section.path.split("#")[1] ?? "" : "";
2236
2228
  function excerpt(text, queryTerms) {
@@ -186,7 +186,7 @@ import {
186
186
  decodeJsonStringSync,
187
187
  encodeUnknownJsonStringSync,
188
188
  storable
189
- } from "./chunk-zb4t1yrt.js";
189
+ } from "./chunk-n381rqax.js";
190
190
  import {
191
191
  SecureRandom,
192
192
  layerWebCrypto,
@@ -277,10 +277,9 @@ import {
277
277
  checkServicesFile,
278
278
  checkServices,
279
279
  serviceChecks
280
- } from "./chunk-qsbq9gvr.js";
280
+ } from "./chunk-1zvfqdby.js";
281
281
  import {
282
282
  empty2,
283
- currentTimeMillis,
284
283
  join,
285
284
  interrupt,
286
285
  interruptAll,
@@ -330,7 +329,7 @@ import {
330
329
  writeSrtSettings2,
331
330
  srtStepArgv2,
332
331
  srtArgv2
333
- } from "./chunk-bj0zchck.js";
332
+ } from "./chunk-hyaq30ne.js";
334
333
  import {
335
334
  writeAgentEnvironmentConfigFile2,
336
335
  readManifestSkillPaths2,
@@ -346,8 +345,13 @@ import {
346
345
  applyAgentEnvironmentMaterialization2,
347
346
  isPathWithin2,
348
347
  skillIdentity2
349
- } from "./chunk-my9db578.js";
350
- import"./chunk-a40yta1r.js";
348
+ } from "./chunk-cy13pst5.js";
349
+ import"./chunk-5bpp6k0h.js";
350
+ import {
351
+ currentTimeMillis,
352
+ ChildProcessSpawner,
353
+ make2
354
+ } from "./chunk-8r9k7pqk.js";
351
355
  import {
352
356
  egressAllowed,
353
357
  writeSecretRegistry,
@@ -357,7 +361,7 @@ import {
357
361
  secretFilter2,
358
362
  opaqueTunnelRefusal2,
359
363
  isOpaqueConnectReason2
360
- } from "./chunk-tfznw549.js";
364
+ } from "./chunk-n00cpb86.js";
361
365
  import {
362
366
  sliceBytes2,
363
367
  maxLineBytes2,
@@ -367,29 +371,25 @@ import {
367
371
  lookAtOpencode2,
368
372
  readOpencode2,
369
373
  databaseStamp2
370
- } from "./chunk-pppryg54.js";
374
+ } from "./chunk-72ht3484.js";
371
375
  import {
372
376
  uploadRunFile,
373
377
  programLease,
374
378
  rpcRunFiles,
375
379
  programHostsEnv,
376
380
  undeclaredHostsEnv
377
- } from "./chunk-chbdcf34.js";
378
- import"./chunk-kt26vpwf.js";
381
+ } from "./chunk-e627b064.js";
382
+ import"./chunk-stx87en6.js";
379
383
  import {
380
384
  nextInt
381
- } from "./chunk-5yygjn0k.js";
382
- import"./chunk-tqspx38s.js";
383
- import {
384
- ChildProcessSpawner,
385
- make3
386
- } from "./chunk-2nq80r46.js";
387
- import"./chunk-2t1hcdeq.js";
385
+ } from "./chunk-apv9h5tz.js";
386
+ import"./chunk-k1fdsn2c.js";
387
+ import"./chunk-ab7r6p1s.js";
388
388
  import {
389
389
  Id,
390
390
  secretReference,
391
391
  secretPlaceholder
392
- } from "./chunk-wxg9k10v.js";
392
+ } from "./chunk-5tgpa02q.js";
393
393
 
394
394
  // packages/core/src/sync-kit.ts
395
395
  import { createHash } from "crypto";
@@ -3335,7 +3335,7 @@ var Proto2 = {
3335
3335
  };
3336
3336
  }
3337
3337
  };
3338
- var make2 = (value) => map9(unbounded({
3338
+ var make3 = (value) => map9(unbounded({
3339
3339
  replay: 1
3340
3340
  }), (pubsub) => {
3341
3341
  const self = Object.create(Proto2);
@@ -5168,7 +5168,7 @@ var runAttempt = (request, options) => gen(function* () {
5168
5168
  return isTagged(terminal.failure, "HerdrCoreRpcError") ? failed("harness_launch_failed", `herdr-core refused to start the Harness: ${terminal.failure.message}`) : { status: "unreported", reason: "herdr_unavailable" };
5169
5169
  }
5170
5170
  const { address } = terminal.success;
5171
- const seen = yield* make2({ status: null, turn: 0, end: undefined });
5171
+ const seen = yield* make3({ status: null, turn: 0, end: undefined });
5172
5172
  yield* forkScoped(follow(options.core, attempt.id, address, seen));
5173
5173
  const stop = gen(function* () {
5174
5174
  if ((yield* get2(seen)).end === "unreachable")
@@ -8909,7 +8909,7 @@ var codexAppServer = (binary = "codex") => (env) => gen(function* () {
8909
8909
  const input = yield* unbounded2();
8910
8910
  const pending = new Map;
8911
8911
  let lastId = 0;
8912
- const handle = yield* spawner.spawn(make3(binary, ["app-server"], {
8912
+ const handle = yield* spawner.spawn(make2(binary, ["app-server"], {
8913
8913
  cwd: env.home,
8914
8914
  extendEnv: true,
8915
8915
  env: { HOME: env.home, CODEX_HOME: env.codexHome },
@@ -9072,7 +9072,7 @@ var handshake = [
9072
9072
  `).join("");
9073
9073
  var kitmanMcpPreflight = (mcp) => gen(function* () {
9074
9074
  const spawner = yield* ChildProcessSpawner;
9075
- const server = yield* spawner.spawn(make3(mcp.command, [...mcp.args], {
9075
+ const server = yield* spawner.spawn(make2(mcp.command, [...mcp.args], {
9076
9076
  extendEnv: true,
9077
9077
  env: mcp.env,
9078
9078
  stdin: { stream: make10(new TextEncoder().encode(handshake)), endOnDone: false },
@@ -9155,7 +9155,7 @@ var programProcessExecutor = (input) => (work) => gen(function* () {
9155
9155
  };
9156
9156
  const { ended, output } = sandbox === undefined ? yield* gen(function* () {
9157
9157
  const spawner = yield* ChildProcessSpawner;
9158
- const handle = yield* spawner.spawn(make3(input.bun ?? process.execPath, [file], {
9158
+ const handle = yield* spawner.spawn(make2(input.bun ?? process.execPath, [file], {
9159
9159
  stdin: make10(new TextEncoder().encode(stdin)),
9160
9160
  stdout: "pipe",
9161
9161
  stderr: "pipe",
@@ -25,21 +25,21 @@ import {
25
25
  isString2,
26
26
  encodePrettyJsonString,
27
27
  decodeJsonStringSync
28
- } from "./chunk-zb4t1yrt.js";
28
+ } from "./chunk-n381rqax.js";
29
29
  import {
30
30
  FileSystem,
31
31
  Path,
32
32
  optionalEnv,
33
33
  tempDirectoryScoped
34
- } from "./chunk-bj0zchck.js";
34
+ } from "./chunk-hyaq30ne.js";
35
35
  import {
36
36
  AgentHarnessIds,
37
37
  sha2562,
38
38
  runCommand2
39
- } from "./chunk-qsbq9gvr.js";
39
+ } from "./chunk-1zvfqdby.js";
40
40
  import {
41
41
  NpmRegistry
42
- } from "./chunk-a40yta1r.js";
42
+ } from "./chunk-5bpp6k0h.js";
43
43
 
44
44
  // packages/agent-runtime/src/config-convergence.ts
45
45
  var writeAgentEnvironmentConfigFile2 = fnUntraced(function* (file, content, keep = {}) {
@@ -12,7 +12,7 @@ import {
12
12
  empty4,
13
13
  add,
14
14
  getOrUndefined2,
15
- get3,
15
+ get4,
16
16
  merge3,
17
17
  Reference,
18
18
  fromInputUnsafe,
@@ -139,7 +139,7 @@ import {
139
139
  toCodecJson,
140
140
  Json,
141
141
  encodeUnknownJsonStringSync
142
- } from "./chunk-zb4t1yrt.js";
142
+ } from "./chunk-n381rqax.js";
143
143
  import {
144
144
  WebCrypto,
145
145
  makeUnsafe,
@@ -180,24 +180,26 @@ import {
180
180
  StepManifest,
181
181
  KitSetup,
182
182
  RunnerRpcError
183
- } from "./chunk-qsbq9gvr.js";
183
+ } from "./chunk-1zvfqdby.js";
184
184
  import {
185
- currentTimeMillis,
186
185
  getCurrent,
187
186
  runForEach,
188
187
  FileSystem
189
- } from "./chunk-bj0zchck.js";
188
+ } from "./chunk-hyaq30ne.js";
189
+ import {
190
+ currentTimeMillis
191
+ } from "./chunk-8r9k7pqk.js";
190
192
  import {
191
193
  splitQuestionOptions,
192
194
  recommendationProblem,
193
195
  questionAdvice
194
- } from "./chunk-tqspx38s.js";
196
+ } from "./chunk-k1fdsn2c.js";
195
197
  import {
196
198
  guard,
197
199
  Id,
198
200
  Timestamp,
199
201
  ActorType
200
- } from "./chunk-wxg9k10v.js";
202
+ } from "./chunk-5tgpa02q.js";
201
203
  var __defProp = Object.defineProperty;
202
204
  var __returnValue = (v) => v;
203
205
  function __exportSetter(name, newValue) {
@@ -664,6 +666,10 @@ var jsonSchemaOf = (loop, schema) => try_2({
664
666
  catch: (error) => new ManifestInvalid({ loop, message: `Schema has no JSON Schema: ${String(error)}` })
665
667
  }).pipe(flatMap3((document) => decodeUnknownEffect2(JsonObjectSchema)({ ...document.schema, $defs: document.definitions }).pipe(mapError2((error) => new ManifestInvalid({ loop, message: error.message })))));
666
668
  var JsonObjectSchema = Record(String4, Json);
669
+ var IntentDeclaration = Union([
670
+ Literal("task"),
671
+ Struct({ goal: String4, doneWhen: optionalKey(ArraySchema(String4)) })
672
+ ]);
667
673
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/workflow/internal/crypto.js
668
674
  var encoder = /* @__PURE__ */ new TextEncoder;
669
675
  var makeHashDigest = (original) => WebCrypto.use((crypto) => map9(webCryptoDigest(crypto, sha256, encoder.encode(original)), (bytes) => encode(bytes).slice(0, 32)));
@@ -774,7 +780,7 @@ class Suspended extends (/* @__PURE__ */ Class2("effect/workflow/Workflow/Suspen
774
780
  [ResultTypeId] = ResultTypeId;
775
781
  }
776
782
  var wrapActivityResult = (effect, isSuspend) => contextWith((context) => {
777
- const instance = get3(context, InstanceTag);
783
+ const instance = get4(context, InstanceTag);
778
784
  return acquireUseRelease(sync2(() => adoptActivityUnsafe(context, instance) ?? registerActivityUnsafe(instance)), () => effect, (registration, exit) => {
779
785
  releaseActivityUnsafe(registration);
780
786
  const isSuspended = isSuccess2(exit) && isSuspend(exit.value);
@@ -1492,7 +1498,7 @@ var scopingActivities = (engine) => ({
1492
1498
  }),
1493
1499
  activityExecute: (activity, attempt) => gen(function* () {
1494
1500
  const scope = yield* StepScope;
1495
- if (scope === "" || get3(activity.annotations, ActivityNamed))
1501
+ if (scope === "" || get4(activity.annotations, ActivityNamed))
1496
1502
  return yield* engine.activityExecute(activity, attempt);
1497
1503
  return yield* engine.activityExecute(renamed(activity, scopedName(scope, activity.name)), attempt);
1498
1504
  })