@skrr-ai/cli 0.1.101 → 0.1.103

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 (91) hide show
  1. package/dist/base-command.js +24 -0
  2. package/dist/commands/agent/message/send.js +6 -2
  3. package/dist/commands/agents/triggers/create.js +7 -17
  4. package/dist/commands/agents/triggers/update.js +41 -28
  5. package/dist/commands/commitments/control/apply.d.ts +15 -0
  6. package/dist/commands/commitments/control/apply.js +36 -0
  7. package/dist/commands/commitments/control/preview.d.ts +17 -0
  8. package/dist/commands/commitments/control/preview.js +43 -0
  9. package/dist/commands/commitments/control/show.d.ts +12 -0
  10. package/dist/commands/commitments/control/show.js +29 -0
  11. package/dist/commands/commitments/create.js +5 -2
  12. package/dist/commands/commitments/observation/probe.d.ts +15 -0
  13. package/dist/commands/commitments/observation/probe.js +46 -0
  14. package/dist/commands/commitments/observation/summary.d.ts +9 -0
  15. package/dist/commands/commitments/observation/summary.js +31 -0
  16. package/dist/commands/commitments/preflight.js +18 -1
  17. package/dist/commands/commitments/readiness/show.d.ts +12 -0
  18. package/dist/commands/commitments/readiness/show.js +29 -0
  19. package/dist/commands/commitments/readiness/verify.d.ts +13 -0
  20. package/dist/commands/commitments/readiness/verify.js +33 -0
  21. package/dist/commands/commitments/roster.d.ts +15 -0
  22. package/dist/commands/commitments/roster.js +39 -0
  23. package/dist/commands/commitments/show.js +1 -1
  24. package/dist/commands/commitments/status.d.ts +17 -0
  25. package/dist/commands/commitments/status.js +41 -0
  26. package/dist/commands/commitments/update.js +23 -9
  27. package/dist/commands/commitments/work-plan.d.ts +11 -0
  28. package/dist/commands/commitments/work-plan.js +36 -0
  29. package/dist/commands/compass/effective-policy.d.ts +12 -0
  30. package/dist/commands/compass/effective-policy.js +34 -0
  31. package/dist/commands/compass/update.d.ts +12 -0
  32. package/dist/commands/compass/update.js +27 -0
  33. package/dist/commands/daemon/logs.d.ts +39 -1
  34. package/dist/commands/daemon/logs.js +140 -13
  35. package/dist/commands/followups/checkin.js +46 -3
  36. package/dist/commands/machines/dedicated/exec.js +3 -1
  37. package/dist/commands/proposals/discard.d.ts +4 -0
  38. package/dist/commands/proposals/discard.js +3 -0
  39. package/dist/commands/proposals/keep.d.ts +4 -0
  40. package/dist/commands/proposals/keep.js +3 -0
  41. package/dist/commands/proposals/snooze.d.ts +4 -0
  42. package/dist/commands/proposals/snooze.js +3 -0
  43. package/dist/commands/spaces/workflows/cancel-node.d.ts +16 -0
  44. package/dist/commands/spaces/workflows/cancel-node.js +44 -0
  45. package/dist/commands/spaces/workflows/cancel.d.ts +40 -0
  46. package/dist/commands/spaces/workflows/cancel.js +109 -3
  47. package/dist/commands/spaces/workflows/run.d.ts +9 -0
  48. package/dist/commands/spaces/workflows/run.js +38 -0
  49. package/dist/commands/tasks/approvals/resolve.d.ts +12 -0
  50. package/dist/commands/tasks/approvals/resolve.js +21 -5
  51. package/dist/commands/tasks/schedule.js +1 -1
  52. package/dist/commands/triggers/capabilities.js +7 -0
  53. package/dist/commands/triggers/create.js +12 -18
  54. package/dist/commands/triggers/fire.js +3 -0
  55. package/dist/commands/triggers/update.js +41 -27
  56. package/dist/commands/widgets/check.d.ts +39 -0
  57. package/dist/commands/widgets/check.js +179 -0
  58. package/dist/lib/agent-mailbox.d.ts +0 -1
  59. package/dist/lib/agent-mailbox.js +0 -1
  60. package/dist/lib/commitment-loop-status.d.ts +16 -0
  61. package/dist/lib/commitment-loop-status.js +164 -0
  62. package/dist/lib/commitments.d.ts +47 -1
  63. package/dist/lib/commitments.js +218 -6
  64. package/dist/lib/compasses.d.ts +3 -0
  65. package/dist/lib/compasses.js +1 -0
  66. package/dist/lib/delegated-cli.d.ts +23 -1
  67. package/dist/lib/delegated-cli.js +61 -4
  68. package/dist/lib/first-party-harness.d.ts +1 -1
  69. package/dist/lib/first-party-harness.js +1 -1
  70. package/dist/lib/responsibility-controls.d.ts +11 -0
  71. package/dist/lib/responsibility-controls.js +119 -0
  72. package/dist/lib/session-task-write.d.ts +13 -0
  73. package/dist/lib/session-task-write.js +63 -3
  74. package/dist/lib/stewardship-output.js +13 -2
  75. package/dist/lib/triggers.d.ts +26 -0
  76. package/dist/lib/triggers.js +134 -1
  77. package/dist/lib/widgetCheck.d.ts +123 -0
  78. package/dist/lib/widgetCheck.js +998 -0
  79. package/dist/lib/widgetStaticScan.d.ts +111 -0
  80. package/dist/lib/widgetStaticScan.js +833 -0
  81. package/dist/lib/workflow-node-control.d.ts +10 -0
  82. package/dist/lib/workflow-node-control.js +76 -0
  83. package/dist/lib/workspaces.d.ts +2 -0
  84. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.d.ts +9 -1
  85. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.js +12 -0
  86. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.d.ts +9 -1
  87. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.js +12 -0
  88. package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
  89. package/dist/node_modules/@skrr-ai/data-provider/index.js +11924 -8704
  90. package/oclif.manifest.json +1487 -396
  91. package/package.json +11 -2
