@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
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converting a Space's older periodic agent turns into Space loops on the CLI
|
|
3
|
+
* (OSK-18009, design §5.11): how `skrr spaces loops migrate` prints a plan and
|
|
4
|
+
* what applying it did.
|
|
5
|
+
*
|
|
6
|
+
* The vocabulary (dispositions, reasons, outcomes) and every sentence that
|
|
7
|
+
* explains a code are `@skrr-ai/data-provider`'s (`spaces/loopMigration.ts`),
|
|
8
|
+
* and the server sends each code's sentence beside it; this file only lays
|
|
9
|
+
* them out. A label, a prompt or a note was written by a person or an agent
|
|
10
|
+
* and is printed as data, on one line.
|
|
11
|
+
*/
|
|
12
|
+
import type { SpaceLoopMigrationApplyResponse, SpaceLoopMigrationPlan } from '@skrr-ai/data-provider';
|
|
13
|
+
/** The plan, as a person reviews it before applying. */
|
|
14
|
+
export declare function planLines(plan: SpaceLoopMigrationPlan, { binName }?: {
|
|
15
|
+
binName?: string;
|
|
16
|
+
}): string[];
|
|
17
|
+
/** What applying did, one line per entry. */
|
|
18
|
+
export declare function applyLines(response: SpaceLoopMigrationApplyResponse): string[];
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.planLines = planLines;
|
|
4
|
+
exports.applyLines = applyLines;
|
|
5
|
+
const space_notebook_1 = require("./space-notebook");
|
|
6
|
+
const SHAPE_WORD = {
|
|
7
|
+
space_loop: "the Space's loop",
|
|
8
|
+
member_automation: "its owner's own Commitment, delivering into the Space",
|
|
9
|
+
};
|
|
10
|
+
const OUTCOME_WORD = {
|
|
11
|
+
handed_over: 'handed over',
|
|
12
|
+
awaiting_activation: 'loop made, not active yet',
|
|
13
|
+
already_handed_over: 'already handed over',
|
|
14
|
+
not_converted: 'not converted',
|
|
15
|
+
not_yours: 'not yours to convert',
|
|
16
|
+
abandoned: 'its loop ended before taking over',
|
|
17
|
+
failed: 'failed',
|
|
18
|
+
};
|
|
19
|
+
function perDay(value) {
|
|
20
|
+
if (value >= 1)
|
|
21
|
+
return `${Math.round(value * 100) / 100}/day`;
|
|
22
|
+
return `1 every ${Math.round(1 / value)} days`;
|
|
23
|
+
}
|
|
24
|
+
function entryHeading(entry) {
|
|
25
|
+
return ` ${entry.entryId} ${(0, space_notebook_1.oneLine)(entry.label, 80)}`;
|
|
26
|
+
}
|
|
27
|
+
function convertLines(entry) {
|
|
28
|
+
const lines = [entryHeading(entry)];
|
|
29
|
+
const target = entry.target;
|
|
30
|
+
if (target) {
|
|
31
|
+
lines.push(` becomes ${SHAPE_WORD[target.shape] || target.shape}: owned by user ${target.ownerUserId}, held by agent ${target.agentId}`);
|
|
32
|
+
}
|
|
33
|
+
if (entry.pointer) {
|
|
34
|
+
lines.push(` loop ${entry.pointer.commitmentId} (${entry.pointer.loopStatus || 'unknown'}); the entry keeps firing until it is active`);
|
|
35
|
+
}
|
|
36
|
+
const cadence = entry.cadence;
|
|
37
|
+
if (cadence) {
|
|
38
|
+
lines.push(` cadence ${cadence.fidelity}: ${(0, space_notebook_1.oneLine)(cadence.before.summary, 80)}, ${perDay(cadence.before.turnsPerDay)} -> ${(0, space_notebook_1.oneLine)(cadence.after.summary, 100)}, ${perDay(cadence.after.turnsPerDay)}`);
|
|
39
|
+
for (const note of cadence.notes)
|
|
40
|
+
lines.push(` ${(0, space_notebook_1.oneLine)(note.message, 200)}`);
|
|
41
|
+
}
|
|
42
|
+
for (const note of entry.notes)
|
|
43
|
+
lines.push(` differs ${(0, space_notebook_1.oneLine)(note.message, 200)}`);
|
|
44
|
+
if (entry.activation?.knownBlockers?.length) {
|
|
45
|
+
lines.push(` activate will stay a draft until fixed: ${entry.activation.knownBlockers.join(', ')} (the entry keeps firing meanwhile)`);
|
|
46
|
+
}
|
|
47
|
+
lines.push(entry.apply.allowed
|
|
48
|
+
? ' apply you can apply this'
|
|
49
|
+
: ` apply not you: ${(0, space_notebook_1.oneLine)(entry.apply.message || entry.apply.reason, 200)}`);
|
|
50
|
+
return lines;
|
|
51
|
+
}
|
|
52
|
+
/** The plan, as a person reviews it before applying. */
|
|
53
|
+
function planLines(plan, { binName = 'skrr' } = {}) {
|
|
54
|
+
const lines = [
|
|
55
|
+
`Converting ${plan.sourceLabel} entries of space ${plan.spaceId} into Space loops`,
|
|
56
|
+
plan.executionPrincipal
|
|
57
|
+
? `Execution principal: user ${plan.executionPrincipal.userId} (version ${plan.executionPrincipal.version}). Their entries become the Space's loops; everyone else's become their own Commitments.`
|
|
58
|
+
: "This Space has no active execution principal, so every entry becomes its owner's own Commitment.",
|
|
59
|
+
];
|
|
60
|
+
if (plan.entryScope === 'owner') {
|
|
61
|
+
lines.push(`A ${plan.sourceLabel} is private to its member: this plan lists only yours, and each member converts their own.`);
|
|
62
|
+
}
|
|
63
|
+
const groups = [
|
|
64
|
+
['Will convert', plan.entries.filter((entry) => entry.disposition === 'convert')],
|
|
65
|
+
[
|
|
66
|
+
'Converted, loop not active yet',
|
|
67
|
+
plan.entries.filter((entry) => entry.disposition === 'resume'),
|
|
68
|
+
],
|
|
69
|
+
['Handed over', plan.entries.filter((entry) => entry.disposition === 'handed_over')],
|
|
70
|
+
['Not converted', plan.entries.filter((entry) => entry.disposition === 'not_convertible')],
|
|
71
|
+
];
|
|
72
|
+
for (const [title, entries] of groups) {
|
|
73
|
+
if (entries.length === 0)
|
|
74
|
+
continue;
|
|
75
|
+
lines.push('', `${title} (${entries.length}):`);
|
|
76
|
+
for (const entry of entries) {
|
|
77
|
+
if (entry.disposition === 'convert' || entry.disposition === 'resume') {
|
|
78
|
+
lines.push(...convertLines(entry));
|
|
79
|
+
}
|
|
80
|
+
else if (entry.disposition === 'handed_over') {
|
|
81
|
+
const status = entry.pointer?.loopStatus;
|
|
82
|
+
lines.push(`${entryHeading(entry)}: retired, replaced by loop ${entry.pointer?.commitmentId} (${status || 'unknown'})${status && status !== 'active' && status !== 'paused'
|
|
83
|
+
? '. A retired entry stays retired; make a new loop or heartbeat to bring the turn back.'
|
|
84
|
+
: ''}`);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
// A short detail reads inline; a long one (which events and filters
|
|
88
|
+
// block a Space assistant, OSK-18010) gets its own line, never cut short.
|
|
89
|
+
const detail = entry.detail ? (0, space_notebook_1.oneLine)(entry.detail, 600) : '';
|
|
90
|
+
const inline = detail && detail.length <= 160;
|
|
91
|
+
lines.push(`${entryHeading(entry)}: ${(0, space_notebook_1.oneLine)(entry.message || entry.reason, 240)}${inline ? ` (${detail})` : ''}`);
|
|
92
|
+
if (detail && !inline)
|
|
93
|
+
lines.push(` why ${detail}`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (plan.entries.length === 0) {
|
|
98
|
+
lines.push('', plan.entryScope === 'owner'
|
|
99
|
+
? `You have no ${plan.sourceLabel} in this space.`
|
|
100
|
+
: `No ${plan.sourceLabel} entries in this space.`);
|
|
101
|
+
}
|
|
102
|
+
lines.push('', `Plan digest: ${plan.planDigest}`);
|
|
103
|
+
if (plan.counts.applicableByYou > 0) {
|
|
104
|
+
lines.push(`Apply the ${plan.counts.applicableByYou} you can: ${binName} spaces loops migrate ${plan.spaceId} --from ${plan.source} --apply --plan-digest ${plan.planDigest}`);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
lines.push('Nothing here is yours to apply.');
|
|
108
|
+
}
|
|
109
|
+
return lines;
|
|
110
|
+
}
|
|
111
|
+
/** What applying did, one line per entry. */
|
|
112
|
+
function applyLines(response) {
|
|
113
|
+
const lines = response.results.map((result) => {
|
|
114
|
+
const word = OUTCOME_WORD[result.outcome] || result.outcome;
|
|
115
|
+
const loop = result.commitmentId ? ` -> loop ${result.commitmentId}` : '';
|
|
116
|
+
const code = result.code ? ` (${result.code})` : '';
|
|
117
|
+
const detail = result.detail ? `: ${(0, space_notebook_1.oneLine)(result.detail, 240)}` : '';
|
|
118
|
+
return `${result.entryId} ${word}${loop}${code}${detail}`;
|
|
119
|
+
});
|
|
120
|
+
const counts = Object.entries(response.counts)
|
|
121
|
+
.map(([outcome, count]) => `${count} ${OUTCOME_WORD[outcome] || outcome}`)
|
|
122
|
+
.join(', ');
|
|
123
|
+
lines.push('', counts || 'Nothing to apply.');
|
|
124
|
+
if (response.results.some((result) => result.outcome === 'awaiting_activation')) {
|
|
125
|
+
lines.push('A loop that is not active yet leaves its entry firing. Fix what the code names, then activate the loop; its entry retires the moment it is active.');
|
|
126
|
+
}
|
|
127
|
+
return lines;
|
|
128
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Space Notebook on the CLI (OSK-17996): how `skrr spaces notebook` prints
|
|
3
|
+
* one page of a Space's timeline.
|
|
4
|
+
*
|
|
5
|
+
* The vocabulary, the link paths and the sentences that explain why a kind
|
|
6
|
+
* ends where it does are `@skrr-ai/data-provider`'s (`spaces/notebook.ts`);
|
|
7
|
+
* this file only lays them out, so the CLI cannot describe a window or a
|
|
8
|
+
* visibility rule differently from the web Notebook tab.
|
|
9
|
+
*
|
|
10
|
+
* A row's summary was written by a person, an Agent or the platform (its
|
|
11
|
+
* author says which) and is printed as data: on one line, control characters
|
|
12
|
+
* removed, so a summary cannot forge a row of its own.
|
|
13
|
+
*/
|
|
14
|
+
import { type SpaceNotebookAuthor, type SpaceNotebookResponse } from '@skrr-ai/data-provider';
|
|
15
|
+
/** One printable line: no control or bidi characters, whitespace collapsed. */
|
|
16
|
+
export declare function oneLine(value: unknown, max?: number): string;
|
|
17
|
+
export declare function notebookAuthorLabel(author: SpaceNotebookAuthor | undefined): string;
|
|
18
|
+
/** The lines `spaces notebook` prints for one page. */
|
|
19
|
+
export declare function notebookLines(page: SpaceNotebookResponse, { webOrigin, binName }: {
|
|
20
|
+
webOrigin?: string;
|
|
21
|
+
binName: string;
|
|
22
|
+
}): string[];
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.oneLine = oneLine;
|
|
4
|
+
exports.notebookAuthorLabel = notebookAuthorLabel;
|
|
5
|
+
exports.notebookLines = notebookLines;
|
|
6
|
+
/**
|
|
7
|
+
* The Space Notebook on the CLI (OSK-17996): how `skrr spaces notebook` prints
|
|
8
|
+
* one page of a Space's timeline.
|
|
9
|
+
*
|
|
10
|
+
* The vocabulary, the link paths and the sentences that explain why a kind
|
|
11
|
+
* ends where it does are `@skrr-ai/data-provider`'s (`spaces/notebook.ts`);
|
|
12
|
+
* this file only lays them out, so the CLI cannot describe a window or a
|
|
13
|
+
* visibility rule differently from the web Notebook tab.
|
|
14
|
+
*
|
|
15
|
+
* A row's summary was written by a person, an Agent or the platform (its
|
|
16
|
+
* author says which) and is printed as data: on one line, control characters
|
|
17
|
+
* removed, so a summary cannot forge a row of its own.
|
|
18
|
+
*/
|
|
19
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
20
|
+
const KIND_TAG = {
|
|
21
|
+
task_result: 'result',
|
|
22
|
+
loop_cycle: 'cycle',
|
|
23
|
+
hypothesis: 'hypothesis',
|
|
24
|
+
journal_entry: 'journal',
|
|
25
|
+
report: 'report',
|
|
26
|
+
};
|
|
27
|
+
const VERDICT_WORD = {
|
|
28
|
+
supported: 'supported',
|
|
29
|
+
refuted: 'ruled out',
|
|
30
|
+
inconclusive: 'inconclusive',
|
|
31
|
+
superseded: 'superseded',
|
|
32
|
+
};
|
|
33
|
+
/** One printable line: no control or bidi characters, whitespace collapsed. */
|
|
34
|
+
function oneLine(value, max = 240) {
|
|
35
|
+
const text = String(value ?? '')
|
|
36
|
+
// eslint-disable-next-line no-control-regex
|
|
37
|
+
.replace(/[\u0000-\u001f\u007f-\u009f--]/g, ' ')
|
|
38
|
+
.replace(/\s+/g, ' ')
|
|
39
|
+
.trim();
|
|
40
|
+
return text.length > max ? `${text.slice(0, max - 1).trimEnd()}…` : text;
|
|
41
|
+
}
|
|
42
|
+
function notebookAuthorLabel(author) {
|
|
43
|
+
if (!author)
|
|
44
|
+
return 'unknown';
|
|
45
|
+
if (author.kind === 'agent')
|
|
46
|
+
return author.agentId ? `agent ${author.agentId}` : 'agent';
|
|
47
|
+
if (author.kind === 'person')
|
|
48
|
+
return author.userId ? `person ${author.userId}` : 'person';
|
|
49
|
+
return author.label ? `system (${oneLine(author.label, 60)})` : 'system';
|
|
50
|
+
}
|
|
51
|
+
const LINK_WORD = {
|
|
52
|
+
home: 'loop of this Space',
|
|
53
|
+
watch: 'watching this Space',
|
|
54
|
+
};
|
|
55
|
+
const VISIBILITY_WORD = {
|
|
56
|
+
space_access: 'shared with the Space',
|
|
57
|
+
commitment_access: 'only for people who can open the Commitment',
|
|
58
|
+
};
|
|
59
|
+
/** Which Commitment a loop row came from, and who may see the row. */
|
|
60
|
+
function loopLine(row) {
|
|
61
|
+
const link = LINK_WORD[row.loop.link] || row.loop.link;
|
|
62
|
+
const seen = VISIBILITY_WORD[row.visibility] || row.visibility;
|
|
63
|
+
return `${link} · ${seen}`;
|
|
64
|
+
}
|
|
65
|
+
function detailLines(row) {
|
|
66
|
+
switch (row.kind) {
|
|
67
|
+
case 'task_result': {
|
|
68
|
+
const task = row.task.identifier || row.task.id;
|
|
69
|
+
const conclusion = row.result.conclusionType ? `, ${row.result.conclusionType}` : '';
|
|
70
|
+
const current = row.result.current ? '' : ', superseded';
|
|
71
|
+
return [`task ${task}, result v${row.result.version}${conclusion}${current}`];
|
|
72
|
+
}
|
|
73
|
+
case 'loop_cycle': {
|
|
74
|
+
const stop = row.cycle.stop;
|
|
75
|
+
const lines = [
|
|
76
|
+
stop
|
|
77
|
+
? `stopped at ${stop.question}/${stop.gate}${stop.reason ? ` (${stop.reason})` : ''}`
|
|
78
|
+
: 'an agent turn was dispatched',
|
|
79
|
+
];
|
|
80
|
+
if (stop?.fix)
|
|
81
|
+
lines.push(`fix: ${oneLine(stop.fix)}`);
|
|
82
|
+
lines.push(loopLine(row));
|
|
83
|
+
return lines;
|
|
84
|
+
}
|
|
85
|
+
case 'hypothesis': {
|
|
86
|
+
const word = VERDICT_WORD[row.verdict.status] || row.verdict.status;
|
|
87
|
+
const by = row.verdict.authority === 'observation_backed' ? 'settled by readings' : 'agent-reported';
|
|
88
|
+
const lines = [`verdict: ${word} (${by})`];
|
|
89
|
+
if (row.verdict.reason)
|
|
90
|
+
lines.push(`because: ${oneLine(row.verdict.reason)}`);
|
|
91
|
+
lines.push(loopLine(row));
|
|
92
|
+
return lines;
|
|
93
|
+
}
|
|
94
|
+
default:
|
|
95
|
+
return [];
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/** The lines `spaces notebook` prints for one page. */
|
|
99
|
+
function notebookLines(page, { webOrigin, binName }) {
|
|
100
|
+
const lines = [];
|
|
101
|
+
if (!page.rows.length) {
|
|
102
|
+
lines.push(page.nextCursor
|
|
103
|
+
? 'Nothing on this page.'
|
|
104
|
+
: `No available records in this listing (${page.kinds.map(data_provider_1.spaceNotebookKindLabel).join(', ')}).`);
|
|
105
|
+
}
|
|
106
|
+
for (const row of page.rows) {
|
|
107
|
+
const tag = (KIND_TAG[row.kind] || row.kind).padEnd(10);
|
|
108
|
+
lines.push(`${row.at} ${tag} ${oneLine(row.title, 80)} · ${notebookAuthorLabel(row.author)}`);
|
|
109
|
+
if (row.summary) {
|
|
110
|
+
lines.push(` ${oneLine(row.summary)}${row.summaryTruncated ? ' (cut; open it for the rest)' : ''}`);
|
|
111
|
+
}
|
|
112
|
+
for (const detail of detailLines(row))
|
|
113
|
+
lines.push(` ${detail}`);
|
|
114
|
+
lines.push(` ${webOrigin ? `${webOrigin}${row.link.path}` : row.link.path}`);
|
|
115
|
+
}
|
|
116
|
+
const notes = [];
|
|
117
|
+
for (const source of page.sources) {
|
|
118
|
+
if (source.state !== 'ended')
|
|
119
|
+
continue;
|
|
120
|
+
for (const window of source.windows || []) {
|
|
121
|
+
notes.push((0, data_provider_1.describeSpaceNotebookWindow)(source.kind, window));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
// Who may see a loop row, once per rule the page shows.
|
|
125
|
+
for (const row of page.rows) {
|
|
126
|
+
if ('visibility' in row && row.visibility) {
|
|
127
|
+
notes.push((0, data_provider_1.describeSpaceNotebookVisibility)(row.visibility));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
lines.push('', ...[...new Set(notes)], data_provider_1.SPACE_NOTEBOOK_COVERAGE_NOTE);
|
|
131
|
+
if (page.nextCursor) {
|
|
132
|
+
// A cursor is bound to the filter it was issued for; every kind is the
|
|
133
|
+
// default, so the flag is only repeated when the page was filtered.
|
|
134
|
+
const kinds = page.kinds.length && page.kinds.length < data_provider_1.SPACE_NOTEBOOK_KINDS.length
|
|
135
|
+
? ` --kinds ${page.kinds.join(',')}`
|
|
136
|
+
: '';
|
|
137
|
+
lines.push('', `More: ${binName} spaces notebook ${page.spaceId}${kinds} --cursor ${page.nextCursor}`);
|
|
138
|
+
}
|
|
139
|
+
return lines;
|
|
140
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { BaseCommand } from '../base-command';
|
|
2
|
+
import { type SpaceProposalDecision } from './space-proposals';
|
|
3
|
+
/**
|
|
4
|
+
* The flags `keep` and `discard` share. Exported so each command spreads it
|
|
5
|
+
* into its own `flags`: the command-hygiene scan reads one file at a time and
|
|
6
|
+
* recognises a shared `...xFlags` spread, not a static inherited from a class.
|
|
7
|
+
*/
|
|
8
|
+
export declare const spaceProposalDecisionFlags: {
|
|
9
|
+
expected: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
reason: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'reason-code': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* `skrr spaces proposals keep|discard <space> <KIND:ID>` (OSK-17993).
|
|
16
|
+
*
|
|
17
|
+
* Reads the item from the Space's inbox, then sends the decision to the
|
|
18
|
+
* endpoint the item names (`decisionRoute`): the owning object's own. The CLI
|
|
19
|
+
* decides nothing itself and adds no decision path. An Action Bundle is pinned
|
|
20
|
+
* to `--expected`, the revision the caller reviewed in `list`: deciding the
|
|
21
|
+
* bundle as it is NOW would approve writes the caller never saw.
|
|
22
|
+
*/
|
|
23
|
+
export declare abstract class SpaceProposalDecisionCommand extends BaseCommand {
|
|
24
|
+
static decision: SpaceProposalDecision;
|
|
25
|
+
static args: {
|
|
26
|
+
space: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
27
|
+
item: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
28
|
+
};
|
|
29
|
+
static flags: {
|
|
30
|
+
expected: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
31
|
+
reason: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
32
|
+
'reason-code': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
33
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
34
|
+
};
|
|
35
|
+
run(): Promise<void>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpaceProposalDecisionCommand = exports.spaceProposalDecisionFlags = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
6
|
+
const base_command_1 = require("../base-command");
|
|
7
|
+
const space_proposals_1 = require("./space-proposals");
|
|
8
|
+
/**
|
|
9
|
+
* The flags `keep` and `discard` share. Exported so each command spreads it
|
|
10
|
+
* into its own `flags`: the command-hygiene scan reads one file at a time and
|
|
11
|
+
* recognises a shared `...xFlags` spread, not a static inherited from a class.
|
|
12
|
+
*/
|
|
13
|
+
exports.spaceProposalDecisionFlags = {
|
|
14
|
+
expected: core_1.Flags.string({
|
|
15
|
+
description: 'For an Action Bundle: the exact REVISION JSON that `spaces proposals list` printed for it',
|
|
16
|
+
}),
|
|
17
|
+
reason: core_1.Flags.string({ description: 'Why (recorded with the decision)' }),
|
|
18
|
+
'reason-code': core_1.Flags.string({ options: [...data_provider_1.PROPOSAL_DISCARD_REASON_CODES] }),
|
|
19
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* `skrr spaces proposals keep|discard <space> <KIND:ID>` (OSK-17993).
|
|
23
|
+
*
|
|
24
|
+
* Reads the item from the Space's inbox, then sends the decision to the
|
|
25
|
+
* endpoint the item names (`decisionRoute`): the owning object's own. The CLI
|
|
26
|
+
* decides nothing itself and adds no decision path. An Action Bundle is pinned
|
|
27
|
+
* to `--expected`, the revision the caller reviewed in `list`: deciding the
|
|
28
|
+
* bundle as it is NOW would approve writes the caller never saw.
|
|
29
|
+
*/
|
|
30
|
+
class SpaceProposalDecisionCommand extends base_command_1.BaseCommand {
|
|
31
|
+
static decision;
|
|
32
|
+
static args = {
|
|
33
|
+
space: core_1.Args.string({
|
|
34
|
+
description: 'Space ID, or a title to resolve',
|
|
35
|
+
required: true,
|
|
36
|
+
ignoreStdin: true,
|
|
37
|
+
}),
|
|
38
|
+
item: core_1.Args.string({
|
|
39
|
+
description: 'The KIND:ID that `spaces proposals list` prints',
|
|
40
|
+
required: true,
|
|
41
|
+
ignoreStdin: true,
|
|
42
|
+
}),
|
|
43
|
+
};
|
|
44
|
+
static flags = exports.spaceProposalDecisionFlags;
|
|
45
|
+
async run() {
|
|
46
|
+
this.requireAuth();
|
|
47
|
+
const { args, flags } = await this.parse(this.constructor);
|
|
48
|
+
const decision = this.constructor.decision;
|
|
49
|
+
let expected;
|
|
50
|
+
if (flags.expected !== undefined) {
|
|
51
|
+
try {
|
|
52
|
+
expected = JSON.parse(flags.expected);
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
this.failWithCliError({
|
|
56
|
+
message: '--expected must be the revision JSON `spaces proposals list` printed.',
|
|
57
|
+
code: 'PROPOSAL_EXPECTED_INVALID',
|
|
58
|
+
exit: 2,
|
|
59
|
+
retryable: false,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const spaceId = await this.resolveSpaceReference(args.space);
|
|
64
|
+
let item;
|
|
65
|
+
try {
|
|
66
|
+
item = await space_proposals_1.spaceProposalsApi.show(spaceId, args.item);
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
if (error?.status === 404) {
|
|
70
|
+
this.failWithCliError({
|
|
71
|
+
message: `No proposal ${args.item} is in this space's inbox for you. ` +
|
|
72
|
+
'`spaces proposals list` prints each as KIND:ID.',
|
|
73
|
+
code: 'PROPOSAL_NOT_FOUND',
|
|
74
|
+
status: 404,
|
|
75
|
+
exit: 4,
|
|
76
|
+
retryable: false,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
this.handleApiError(error);
|
|
80
|
+
}
|
|
81
|
+
let result;
|
|
82
|
+
try {
|
|
83
|
+
result = await space_proposals_1.spaceProposalsApi.decide(item, {
|
|
84
|
+
decision,
|
|
85
|
+
expected,
|
|
86
|
+
reason: flags.reason,
|
|
87
|
+
reasonCode: flags['reason-code'],
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
if (error instanceof space_proposals_1.SpaceProposalDecisionError) {
|
|
92
|
+
this.failWithCliError({
|
|
93
|
+
message: error.message,
|
|
94
|
+
code: error.code,
|
|
95
|
+
exit: 2,
|
|
96
|
+
retryable: false,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
this.handleApiError(error);
|
|
100
|
+
}
|
|
101
|
+
if (flags.json) {
|
|
102
|
+
this.printJsonResult({ item: item.id, decision, result });
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
this.log(`Proposal ${item.id}: ${decision} recorded by its own service.`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
exports.SpaceProposalDecisionCommand = SpaceProposalDecisionCommand;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Space proposals inbox on the CLI (OSK-17993): `skrr spaces proposals
|
|
3
|
+
* list|keep|discard`.
|
|
4
|
+
*
|
|
5
|
+
* The inbox is a READ-TIME projection (`GET /api/spaces/:spaceId/proposals`).
|
|
6
|
+
* It has no decision endpoint of its own, and neither does this file: a keep
|
|
7
|
+
* or discard is sent to the endpoint the ITEM names (`decisionRoute`), which
|
|
8
|
+
* is the owning object's existing one, and that endpoint authorizes the
|
|
9
|
+
* decider. One entry per route kind in `DECIDERS`; the record type makes a
|
|
10
|
+
* new route kind fail to compile here until it is given one.
|
|
11
|
+
*/
|
|
12
|
+
import { type ProposalDiscardReasonCode, type ProposalRevision, type SpaceProposalListParams, type SpaceProposalListResponse, type SpaceProposalView } from '@skrr-ai/data-provider';
|
|
13
|
+
export type SpaceProposalDecision = 'keep' | 'discard';
|
|
14
|
+
export type SpaceProposalDecisionInput = {
|
|
15
|
+
decision: SpaceProposalDecision;
|
|
16
|
+
/** The revision the caller reviewed (Action Bundles only). */
|
|
17
|
+
expected?: ProposalRevision;
|
|
18
|
+
reason?: string;
|
|
19
|
+
reasonCode?: ProposalDiscardReasonCode;
|
|
20
|
+
};
|
|
21
|
+
export declare class SpaceProposalDecisionError extends Error {
|
|
22
|
+
readonly code: string;
|
|
23
|
+
constructor(message: string, code: string);
|
|
24
|
+
}
|
|
25
|
+
export declare const spaceProposalsApi: {
|
|
26
|
+
list(spaceId: string, params?: SpaceProposalListParams): Promise<SpaceProposalListResponse>;
|
|
27
|
+
show(spaceId: string, itemId: string): Promise<SpaceProposalView>;
|
|
28
|
+
/**
|
|
29
|
+
* Send one decision to the endpoint `item.decisionRoute` names. Refuses
|
|
30
|
+
* before any transport when the item says the caller cannot take it.
|
|
31
|
+
*/
|
|
32
|
+
decide(item: SpaceProposalView, input: SpaceProposalDecisionInput): Promise<unknown>;
|
|
33
|
+
};
|
|
34
|
+
/** The attribution line of a Memory proposal the platform made, or null for the Agent's own. */
|
|
35
|
+
export declare function spaceMemoryProducerLine(item: SpaceProposalView): string | null;
|
|
36
|
+
/** One row of `spaces proposals list`, in the order printed. */
|
|
37
|
+
export declare function spaceProposalRow(item: SpaceProposalView): Record<string, string>;
|
|
38
|
+
/**
|
|
39
|
+
* The lines under the table: the writes each held bundle would make here, and,
|
|
40
|
+
* for a bundle the caller can decide, the exact revision to pin `keep` to.
|
|
41
|
+
*/
|
|
42
|
+
export declare function spaceProposalDetailLines(item: SpaceProposalView, binName: string): string[];
|
|
43
|
+
/** What an empty page means: "none" only once the inbox is exhausted. */
|
|
44
|
+
export declare function emptySpaceInboxLines(nextCursor: string | null | undefined): string[];
|