@kangentic/protocol 0.20.0 → 0.21.0

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.
@@ -13,8 +13,8 @@
13
13
  * this protocol surface honest: a tool renamed or removed desktop-side
14
14
  * fails that test instead of silently breaking phones.
15
15
  */
16
- export declare const BOARD_TOOL_READ_NAMES: readonly ["search_tasks", "find_task", "get_current_task", "get_task_stats", "get_usage_stats", "board_summary", "list_sessions", "get_session_history", "get_column_detail", "list_board_profiles", "get_handoff_context", "get_transcript", "get_session_files", "get_session_events", "get_activity_intervals"];
17
- export declare const BOARD_TOOL_WRITE_NAMES: readonly ["create_task", "update_task", "delete_task", "link_pr", "remove_attachment", "update_column", "create_board_profile", "update_board_profile", "delete_board_profile", "create_backlog_task", "promote_backlog", "update_backlog_item", "delete_backlog_item"];
16
+ export declare const BOARD_TOOL_READ_NAMES: readonly ["search_tasks", "find_task", "get_current_task", "get_task_stats", "get_usage_stats", "board_summary", "list_sessions", "get_session_history", "get_column_detail", "list_board_profiles", "get_handoff_context", "get_transcript", "get_session_files", "get_session_events", "get_activity_intervals", "list_workflows", "get_workflow"];
17
+ export declare const BOARD_TOOL_WRITE_NAMES: readonly ["create_task", "update_task", "delete_task", "link_pr", "remove_attachment", "update_column", "create_board_profile", "update_board_profile", "delete_board_profile", "create_backlog_task", "promote_backlog", "update_backlog_item", "delete_backlog_item", "pause_workflow", "resume_workflow"];
18
18
  export type BoardToolReadName = (typeof BOARD_TOOL_READ_NAMES)[number];
19
19
  export type BoardToolWriteName = (typeof BOARD_TOOL_WRITE_NAMES)[number];
20
20
  export type BoardToolName = BoardToolReadName | BoardToolWriteName;
@@ -1,4 +1,9 @@
1
- export declare const PUSH_CATEGORIES: readonly ["input-required", "turn-complete", "session-failed", "plan-complete", "spawn-stalled"];
1
+ /**
2
+ * Append only. `workflow-complete` (every task of a workflow reached Done) is
3
+ * the newest; a phone that predates it reads the envelope as an unknown
4
+ * category and shows the generic placeholder.
5
+ */
6
+ export declare const PUSH_CATEGORIES: readonly ["input-required", "turn-complete", "session-failed", "plan-complete", "spawn-stalled", "workflow-complete"];
2
7
  export type PushCategory = (typeof PUSH_CATEGORIES)[number];
3
8
  export declare function isPushCategory(value: unknown): value is PushCategory;
4
9
  /** Reject an opened envelope whose sentAt is older than this (stale replay). */
@@ -465,6 +465,46 @@ export interface BoardTaskWire {
465
465
  * key from every real wire response.
466
466
  */
467
467
  pausable?: boolean | null;
468
+ /**
469
+ * The workflow the task belongs to (a set of linked tasks that runs through
470
+ * its boards by itself), or null for an ordinary task. Absent from desktops
471
+ * that predate workflows, which the parser reads as null, as it does a value
472
+ * it cannot read. Declared OPTIONAL for the reason `pr_merge_readiness` is.
473
+ */
474
+ workflow?: BoardTaskWorkflowWire | null;
475
+ }
476
+ /**
477
+ * A board task's workflow, as its card draws it: the strip (name, color), what
478
+ * the task waits for, and whether a hand may move it. `lock_reason` is the
479
+ * desktop's own sentence, so a phone that refuses a move says what the desktop
480
+ * would; the desktop refuses a locked move on its own anyway.
481
+ */
482
+ export interface BoardTaskWorkflowWire {
483
+ id: string;
484
+ title: string;
485
+ /** The workflow's home project, which may not be the board's. */
486
+ project_id: string;
487
+ /** `running`, `paused`, `draft` or `done`; a value a client does not know reads as running. */
488
+ state: string;
489
+ /** Which of six categorical colors (1 to 6) the desktop paints its icon in. */
490
+ color_slot: number;
491
+ /** The columns the task visits, by id, in board order. */
492
+ route: string[];
493
+ /** The tasks it waits for that are not done, named as the card's footer names them ("#413"). */
494
+ waiting_for: string[];
495
+ /**
496
+ * While the card is locked (its workflow runs and it is not waiting in a
497
+ * human gate), the desktop's sentence for a refused move; null otherwise,
498
+ * which is when the desktop draws no lock. An unlocked card still never
499
+ * moves into To Do, and while `gate_target_id` is set it moves only there.
500
+ */
501
+ lock_reason: string | null;
502
+ /**
503
+ * While the workflow runs and the card waits in a column no agent judges
504
+ * (a human gate): the one column a hand may move it to, the next on its
505
+ * route. Moving it there is how the person reports the step done. Null otherwise.
506
+ */
507
+ gate_target_id: string | null;
468
508
  }
