@50arms/plugin-sdk 0.2.59 → 0.2.61

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.
@@ -4,6 +4,8 @@ declare module "@danxbot/card-kit@1" {
4
4
  import { ReactNode } from 'react';
5
5
  export { Link, useNavigate } from 'react-router';
6
6
 
7
+ type RiskScore = "R0" | "R1" | "R2" | "R3" | "R4";
8
+
7
9
  const BOARD_ID: unique symbol;
8
10
  const CARD_ID: unique symbol;
9
11
  type BoardId = number & {
@@ -28,43 +30,17 @@ declare module "@danxbot/card-kit@1" {
28
30
  }
29
31
 
30
32
  type CardTypeKey = string;
31
- type MirrorProviderId = "trello" | "slack" | "asana" | "linear";
32
- type SourceOrigin = "danxbot" | MirrorProviderId | "";
33
33
 
34
- type ListType$1 = "and" | "or" | "semicolon";
35
- interface ListValue<Item> {
36
- list: readonly Item[];
37
- type?: ListType$1;
38
- }
39
- interface RepoProfileCopy {
40
- shipped: string;
41
- repo: string;
42
- }
43
- type ProfileNameId = string;
44
- type ProfileName = StatusReason | ProfileNameMessage;
45
- type StatusReasonId = string;
46
- type StatusReasonValues = Record<string, string | number | boolean | null | StatusReason | ProfileNameMessage | StatusReasonSentences | StatusReasonLines | StatusReasonList>;
47
- interface ProfileNameMessage {
48
- id: ProfileNameId;
49
- values: StatusReasonValues;
50
- }
51
- type StatusReasonList = ListValue<string | number | StatusReason | ProfileNameMessage>;
52
- interface StatusReasonLines {
53
- lines: StatusReason[];
54
- }
55
- interface StatusReasonSentences {
56
- sentences: StatusReason[];
57
- }
58
- interface StatusReason {
59
- id: StatusReasonId;
60
- values: StatusReasonValues;
34
+ interface Justification {
35
+ quote: string;
36
+ reasoning: string;
61
37
  }
38
+ type MirrorProviderId = "trello" | "slack" | "asana" | "linear";
39
+ type SourceOrigin = "danxbot" | MirrorProviderId | "";
62
40
  type DecisionRecordKind = "business_rule" | "architecture" | "design" | "other";
63
41
  type DecisionRecordAction = "created" | "changed" | "deleted" | "restored";
64
42
  type DecisionMadeBy = "human" | "agent";
65
43
  type DecisionApprovalAction = "approve" | "unapprove";
66
- type ProvenanceSourceKind = "card" | "comment" | "session_thread" | "problem" | "url";
67
- type ProvenancePartyKind = "agent" | "person";
68
44
 
69
45
  interface DecisionApprovalState {
70
46
  approved: boolean;
@@ -97,18 +73,44 @@ declare module "@danxbot/card-kit@1" {
97
73
  version_no: number;
98
74
  approval: DecisionApprovalState;
99
75
  }
100
- interface DecisionRecordPage {
101
- offset: number;
102
- target_found: boolean | null;
76
+ interface RepoProfileCopy {
77
+ shipped: string;
78
+ repo: string;
79
+ }
80
+ type ProfileNameId = string;
81
+ type ProfileName = StatusReason | ProfileNameMessage;
82
+
83
+ type ListType$1 = "and" | "or" | "semicolon";
84
+ interface ListValue<Item> {
85
+ list: readonly Item[];
86
+ type?: ListType$1;
87
+ }
88
+ type StatusReasonId = string;
89
+ type StatusReasonValues = Record<string, string | number | boolean | null | StatusReason | ProfileNameMessage | StatusReasonSentences | StatusReasonLines | StatusReasonList>;
90
+ interface ProfileNameMessage {
91
+ id: ProfileNameId;
92
+ values: StatusReasonValues;
93
+ }
94
+ type StatusReasonList = ListValue<string | number | StatusReason | ProfileNameMessage>;
95
+ interface StatusReasonLines {
96
+ lines: StatusReason[];
97
+ }
98
+ interface StatusReasonSentences {
99
+ sentences: StatusReason[];
100
+ }
101
+ interface StatusReason {
102
+ id: StatusReasonId;
103
+ values: StatusReasonValues;
103
104
  }
104
105
  type PacingLimit = "five_hour" | "weekly" | "spend";
105
- type ResourceType = "plan" | "design" | "problem" | "issue" | "plan_record" | "plan_section" | "decision";
106
+ type ProvenanceSourceKind = "card" | "comment" | "session_thread" | "problem" | "url";
107
+ type ProvenancePartyKind = "agent" | "person";
108
+ type ResourceType = "design" | "plan" | "problem" | "issue" | "plan_record" | "plan_section" | "decision";
106
109
  interface ResourceRef {
107
110
  type: ResourceType;
108
111
  id: string;
109
112
  }
110
- type RiskScore = "R0" | "R1" | "R2" | "R3" | "R4";
111
- type WorkMarkResourceType = "plan" | "design" | "problem" | "issue" | "plan_record" | "plan_section" | "decision";
113
+ type WorkMarkResourceType = "design" | "plan" | "problem" | "plan_record" | "plan_section" | "decision";
112
114
  interface WorkMarkResource extends ResourceRef {
113
115
  type: WorkMarkResourceType;
114
116
  }
@@ -170,6 +172,10 @@ declare module "@danxbot/card-kit@1" {
170
172
  compare_url: string | null;
171
173
  updated_at: string;
172
174
  }
175
+ interface DecisionRecordPage {
176
+ offset: number;
177
+ target_found: boolean | null;
178
+ }
173
179
  type BrowserCheckStatus = "checked" | "not_checked" | "not_recorded";
174
180
 
175
181
  type ListType = "archived" | "review" | "ready" | "in_progress" | "completed" | "cancelled";
@@ -200,6 +206,7 @@ declare module "@danxbot/card-kit@1" {
200
206
  answers_decision: V2CopyDecisionRef | null;
201
207
  tags: V2CopyCommentTag[];
202
208
  sign_off: V2CopySignOff | null;
209
+ quoted_request: V2CopyProvenanceRecord | null;
203
210
  team_agent: string | null;
204
211
  author_email: string | null;
205
212
  created_at: string;
@@ -286,6 +293,7 @@ declare module "@danxbot/card-kit@1" {
286
293
  interface V2CopyAgentNote {
287
294
  author: string;
288
295
  text: string;
296
+ reduced_text: string | null;
289
297
  team_agent: string | null;
290
298
  metadata: Record<string, unknown> | null;
291
299
  ordinal: number;
@@ -584,6 +592,39 @@ declare module "@danxbot/card-kit@1" {
584
592
  text: string;
585
593
  };
586
594
 
595
+ interface CompactionJobWho {
596
+ name: string;
597
+ avatar_url: string | null;
598
+ profile: string | null;
599
+ }
600
+ type CompactionJobWhere = {
601
+ kind: "worker";
602
+ worker: string;
603
+ } | {
604
+ kind: "session";
605
+ session: string;
606
+ };
607
+ interface CompactionFigures {
608
+ tool_calls: number;
609
+ turns: number;
610
+ spend_usd: number;
611
+ }
612
+ interface CompactionJobProgress {
613
+ dispatch_id: string;
614
+ baseline: CompactionFigures;
615
+ now: CompactionFigures;
616
+ }
617
+ interface CompactionJob {
618
+ who: CompactionJobWho;
619
+ where: CompactionJobWhere;
620
+ started_at: string;
621
+ progress: CompactionJobProgress | null;
622
+ }
623
+ interface CompactionSizes {
624
+ before_tokens: number | null;
625
+ after_tokens: number | null;
626
+ }
627
+
587
628
  type PreGateHold = {
588
629
  kind: "awaiting_person";
589
630
  } | {
@@ -689,9 +730,10 @@ declare module "@danxbot/card-kit@1" {
689
730
  dispatch_key_blockers: DispatchKeyBlocker[];
690
731
  worker_readiness_blockers: ReadinessBlocker[];
691
732
  agent_wait: StatusReason | null;
733
+ orchestrator_profile: string | null;
692
734
  }
693
735
  type CardContextCategoryKey = "comments" | "checklists" | "content" | "agent_notes" | "problems" | "decisions" | "designs";
694
- type PlanContextCategoryKey = "comments" | "architecture" | "records" | "notes" | "open_cards";
736
+ type PlanContextCategoryKey = "architecture" | "comments" | "heading" | "records" | "notes" | "open_cards";
695
737
  type ContextCategoryKey = CardContextCategoryKey | PlanContextCategoryKey;
696
738
  interface ContextCategorySize {
697
739
  key: ContextCategoryKey;
@@ -841,6 +883,7 @@ declare module "@danxbot/card-kit@1" {
841
883
  metadata?: unknown;
842
884
  answers_decision_id?: undefined | null | number;
843
885
  sign_off?: undefined | null | CommentSignOffViewV2;
886
+ quoted_request?: undefined | null | ProvenanceRecordV2;
844
887
  tags: Array<{ kind: "problem"; ref: number; } | { kind: "design"; ref: number; } | { kind: "decision"; ref: number; }>;
845
888
  resource_tags: Array<CommentResourceTag>;
846
889
  parent_comment_id: null | number;
@@ -860,10 +903,10 @@ declare module "@danxbot/card-kit@1" {
860
903
  thumbnail_error: null | string;
861
904
  created_at: string;
862
905
  }>);
863
- description?: undefined | string;
864
- type: string;
865
906
  title: string;
907
+ description?: undefined | string;
866
908
  status: "Cancelled" | "Review" | "ToDo" | "In Progress" | "Backlog" | "Done";
909
+ type: string;
867
910
  priority: number;
868
911
  agent_notes?: undefined | (Array<{
869
912
  id: string;
@@ -873,6 +916,8 @@ declare module "@danxbot/card-kit@1" {
873
916
  timestamp: string;
874
917
  updated_at: string;
875
918
  text: string;
919
+ reduced?: undefined | true;
920
+ reduced_text?: undefined | null | string;
876
921
  metadata: unknown;
877
922
  }>);
878
923
  designs?: undefined | (Array<{
@@ -936,6 +981,7 @@ declare module "@danxbot/card-kit@1" {
936
981
  blocked?: undefined | null | { at: string; reason: string; by: AuthorV2 | null; };
937
982
  board_id?: undefined | BoardRefNum;
938
983
  ready_at?: undefined | null | string;
984
+ started_at?: undefined | null | string;
939
985
  archived_at?: undefined | null | string;
940
986
  completed_at?: undefined | null | string;
941
987
  cancelled_at?: undefined | null | string;
@@ -959,7 +1005,9 @@ declare module "@danxbot/card-kit@1" {
959
1005
  pull_request_url?: undefined | null | string;
960
1006
  risk_score?: undefined | null | "R0" | "R1" | "R2" | "R3" | "R4";
961
1007
  risk_reason?: undefined | null | string;
1008
+ risk_set?: undefined | null | { at: string; by: AuthorV2; };
962
1009
  risk_raise_reason?: undefined | null | string;
1010
+ justification?: undefined | null | Justification;
963
1011
  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; };
964
1012
  problem_total?: undefined | number;
965
1013
  decision_record_total?: undefined | number;
@@ -1003,7 +1051,7 @@ declare module "@danxbot/card-kit@1" {
1003
1051
  unread_comments_count?: undefined | number;
1004
1052
  unread_decision_comment_counts?: undefined | Record<string, number>;
1005
1053
  context_size?: undefined | ContextSize;
1006
- content_compaction?: undefined | null | { requested_at: string; } & { status: "waiting" | "working"; ended_at: null; failure_reason: null; } | { requested_at: string; } & { status: "done"; ended_at: string; failure_reason: null; } | { requested_at: string; } & { status: "failed"; ended_at: string; failure_reason: NotificationText; };
1054
+ content_compaction?: undefined | null | { id: number; requested_at: string; } & { status: "waiting"; ended_at: null; failure_reason: null; } | { id: number; requested_at: string; } & { status: "working"; ended_at: null; failure_reason: null; job: CompactionJob; } | { id: number; requested_at: string; } & { status: "done"; ended_at: string; failure_reason: null; sizes: CompactionSizes; } | { id: number; requested_at: string; } & { status: "failed"; ended_at: string; failure_reason: NotificationText; };
1007
1055
  agent_notes_count?: undefined | number;
1008
1056
  comment_recipient?: undefined | { kind: "agent"; by: AuthorV2; reachability: CommentReachabilityV2; } | { kind: "none"; waiting_on: { kind: "plan"; id: PlanRefNum; ref: string; name: string; } | { kind: "card"; id: string; }; };
1009
1057
  comment_tags?: undefined | Array<CommentTagOption>;
@@ -1027,13 +1075,13 @@ declare module "@danxbot/card-kit@1" {
1027
1075
  copy_payload?: undefined | V2CopyPayload;
1028
1076
  copy_issue?: undefined | V2CopyIssue;
1029
1077
  decision_records?: undefined | (Array<{
1030
- made_by: "human" | "agent";
1078
+ title: string;
1031
1079
  kind: "business_rule" | "architecture" | "design" | "other";
1080
+ action: "created" | "changed" | "deleted" | "restored";
1081
+ made_by: "human" | "agent";
1032
1082
  approved: boolean;
1033
1083
  impact: number;
1034
1084
  confidence: number;
1035
- title: string;
1036
- action: "created" | "changed" | "deleted" | "restored";
1037
1085
  rev: number;
1038
1086
  created_at: string;
1039
1087
  updated_at: string;
@@ -1055,12 +1103,12 @@ declare module "@danxbot/card-kit@1" {
1055
1103
  comment_count: number;
1056
1104
  unread_comment_count: number;
1057
1105
  versions?: undefined | (Array<{
1058
- made_by: "human" | "agent";
1106
+ title: string;
1059
1107
  kind: "business_rule" | "architecture" | "design" | "other";
1108
+ action: "created" | "changed" | "deleted" | "restored";
1109
+ made_by: "human" | "agent";
1060
1110
  impact: number;
1061
1111
  confidence: number;
1062
- title: string;
1063
- action: "created" | "changed" | "deleted" | "restored";
1064
1112
  id: number;
1065
1113
  created_at: string;
1066
1114
  author: string;
@@ -1087,12 +1135,12 @@ declare module "@danxbot/card-kit@1" {
1087
1135
  }>);
1088
1136
  }>);
1089
1137
  decision_record_versions?: undefined | (Array<{
1090
- made_by: "human" | "agent";
1138
+ title: string;
1091
1139
  kind: "business_rule" | "architecture" | "design" | "other";
1140
+ action: "created" | "changed" | "deleted" | "restored";
1141
+ made_by: "human" | "agent";
1092
1142
  impact: number;
1093
1143
  confidence: number;
1094
- title: string;
1095
- action: "created" | "changed" | "deleted" | "restored";
1096
1144
  id: number;
1097
1145
  created_at: string;
1098
1146
  author: string;
@@ -1126,14 +1174,6 @@ declare module "@danxbot/card-kit@1" {
1126
1174
  started_at: string;
1127
1175
  expires_at: string;
1128
1176
  }>;
1129
- gate_follow_ups?: undefined | (Array<{
1130
- id: number;
1131
- label: string;
1132
- gate: string;
1133
- round: number;
1134
- stacked_to: null | string;
1135
- stacked_at: null | string;
1136
- }>);
1137
1177
  pull_request_reviews?: undefined | (Array<{
1138
1178
  id: number;
1139
1179
  kind: "comment" | "review" | "thread";
@@ -1148,8 +1188,8 @@ declare module "@danxbot/card-kit@1" {
1148
1188
  }>);
1149
1189
  changed_fields?: undefined | Array<string>;
1150
1190
  children_detail?: undefined | (Array<{
1151
- type: string;
1152
1191
  status: "Cancelled" | "Review" | "ToDo" | "In Progress" | "Backlog" | "Done";
1192
+ type: string;
1153
1193
  priority: number;
1154
1194
  name: string;
1155
1195
  id: string;
@@ -1171,10 +1211,10 @@ declare module "@danxbot/card-kit@1" {
1171
1211
  target_type: "trello" | "slack" | "asana" | "linear";
1172
1212
  target_url: string;
1173
1213
  sync_state: "synced" | "out_of_sync" | "error" | "dead" | "unavailable" | "diverged";
1174
- dead_reason: "" | "deleted" | "archived";
1214
+ dead_reason: "" | "deleted" | "archived" | "left";
1175
1215
  source_ref: string;
1176
1216
  last_error: null | StatusReason;
1177
- owed: Array<"comments" | "checklists" | "attachments" | "description" | "type" | "title" | "status" | "priority" | "parent_child" | "dependencies" | "card_create" | "card_delete">;
1217
+ owed: Array<"comments" | "checklists" | "attachments" | "title" | "description" | "status" | "type" | "priority" | "parent_child" | "dependencies" | "card_create" | "card_delete">;
1178
1218
  description_unreadable: boolean;
1179
1219
  target_ref: string;
1180
1220
  target_label: string;
@@ -1281,12 +1321,12 @@ declare module "@danxbot/card-kit@1" {
1281
1321
  answered_version_no: null | number;
1282
1322
  choices: Array<{ solution_id: number; kind: DecisionReviewChoiceKind; version_no: number; title: string; }>;
1283
1323
  versions?: undefined | (Array<{
1284
- made_by: "human" | "agent";
1324
+ title: string;
1285
1325
  kind: "business_rule" | "architecture" | "design" | "other";
1326
+ action: "created" | "changed" | "deleted" | "restored";
1327
+ made_by: "human" | "agent";
1286
1328
  impact: number;
1287
1329
  confidence: number;
1288
- title: string;
1289
- action: "created" | "changed" | "deleted" | "restored";
1290
1330
  id: number;
1291
1331
  created_at: string;
1292
1332
  author: string;
@@ -1425,7 +1465,14 @@ declare module "@danxbot/card-kit@1" {
1425
1465
  pull_request_url: string | null;
1426
1466
  risk_score: RiskScore | null;
1427
1467
  risk_reason: string | null;
1468
+ risk_set_at: string | null;
1469
+ risk_set_by: string | null;
1470
+ risk_set_via_key_id: number | null;
1471
+ risk_set_via_key_name: string | null;
1472
+ risk_set_team_agent_id: number | null;
1428
1473
  risk_raise_reason: string | null;
1474
+ justification_quote: string | null;
1475
+ justification_reasoning: string | null;
1429
1476
  start_commit_sha: string | null;
1430
1477
  start_commit_at: string | null;
1431
1478
  start_commit_error: StartCommitError | null;
package/dist/publish.d.ts CHANGED
@@ -37,6 +37,11 @@ type ValueField = {
37
37
  readonly enum?: readonly string[];
38
38
  /** The words for each option of `enum`, by option id; present exactly when `enum` is, naming every option and no other. The stored value is the id. */
39
39
  readonly optionLabels?: Readonly<Record<string, FieldText>>;
40
+ /**
41
+ * DX-7112: the value is the id of one of the team's things, chosen from them in the Configure form instead of typed (a machine's id). The server checks the value as any text; an empty default means none is chosen yet.
42
+ * Not with `enum`: a field offers either its own fixed options or a team's things.
43
+ */
44
+ readonly source?: "machine";
40
45
  } | {
41
46
  readonly type: "number";
42
47
  readonly label: FieldText;
package/dist/vite.d.ts CHANGED
@@ -29,6 +29,11 @@ type ValueField = {
29
29
  readonly enum?: readonly string[];
30
30
  /** The words for each option of `enum`, by option id; present exactly when `enum` is, naming every option and no other. The stored value is the id. */
31
31
  readonly optionLabels?: Readonly<Record<string, FieldText>>;
32
+ /**
33
+ * DX-7112: the value is the id of one of the team's things, chosen from them in the Configure form instead of typed (a machine's id). The server checks the value as any text; an empty default means none is chosen yet.
34
+ * Not with `enum`: a field offers either its own fixed options or a team's things.
35
+ */
36
+ readonly source?: "machine";
32
37
  } | {
33
38
  readonly type: "number";
34
39
  readonly label: FieldText;
package/dist/vite.js CHANGED
@@ -150,6 +150,8 @@ function labelIssues(schema) {
150
150
  for (const [name, field] of Object.entries(schema)) {
151
151
  if (blank(field.label)) issues.push(`field "${name}" has an empty label`);
152
152
  if (field.type !== "string") continue;
153
+ if (field.source !== void 0 && field.enum !== void 0)
154
+ issues.push(`field "${name}" offers options and a source of them`);
153
155
  const options = field.enum ?? [];
154
156
  const labelled = Object.keys(field.optionLabels ?? {});
155
157
  if (field.enum !== void 0 && field.optionLabels === void 0)
package/dist/widgets.d.ts CHANGED
@@ -34,6 +34,11 @@ type ValueField = {
34
34
  readonly enum?: readonly string[];
35
35
  /** The words for each option of `enum`, by option id; present exactly when `enum` is, naming every option and no other. The stored value is the id. */
36
36
  readonly optionLabels?: Readonly<Record<string, FieldText>>;
37
+ /**
38
+ * DX-7112: the value is the id of one of the team's things, chosen from them in the Configure form instead of typed (a machine's id). The server checks the value as any text; an empty default means none is chosen yet.
39
+ * Not with `enum`: a field offers either its own fixed options or a team's things.
40
+ */
41
+ readonly source?: "machine";
37
42
  } | {
38
43
  readonly type: "number";
39
44
  readonly label: FieldText;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@50arms/plugin-sdk",
3
- "version": "0.2.59",
3
+ "version": "0.2.61",
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",
@@ -50,7 +50,7 @@
50
50
  "test": "vitest run"
51
51
  },
52
52
  "devDependencies": {
53
- "@50arms/ui": "36.4.2",
53
+ "@50arms/ui": "36.7.0",
54
54
  "@types/node": "^22.0.0",
55
55
  "@types/react": "^19.2.2",
56
56
  "esbuild": "^0.25.0",