@skrr-ai/cli 0.1.102 → 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 (47) 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/preflight.js +18 -1
  6. package/dist/commands/commitments/roster.d.ts +15 -0
  7. package/dist/commands/commitments/roster.js +39 -0
  8. package/dist/commands/commitments/show.js +1 -1
  9. package/dist/commands/commitments/status.d.ts +17 -0
  10. package/dist/commands/commitments/status.js +41 -0
  11. package/dist/commands/commitments/update.js +12 -0
  12. package/dist/commands/daemon/logs.d.ts +39 -1
  13. package/dist/commands/daemon/logs.js +140 -13
  14. package/dist/commands/followups/checkin.js +46 -3
  15. package/dist/commands/tasks/approvals/resolve.d.ts +12 -0
  16. package/dist/commands/tasks/approvals/resolve.js +21 -5
  17. package/dist/commands/triggers/create.js +8 -17
  18. package/dist/commands/triggers/fire.js +3 -0
  19. package/dist/commands/triggers/update.js +41 -27
  20. package/dist/commands/widgets/check.d.ts +39 -0
  21. package/dist/commands/widgets/check.js +179 -0
  22. package/dist/lib/agent-mailbox.d.ts +0 -1
  23. package/dist/lib/agent-mailbox.js +0 -1
  24. package/dist/lib/commitment-loop-status.d.ts +16 -0
  25. package/dist/lib/commitment-loop-status.js +164 -0
  26. package/dist/lib/commitments.d.ts +28 -1
  27. package/dist/lib/commitments.js +184 -5
  28. package/dist/lib/delegated-cli.d.ts +23 -1
  29. package/dist/lib/delegated-cli.js +61 -4
  30. package/dist/lib/first-party-harness.d.ts +1 -1
  31. package/dist/lib/first-party-harness.js +1 -1
  32. package/dist/lib/session-task-write.d.ts +13 -0
  33. package/dist/lib/session-task-write.js +63 -3
  34. package/dist/lib/triggers.d.ts +26 -0
  35. package/dist/lib/triggers.js +134 -1
  36. package/dist/lib/widgetCheck.d.ts +123 -0
  37. package/dist/lib/widgetCheck.js +998 -0
  38. package/dist/lib/widgetStaticScan.d.ts +111 -0
  39. package/dist/lib/widgetStaticScan.js +833 -0
  40. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.d.ts +9 -1
  41. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.js +12 -0
  42. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.d.ts +9 -1
  43. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.js +12 -0
  44. package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
  45. package/dist/node_modules/@skrr-ai/data-provider/index.js +11902 -8696
  46. package/oclif.manifest.json +218 -5
  47. package/package.json +2 -2
@@ -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.21",
3
+ "version": "0.4.22",
4
4
  "main": "dist/cjs/index.js",
5
5
  "types": "dist/esm/index.d.ts",
6
6
  "exports": {