@skrr-ai/cli 0.1.143 → 0.1.144

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 (88) hide show
  1. package/README.md +8 -0
  2. package/dist/commands/agenda/trigger/create.js +4 -2
  3. package/dist/commands/agenda/trigger/list.js +7 -7
  4. package/dist/commands/agent/message/approve.d.ts +17 -0
  5. package/dist/commands/agent/message/approve.js +72 -0
  6. package/dist/commands/agent/message/decline.d.ts +17 -0
  7. package/dist/commands/agent/message/decline.js +72 -0
  8. package/dist/commands/agent/message/pending.d.ts +18 -0
  9. package/dist/commands/agent/message/pending.js +79 -0
  10. package/dist/commands/agents/delete.d.ts +45 -0
  11. package/dist/commands/agents/delete.js +139 -2
  12. package/dist/commands/agents/plan-day.d.ts +39 -7
  13. package/dist/commands/agents/plan-day.js +254 -65
  14. package/dist/commands/agents/proactive-audit.d.ts +22 -0
  15. package/dist/commands/agents/proactive-audit.js +86 -0
  16. package/dist/commands/agents/schedule-overview.d.ts +7 -0
  17. package/dist/commands/agents/schedule-overview.js +43 -5
  18. package/dist/commands/agents/schedule-trace.js +30 -19
  19. package/dist/commands/agents/spawn.d.ts +42 -0
  20. package/dist/commands/agents/spawn.js +91 -4
  21. package/dist/commands/agents/todos/list.d.ts +5 -0
  22. package/dist/commands/agents/todos/list.js +19 -5
  23. package/dist/commands/agents/triggers/create.js +1 -1
  24. package/dist/commands/agents/triggers/update.js +1 -1
  25. package/dist/commands/commitments/create.js +13 -3
  26. package/dist/commands/commitments/preflight.js +14 -3
  27. package/dist/commands/initiatives/worker/deactivate.d.ts +23 -0
  28. package/dist/commands/initiatives/worker/deactivate.js +78 -0
  29. package/dist/commands/login.js +8 -2
  30. package/dist/commands/logout.d.ts +20 -0
  31. package/dist/commands/logout.js +110 -5
  32. package/dist/commands/memory/maintain.js +16 -2
  33. package/dist/commands/spaces/delete.js +6 -1
  34. package/dist/commands/spaces/workflows/archive.js +6 -1
  35. package/dist/commands/spaces/workflows/publish.js +3 -1
  36. package/dist/commands/spaces/workflows/run.d.ts +1 -0
  37. package/dist/commands/spaces/workflows/run.js +17 -1
  38. package/dist/commands/spaces/workflows/triggers/create.js +3 -1
  39. package/dist/commands/tasks/workflow-context.js +3 -1
  40. package/dist/commands/triggers/capabilities.js +17 -1
  41. package/dist/commands/triggers/create.d.ts +2 -0
  42. package/dist/commands/triggers/create.js +23 -7
  43. package/dist/commands/triggers/fire-detail.js +12 -3
  44. package/dist/commands/triggers/list.d.ts +1 -0
  45. package/dist/commands/triggers/list.js +13 -1
  46. package/dist/commands/triggers/preflight.js +18 -0
  47. package/dist/commands/triggers/prune.js +9 -5
  48. package/dist/commands/triggers/update.js +13 -4
  49. package/dist/generated/agent-guides.json +35 -35
  50. package/dist/lib/agent-proactive-baseline.js +7 -1
  51. package/dist/lib/commitments.d.ts +16 -9
  52. package/dist/lib/commitments.js +65 -4
  53. package/dist/lib/daemon-setup.js +9 -3
  54. package/dist/lib/daemonBroker.d.ts +7 -0
  55. package/dist/lib/daemonBroker.js +5 -0
  56. package/dist/lib/daemonHandoff.d.ts +2 -0
  57. package/dist/lib/daemonHandoff.js +10 -1
  58. package/dist/lib/daemonIslandProfile.d.ts +19 -0
  59. package/dist/lib/daemonIslandProfile.js +41 -0
  60. package/dist/lib/format.d.ts +32 -0
  61. package/dist/lib/format.js +105 -1
  62. package/dist/lib/initiatives-worker.d.ts +25 -0
  63. package/dist/lib/initiatives-worker.js +13 -0
  64. package/dist/lib/login.d.ts +7 -0
  65. package/dist/lib/login.js +5 -0
  66. package/dist/lib/proactive-audit.d.ts +52 -0
  67. package/dist/lib/proactive-audit.js +67 -0
  68. package/dist/lib/proactiveApi.d.ts +9 -0
  69. package/dist/lib/refresh.d.ts +20 -6
  70. package/dist/lib/refresh.js +27 -9
  71. package/dist/lib/roles.d.ts +1 -1
  72. package/dist/lib/schedule.d.ts +189 -9
  73. package/dist/lib/schedule.js +283 -22
  74. package/dist/lib/triggers.d.ts +134 -3
  75. package/dist/lib/triggers.js +370 -17
  76. package/dist/lib/workflow-node-control.js +8 -0
  77. package/dist/lib/workflow-run-view.js +9 -0
  78. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +1 -1
  79. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +2 -0
  80. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.d.ts +22 -0
  81. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.js +15 -4
  82. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +1 -1
  83. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +1 -1
  84. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.d.ts +22 -0
  85. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.js +22 -4
  86. package/dist/node_modules/@skrr-ai/data-provider/index.js +4779 -4741
  87. package/oclif.manifest.json +494 -26
  88. package/package.json +1 -1
