@skrr-ai/cli 0.1.142 → 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.
- package/README.md +8 -0
- package/dist/base-command.d.ts +4 -2
- package/dist/base-command.js +46 -13
- 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 +72 -0
- package/dist/commands/agent/message/decline.d.ts +17 -0
- package/dist/commands/agent/message/decline.js +72 -0
- package/dist/commands/agent/message/pending.d.ts +18 -0
- package/dist/commands/agent/message/pending.js +79 -0
- package/dist/commands/agents/always-on/disable.js +9 -1
- package/dist/commands/agents/always-on/enable.js +9 -1
- package/dist/commands/agents/always-on/status.js +14 -1
- package/dist/commands/agents/create.js +10 -1
- package/dist/commands/agents/delete.d.ts +51 -0
- package/dist/commands/agents/delete.js +163 -2
- package/dist/commands/agents/intuitions/list.js +1 -1
- package/dist/commands/agents/plan-day.d.ts +39 -7
- package/dist/commands/agents/plan-day.js +254 -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 +43 -5
- package/dist/commands/agents/schedule-trace.js +30 -19
- package/dist/commands/agents/spawn.d.ts +51 -0
- package/dist/commands/agents/spawn.js +212 -9
- package/dist/commands/agents/todos/cancel.js +3 -0
- package/dist/commands/agents/todos/edit.js +1 -1
- 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/policy.js +7 -0
- package/dist/commands/agents/triggers/update.js +1 -1
- package/dist/commands/commitments/create.js +13 -3
- package/dist/commands/commitments/preflight.js +31 -5
- package/dist/commands/daemon/index.js +1 -0
- package/dist/commands/daemon/logs.d.ts +8 -1
- package/dist/commands/daemon/logs.js +32 -22
- package/dist/commands/daemon/profile.d.ts +15 -0
- package/dist/commands/daemon/profile.js +51 -0
- package/dist/commands/goals/briefing/status.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/machines/profiles/disconnect.d.ts +23 -0
- package/dist/commands/machines/profiles/disconnect.js +102 -0
- package/dist/commands/machines/profiles/index.d.ts +15 -0
- package/dist/commands/machines/profiles/index.js +33 -0
- package/dist/commands/machines/profiles/label.d.ts +24 -0
- package/dist/commands/machines/profiles/label.js +85 -0
- package/dist/commands/machines/profiles/list.d.ts +16 -0
- package/dist/commands/machines/profiles/list.js +87 -0
- package/dist/commands/memory/maintain.js +16 -2
- package/dist/commands/profiles/list.js +17 -2
- package/dist/commands/spaces/delete.js +6 -1
- 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/tasks/workflow-context.js +3 -1
- package/dist/commands/triggers/authorization.js +1 -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-guides.js +1 -1
- package/dist/lib/agent-proactive-baseline.d.ts +6 -0
- package/dist/lib/agent-proactive-baseline.js +32 -3
- package/dist/lib/always-on-command-result.d.ts +18 -0
- package/dist/lib/always-on-command-result.js +52 -0
- package/dist/lib/always-on-runtime.d.ts +31 -0
- package/dist/lib/always-on-runtime.js +39 -0
- package/dist/lib/auth-diagnostics.d.ts +10 -1
- package/dist/lib/auth-diagnostics.js +16 -8
- package/dist/lib/commitments.d.ts +16 -9
- package/dist/lib/commitments.js +65 -4
- package/dist/lib/compasses.js +5 -0
- package/dist/lib/daemon-binding.js +6 -3
- package/dist/lib/daemon-command-hint.d.ts +10 -5
- package/dist/lib/daemon-command-hint.js +11 -6
- 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 +16 -3
- package/dist/lib/daemonIslandProfile.d.ts +19 -0
- package/dist/lib/daemonIslandProfile.js +41 -0
- package/dist/lib/drain-stdio.d.ts +22 -0
- package/dist/lib/drain-stdio.js +46 -0
- package/dist/lib/format.d.ts +32 -0
- package/dist/lib/format.js +105 -1
- package/dist/lib/initiatives-worker.d.ts +25 -0
- package/dist/lib/initiatives-worker.js +13 -0
- package/dist/lib/keychain.d.ts +22 -1
- package/dist/lib/keychain.js +40 -1
- package/dist/lib/local-daemon-readiness.js +4 -6
- package/dist/lib/local-skills.js +4 -1
- package/dist/lib/login.d.ts +7 -0
- package/dist/lib/login.js +5 -0
- package/dist/lib/machines.d.ts +68 -0
- package/dist/lib/machines.js +67 -0
- package/dist/lib/proactive-audit.d.ts +52 -0
- package/dist/lib/proactive-audit.js +67 -0
- package/dist/lib/proactiveApi.d.ts +23 -0
- 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/runtime-start-verification.js +3 -6
- package/dist/lib/schedule.d.ts +189 -9
- package/dist/lib/schedule.js +283 -22
- package/dist/lib/triggers.d.ts +134 -3
- package/dist/lib/triggers.js +370 -17
- 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/configRoot.d.ts +12 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/configRoot.js +10 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.d.ts +8 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.js +22 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/executorStopReceiptV2.d.ts +133 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/executorStopReceiptV2.js +180 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +5 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +50 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profilePorts.d.ts +137 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profilePorts.js +328 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profileSelection.d.ts +63 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profileSelection.js +174 -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/configRoot.d.ts +12 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/configRoot.js +14 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.d.ts +8 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.js +27 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/executorStopReceiptV2.d.ts +133 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/executorStopReceiptV2.js +183 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +5 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +11 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profilePorts.d.ts +137 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profilePorts.js +333 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profileSelection.d.ts +63 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profileSelection.js +212 -0
- 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/auth-core/package.json +11 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +7446 -7378
- package/oclif.manifest.json +844 -47
- package/package.json +1 -1
|
@@ -109,6 +109,9 @@ export interface ApplyProactiveAgentResponse {
|
|
|
109
109
|
source: string;
|
|
110
110
|
ok: boolean;
|
|
111
111
|
code?: string;
|
|
112
|
+
/** The trigger the watcher became; absent on a failure or an older server. */
|
|
113
|
+
triggerId?: string;
|
|
114
|
+
enabled?: boolean;
|
|
112
115
|
}>;
|
|
113
116
|
};
|
|
114
117
|
alwaysOn?: {
|
|
@@ -122,6 +125,17 @@ export interface ApplyProactiveAgentResponse {
|
|
|
122
125
|
status?: string;
|
|
123
126
|
code?: string;
|
|
124
127
|
};
|
|
128
|
+
compass?: {
|
|
129
|
+
ok: boolean;
|
|
130
|
+
skipped?: string;
|
|
131
|
+
code?: string;
|
|
132
|
+
};
|
|
133
|
+
/** Where the apply put a new Agent, when it chose (the owner's own Codex machine). */
|
|
134
|
+
runsOn?: {
|
|
135
|
+
kind: string;
|
|
136
|
+
harnessId?: string;
|
|
137
|
+
label?: string;
|
|
138
|
+
};
|
|
125
139
|
orchestrator?: {
|
|
126
140
|
ok: boolean;
|
|
127
141
|
status?: string;
|
|
@@ -150,17 +164,26 @@ export interface ApplyProactiveAgentResponse {
|
|
|
150
164
|
gate?: string;
|
|
151
165
|
reason?: string;
|
|
152
166
|
}>;
|
|
167
|
+
/** The gates that actually refused activation (`blockedBy` also lists advisory ones). */
|
|
168
|
+
activationBlockedBy?: Array<{
|
|
169
|
+
gate?: string;
|
|
170
|
+
reason?: string;
|
|
171
|
+
}>;
|
|
172
|
+
/** The first attempt made this one; a retry reported it instead of creating it again. */
|
|
173
|
+
existing?: boolean;
|
|
153
174
|
}>;
|
|
154
175
|
initialize?: {
|
|
155
176
|
goals: Array<{
|
|
156
177
|
id?: string;
|
|
157
178
|
ok: boolean;
|
|
158
179
|
code?: string;
|
|
180
|
+
existing?: boolean;
|
|
159
181
|
}>;
|
|
160
182
|
tasks: Array<{
|
|
161
183
|
id?: string;
|
|
162
184
|
ok: boolean;
|
|
163
185
|
code?: string;
|
|
186
|
+
existing?: boolean;
|
|
164
187
|
}>;
|
|
165
188
|
jobs: Array<{
|
|
166
189
|
id?: string;
|
package/dist/lib/refresh.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* don't rotate; the caller is expected to `classifyTokenKind()` and
|
|
16
16
|
* skip this module entirely when `kind === 'ci'`.
|
|
17
17
|
*/
|
|
18
|
-
import { PermanentAuthFailure, TransientAuthFailure, type ResolvedCredential, type TokenPair } from '@skrr-ai/auth-core';
|
|
18
|
+
import { PermanentAuthFailure, TransientAuthFailure, type RefreshRevokeResult, type ResolvedCredential, type TokenPair } from '@skrr-ai/auth-core';
|
|
19
19
|
export declare const CLI_REFRESH_EARLY_MS: number;
|
|
20
20
|
/**
|
|
21
21
|
* Stable origin header so the server's benign-grace matcher can identify
|
|
@@ -78,11 +78,25 @@ export declare function ensureFreshCliCredential(opts?: EnsureFreshCliCredential
|
|
|
78
78
|
*/
|
|
79
79
|
export declare function refreshCliToken(): Promise<TokenPair>;
|
|
80
80
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
81
|
+
* What revoking this profile's CLI session came to. The server's three answers
|
|
82
|
+
* (`accepted`, `refused`, `unreachable`), or `not_sent` when there was nothing
|
|
83
|
+
* this computer could present: no sign-in stored for this server, one with no
|
|
84
|
+
* refresh half, or one that could not be read.
|
|
85
85
|
*/
|
|
86
|
-
export
|
|
86
|
+
export type CliSessionRevokeResult = RefreshRevokeResult | {
|
|
87
|
+
outcome: 'not_sent';
|
|
88
|
+
reason: 'no_credential' | 'no_refresh_token' | 'read_failed';
|
|
89
|
+
detail?: string;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Revoke this profile's CLI session on the server, and say what happened.
|
|
93
|
+
* Does NOT clear local backends: the revoke is authenticated by the refresh
|
|
94
|
+
* token itself, so the caller stages it before discarding the bundle.
|
|
95
|
+
*
|
|
96
|
+
* It used to return nothing and swallow every failure, so `skrr logout`
|
|
97
|
+
* printed "Signed out." over a session the server never heard about
|
|
98
|
+
* (OSK-22307). It never throws.
|
|
99
|
+
*/
|
|
100
|
+
export declare function revokeCurrentRefreshToken(): Promise<CliSessionRevokeResult>;
|
|
87
101
|
export { PermanentAuthFailure, TransientAuthFailure };
|
|
88
102
|
export type { TokenPair };
|
package/dist/lib/refresh.js
CHANGED
|
@@ -255,15 +255,33 @@ async function refreshCliToken() {
|
|
|
255
255
|
});
|
|
256
256
|
}
|
|
257
257
|
/**
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
258
|
+
* Revoke this profile's CLI session on the server, and say what happened.
|
|
259
|
+
* Does NOT clear local backends: the revoke is authenticated by the refresh
|
|
260
|
+
* token itself, so the caller stages it before discarding the bundle.
|
|
261
|
+
*
|
|
262
|
+
* It used to return nothing and swallow every failure, so `skrr logout`
|
|
263
|
+
* printed "Signed out." over a session the server never heard about
|
|
264
|
+
* (OSK-22307). It never throws.
|
|
262
265
|
*/
|
|
263
266
|
async function revokeCurrentRefreshToken() {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
267
|
+
let serverUrl;
|
|
268
|
+
let refreshToken;
|
|
269
|
+
try {
|
|
270
|
+
const cfg = (0, config_1.loadConfig)();
|
|
271
|
+
serverUrl = cfg.baseURL;
|
|
272
|
+
const read = (0, auth_storage_1.readFromBackend)(cfg.baseURL);
|
|
273
|
+
if (!read.bundle)
|
|
274
|
+
return { outcome: 'not_sent', reason: 'no_credential' };
|
|
275
|
+
refreshToken = read.bundle.refreshToken;
|
|
276
|
+
}
|
|
277
|
+
catch (err) {
|
|
278
|
+
return {
|
|
279
|
+
outcome: 'not_sent',
|
|
280
|
+
reason: 'read_failed',
|
|
281
|
+
detail: err instanceof Error ? err.message : String(err),
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
if (!refreshToken)
|
|
285
|
+
return { outcome: 'not_sent', reason: 'no_refresh_token' };
|
|
286
|
+
return (0, auth_core_1.revokeDaemonRefreshSessionReported)(serverUrl, refreshToken);
|
|
269
287
|
}
|
package/dist/lib/roles.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export declare const roleApi: {
|
|
|
53
53
|
config?: Record<string, unknown> | undefined;
|
|
54
54
|
}[];
|
|
55
55
|
sources: {
|
|
56
|
-
source: "space" | "tasks" | "memory" | "daemon" | "email" | "goal" | "files" | "local" | "browser" | "conversations" | "slack" | "github" | "messages" | "calendar" | "docs" | "metrics" | "agent_run" | "
|
|
56
|
+
source: "space" | "tasks" | "memory" | "daemon" | "email" | "goal" | "files" | "local" | "browser" | "conversations" | "slack" | "agent_initiatives" | "github" | "messages" | "calendar" | "docs" | "metrics" | "agent_run" | "documents" | "product_metrics" | "business_metrics" | "state_monitor" | "monitor";
|
|
57
57
|
enabled: boolean;
|
|
58
58
|
config?: Record<string, unknown> | undefined;
|
|
59
59
|
}[];
|
|
@@ -5,6 +5,7 @@ exports.statusArgsForStart = statusArgsForStart;
|
|
|
5
5
|
exports.parseRuntimeStartStatus = parseRuntimeStartStatus;
|
|
6
6
|
exports.daemonLoginRecoveryCommand = daemonLoginRecoveryCommand;
|
|
7
7
|
exports.verifyRuntimeStart = verifyRuntimeStart;
|
|
8
|
+
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
8
9
|
const keychain_1 = require("./keychain");
|
|
9
10
|
/** Matches the runtime's EX_CONFIG result for a permanent local configuration failure. */
|
|
10
11
|
exports.DAEMON_START_REAUTH_EXIT = 78;
|
|
@@ -19,10 +20,7 @@ function asString(value) {
|
|
|
19
20
|
return typeof value === 'string' && value.length > 0 ? value : null;
|
|
20
21
|
}
|
|
21
22
|
function profileFromArgv(argv) {
|
|
22
|
-
return (
|
|
23
|
-
process.env.OVERSKY_PROFILE ??
|
|
24
|
-
(0, keychain_1.getActiveProfile)() ??
|
|
25
|
-
keychain_1.DEFAULT_PROFILE);
|
|
23
|
+
return (0, keychain_1.profileForChildProcess)(argv);
|
|
26
24
|
}
|
|
27
25
|
function quoteShellArg(value) {
|
|
28
26
|
return /^[A-Za-z0-9_./:@+=-]+$/.test(value) ? value : `'${value.replaceAll("'", "'\\''")}'`;
|
|
@@ -33,8 +31,7 @@ function quoteShellArg(value) {
|
|
|
33
31
|
* `status` here and normalized by execRuntimeBinary before spawning.
|
|
34
32
|
*/
|
|
35
33
|
function statusArgsForStart(argv) {
|
|
36
|
-
|
|
37
|
-
return requested ? ['status', '--json', '--profile', requested] : ['status', '--json'];
|
|
34
|
+
return ['status', '--json', ...(0, auth_core_1.explicitProfileArgs)(profileFromArgv(argv))];
|
|
38
35
|
}
|
|
39
36
|
function parseRuntimeStartStatus(value, fallbackProfile) {
|
|
40
37
|
const root = asRecord(value);
|
package/dist/lib/schedule.d.ts
CHANGED
|
@@ -6,6 +6,17 @@ export interface TodoTaskRef {
|
|
|
6
6
|
titleSnapshot: string;
|
|
7
7
|
statusSnapshot: string;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* A direct Commitment block (Smart Schedule only). The server revalidates it at
|
|
11
|
+
* approval, so the CLI carries the draft's reference through untouched.
|
|
12
|
+
*/
|
|
13
|
+
export interface TodoCommitmentRef {
|
|
14
|
+
commitmentId: string;
|
|
15
|
+
titleSnapshot?: string;
|
|
16
|
+
kindSnapshot?: string;
|
|
17
|
+
versionSnapshot: number;
|
|
18
|
+
actionReason?: string;
|
|
19
|
+
}
|
|
9
20
|
export interface Todo {
|
|
10
21
|
id: string;
|
|
11
22
|
agentId: string;
|
|
@@ -48,6 +59,24 @@ export interface ProposedTodo {
|
|
|
48
59
|
confidence?: TodoConfidence;
|
|
49
60
|
dropped?: boolean;
|
|
50
61
|
taskRefs?: TodoTaskRef[];
|
|
62
|
+
commitmentRefs?: TodoCommitmentRef[];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* A block from the previously approved plan that approving this draft cancels
|
|
66
|
+
* without the draft listing it (OSK-22419). Absent when approval retires nothing.
|
|
67
|
+
*/
|
|
68
|
+
export interface ReplacementPreview {
|
|
69
|
+
fromVersion?: number;
|
|
70
|
+
blocks: Array<{
|
|
71
|
+
todoId: string;
|
|
72
|
+
name: string;
|
|
73
|
+
runAt: string;
|
|
74
|
+
durationMinutes?: number;
|
|
75
|
+
taskRefs?: Array<{
|
|
76
|
+
taskId: string;
|
|
77
|
+
titleSnapshot?: string;
|
|
78
|
+
}>;
|
|
79
|
+
}>;
|
|
51
80
|
}
|
|
52
81
|
export interface WorkingHoursWindow {
|
|
53
82
|
start: string;
|
|
@@ -57,7 +86,10 @@ export interface WorkingHoursWindow {
|
|
|
57
86
|
export interface SmartScheduleProposal {
|
|
58
87
|
proposalId: string;
|
|
59
88
|
agentId: string;
|
|
60
|
-
status?: 'pending' | 'approved' | 'dismissed' | 'superseded' | 'expired';
|
|
89
|
+
status?: 'pending' | 'approving' | 'approved' | 'dismissed' | 'superseded' | 'expired';
|
|
90
|
+
/** The local calendar day (YYYY-MM-DD, in `timezone`) this plan covers. */
|
|
91
|
+
planDate?: string;
|
|
92
|
+
version?: number;
|
|
61
93
|
generatedAt: string;
|
|
62
94
|
expiresAt?: string;
|
|
63
95
|
timezone: string;
|
|
@@ -70,6 +102,7 @@ export interface SmartScheduleProposal {
|
|
|
70
102
|
truncated: boolean;
|
|
71
103
|
};
|
|
72
104
|
todos: ProposedTodo[];
|
|
105
|
+
replacementPreview?: ReplacementPreview;
|
|
73
106
|
nextRunSuggestion?: {
|
|
74
107
|
runAt: string;
|
|
75
108
|
reason?: string;
|
|
@@ -87,8 +120,37 @@ export interface TriggerCapacity {
|
|
|
87
120
|
scopeKind: string;
|
|
88
121
|
active: number;
|
|
89
122
|
limit: number;
|
|
123
|
+
/** True when the owner has no cap of their own; `limit` is then the platform ceiling. */
|
|
124
|
+
unlimited?: boolean;
|
|
90
125
|
remaining: number;
|
|
91
126
|
reclaimable: number;
|
|
127
|
+
/** Whether approving would find the schedule-check watcher already installed. */
|
|
128
|
+
deltaWatcherInstalled?: boolean | null;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* The server's record of whether a plan is being generated for one agent-day.
|
|
132
|
+
*
|
|
133
|
+
* `holds` is the single answer to "may I approve, dismiss or regenerate": it is
|
|
134
|
+
* true only while a request is `running` and inside its expiry. `unknown` is a
|
|
135
|
+
* `running` request that has gone quiet past the longest a planner may run — a
|
|
136
|
+
* statement about silence, not proof that anything stopped.
|
|
137
|
+
*/
|
|
138
|
+
export type PlanRequestState = 'running' | 'unknown' | 'succeeded' | 'failed';
|
|
139
|
+
export interface SmartSchedulePlanRequest {
|
|
140
|
+
requestId: string;
|
|
141
|
+
agentId: string;
|
|
142
|
+
planDate: string;
|
|
143
|
+
state: PlanRequestState;
|
|
144
|
+
holds: boolean;
|
|
145
|
+
origin?: 'requested' | 'automatic';
|
|
146
|
+
startedAt?: string;
|
|
147
|
+
expiresAt?: string;
|
|
148
|
+
finishedAt?: string;
|
|
149
|
+
proposalId?: string;
|
|
150
|
+
failure?: {
|
|
151
|
+
code: string;
|
|
152
|
+
message: string;
|
|
153
|
+
};
|
|
92
154
|
}
|
|
93
155
|
export interface ApproveTodoInput {
|
|
94
156
|
tempId?: string;
|
|
@@ -97,6 +159,8 @@ export interface ApproveTodoInput {
|
|
|
97
159
|
runAt: string;
|
|
98
160
|
timezone?: string;
|
|
99
161
|
durationMinutes?: number;
|
|
162
|
+
taskRefs?: TodoTaskRef[];
|
|
163
|
+
commitmentRefs?: TodoCommitmentRef[];
|
|
100
164
|
rationale?: string;
|
|
101
165
|
confidence?: TodoConfidence;
|
|
102
166
|
}
|
|
@@ -115,9 +179,40 @@ export interface ApproveSmartScheduleResponse {
|
|
|
115
179
|
scheduledNextRun?: {
|
|
116
180
|
created?: boolean;
|
|
117
181
|
triggerId?: string;
|
|
182
|
+
runAt?: string;
|
|
118
183
|
skippedReason?: string;
|
|
119
184
|
message?: string;
|
|
120
185
|
} | null;
|
|
186
|
+
/** Blocks of the previously approved plan this approval cancelled or kept. */
|
|
187
|
+
replaced?: {
|
|
188
|
+
cancelled?: string[];
|
|
189
|
+
kept?: string[];
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* The recurring schedule watcher an approval keeps on. `created` when this
|
|
193
|
+
* approval armed it, `skippedReason` when it was already there, switched off
|
|
194
|
+
* (`disabled_delta_watcher`), or could not be made. Absent on older servers
|
|
195
|
+
* and when an approval was only partly applied.
|
|
196
|
+
*/
|
|
197
|
+
scheduledDeltaWatcher?: DeltaWatcherOutcome | null;
|
|
198
|
+
}
|
|
199
|
+
export interface DeltaWatcherOutcome {
|
|
200
|
+
created?: boolean;
|
|
201
|
+
updated?: boolean;
|
|
202
|
+
triggerId?: string;
|
|
203
|
+
skippedReason?: string;
|
|
204
|
+
/** Wall-clock fire times (HH:MM) in `timezone`. */
|
|
205
|
+
times?: string[];
|
|
206
|
+
previousTimes?: string[];
|
|
207
|
+
timezone?: string;
|
|
208
|
+
message?: string;
|
|
209
|
+
/** Set when feedback from this very approval moved `times` after the watcher was ensured. */
|
|
210
|
+
cadenceUpdated?: boolean;
|
|
211
|
+
}
|
|
212
|
+
export interface DismissSmartScheduleResponse {
|
|
213
|
+
proposal: SmartScheduleProposal;
|
|
214
|
+
/** Present when dismissing the plan also moved the watcher's check times. */
|
|
215
|
+
deltaWatcher?: DeltaWatcherOutcome;
|
|
121
216
|
}
|
|
122
217
|
/**
|
|
123
218
|
* The self-schedule TRACE — why the agent's day looks the way it does.
|
|
@@ -155,11 +250,32 @@ export interface ScheduleTrace {
|
|
|
155
250
|
};
|
|
156
251
|
sourcePolicy?: Record<string, string>;
|
|
157
252
|
events?: ScheduleTraceEvent[];
|
|
253
|
+
/** Whether a plan is being generated for this day, failed, or went quiet. */
|
|
254
|
+
planRequest?: SmartSchedulePlanRequest | null;
|
|
158
255
|
has_more?: boolean;
|
|
159
256
|
next_cursor?: string | null;
|
|
160
257
|
}
|
|
161
258
|
/** Calendar day at an instant in the zone used for the schedule query. */
|
|
162
259
|
export declare function scheduleTraceToday(now: Date, timezone: string): string;
|
|
260
|
+
/**
|
|
261
|
+
* This machine's IANA zone — the "viewer" zone the web client also sends
|
|
262
|
+
* (`browserTimeZone()` on propose, list and trace). `UTC` only when the runtime
|
|
263
|
+
* cannot say.
|
|
264
|
+
*/
|
|
265
|
+
export declare function machineTimeZone(): string;
|
|
266
|
+
export declare function isValidTimeZone(timeZone: string): boolean;
|
|
267
|
+
/** `America/Vancouver (PST)` — a zone name plus what it is called right now. */
|
|
268
|
+
export declare function describeTimeZone(timeZone: string, at?: Date): string;
|
|
269
|
+
/**
|
|
270
|
+
* One zone for one agent-day, for every Smart Schedule command that names a
|
|
271
|
+
* "today": `--timezone` when given, otherwise this machine's. `plan-day`,
|
|
272
|
+
* `schedule-trace`, `schedule-overview` and `todos list` used to default to
|
|
273
|
+
* three different zones (the server's last-seen browser zone, this machine, and
|
|
274
|
+
* UTC), so the same minute was a different day depending on the command
|
|
275
|
+
* (OSK-22397, OSK-22398). Returns `null` for an invalid explicit zone so the
|
|
276
|
+
* caller can fail with its own message.
|
|
277
|
+
*/
|
|
278
|
+
export declare function resolveDayTimeZone(flag?: string): string | null;
|
|
163
279
|
export declare function scheduleTracePath(params: {
|
|
164
280
|
agentId: string;
|
|
165
281
|
date: string;
|
|
@@ -196,6 +312,8 @@ export declare const scheduleApi: {
|
|
|
196
312
|
}) => Promise<SmartScheduleProposal>;
|
|
197
313
|
pendingProposal: (agentId: string) => Promise<{
|
|
198
314
|
proposal: SmartScheduleProposal | null;
|
|
315
|
+
/** Absent from older servers; null when no request is on record. */
|
|
316
|
+
planRequest?: SmartSchedulePlanRequest | null;
|
|
199
317
|
}>;
|
|
200
318
|
approveSmartSchedule: (input: {
|
|
201
319
|
agentId: string;
|
|
@@ -205,9 +323,7 @@ export declare const scheduleApi: {
|
|
|
205
323
|
saveHoursAsDefault?: boolean;
|
|
206
324
|
workingHours?: WorkingHoursWindow;
|
|
207
325
|
}) => Promise<ApproveSmartScheduleResponse>;
|
|
208
|
-
dismissProposal: (proposalId: string, agentId?: string) => Promise<
|
|
209
|
-
proposal: SmartScheduleProposal;
|
|
210
|
-
}>;
|
|
326
|
+
dismissProposal: (proposalId: string, agentId?: string) => Promise<DismissSmartScheduleResponse>;
|
|
211
327
|
};
|
|
212
328
|
/**
|
|
213
329
|
* Is this actually a proposal?
|
|
@@ -228,22 +344,86 @@ export declare function isSmartScheduleProposal(value: unknown): value is SmartS
|
|
|
228
344
|
* HTML error page, and dumping it into the user's terminal helps nobody.
|
|
229
345
|
*/
|
|
230
346
|
export declare function describeNonProposal(value: unknown): string;
|
|
347
|
+
/**
|
|
348
|
+
* One sentence for a plan request a person should know about, or null when
|
|
349
|
+
* there is nothing to say (no record, or a plan that simply succeeded).
|
|
350
|
+
*
|
|
351
|
+
* The same four states the web panel shows, worded for a terminal. `unknown`
|
|
352
|
+
* says what is true — the request stopped reporting — and does not claim the
|
|
353
|
+
* planner stopped.
|
|
354
|
+
*/
|
|
355
|
+
export declare function describePlanRequest(request: SmartSchedulePlanRequest | null | undefined, now?: Date): string | null;
|
|
231
356
|
/** Explain terminal policy outcomes without changing the machine-readable status. */
|
|
232
357
|
export declare function todoPolicyBlockMessage(reason?: string): string | undefined;
|
|
233
358
|
/** Print explanations alongside the trace rows that recorded policy blocks. */
|
|
234
359
|
export declare function renderTodoPolicyTraceDetails(events: ScheduleTraceEvent[], log: (line: string) => void): void;
|
|
235
|
-
/**
|
|
236
|
-
|
|
360
|
+
/**
|
|
361
|
+
* Render a To-Do list as a table. `timeZone` names the zone the WHEN column is
|
|
362
|
+
* shown in (and is labelled on every row); omitted, rows keep the raw UTC
|
|
363
|
+
* instant the older output printed.
|
|
364
|
+
*/
|
|
365
|
+
export declare function renderTodoList(todos: Todo[], log: (line: string) => void, timeZone?: string): void;
|
|
237
366
|
/**
|
|
238
367
|
* Warn at REVIEW time when approving this plan is likely to hit the wall.
|
|
239
368
|
*
|
|
240
369
|
* Silent when there is comfortable headroom — a budget line on every plan is
|
|
241
370
|
* noise, and noise is how a real warning gets ignored. It speaks up only when
|
|
242
371
|
* the budget is exhausted or nearly so, and always names the remediation
|
|
243
|
-
* rather than just the number.
|
|
372
|
+
* rather than just the number. An owner with no cap of their own never sees it.
|
|
373
|
+
*
|
|
374
|
+
* `agentId` makes the remedy a command that can be pasted; without it the
|
|
375
|
+
* command keeps a placeholder, which is only right when the caller cannot know.
|
|
376
|
+
*/
|
|
377
|
+
export declare function renderCapacityWarning(capacity: TriggerCapacity | undefined, log: (line: string) => void, agentId?: string, phase?: 'review' | 'approved'): void;
|
|
378
|
+
/**
|
|
379
|
+
* Name the earlier blocks approval will cancel BEFORE the reviewer approves.
|
|
380
|
+
* The draft lists only what it adds, so without this the cancellation is only
|
|
381
|
+
* discoverable afterwards in the schedule trace (OSK-22419).
|
|
382
|
+
*/
|
|
383
|
+
export declare function renderReplacementPreview(preview: ReplacementPreview | undefined, zone: string, log: (line: string) => void): void;
|
|
384
|
+
/** The proposed to-dos a person would be approving (dropped ones are not). */
|
|
385
|
+
export declare function liveProposedTodos(proposal: SmartScheduleProposal): ProposedTodo[];
|
|
386
|
+
/**
|
|
387
|
+
* Render a Smart Schedule proposal: header + the proposed (non-dropped) to-dos.
|
|
388
|
+
*
|
|
389
|
+
* Every instant is shown in the PLAN's zone and says which: a draft that "stays
|
|
390
|
+
* until midnight" is only readable as `00:00 PST`, not as `08:00Z` (OSK-22397).
|
|
391
|
+
* `--json` keeps the raw UTC instants.
|
|
244
392
|
*/
|
|
245
|
-
export declare function renderCapacityWarning(capacity: TriggerCapacity | undefined, log: (line: string) => void): void;
|
|
246
|
-
/** Render a Smart Schedule proposal: header + the proposed (non-dropped) to-dos. */
|
|
247
393
|
export declare function renderProposal(proposal: SmartScheduleProposal, log: (line: string) => void): void;
|
|
394
|
+
/**
|
|
395
|
+
* The commands that can succeed for THIS draft, in the order a person would
|
|
396
|
+
* reach for them.
|
|
397
|
+
*
|
|
398
|
+
* The footer used to be one generic three-line block, so an EMPTY draft led with
|
|
399
|
+
* `--approve`, which the same command refuses ("no schedulable to-dos"): the
|
|
400
|
+
* very first suggestion failed (OSK-22396). An empty draft can only be accepted
|
|
401
|
+
* together with its suggested next run, so that is the one accept command it
|
|
402
|
+
* prints; with no next run to schedule there is nothing to accept and the only
|
|
403
|
+
* move left is to discard it.
|
|
404
|
+
*/
|
|
405
|
+
export declare function proposalNextSteps(proposal: SmartScheduleProposal, bin: string, agentId: string): string[];
|
|
406
|
+
/**
|
|
407
|
+
* What an approval left behind besides To-Dos: the next planning run and the
|
|
408
|
+
* recurring watcher. The server always did both; only the next run was ever
|
|
409
|
+
* printed, so `upcoming` was the one place a person found the watcher
|
|
410
|
+
* (OSK-22403). Wording follows the web's approval notice.
|
|
411
|
+
*/
|
|
412
|
+
export declare function approvalEffectLines(result: ApproveSmartScheduleResponse, options: {
|
|
413
|
+
approvedNextRun: boolean;
|
|
414
|
+
timeZone: string;
|
|
415
|
+
bin: string;
|
|
416
|
+
agentId: string;
|
|
417
|
+
}): string[];
|
|
418
|
+
/**
|
|
419
|
+
* Dismissing is plan feedback, and feedback may move the watcher's check times.
|
|
420
|
+
* Say which happened, so "why did the watcher fire at 11:00 and not 02:00" is
|
|
421
|
+
* never answerable only by diffing triggers before and after (OSK-22407).
|
|
422
|
+
*/
|
|
423
|
+
export declare function dismissEffectLines(result: DismissSmartScheduleResponse): string[];
|
|
248
424
|
/** Map a proposal's live todos into the approve-payload shape (approve all). */
|
|
249
425
|
export declare function proposalToApproveTodos(proposal: SmartScheduleProposal): ApproveTodoInput[];
|
|
426
|
+
/** An instant for a person: in `timeZone` with the zone named; raw UTC when none is given. */
|
|
427
|
+
export declare function formatStamp(value: string | undefined, timeZone?: string, options?: {
|
|
428
|
+
seconds?: boolean;
|
|
429
|
+
}): string;
|