@drisp/cli 0.7.12 → 0.7.13

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runMachineRunners
3
- } from "./chunk-UUUCDIHI.js";
3
+ } from "./chunk-5TM2ARN3.js";
4
4
 
5
5
  // src/app/entry/runnerDaemon.ts
6
6
  if (process.argv.includes("--help")) {
@@ -13,4 +13,4 @@ if (process.argv.includes("--help")) {
13
13
  process.exitCode = 1;
14
14
  });
15
15
  }
16
- //# sourceMappingURL=chunk-ZKL7NFOA.js.map
16
+ //# sourceMappingURL=chunk-CD6EY4ZE.js.map
package/dist/cli.js CHANGED
@@ -141,10 +141,14 @@ import {
141
141
  teamDefaultSchema,
142
142
  teamIdentityPath,
143
143
  todoGlyphSet,
144
+ trackerImportPreviewSchema,
145
+ trackerIssueSchema,
146
+ trackerOperationSchema,
147
+ trackerSnapshotSchema,
144
148
  visualPositionToOffset,
145
149
  wrapText,
146
150
  writeIdentityOnce
147
- } from "./chunk-UUUCDIHI.js";
151
+ } from "./chunk-5TM2ARN3.js";
148
152
  import {
149
153
  generateId as generateId2
150
154
  } from "./chunk-PQIB66SG.js";
@@ -13893,6 +13897,24 @@ var DrispClient = class _DrispClient {
13893
13897
  submit(command) {
13894
13898
  return this.request("/commands", commandSchema.parse(command));
13895
13899
  }
13900
+ async tracker() {
13901
+ return trackerSnapshotSchema.parse(await this.request("/tracker"));
13902
+ }
13903
+ async trackerIssue(id) {
13904
+ return trackerIssueSchema.parse(await this.request(`/tracker/issues/${encodeURIComponent(id)}`));
13905
+ }
13906
+ trackerOperation(operation) {
13907
+ return this.request("/tracker", trackerOperationSchema.parse(operation));
13908
+ }
13909
+ async previewLinearImport(input) {
13910
+ return trackerImportPreviewSchema.parse(await this.trackerOperation({ kind: "import.preview", input }));
13911
+ }
13912
+ async commitLinearImport(previewId) {
13913
+ return trackerSnapshotSchema.parse(await this.trackerOperation({ kind: "import.commit", previewId }));
13914
+ }
13915
+ startIssue(id, command) {
13916
+ return this.request(`/tracker/issues/${encodeURIComponent(id)}/start`, commandSchema.parse(command));
13917
+ }
13896
13918
  /** The recent Runs; with a filter, every Run carrying that key or every child of that Run, newest first. */
13897
13919
  async runs(filter) {
13898
13920
  const query = !filter ? "" : "key" in filter ? `?key=${encodeURIComponent(filter.key)}` : `?parent=${encodeURIComponent(filter.parent)}`;
@@ -15585,6 +15607,42 @@ ${USAGE3}
15585
15607
  }
15586
15608
  }
15587
15609
 