@@ -13,7 +13,7 @@ export { decodeJwtExpiry, decodeJwtPayload } from './jwtUtils.js';
13
13
  export { isAuthExpiredSseEvent, handleMidStreamAuthExpiry, type ParsedSseLike, type AuthExpiredCallbacks, type HandleMidStreamAuthExpiryResult, } from './authExpiredDetector.js';
14
14
  export { formatReauthMessage, reauthCommand, EXIT_NEEDS_REAUTH, type AuthFailureReason, } from './messages.js';
15
15
  export { classifyRefreshResponse, type RefreshResponseShape, type ClassifiedRefreshResult, type ClassifiedRefreshSuccess, type ClassifiedRefreshFailure, } from './refreshClassification.js';
16
- export { refreshDaemonToken, revokeDaemonRefreshSession, withAuthLock, persistReauthState, needsReauthState, clearReauthState, installLockExitHandlers, __refreshDiagnostics, __resetUnknown401StreaksForTest, UNKNOWN_401_BUDGET, } from './refresh.js';
16
+ export { refreshDaemonToken, revokeDaemonRefreshSession, revokeDaemonRefreshSessionReported, type RefreshRevokeResult, withAuthLock, persistReauthState, needsReauthState, clearReauthState, installLockExitHandlers, __refreshDiagnostics, __resetUnknown401StreaksForTest, UNKNOWN_401_BUDGET, } from './refresh.js';
17
17
  export { createRefreshScheduler, type RefreshScheduler, type RefreshSchedulerOptions, } from './refreshScheduler.js';
18
18
  export { readAuthFromFd, __setFdReaderForTest, type FdAuthPayload } from './fdToken.js';
19
19
  export { CredentialResolver, CREDENTIAL_PRECEDENCE, __resetCredentialResolverForTest, invalidateAuthHelperCache, classifyTokenKind, CI_TOKEN_PREFIX, PERSONAL_ACCESS_TOKEN_PREFIX, isStaticTokenKind, AuthHelperUntrustedError, AuthHelperUnavailableError, type CredentialSource, type CredentialStoreMode, type CredentialResolverOptions, type ResolvedCredential, type TokenKind, type HelperTrustDecision, type AuthHelperBlockedInfo, type AuthHelperSentinelInfo, } from './credentialResolver.js';
@@ -28,7 +28,7 @@ export { formatReauthMessage, reauthCommand, EXIT_NEEDS_REAUTH, } from './messag
28
28
  // exposed so RN-side clients can apply the same mapping daemon uses.
29
29
  export { classifyRefreshResponse, } from './refreshClassification.js';
30
30
  // Refresh
