@workser/cli 0.6.9 → 0.6.11

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 (2) hide show
  1. package/dist/index.js +59 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8639,6 +8639,50 @@ function collect2(value, previous) {
8639
8639
 
8640
8640
  // src/commands/task.ts
8641
8641
  var import_picocolors29 = __toESM(require_picocolors(), 1);
8642
+
8643
+ // src/subtask-attachments.ts
8644
+ var MAX_REF_NOTE = 500;
8645
+ var MAX_REFS = 20;
8646
+ var URL_SCHEME = /^https?:\/\//i;
8647
+ function labelFor(type, value) {
8648
+ if (type === "url") {
8649
+ try {
8650
+ return new URL(value).hostname.replace(/^www\./, "");
8651
+ } catch {
8652
+ return value;
8653
+ }
8654
+ }
8655
+ const parts = value.split(/[\\/]/).filter(Boolean);
8656
+ return parts[parts.length - 1] || value;
8657
+ }
8658
+ function parseRef(raw) {
8659
+ const at = raw.indexOf("::");
8660
+ const value = (at === -1 ? raw : raw.slice(0, at)).trim();
8661
+ if (!value) return null;
8662
+ const note = at === -1 ? "" : raw.slice(at + 2).trim().slice(0, MAX_REF_NOTE);
8663
+ const type = URL_SCHEME.test(value) ? "url" : "file";
8664
+ return {
8665
+ type,
8666
+ value,
8667
+ label: labelFor(type, value),
8668
+ ...note ? { note } : {}
8669
+ };
8670
+ }
8671
+ function parseRefs(raw) {
8672
+ if (!raw?.length) return [];
8673
+ const out = [];
8674
+ const seen = /* @__PURE__ */ new Set();
8675
+ for (const item of raw) {
8676
+ const parsed = parseRef(item);
8677
+ if (!parsed) continue;
8678
+ if (seen.has(parsed.value)) continue;
8679
+ seen.add(parsed.value);
8680
+ out.push(parsed);
8681
+ }
8682
+ return out.slice(0, MAX_REFS);
8683
+ }
8684
+
8685
+ // src/commands/task.ts
8642
8686
  var STATUSES2 = [
8643
8687
  "todo",
8644
8688
  "working",
@@ -8817,6 +8861,9 @@ function registerTask(program3) {
8817
8861
  "--infra <ref...>",
8818
8862
  "shared setup it touches (database | storage | auth | hosting | jobs)"
8819
8863
  ).option("--scope <path...>", "files or folders THIS subtask owns").option(
8864
+ "--ref <spec...>",
8865
+ 'what this step should READ first \u2014 a path or URL, optionally "::why it matters" (repeatable)'
8866
+ ).option(
8820
8867
  "--depends-on <id...>",
8821
8868
  "subtasks that must finish first (key or id)"
8822
8869
  ).option(
@@ -8840,6 +8887,10 @@ function registerTask(program3) {
8840
8887
  role: opts.role,
8841
8888
  category: opts.kind,
8842
8889
  scopePaths: opts.scope,
8890
+ // What to read before doing it. Parsed here rather than pushed at
8891
+ // the API so a malformed pointer is dropped where the agent can
8892
+ // still be told, not stored and drawn as an empty chip.
8893
+ attachments: parseRefs(opts.ref),
8843
8894
  dependsOn,
8844
8895
  targets: [
8845
8896
  ...(opts.app ?? []).map((appId) => ({
@@ -8898,6 +8949,9 @@ function registerTask(program3) {
8898
8949
  })
8899
8950
  );
8900
8951
  subtask.command("update <id>").description("Change a subtask \u2014 its title, its role, what it touches").option("--title <text>").option("--note <text>").option("--role <value>", ROLES.join(" | ")).option("--kind <value>", KINDS2.join(" | ")).option("--scope <path...>", "replaces the subtask's scope entirely").option(
8952
+ "--ref <spec...>",
8953
+ "replaces what this step should READ first \u2014 same form as `subtask add --ref`"
8954
+ ).option(
8901
8955
  "--agent <id>",
8902
8956
  `run this step on a specific CLI (${AGENTS.join(" | ")}); "default" hands it back to the role's own`
8903
8957
  ).option("--model <id>", 'the model that CLI should use; "default" clears it').option(
@@ -8925,6 +8979,10 @@ function registerTask(program3) {
8925
8979
  role: opts.role,
8926
8980
  category: opts.kind,
8927
8981
  scopePaths: opts.scope,
8982
+ // Only sent when `--ref` was actually given: the PATCH replaces
8983
+ // the whole list, so passing `[]` for an untouched flag would
8984
+ // clear a brief the manager set on a previous call.
8985
+ attachments: opts.ref ? parseRefs(opts.ref) : void 0,
8928
8986
  agentOverride: clearable(opts.agent),
8929
8987
  agentModelOverride: clearable(opts.model),
8930
8988
  agentEffortOverride: clearable(opts.effort)
@@ -11066,7 +11124,7 @@ function colour(d) {
11066
11124
 
11067
11125
  // src/index.ts
11068
11126
  var pkg = {
11069
- version: true ? "0.6.9" : "0.0.0-dev"
11127
+ version: true ? "0.6.11" : "0.0.0-dev"
11070
11128
  };
11071
11129
  var program2 = new Command();
11072
11130
  program2.name("workser").description(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workser/cli",
3
- "version": "0.6.9",
3
+ "version": "0.6.11",
4
4
  "description": "Workser CLI — give your local AI agent native DevOps & infrastructure on Workser. The agent runs `workser …` to provision, deploy, and manage real apps.",
5
5
  "license": "MIT",
6
6
  "type": "module",