@kitman-sh/cli 0.12.0-rc.2 → 0.12.0-rc.3

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.
@@ -227,9 +227,11 @@ People create Tasks and hand them to agents. An agent works on a Task through a
227
227
  link: "https://kitman.sh/knowledge/docs/handing-work-to-agents#ready-for-agents",
228
228
  text: `## Ready for agents
229
229
 
230
- Moving a Task to a state agents pick up from, such as **Ready for agents**, starts its Task Type's default Loop for it. You become the Run's Delivery Owner: its Questions and its handoff come to you. When an agent or a Triage Rule moved the Task, the Task's assignee is the Delivery Owner, or else its creator.
230
+ Moving a Task to a state agents pick up from, such as **Ready for agents**, or creating it in one, starts its Task Type's default Loop for it. Creating a Task with a Loop chosen, or by starting a Run from words, starts only that Run, and the tickets Plan builds itself and a Firewatch alert's Task start only the Runs their Loops give them. Tickets filed as Tasks are picked up once their blockers are related; Plan's File as Tasks waits until the Plan Run ends without building them. You become the Run's Delivery Owner: its Questions and its handoff come to you. When an agent or a Triage Rule moved the Task, the Task's assignee is the Delivery Owner, or else its human creator; with neither, its Team gets a **Start** item in the Inbox. The Run queues for a Runner like any other, by the Task's priority.
231
231
 
232
- Nothing new starts while the Task already has a Run that has not finished.
232
+ Nothing new starts while the Task already has a Run that has not finished. To give a new Task blockers before it starts, create it in another state, add its relations, then move it.
233
+
234
+ Each pickup is listed by \`kitman loop starts\` (\`loops.automaticStarts\`) as a \`task.picked_up\` Event, and each release by a finished blocker as \`task.unblocked\`: the Run it started, or why it started none, such as the blockers it waits on or the Run it already has. A blocker in another private Team is listed only as a count.
233
235
 
234
236
  Any state can hand Tasks to agents. In the Team's settings, the **Workflow** tab has a switch with a robot on each state that turns agent pickup on or off; the same robot marks those states in lists and menus. A Triage Rule can accept a Task straight into such a state, so routine work goes from intake to an agent without waiting on a person.`
235
237
  },
@@ -1442,7 +1444,7 @@ var pathOfLink = (link) => {
1442
1444
  return page === null ? link : page[1] || "index";
1443
1445
  };
1444
1446
  var UnpinnedSdkLink = "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/";
1445
- var pinnedLink2 = (link, version = "0.12.0-rc.2") => version === undefined || !link.startsWith(UnpinnedSdkLink) ? link : link.replace(UnpinnedSdkLink, `https://cdn.jsdelivr.net/npm/@kitman-sh/sdk@${version}/`);
1447
+ var pinnedLink2 = (link, version = "0.12.0-rc.3") => version === undefined || !link.startsWith(UnpinnedSdkLink) ? link : link.replace(UnpinnedSdkLink, `https://cdn.jsdelivr.net/npm/@kitman-sh/sdk@${version}/`);
1446
1448
  var pageOf = (path) => path.split("#")[0];
1447
1449
  var exportName = (section) => section.path.startsWith("sdk/") ? section.path.split("#")[1] ?? "" : "";
1448
1450
  function excerpt(text, queryTerms) {
@@ -31,16 +31,17 @@ import {
31
31
  import {
32
32
  FileSystem,
33
33
  Path,
34
- optionalEnv
35
- } from "./chunk-3d4d52e5.js";
34
+ optionalEnv,
35
+ tempDirectoryScoped
36
+ } from "./chunk-gspfm7qh.js";
36
37
  import {
37
38
  AgentHarnessIds,
38
39
  sha2562,
39
40
  runCommand2
40
- } from "./chunk-fhyn2b38.js";
41
+ } from "./chunk-dymepetx.js";
41
42
  import {
42
43
  NpmRegistry
43
- } from "./chunk-n6hxwdm6.js";
44
+ } from "./chunk-e7e120qw.js";
44
45
 
