@50arms/plugin-sdk 0.2.60 → 0.2.62

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.
@@ -103,9 +103,9 @@ declare module "@danxbot/card-kit@1" {
103
103
  values: StatusReasonValues;
104
104
  }
105
105
  type PacingLimit = "five_hour" | "weekly" | "spend";
106
- type ProvenanceSourceKind = "card" | "comment" | "session_thread" | "problem" | "url";
106
+ type ProvenanceSourceKind = "card" | "comment" | "session_thread" | "problem" | "url" | "evidence";
107
107
  type ProvenancePartyKind = "agent" | "person";
108
- type ResourceType = "design" | "plan" | "problem" | "issue" | "plan_record" | "plan_section" | "decision";
108
+ type ResourceType = "design" | "plan" | "problem" | "evidence" | "issue" | "plan_record" | "plan_section" | "decision";
109
109
  interface ResourceRef {
110
110
  type: ResourceType;
111
111
  id: string;
@@ -176,6 +176,115 @@ declare module "@danxbot/card-kit@1" {
176
176
  offset: number;
177
177
  target_found: boolean | null;
178
178
  }
179
+ type EvidenceBlockType = "note" | "steps" | "command" | "table";
180
+ type EvidenceMadeBy = "human" | "agent";
181
+ type EvidenceColumnType = "number" | "boolean" | "text" | "date";
182
+ type EvidenceAttachmentRole = "file" | "csv";
183
+
184
+ interface EvidenceColumn {
185
+ name: string;
186
+ type: EvidenceColumnType;
187
+ unit: string | null;
188
+ }
189
+ type EvidenceCell = string | number | boolean | null;
190
+ interface EvidenceNoteData {
191
+ markdown: string;
192
+ }
193
+ interface EvidenceStepsData {
194
+ steps: Array<{
195
+ text: string;
196
+ expected: string | null;
197
+ actual: string | null;
198
+ }>;
199
+ }
200
+ interface EvidenceTableRows {
201
+ columns: EvidenceColumn[];
202
+ rows: EvidenceCell[][];
203
+ }
204
+ interface EvidenceCommandData {
205
+ command: string;
206
+ language: string;
207
+ exit_code: number | null;
208
+ output: {
209
+ kind: "text";
210
+ text: string;
211
+ } | ({
212
+ kind: "table";
213
+ } & EvidenceTableRows);
214
+ }
215
+ interface EvidenceTableData extends EvidenceTableRows {
216
+ source: "inline" | "csv";
217
+ }
218
+ interface EvidenceBlockDataByType {
219
+ note: EvidenceNoteData;
220
+ steps: EvidenceStepsData;
221
+ command: EvidenceCommandData;
222
+ table: EvidenceTableData;
223
+ }
224
+ interface EvidenceWriterView {
225
+ author: string;
226
+ by: AuthorV2;
227
+ via_key: ViaKey | null;
228
+ created_at: string;
229
+ }
230
+ interface EvidenceMakerView {
231
+ made_by: EvidenceMadeBy;
232
+ made_by_user_id: number | null;
233
+ made_by_name: string | null;
234
+ made_by_author: AuthorV2;
235
+ made_by_is_writer: boolean;
236
+ }
237
+ interface EvidenceExhibitView {
238
+ key: string;
239
+ letter: string;
240
+ title: string;
241
+ block_type: EvidenceBlockType;
242
+ method: string;
243
+ }
244
+ interface EvidenceHypothesisVersionView extends EvidenceWriterView, EvidenceMakerView {
245
+ id: number;
246
+ version_no: number;
247
+ question: string;
248
+ expected_answer: string;
249
+ exhibits: EvidenceExhibitView[];
250
+ reasoning: string;
251
+ confidence: number;
252
+ }
253
+ interface EvidenceVerdictVersionView extends EvidenceWriterView, EvidenceMakerView {
254
+ id: number;
255
+ version_no: number;
256
+ answer: string;
257
+ confidence: number;
258
+ reasoning: string;
259
+ cites: string[];
260
+ }
261
+ interface EvidenceBlockAttachmentView {
262
+ role: EvidenceAttachmentRole;
263
+ attachment_id: number | null;
264
+ filename: string | null;
265
+ content_type: string | null;
266
+ size_bytes: number | null;
267
+ removed: boolean;
268
+ }
269
+ interface EvidenceBlockViewBase<T extends EvidenceBlockType> {
270
+ block_no: number;
271
+ label: string;
272
+ ref: string;
273
+ round_no: number;
274
+ type: T;
275
+ data: EvidenceBlockDataByType[T];
276
+ caption: string | null;
277
+ exhibit_key: string | null;
278
+ generic_reason: string | null;
279
+ attachments: EvidenceBlockAttachmentView[];
280
+ }
281
+ interface EvidenceExhibitStatusView {
282
+ key: string;
283
+ letter: string;
284
+ title: string;
285
+ block_count: number;
286
+ gathered: boolean;
287
+ }
179
288
  type BrowserCheckStatus = "checked" | "not_checked" | "not_recorded";
180
289
 
181
290
  type ListType = "archived" | "review" | "ready" | "in_progress" | "completed" | "cancelled";
@@ -206,6 +315,7 @@ declare module "@danxbot/card-kit@1" {
206
315
  answers_decision: V2CopyDecisionRef | null;
207
316
  tags: V2CopyCommentTag[];
208
317
  sign_off: V2CopySignOff | null;
318
+ quoted_request: V2CopyProvenanceRecord | null;
209
319
  team_agent: string | null;
210
320
  author_email: string | null;
211
321
  created_at: string;
@@ -292,6 +402,7 @@ declare module "@danxbot/card-kit@1" {
292
402
  interface V2CopyAgentNote {
293
403
  author: string;
294
404
  text: string;
405
+ reduced_text: string | null;
295
406
  team_agent: string | null;
296
407
  metadata: Record<string, unknown> | null;
297
408
  ordinal: number;
@@ -327,6 +438,67 @@ declare module "@danxbot/card-kit@1" {
327
438
  ref_num: number;
328
439
  versions: V2CopyDecisionVersion[];
329
440
  }
441
+ interface V2CopyEvidenceMaker {
442
+ made_by: EvidenceMadeBy;
443
+ made_by_email: string | null;
444
+ made_by_name: string | null;
445
+ made_by_team_agent: string | null;
446
+ author: string;
447
+ team_agent: string | null;
448
+ created_at: string;
449
+ }
450
+ interface V2CopyEvidenceExhibit {
451
+ key: string;
452
+ title: string;
453
+ block_type: EvidenceBlockType;
454
+ method: string;
455
+ }
456
+ interface V2CopyEvidenceHypothesisVersion extends V2CopyEvidenceMaker {
457
+ version_no: number;
458
+ question: string;
459
+ expected_answer: string;
460
+ reasoning: string;
461
+ confidence: number;
462
+ exhibits: V2CopyEvidenceExhibit[];
463
+ }
464
+ interface V2CopyEvidenceVerdictVersion extends V2CopyEvidenceMaker {
465
+ version_no: number;
466
+ answer: string;
467
+ confidence: number;
468
+ reasoning: string;
469
+ cites: number[];
470
+ }
471
+ interface V2CopyEvidenceBlockAttachment {
472
+ role: EvidenceAttachmentRole;
473
+ attachment_index: number | null;
474
+ }
475
+ interface V2CopyEvidenceBlock {
476
+ block_no: number;
477
+ type: EvidenceBlockType;
478
+ data: Record<string, unknown>;
479
+ caption: string | null;
480
+ exhibit_key: string | null;
481
+ generic_reason: string | null;
482
+ attachments: V2CopyEvidenceBlockAttachment[];
483
+ }
484
+ interface V2CopyEvidenceRound {
485
+ round_no: number;
486
+ hypothesis_version: number;
487
+ environment: string;
488
+ commit_sha: string;
489
+ author: string;
490
+ team_agent: string | null;
491
+ created_at: string;
492
+ blocks: V2CopyEvidenceBlock[];
493
+ }
494
+ interface V2CopyEvidenceRecord {
495
+ ref_num: number;
496
+ last_exhibit_no: number;
497
+ created_at: string;
498
+ hypothesis_versions: V2CopyEvidenceHypothesisVersion[];
499
+ rounds: V2CopyEvidenceRound[];
500
+ verdict_versions: V2CopyEvidenceVerdictVersion[];
501
+ }
330
502
  interface V2CopyAc {
331
503
  title: string;
332
504
  checked: boolean;
@@ -431,6 +603,7 @@ declare module "@danxbot/card-kit@1" {
431
603
  ref: string;
432
604
  comment_index: number | null;
433
605
  problem_index: number | null;
606
+ evidence_index: number | null;
434
607
  card_linked: boolean;
435
608
  author: V2CopyProvenanceParty | null;
436
609
  at: string | null;
@@ -475,6 +648,7 @@ declare module "@danxbot/card-kit@1" {
475
648
  comments: V2CopyComment[];
476
649
  agent_notes: V2CopyAgentNote[];
477
650
  decision_records: V2CopyDecisionRecord[];
651
+ evidence_records: V2CopyEvidenceRecord[];
478
652
  created_tags: V2CopyCommentTag[];
479
653
  dependencies: V2CopyDependency[];
480
654
  retro: V2CopyRetro | null;
@@ -590,6 +764,39 @@ declare module "@danxbot/card-kit@1" {
590
764
  text: string;
591
765
  };
592
766
 
767
+ interface CompactionJobWho {
768
+ name: string;
769
+ avatar_url: string | null;
770
+ profile: string | null;
771
+ }
772
+ type CompactionJobWhere = {
773
+ kind: "worker";
774
+ worker: string;
775
+ } | {
776
+ kind: "session";
777
+ session: string;
778
+ };
779
+ interface CompactionFigures {
780
+ tool_calls: number;
781
+ turns: number;
782
+ spend_usd: number;
783
+ }
784
+ interface CompactionJobProgress {
785
+ dispatch_id: string;
786
+ baseline: CompactionFigures;
787
+ now: CompactionFigures;
788
+ }
789
+ interface CompactionJob {
790
+ who: CompactionJobWho;
791
+ where: CompactionJobWhere;
792
+ started_at: string;
793
+ progress: CompactionJobProgress | null;
794
+ }
795
+ interface CompactionSizes {
796
+ before_tokens: number | null;
797
+ after_tokens: number | null;
798
+ }
799
+
593
800
  type PreGateHold = {
594
801
  kind: "awaiting_person";
595
802
  } | {
@@ -698,7 +905,7 @@ declare module "@danxbot/card-kit@1" {
698
905
  orchestrator_profile: string | null;
699
906
  }
700
907
  type CardContextCategoryKey = "comments" | "checklists" | "content" | "agent_notes" | "problems" | "decisions" | "designs";
701
- type PlanContextCategoryKey = "architecture" | "comments" | "records" | "notes" | "open_cards";
908
+ type PlanContextCategoryKey = "architecture" | "comments" | "heading" | "records" | "notes" | "open_cards";
702
909
  type ContextCategoryKey = CardContextCategoryKey | PlanContextCategoryKey;
703
910
  interface ContextCategorySize {
704
911
  key: ContextCategoryKey;
@@ -848,6 +1055,7 @@ declare module "@danxbot/card-kit@1" {
848
1055
  metadata?: unknown;
849
1056
  answers_decision_id?: undefined | null | number;
850
1057
  sign_off?: undefined | null | CommentSignOffViewV2;
1058
+ quoted_request?: undefined | null | ProvenanceRecordV2;
851
1059
  tags: Array<{ kind: "problem"; ref: number; } | { kind: "design"; ref: number; } | { kind: "decision"; ref: number; }>;
852
1060
  resource_tags: Array<CommentResourceTag>;
853
1061
  parent_comment_id: null | number;
@@ -880,6 +1088,8 @@ declare module "@danxbot/card-kit@1" {
880
1088
  timestamp: string;
881
1089
  updated_at: string;
882
1090
  text: string;
1091
+ reduced?: undefined | true;
1092
+ reduced_text?: undefined | null | string;
883
1093
  metadata: unknown;
884
1094
  }>);
885
1095
  designs?: undefined | (Array<{
@@ -972,6 +1182,7 @@ declare module "@danxbot/card-kit@1" {
972
1182
  justification?: undefined | null | Justification;
973
1183
  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; };
974
1184
  problem_total?: undefined | number;
1185
+ evidence_record_total?: undefined | number;
975
1186
  decision_record_total?: undefined | number;
976
1187
  decision_record_page?: undefined | DecisionRecordPage;
977
1188
  decision_record_approved_total?: undefined | number;
@@ -1000,6 +1211,9 @@ declare module "@danxbot/card-kit@1" {
1000
1211
  conflict_on_reverse?: undefined | Array<ConflictEntryViewV2>;
1001
1212
  conflict_on_partners?: undefined | Record<string, { status: IssueStatus; title: string; }>;
1002
1213
  conflict_dep_ids?: undefined | Record<string, number>;
1214
+ depends_on_landing?: undefined | Array<ConflictEntryViewV2>;
1215
+ depends_on_landing_partners?: undefined | Record<string, { status: IssueStatus; title: string; }>;
1216
+ depends_on_landing_dep_ids?: undefined | Record<string, number>;
1003
1217
  conflict_on_active_count?: undefined | number;
1004
1218
  children?: undefined | Array<string>;
1005
1219
  descendant_ids?: undefined | Array<string>;
@@ -1013,7 +1227,7 @@ declare module "@danxbot/card-kit@1" {
1013
1227
  unread_comments_count?: undefined | number;
1014
1228
  unread_decision_comment_counts?: undefined | Record<string, number>;
1015
1229
  context_size?: undefined | ContextSize;
1016
- 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; };
1230
+ 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; };
1017
1231
  agent_notes_count?: undefined | number;
1018
1232
  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; }; };
1019
1233
  comment_tags?: undefined | Array<CommentTagOption>;
@@ -1044,6 +1258,7 @@ declare module "@danxbot/card-kit@1" {
1044
1258
  approved: boolean;
1045
1259
  impact: number;
1046
1260
  confidence: number;
1261
+ text: string;
1047
1262
  rev: number;
1048
1263
  created_at: string;
1049
1264
  updated_at: string;
@@ -1051,7 +1266,6 @@ declare module "@danxbot/card-kit@1" {
1051
1266
  author: string;
1052
1267
  by: AuthorV2;
1053
1268
  via_key: null | ViaKey;
1054
- text: string;
1055
1269
  ref: string;
1056
1270
  ref_num: number;
1057
1271
  current_version: number;
@@ -1071,12 +1285,12 @@ declare module "@danxbot/card-kit@1" {
1071
1285
  made_by: "human" | "agent";
1072
1286
  impact: number;
1073
1287
  confidence: number;
1288
+ text: string;
1074
1289
  id: number;
1075
1290
  created_at: string;
1076
1291
  author: string;
1077
1292
  by: AuthorV2;
1078
1293
  via_key: null | ViaKey;
1079
- text: string;
1080
1294
  ref: string;
1081
1295
  approval: DecisionApprovalState;
1082
1296
  made_by_user_id: null | number;
@@ -1095,6 +1309,65 @@ declare module "@danxbot/card-kit@1" {
1095
1309
  by_user_id: null | number;
1096
1310
  by_name: string;
1097
1311
  }>);
1312
+ }>);
1313
+ evidence_records?: undefined | (Array<{
1314
+ rev: number;
1315
+ created_at: string;
1316
+ updated_at: string;
1317
+ ref: string;
1318
+ ref_num: number;
1319
+ hypothesis: EvidenceHypothesisVersionView;
1320
+ verdict: null | EvidenceVerdictVersionView;
1321
+ exhibits: Array<EvidenceExhibitStatusView>;
1322
+ other_block_count: number;
1323
+ round_count: number;
1324
+ block_count: number;
1325
+ rounds?: undefined | (Array<{
1326
+ created_at: string;
1327
+ author: string;
1328
+ by: AuthorV2;
1329
+ via_key: null | ViaKey;
1330
+ round_no: number;
1331
+ hypothesis_version: number;
1332
+ environment: string;
1333
+ commit_sha: string;
1334
+ blocks: Array<EvidenceBlockViewBase<"note"> | EvidenceBlockViewBase<"steps"> | EvidenceBlockViewBase<"command"> | EvidenceBlockViewBase<"table">>;
1335
+ }>);
1336
+ hypothesis_versions?: undefined | (Array<{
1337
+ id: number;
1338
+ version_no: number;
1339
+ question: string;
1340
+ expected_answer: string;
1341
+ exhibits: Array<EvidenceExhibitView>;
1342
+ reasoning: string;
1343
+ confidence: number;
1344
+ author: string;
1345
+ by: AuthorV2;
1346
+ via_key: null | ViaKey;
1347
+ created_at: string;
1348
+ made_by: "human" | "agent";
1349
+ made_by_user_id: null | number;
1350
+ made_by_name: null | string;
1351
+ made_by_author: AuthorV2;
1352
+ made_by_is_writer: boolean;
1353
+ }>);
1354
+ verdict_versions?: undefined | (Array<{
1355
+ id: number;
1356
+ version_no: number;
1357
+ answer: string;
1358
+ confidence: number;
1359
+ reasoning: string;
1360
+ cites: Array<string>;
1361
+ author: string;
1362
+ by: AuthorV2;
1363
+ via_key: null | ViaKey;
1364
+ created_at: string;
1365
+ made_by: "human" | "agent";
1366
+ made_by_user_id: null | number;
1367
+ made_by_name: null | string;
1368
+ made_by_author: AuthorV2;
1369
+ made_by_is_writer: boolean;
1370
+ }>);
1098
1371
  }>);
1099
1372
  decision_record_versions?: undefined | (Array<{
1100
1373
  title: string;
@@ -1103,12 +1376,12 @@ declare module "@danxbot/card-kit@1" {
1103
1376
  made_by: "human" | "agent";
1104
1377
  impact: number;
1105
1378
  confidence: number;
1379
+ text: string;
1106
1380
  id: number;
1107
1381
  created_at: string;
1108
1382
  author: string;
1109
1383
  by: AuthorV2;
1110
1384
  via_key: null | ViaKey;
1111
- text: string;
1112
1385
  ref: string;
1113
1386
  approval: DecisionApprovalState;
1114
1387
  made_by_user_id: null | number;
@@ -1127,15 +1400,15 @@ declare module "@danxbot/card-kit@1" {
1127
1400
  by_user_id: null | number;
1128
1401
  by_name: string;
1129
1402
  }>);
1130
- work_marks?: undefined | Array<{
1403
+ work_marks?: undefined | (Array<{
1131
1404
  id: number;
1132
1405
  via_key_id: number;
1133
1406
  resource: WorkMarkResource;
1134
1407
  note: string;
1135
1408
  by: AuthorV2;
1136
1409
  started_at: string;
1137
- expires_at: string;
1138
- }>;
1410
+ expires_at: null | string;
1411
+ }>);
1139
1412
  pull_request_reviews?: undefined | (Array<{
1140
1413
  id: number;
1141
1414
  kind: "comment" | "review" | "thread";
@@ -1188,7 +1461,7 @@ declare module "@danxbot/card-kit@1" {
1188
1461
  actor: string;
1189
1462
  actor_ref: ActorRef;
1190
1463
  via_key: undefined | null | ViaKey;
1191
- event: "created" | "blocked" | "activity" | "status_change" | "unblocked" | "field_change" | "dependency_added" | "dependency_removed" | "conflict_added" | "conflict_removed";
1464
+ event: "created" | "blocked" | "activity" | "status_change" | "unblocked" | "field_change" | "dependency_added" | "dependency_removed" | "conflict_added" | "conflict_removed" | "landing_dependency_added" | "landing_dependency_removed";
1192
1465
  label: undefined | StatusReason;
1193
1466
  from: undefined | "Cancelled" | "Review" | "ToDo" | "In Progress" | "Backlog" | "Done";
1194
1467
  to: undefined | "Cancelled" | "Review" | "ToDo" | "In Progress" | "Backlog" | "Done";
@@ -1289,12 +1562,12 @@ declare module "@danxbot/card-kit@1" {
1289
1562
  made_by: "human" | "agent";
1290
1563
  impact: number;
1291
1564
  confidence: number;
1565
+ text: string;
1292
1566
  id: number;
1293
1567
  created_at: string;
1294
1568
  author: string;
1295
1569
  by: AuthorV2;
1296
1570
  via_key: null | ViaKey;
1297
- text: string;
1298
1571
  ref: string;
1299
1572
  approval: DecisionApprovalState;
1300
1573
  made_by_user_id: null | number;
@@ -1308,10 +1581,6 @@ declare module "@danxbot/card-kit@1" {
1308
1581
  };
1309
1582
  type SolutionViewV2 = {
1310
1583
  title: string;
1311
- id: number;
1312
- content_hash: string;
1313
- body: string;
1314
- steps_hash: string;
1315
1584
  steps: Array<{
1316
1585
  id: number;
1317
1586
  solution_id: number;
@@ -1324,6 +1593,10 @@ declare module "@danxbot/card-kit@1" {
1324
1593
  checked_by: null | string;
1325
1594
  steps: Array<SolutionStepViewV2>;
1326
1595
  }>;
1596
+ id: number;
1597
+ content_hash: string;
1598
+ body: string;
1599
+ steps_hash: string;
1327
1600
  removed: boolean;
1328
1601
  pro: string;
1329
1602
  con: string;
@@ -1410,7 +1683,8 @@ declare module "@danxbot/card-kit@1" {
1410
1683
  type EffortLevelName = "min" | "very_low" | "low" | "medium" | "high" | "very_high" | "max";
1411
1684
  type IssueProblemType = "design" | "question" | "action" | "decision_review";
1412
1685
  type DecisionOutcome = "rejected" | "answered";
1413
- type IssueDependencyKind = "depends_on" | "conflict_on";
1686
+ type GatingDependencyKind = "conflict_on" | "depends_on";
1687
+ type IssueDependencyKind = GatingDependencyKind | "depends_on_landing";
1414
1688
  type IssueDispatchKind = "work" | "triage" | "recovery" | "flesh-out" | "chat" | "main-sync-repair" | "worktree-maintenance" | "manual" | "landing" | `gate-${string}`;
1415
1689
  type IssueAssignmentMode = "automated" | "manual";
1416
1690
  type StartCommitError = "no_repo" | "not_github_repo" | "no_token" | "github_refused" | "github_unreachable" | "unreadable_tip" | "unexpected";
@@ -1864,6 +2138,7 @@ declare module "@danxbot/card-kit@1" {
1864
2138
  interface AttachmentViewer {
1865
2139
  open: (attachmentId: number) => void;
1866
2140
  element: ReactNode;
2141
+ live: ReadonlyMap<number, ShownAttachment>;
1867
2142
  }
1868
2143
 
1869
2144
  function AttachmentsTab({ cardId, actions, viewer, }: {
package/dist/publish.d.ts CHANGED
@@ -8,8 +8,17 @@ declare function sourceFiles(projectDir: string): Promise<string[]>;
8
8
  /** The project's source as a gzip-compressed tar archive, ready for `source_archive_base64`. The same files give the same bytes (fixed mtime, `portable`). */
9
9
  declare function archiveSource(projectDir: string): Promise<Buffer>;
10
10
 
11
+ /**
12
+ * DX-6233 (PLAN-96 G-6) - the shapes of the widget-surface domain that the server and the app both read. Plan section "Extensibility: widgets and
13
+ * plugins" is the spec. Pure and import-free of Node, because the app imports this module at runtime (`@backend/widget-surfaces/model.js`).
14
+ *
15
+ * The surface-wide settings are system-defined: every Widget knows they exist and a Widget receives only the ones it declares it reads. For now they are a
16
+ * date range (primary), a keyword search and (DX-7166) the alert areas to show. A surface stores all of them as its defaults (a writer seeds them when it creates the surface; a reader never
17
+ * fills a missing one in), and a person's override is sparse: a key absent from it means the person has chosen nothing for that setting.
18
+ */
19
+
11
20
  /** The names of the surface-wide settings, one per member of {@link SurfaceWideSettings} (a new member fails `tsc` here). */
12
- declare const SURFACE_WIDE_SETTING_KEYS: readonly ["date_range", "keyword"];
21
+ declare const SURFACE_WIDE_SETTING_KEYS: readonly ["date_range", "keyword", "areas"];
13
22
  type SurfaceWideSettingKey = (typeof SURFACE_WIDE_SETTING_KEYS)[number];
14
23
 
15
24
  /**
@@ -37,6 +46,11 @@ type ValueField = {
37
46
  readonly enum?: readonly string[];
38
47
  /** 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
48
  readonly optionLabels?: Readonly<Record<string, FieldText>>;
49
+ /**
50
+ * 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.
51
+ * Not with `enum`: a field offers either its own fixed options or a team's things.
52
+ */
53
+ readonly source?: "machine";
40
54
  } | {
41
55
  readonly type: "number";
42
56
  readonly label: FieldText;
package/dist/vite.d.ts CHANGED
@@ -1,7 +1,16 @@
1
1
  import { Plugin } from 'vite';
2
2
 
3
+ /**
4
+ * DX-6233 (PLAN-96 G-6) - the shapes of the widget-surface domain that the server and the app both read. Plan section "Extensibility: widgets and
5
+ * plugins" is the spec. Pure and import-free of Node, because the app imports this module at runtime (`@backend/widget-surfaces/model.js`).
6
+ *
7
+ * The surface-wide settings are system-defined: every Widget knows they exist and a Widget receives only the ones it declares it reads. For now they are a
8
+ * date range (primary), a keyword search and (DX-7166) the alert areas to show. A surface stores all of them as its defaults (a writer seeds them when it creates the surface; a reader never
9
+ * fills a missing one in), and a person's override is sparse: a key absent from it means the person has chosen nothing for that setting.
10
+ */
11
+
3
12
  /** The names of the surface-wide settings, one per member of {@link SurfaceWideSettings} (a new member fails `tsc` here). */
4
- declare const SURFACE_WIDE_SETTING_KEYS: readonly ["date_range", "keyword"];
13
+ declare const SURFACE_WIDE_SETTING_KEYS: readonly ["date_range", "keyword", "areas"];
5
14
  type SurfaceWideSettingKey = (typeof SURFACE_WIDE_SETTING_KEYS)[number];
6
15
 
7
16
  /**
@@ -29,6 +38,11 @@ type ValueField = {
29
38
  readonly enum?: readonly string[];
30
39
  /** 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
40
  readonly optionLabels?: Readonly<Record<string, FieldText>>;
41
+ /**
42
+ * 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.
43
+ * Not with `enum`: a field offers either its own fixed options or a team's things.
44
+ */
45
+ readonly source?: "machine";
32
46
  } | {
33
47
  readonly type: "number";
34
48
  readonly label: FieldText;
package/dist/vite.js CHANGED
@@ -103,7 +103,8 @@ var DATE_RANGE_MS = {
103
103
  };
104
104
  var SURFACE_WIDE_SETTING_KEYS = [
105
105
  "date_range",
106
- "keyword"
106
+ "keyword",
107
+ "areas"
107
108
  ];
108
109
 
109
110
  // ../../src/widget-surfaces/value-schema.ts
@@ -150,6 +151,8 @@ function labelIssues(schema) {
150
151
  for (const [name, field] of Object.entries(schema)) {
151
152
  if (blank(field.label)) issues.push(`field "${name}" has an empty label`);
152
153
  if (field.type !== "string") continue;
154
+ if (field.source !== void 0 && field.enum !== void 0)
155
+ issues.push(`field "${name}" offers options and a source of them`);
153
156
  const options = field.enum ?? [];
154
157
  const labelled = Object.keys(field.optionLabels ?? {});
155
158
  if (field.enum !== void 0 && field.optionLabels === void 0)
package/dist/widgets.d.ts CHANGED
@@ -1,12 +1,27 @@
1
+ /** The areas an alert belongs to; the Performance tab's Areas filter (DX-7166) picks among them. */
2
+ declare const ALERT_AREAS: readonly ["machine", "agents", "pacing", "delivery"];
3
+ type AlertArea = (typeof ALERT_AREAS)[number];
4
+
5
+ /**
6
+ * DX-6233 (PLAN-96 G-6) - the shapes of the widget-surface domain that the server and the app both read. Plan section "Extensibility: widgets and
7
+ * plugins" is the spec. Pure and import-free of Node, because the app imports this module at runtime (`@backend/widget-surfaces/model.js`).
8
+ *
9
+ * The surface-wide settings are system-defined: every Widget knows they exist and a Widget receives only the ones it declares it reads. For now they are a
10
+ * date range (primary), a keyword search and (DX-7166) the alert areas to show. A surface stores all of them as its defaults (a writer seeds them when it creates the surface; a reader never
11
+ * fills a missing one in), and a person's override is sparse: a key absent from it means the person has chosen nothing for that setting.
12
+ */
13
+
1
14
  declare const DATE_RANGES: readonly ["24h", "7d", "30d"];
2
15
  type DateRange = (typeof DATE_RANGES)[number];
3
16
  /** Every surface-wide setting a surface stores a default for. */
4
17
  interface SurfaceWideSettings {
5
18
  date_range: DateRange;
6
19
  keyword: string;
20
+ /** DX-7166: the alert areas the surface's Widgets show; none picked (an empty list) shows every area. */
21
+ areas: AlertArea[];
7
22
  }
8
23
  /** The names of the surface-wide settings, one per member of {@link SurfaceWideSettings} (a new member fails `tsc` here). */
9
- declare const SURFACE_WIDE_SETTING_KEYS: readonly ["date_range", "keyword"];
24
+ declare const SURFACE_WIDE_SETTING_KEYS: readonly ["date_range", "keyword", "areas"];
10
25
  type SurfaceWideSettingKey = (typeof SURFACE_WIDE_SETTING_KEYS)[number];
11
26
 
12
27
  /**
@@ -34,6 +49,11 @@ type ValueField = {
34
49
  readonly enum?: readonly string[];
35
50
  /** 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
51
  readonly optionLabels?: Readonly<Record<string, FieldText>>;
52
+ /**
53
+ * 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.
54
+ * Not with `enum`: a field offers either its own fixed options or a team's things.
55
+ */
56
+ readonly source?: "machine";
37
57
  } | {
38
58
  readonly type: "number";
39
59
  readonly label: FieldText;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@50arms/plugin-sdk",
3
- "version": "0.2.60",
3
+ "version": "0.2.62",
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",