@skrr-ai/cli 0.1.118 → 0.1.120
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/dist/base-command.d.ts +32 -0
- package/dist/base-command.js +113 -5
- package/dist/commands/commands.js +11 -0
- package/dist/commands/commitments/action-proposal.d.ts +13 -0
- package/dist/commands/commitments/action-proposal.js +39 -0
- package/dist/commands/commitments/action-proposals/decide.js +8 -1
- package/dist/commands/commitments/action-proposals/execute.js +11 -1
- package/dist/commands/commitments/create.js +2 -2
- package/dist/commands/commitments/doctor.d.ts +8 -0
- package/dist/commands/commitments/doctor.js +22 -0
- package/dist/commands/commitments/execute-remediation.js +12 -1
- package/dist/commands/commitments/observations.js +2 -2
- package/dist/commands/commitments/pack/bind.d.ts +18 -1
- package/dist/commands/commitments/pack/bind.js +66 -8
- package/dist/commands/commitments/pack/plan.d.ts +4 -1
- package/dist/commands/commitments/pack/plan.js +30 -2
- package/dist/commands/commitments/update.js +8 -2
- package/dist/commands/completion/index.js +1 -1
- package/dist/commands/completion/values.js +1 -1
- package/dist/commands/computer-use/audio.d.ts +1 -0
- package/dist/commands/computer-use/audio.js +1 -0
- package/dist/commands/computer-use/browser.d.ts +1 -0
- package/dist/commands/computer-use/browser.js +1 -0
- package/dist/commands/computer-use/disable.d.ts +1 -0
- package/dist/commands/computer-use/disable.js +1 -0
- package/dist/commands/computer-use/enable.d.ts +1 -0
- package/dist/commands/computer-use/enable.js +1 -0
- package/dist/commands/computer-use/index.d.ts +1 -0
- package/dist/commands/computer-use/index.js +1 -0
- package/dist/commands/computer-use/install.d.ts +1 -0
- package/dist/commands/computer-use/install.js +1 -0
- package/dist/commands/computer-use/recover.d.ts +1 -0
- package/dist/commands/computer-use/recover.js +1 -0
- package/dist/commands/computer-use/status.d.ts +1 -0
- package/dist/commands/computer-use/status.js +1 -0
- package/dist/commands/computer-use/stop.d.ts +1 -0
- package/dist/commands/computer-use/stop.js +1 -0
- package/dist/commands/context.js +16 -11
- package/dist/commands/convos/recovery.js +1 -1
- package/dist/commands/daemon/diagnostics.d.ts +9 -0
- package/dist/commands/daemon/diagnostics.js +53 -0
- package/dist/commands/daemon/index.js +2 -0
- package/dist/commands/daemon/maintenance/attest.d.ts +15 -0
- package/dist/commands/daemon/maintenance/attest.js +52 -0
- package/dist/commands/daemon/maintenance/hold.d.ts +17 -0
- package/dist/commands/daemon/maintenance/hold.js +70 -0
- package/dist/commands/daemon/maintenance/index.d.ts +12 -0
- package/dist/commands/daemon/maintenance/index.js +30 -0
- package/dist/commands/daemon/maintenance/resume.d.ts +13 -0
- package/dist/commands/daemon/maintenance/resume.js +36 -0
- package/dist/commands/daemon/maintenance/status.d.ts +13 -0
- package/dist/commands/daemon/maintenance/status.js +36 -0
- package/dist/commands/doctor.d.ts +4 -1
- package/dist/commands/doctor.js +50 -6
- package/dist/commands/followups/plans/cancel-batch.js +6 -3
- package/dist/commands/followups/plans/capacity.js +7 -3
- package/dist/commands/followups/plans/observability.js +11 -3
- package/dist/commands/followups/plans/preferences/set.js +26 -8
- package/dist/commands/followups/plans/preferences.js +1 -1
- package/dist/commands/followups/plans/show.js +1 -1
- package/dist/commands/goals/key-results/assess.d.ts +36 -0
- package/dist/commands/goals/key-results/assess.js +110 -0
- package/dist/commands/goals/key-results/history.d.ts +30 -0
- package/dist/commands/goals/key-results/history.js +104 -0
- package/dist/commands/goals/key-results/list.d.ts +5 -4
- package/dist/commands/goals/key-results/list.js +12 -6
- package/dist/commands/goals/key-results/show.d.ts +4 -2
- package/dist/commands/goals/key-results/show.js +25 -4
- package/dist/commands/goals/key-results/update.d.ts +4 -0
- package/dist/commands/goals/key-results/update.js +18 -24
- package/dist/commands/goals/plan-now.js +12 -1
- package/dist/commands/goals/planner-compare.d.ts +30 -0
- package/dist/commands/goals/planner-compare.js +136 -0
- package/dist/commands/machines/dedicated/service/exec.d.ts +3 -0
- package/dist/commands/machines/dedicated/service/exec.js +70 -11
- package/dist/commands/machines/hosted/destroy.d.ts +1 -0
- package/dist/commands/machines/hosted/destroy.js +11 -1
- package/dist/commands/machines/hosted/exec.d.ts +1 -0
- package/dist/commands/machines/hosted/exec.js +12 -1
- package/dist/commands/machines/hosted/index.js +1 -0
- package/dist/commands/machines/hosted/operation.d.ts +14 -0
- package/dist/commands/machines/hosted/operation.js +51 -0
- package/dist/commands/machines/hosted/pull.js +1 -1
- package/dist/commands/machines/hosted/start.js +6 -2
- package/dist/commands/memory/versions/list.d.ts +2 -0
- package/dist/commands/memory/versions/list.js +3 -2
- package/dist/commands/memory/versions/show.d.ts +2 -0
- package/dist/commands/memory/versions/show.js +3 -2
- package/dist/commands/spaces/auto-executor/compare.d.ts +18 -0
- package/dist/commands/spaces/auto-executor/compare.js +139 -0
- package/dist/commands/spaces/auto-executor/runs.d.ts +3 -0
- package/dist/commands/spaces/auto-executor/runs.js +13 -1
- package/dist/commands/spaces/charter/create-from-description.d.ts +21 -0
- package/dist/commands/spaces/charter/create-from-description.js +77 -0
- package/dist/commands/spaces/charter/show.d.ts +22 -0
- package/dist/commands/spaces/charter/show.js +61 -0
- package/dist/commands/spaces/heartbeats/list.d.ts +1 -16
- package/dist/commands/spaces/heartbeats/list.js +13 -0
- package/dist/commands/spaces/install-template.js +3 -0
- package/dist/commands/spaces/loops/migrate.d.ts +32 -0
- package/dist/commands/spaces/loops/migrate.js +103 -0
- package/dist/commands/spaces/loops/release.d.ts +14 -0
- package/dist/commands/spaces/loops/release.js +59 -0
- package/dist/commands/spaces/notebook.d.ts +25 -0
- package/dist/commands/spaces/notebook.js +75 -0
- package/dist/commands/spaces/proposals/discard.d.ts +17 -0
- package/dist/commands/spaces/proposals/discard.js +17 -0
- package/dist/commands/spaces/proposals/keep.d.ts +17 -0
- package/dist/commands/spaces/proposals/keep.js +17 -0
- package/dist/commands/spaces/proposals/list.d.ts +24 -0
- package/dist/commands/spaces/proposals/list.js +89 -0
- package/dist/commands/spaces/skills/propose.d.ts +29 -0
- package/dist/commands/spaces/skills/propose.js +82 -0
- package/dist/commands/spaces/templates/fork.js +3 -0
- package/dist/commands/spaces/triggers/show.js +6 -0
- package/dist/commands/spaces/workflows/retry.d.ts +1 -0
- package/dist/commands/spaces/workflows/retry.js +8 -1
- package/dist/commands/spaces/workflows/triggers/create.js +3 -2
- package/dist/commands/spaces/workflows/triggers/fire.js +4 -0
- package/dist/commands/spaces/workflows/triggers/update.js +2 -1
- package/dist/commands/spaces/write-policy/set.d.ts +22 -0
- package/dist/commands/spaces/write-policy/set.js +82 -0
- package/dist/commands/spaces/write-policy/show.d.ts +19 -0
- package/dist/commands/spaces/write-policy/show.js +49 -0
- package/dist/commands/store/artifacts/receipt.d.ts +14 -0
- package/dist/commands/store/artifacts/receipt.js +34 -0
- package/dist/commands/store/artifacts/release.d.ts +2 -0
- package/dist/commands/store/artifacts/release.js +11 -0
- package/dist/commands/store/governance/publish-release.d.ts +2 -0
- package/dist/commands/store/governance/publish-release.js +30 -1
- package/dist/commands/store/governance/release-receipt.d.ts +12 -0
- package/dist/commands/store/governance/release-receipt.js +32 -0
- package/dist/commands/tasks/approvals/list.d.ts +11 -5
- package/dist/commands/tasks/approvals/list.js +13 -6
- package/dist/commands/tasks/attachments/facts.d.ts +12 -0
- package/dist/commands/tasks/attachments/facts.js +29 -0
- package/dist/commands/tasks/attachments/upload.d.ts +1 -0
- package/dist/commands/tasks/attachments/upload.js +16 -0
- package/dist/commands/tasks/bulk-update.js +35 -1
- package/dist/commands/tasks/context.d.ts +15 -0
- package/dist/commands/tasks/context.js +69 -0
- package/dist/commands/tasks/copy.d.ts +18 -0
- package/dist/commands/tasks/copy.js +85 -0
- package/dist/commands/tasks/create-tree.js +97 -23
- package/dist/commands/tasks/create.js +9 -1
- package/dist/commands/tasks/deliverable/add.js +20 -10
- package/dist/commands/tasks/move.js +8 -1
- package/dist/commands/tasks/operations/show.d.ts +16 -0
- package/dist/commands/tasks/operations/show.js +98 -0
- package/dist/commands/tasks/operations/wait.d.ts +22 -0
- package/dist/commands/tasks/operations/wait.js +114 -0
- package/dist/commands/tasks/preflight.d.ts +1 -0
- package/dist/commands/tasks/preflight.js +11 -1
- package/dist/commands/tasks/rearm-recurrence.js +4 -0
- package/dist/commands/tasks/result/show.js +22 -0
- package/dist/commands/tasks/result/submit.d.ts +1 -0
- package/dist/commands/tasks/result/submit.js +3 -0
- package/dist/commands/tasks/retry-receipt.d.ts +15 -0
- package/dist/commands/tasks/retry-receipt.js +89 -0
- package/dist/commands/tasks/retry-review.d.ts +16 -0
- package/dist/commands/tasks/retry-review.js +66 -0
- package/dist/commands/tasks/retry.d.ts +4 -8
- package/dist/commands/tasks/retry.js +34 -68
- package/dist/commands/tasks/runs.d.ts +21 -0
- package/dist/commands/tasks/runs.js +95 -0
- package/dist/commands/tasks/show.d.ts +2 -0
- package/dist/commands/tasks/show.js +15 -1
- package/dist/commands/tasks/start-receipt.d.ts +15 -0
- package/dist/commands/tasks/start-receipt.js +95 -0
- package/dist/commands/tasks/start.d.ts +4 -0
- package/dist/commands/tasks/start.js +49 -3
- package/dist/commands/tasks/update.js +3 -0
- package/dist/commands/tasks/upsert.js +17 -3
- package/dist/commands/tasks/watch.d.ts +3 -0
- package/dist/commands/tasks/watch.js +85 -20
- package/dist/commands/wiki/history.d.ts +33 -0
- package/dist/commands/wiki/history.js +134 -0
- package/dist/commands/wiki/ls.d.ts +2 -0
- package/dist/commands/wiki/ls.js +8 -0
- package/dist/commands/wiki/update.d.ts +3 -1
- package/dist/commands/wiki/update.js +24 -2
- package/dist/commands/wiki/write.d.ts +22 -0
- package/dist/commands/wiki/write.js +144 -6
- package/dist/generated/agent-guides.json +81 -81
- package/dist/generated/managed-instruction-guides.json +1 -1
- package/dist/lib/agent-guides.d.ts +9 -0
- package/dist/lib/agent-guides.js +23 -1
- package/dist/lib/agentic-stream.d.ts +5 -0
- package/dist/lib/agentic-stream.js +122 -3
- package/dist/lib/api-fetch.d.ts +4 -0
- package/dist/lib/api-fetch.js +25 -7
- package/dist/lib/auth-diagnostics.d.ts +39 -0
- package/dist/lib/auth-diagnostics.js +71 -0
- package/dist/lib/cli-client-identity.d.ts +6 -0
- package/dist/lib/cli-client-identity.js +16 -0
- package/dist/lib/cli-installation-diagnostics.d.ts +52 -0
- package/dist/lib/cli-installation-diagnostics.js +254 -0
- package/dist/lib/command-hygiene.d.ts +45 -0
- package/dist/lib/command-hygiene.js +413 -0
- package/dist/lib/commitments.d.ts +64 -3
- package/dist/lib/commitments.js +34 -6
- package/dist/lib/completion-index.d.ts +16 -4
- package/dist/lib/completion-index.js +50 -14
- package/dist/lib/config.js +7 -1
- package/dist/lib/daemon-maintenance-command.d.ts +22 -0
- package/dist/lib/daemon-maintenance-command.js +39 -0
- package/dist/lib/daemon-maintenance.d.ts +275 -0
- package/dist/lib/daemon-maintenance.js +1035 -0
- package/dist/lib/dedicated-service.d.ts +3 -2
- package/dist/lib/dedicated-service.js +11 -3
- package/dist/lib/governed-store.d.ts +8 -0
- package/dist/lib/governed-store.js +5 -0
- package/dist/lib/hosted-machines.d.ts +33 -2
- package/dist/lib/hosted-machines.js +19 -1
- package/dist/lib/json-output.d.ts +1 -1
- package/dist/lib/machines.d.ts +9 -1
- package/dist/lib/machines.js +15 -1
- package/dist/lib/memory-history-session.d.ts +14 -0
- package/dist/lib/memory-history-session.js +60 -0
- package/dist/lib/node-adapter.js +13 -0
- package/dist/lib/record-output.d.ts +22 -0
- package/dist/lib/record-output.js +78 -0
- package/dist/lib/roles.d.ts +3 -3
- package/dist/lib/scoped-memory-command.d.ts +24 -0
- package/dist/lib/scoped-memory-command.js +87 -5
- package/dist/lib/space-charter.d.ts +49 -0
- package/dist/lib/space-charter.js +78 -0
- package/dist/lib/space-loop-migration.d.ts +18 -0
- package/dist/lib/space-loop-migration.js +128 -0
- package/dist/lib/space-notebook.d.ts +22 -0
- package/dist/lib/space-notebook.js +140 -0
- package/dist/lib/space-proposal-decision-command.d.ts +36 -0
- package/dist/lib/space-proposal-decision-command.js +108 -0
- package/dist/lib/space-proposals.d.ts +44 -0
- package/dist/lib/space-proposals.js +186 -0
- package/dist/lib/space-templates.d.ts +8 -0
- package/dist/lib/space-templates.js +17 -0
- package/dist/lib/space-write-policy.d.ts +24 -0
- package/dist/lib/space-write-policy.js +103 -0
- package/dist/lib/task-agent-context-capabilities.d.ts +10 -0
- package/dist/lib/task-agent-context-capabilities.js +22 -0
- package/dist/lib/task-agent-context-compatibility.d.ts +9 -0
- package/dist/lib/task-agent-context-compatibility.js +30 -0
- package/dist/lib/task-asset-upload.d.ts +22 -0
- package/dist/lib/task-asset-upload.js +257 -29
- package/dist/lib/task-batch.d.ts +15 -1
- package/dist/lib/task-batch.js +35 -2
- package/dist/lib/task-operation-watch.d.ts +66 -0
- package/dist/lib/task-operation-watch.js +159 -0
- package/dist/lib/task-resolver.d.ts +1 -1
- package/dist/lib/task-resolver.js +4 -3
- package/dist/lib/task-runtime-headers.js +13 -3
- package/dist/lib/task-work.d.ts +1 -1
- package/dist/lib/task-work.js +35 -1
- package/dist/lib/task-write-attribution.d.ts +14 -0
- package/dist/lib/task-write-attribution.js +35 -2
- package/dist/lib/triggers.d.ts +11 -0
- package/dist/lib/triggers.js +7 -0
- package/dist/lib/wiki-update.d.ts +1 -0
- package/dist/lib/wiki-update.js +10 -1
- package/dist/lib/wiki.js +4 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.d.ts +9 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.js +31 -15
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonToolApproval.js +1 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.js +13 -7
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/guidedUpdate.d.ts +370 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/guidedUpdate.js +315 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/maintenanceReportWire.d.ts +178 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/maintenanceReportWire.js +262 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.d.ts +51 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.js +106 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.d.ts +9 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.js +32 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonToolApproval.js +1 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.js +33 -14
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/guidedUpdate.d.ts +370 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/guidedUpdate.js +404 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/maintenanceReportWire.d.ts +178 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/maintenanceReportWire.js +342 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.d.ts +51 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.js +138 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +20 -0
- package/dist/node_modules/@skrr-ai/data-provider/index.js +27085 -20250
- package/oclif.manifest.json +10570 -7247
- package/package.json +20 -2
package/dist/base-command.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ import { dataService } from '@skrr-ai/data-provider';
|
|
|
5
5
|
import { type WriteTarget } from './lib/write-target';
|
|
6
6
|
import { type AssigneeResolution, type MemberKind, type SpaceMember } from './lib/assignee-resolver';
|
|
7
7
|
import { type CliConfig } from './lib/config';
|
|
8
|
+
import { type AuthResolutionDiagnostic } from './lib/auth-diagnostics';
|
|
9
|
+
import { type CompletionCacheScope } from './lib/completion-index';
|
|
8
10
|
import { type OutboxMethod } from './lib/outbox';
|
|
9
11
|
import { type CredentialProvenance, type ResolvedCredential } from './lib/credential-resolver';
|
|
10
12
|
import { type BrokerRefusalDescription } from './lib/daemonBrokerRefusal';
|
|
@@ -32,6 +34,7 @@ export declare abstract class BaseCommand extends Command {
|
|
|
32
34
|
* acquiring unrelated account authority. Human invocations are unaffected.
|
|
33
35
|
*/
|
|
34
36
|
static autonomousCredentialPolicy: 'delegated' | 'bound-session';
|
|
37
|
+
static sessionReadPolicy?: 'memory-history-v1';
|
|
35
38
|
/** Add the owning agent's web detail link without overwriting resource URLs. */
|
|
36
39
|
protected withAgentContext<T>(agentId: string, value: T): T & {
|
|
37
40
|
agentUrl: string | null;
|
|
@@ -81,6 +84,15 @@ export declare abstract class BaseCommand extends Command {
|
|
|
81
84
|
protected printJsonResult(value: unknown, options?: {
|
|
82
85
|
ok?: boolean;
|
|
83
86
|
}): void;
|
|
87
|
+
/**
|
|
88
|
+
* A task write the Space write policy HELD for approval (OSK-17988): the
|
|
89
|
+
* server answered `202 { status: 'pending_approval' }` and wrote nothing.
|
|
90
|
+
* Prints it as that, never as a created or updated task, and returns true so
|
|
91
|
+
* the command stops there (exit 0: the request was accepted, not refused).
|
|
92
|
+
*/
|
|
93
|
+
protected reportHeldSpaceWrite(result: unknown, { json }?: {
|
|
94
|
+
json?: boolean;
|
|
95
|
+
}): boolean;
|
|
84
96
|
private jsonOperationContext?;
|
|
85
97
|
/** Opt in at the command boundary, including its existing structured errors. */
|
|
86
98
|
protected setJsonOperation(options: Partial<CliOperationOptions>): void;
|
|
@@ -96,6 +108,8 @@ export declare abstract class BaseCommand extends Command {
|
|
|
96
108
|
* from here.
|
|
97
109
|
*/
|
|
98
110
|
protected resolvedCredential: ResolvedCredential;
|
|
111
|
+
/** Completion references follow the same principal and workspace as requests. */
|
|
112
|
+
protected completionCacheScope(): CompletionCacheScope | null;
|
|
99
113
|
/** Re-authorize a long-lived transport using this command's credential
|
|
100
114
|
* source. A daemon handoff is redeemed again; its refresh family is never
|
|
101
115
|
* borrowed or written into the CLI's own login. */
|
|
@@ -108,6 +122,8 @@ export declare abstract class BaseCommand extends Command {
|
|
|
108
122
|
*/
|
|
109
123
|
protected credentialProvenance: CredentialProvenance | null;
|
|
110
124
|
protected bareMode: boolean;
|
|
125
|
+
/** Managed runtimes must never suggest a human's local credential store. */
|
|
126
|
+
private authManagedRuntime;
|
|
111
127
|
/**
|
|
112
128
|
* Set when the auto-broker reached a live daemon and it REFUSED the hand-off.
|
|
113
129
|
* `requireAuth()` reports it instead of a bare "Not signed in", because the
|
|
@@ -350,6 +366,11 @@ export declare abstract class BaseCommand extends Command {
|
|
|
350
366
|
* Returns `null` when not signed in.
|
|
351
367
|
*/
|
|
352
368
|
protected credentialSourceLabel(): string | null;
|
|
369
|
+
/**
|
|
370
|
+
* A machine-readable explanation of credential resolution. This carries
|
|
371
|
+
* source metadata only; neither token material nor raw URLs may escape.
|
|
372
|
+
*/
|
|
373
|
+
protected authResolution(): AuthResolutionDiagnostic;
|
|
353
374
|
protected catch(err: Error & {
|
|
354
375
|
code?: string;
|
|
355
376
|
exitCode?: number;
|
|
@@ -635,6 +656,10 @@ type UnsupportedFlagRemedy = {
|
|
|
635
656
|
fix: string;
|
|
636
657
|
targets: readonly UnsupportedFlagRemedyTarget[];
|
|
637
658
|
};
|
|
659
|
+
type MissingFlagRemedy = {
|
|
660
|
+
fix: string;
|
|
661
|
+
targets: readonly UnsupportedFlagRemedyTarget[];
|
|
662
|
+
};
|
|
638
663
|
/**
|
|
639
664
|
* Specific corrections for habitual flags that look plausible but do not belong
|
|
640
665
|
* to the command that received them. Keep the replacement command and every
|
|
@@ -642,6 +667,13 @@ type UnsupportedFlagRemedy = {
|
|
|
642
667
|
* manifest, so a useful refusal cannot slowly point at a removed form.
|
|
643
668
|
*/
|
|
644
669
|
export declare const UNSUPPORTED_FLAG_REMEDIES: Readonly<Record<string, Readonly<Record<string, UnsupportedFlagRemedy>>>>;
|
|
670
|
+
/**
|
|
671
|
+
* Required flags normally share a generic repair. A few have a meaningful
|
|
672
|
+
* choice that cannot be recovered from `<value>` alone; keep those remedies
|
|
673
|
+
* declarative and validate their referenced command flags alongside the
|
|
674
|
+
* habitual unsupported-flag corrections.
|
|
675
|
+
*/
|
|
676
|
+
export declare const MISSING_FLAG_REMEDIES: Readonly<Record<string, Readonly<Record<string, MissingFlagRemedy>>>>;
|
|
645
677
|
/**
|
|
646
678
|
* The hint for a `Nonexistent flags:` refusal, or null. Two cases:
|
|
647
679
|
* - a flag retired from THIS command, which this command does not define again: where it went;
|
package/dist/base-command.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Flags = exports.UNSUPPORTED_FLAG_REMEDIES = exports.BaseCommand = exports.resolveProfileFromArgv = void 0;
|
|
3
|
+
exports.Flags = exports.MISSING_FLAG_REMEDIES = exports.UNSUPPORTED_FLAG_REMEDIES = exports.BaseCommand = exports.resolveProfileFromArgv = void 0;
|
|
4
4
|
exports.assigneePayloadNeedsResolution = assigneePayloadNeedsResolution;
|
|
5
5
|
exports.parseGlobalFlags = parseGlobalFlags;
|
|
6
6
|
exports.refusalCodeOf = refusalCodeOf;
|
|
@@ -22,6 +22,7 @@ exports.errorBodyMessage = errorBodyMessage;
|
|
|
22
22
|
exports.envelopeDetails = envelopeDetails;
|
|
23
23
|
exports.retiredFlagHint = retiredFlagHint;
|
|
24
24
|
exports.parseErrorRemedy = parseErrorRemedy;
|
|
25
|
+
const space_write_policy_1 = require("./lib/space-write-policy");
|
|
25
26
|
const node_fs_1 = require("node:fs");
|
|
26
27
|
const core_1 = require("@oclif/core");
|
|
27
28
|
Object.defineProperty(exports, "Flags", { enumerable: true, get: function () { return core_1.Flags; } });
|
|
@@ -40,6 +41,7 @@ const guide_pointer_1 = require("./lib/guide-pointer");
|
|
|
40
41
|
var keychain_1 = require("./lib/keychain");
|
|
41
42
|
Object.defineProperty(exports, "resolveProfileFromArgv", { enumerable: true, get: function () { return keychain_1.resolveProfileFromArgv; } });
|
|
42
43
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
44
|
+
const cli_client_identity_1 = require("./lib/cli-client-identity");
|
|
43
45
|
const auth_core_1 = require("@skrr-ai/auth-core");
|
|
44
46
|
const auth_failure_1 = require("./lib/auth-failure");
|
|
45
47
|
const list_output_1 = require("./lib/list-output");
|
|
@@ -49,10 +51,14 @@ const task_ref_resolver_1 = require("./lib/task-ref-resolver");
|
|
|
49
51
|
const space_resolver_1 = require("./lib/space-resolver");
|
|
50
52
|
const projects_1 = require("./lib/projects");
|
|
51
53
|
const config_1 = require("./lib/config");
|
|
54
|
+
const auth_diagnostics_1 = require("./lib/auth-diagnostics");
|
|
55
|
+
const completion_index_1 = require("./lib/completion-index");
|
|
56
|
+
const workspace_header_1 = require("./lib/workspace-header");
|
|
52
57
|
const cli_id_1 = require("./lib/cli-id");
|
|
53
58
|
const keychain_2 = require("./lib/keychain");
|
|
54
59
|
const outbox_1 = require("./lib/outbox");
|
|
55
60
|
const node_adapter_1 = require("./lib/node-adapter");
|
|
61
|
+
const memory_history_session_1 = require("./lib/memory-history-session");
|
|
56
62
|
const migrate_1 = require("./lib/migrate");
|
|
57
63
|
const auth_core_init_1 = require("./lib/auth-core-init");
|
|
58
64
|
const credential_resolver_1 = require("./lib/credential-resolver");
|
|
@@ -125,6 +131,7 @@ class BaseCommand extends core_1.Command {
|
|
|
125
131
|
* acquiring unrelated account authority. Human invocations are unaffected.
|
|
126
132
|
*/
|
|
127
133
|
static autonomousCredentialPolicy = 'delegated';
|
|
134
|
+
static sessionReadPolicy;
|
|
128
135
|
/** Add the owning agent's web detail link without overwriting resource URLs. */
|
|
129
136
|
withAgentContext(agentId, value) {
|
|
130
137
|
const agentUrl = (0, web_url_1.agentUrlFrom)(this.cliConfig.baseURL, { id: agentId });
|
|
@@ -203,6 +210,25 @@ class BaseCommand extends core_1.Command {
|
|
|
203
210
|
printJsonResult(value, options = {}) {
|
|
204
211
|
this.log(JSON.stringify((0, json_output_1.withOk)(value, options.ok ?? true), null, 2));
|
|
205
212
|
}
|
|
213
|
+
/**
|
|
214
|
+
* A task write the Space write policy HELD for approval (OSK-17988): the
|
|
215
|
+
* server answered `202 { status: 'pending_approval' }` and wrote nothing.
|
|
216
|
+
* Prints it as that, never as a created or updated task, and returns true so
|
|
217
|
+
* the command stops there (exit 0: the request was accepted, not refused).
|
|
218
|
+
*/
|
|
219
|
+
reportHeldSpaceWrite(result, { json } = {}) {
|
|
220
|
+
if (!(0, space_write_policy_1.isSpaceWritePendingResponse)(result))
|
|
221
|
+
return false;
|
|
222
|
+
if (json) {
|
|
223
|
+
this.printJsonOperation(result, { writeState: 'not_attempted' });
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
for (const line of (0, space_write_policy_1.spaceWritePendingLines)(result, { binName: this.config.bin })) {
|
|
227
|
+
this.log(line);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return true;
|
|
231
|
+
}
|
|
206
232
|
jsonOperationContext;
|
|
207
233
|
/** Opt in at the command boundary, including its existing structured errors. */
|
|
208
234
|
setJsonOperation(options) {
|
|
@@ -234,6 +260,16 @@ class BaseCommand extends core_1.Command {
|
|
|
234
260
|
* from here.
|
|
235
261
|
*/
|
|
236
262
|
resolvedCredential;
|
|
263
|
+
/** Completion references follow the same principal and workspace as requests. */
|
|
264
|
+
completionCacheScope() {
|
|
265
|
+
return (0, completion_index_1.createCompletionCacheScope)({
|
|
266
|
+
configRoot: (0, config_1.configRoot)(),
|
|
267
|
+
profile: (0, keychain_2.getActiveProfile)(),
|
|
268
|
+
baseURL: this.cliConfig.baseURL,
|
|
269
|
+
workspaceId: (0, workspace_header_1.withWorkspaceHeader)({})['X-Workspace-Id'],
|
|
270
|
+
token: this.resolvedCredential?.token,
|
|
271
|
+
});
|
|
272
|
+
}
|
|
237
273
|
/** Re-authorize a long-lived transport using this command's credential
|
|
238
274
|
* source. A daemon handoff is redeemed again; its refresh family is never
|
|
239
275
|
* borrowed or written into the CLI's own login. */
|
|
@@ -266,6 +302,8 @@ class BaseCommand extends core_1.Command {
|
|
|
266
302
|
*/
|
|
267
303
|
credentialProvenance = null;
|
|
268
304
|
bareMode = false;
|
|
305
|
+
/** Managed runtimes must never suggest a human's local credential store. */
|
|
306
|
+
authManagedRuntime = false;
|
|
269
307
|
/**
|
|
270
308
|
* Set when the auto-broker reached a live daemon and it REFUSED the hand-off.
|
|
271
309
|
* `requireAuth()` reports it instead of a bare "Not signed in", because the
|
|
@@ -274,6 +312,11 @@ class BaseCommand extends core_1.Command {
|
|
|
274
312
|
brokerRefusal = null;
|
|
275
313
|
async init() {
|
|
276
314
|
await super.init();
|
|
315
|
+
// Task Agent Context compatibility is meaningful only when the API can
|
|
316
|
+
// distinguish a real CLI build from a generic HTTP caller. This is still
|
|
317
|
+
// telemetry/presentation metadata: the server must never treat it as an
|
|
318
|
+
// execution or authorization claim.
|
|
319
|
+
(0, cli_client_identity_1.configureCliClientIdentity)(this.config.pjson?.version);
|
|
277
320
|
// The profile is resolved from raw argv, BEFORE oclif parses anything.
|
|
278
321
|
//
|
|
279
322
|
// It has to be. `parseBaseFlags()` runs far below, after migration and
|
|
@@ -292,7 +335,11 @@ class BaseCommand extends core_1.Command {
|
|
|
292
335
|
// touching migration, Keychain/file auth, refresh, or daemon auto-broker
|
|
293
336
|
// state. The restricted session token (or a null credential when it is
|
|
294
337
|
// missing) is the only adapter authority exposed to the command.
|
|
295
|
-
|
|
338
|
+
const historySession = this.constructor.sessionReadPolicy === 'memory-history-v1' &&
|
|
339
|
+
(0, memory_history_session_1.hasMemoryHistoryRuntime)() ? (0, memory_history_session_1.memoryHistorySession)() : null;
|
|
340
|
+
let autonomousCredential = historySession
|
|
341
|
+
? { token: historySession.token, source: 'env-token', kind: (0, auth_core_1.classifyTokenKind)(historySession.token) }
|
|
342
|
+
: (0, credential_resolver_1.resolveTrustedAutonomousCredential)();
|
|
296
343
|
const boundSessionCommand = Boolean(autonomousCredential &&
|
|
297
344
|
this.constructor.autonomousCredentialPolicy === 'bound-session');
|
|
298
345
|
if ((0, delegated_cli_1.isDelegatedCliSession)() && !boundSessionCommand) {
|
|
@@ -386,6 +433,7 @@ class BaseCommand extends core_1.Command {
|
|
|
386
433
|
// from the daemon and never owns the person's stored session, so the
|
|
387
434
|
// commands that create, replace or end that session are not its to run.
|
|
388
435
|
const harnessContext = (0, harness_context_1.isHarnessCliContext)();
|
|
436
|
+
this.authManagedRuntime = harnessContext;
|
|
389
437
|
if (harnessContext && this.id && harness_context_1.HARNESS_REFUSED_AUTH_COMMANDS.has(this.id)) {
|
|
390
438
|
this.failWithCliError({
|
|
391
439
|
message: `\`${this.config.bin} ${this.id}\` is not available here: this process was started by the skrr ` +
|
|
@@ -418,7 +466,12 @@ class BaseCommand extends core_1.Command {
|
|
|
418
466
|
// us `bare` and `token` without each subclass having to re-plumb
|
|
419
467
|
// them.
|
|
420
468
|
const parsed = await this.parseBaseFlags();
|
|
421
|
-
|
|
469
|
+
// Keep the orchestration path aligned with credential-resolver: an
|
|
470
|
+
// environment-enabled bare invocation skips stored credentials just as an
|
|
471
|
+
// explicit `--bare` invocation does, so its diagnostic and broker policy
|
|
472
|
+
// must say the same thing.
|
|
473
|
+
this.bareMode =
|
|
474
|
+
parsed.bare || ['1', 'true', 'TRUE', 'yes'].includes(process.env.OVERSKY_BARE_MODE ?? '');
|
|
422
475
|
if (parsed.workspace)
|
|
423
476
|
process.env.OVERSKY_WORKSPACE_ID = parsed.workspace;
|
|
424
477
|
this.cliConfig = (0, config_1.loadConfig)();
|
|
@@ -991,6 +1044,7 @@ class BaseCommand extends core_1.Command {
|
|
|
991
1044
|
/** Abort the command with a helpful message if the user isn't signed in. */
|
|
992
1045
|
requireAuth() {
|
|
993
1046
|
if (!this.resolvedCredential?.token) {
|
|
1047
|
+
const diagnostic = this.authResolution();
|
|
994
1048
|
const refusal = this.brokerRefusal;
|
|
995
1049
|
if (refusal) {
|
|
996
1050
|
// Same code as the plain case — scripts branch on NOT_SIGNED_IN — with
|
|
@@ -1004,14 +1058,24 @@ class BaseCommand extends core_1.Command {
|
|
|
1004
1058
|
code: 'NOT_SIGNED_IN',
|
|
1005
1059
|
exit: 2,
|
|
1006
1060
|
retryable: refusal.transient,
|
|
1007
|
-
details: {
|
|
1061
|
+
details: {
|
|
1062
|
+
broker: refusal.broker,
|
|
1063
|
+
auth: diagnostic,
|
|
1064
|
+
server: diagnostic.server,
|
|
1065
|
+
suggestion: refusal.remedy,
|
|
1066
|
+
},
|
|
1008
1067
|
});
|
|
1009
1068
|
}
|
|
1010
1069
|
this.failWithCliError({
|
|
1011
|
-
message:
|
|
1070
|
+
message: (0, auth_diagnostics_1.describeMissingCredential)(diagnostic, this.config.bin),
|
|
1012
1071
|
code: 'NOT_SIGNED_IN',
|
|
1013
1072
|
exit: 2,
|
|
1014
1073
|
retryable: false,
|
|
1074
|
+
details: {
|
|
1075
|
+
auth: diagnostic,
|
|
1076
|
+
server: diagnostic.server,
|
|
1077
|
+
suggestion: diagnostic.suggestion,
|
|
1078
|
+
},
|
|
1015
1079
|
});
|
|
1016
1080
|
}
|
|
1017
1081
|
const incompatibleScope = incompatibleCliCredentialScope(this.resolvedCredential.token);
|
|
@@ -1269,6 +1333,19 @@ class BaseCommand extends core_1.Command {
|
|
|
1269
1333
|
return null;
|
|
1270
1334
|
return (0, credential_resolver_1.describeCredentialSource)(this.resolvedCredential.source, this.credentialProvenance);
|
|
1271
1335
|
}
|
|
1336
|
+
/**
|
|
1337
|
+
* A machine-readable explanation of credential resolution. This carries
|
|
1338
|
+
* source metadata only; neither token material nor raw URLs may escape.
|
|
1339
|
+
*/
|
|
1340
|
+
authResolution() {
|
|
1341
|
+
return (0, auth_diagnostics_1.authResolutionDiagnostic)({
|
|
1342
|
+
credential: this.resolvedCredential,
|
|
1343
|
+
bareMode: this.bareMode,
|
|
1344
|
+
managedRuntime: this.authManagedRuntime,
|
|
1345
|
+
baseURL: this.cliConfig?.baseURL,
|
|
1346
|
+
bin: this.config?.bin ?? 'skrr',
|
|
1347
|
+
});
|
|
1348
|
+
}
|
|
1272
1349
|
async catch(err) {
|
|
1273
1350
|
if (isOclifExitError(err)) {
|
|
1274
1351
|
return super.catch(err);
|
|
@@ -1285,6 +1362,10 @@ class BaseCommand extends core_1.Command {
|
|
|
1285
1362
|
if (unsupportedFlagHint && !err.message.includes(unsupportedFlagHint.fix)) {
|
|
1286
1363
|
err.message = `${err.message}\n\n${unsupportedFlagHint.fix}`;
|
|
1287
1364
|
}
|
|
1365
|
+
const missingFlagHint = missingFlagRemedyForMessage(err.message || '', this.id);
|
|
1366
|
+
if (missingFlagHint && !err.message.includes(missingFlagHint.fix)) {
|
|
1367
|
+
err.message = `${err.message}\n\n${missingFlagHint.fix}`;
|
|
1368
|
+
}
|
|
1288
1369
|
// Sibling domains spell one lifecycle differently (`in_progress` for a
|
|
1289
1370
|
// space, `active` for a goal), and oclif's enum refusal named neither the
|
|
1290
1371
|
// difference nor the value to use (OSK-9735).
|
|
@@ -1550,11 +1631,14 @@ class BaseCommand extends core_1.Command {
|
|
|
1550
1631
|
const renewal = refreshRefusal
|
|
1551
1632
|
? refreshRefusal.message.replace(/\s*Run `[^`]+` to sign in again\.$/, '')
|
|
1552
1633
|
: "This CLI's own sign-in could not be renewed.";
|
|
1634
|
+
const authDiagnostic = this.authResolution();
|
|
1553
1635
|
const details = {
|
|
1554
1636
|
...(refreshRefusal && bodyCode ? { accessTokenCode: bodyCode } : {}),
|
|
1555
1637
|
...(brokerRefusal
|
|
1556
1638
|
? { broker: brokerRefusal.broker, suggestion: brokerRefusal.remedy }
|
|
1557
1639
|
: {}),
|
|
1640
|
+
auth: authDiagnostic,
|
|
1641
|
+
server: authDiagnostic.server,
|
|
1558
1642
|
};
|
|
1559
1643
|
let authMessage;
|
|
1560
1644
|
if (presentedCiToken) {
|
|
@@ -2671,13 +2755,35 @@ exports.UNSUPPORTED_FLAG_REMEDIES = {
|
|
|
2671
2755
|
},
|
|
2672
2756
|
},
|
|
2673
2757
|
};
|
|
2758
|
+
/**
|
|
2759
|
+
* Required flags normally share a generic repair. A few have a meaningful
|
|
2760
|
+
* choice that cannot be recovered from `<value>` alone; keep those remedies
|
|
2761
|
+
* declarative and validate their referenced command flags alongside the
|
|
2762
|
+
* habitual unsupported-flag corrections.
|
|
2763
|
+
*/
|
|
2764
|
+
exports.MISSING_FLAG_REMEDIES = {
|
|
2765
|
+
'tasks:ready': {
|
|
2766
|
+
for: {
|
|
2767
|
+
fix: 'Choose who can move the work: pass `--for agent` or `--for human`. ' +
|
|
2768
|
+
'For a Space, run `skrr tasks ready --for agent --space <space-id>`.',
|
|
2769
|
+
targets: [{ command: 'tasks:ready', flags: ['for', 'space'] }],
|
|
2770
|
+
},
|
|
2771
|
+
},
|
|
2772
|
+
};
|
|
2674
2773
|
function unsupportedFlagRemedy(commandId, flag) {
|
|
2675
2774
|
return commandId ? exports.UNSUPPORTED_FLAG_REMEDIES[commandId]?.[flag] : undefined;
|
|
2676
2775
|
}
|
|
2776
|
+
function missingFlagRemedy(commandId, flag) {
|
|
2777
|
+
return commandId ? exports.MISSING_FLAG_REMEDIES[commandId]?.[flag] : undefined;
|
|
2778
|
+
}
|
|
2677
2779
|
function unsupportedFlagRemedyForMessage(message, commandId) {
|
|
2678
2780
|
const match = /Nonexistent flag[s]?:?\s*(-{1,2}[\w-]+)/i.exec(message);
|
|
2679
2781
|
return match ? unsupportedFlagRemedy(commandId, match[1].replace(/^-+/, '')) : undefined;
|
|
2680
2782
|
}
|
|
2783
|
+
function missingFlagRemedyForMessage(message, commandId) {
|
|
2784
|
+
const match = /Missing required flag[s]?:?\s*(?:\n\s*)?-{0,2}([a-z][\w-]*)/i.exec(message);
|
|
2785
|
+
return match ? missingFlagRemedy(commandId, match[1]) : undefined;
|
|
2786
|
+
}
|
|
2681
2787
|
/**
|
|
2682
2788
|
* The hint for a `Nonexistent flags:` refusal, or null. Two cases:
|
|
2683
2789
|
* - a flag retired from THIS command, which this command does not define again: where it went;
|
|
@@ -2722,9 +2828,11 @@ function parseErrorRemedy(err, commandId, bin = 'skrr') {
|
|
|
2722
2828
|
const missingFlag = /Missing required flag[s]?:?\s*(?:\n\s*)?-{0,2}([a-z][\w-]*)/i.exec(message);
|
|
2723
2829
|
if (missingFlag) {
|
|
2724
2830
|
const flag = missingFlag[1];
|
|
2831
|
+
const missingFlagHint = missingFlagRemedy(commandId, flag);
|
|
2725
2832
|
return {
|
|
2726
2833
|
flag,
|
|
2727
2834
|
fix: suggestion ??
|
|
2835
|
+
missingFlagHint?.fix ??
|
|
2728
2836
|
`Pass --${flag} <value>. Run \`${helpCommand}\` for its description and accepted values.`,
|
|
2729
2837
|
};
|
|
2730
2838
|
}
|
|
@@ -60,6 +60,17 @@ class Commands extends base_command_1.BaseCommand {
|
|
|
60
60
|
else {
|
|
61
61
|
this.log(`Command hygiene: ${report.ok ? 'OK' : 'FAILED'} ` +
|
|
62
62
|
`(${report.counts.errors} error(s), ${report.counts.warnings} warning(s))`);
|
|
63
|
+
this.log('Execution contracts: ' +
|
|
64
|
+
report.execution.classified +
|
|
65
|
+
'/' +
|
|
66
|
+
report.execution.candidates +
|
|
67
|
+
' classified, ' +
|
|
68
|
+
report.execution.humanOnlyExemptions +
|
|
69
|
+
' human-only exemption(s), ' +
|
|
70
|
+
report.execution.missingReceipts +
|
|
71
|
+
' receipt gap(s), ' +
|
|
72
|
+
report.execution.missingRecoveryGuidance +
|
|
73
|
+
' recovery gap(s).');
|
|
63
74
|
for (const issue of report.issues) {
|
|
64
75
|
const location = issue.command ? ` ${issue.command}` : '';
|
|
65
76
|
this.log(`[${issue.severity}] ${issue.code}${location}: ${issue.message}`);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
/** Read the exact Action Bundle execution receipt before any retry. */
|
|
3
|
+
export default class CommitmentsActionProposal extends BaseCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static args: {
|
|
6
|
+
commitmentId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
proposalId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
static flags: {
|
|
10
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../base-command");
|
|
5
|
+
const commitments_1 = require("../../lib/commitments");
|
|
6
|
+
/** Read the exact Action Bundle execution receipt before any retry. */
|
|
7
|
+
class CommitmentsActionProposal extends base_command_1.BaseCommand {
|
|
8
|
+
static description = 'Show one frozen Action Bundle and its execution receipt';
|
|
9
|
+
static args = {
|
|
10
|
+
commitmentId: core_1.Args.string({ ignoreStdin: true, description: 'Commitment ID', required: true }),
|
|
11
|
+
proposalId: core_1.Args.string({
|
|
12
|
+
ignoreStdin: true,
|
|
13
|
+
description: 'Action Proposal ID',
|
|
14
|
+
required: true,
|
|
15
|
+
}),
|
|
16
|
+
};
|
|
17
|
+
static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
|
|
18
|
+
async run() {
|
|
19
|
+
this.requireAuth();
|
|
20
|
+
const { args, flags } = await this.parse(CommitmentsActionProposal);
|
|
21
|
+
try {
|
|
22
|
+
const result = await commitments_1.commitmentApi.actionProposal(args.commitmentId, args.proposalId);
|
|
23
|
+
if (flags.json)
|
|
24
|
+
this.printJsonResult(result);
|
|
25
|
+
else {
|
|
26
|
+
const proposal = result.proposal;
|
|
27
|
+
const execution = result.execution;
|
|
28
|
+
this.log(`Action Bundle: ${String(proposal?.status || 'unknown')}`);
|
|
29
|
+
this.log(`Operation: ${String(execution?.operationId || 'unavailable')}`);
|
|
30
|
+
const receipt = execution?.receipt;
|
|
31
|
+
this.log(`Receipt: ${String(receipt?.state || 'unknown')}`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
this.handleApiError(error);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.default = CommitmentsActionProposal;
|
|
@@ -50,7 +50,14 @@ class CommitmentsActionProposalsDecide extends base_command_1.BaseCommand {
|
|
|
50
50
|
: {}),
|
|
51
51
|
});
|
|
52
52
|
const execution = decision === 'approve' && decided.status === 'approved'
|
|
53
|
-
? await commitments_1.commitmentApi.executeActionProposal(args.commitmentId, args.proposalId)
|
|
53
|
+
? await commitments_1.commitmentApi.executeActionProposal(args.commitmentId, args.proposalId, proposal.snapshotDigest && Number.isInteger(proposal.bundleVersion)
|
|
54
|
+
? {
|
|
55
|
+
// Keep the automatic hand-off fenced to the same Action
|
|
56
|
+
// Bundle the human decision just approved.
|
|
57
|
+
expectedBundleVersion: proposal.bundleVersion,
|
|
58
|
+
expectedSnapshotDigest: proposal.snapshotDigest,
|
|
59
|
+
}
|
|
60
|
+
: {})
|
|
54
61
|
: undefined;
|
|
55
62
|
result = { decision: decided, ...(execution ? { execution } : {}) };
|
|
56
63
|
}
|
|
@@ -19,7 +19,17 @@ class CommitmentsActionProposalsExecute extends base_command_1.BaseCommand {
|
|
|
19
19
|
const { args, flags } = await this.parse(CommitmentsActionProposalsExecute);
|
|
20
20
|
let result;
|
|
21
21
|
try {
|
|
22
|
-
|
|
22
|
+
// Read the frozen bundle first. The server compares both coordinates in
|
|
23
|
+
// its claim CAS, so a re-proposed bundle cannot inherit this nudge.
|
|
24
|
+
const inspected = await commitments_1.commitmentApi.actionProposal(args.commitmentId, args.proposalId);
|
|
25
|
+
const proposal = inspected.proposal;
|
|
26
|
+
if (!proposal || typeof proposal.bundleVersion !== 'number' || typeof proposal.snapshotDigest !== 'string') {
|
|
27
|
+
throw new Error('The Action Bundle inspection did not include its reviewed revision.');
|
|
28
|
+
}
|
|
29
|
+
result = await commitments_1.commitmentApi.executeActionProposal(args.commitmentId, args.proposalId, {
|
|
30
|
+
expectedBundleVersion: proposal.bundleVersion,
|
|
31
|
+
expectedSnapshotDigest: proposal.snapshotDigest,
|
|
32
|
+
});
|
|
23
33
|
}
|
|
24
34
|
catch (error) {
|
|
25
35
|
this.handleApiError(error);
|
|
@@ -183,7 +183,7 @@ function commitmentActivationRefusal(err, { id, bin }) {
|
|
|
183
183
|
*/
|
|
184
184
|
class CommitmentsCreate extends base_command_1.BaseCommand {
|
|
185
185
|
static description = 'Create a commitment (a durable agent contract). Its cadence is manual, an interval or daily clock times; ' +
|
|
186
|
-
'
|
|
186
|
+
'activeHours and daysOfWeek in --from-json select hours and weekdays. No holiday, business-day or trading-calendar fields';
|
|
187
187
|
static examples = [
|
|
188
188
|
'<%= config.bin %> commitments create --agent <agent-id> --title "Ship v2" --outcome "v2 is live for all users" --cadence 6h --activate',
|
|
189
189
|
'<%= config.bin %> commitments create --agent <agent-id> --title "Hiring loop" --outcome "Every candidate hears back in 48h" --watch tasks --watch email --cadence 12h',
|
|
@@ -199,7 +199,7 @@ cat > commitment.json <<'JSON'
|
|
|
199
199
|
"title": "Daily queue review",
|
|
200
200
|
"status": "draft",
|
|
201
201
|
"target": { "outcome": "Queue changes are reviewed" },
|
|
202
|
-
"cadence": { "mode": "
|
|
202
|
+
"cadence": { "mode": "interval", "intervalMs": 3600000, "activeHours": { "start": "09:00", "end": "22:00" }, "daysOfWeek": ["mon", "tue", "wed", "thu", "fri"], "timezone": "Asia/Shanghai" },
|
|
203
203
|
"watchedSources": [{
|
|
204
204
|
"source": "agent_run",
|
|
205
205
|
"config": { "keys": [
|
|
@@ -8,6 +8,14 @@ export declare function doctorVerdict(input: {
|
|
|
8
8
|
next: string;
|
|
9
9
|
why?: string;
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* The Space loop line (OSK-17989): a Commitment homed in a Space runs only while
|
|
13
|
+
* that Space's execution principal admits it. Empty for a Commitment that is not
|
|
14
|
+
* a loop. A refused loop is also the operating state's first blocker, so the
|
|
15
|
+
* verdict and next step above already say what to do; this line says which
|
|
16
|
+
* Space and why.
|
|
17
|
+
*/
|
|
18
|
+
export declare function spaceLoopLine(value: unknown): string;
|
|
11
19
|
export default class CommitmentsDoctor extends BaseCommand {
|
|
12
20
|
static description: string;
|
|
13
21
|
static args: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.doctorVerdict = doctorVerdict;
|
|
4
|
+
exports.spaceLoopLine = spaceLoopLine;
|
|
4
5
|
const core_1 = require("@oclif/core");
|
|
5
6
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
6
7
|
const base_command_1 = require("../../base-command");
|
|
@@ -69,6 +70,24 @@ function doctorVerdict(input) {
|
|
|
69
70
|
...(typeof stop?.detail === 'string' && stop.detail ? { why: stop.detail } : {}),
|
|
70
71
|
};
|
|
71
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* The Space loop line (OSK-17989): a Commitment homed in a Space runs only while
|
|
75
|
+
* that Space's execution principal admits it. Empty for a Commitment that is not
|
|
76
|
+
* a loop. A refused loop is also the operating state's first blocker, so the
|
|
77
|
+
* verdict and next step above already say what to do; this line says which
|
|
78
|
+
* Space and why.
|
|
79
|
+
*/
|
|
80
|
+
function spaceLoopLine(value) {
|
|
81
|
+
if (!value || typeof value !== 'object')
|
|
82
|
+
return '';
|
|
83
|
+
const loop = value;
|
|
84
|
+
const status = loop.status || 'unreadable';
|
|
85
|
+
let detail = loop.reason ? ` (${loop.reason})` : '';
|
|
86
|
+
if (status === 'admitted') {
|
|
87
|
+
detail = loop.principalVersion ? ` (principal v${loop.principalVersion})` : '';
|
|
88
|
+
}
|
|
89
|
+
return `Space loop: ${status}${loop.spaceId ? ` · ${loop.spaceId}` : ''}${detail}`;
|
|
90
|
+
}
|
|
72
91
|
class CommitmentsDoctor extends base_command_1.BaseCommand {
|
|
73
92
|
static description = 'Summarize commitment readiness and the next operator action';
|
|
74
93
|
static args = {
|
|
@@ -106,6 +125,9 @@ class CommitmentsDoctor extends base_command_1.BaseCommand {
|
|
|
106
125
|
const knowledge = operatingState.knowledge;
|
|
107
126
|
this.log(`Space knowledge: ${knowledge.status || 'unavailable'}${knowledge.spaceId ? ` · ${knowledge.spaceId}` : ''}${knowledge.source ? ` (${knowledge.source})` : ''}; prospective scope, not a completed memory mount`);
|
|
108
127
|
}
|
|
128
|
+
const loopLine = spaceLoopLine(operatingState.spaceLoop);
|
|
129
|
+
if (!flags.json && loopLine)
|
|
130
|
+
this.log(loopLine);
|
|
109
131
|
if (flags.json)
|
|
110
132
|
this.log(JSON.stringify(report, null, 2));
|
|
111
133
|
else {
|
|
@@ -18,7 +18,18 @@ class CommitmentsExecuteRemediation extends base_command_1.BaseCommand {
|
|
|
18
18
|
const { args, flags } = await this.parse(CommitmentsExecuteRemediation);
|
|
19
19
|
let result;
|
|
20
20
|
try {
|
|
21
|
-
|
|
21
|
+
const inspected = await commitments_1.commitmentApi.remediationProposal(args.commitmentId, args.proposalId);
|
|
22
|
+
const proposal = inspected.proposal;
|
|
23
|
+
if (!proposal || typeof proposal.proposalVersion !== 'number') {
|
|
24
|
+
throw new Error('The remediation proposal inspection did not include its reviewed revision.');
|
|
25
|
+
}
|
|
26
|
+
result = await commitments_1.commitmentApi.executeRemediationProposal(args.commitmentId, args.proposalId, {
|
|
27
|
+
retryExecuting: flags['retry-executing'] === true,
|
|
28
|
+
expectedRevision: proposal.proposalVersion,
|
|
29
|
+
...(typeof proposal.updatedAt === 'string'
|
|
30
|
+
? { expectedUpdatedAt: proposal.updatedAt }
|
|
31
|
+
: {}),
|
|
32
|
+
});
|
|
22
33
|
}
|
|
23
34
|
catch (error) {
|
|
24
35
|
this.handleApiError(error);
|
|
@@ -131,7 +131,7 @@ class CommitmentsObservations extends base_command_1.BaseCommand {
|
|
|
131
131
|
this.handleApiError(err);
|
|
132
132
|
}
|
|
133
133
|
if (flags.json)
|
|
134
|
-
this.
|
|
134
|
+
this.printJsonResult(response);
|
|
135
135
|
else
|
|
136
136
|
renderObservationWindow(response, (line) => this.log(line));
|
|
137
137
|
return;
|
|
@@ -152,7 +152,7 @@ class CommitmentsObservations extends base_command_1.BaseCommand {
|
|
|
152
152
|
this.handleApiError(err);
|
|
153
153
|
}
|
|
154
154
|
if (flags.json) {
|
|
155
|
-
this.
|
|
155
|
+
this.printJsonResult(response);
|
|
156
156
|
}
|
|
157
157
|
else {
|
|
158
158
|
// "The commitment has none" and "your filter matched none" are different
|
|
@@ -5,6 +5,11 @@ import { BaseCommand } from '../../../base-command';
|
|
|
5
5
|
* Binding is idempotent by design — the API answers 200 with `reused: true`
|
|
6
6
|
* rather than minting a second draft, because a retried bind used to leave
|
|
7
7
|
* duplicate Commitments behind (OSK-5763).
|
|
8
|
+
*
|
|
9
|
+
* `--space` binds the Pack into a Space as that Space's loop: held by the
|
|
10
|
+
* Space's lead unless `--agent` names another member, owned by the person
|
|
11
|
+
* binding, who must be the Space's execution-principal user and hold SHARE on
|
|
12
|
+
* it. The server refuses, and writes nothing, when the Space cannot take it.
|
|
8
13
|
*/
|
|
9
14
|
export default class CommitmentsPackBind extends BaseCommand {
|
|
10
15
|
static description: string;
|
|
@@ -13,7 +18,10 @@ export default class CommitmentsPackBind extends BaseCommand {
|
|
|
13
18
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
19
|
pack: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
20
|
'pack-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
-
agent: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
agent: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
space: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
goal: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
|
+
'interval-minutes': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
25
|
repository: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
26
|
'required-check': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
27
|
'installation-id': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -22,3 +30,12 @@ export default class CommitmentsPackBind extends BaseCommand {
|
|
|
22
30
|
};
|
|
23
31
|
run(): Promise<void>;
|
|
24
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* The Space knowledge default a loop's home link reports
|
|
35
|
+
* (`CommitmentSpaceLoop.KNOWLEDGE_DEFAULT_OUTCOMES`), in words. Empty for an
|
|
36
|
+
* outcome this CLI does not know, rather than a guess.
|
|
37
|
+
*/
|
|
38
|
+
export declare function describeKnowledgeDefault(scope: {
|
|
39
|
+
default?: string;
|
|
40
|
+
enabled?: boolean;
|
|
41
|
+
} | undefined): string;
|