15610
+ // src/app/entry/trackerCommand.ts
15611
+ import { readFile as readFile2 } from "fs/promises";
15612
+ async function runTrackerCommand(args, env2 = process.env) {
15613
+ const usage2 = "Usage: drisp tracker get <issue-id> | apply <operation.json>\nOperations: issue.revision, issue.comment, issue.attention, issue.evidence. Read the Issue first for its current version. Evidence includes revision, reference, kind and runId; staging/QA also require deploymentId. Production release confirmation is a human action.";
15614
+ try {
15615
+ if (!env2.DRISP_HUB_URL || !env2.DRISP_RUN_TOKEN)
15616
+ throw new Error(
15617
+ "This command requires a native Issue Run with DRISP_HUB_URL and DRISP_RUN_TOKEN."
15618
+ );
15619
+ const client2 = DrispClient.delegated(
15620
+ env2.DRISP_HUB_URL,
15621
+ env2.DRISP_RUN_TOKEN
15622
+ );
15623
+ const [action, argument, ...extra] = args;
15624
+ if (!argument || extra.length) throw new Error(usage2);
15625
+ if (action === "get")
15626
+ process.stdout.write(
15627
+ JSON.stringify(await client2.trackerIssue(argument)) + "\n"
15628
+ );
15629
+ else if (action === "apply") {
15630
+ const operation = trackerOperationSchema.parse(
15631
+ JSON.parse(await readFile2(argument, "utf8"))
15632
+ );
15633
+ process.stdout.write(
15634
+ JSON.stringify(await client2.trackerOperation(operation)) + "\n"
15635
+ );
15636
+ } else throw new Error(usage2);
15637
+ return 0;
15638
+ } catch (error) {
15639
+ process.stderr.write(
15640
+ (error instanceof Error ? error.message : String(error)) + "\n"
15641
+ );
15642
+ return 2;
15643
+ }
15644
+ }
15645
+
15588
15646
  // src/app/entry/doctorCommand.ts
15589
15647
  import process7 from "process";
15590
15648
 
@@ -16238,6 +16296,7 @@ function resolvePackageJsonPath(entryUrl) {
16238
16296
  var require2 = createRequire(import.meta.url);
16239
16297
  var { version } = require2(resolvePackageJsonPath(import.meta.url));
16240
16298
  var KNOWN_COMMANDS = /* @__PURE__ */ new Set([
16299
+ "tracker",
16241
16300
  "setup",
16242
16301
  "sessions",
16243
16302
  "resume",
@@ -16398,6 +16457,8 @@ var cli = meow(
16398
16457
  runner [sub] Run the runner that connects this machine to a Team and executes its Runs
16399
16458
  (no subcommand: foreground; connect [code] --hub <url> [--replace], disconnect [team], status, restart, recover, help)
16400
16459
  build plan --input <path> Plan a Build inside an Orchestrator Run (prints one JSON object)
16460
+ tracker get <issue> Read the current native Drisp Issue
16461
+ tracker apply <json> Apply a scoped native Issue operation from a JSON file
16401
16462
  build children List this Build's children and their interruptions
16402
16463
  build inspect <run> [cursor] Read a child's state and paged history
16403
16464
  build guide <run> "<text>" Guide a child or answer its delegated technical question
@@ -16726,6 +16787,10 @@ Available commands: ${[...KNOWN_COMMANDS].join(", ")}`
16726
16787
  );
16727
16788
  return;
16728
16789
  }
16790
+ if (command === "tracker") {
16791
+ await exitWith(await runTrackerCommand(commandArgs));
16792
+ return;
16793
+ }
16729
16794
  if (command === "build") {
16730
16795
  const rawArgs = process.argv.slice(2);
16731
16796
  const dashIdx = rawArgs.indexOf("--");
@@ -1,5 +1,5 @@
1
- import "./chunk-ZKL7NFOA.js";
2
- import "./chunk-UUUCDIHI.js";
1
+ import "./chunk-CD6EY4ZE.js";
2
+ import "./chunk-5TM2ARN3.js";
3
3
  import "./chunk-PQIB66SG.js";
4
4
  import "./chunk-SACVOS6T.js";
5
5
  import "./chunk-G3PMV62Z.js";
package/dist/runner.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./chunk-ZKL7NFOA.js";
2
- import "./chunk-UUUCDIHI.js";
1
+ import "./chunk-CD6EY4ZE.js";
2
+ import "./chunk-5TM2ARN3.js";
3
3
  import "./chunk-PQIB66SG.js";
4
4
  import "./chunk-SACVOS6T.js";
5
5
  import "./chunk-G3PMV62Z.js";
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "hooks",
18
18
  "dashboard"
19
19
  ],
20
- "version": "0.7.12",
20
+ "version": "0.7.13",
21
21
  "license": "MIT",
22
22
  "bin": {
23
23
  "athena": "dist/cli.js",