@@ -0,0 +1,10 @@
1
+ import type { WorkflowReviewedCancellationScope } from '@skrr-ai/data-provider';
2
+ /** Freeze the saved canonical selection. This command performs no live reads. */
3
+ export declare function nodeCancellationFromSnapshot(spaceId: string, runId: string, nodeKey: string, snapshot: Record<string, unknown>, reason?: string): {
4
+ expectedRunGeneration: number;
5
+ expectedGeneration: number;
6
+ expectedAttempt: string;
7
+ expectedTaskRunId: string | null;
8
+ expectedScopeNode: WorkflowReviewedCancellationScope['nodes'][number];
9
+ reason?: string;
10
+ };
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.nodeCancellationFromSnapshot = nodeCancellationFromSnapshot;
4
+ function record(value) {
5
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
6
+ }
7
+ function integer(value) {
8
+ return typeof value === 'number' && Number.isSafeInteger(value) && value >= 0;
9
+ }
10
+ function id(value) {
11
+ return typeof value === 'string' && value.length > 0 && value.length <= 160;
12
+ }
13
+ /** Freeze the saved canonical selection. This command performs no live reads. */
14
+ function nodeCancellationFromSnapshot(spaceId, runId, nodeKey, snapshot, reason) {
15
+ if (snapshot.id !== runId || snapshot.spaceId !== spaceId || !integer(snapshot.generation) || !Array.isArray(snapshot.nodes)) {
16
+ throw new Error('Use a saved canonical run snapshot for this exact Space and workflow run.');
17
+ }
18
+ const selected = snapshot.nodes.filter((node) => record(node) && node.nodeKey === nodeKey);
19
+ const node = selected[0];
20
+ if (selected.length !== 1 || !record(node) || !id(node.id) || node.workflowRunId !== runId
21
+ || !integer(node.iteration) || !integer(node.planGeneration) || !id(node.nodeType)) {
22
+ throw new Error('The saved snapshot must contain one exact node attempt and its generation.');
23
+ }
24
+ if (node.taskRunId != null && !id(node.taskRunId))
25
+ throw new Error('The saved TaskRun pin is invalid.');
26
+ if (reason !== undefined && reason.length > 500)
27
+ throw new Error('The cancellation reason must be at most 500 characters.');
28
+ const expectedScopeNode = {
29
+ id: node.id, workflowRunId: runId, iteration: node.iteration,
30
+ planGeneration: node.planGeneration, nodeType: node.nodeType,
31
+ };
32
+ for (const key of ['taskId', 'taskRunId', 'autonomousRunId']) {
33
+ const value = node[key];
34
+ if (value == null)
35
+ continue;
36
+ if (!id(value))
37
+ throw new Error(`The saved ${key} pin is invalid.`);
38
+ Object.assign(expectedScopeNode, { [key]: value });
39
+ }
40
+ // Explicit physical absence is a boundary. The canonical service refuses
41
+ // an executor that appears later rather than discovering it during a stop.
42
+ if (node.sessionId != null && !id(node.sessionId))
43
+ throw new Error('The saved session pin is invalid.');
44
+ expectedScopeNode.sessionId = node.sessionId == null ? null : node.sessionId;
45
+ const executor = (value) => {
46
+ if (value == null)
47
+ return null;
48
+ if (!record(value) || !id(value.kind) || !id(value.runId) || !integer(value.generation) || !integer(value.attempt)) {
49
+ throw new Error('The saved physical executor attempt is invalid.');
50
+ }
51
+ return { kind: value.kind, runId: value.runId, generation: value.generation, attempt: value.attempt };
52
+ };
53
+ expectedScopeNode.executorAttemptRef = executor(node.executorAttemptRef);
54
+ if (node.waitingFor !== undefined) {
55
+ const waitingFor = node.waitingFor;
56
+ if (!record(waitingFor))
57
+ throw new Error('The saved child execution scope is invalid.');
58
+ const keys = ['kind', 'eventKey', 'workflowRunId', 'index', 'phase', 'round', 'reviewTaskIds', 'reviseTaskId', 'executions'];
59
+ expectedScopeNode.waitingFor = Object.fromEntries(keys.filter((key) => waitingFor[key] !== undefined)
60
+ .map((key) => [key, waitingFor[key]]));
61
+ }
62
+ if (node.executorPins !== undefined) {
63
+ if (!Array.isArray(node.executorPins))
64
+ throw new Error('The saved executor set is invalid.');
65
+ expectedScopeNode.executorPins = node.executorPins.map((pin) => {
66
+ if (!record(pin) || !id(pin.taskId) || (pin.runId !== null && !id(pin.runId))
67
+ || (pin.sessionId != null && !id(pin.sessionId)))
68
+ throw new Error('The saved executor set is invalid.');
69
+ return { taskId: pin.taskId, runId: pin.runId, sessionId: pin.sessionId == null ? null : pin.sessionId,
70
+ executorAttemptRef: executor(pin.executorAttemptRef) };
71
+ });
72
+ }
73
+ return { expectedRunGeneration: snapshot.generation, expectedGeneration: node.planGeneration, expectedAttempt: node.id,
74
+ expectedTaskRunId: node.taskRunId == null ? null : node.taskRunId, expectedScopeNode,
75
+ ...(reason !== undefined ? { reason } : {}) };
76
+ }
@@ -4,6 +4,8 @@ export interface StewardshipSource {
4
4
  status: 'available' | 'unavailable';
5
5
  truncated: boolean;
6
6
  code?: string;
7
+ /** `unattributedGrants` only: Grants in this workspace by Agent or Commitment that carry no workspace stamp and so are not listed. */
8
+ unlisted?: number;
7
9
  }