45
46
  // packages/agent-runtime/src/config-convergence.ts
46
47
  var writeAgentEnvironmentConfigFile2 = fnUntraced(function* (file, content, keep = {}) {
@@ -1234,7 +1235,7 @@ var writeSkill = (plan, operation) => gen(function* () {
1234
1235
  var checkoutGitTree = (url, ref) => gen(function* () {
1235
1236
  const fs = yield* FileSystem;
1236
1237
  const path = yield* Path;
1237
- const scratch = yield* fs.makeTempDirectoryScoped({ prefix: "kitman-git-" });
1238
+ const scratch = yield* tempDirectoryScoped(fs, { prefix: "kitman-git-" });
1238
1239
  const repository = path.join(scratch, "repository");
1239
1240
  const tree = path.join(scratch, "tree");
1240
1241
  const git = (...args) => runCommand2("git", ["--git-dir", repository, ...args]);
@@ -248,7 +248,7 @@ import {
248
248
  installCommand,
249
249
  checkServicesFile,
250
250
  checkServices
251
- } from "./chunk-fhyn2b38.js";
251
+ } from "./chunk-dymepetx.js";
252
252
  import {
253
253
  join,
254
254
  interrupt,
@@ -274,6 +274,7 @@ import {
274
274
  extractEmbeddedFile,
275
275
  optionalEnv,
276
276
  operatorConfigHome,
277
+ tempDirectoryScoped,
277
278
  harnessesUnsupportedInSrt2,
278
279
  compiled2,
279
280
  pinnedSrtCommand2,
@@ -288,7 +289,7 @@ import {
288
289
  writeSrtSettings2,
289
290
  srtStepArgv2,
290
291
  srtArgv2
291
- } from "./chunk-3d4d52e5.js";
292
+ } from "./chunk-gspfm7qh.js";
292
293
  import {
293
294
  writeAgentEnvironmentConfigFile2,
294
295
  readManifestSkillPaths2,
@@ -304,8 +305,8 @@ import {
304
305
  applyAgentEnvironmentMaterialization2,
305
306
  isPathWithin2,
306
307
  skillIdentity2
307
- } from "./chunk-bxqfgc6z.js";
308
- import"./chunk-n6hxwdm6.js";
308
+ } from "./chunk-trb9325k.js";
309
+ import"./chunk-e7e120qw.js";
309
310
  import {
310
311
  egressAllowed,
311
312
  writeSecretRegistry,
@@ -323,23 +324,23 @@ import {
323
324
  decodedOption2,
324
325
  decoded2,
325
326
  readOpencode2
326
- } from "./chunk-vmv7gwwr.js";
327
+ } from "./chunk-56knbdt6.js";
327
328
  import {
328
329
  uploadRunFile,
329
330
  programLease,
330
331
  rpcRunFiles,
331
332
  programHostsEnv,
332
333
  undeclaredHostsEnv
333
- } from "./chunk-2ptxq9cq.js";
334
- import"./chunk-myqf27w2.js";
334
+ } from "./chunk-8ez1s9cr.js";
335
+ import"./chunk-y8sscyvt.js";
335
336
  import {
336
337
  nextInt
337
338
  } from "./chunk-nzjb36ad.js";
338
339
  import {
339
340
  ChildProcessSpawner,
340
341
  make3
341
- } from "./chunk-sk6ceghr.js";
342
- import"./chunk-db9q9y8h.js";
342
+ } from "./chunk-xwya1er0.js";
343
+ import"./chunk-794hjysw.js";
343
344
 
344
345
  // packages/core/src/sync-kit.ts
345
346
  import { createHash } from "crypto";
@@ -2367,7 +2368,7 @@ var openCodeExpiry = (credentials, provider) => renewableLogin(provider, credent
2367
2368
  var replaceStored = (binary, source, store, stored, value) => gen(function* () {
2368
2369
  const fs = yield* FileSystem;
2369
2370
  const path = yield* Path;
2370
- const directory = yield* fs.makeTempDirectoryScoped({
2371
+ const directory = yield* tempDirectoryScoped(fs, {
2371
2372
  directory: path.dirname(source),
2372
2373
  prefix: "kitman-opencode-renewal-"
2373
2374
  });
@@ -2539,7 +2540,7 @@ var prepareHarness = (input) => gen(function* () {
2539
2540
  const fs = yield* FileSystem;
2540
2541
  const model = input.agent.brief.model ?? input.attempt.attempt.execution.metadata.model;
2541
2542
  const effort = input.agent.brief.effort;
2542
- const configDir = input.agent.session?.configDir ?? (yield* fs.makeTempDirectoryScoped({ prefix: "kitman-harness-" }).pipe(orDie));
2543
+ const configDir = input.agent.session?.configDir ?? (yield* tempDirectoryScoped(fs, { prefix: "kitman-harness-" }).pipe(orDie));
2543
2544
  const fitting = kitSetup === undefined ? [] : yield* fittingSkills(input.workspace, kitSetup.fitRules);
2544
2545
  const mcp = {
2545
2546
  ...input.agent.kitmanMcp,
@@ -2793,7 +2794,7 @@ var stepLogin = (login, reference) => map8(loginCredentials(login), (credentials
2793
2794
  var renewableStepLogin = (login, referenced, http) => gen(function* () {
2794
2795
  const fs = yield* FileSystem;
2795
2796
  const path = yield* Path;
2796
- const directory = yield* fs.makeTempDirectoryScoped({ prefix: "kitman-login-" });
2797
+ const directory = yield* tempDirectoryScoped(fs, { prefix: "kitman-login-" });
2797
2798
  const file = path.join(directory, path.basename(login.source));
2798
2799
  const expired = new Map;
2799
2800
  let published;
@@ -6232,7 +6233,7 @@ var stepAttempt = (input, resending) => (work) => gen(function* () {
6232
6233
  if (merge?.clean === "up_to_date" && work.branch !== undefined)
6233
6234
  return yield* deliver(work.branch);
6234
6235
  const notes = [...work.resumeNotes ?? [], ...merge === undefined ? [] : [merge.note]];
6235
- const configDir = yield* (yield* FileSystem).makeTempDirectoryScoped({ prefix: "kitman-harness-" }).pipe(orDie);
6236
+ const configDir = yield* tempDirectoryScoped(yield* FileSystem, { prefix: "kitman-harness-" }).pipe(orDie);
6236
6237
  const backend = work.sandbox ?? (isFunction2(input.sandbox) ? input.sandbox(work) : input.sandbox);
6237
6238
  const writableSessions = adapter === undefined ? undefined : worktreeSessionDirectory(adapter, home, worktree);
6238
6239
  if (backend === "srt" && writableSessions !== undefined)
@@ -6534,7 +6535,7 @@ var runSandboxCommand = (input) => scoped(gen(function* () {
6534
6535
  ...command.onOutput === undefined ? undefined : { onOutput: command.onOutput }
6535
6536
  });
6536
6537
  }
6537
- const configDir = yield* (yield* FileSystem).makeTempDirectoryScoped({ prefix: "kitman-sandbox-" });
6538
+ const configDir = yield* tempDirectoryScoped(yield* FileSystem, { prefix: "kitman-sandbox-" });
6538
6539
  const { container } = yield* startDockerSandbox({
6539
6540
  docker: input.docker,
6540
6541
  runnerId: input.runnerId,
@@ -6584,7 +6585,7 @@ var harnessesInSrt = (input) => gen(function* () {
6584
6585
  const fs = yield* FileSystem;
6585
6586
  const inherited = yield* inheritedEnvironment2(srtInheritedEnv2);
6586
6587
  const starts = (harness, binary) => scoped(gen(function* () {
6587
- const configDir = yield* fs.makeTempDirectoryScoped({ prefix: "kitman-harness-probe-" });
6588
+ const configDir = yield* tempDirectoryScoped(fs, { prefix: "kitman-harness-probe-" });
6588
6589
  const policy = {
6589
6590
  ...runnerStateSandboxPolicy(input.runner, [...harnessAdapter(harness)?.loginFiles ?? [], configDir]),
6590
6591
  writablePaths: [configDir],
@@ -6631,7 +6632,6 @@ var harnessesInSrt = (input) => gen(function* () {
6631
6632
  });
6632
6633
  // packages/agent-runtime/src/loopback-tunnel.ts
6633
6634
  import * as net from "net";
6634
-
6635
6635
  class LoopbackTunnelUnavailable extends TaggedError("LoopbackTunnelUnavailable") {
6636
6636
  }
6637
6637
  var srtLoopbackTunnel = (tunnel) => [
@@ -6667,7 +6667,7 @@ var srtLoopbackTunnel = (tunnel) => [
6667
6667
  `);
6668
6668
  var loopbackSocketForwarder = (hostPort, socket) => gen(function* () {
6669
6669
  const fs = yield* FileSystem;
6670
- const dir = yield* flatMap3(fs.makeTempDirectoryScoped({ prefix: "kitman-lo-" }), fs.realPath).pipe(mapError2((error) => new LoopbackTunnelUnavailable({ reason: error.message })));
6670
+ const dir = yield* flatMap3(tempDirectoryScoped(fs, { prefix: "kitman-lo-" }), fs.realPath).pipe(mapError2((error) => new LoopbackTunnelUnavailable({ reason: error.message })));
6671
6671
  yield* acquireRelease(callback3((resume) => {
6672
6672
  const open = new Set;
6673
6673
  const server = net.createServer({ allowHalfOpen: true }, (client) => {
@@ -7262,7 +7262,7 @@ var programProcessExecutor = (input) => (work) => gen(function* () {
7262
7262
  }));
7263
7263
  return yield* handle.exitCode;
7264
7264
  }) : yield* gen(function* () {
7265
- const tmp = yield* (yield* FileSystem).makeTempDirectoryScoped({ prefix: "kitman-program-" });
7265
+ const tmp = yield* tempDirectoryScoped(yield* FileSystem, { prefix: "kitman-program-" });
7266
7266
  const policy = {
7267
7267
  ...runnerStateSandboxPolicy(sandbox.runner, [file]),
7268
7268
  writablePaths: [tmp],
@@ -7653,7 +7653,7 @@ var pipelineDaemon = (services, check) => gen(function* () {
7653
7653
  });
7654
7654
  const fs = yield* FileSystem;
7655
7655
  const started = yield* services.docker({ id: services.id, network: services.network }).pipe(mapError2((error) => new ServicesUnavailable({ reason: error.message })));
7656
- const clientDir = yield* fs.makeTempDirectoryScoped({ prefix: "kitman-check-docker-" });
7656
+ const clientDir = yield* tempDirectoryScoped(fs, { prefix: "kitman-check-docker-" });
7657
7657
  yield* fs.makeDirectory(`${clientDir}/docker`);
7658
7658
  yield* fs.makeDirectory(`${clientDir}/gitlab-ci-local-home`);
7659
7659
  yield* fs.writeFileString(`${clientDir}/docker/config.json`, encodeUnknownJsonStringSync(checkDockerClientConfig(started.proxy)));
@@ -7687,7 +7687,7 @@ var reachCheckPostgres = (postgres, services, worktree, run) => gen(function* ()
7687
7687
  socketDir: yield* postgresSocketForwarder(postgres.hostPort).pipe(mapError2((error) => new ServicesUnavailable({ reason: error.message })))
7688
7688
  };
7689
7689
  const fs = yield* FileSystem;
7690
- const filesDir = yield* fs.makeTempDirectoryScoped({ prefix: "kitman-check-files-" });
7690
+ const filesDir = yield* tempDirectoryScoped(fs, { prefix: "kitman-check-files-" });
7691
7691
  const reached = yield* run({ command: ":", cwd: worktree, filesDir, postgres });
7692
7692
  if (reached.exitCode !== 0)
7693
7693
  return yield* new ServicesUnavailable({
@@ -7798,7 +7798,7 @@ var installIn = (worktree, run) => gen(function* () {
7798
7798
  const install = installCommand(yield* files.readDirectory(worktree));
7799
7799
  if (install === undefined)
7800
7800
  return;
7801
- const filesDir = yield* files.makeTempDirectoryScoped({ prefix: "kitman-check-files-" });
7801
+ const filesDir = yield* tempDirectoryScoped(files, { prefix: "kitman-check-files-" });
7802
7802
  const installWith = (command) => gen(function* () {
7803
7803
  const installed = yield* run({ command, cwd: worktree, filesDir });
7804
7804
  if (installed.exitCode !== 0)
@@ -7823,8 +7823,8 @@ var runChecks = (worktree, checks, tree, known, run, keeper, services) => gen(fu
7823
7823
  return yield* forEach(due, (check) => gen(function* () {
7824
7824
  const fs = yield* FileSystem;
7825
7825
  const startedAt = yield* currentTimeMillis;
7826
- const filesDir = yield* fs.makeTempDirectoryScoped({ prefix: "kitman-check-files-" });
7827
- const output = path.join(yield* fs.makeTempDirectoryScoped({ prefix: "kitman-check-output-" }), "output");
7826
+ const filesDir = yield* tempDirectoryScoped(fs, { prefix: "kitman-check-files-" });
7827
+ const output = path.join(yield* tempDirectoryScoped(fs, { prefix: "kitman-check-output-" }), "output");
7828
7828
  const sink = keeper === undefined ? undefined : yield* fs.open(output, { flag: "w" });
7829
7829
  const docker = check.pipeline === true ? yield* pipelineDaemon(services, check.name) : undefined;
7830
7830
  const ran = yield* run({
@@ -7887,7 +7887,7 @@ var sampleMetrics = (output) => {
7887
7887
  var measureRevisions = (work, measure, checkouts, runIn) => gen(function* () {
7888
7888
  const fs = yield* FileSystem;
7889
7889
  const path = yield* Path;
7890
- const filesDir = yield* fs.makeTempDirectoryScoped({ prefix: "kitman-measure-files-" });
7890
+ const filesDir = yield* tempDirectoryScoped(fs, { prefix: "kitman-measure-files-" });
7891
7891
  const head = yield* checkouts.checkout({ runId: work.runId, id: work.id, baseRevision: work.revision }, work.repoBinding);
7892
7892
  const base = yield* checkouts.checkout({ runId: work.runId, id: `${work.id}-base`, baseRevision: measure.base }, work.repoBinding);
7893
7893
  const call = (checkout, command) => runIn(checkout)({ command, cwd: path.join(checkout, measure.plan.workingDirectory ?? "."), filesDir });
@@ -7936,7 +7936,7 @@ var measureRevisions = (work, measure, checkouts, runIn) => gen(function* () {
7936
7936
  var ownRepository = (worktree, clone, targetBranch) => gen(function* () {
7937
7937
  const fs = yield* FileSystem;
7938
7938
  const path = yield* Path;
7939
- const scratch = yield* fs.makeTempDirectoryScoped({
7939
+ const scratch = yield* tempDirectoryScoped(fs, {
7940
7940
  directory: path.dirname(worktree),
7941
7941
  prefix: "kitman-check-git-"
7942
7942
  });
@@ -7996,7 +7996,7 @@ var verificationExecutor = (input) => (work) => gen(function* () {
7996
7996
  status: "failed",
7997
7997
  failureSummary: "A shared Runner runs verifications only in `srt` or `docker`."
7998
7998
  };
7999
- const cache = yield* (yield* FileSystem).makeTempDirectoryScoped({ prefix: "kitman-verify-cache-" });
7999
+ const cache = yield* tempDirectoryScoped(yield* FileSystem, { prefix: "kitman-verify-cache-" });
8000
8000
  const runIn = checkRunner(work, input.sandbox, cache, yield* inheritedEnvironment2(srtInheritedEnv2));
8001
8001
  const checkouts = runCheckouts(input.rootDir, input.gitCredentials);
8002
8002
  if (work.resolve !== undefined)
@@ -31,7 +31,7 @@ import {
31
31
  runCollect,
32
32
  runDrain,
33
33
  mkString
34
- } from "./chunk-3d4d52e5.js";
34
+ } from "./chunk-gspfm7qh.js";
35
35
 
36
36
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/internal/redacted.js
37
37
  var redactedRegistry = /* @__PURE__ */ new WeakMap;
@@ -20,22 +20,22 @@ import {
20
20
  import {
21
21
  FileSystem,
22
22
  Path
23
- } from "./chunk-3d4d52e5.js";
23
+ } from "./chunk-gspfm7qh.js";
24
24
  import {
25
25
  tomlTableHeader2,
26
26
  tomlKeyPath2,
27
27
  kitmanSkillEntry,
28
28
  isPathWithin2
29
- } from "./chunk-bxqfgc6z.js";
29
+ } from "./chunk-trb9325k.js";
30
30
  import {
31
31
  instructionsStart,
32
32
  instructionsEnd,
33
33
  renderMcpServer,
34
34
  materializeKitSetup,
35
35
  tomlInline
36
- } from "./chunk-fhyn2b38.js";
37
- import"./chunk-n6hxwdm6.js";
38
- import"./chunk-sk6ceghr.js";
36
+ } from "./chunk-dymepetx.js";
37
+ import"./chunk-e7e120qw.js";
38
+ import"./chunk-xwya1er0.js";
39
39
 
40
40
  // packages/agent-runtime/src/kit-setup-sync.ts
41
41
  class KitSyncError extends TaggedError("KitSyncError") {
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-vtfwjhzh.js";
10
10
  import {
11
11
  runForEach
12
- } from "./chunk-3d4d52e5.js";
12
+ } from "./chunk-gspfm7qh.js";
13
13
  import {
14
14
  WebSocketConstructor,
15
15
  layerWebSocketConstructorGlobal,
@@ -19,13 +19,13 @@ import {
19
19
  RunnerReplicaRpcs,
20
20
  RunnerRunFileRpcs,
21
21
  ProgramRpcs
22
- } from "./chunk-fhyn2b38.js";
22
+ } from "./chunk-dymepetx.js";
23
23
  import {
24
24
  layerJson,
25
25
  make4,
26
26
  withHeaders,
27
27
  layerProtocolSocket
28
- } from "./chunk-db9q9y8h.js";
28
+ } from "./chunk-794hjysw.js";
29
29
 
30
30
  // packages/live/src/rpc/runner-client.ts
31
31
  var proxiedWebSocket = (proxy) => succeed5(WebSocketConstructor)((target) => {
@@ -4,7 +4,7 @@ import {
4
4
  searchDocs2,
5
5
  readDoc2,
6
6
  pinnedLink2
7
- } from "./chunk-ha241q06.js";
7
+ } from "./chunk-mc87tyzm.js";
8
8
  export {
9
9
  DefaultDocsSearchLimit2 as DefaultDocsSearchLimit,
10
10
  pinnedLink2 as pinnedLink,
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-japwbj9n.js");
8
+ const { runSrtCli } = await import("./chunk-ewhzaqp3.js");
9
9
  await runSrtCli();
10
10
  } else if (args[0] === "srt-step") {
11
11
  const { runSrtStep } = await import("./chunk-z450wa10.js");
12
12
  await runSrtStep(args.slice(1));
13
13
  } else if (args[0] === "opencode-read") {
14
- const { runOpencodeReader } = await import("./chunk-d9bv70qb.js");
14
+ const { runOpencodeReader } = await import("./chunk-0346hwh6.js");
15
15
  runOpencodeReader();
16
16
  } else {
17
- const { runCli } = await import("./chunk-cjscsbg8.js");
17
+ const { runCli } = await import("./chunk-h6hd61dn.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.12.0-rc.2",
3
+ "version": "0.12.0-rc.3",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {