@skrr-ai/cli 0.1.119 → 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 +31 -0
- package/dist/base-command.js +106 -4
- 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/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/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/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 +18 -0
- package/dist/lib/scoped-memory-command.js +53 -2
- 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-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 +10566 -7247
- package/package.json +20 -2
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { type SpaceJudgmentTurnRecord } from '@skrr-ai/data-provider';
|
|
1
2
|
import { BaseCommand } from '../../../base-command';
|
|
3
|
+
/** Who held the Space's judgment turn at this tick (OSK-18003). */
|
|
4
|
+
export declare function judgmentTurnLabel(turn?: SpaceJudgmentTurnRecord): string;
|
|
2
5
|
export default class SpacesAutoExecutorRuns extends BaseCommand {
|
|
3
6
|
static description: string;
|
|
4
7
|
static examples: string[];
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.judgmentTurnLabel = judgmentTurnLabel;
|
|
3
4
|
const core_1 = require("@oclif/core");
|
|
4
5
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
6
|
const base_command_1 = require("../../../base-command");
|
|
6
7
|
const space_output_1 = require("../../../lib/space-output");
|
|
8
|
+
/** Who held the Space's judgment turn at this tick (OSK-18003). */
|
|
9
|
+
function judgmentTurnLabel(turn) {
|
|
10
|
+
if (!turn)
|
|
11
|
+
return '';
|
|
12
|
+
if (turn.holder === 'leader')
|
|
13
|
+
return ' turn: Leader';
|
|
14
|
+
if (turn.holder === 'space_loop') {
|
|
15
|
+
return ` turn: loop ${turn.commitmentId ?? ''}${turn.inFlightRunId ? ' (waiting for its turn to end)' : ''}`;
|
|
16
|
+
}
|
|
17
|
+
return ' turn: unreadable, Leader stood down';
|
|
18
|
+
}
|
|
7
19
|
class SpacesAutoExecutorRuns extends base_command_1.BaseCommand {
|
|
8
20
|
static description = "List a space's recent auto-orchestration runs and its Lead health";
|
|
9
21
|
static examples = [
|
|
@@ -50,7 +62,7 @@ class SpacesAutoExecutorRuns extends base_command_1.BaseCommand {
|
|
|
50
62
|
for (const run of result.runs) {
|
|
51
63
|
const when = run.triggeredAt ?? 'unknown-time';
|
|
52
64
|
const failure = run.failureReason ? ` — ${run.failureReason}` : '';
|
|
53
|
-
this.log(`${when} ${run.status}${failure}`);
|
|
65
|
+
this.log(`${when} ${run.status}${failure}${judgmentTurnLabel(run.judgmentTurn)}`);
|
|
54
66
|
}
|
|
55
67
|
}
|
|
56
68
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* `skrr spaces charter create-from-description <space>` — seed the Space's
|
|
4
|
+
* charter page from its description, once.
|
|
5
|
+
*
|
|
6
|
+
* An explicit action: nothing turns descriptions into charters on its own, and
|
|
7
|
+
* the description itself is left as it is (the Space card's one-line summary).
|
|
8
|
+
* The page lands at the Space root as `charter`; a Space that already has a
|
|
9
|
+
* charter is refused, and so is one with no description to seed from.
|
|
10
|
+
*/
|
|
11
|
+
export default class SpacesCharterCreateFromDescription extends BaseCommand {
|
|
12
|
+
static description: string;
|
|
13
|
+
static examples: string[];
|
|
14
|
+
static args: {
|
|
15
|
+
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
16
|
+
};
|
|
17
|
+
static flags: {
|
|
18
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
19
|
+
};
|
|
20
|
+
run(): Promise<void>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
|
+
const base_command_1 = require("../../../base-command");
|
|
6
|
+
const http_error_1 = require("../../../lib/http-error");
|
|
7
|
+
const space_charter_1 = require("../../../lib/space-charter");
|
|
8
|
+
const web_url_1 = require("../../../lib/web-url");
|
|
9
|
+
/**
|
|
10
|
+
* `skrr spaces charter create-from-description <space>` — seed the Space's
|
|
11
|
+
* charter page from its description, once.
|
|
12
|
+
*
|
|
13
|
+
* An explicit action: nothing turns descriptions into charters on its own, and
|
|
14
|
+
* the description itself is left as it is (the Space card's one-line summary).
|
|
15
|
+
* The page lands at the Space root as `charter`; a Space that already has a
|
|
16
|
+
* charter is refused, and so is one with no description to seed from.
|
|
17
|
+
*/
|
|
18
|
+
class SpacesCharterCreateFromDescription extends base_command_1.BaseCommand {
|
|
19
|
+
static description = "Create a space's charter page from the space description (one time; the description is left as it is)";
|
|
20
|
+
static examples = [
|
|
21
|
+
'<%= config.bin %> spaces charter create-from-description <space-id>',
|
|
22
|
+
'<%= config.bin %> spaces charter create-from-description "Growth lab" --json',
|
|
23
|
+
];
|
|
24
|
+
static args = {
|
|
25
|
+
id: core_1.Args.string({
|
|
26
|
+
description: 'Space ID, or a title to resolve',
|
|
27
|
+
required: true,
|
|
28
|
+
ignoreStdin: true,
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
31
|
+
static flags = {
|
|
32
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
33
|
+
};
|
|
34
|
+
async run() {
|
|
35
|
+
this.requireAuth();
|
|
36
|
+
const { args, flags } = await this.parse(SpacesCharterCreateFromDescription);
|
|
37
|
+
const spaceId = await this.resolveSpaceReference(args.id);
|
|
38
|
+
let response;
|
|
39
|
+
try {
|
|
40
|
+
response = await data_provider_1.dataService.createSpaceWikiCharterFromDescription(spaceId);
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
const conflict = (0, space_charter_1.charterConflictHint)(err, { binName: this.config.bin, spaceId });
|
|
44
|
+
if (conflict) {
|
|
45
|
+
this.failWithCliError({
|
|
46
|
+
message: conflict.message,
|
|
47
|
+
code: 'WIKI_CHARTER_EXISTS',
|
|
48
|
+
status: 409,
|
|
49
|
+
exit: 1,
|
|
50
|
+
retryable: false,
|
|
51
|
+
details: conflict.details,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if ((0, http_error_1.hasHttpStatus)(err, 422) && (0, http_error_1.httpBodyOf)(err)?.code === 'SPACE_DESCRIPTION_EMPTY') {
|
|
55
|
+
this.failWithCliError({
|
|
56
|
+
message: 'This Space has no description to create a charter from. Write the charter directly: ' +
|
|
57
|
+
`\`${this.config.bin} wiki write ${spaceId} charter --kind charter --file charter.md\`.`,
|
|
58
|
+
code: 'SPACE_DESCRIPTION_EMPTY',
|
|
59
|
+
status: 422,
|
|
60
|
+
exit: 1,
|
|
61
|
+
retryable: false,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
this.handleApiError(err, { subject: `space ${args.id}` });
|
|
65
|
+
}
|
|
66
|
+
const charter = (0, web_url_1.withWikiPageUrl)(this.cliConfig.baseURL, response.charter);
|
|
67
|
+
if (flags.json) {
|
|
68
|
+
this.printJsonResult({ ...response, charter });
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
this.log('Created the charter page from the Space description.');
|
|
72
|
+
for (const line of (0, space_charter_1.charterLines)(charter, { binName: this.config.bin, spaceId })) {
|
|
73
|
+
this.log(line);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.default = SpacesCharterCreateFromDescription;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* `skrr spaces charter show <space>` — the Space's charter page.
|
|
4
|
+
*
|
|
5
|
+
* The charter is the Space's one live `kind: 'charter'` wiki page. What this
|
|
6
|
+
* prints first is its LEAD SECTION (everything before the first `##`), because
|
|
7
|
+
* that is the part every agent turn in the Space receives; the rest of the page
|
|
8
|
+
* is read on demand. No charter is an ordinary state, not an error: it prints
|
|
9
|
+
* how to create one and exits 0 (`--json` carries `charter: null`).
|
|
10
|
+
*/
|
|
11
|
+
export default class SpacesCharterShow extends BaseCommand {
|
|
12
|
+
static description: string;
|
|
13
|
+
static examples: string[];
|
|
14
|
+
static args: {
|
|
15
|
+
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
16
|
+
};
|
|
17
|
+
static flags: {
|
|
18
|
+
full: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
19
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
20
|
+
};
|
|
21
|
+
run(): Promise<void>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
|
+
const base_command_1 = require("../../../base-command");
|
|
6
|
+
const space_charter_1 = require("../../../lib/space-charter");
|
|
7
|
+
const web_url_1 = require("../../../lib/web-url");
|
|
8
|
+
/**
|
|
9
|
+
* `skrr spaces charter show <space>` — the Space's charter page.
|
|
10
|
+
*
|
|
11
|
+
* The charter is the Space's one live `kind: 'charter'` wiki page. What this
|
|
12
|
+
* prints first is its LEAD SECTION (everything before the first `##`), because
|
|
13
|
+
* that is the part every agent turn in the Space receives; the rest of the page
|
|
14
|
+
* is read on demand. No charter is an ordinary state, not an error: it prints
|
|
15
|
+
* how to create one and exits 0 (`--json` carries `charter: null`).
|
|
16
|
+
*/
|
|
17
|
+
class SpacesCharterShow extends base_command_1.BaseCommand {
|
|
18
|
+
static description = "Show a space's charter page: the lead section every agent in the space reads, " +
|
|
19
|
+
'and how to read the rest';
|
|
20
|
+
static examples = [
|
|
21
|
+
'<%= config.bin %> spaces charter show <space-id>',
|
|
22
|
+
'<%= config.bin %> spaces charter show "Growth lab" --full',
|
|
23
|
+
'<%= config.bin %> spaces charter show <space-id> --json',
|
|
24
|
+
];
|
|
25
|
+
static args = {
|
|
26
|
+
id: core_1.Args.string({
|
|
27
|
+
description: 'Space ID, or a title to resolve',
|
|
28
|
+
required: true,
|
|
29
|
+
ignoreStdin: true,
|
|
30
|
+
}),
|
|
31
|
+
};
|
|
32
|
+
static flags = {
|
|
33
|
+
full: core_1.Flags.boolean({ description: 'Print the whole page, not only its lead section' }),
|
|
34
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
35
|
+
};
|
|
36
|
+
async run() {
|
|
37
|
+
this.requireAuth();
|
|
38
|
+
const { args, flags } = await this.parse(SpacesCharterShow);
|
|
39
|
+
const spaceId = await this.resolveSpaceReference(args.id);
|
|
40
|
+
let response;
|
|
41
|
+
try {
|
|
42
|
+
response = await data_provider_1.dataService.getSpaceWikiCharter(spaceId);
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
this.handleApiError(err, { subject: `space ${args.id}` });
|
|
46
|
+
}
|
|
47
|
+
const charter = response.charter
|
|
48
|
+
? (0, web_url_1.withWikiPageUrl)(this.cliConfig.baseURL, response.charter)
|
|
49
|
+
: null;
|
|
50
|
+
if (flags.json) {
|
|
51
|
+
this.printJsonResult({ ...response, charter });
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const lines = charter
|
|
55
|
+
? (0, space_charter_1.charterLines)(charter, { binName: this.config.bin, spaceId, full: flags.full })
|
|
56
|
+
: (0, space_charter_1.noCharterLines)({ binName: this.config.bin, spaceId });
|
|
57
|
+
for (const line of lines)
|
|
58
|
+
this.log(line);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.default = SpacesCharterShow;
|
|
@@ -1,25 +1,10 @@
|
|
|
1
1
|
import { BaseCommand } from '../../../base-command';
|
|
2
|
-
/**
|
|
3
|
-
* One heartbeat document → one table row.
|
|
4
|
-
*
|
|
5
|
-
* Schema reference (packages/data-provider/src/types/spaces.ts:110-132):
|
|
6
|
-
* frequency?: Record<string, unknown> // object, NOT string
|
|
7
|
-
* schedule: { pattern: string; timezone: string } // nested
|
|
8
|
-
*
|
|
9
|
-
* An earlier version read `h.frequency` / `h.timezone` directly, which
|
|
10
|
-
* rendered `[object Object]` and `-` for every row. The casts below are
|
|
11
|
-
* assertions, not guarantees — the payload is untyped at runtime — so the
|
|
12
|
-
* final render goes through `formatCell`: if `schedule.pattern` ever arrives
|
|
13
|
-
* structured (a `{ cron, tz }` object, say) the cell degrades to readable
|
|
14
|
-
* `key=value` pairs instead of regressing to `[object Object]`.
|
|
15
|
-
*
|
|
16
|
-
* Exported for the unit test.
|
|
17
|
-
*/
|
|
18
2
|
export declare function heartbeatRow(h: Record<string, unknown>): {
|
|
19
3
|
agentId: string;
|
|
20
4
|
pattern: string;
|
|
21
5
|
timezone: string;
|
|
22
6
|
enabled: string;
|
|
7
|
+
loop: string;
|
|
23
8
|
updated: string;
|
|
24
9
|
};
|
|
25
10
|
export default class SpacesHeartbeatsList extends BaseCommand {
|
|
@@ -23,6 +23,17 @@ const space_output_1 = require("../../../lib/space-output");
|
|
|
23
23
|
*
|
|
24
24
|
* Exported for the unit test.
|
|
25
25
|
*/
|
|
26
|
+
/**
|
|
27
|
+
* The Space loop a heartbeat was converted into (`skrr spaces loops migrate`,
|
|
28
|
+
* OSK-18009): `pending` while the loop is not active (the heartbeat still runs
|
|
29
|
+
* and is read-only), `retired` once the loop replaced it.
|
|
30
|
+
*/
|
|
31
|
+
function loopCell(loop) {
|
|
32
|
+
const pointer = loop;
|
|
33
|
+
if (!pointer?.commitmentId)
|
|
34
|
+
return '-';
|
|
35
|
+
return `${(0, format_1.formatCell)(pointer.state)} -> ${(0, format_1.formatCell)(pointer.commitmentId)}`;
|
|
36
|
+
}
|
|
26
37
|
function heartbeatRow(h) {
|
|
27
38
|
const schedule = h.schedule;
|
|
28
39
|
const freqObj = h.frequency;
|
|
@@ -34,6 +45,7 @@ function heartbeatRow(h) {
|
|
|
34
45
|
pattern: (0, format_1.formatCell)(pattern),
|
|
35
46
|
timezone: (0, format_1.formatCell)(schedule?.timezone),
|
|
36
47
|
enabled: h.enabled === true ? 'yes' : 'no',
|
|
48
|
+
loop: loopCell(h.loop),
|
|
37
49
|
updated: h.updatedAt ? (0, format_1.localTime)(h.updatedAt) : '-',
|
|
38
50
|
};
|
|
39
51
|
}
|
|
@@ -85,6 +97,7 @@ class SpacesHeartbeatsList extends base_command_1.BaseCommand {
|
|
|
85
97
|
{ key: 'pattern', header: 'PATTERN' },
|
|
86
98
|
{ key: 'timezone', header: 'TIMEZONE' },
|
|
87
99
|
{ key: 'enabled', header: 'ENABLED' },
|
|
100
|
+
{ key: 'loop', header: 'LOOP' },
|
|
88
101
|
{ key: 'updated', header: 'UPDATED' },
|
|
89
102
|
], (line) => this.log(line));
|
|
90
103
|
this.log('');
|
|
@@ -140,6 +140,9 @@ class SpacesInstallTemplate extends base_command_1.BaseCommand {
|
|
|
140
140
|
}
|
|
141
141
|
const verb = installed.attachedToExistingSpace ? 'Installed into' : 'Created';
|
|
142
142
|
this.log(`${verb} space ${spaceId} — ${installed.taskCount ?? 0} task(s), ${installed.goalCount ?? 0} goal(s).`);
|
|
143
|
+
for (const notice of (0, space_templates_1.wikiPageInstallNotices)(installed.outcomes)) {
|
|
144
|
+
this.log(notice);
|
|
145
|
+
}
|
|
143
146
|
}
|
|
144
147
|
}
|
|
145
148
|
exports.default = SpacesInstallTemplate;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* `skrr spaces loops migrate <space> --from heartbeats|oracle_triggers|assistants`
|
|
4
|
+
* (OSK-18009, OSK-18011, OSK-18010; design §5.11): converts a Space's older
|
|
5
|
+
* periodic agent turns into Space loops. The sources are the server's (its
|
|
6
|
+
* adapter registry), so `--from` is passed through and an unknown one is
|
|
7
|
+
* answered with the list. A Space assistant is private to its member, so its
|
|
8
|
+
* plan lists only the caller's own.
|
|
9
|
+
*
|
|
10
|
+
* Without `--apply` it prints the plan, a pure read: every entry, what it
|
|
11
|
+
* becomes (the Space's loop when its owner is the Space's execution principal,
|
|
12
|
+
* otherwise its owner's own Commitment), its cadence before and after (never
|
|
13
|
+
* rounded silently), what the loop does differently, the entries it cannot
|
|
14
|
+
* convert and why, and who may apply each. With `--apply --plan-digest <digest>`
|
|
15
|
+
* it converts the entries the caller may, acting only on the plan that digest
|
|
16
|
+
* names. Each entry keeps firing until its loop is active, and is retired then.
|
|
17
|
+
*/
|
|
18
|
+
export default class SpacesLoopsMigrate extends BaseCommand {
|
|
19
|
+
static description: string;
|
|
20
|
+
static examples: string[];
|
|
21
|
+
static args: {
|
|
22
|
+
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
23
|
+
};
|
|
24
|
+
static flags: {
|
|
25
|
+
from: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
26
|
+
apply: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
27
|
+
'plan-digest': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
28
|
+
entry: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
29
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
30
|
+
};
|
|
31
|
+
run(): Promise<void>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
|
+
const base_command_1 = require("../../../base-command");
|
|
6
|
+
const space_loop_migration_1 = require("../../../lib/space-loop-migration");
|
|
7
|
+
/**
|
|
8
|
+
* `skrr spaces loops migrate <space> --from heartbeats|oracle_triggers|assistants`
|
|
9
|
+
* (OSK-18009, OSK-18011, OSK-18010; design §5.11): converts a Space's older
|
|
10
|
+
* periodic agent turns into Space loops. The sources are the server's (its
|
|
11
|
+
* adapter registry), so `--from` is passed through and an unknown one is
|
|
12
|
+
* answered with the list. A Space assistant is private to its member, so its
|
|
13
|
+
* plan lists only the caller's own.
|
|
14
|
+
*
|
|
15
|
+
* Without `--apply` it prints the plan, a pure read: every entry, what it
|
|
16
|
+
* becomes (the Space's loop when its owner is the Space's execution principal,
|
|
17
|
+
* otherwise its owner's own Commitment), its cadence before and after (never
|
|
18
|
+
* rounded silently), what the loop does differently, the entries it cannot
|
|
19
|
+
* convert and why, and who may apply each. With `--apply --plan-digest <digest>`
|
|
20
|
+
* it converts the entries the caller may, acting only on the plan that digest
|
|
21
|
+
* names. Each entry keeps firing until its loop is active, and is retired then.
|
|
22
|
+
*/
|
|
23
|
+
class SpacesLoopsMigrate extends base_command_1.BaseCommand {
|
|
24
|
+
static description = "Convert a space's heartbeats, custom oracle triggers or your Space assistant (or another older periodic agent turn) into Space loops: print the plan, then apply it";
|
|
25
|
+
static examples = [
|
|
26
|
+
'<%= config.bin %> spaces loops migrate <space-id> --from heartbeats',
|
|
27
|
+
'<%= config.bin %> spaces loops migrate <space-id> --from assistants',
|
|
28
|
+
'<%= config.bin %> spaces loops migrate "Growth lab" --from heartbeats --json',
|
|
29
|
+
'<%= config.bin %> spaces loops migrate <space-id> --from oracle_triggers',
|
|
30
|
+
'<%= config.bin %> spaces loops migrate <space-id> --from heartbeats --apply --plan-digest <digest>',
|
|
31
|
+
'<%= config.bin %> spaces loops migrate <space-id> --from heartbeats --apply --plan-digest <digest> --entry <entry-id>',
|
|
32
|
+
];
|
|
33
|
+
static args = {
|
|
34
|
+
id: core_1.Args.string({
|
|
35
|
+
description: 'Space ID, or a title to resolve',
|
|
36
|
+
required: true,
|
|
37
|
+
ignoreStdin: true,
|
|
38
|
+
}),
|
|
39
|
+
};
|
|
40
|
+
static flags = {
|
|
41
|
+
from: core_1.Flags.string({
|
|
42
|
+
description: 'What to convert: heartbeats, oracle_triggers (custom space_oracle triggers), or assistants (your own Space assistant)',
|
|
43
|
+
required: true,
|
|
44
|
+
}),
|
|
45
|
+
apply: core_1.Flags.boolean({
|
|
46
|
+
description: 'Apply the plan (needs --plan-digest from a plan you reviewed)',
|
|
47
|
+
default: false,
|
|
48
|
+
}),
|
|
49
|
+
'plan-digest': core_1.Flags.string({
|
|
50
|
+
description: 'The digest the plan printed; apply refuses a plan that changed since',
|
|
51
|
+
}),
|
|
52
|
+
entry: core_1.Flags.string({
|
|
53
|
+
description: 'Apply only this entry of the plan (repeatable)',
|
|
54
|
+
multiple: true,
|
|
55
|
+
}),
|
|
56
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
57
|
+
};
|
|
58
|
+
async run() {
|
|
59
|
+
this.requireAuth();
|
|
60
|
+
const { args, flags } = await this.parse(SpacesLoopsMigrate);
|
|
61
|
+
const source = String(flags.from).trim();
|
|
62
|
+
if (flags.apply && !flags['plan-digest']) {
|
|
63
|
+
this.error('Apply acts on the plan you reviewed: run without --apply first, then pass the digest it prints as --plan-digest.', { exit: 2 });
|
|
64
|
+
}
|
|
65
|
+
if (!flags.apply && (flags['plan-digest'] || flags.entry?.length)) {
|
|
66
|
+
this.error('--plan-digest and --entry apply a plan: add --apply.', { exit: 2 });
|
|
67
|
+
}
|
|
68
|
+
const spaceId = await this.resolveSpaceReference(args.id);
|
|
69
|
+
if (!flags.apply) {
|
|
70
|
+
let plan;
|
|
71
|
+
try {
|
|
72
|
+
plan = await data_provider_1.dataService.planSpaceLoopMigration(spaceId, source);
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
this.handleApiError(err, { subject: `space ${args.id}` });
|
|
76
|
+
}
|
|
77
|
+
if (flags.json) {
|
|
78
|
+
this.printJsonResult(plan);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
for (const line of (0, space_loop_migration_1.planLines)(plan, { binName: this.config.bin }))
|
|
82
|
+
this.log(line);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
let applied;
|
|
86
|
+
try {
|
|
87
|
+
applied = await data_provider_1.dataService.applySpaceLoopMigration(spaceId, source, {
|
|
88
|
+
planDigest: String(flags['plan-digest']),
|
|
89
|
+
...(flags.entry?.length ? { entryIds: flags.entry } : {}),
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
this.handleApiError(err, { subject: `space ${args.id}` });
|
|
94
|
+
}
|
|
95
|
+
if (flags.json) {
|
|
96
|
+
this.printJsonResult(applied);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
for (const line of (0, space_loop_migration_1.applyLines)(applied))
|
|
100
|
+
this.log(line);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.default = SpacesLoopsMigrate;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class SpacesLoopsRelease extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
commitment: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
link: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
|
+
const base_command_1 = require("../../../base-command");
|
|
6
|
+
class SpacesLoopsRelease extends base_command_1.BaseCommand {
|
|
7
|
+
static description = 'Pause a loop and release its Space and Goals to built-in planners (requires Space SHARE permission)';
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> spaces loops release <space-id> --commitment <commitment-id>',
|
|
10
|
+
'<%= config.bin %> spaces loops release "Growth lab" --commitment <commitment-id> --json',
|
|
11
|
+
];
|
|
12
|
+
static args = {
|
|
13
|
+
id: core_1.Args.string({ description: 'Space ID, or a title to resolve', required: true, ignoreStdin: true }),
|
|
14
|
+
};
|
|
15
|
+
static flags = {
|
|
16
|
+
commitment: core_1.Flags.string({ description: 'The loop Commitment to pause and release', required: true }),
|
|
17
|
+
link: core_1.Flags.string({ description: 'Pin the reviewed home link ID; otherwise resolve the current active home link once' }),
|
|
18
|
+
json: core_1.Flags.boolean({ description: 'Output the release receipt as JSON' }),
|
|
19
|
+
};
|
|
20
|
+
async run() {
|
|
21
|
+
this.requireAuth();
|
|
22
|
+
const { args, flags } = await this.parse(SpacesLoopsRelease);
|
|
23
|
+
const spaceId = await this.resolveSpaceReference(args.id);
|
|
24
|
+
let receipt;
|
|
25
|
+
try {
|
|
26
|
+
let linkId = flags.link;
|
|
27
|
+
if (!linkId) {
|
|
28
|
+
const links = await data_provider_1.dataService.listCommitmentWorkLinksForTarget({ targetType: 'space', targetId: spaceId });
|
|
29
|
+
const homes = links.data.filter((link) => link.commitmentId === flags.commitment && link.status === 'active' && link.roles.includes('home'));
|
|
30
|
+
if (homes.length !== 1) {
|
|
31
|
+
this.error('No unique active home link found. Supply --link <home-link-id> to release a reviewed link or retry its receipt.', { exit: 2 });
|
|
32
|
+
}
|
|
33
|
+
linkId = homes[0].id;
|
|
34
|
+
}
|
|
35
|
+
receipt = await data_provider_1.dataService.releaseSpaceLoop(spaceId, flags.commitment, { linkId });
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
this.handleApiError(err, { subject: `loop ${flags.commitment} in space ${args.id}` });
|
|
39
|
+
}
|
|
40
|
+
if (flags.json) {
|
|
41
|
+
this.printJsonResult(receipt);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
this.log(receipt.outcome === 'already_released'
|
|
45
|
+
? `Loop ${receipt.commitmentId} was already released from this Space.`
|
|
46
|
+
: `Loop ${receipt.commitmentId} is paused and released from this Space.`);
|
|
47
|
+
this.log(`Home link: ${receipt.linkId}`);
|
|
48
|
+
this.log(receipt.outcome === 'released'
|
|
49
|
+
? 'Its Space and Goal planning turns are released after current turns finish. The owner may explicitly resume the Commitment personally.'
|
|
50
|
+
: 'This receipt refers to the previously released home link. Current planning may have changed.');
|
|
51
|
+
if (receipt.teardown?.status === 'degraded') {
|
|
52
|
+
this.log('Some running work could not be stopped. Review the teardown receipt before assuming all work has ended.');
|
|
53
|
+
for (const failure of receipt.teardown.failures ?? []) {
|
|
54
|
+
this.log(` ${failure.step}: ${failure.reason}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.default = SpacesLoopsRelease;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* `skrr spaces notebook <space>` — the Space's notebook (OSK-17996): one page
|
|
4
|
+
* of its Task Results, loop Cycles, hypothesis verdicts and journal / report
|
|
5
|
+
* pages, newest first. A view over records that already exist: each row is a
|
|
6
|
+
* summary and a link, and the body is read from the record itself. VIEW on
|
|
7
|
+
* the Space. A loop's Cycles are shared with the Space's members while its
|
|
8
|
+
* rules hold; a Commitment that only watches the Space, and every hypothesis
|
|
9
|
+
* verdict, show only to people who can open the Commitment. Each loop row says
|
|
10
|
+
* which.
|
|
11
|
+
*/
|
|
12
|
+
export default class SpacesNotebook extends BaseCommand {
|
|
13
|
+
static description: string;
|
|
14
|
+
static examples: string[];
|
|
15
|
+
static args: {
|
|
16
|
+
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
17
|
+
};
|
|
18
|
+
static flags: {
|
|
19
|
+
kinds: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
limit: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
cursor: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
23
|
+
};
|
|
24
|
+
run(): Promise<void>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
|
+
const base_command_1 = require("../../base-command");
|
|
6
|
+
const space_notebook_1 = require("../../lib/space-notebook");
|
|
7
|
+
const web_url_1 = require("../../lib/web-url");
|
|
8
|
+
/**
|
|
9
|
+
* `skrr spaces notebook <space>` — the Space's notebook (OSK-17996): one page
|
|
10
|
+
* of its Task Results, loop Cycles, hypothesis verdicts and journal / report
|
|
11
|
+
* pages, newest first. A view over records that already exist: each row is a
|
|
12
|
+
* summary and a link, and the body is read from the record itself. VIEW on
|
|
13
|
+
* the Space. A loop's Cycles are shared with the Space's members while its
|
|
14
|
+
* rules hold; a Commitment that only watches the Space, and every hypothesis
|
|
15
|
+
* verdict, show only to people who can open the Commitment. Each loop row says
|
|
16
|
+
* which.
|
|
17
|
+
*/
|
|
18
|
+
class SpacesNotebook extends base_command_1.BaseCommand {
|
|
19
|
+
static description = "Show a space's notebook: its task results, loop cycles, hypothesis verdicts and journal and report pages, newest first";
|
|
20
|
+
static examples = [
|
|
21
|
+
'<%= config.bin %> spaces notebook <space-id>',
|
|
22
|
+
'<%= config.bin %> spaces notebook "Growth lab" --kinds task_result,hypothesis',
|
|
23
|
+
'<%= config.bin %> spaces notebook <space-id> --limit 50 --json',
|
|
24
|
+
'<%= config.bin %> spaces notebook <space-id> --cursor <next-cursor>',
|
|
25
|
+
];
|
|
26
|
+
static args = {
|
|
27
|
+
id: core_1.Args.string({
|
|
28
|
+
description: 'Space ID, or a title to resolve',
|
|
29
|
+
required: true,
|
|
30
|
+
ignoreStdin: true,
|
|
31
|
+
}),
|
|
32
|
+
};
|
|
33
|
+
static flags = {
|
|
34
|
+
kinds: core_1.Flags.string({
|
|
35
|
+
description: `Only these kinds, comma-separated: ${data_provider_1.SPACE_NOTEBOOK_KINDS.join(', ')} (default: all)`,
|
|
36
|
+
}),
|
|
37
|
+
limit: core_1.Flags.integer({ description: 'Rows per page (1-100, default 30)', min: 1, max: 100 }),
|
|
38
|
+
cursor: core_1.Flags.string({
|
|
39
|
+
description: 'The cursor the previous page printed; pass the same --kinds with it',
|
|
40
|
+
}),
|
|
41
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
42
|
+
};
|
|
43
|
+
async run() {
|
|
44
|
+
this.requireAuth();
|
|
45
|
+
const { args, flags } = await this.parse(SpacesNotebook);
|
|
46
|
+
const kinds = (0, data_provider_1.readSpaceNotebookKinds)(flags.kinds);
|
|
47
|
+
if (!kinds.ok) {
|
|
48
|
+
this.error(`Unknown notebook kind: ${kinds.unknown.join(', ')}. Use: ${data_provider_1.SPACE_NOTEBOOK_KINDS.join(', ')}`, { exit: 2 });
|
|
49
|
+
}
|
|
50
|
+
const spaceId = await this.resolveSpaceReference(args.id);
|
|
51
|
+
let page;
|
|
52
|
+
try {
|
|
53
|
+
page = await data_provider_1.dataService.getSpaceNotebook(spaceId, {
|
|
54
|
+
// Every kind is the default; sending none keeps the URL short.
|
|
55
|
+
...(kinds.kinds.length < data_provider_1.SPACE_NOTEBOOK_KINDS.length ? { kinds: kinds.kinds } : {}),
|
|
56
|
+
...(typeof flags.limit === 'number' ? { limit: flags.limit } : {}),
|
|
57
|
+
...(flags.cursor ? { cursor: flags.cursor } : {}),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
this.handleApiError(err, { subject: `space ${args.id}` });
|
|
62
|
+
}
|
|
63
|
+
if (flags.json) {
|
|
64
|
+
this.printJsonResult(page);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
for (const line of (0, space_notebook_1.notebookLines)(page, {
|
|
68
|
+
webOrigin: (0, web_url_1.webOrigin)(this.cliConfig.baseURL),
|
|
69
|
+
binName: this.config.bin,
|
|
70
|
+
})) {
|
|
71
|
+
this.log(line);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.default = SpacesNotebook;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SpaceProposalDecisionCommand } from '../../../lib/space-proposal-decision-command';
|
|
2
|
+
/** `skrr spaces proposals discard <space> <KIND:ID>`: reject through the item's own endpoint. */
|
|
3
|
+
export default class SpacesProposalsDiscard extends SpaceProposalDecisionCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static args: {
|
|
7
|
+
space: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
|
+
item: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
9
|
+
};
|
|
10
|
+
static flags: {
|
|
11
|
+
expected: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
reason: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'reason-code': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
};
|
|
16
|
+
static decision: "discard";
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const space_proposal_decision_command_1 = require("../../../lib/space-proposal-decision-command");
|
|
4
|
+
/** `skrr spaces proposals discard <space> <KIND:ID>`: reject through the item's own endpoint. */
|
|
5
|
+
class SpacesProposalsDiscard extends space_proposal_decision_command_1.SpaceProposalDecisionCommand {
|
|
6
|
+
static description = "Discard (reject) one item in a space's proposals inbox, through the item's own decision endpoint";
|
|
7
|
+
static examples = [
|
|
8
|
+
`<%= config.bin %> spaces proposals discard <space-id> commitment_action_proposal:cap_123 --expected '{"snapshotDigest":"…","bundleVersion":2}' --reason-code not_worth_it`,
|
|
9
|
+
'<%= config.bin %> spaces proposals discard <space-id> memory_proposal:<uuid> --reason "Not true any more"',
|
|
10
|
+
'<%= config.bin %> spaces proposals discard <space-id> space_lesson:<uuid> --reason-code incorrect --reason "Step 2 is the old flow"',
|
|
11
|
+
];
|
|
12
|
+
// Own, not inherited: oclif drops a static a subclass only inherits (OSK-15346).
|
|
13
|
+
static args = space_proposal_decision_command_1.SpaceProposalDecisionCommand.args;
|
|
14
|
+
static flags = { ...space_proposal_decision_command_1.spaceProposalDecisionFlags };
|
|
15
|
+
static decision = 'discard';
|
|
16
|
+
}
|
|
17
|
+
exports.default = SpacesProposalsDiscard;
|