31
- export { refreshDaemonToken, revokeDaemonRefreshSession, withAuthLock, persistReauthState, needsReauthState, clearReauthState, installLockExitHandlers,
31
+ export { refreshDaemonToken, revokeDaemonRefreshSession, revokeDaemonRefreshSessionReported, withAuthLock, persistReauthState, needsReauthState, clearReauthState, installLockExitHandlers,
32
32
  // H1 — Test-only diagnostic counters that prove every outgoing
33
33
  // refresh request mints a fresh proof. Production code never reads
34
34
  // this; tests use it to assert the per-attempt invariant.
@@ -270,6 +270,28 @@ export declare function refreshDaemonToken(serverUrl: string, currentRefreshToke
270
270
  * replay attempt while keeping back-compat with un-upgraded servers.
271
271
  */
272
272
  export declare function revokeDaemonRefreshSession(serverUrl: string, refreshToken: string): Promise<void>;
273
+ /**
274
+ * What became of a revoke request. The server never says whether the presented
275
+ * token existed, so `accepted` is the strongest claim available: the server
276
+ * took the request, and a live session behind that token is now revoked.
277
+ * `refused` and `unreachable` mean the session, if there is one, is still live.
278
+ */
279
+ export type RefreshRevokeResult = {
280
+ outcome: 'accepted';
281
+ } | {
282
+ outcome: 'refused';
283
+ status: number;
284
+ } | {
285
+ outcome: 'unreachable';
286
+ detail: string;
287
+ };
288
+ /**
289
+ * `revokeDaemonRefreshSession` with its outcome reported instead of swallowed,
290
+ * for a caller that must not tell a person "signed out" when the server never
291
+ * heard (OSK-22307: `skrr logout` did exactly that). Same request, same body,
292
+ * same 5-second bound; it never throws.
293
+ */
294
+ export declare function revokeDaemonRefreshSessionReported(serverUrl: string, refreshToken: string): Promise<RefreshRevokeResult>;
273
295
  export declare function persistReauthState(state: ReauthState): void;
274
296
  export declare function needsReauthState(): {
275
297
  needed: boolean;
@@ -545,7 +545,24 @@ export async function refreshDaemonToken(serverUrl, currentRefreshToken, daemonI
545
545
  export async function revokeDaemonRefreshSession(serverUrl, refreshToken) {
546
546
  if (!refreshToken)
547
547
  return;
548
+ const result = await revokeDaemonRefreshSessionReported(serverUrl, refreshToken);
548
549
  const log = getAuthLogger();
550
+ if (result.outcome === 'refused') {
551
+ log.debug(`[auth/refresh] revoke returned ${result.status}`);
552
+ }
553
+ else if (result.outcome === 'unreachable') {
554
+ log.debug(`[auth/refresh] revoke network error: ${result.detail}`);
555
+ }
556
+ }
557
+ /**
558
+ * `revokeDaemonRefreshSession` with its outcome reported instead of swallowed,
559
+ * for a caller that must not tell a person "signed out" when the server never
560
+ * heard (OSK-22307: `skrr logout` did exactly that). Same request, same body,
561
+ * same 5-second bound; it never throws.
562
+ */
563
+ export async function revokeDaemonRefreshSessionReported(serverUrl, refreshToken) {
564
+ if (!refreshToken)
565
+ return { outcome: 'unreachable', detail: 'no refresh token to present' };
549
566
  const url = `${serverUrl.replace(/\/+$/, '')}/api/daemons/token/revoke`;
550
567
  const controller = new AbortController();
551
568
  const timer = setTimeout(() => controller.abort(), 5_000);
@@ -562,12 +579,13 @@ export async function revokeDaemonRefreshSession(serverUrl, refreshToken) {
562
579
  signal: controller.signal,
563
580
  });
564
581
  notifyResponseObserver(res);
565
- if (!res.ok) {
566
- log.debug(`[auth/refresh] revoke returned ${res.status}`);
567
- }
582
+ return res.ok ? { outcome: 'accepted' } : { outcome: 'refused', status: res.status };
568
583
  }
569
584
  catch (err) {
570
- log.debug(`[auth/refresh] revoke network error: ${err?.message}`);
585
+ const detail = controller.signal.aborted
586
+ ? 'no answer within 5 seconds'
587
+ : err?.message || String(err);
588
+ return { outcome: 'unreachable', detail };
571
589
  }
572
590
  finally {
573
591
  clearTimeout(timer);