8
10
  export interface StewardshipCoverage {
9
11
  complete: boolean;
@@ -10,7 +10,7 @@ type DeviceIdentityState = {
10
10
  profile: string;
11
11
  envelopeProtected: boolean;
12
12
  };
13
- type DisabledReason = 'init_failed' | 'load_failed' | 'persist_failed' | 'unreadable_key';
13
+ type DisabledReason = 'init_failed' | 'load_failed' | 'persist_failed' | 'unreadable_key' | 'no_stored_key';
14
14
  /** @internal Test seam — force-set state. */
15
15
  export declare function __setStateForTest(next: DeviceIdentityState): DeviceIdentityState;
16
16
  /** @internal Test seam — read state. */
@@ -47,9 +47,17 @@ export declare function describeDeviceKeySplit(profile: string): {
47
47
  * next refresh with a key the server never pinned.
48
48
  * 2. Generate fresh keypair and persist. Failure to persist is a hard
49
49
  * error landing in disabled+persist_failed.
50
+ *
51
+ * `createIfMissing: false` stops before step 2 (disabled+no_stored_key) and
52
+ * never replaces anything: for a short-lived process that must only READ the
53
+ * daemon's key while the daemon itself may be creating it (OSK-15990's
54
+ * `skrrd device-proof`). The persist below is not an exclusive create, so a
55
+ * second creator racing the daemon could leave the daemon holding one key in
56
+ * memory and the disk another.
50
57
  */
51
58
  export declare function initDeviceIdentity(profile: string, options?: {
52
59
  recoverUnreadable?: boolean;
60
+ createIfMissing?: boolean;
53
61
  }): Promise<void>;
54
62
  /**
55
63
  * Reset in-memory state. With `clearOnDisk=true` deletes both keypair files.
@@ -364,6 +364,13 @@ async function consolidateDeviceIdentity(profile) {
364
364
  * next refresh with a key the server never pinned.
365
365
  * 2. Generate fresh keypair and persist. Failure to persist is a hard
366
366
  * error landing in disabled+persist_failed.
367
+ *
368
+ * `createIfMissing: false` stops before step 2 (disabled+no_stored_key) and
369
+ * never replaces anything: for a short-lived process that must only READ the
370
+ * daemon's key while the daemon itself may be creating it (OSK-15990's
371
+ * `skrrd device-proof`). The persist below is not an exclusive create, so a
372
+ * second creator racing the daemon could leave the daemon holding one key in
373
+ * memory and the disk another.
367
374
  */
368
375
  async function initDeviceIdentity(profile, options = {}) {
369
376
  if (_state.kind !== 'uninit')
@@ -412,6 +419,11 @@ async function initDeviceIdentity(profile, options = {}) {
412
419
  emit('recovery_required', false, { profile, reason: 'stored_key_unreadable' });
413
420
  return;
414
421
  }
422
+ if (options.createIfMissing === false) {
423
+ _state = { kind: 'disabled', reason: 'no_stored_key' };
424
+ emit('no_stored_key', false, { profile });
425
+ return;
426
+ }
415
427
  let fresh;
416
428
  try {
417
429
  fresh = (0, deviceKey_js_1.generateDeviceKeyPair)();
@@ -10,7 +10,7 @@ type DeviceIdentityState = {
10
10
  profile: string;
11
11
  envelopeProtected: boolean;
12
12
  };
13
- type DisabledReason = 'init_failed' | 'load_failed' | 'persist_failed' | 'unreadable_key';
13
+ type DisabledReason = 'init_failed' | 'load_failed' | 'persist_failed' | 'unreadable_key' | 'no_stored_key';
14
14
  /** @internal Test seam — force-set state. */
15
15
  export declare function __setStateForTest(next: DeviceIdentityState): DeviceIdentityState;
16
16
  /** @internal Test seam — read state. */
@@ -47,9 +47,17 @@ export declare function describeDeviceKeySplit(profile: string): {
47
47
  * next refresh with a key the server never pinned.
48
48
  * 2. Generate fresh keypair and persist. Failure to persist is a hard
49
49
  * error landing in disabled+persist_failed.
50
+ *
51
+ * `createIfMissing: false` stops before step 2 (disabled+no_stored_key) and
52
+ * never replaces anything: for a short-lived process that must only READ the
53
+ * daemon's key while the daemon itself may be creating it (OSK-15990's
54
+ * `skrrd device-proof`). The persist below is not an exclusive create, so a
55
+ * second creator racing the daemon could leave the daemon holding one key in
56
+ * memory and the disk another.
50
57
  */
51
58
  export declare function initDeviceIdentity(profile: string, options?: {
52
59
  recoverUnreadable?: boolean;
60
+ createIfMissing?: boolean;
53
61
  }): Promise<void>;
54
62
  /**
55
63
  * Reset in-memory state. With `clearOnDisk=true` deletes both keypair files.
@@ -344,6 +344,13 @@ async function consolidateDeviceIdentity(profile) {
344
344
  * next refresh with a key the server never pinned.
345
345
  * 2. Generate fresh keypair and persist. Failure to persist is a hard
346
346
  * error landing in disabled+persist_failed.
347
+ *
348
+ * `createIfMissing: false` stops before step 2 (disabled+no_stored_key) and
349
+ * never replaces anything: for a short-lived process that must only READ the
350
+ * daemon's key while the daemon itself may be creating it (OSK-15990's
351
+ * `skrrd device-proof`). The persist below is not an exclusive create, so a
352
+ * second creator racing the daemon could leave the daemon holding one key in
353
+ * memory and the disk another.
347
354
  */
348
355
  export async function initDeviceIdentity(profile, options = {}) {
349
356
  if (_state.kind !== 'uninit')
@@ -392,6 +399,11 @@ export async function initDeviceIdentity(profile, options = {}) {
392
399
  emit('recovery_required', false, { profile, reason: 'stored_key_unreadable' });
393
400
  return;
394
401
  }
402
+ if (options.createIfMissing === false) {
403
+ _state = { kind: 'disabled', reason: 'no_stored_key' };
404
+ emit('no_stored_key', false, { profile });
405
+ return;
406
+ }
395
407
  let fresh;
396
408
  try {
397
409
  fresh = generateDeviceKeyPair();
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skrr-ai/auth-core",
3
- "version": "0.4.20",
3
+ "version": "0.4.22",
4
4
  "main": "dist/cjs/index.js",
5
5
  "types": "dist/esm/index.d.ts",
6
6
  "exports": {