@skrr-ai/cli 0.1.143 → 0.1.145
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.
- package/README.md +13 -0
- package/dist/commands/agenda/plan.d.ts +7 -0
- package/dist/commands/agenda/plan.js +17 -0
- package/dist/commands/agenda/trigger/create.js +4 -2
- package/dist/commands/agenda/trigger/list.js +7 -7
- package/dist/commands/agent/message/approve.d.ts +17 -0
- package/dist/commands/agent/message/approve.js +70 -0
- package/dist/commands/agent/message/decline.d.ts +17 -0
- package/dist/commands/agent/message/decline.js +70 -0
- package/dist/commands/agent/message/pending.d.ts +18 -0
- package/dist/commands/agent/message/pending.js +79 -0
- package/dist/commands/agents/delete.d.ts +45 -0
- package/dist/commands/agents/delete.js +139 -2
- package/dist/commands/agents/plan-day.d.ts +50 -7
- package/dist/commands/agents/plan-day.js +293 -65
- package/dist/commands/agents/proactive-audit.d.ts +22 -0
- package/dist/commands/agents/proactive-audit.js +86 -0
- package/dist/commands/agents/schedule-overview.d.ts +7 -0
- package/dist/commands/agents/schedule-overview.js +49 -5
- package/dist/commands/agents/schedule-trace.js +42 -21
- package/dist/commands/agents/spawn.d.ts +78 -1
- package/dist/commands/agents/spawn.js +262 -6
- package/dist/commands/agents/todos/list.d.ts +5 -0
- package/dist/commands/agents/todos/list.js +19 -5
- package/dist/commands/agents/triggers/create.js +1 -1
- package/dist/commands/agents/triggers/update.js +1 -1
- package/dist/commands/agents/upcoming.d.ts +1 -0
- package/dist/commands/agents/upcoming.js +18 -7
- package/dist/commands/commitments/create.js +14 -4
- package/dist/commands/commitments/preflight.js +14 -3
- package/dist/commands/commitments/update.js +1 -1
- package/dist/commands/initiatives/worker/deactivate.d.ts +23 -0
- package/dist/commands/initiatives/worker/deactivate.js +78 -0
- package/dist/commands/login.js +8 -2
- package/dist/commands/logout.d.ts +20 -0
- package/dist/commands/logout.js +110 -5
- package/dist/commands/memory/maintain.js +16 -2
- package/dist/commands/spaces/delete.js +6 -1
- package/dist/commands/spaces/workflow-templates/insert.js +4 -0
- package/dist/commands/spaces/workflows/archive.js +6 -1
- package/dist/commands/spaces/workflows/publish.js +3 -1
- package/dist/commands/spaces/workflows/run.d.ts +1 -0
- package/dist/commands/spaces/workflows/run.js +17 -1
- package/dist/commands/spaces/workflows/triggers/create.js +3 -1
- package/dist/commands/store/show.js +22 -0
- package/dist/commands/tasks/workflow-context.js +3 -1
- package/dist/commands/triggers/capabilities.js +17 -1
- package/dist/commands/triggers/create.d.ts +2 -0
- package/dist/commands/triggers/create.js +23 -7
- package/dist/commands/triggers/fire-detail.js +12 -3
- package/dist/commands/triggers/list.d.ts +1 -0
- package/dist/commands/triggers/list.js +13 -1
- package/dist/commands/triggers/preflight.js +18 -0
- package/dist/commands/triggers/prune.js +9 -5
- package/dist/commands/triggers/update.js +13 -4
- package/dist/generated/agent-guides.json +35 -35
- package/dist/lib/agent-proactive-baseline.js +7 -1
- package/dist/lib/agentic-stream.d.ts +7 -0
- package/dist/lib/agentic-stream.js +22 -0
- package/dist/lib/commitments.d.ts +16 -9
- package/dist/lib/commitments.js +78 -5
- package/dist/lib/compasses.js +1 -1
- package/dist/lib/daemon-setup.js +9 -3
- package/dist/lib/daemonBroker.d.ts +7 -0
- package/dist/lib/daemonBroker.js +5 -0
- package/dist/lib/daemonHandoff.d.ts +2 -0
- package/dist/lib/daemonHandoff.js +10 -1
- package/dist/lib/daemonIslandProfile.d.ts +19 -0
- package/dist/lib/daemonIslandProfile.js +41 -0
- package/dist/lib/dedicated-power.js +10 -3
- package/dist/lib/format.d.ts +47 -0
- package/dist/lib/format.js +136 -1
- package/dist/lib/initiatives-worker.d.ts +25 -0
- package/dist/lib/initiatives-worker.js +13 -0
- package/dist/lib/login.d.ts +7 -0
- package/dist/lib/login.js +5 -0
- package/dist/lib/planOutcome.d.ts +51 -0
- package/dist/lib/planOutcome.js +88 -0
- package/dist/lib/proactive-audit.d.ts +52 -0
- package/dist/lib/proactive-audit.js +67 -0
- package/dist/lib/proactiveApi.d.ts +71 -0
- package/dist/lib/proactiveApi.js +10 -1
- package/dist/lib/refresh.d.ts +20 -6
- package/dist/lib/refresh.js +27 -9
- package/dist/lib/roles.d.ts +1 -1
- package/dist/lib/schedule.d.ts +214 -10
- package/dist/lib/schedule.js +317 -21
- package/dist/lib/triggers.d.ts +139 -3
- package/dist/lib/triggers.js +382 -18
- package/dist/lib/workflow-node-control.js +8 -0
- package/dist/lib/workflow-run-view.js +9 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.d.ts +22 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.js +15 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.d.ts +22 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.js +22 -4
- package/dist/node_modules/@skrr-ai/data-provider/index.js +5252 -5211
- package/oclif.manifest.json +526 -29
- package/package.json +1 -1
|
@@ -40,6 +40,7 @@ __export(refresh_exports, {
|
|
|
40
40
|
persistReauthState: () => persistReauthState,
|
|
41
41
|
refreshDaemonToken: () => refreshDaemonToken,
|
|
42
42
|
revokeDaemonRefreshSession: () => revokeDaemonRefreshSession,
|
|
43
|
+
revokeDaemonRefreshSessionReported: () => revokeDaemonRefreshSessionReported,
|
|
43
44
|
withAuthLock: () => withAuthLock
|
|
44
45
|
});
|
|
45
46
|
module.exports = __toCommonJS(refresh_exports);
|
|
@@ -245,7 +246,17 @@ async function refreshDaemonToken(serverUrl, currentRefreshToken, daemonId, opti
|
|
|
245
246
|
async function revokeDaemonRefreshSession(serverUrl, refreshToken) {
|
|
246
247
|
if (!refreshToken)
|
|
247
248
|
return;
|
|
249
|
+
const result = await revokeDaemonRefreshSessionReported(serverUrl, refreshToken);
|
|
248
250
|
const log = (0, import_runtime.getAuthLogger)();
|
|
251
|
+
if (result.outcome === "refused") {
|
|
252
|
+
log.debug(`[auth/refresh] revoke returned ${result.status}`);
|
|
253
|
+
} else if (result.outcome === "unreachable") {
|
|
254
|
+
log.debug(`[auth/refresh] revoke network error: ${result.detail}`);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
async function revokeDaemonRefreshSessionReported(serverUrl, refreshToken) {
|
|
258
|
+
if (!refreshToken)
|
|
259
|
+
return { outcome: "unreachable", detail: "no refresh token to present" };
|
|
249
260
|
const url = `${serverUrl.replace(/\/+$/, "")}/api/daemons/token/revoke`;
|
|
250
261
|
const controller = new AbortController();
|
|
251
262
|
const timer = setTimeout(() => controller.abort(), 5e3);
|
|
@@ -258,11 +269,10 @@ async function revokeDaemonRefreshSession(serverUrl, refreshToken) {
|
|
|
258
269
|
signal: controller.signal
|
|
259
270
|
});
|
|
260
271
|
(0, import_runtime.notifyResponseObserver)(res);
|
|
261
|
-
|
|
262
|
-
log.debug(`[auth/refresh] revoke returned ${res.status}`);
|
|
263
|
-
}
|
|
272
|
+
return res.ok ? { outcome: "accepted" } : { outcome: "refused", status: res.status };
|
|
264
273
|
} catch (err) {
|
|
265
|
-
|
|
274
|
+
const detail = controller.signal.aborted ? "no answer within 5 seconds" : err?.message || String(err);
|
|
275
|
+
return { outcome: "unreachable", detail };
|
|
266
276
|
} finally {
|
|
267
277
|
clearTimeout(timer);
|
|
268
278
|
}
|
|
@@ -553,5 +563,6 @@ function clearReauthState() {
|
|
|
553
563
|
persistReauthState,
|
|
554
564
|
refreshDaemonToken,
|
|
555
565
|
revokeDaemonRefreshSession,
|
|
566
|
+
revokeDaemonRefreshSessionReported,
|
|
556
567
|
withAuthLock
|
|
557
568
|
});
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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);
|