469
509
  /**
470
510
  * One live Command Terminal of a project (protocol 0.20.0): an agent the
@@ -564,6 +604,11 @@ export declare function parseSessionEventWire(payload: JsonValue): SessionEventW
564
604
  export declare function parseBoardColumnWire(value: JsonValue): BoardColumnWire;
565
605
  /** Narrows one board-task row. Throws on a malformed required field. */
566
606
  export declare function parseBoardTaskWire(value: JsonValue): BoardTaskWire;
607
+ /**
608
+ * A board task's workflow, or null when absent or unreadable. Lenient on
609
+ * purpose: a malformed workflow costs the card its strip, never the board.
610
+ */
611
+ export declare function parseBoardTaskWorkflowWire(value: JsonValue | undefined): BoardTaskWorkflowWire | null;
567
612
  /**
568
613
  * Narrows one Command Terminal row. Throws on a malformed required field. An
569
614
  * unrecognized activity state or reason reads as null rather than throwing, so
package/dist/index.cjs CHANGED
@@ -97,6 +97,7 @@ __export(index_exports, {
97
97
  parseBacklogItemWire: () => parseBacklogItemWire,
98
98
  parseBoardColumnWire: () => parseBoardColumnWire,
99
99
  parseBoardTaskWire: () => parseBoardTaskWire,
100
+ parseBoardTaskWorkflowWire: () => parseBoardTaskWorkflowWire,
100
101
  parseCapabilityRequestPayload: () => parseCapabilityRequestPayload,
101
102
  parseCommandTerminalStartResponsePayload: () => parseCommandTerminalStartResponsePayload,
102
103
  parseCommandTerminalWire: () => parseCommandTerminalWire,
@@ -5228,7 +5229,7 @@ function base64UrlDecode(encoded) {
5228
5229
  }
5229
5230
 
5230
5231
  // src/crypto/push-envelope.ts
5231
- var PUSH_CATEGORIES = ["input-required", "turn-complete", "session-failed", "plan-complete", "spawn-stalled"];
5232
+ var PUSH_CATEGORIES = ["input-required", "turn-complete", "session-failed", "plan-complete", "spawn-stalled", "workflow-complete"];
5232
5233
  function isPushCategory(value) {
5233
5234
  return typeof value === "string" && PUSH_CATEGORIES.includes(value);
5234
5235
  }
@@ -5509,7 +5510,24 @@ function parseBoardTaskWire(value) {
5509
5510
  spawn_progress: nullableString(value, "spawn_progress"),
5510
5511
  resumable: nullableBoolean(value, "resumable"),
5511
5512
  paused: nullableBoolean(value, "paused"),
5512
- pausable: nullableBoolean(value, "pausable")
5513
+ pausable: nullableBoolean(value, "pausable"),
5514
+ workflow: parseBoardTaskWorkflowWire(value.workflow)
5515
+ };
5516
+ }
5517
+ function parseBoardTaskWorkflowWire(value) {
5518
+ if (value === void 0 || !isRecord(value)) return null;
5519
+ const strings = (field) => Array.isArray(field) ? field.filter((entry) => typeof entry === "string") : [];
5520
+ if (typeof value.id !== "string" || typeof value.title !== "string" || typeof value.project_id !== "string") return null;
5521
+ return {
5522
+ id: value.id,
5523
+ title: value.title,
5524
+ project_id: value.project_id,
5525
+ state: typeof value.state === "string" ? value.state : "running",
5526
+ color_slot: typeof value.color_slot === "number" ? value.color_slot : 1,
5527
+ route: strings(value.route),
5528
+ waiting_for: strings(value.waiting_for),
5529
+ lock_reason: typeof value.lock_reason === "string" ? value.lock_reason : null,
5530
+ gate_target_id: typeof value.gate_target_id === "string" ? value.gate_target_id : null
5513
5531
  };
5514
5532
  }
5515
5533
  function parseCommandTerminalWire(value) {
@@ -6186,7 +6204,10 @@ var BOARD_TOOL_READ_NAMES = [
6186
6204
  "get_transcript",
6187
6205
  "get_session_files",
6188
6206
  "get_session_events",
6189
- "get_activity_intervals"
6207
+ "get_activity_intervals",
6208
+ // Workflows: the project's workflows and one workflow's tasks, routes and links.
6209
+ "list_workflows",
6210
+ "get_workflow"
6190
6211
  ];
6191
6212
  var BOARD_TOOL_WRITE_NAMES = [
6192
6213
  "create_task",
@@ -6201,7 +6222,10 @@ var BOARD_TOOL_WRITE_NAMES = [
6201
6222
  "create_backlog_task",
6202
6223
  "promote_backlog",
6203
6224
  "update_backlog_item",
6204
- "delete_backlog_item"
6225
+ "delete_backlog_item",
6226
+ // Workflows: stop every task of a running workflow at once, and start them again.
6227
+ "pause_workflow",
6228
+ "resume_workflow"
6205
6229
  ];
6206
6230
  function isBoardToolReadName(value) {
6207
6231
  return BOARD_TOOL_READ_NAMES.includes(value);
@@ -6404,6 +6428,7 @@ function isBridgeEvent(value) {
6404
6428
  parseBacklogItemWire,
6405
6429
  parseBoardColumnWire,
6406
6430
  parseBoardTaskWire,
6431
+ parseBoardTaskWorkflowWire,
6407
6432
  parseCapabilityRequestPayload,
6408
6433
  parseCommandTerminalStartResponsePayload,
6409
6434
  parseCommandTerminalWire,
package/dist/index.d.ts CHANGED
@@ -22,5 +22,5 @@ export { formatKeyFingerprint } from './roster/fingerprint';
22
22
  export { CAPABILITY_VERBS, isCapabilityVerb, capabilitySetFromArray, capabilitySetToArray, type CapabilityVerb, type CapabilitySet, } from './capabilities/verbs';
23
23
  export { BOARD_TOOL_READ_NAMES, BOARD_TOOL_WRITE_NAMES, isBoardToolReadName, isBoardToolWriteName, type BoardToolReadName, type BoardToolWriteName, type BoardToolName, } from './capabilities/board-tools';
24
24
  export { isBridgeEvent, parseActivityEventPayload, type BridgeEvent, type TranscriptEvent, type ActivityEvent, type ActivityEventPayload, type TerminalEvent, type TerminalResizeEvent, type BoardEvent, type BoardEventPayload, type DiffEvent, } from './events/event';
25
- export { parseTranscriptEntriesWire, parseTranscriptEventPayload, type TranscriptEventPayload, type TranscriptUpsertWire, isActivityStateWire, isActivityReasonWire, parseSessionUsageWire, parseSessionSummaryWire, parseSessionEventWire, parseTerminalDimensionsWire, parseBoardColumnWire, parseBoardTaskWire, parseCommandTerminalWire, parseBacklogItemWire, parseDiffFileListWire, parseDiffFileContentWire, isTodoRole, isDoneRole, BOARD_COLUMN_ROLES, type TranscriptBlockWire, type TranscriptEntryWire, type TranscriptTurnUsageWire, type TranscriptSystemSubtypeWire, type ActivityStateWire, type ActivityReasonWire, type SessionUsageWire, type SessionSummaryWire, type SessionEventWire, type TerminalDimensionsWire, type BoardColumnWire, type BoardColumnRoleWire, type BoardTaskWire, type CommandTerminalWire, type BacklogItemWire, type DiffFileStatusWire, type DiffFileWire, type DiffFileListWire, type DiffFileContentWire, } from './events/payloads';
25
+ export { parseTranscriptEntriesWire, parseTranscriptEventPayload, type TranscriptEventPayload, type TranscriptUpsertWire, isActivityStateWire, isActivityReasonWire, parseSessionUsageWire, parseSessionSummaryWire, parseSessionEventWire, parseTerminalDimensionsWire, parseBoardColumnWire, parseBoardTaskWire, parseCommandTerminalWire, parseBoardTaskWorkflowWire, parseBacklogItemWire, parseDiffFileListWire, parseDiffFileContentWire, isTodoRole, isDoneRole, BOARD_COLUMN_ROLES, type TranscriptBlockWire, type TranscriptEntryWire, type TranscriptTurnUsageWire, type TranscriptSystemSubtypeWire, type ActivityStateWire, type ActivityReasonWire, type SessionUsageWire, type SessionSummaryWire, type SessionEventWire, type TerminalDimensionsWire, type BoardColumnWire, type BoardColumnRoleWire, type BoardTaskWire, type CommandTerminalWire, type BoardTaskWorkflowWire, type BacklogItemWire, type DiffFileStatusWire, type DiffFileWire, type DiffFileListWire, type DiffFileContentWire, } from './events/payloads';
26
26
  export type { Transport, TransportState, Unsubscribe } from './transport/transport';
package/dist/index.mjs CHANGED
@@ -5089,7 +5089,7 @@ function base64UrlDecode(encoded) {
5089
5089
  }
5090
5090
 
5091
5091
  // src/crypto/push-envelope.ts
5092
- var PUSH_CATEGORIES = ["input-required", "turn-complete", "session-failed", "plan-complete", "spawn-stalled"];
5092
+ var PUSH_CATEGORIES = ["input-required", "turn-complete", "session-failed", "plan-complete", "spawn-stalled", "workflow-complete"];
5093
5093
  function isPushCategory(value) {
5094
5094
  return typeof value === "string" && PUSH_CATEGORIES.includes(value);
5095
5095
  }
@@ -5370,7 +5370,24 @@ function parseBoardTaskWire(value) {
5370
5370
  spawn_progress: nullableString(value, "spawn_progress"),
5371
5371
  resumable: nullableBoolean(value, "resumable"),
5372
5372
  paused: nullableBoolean(value, "paused"),
5373
- pausable: nullableBoolean(value, "pausable")
5373
+ pausable: nullableBoolean(value, "pausable"),
5374
+ workflow: parseBoardTaskWorkflowWire(value.workflow)
5375
+ };
5376
+ }
5377
+ function parseBoardTaskWorkflowWire(value) {
5378
+ if (value === void 0 || !isRecord(value)) return null;
5379
+ const strings = (field) => Array.isArray(field) ? field.filter((entry) => typeof entry === "string") : [];
5380
+ if (typeof value.id !== "string" || typeof value.title !== "string" || typeof value.project_id !== "string") return null;
5381
+ return {
5382
+ id: value.id,
5383
+ title: value.title,
5384
+ project_id: value.project_id,
5385
+ state: typeof value.state === "string" ? value.state : "running",
5386
+ color_slot: typeof value.color_slot === "number" ? value.color_slot : 1,
5387
+ route: strings(value.route),
5388
+ waiting_for: strings(value.waiting_for),
5389
+ lock_reason: typeof value.lock_reason === "string" ? value.lock_reason : null,
5390
+ gate_target_id: typeof value.gate_target_id === "string" ? value.gate_target_id : null
5374
5391
  };
5375
5392
  }
5376
5393
  function parseCommandTerminalWire(value) {
@@ -6047,7 +6064,10 @@ var BOARD_TOOL_READ_NAMES = [
6047
6064
  "get_transcript",
6048
6065
  "get_session_files",
6049
6066
  "get_session_events",
6050
- "get_activity_intervals"
6067
+ "get_activity_intervals",
6068
+ // Workflows: the project's workflows and one workflow's tasks, routes and links.
6069
+ "list_workflows",
6070
+ "get_workflow"
6051
6071
  ];
6052
6072
  var BOARD_TOOL_WRITE_NAMES = [
6053
6073
  "create_task",
@@ -6062,7 +6082,10 @@ var BOARD_TOOL_WRITE_NAMES = [
6062
6082
  "create_backlog_task",
6063
6083
  "promote_backlog",
6064
6084
  "update_backlog_item",
6065
- "delete_backlog_item"
6085
+ "delete_backlog_item",
6086
+ // Workflows: stop every task of a running workflow at once, and start them again.
6087
+ "pause_workflow",
6088
+ "resume_workflow"
6066
6089
  ];
6067
6090
  function isBoardToolReadName(value) {
6068
6091
  return BOARD_TOOL_READ_NAMES.includes(value);
@@ -6264,6 +6287,7 @@ export {
6264
6287
  parseBacklogItemWire,
6265
6288
  parseBoardColumnWire,
6266
6289
  parseBoardTaskWire,
6290
+ parseBoardTaskWorkflowWire,
6267
6291
  parseCapabilityRequestPayload,
6268
6292
  parseCommandTerminalStartResponsePayload,
6269
6293
  parseCommandTerminalWire,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kangentic/protocol",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "description": "Kangentic mobile bridge wire protocol: framing, Noise-based pairing and session handshakes, signed device roster, and capability verbs shared between desktop and mobile.",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",