@50arms/plugin-sdk 0.2.74 → 0.2.75

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.
@@ -871,84 +871,6 @@ declare module "@danxbot/card-kit@1" {
871
871
  blobs: Record<string, string>;
872
872
  }
873
873
 
874
- interface HolderAgentPause {
875
- reason: string;
876
- since: string;
877
- until: string | null;
878
- }
879
-
880
- interface AgentIdentity {
881
- id: number;
882
- name: string;
883
- avatar_url: string | null;
884
- }
885
- type AssignedAgentKind = "person" | "session" | "worker" | "label";
886
-
887
- interface UsageTokenCounts {
888
- input: number;
889
- output: number;
890
- cacheRead: number;
891
- cacheWrite: number;
892
- }
893
- interface UsageSlice {
894
- tokens: UsageTokenCounts;
895
- costUsd: number;
896
- }
897
- interface UsageTotals extends UsageTokenCounts {
898
- cacheWrite5m: number;
899
- cacheWrite1h: number;
900
- cacheWriteUnsplit: number;
901
- }
902
- interface UsageModelRow extends UsageSlice {
903
- model: string | null;
904
- }
905
- type UsageKind = "work" | "operator-session" | `gate:${string}` | "triage" | "maintenance" | "chat" | "other";
906
- interface UsageKindRow extends UsageSlice {
907
- kind: UsageKind;
908
- label: string;
909
- }
910
- type UsageSubagentTypeKey = "main" | "unknown" | "unattributed" | `agent:${string}`;
911
- interface UsageSubagentTypeRow extends UsageSlice {
912
- key: UsageSubagentTypeKey;
913
- label: string;
914
- sourceCount: number;
915
- }
916
- interface UsageTiming {
917
- apiMs: number;
918
- agentMs: number;
919
- linesAdded: number;
920
- linesRemoved: number;
921
- }
922
- interface UsageActivity {
923
- activeMinutes: number;
924
- agentMinutes: number;
925
- tokens: number;
926
- costUsd: number;
927
- tokensPerMinute: number;
928
- measuredSince: number;
929
- }
930
- interface UsageSummary {
931
- totals: UsageTotals;
932
- costUsd: number;
933
- byModel: UsageModelRow[];
934
- byKind: UsageKindRow[];
935
- bySubagentType: UsageSubagentTypeRow[];
936
- dispatchCount: number;
937
- operatorAttributionSince: number | null;
938
- timing: UsageTiming;
939
- timingMeasuredSince: number | null;
940
- activity: UsageActivity | null;
941
- }
942
- type UsageErrorCode = "unattributable_dispatch" | "usage_inconsistent";
943
- interface UsageError {
944
- error: {
945
- code: UsageErrorCode;
946
- message: string;
947
- dispatchId: string;
948
- };
949
- }
950
- type CardUsage = UsageSummary | UsageError | null;
951
-
952
874
  interface BehaviorDecisionView {
953
875
  readonly signoff_id: number;
954
876
  readonly status: Exclude<SlotStatus, "unverified">;
@@ -1049,6 +971,84 @@ declare module "@danxbot/card-kit@1" {
1049
971
  content: string;
1050
972
  }
1051
973
 
974
+ interface HolderAgentPause {
975
+ reason: string;
976
+ since: string;
977
+ until: string | null;
978
+ }
979
+
980
+ interface AgentIdentity {
981
+ id: number;
982
+ name: string;
983
+ avatar_url: string | null;
984
+ }
985
+ type AssignedAgentKind = "person" | "session" | "worker" | "label";
986
+
987
+ interface UsageTokenCounts {
988
+ input: number;
989
+ output: number;
990
+ cacheRead: number;
991
+ cacheWrite: number;
992
+ }
993
+ interface UsageSlice {
994
+ tokens: UsageTokenCounts;
995
+ costUsd: number;
996
+ }
997
+ interface UsageTotals extends UsageTokenCounts {
998
+ cacheWrite5m: number;
999
+ cacheWrite1h: number;
1000
+ cacheWriteUnsplit: number;
1001
+ }
1002
+ interface UsageModelRow extends UsageSlice {
1003
+ model: string | null;
1004
+ }
1005
+ type UsageKind = "work" | "operator-session" | `gate:${string}` | "triage" | "maintenance" | "chat" | "other";
1006
+ interface UsageKindRow extends UsageSlice {
1007
+ kind: UsageKind;
1008
+ label: string;
1009
+ }
1010
+ type UsageSubagentTypeKey = "main" | "unknown" | "unattributed" | `agent:${string}`;
1011
+ interface UsageSubagentTypeRow extends UsageSlice {
1012
+ key: UsageSubagentTypeKey;
1013
+ label: string;
1014
+ sourceCount: number;
1015
+ }
1016
+ interface UsageTiming {
1017
+ apiMs: number;
1018
+ agentMs: number;
1019
+ linesAdded: number;
1020
+ linesRemoved: number;
1021
+ }
1022
+ interface UsageActivity {
1023
+ activeMinutes: number;
1024
+ agentMinutes: number;
1025
+ tokens: number;
1026
+ costUsd: number;
1027
+ tokensPerMinute: number;
1028
+ measuredSince: number;
1029
+ }
1030
+ interface UsageSummary {
1031
+ totals: UsageTotals;
1032
+ costUsd: number;
1033
+ byModel: UsageModelRow[];
1034
+ byKind: UsageKindRow[];
1035
+ bySubagentType: UsageSubagentTypeRow[];
1036
+ dispatchCount: number;
1037
+ operatorAttributionSince: number | null;
1038
+ timing: UsageTiming;
1039
+ timingMeasuredSince: number | null;
1040
+ activity: UsageActivity | null;
1041
+ }
1042
+ type UsageErrorCode = "unattributable_dispatch" | "usage_inconsistent";
1043
+ interface UsageError {
1044
+ error: {
1045
+ code: UsageErrorCode;
1046
+ message: string;
1047
+ dispatchId: string;
1048
+ };
1049
+ }
1050
+ type CardUsage = UsageSummary | UsageError | null;
1051
+
1052
1052
  type NotificationText = {
1053
1053
  kind: "reason";
1054
1054
  reason: StatusReason;
@@ -1627,6 +1627,7 @@ declare module "@danxbot/card-kit@1" {
1627
1627
  assigned_agent: null | string;
1628
1628
  content_hash: string;
1629
1629
  retro?: undefined | RetroViewV2;
1630
+ behavior_policies?: undefined | CardBehaviorPoliciesView;
1630
1631
  stored_row?: undefined | IssueDisplayV2;
1631
1632
  stored_checklists?: undefined | Array<ChecklistWithItemsV2>;
1632
1633
  stored_attachments?: undefined | Array<IssueAttachmentV2>;
@@ -1669,7 +1670,6 @@ declare module "@danxbot/card-kit@1" {
1669
1670
  start_commit?: undefined | null | { at: string; sha: string | null; error: "no_repo" | "not_github_repo" | "no_token" | "github_refused" | "github_unreachable" | "unreadable_tip" | "unexpected" | null; error_detail: string | null; };
1670
1671
  problem_total?: undefined | number;
1671
1672
  evidence_record_total?: undefined | number;
1672
- behavior_policies?: undefined | CardBehaviorPoliciesView;
1673
1673
  behavior_signoffs?: undefined | CardBehaviorSignoffs;
1674
1674
  decision_record_total?: undefined | number;
1675
1675
  decision_record_page?: undefined | DecisionRecordPage;
@@ -1951,11 +1951,12 @@ declare module "@danxbot/card-kit@1" {
1951
1951
  conflict_on_ids: Array<string>;
1952
1952
  board_id: BoardRefNum;
1953
1953
  }>);
1954
- plans?: undefined | Array<{
1954
+ plans?: undefined | (Array<{
1955
1955
  id: PlanRefNum;
1956
1956
  ref: string;
1957
1957
  name: string;
1958
- }>;
1958
+ status: "planning" | "awaiting-session" | "building" | "awaiting-sign-off" | "awaiting-docs" | "complete";
1959
+ }>);
1959
1960
  mirrors?: undefined | (Array<{
1960
1961
  target_type: "trello" | "slack" | "asana" | "linear";
1961
1962
  target_url: string;
package/dist/cli.js CHANGED
@@ -4,10 +4,8 @@
4
4
  import { parseArgs } from "node:util";
5
5
 
6
6
  // src/publish/archive.ts
7
- import { execFile } from "node:child_process";
8
7
  import { lstat, readdir, readFile } from "node:fs/promises";
9
8
  import { join as join2, resolve } from "node:path";
10
- import { promisify } from "node:util";
11
9
 
12
10
  // node_modules/@isaacs/fs-minipass/dist/esm/index.js
13
11
  import EE from "events";
@@ -5796,8 +5794,31 @@ var mtimeFilter = (opt) => {
5796
5794
  ((opt.mtimeCache?.get(path8) ?? stat.mtime ?? 0) > (stat.mtime ?? 0));
5797
5795
  };
5798
5796
 
5797
+ // ../../src/util/hidden-process.mjs
5798
+ import * as cp from "node:child_process";
5799
+ import { promisify } from "node:util";
5800
+ function withWindowsHidden(args, optionsAfterArgs) {
5801
+ const out = [...args];
5802
+ let at = 1;
5803
+ if (optionsAfterArgs && (Array.isArray(out[1]) || (out[1] === void 0 || out[1] === null) && out.length > 2 && typeof out[2] !== "function")) {
5804
+ at = 2;
5805
+ }
5806
+ const given = out[at];
5807
+ if (given === void 0 || given === null) out[at] = { windowsHide: true };
5808
+ else if (typeof given === "function")
5809
+ out.splice(at, 0, { windowsHide: true });
5810
+ else out[at] = { ...given, windowsHide: true };
5811
+ return out;
5812
+ }
5813
+ var spawn2 = (...args) => cp.spawn(...withWindowsHidden(args, true));
5814
+ var execFileAsync = (...args) => promisify(cp.execFile)(...withWindowsHidden(args, true));
5815
+ var execAsync = (...args) => promisify(cp.exec)(...withWindowsHidden(args, false));
5816
+ var execFile2 = (...args) => cp.execFile(...withWindowsHidden(args, true));
5817
+ var exec2 = (...args) => cp.exec(...withWindowsHidden(args, false));
5818
+ execFile2[promisify.custom] = execFileAsync;
5819
+ exec2[promisify.custom] = execAsync;
5820
+
5799
5821
  // src/publish/archive.ts
5800
- var execFileAsync = promisify(execFile);
5801
5822
  var EXCLUDED_SEGMENTS = /* @__PURE__ */ new Set(["node_modules", ".git"]);
5802
5823
  var EXCLUDED_TOP_LEVEL = /* @__PURE__ */ new Set(["dist"]);
5803
5824
  var LOCKFILE_NAMES = [
@@ -5863,8 +5884,7 @@ function gitFailure(err) {
5863
5884
  async function gitFiles(dir) {
5864
5885
  try {
5865
5886
  await execFileAsync("git", ["rev-parse", "--is-inside-work-tree"], {
5866
- cwd: dir,
5867
- windowsHide: true
5887
+ cwd: dir
5868
5888
  });
5869
5889
  } catch (err) {
5870
5890
  if (err.code === 128 && /not a git repository/i.test(gitFailure(err)))
@@ -5878,7 +5898,7 @@ async function gitFiles(dir) {
5878
5898
  ({ stdout } = await execFileAsync(
5879
5899
  "git",
5880
5900
  ["ls-files", "-z", "--cached", "--others", "--exclude-standard"],
5881
- { cwd: dir, windowsHide: true, maxBuffer: 64 * 1024 * 1024 }
5901
+ { cwd: dir, maxBuffer: 64 * 1024 * 1024 }
5882
5902
  ));
5883
5903
  } catch (err) {
5884
5904
  throw new Error(
@@ -5920,7 +5940,6 @@ async function archiveSource(projectDir) {
5920
5940
  }
5921
5941
 
5922
5942
  // src/publish/build.ts
5923
- import { spawn } from "node:child_process";
5924
5943
  import { readFile as readFile2 } from "node:fs/promises";
5925
5944
  import { join as join3, resolve as resolve2 } from "node:path";
5926
5945
 
@@ -5965,9 +5984,8 @@ var BUILD_OUTPUT_TAIL_CHARS = 4e3;
5965
5984
  function runProjectBuild(projectDir) {
5966
5985
  return new Promise((resolvePromise, reject) => {
5967
5986
  let output = "";
5968
- const child = spawn("npm", ["run", "build"], {
5987
+ const child = spawn2("npm", ["run", "build"], {
5969
5988
  cwd: projectDir,
5970
- windowsHide: true,
5971
5989
  shell: process.platform === "win32",
5972
5990
  stdio: ["ignore", "pipe", "pipe"]
5973
5991
  });
package/dist/publish.js CHANGED
@@ -1,8 +1,6 @@
1
1
  // src/publish/archive.ts
2
- import { execFile } from "node:child_process";
3
2
  import { lstat, readdir, readFile } from "node:fs/promises";
4
3
  import { join as join2, resolve } from "node:path";
5
- import { promisify } from "node:util";
6
4
 
7
5
  // node_modules/@isaacs/fs-minipass/dist/esm/index.js
8
6
  import EE from "events";
@@ -5791,8 +5789,31 @@ var mtimeFilter = (opt) => {
5791
5789
  ((opt.mtimeCache?.get(path8) ?? stat.mtime ?? 0) > (stat.mtime ?? 0));
5792
5790
  };
5793
5791
 
5792
+ // ../../src/util/hidden-process.mjs
5793
+ import * as cp from "node:child_process";
5794
+ import { promisify } from "node:util";
5795
+ function withWindowsHidden(args, optionsAfterArgs) {
5796
+ const out = [...args];
5797
+ let at = 1;
5798
+ if (optionsAfterArgs && (Array.isArray(out[1]) || (out[1] === void 0 || out[1] === null) && out.length > 2 && typeof out[2] !== "function")) {
5799
+ at = 2;
5800
+ }
5801
+ const given = out[at];
5802
+ if (given === void 0 || given === null) out[at] = { windowsHide: true };
5803
+ else if (typeof given === "function")
5804
+ out.splice(at, 0, { windowsHide: true });
5805
+ else out[at] = { ...given, windowsHide: true };
5806
+ return out;
5807
+ }
5808
+ var spawn2 = (...args) => cp.spawn(...withWindowsHidden(args, true));
5809
+ var execFileAsync = (...args) => promisify(cp.execFile)(...withWindowsHidden(args, true));
5810
+ var execAsync = (...args) => promisify(cp.exec)(...withWindowsHidden(args, false));
5811
+ var execFile2 = (...args) => cp.execFile(...withWindowsHidden(args, true));
5812
+ var exec2 = (...args) => cp.exec(...withWindowsHidden(args, false));
5813
+ execFile2[promisify.custom] = execFileAsync;
5814
+ exec2[promisify.custom] = execAsync;
5815
+
5794
5816
  // src/publish/archive.ts
5795
- var execFileAsync = promisify(execFile);
5796
5817
  var EXCLUDED_SEGMENTS = /* @__PURE__ */ new Set(["node_modules", ".git"]);
5797
5818
  var EXCLUDED_TOP_LEVEL = /* @__PURE__ */ new Set(["dist"]);
5798
5819
  var LOCKFILE_NAMES = [
@@ -5858,8 +5879,7 @@ function gitFailure(err) {
5858
5879
  async function gitFiles(dir) {
5859
5880
  try {
5860
5881
  await execFileAsync("git", ["rev-parse", "--is-inside-work-tree"], {
5861
- cwd: dir,
5862
- windowsHide: true
5882
+ cwd: dir
5863
5883
  });
5864
5884
  } catch (err) {
5865
5885
  if (err.code === 128 && /not a git repository/i.test(gitFailure(err)))
@@ -5873,7 +5893,7 @@ async function gitFiles(dir) {
5873
5893
  ({ stdout } = await execFileAsync(
5874
5894
  "git",
5875
5895
  ["ls-files", "-z", "--cached", "--others", "--exclude-standard"],
5876
- { cwd: dir, windowsHide: true, maxBuffer: 64 * 1024 * 1024 }
5896
+ { cwd: dir, maxBuffer: 64 * 1024 * 1024 }
5877
5897
  ));
5878
5898
  } catch (err) {
5879
5899
  throw new Error(
@@ -5915,7 +5935,6 @@ async function archiveSource(projectDir) {
5915
5935
  }
5916
5936
 
5917
5937
  // src/publish/build.ts
5918
- import { spawn } from "node:child_process";
5919
5938
  import { readFile as readFile2 } from "node:fs/promises";
5920
5939
  import { join as join3, resolve as resolve2 } from "node:path";
5921
5940
 
@@ -5960,9 +5979,8 @@ var BUILD_OUTPUT_TAIL_CHARS = 4e3;
5960
5979
  function runProjectBuild(projectDir) {
5961
5980
  return new Promise((resolvePromise, reject) => {
5962
5981
  let output = "";
5963
- const child = spawn("npm", ["run", "build"], {
5982
+ const child = spawn2("npm", ["run", "build"], {
5964
5983
  cwd: projectDir,
5965
- windowsHide: true,
5966
5984
  shell: process.platform === "win32",
5967
5985
  stdio: ["ignore", "pipe", "pipe"]
5968
5986
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@50arms/plugin-sdk",
3
- "version": "0.2.74",
3
+ "version": "0.2.75",
4
4
  "description": "SDK for building 50 Arms plugins (DX-5170): the card kit's type declarations, the Widget declaration kit, a Vite preset that builds a plugin against the app's shared runtime and writes its manifest, and the danx-plugin CLI.",
5
5
  "license": "MIT",
6
6
  "type": "module",