@skrr-ai/cli 0.1.22 → 0.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -73
- package/bin/dev-fallback.js +221 -0
- package/bin/run.js +96 -0
- package/dist/base-command.d.ts +15 -0
- package/dist/base-command.js +145 -11
- package/dist/commands/agents/attach-harness.d.ts +37 -0
- package/dist/commands/agents/attach-harness.js +102 -3
- package/dist/commands/agents/chat.d.ts +69 -1
- package/dist/commands/agents/chat.js +202 -22
- package/dist/commands/agents/create.d.ts +38 -0
- package/dist/commands/agents/create.js +95 -2
- package/dist/commands/agents/schedule-trace.js +11 -0
- package/dist/commands/agents/show.js +29 -1
- package/dist/commands/api-keys/create.d.ts +24 -0
- package/dist/commands/api-keys/create.js +80 -0
- package/dist/commands/api-keys/list.d.ts +11 -0
- package/dist/commands/api-keys/list.js +42 -0
- package/dist/commands/api-keys/revoke.d.ts +14 -0
- package/dist/commands/api-keys/revoke.js +33 -0
- package/dist/commands/api-keys/rotate.d.ts +19 -0
- package/dist/commands/api-keys/rotate.js +42 -0
- package/dist/commands/balance/index.d.ts +18 -0
- package/dist/commands/balance/index.js +29 -0
- package/dist/commands/balance/show.d.ts +25 -0
- package/dist/commands/balance/show.js +60 -0
- package/dist/commands/balance/statement.d.ts +19 -0
- package/dist/commands/balance/statement.js +52 -0
- package/dist/commands/browser/doctor.d.ts +11 -0
- package/dist/commands/browser/doctor.js +11 -0
- package/dist/commands/code/jobs/approve.d.ts +25 -0
- package/dist/commands/code/jobs/approve.js +52 -0
- package/dist/commands/code/jobs/cancel.d.ts +12 -0
- package/dist/commands/code/jobs/cancel.js +39 -0
- package/dist/commands/code/jobs/index.d.ts +19 -0
- package/dist/commands/code/jobs/index.js +38 -0
- package/dist/commands/code/jobs/list.d.ts +12 -0
- package/dist/commands/code/jobs/list.js +87 -0
- package/dist/commands/code/jobs/run.d.ts +32 -0
- package/dist/commands/code/jobs/run.js +151 -0
- package/dist/commands/code/jobs/show.d.ts +12 -0
- package/dist/commands/code/jobs/show.js +86 -0
- package/dist/commands/commitments/preflight.js +18 -4
- package/dist/commands/commitments/receipt-metrics.d.ts +39 -0
- package/dist/commands/commitments/receipt-metrics.js +78 -0
- package/dist/commands/convos/search.js +5 -5
- package/dist/commands/harnesses/leases/list.d.ts +3 -0
- package/dist/commands/harnesses/leases/list.js +59 -12
- package/dist/commands/harnesses/leases/show.js +36 -0
- package/dist/commands/harnesses/list.d.ts +18 -0
- package/dist/commands/harnesses/list.js +30 -0
- package/dist/commands/harnesses/products.js +49 -3
- package/dist/commands/harnesses/quota.d.ts +16 -0
- package/dist/commands/harnesses/quota.js +26 -1
- package/dist/commands/harnesses/usage.js +17 -0
- package/dist/commands/inbox/index.d.ts +2 -1
- package/dist/commands/inbox/index.js +27 -4
- package/dist/commands/login.js +4 -1
- package/dist/commands/machines/dedicated/create.d.ts +18 -0
- package/dist/commands/machines/dedicated/create.js +90 -0
- package/dist/commands/machines/dedicated/destroy.d.ts +14 -0
- package/dist/commands/machines/dedicated/destroy.js +56 -0
- package/dist/commands/machines/dedicated/grow.d.ts +13 -0
- package/dist/commands/machines/dedicated/grow.js +46 -0
- package/dist/commands/machines/dedicated/health-check.d.ts +12 -0
- package/dist/commands/machines/dedicated/health-check.js +42 -0
- package/dist/commands/machines/dedicated/incident-close.d.ts +12 -0
- package/dist/commands/machines/dedicated/incident-close.js +42 -0
- package/dist/commands/machines/dedicated/index.d.ts +6 -0
- package/dist/commands/machines/dedicated/index.js +39 -0
- package/dist/commands/machines/dedicated/list.d.ts +11 -0
- package/dist/commands/machines/dedicated/list.js +58 -0
- package/dist/commands/machines/dedicated/restart.d.ts +12 -0
- package/dist/commands/machines/dedicated/restart.js +42 -0
- package/dist/commands/machines/dedicated/show.d.ts +12 -0
- package/dist/commands/machines/dedicated/show.js +58 -0
- package/dist/commands/machines/dedicated/snapshot.d.ts +12 -0
- package/dist/commands/machines/dedicated/snapshot.js +42 -0
- package/dist/commands/machines/dedicated/start.d.ts +12 -0
- package/dist/commands/machines/dedicated/start.js +42 -0
- package/dist/commands/machines/dedicated/stop.d.ts +12 -0
- package/dist/commands/machines/dedicated/stop.js +42 -0
- package/dist/commands/machines/hosted/index.js +4 -1
- package/dist/commands/machines/list.d.ts +1 -0
- package/dist/commands/machines/list.js +33 -5
- package/dist/commands/memory/approvals/issue.d.ts +18 -0
- package/dist/commands/memory/approvals/issue.js +63 -0
- package/dist/commands/memory/commit.js +5 -2
- package/dist/commands/memory/context.d.ts +3 -2
- package/dist/commands/memory/context.js +9 -11
- package/dist/commands/memory/delete.d.ts +1 -1
- package/dist/commands/memory/list.d.ts +1 -1
- package/dist/commands/memory/list.js +1 -1
- package/dist/commands/memory/mounts/resolve.d.ts +10 -0
- package/dist/commands/memory/mounts/resolve.js +27 -0
- package/dist/commands/memory/proposals/commit.d.ts +18 -0
- package/dist/commands/memory/proposals/commit.js +32 -0
- package/dist/commands/memory/proposals/create.d.ts +18 -0
- package/dist/commands/memory/proposals/create.js +56 -0
- package/dist/commands/memory/proposals/list.d.ts +13 -0
- package/dist/commands/memory/proposals/list.js +31 -0
- package/dist/commands/memory/proposals/promote.d.ts +22 -0
- package/dist/commands/memory/proposals/promote.js +33 -0
- package/dist/commands/memory/proposals/reject.d.ts +16 -0
- package/dist/commands/memory/proposals/reject.js +28 -0
- package/dist/commands/memory/rebuild-index.d.ts +20 -0
- package/dist/commands/memory/rebuild-index.js +25 -0
- package/dist/commands/memory/save.d.ts +1 -1
- package/dist/commands/memory/save.js +1 -1
- package/dist/commands/memory/search.d.ts +6 -3
- package/dist/commands/memory/search.js +27 -3
- package/dist/commands/memory/show.d.ts +1 -1
- package/dist/commands/memory/stores/archive.d.ts +14 -0
- package/dist/commands/memory/stores/archive.js +31 -0
- package/dist/commands/memory/stores/create.d.ts +12 -0
- package/dist/commands/memory/stores/create.js +30 -0
- package/dist/commands/memory/stores/delete.d.ts +15 -0
- package/dist/commands/memory/stores/delete.js +38 -0
- package/dist/commands/memory/stores/list.d.ts +10 -0
- package/dist/commands/memory/stores/list.js +29 -0
- package/dist/commands/memory/stores/show.d.ts +12 -0
- package/dist/commands/memory/stores/show.js +14 -0
- package/dist/commands/memory/stores/update.d.ts +15 -0
- package/dist/commands/memory/stores/update.js +39 -0
- package/dist/commands/memory/sync/delete.d.ts +13 -0
- package/dist/commands/memory/sync/delete.js +35 -0
- package/dist/commands/memory/sync/pull.d.ts +19 -0
- package/dist/commands/memory/sync/pull.js +52 -0
- package/dist/commands/memory/sync/push.d.ts +18 -0
- package/dist/commands/memory/sync/push.js +115 -0
- package/dist/commands/memory/sync/resolve.d.ts +23 -0
- package/dist/commands/memory/sync/resolve.js +27 -0
- package/dist/commands/memory/sync/status.d.ts +9 -0
- package/dist/commands/memory/sync/status.js +22 -0
- package/dist/commands/memory/topics/archive.d.ts +20 -0
- package/dist/commands/memory/topics/archive.js +29 -0
- package/dist/commands/memory/topics/create.d.ts +23 -0
- package/dist/commands/memory/topics/create.js +46 -0
- package/dist/commands/memory/topics/delete.d.ts +22 -0
- package/dist/commands/memory/topics/delete.js +30 -0
- package/dist/commands/memory/topics/forget.d.ts +22 -0
- package/dist/commands/memory/topics/forget.js +29 -0
- package/dist/commands/memory/topics/list.d.ts +13 -0
- package/dist/commands/memory/topics/list.js +22 -0
- package/dist/commands/memory/topics/move.d.ts +22 -0
- package/dist/commands/memory/topics/move.js +26 -0
- package/dist/commands/memory/topics/show.d.ts +17 -0
- package/dist/commands/memory/topics/show.js +21 -0
- package/dist/commands/memory/topics/update.d.ts +23 -0
- package/dist/commands/memory/topics/update.js +27 -0
- package/dist/commands/memory/tree.d.ts +5 -2
- package/dist/commands/memory/tree.js +20 -2
- package/dist/commands/memory/update.d.ts +1 -1
- package/dist/commands/memory/versions/list.d.ts +16 -0
- package/dist/commands/memory/versions/list.js +22 -0
- package/dist/commands/memory/versions/redact.d.ts +21 -0
- package/dist/commands/memory/versions/redact.js +22 -0
- package/dist/commands/memory/versions/restore.d.ts +20 -0
- package/dist/commands/memory/versions/restore.js +16 -0
- package/dist/commands/memory/versions/show.d.ts +15 -0
- package/dist/commands/memory/versions/show.js +17 -0
- package/dist/commands/messages/list.js +25 -8
- package/dist/commands/messages/show.js +10 -0
- package/dist/commands/spaces/update.js +16 -12
- package/dist/commands/spaces/work-sync/reconcile.d.ts +38 -0
- package/dist/commands/spaces/work-sync/reconcile.js +90 -0
- package/dist/commands/spaces/work-sync/telemetry.d.ts +29 -0
- package/dist/commands/spaces/work-sync/telemetry.js +96 -0
- package/dist/commands/store/install.js +5 -1
- package/dist/commands/store/releases.js +1 -1
- package/dist/commands/store/update.js +5 -1
- package/dist/commands/subscriptions/cancel.js +5 -1
- package/dist/commands/subscriptions/health.js +5 -1
- package/dist/commands/subscriptions/status.js +5 -1
- package/dist/commands/subscriptions/subscribe.js +5 -1
- package/dist/commands/tasks/activity.d.ts +2 -3
- package/dist/commands/tasks/activity.js +20 -6
- package/dist/commands/tasks/complete.d.ts +22 -150
- package/dist/commands/tasks/complete.js +174 -599
- package/dist/commands/tasks/create.d.ts +6 -0
- package/dist/commands/tasks/create.js +114 -4
- package/dist/commands/tasks/deliverable/add.d.ts +8 -0
- package/dist/commands/tasks/deliverable/add.js +62 -11
- package/dist/commands/tasks/deliverable/confirm.d.ts +5 -5
- package/dist/commands/tasks/deliverable/confirm.js +9 -18
- package/dist/commands/tasks/deliverable/list.d.ts +12 -0
- package/dist/commands/tasks/deliverable/list.js +58 -0
- package/dist/commands/tasks/events/append.d.ts +2 -0
- package/dist/commands/tasks/events/append.js +41 -6
- package/dist/commands/tasks/events/list.d.ts +1 -0
- package/dist/commands/tasks/events/list.js +1 -0
- package/dist/commands/tasks/events/tail.d.ts +1 -0
- package/dist/commands/tasks/events/tail.js +1 -0
- package/dist/commands/tasks/expectations/assess.d.ts +21 -0
- package/dist/commands/tasks/expectations/assess.js +103 -0
- package/dist/commands/tasks/expectations.js +121 -25
- package/dist/commands/tasks/judge.d.ts +1 -0
- package/dist/commands/tasks/judge.js +2 -1
- package/dist/commands/tasks/output.d.ts +1 -11
- package/dist/commands/tasks/output.js +80 -141
- package/dist/commands/tasks/report.d.ts +3 -3
- package/dist/commands/tasks/report.js +66 -41
- package/dist/commands/tasks/resource/add.d.ts +23 -0
- package/dist/commands/tasks/resource/add.js +76 -0
- package/dist/commands/tasks/resource/list.d.ts +13 -0
- package/dist/commands/tasks/resource/list.js +41 -0
- package/dist/commands/tasks/result/show.d.ts +13 -0
- package/dist/commands/tasks/result/show.js +64 -0
- package/dist/commands/tasks/result/submit.d.ts +26 -0
- package/dist/commands/tasks/result/submit.js +134 -0
- package/dist/commands/tasks/resume/save.d.ts +16 -0
- package/dist/commands/tasks/resume/save.js +69 -0
- package/dist/commands/tasks/resume/show.d.ts +13 -0
- package/dist/commands/tasks/resume/show.js +35 -0
- package/dist/commands/tasks/review.d.ts +17 -0
- package/dist/commands/tasks/review.js +54 -0
- package/dist/commands/tasks/runs.js +5 -0
- package/dist/commands/tasks/self-schedule.js +7 -4
- package/dist/commands/tasks/show.js +19 -0
- package/dist/commands/tasks/timeline.d.ts +2 -2
- package/dist/commands/tasks/timeline.js +19 -24
- package/dist/commands/tasks/updates/add.d.ts +22 -0
- package/dist/commands/tasks/updates/add.js +122 -0
- package/dist/commands/tasks/updates/list.d.ts +15 -0
- package/dist/commands/tasks/updates/list.js +57 -0
- package/dist/commands/tasks/waive.d.ts +1 -0
- package/dist/commands/tasks/waive.js +2 -1
- package/dist/lib/agentic-stream.d.ts +257 -0
- package/dist/lib/agentic-stream.js +490 -33
- package/dist/lib/balance.d.ts +8 -0
- package/dist/lib/commitment-product.d.ts +10 -1
- package/dist/lib/commitment-product.js +66 -2
- package/dist/lib/commitments.d.ts +2 -1
- package/dist/lib/commitments.js +1 -0
- package/dist/lib/conversation-search.d.ts +3 -0
- package/dist/lib/conversation-search.js +75 -0
- package/dist/lib/dedicated-machines.d.ts +66 -0
- package/dist/lib/dedicated-machines.js +161 -0
- package/dist/lib/execution-target.d.ts +21 -0
- package/dist/lib/execution-target.js +22 -6
- package/dist/lib/harnesses.d.ts +87 -6
- package/dist/lib/harnesses.js +32 -1
- package/dist/lib/hosted-machines.js +9 -0
- package/dist/lib/inbox.d.ts +2 -1
- package/dist/lib/machines.d.ts +17 -0
- package/dist/lib/machines.js +29 -0
- package/dist/lib/managed-agent-keys.d.ts +104 -0
- package/dist/lib/managed-agent-keys.js +50 -0
- package/dist/lib/memory-scope.d.ts +4 -3
- package/dist/lib/memory-scope.js +9 -9
- package/dist/lib/memory-sync.d.ts +114 -0
- package/dist/lib/memory-sync.js +730 -0
- package/dist/lib/message-provenance.d.ts +42 -0
- package/dist/lib/message-provenance.js +89 -0
- package/dist/lib/scoped-memory-command.d.ts +68 -0
- package/dist/lib/scoped-memory-command.js +183 -0
- package/dist/lib/session-task-endpoints.d.ts +1 -1
- package/dist/lib/session-task-endpoints.js +7 -0
- package/dist/lib/sky-code-broker.d.ts +47 -0
- package/dist/lib/sky-code-broker.js +50 -0
- package/dist/lib/sky-code-doctor.js +10 -1
- package/dist/lib/task-artifact-flags.d.ts +2 -0
- package/dist/lib/task-artifact-flags.js +7 -0
- package/dist/lib/task-execution.d.ts +4 -5
- package/dist/lib/task-execution.js +4 -5
- package/dist/lib/task-extras.d.ts +1 -5
- package/dist/lib/task-extras.js +1 -5
- package/dist/lib/task-legacy.d.ts +24 -0
- package/dist/lib/task-legacy.js +48 -0
- package/dist/lib/task-transcript.d.ts +5 -7
- package/dist/lib/task-transcript.js +8 -16
- package/dist/lib/tasks.d.ts +39 -21
- package/dist/lib/tasks.js +64 -21
- package/dist/lib/triggers.d.ts +39 -1
- package/dist/lib/triggers.js +70 -2
- package/dist/lib/usage-discovery.d.ts +17 -1
- package/dist/lib/usage-discovery.js +17 -1
- package/dist/lib/work-sync.d.ts +70 -0
- package/dist/lib/work-sync.js +29 -0
- package/dist/node_modules/@skrr-ai/data-provider/index.js +3760 -3621
- package/oclif.manifest.json +14653 -7813
- package/package.json +26 -5
|
@@ -0,0 +1,42 @@
|
|
|
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 dedicated_machines_1 = require("../../../lib/dedicated-machines");
|
|
6
|
+
class DedicatedMachinesStart extends base_command_1.BaseCommand {
|
|
7
|
+
static description = 'Start a Dedicated Runtime lease';
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> machines dedicated start <lease-id>',
|
|
10
|
+
'<%= config.bin %> machines dedicated start <lease-id> --json',
|
|
11
|
+
];
|
|
12
|
+
static args = {
|
|
13
|
+
lease: core_1.Args.string({
|
|
14
|
+
description: 'Dedicated Runtime lease id',
|
|
15
|
+
required: true,
|
|
16
|
+
ignoreStdin: true,
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
static flags = {
|
|
20
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
21
|
+
};
|
|
22
|
+
async run() {
|
|
23
|
+
this.requireAuth();
|
|
24
|
+
const { args, flags } = await this.parse(DedicatedMachinesStart);
|
|
25
|
+
let response;
|
|
26
|
+
try {
|
|
27
|
+
response = await (0, dedicated_machines_1.performDedicatedLeaseAction)(args.lease, 'start');
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
const message = (0, dedicated_machines_1.formatDedicatedRuntimeApiError)(err);
|
|
31
|
+
if (message)
|
|
32
|
+
this.error(message, { exit: 1 });
|
|
33
|
+
this.handleApiError(err);
|
|
34
|
+
}
|
|
35
|
+
if (flags.json) {
|
|
36
|
+
this.log(JSON.stringify(response, null, 2));
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
this.log(`Dedicated Runtime ${(0, dedicated_machines_1.dedicatedLeaseId)(response?.lease)} ${(0, dedicated_machines_1.dedicatedLeaseState)(response?.lease)}.`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.default = DedicatedMachinesStart;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export default class DedicatedMachinesStop extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
lease: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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 dedicated_machines_1 = require("../../../lib/dedicated-machines");
|
|
6
|
+
class DedicatedMachinesStop extends base_command_1.BaseCommand {
|
|
7
|
+
static description = 'Stop a Dedicated Runtime lease';
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> machines dedicated stop <lease-id>',
|
|
10
|
+
'<%= config.bin %> machines dedicated stop <lease-id> --json',
|
|
11
|
+
];
|
|
12
|
+
static args = {
|
|
13
|
+
lease: core_1.Args.string({
|
|
14
|
+
description: 'Dedicated Runtime lease id',
|
|
15
|
+
required: true,
|
|
16
|
+
ignoreStdin: true,
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
static flags = {
|
|
20
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
21
|
+
};
|
|
22
|
+
async run() {
|
|
23
|
+
this.requireAuth();
|
|
24
|
+
const { args, flags } = await this.parse(DedicatedMachinesStop);
|
|
25
|
+
let response;
|
|
26
|
+
try {
|
|
27
|
+
response = await (0, dedicated_machines_1.performDedicatedLeaseAction)(args.lease, 'stop');
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
const message = (0, dedicated_machines_1.formatDedicatedRuntimeApiError)(err);
|
|
31
|
+
if (message)
|
|
32
|
+
this.error(message, { exit: 1 });
|
|
33
|
+
this.handleApiError(err);
|
|
34
|
+
}
|
|
35
|
+
if (flags.json) {
|
|
36
|
+
this.log(JSON.stringify(response, null, 2));
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
this.log(`Dedicated Runtime ${(0, dedicated_machines_1.dedicatedLeaseId)(response?.lease)} ${(0, dedicated_machines_1.dedicatedLeaseState)(response?.lease)}.`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.default = DedicatedMachinesStop;
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
4
|
class Machines extends core_1.Command {
|
|
5
|
-
|
|
5
|
+
// Paired with `machines dedicated`, and the pairing is the point: this one
|
|
6
|
+
// resumes, that one restarts. Stated here so the choice can be made without
|
|
7
|
+
// opening either topic.
|
|
8
|
+
static description = 'A managed workspace that resumes — files, memory and running processes survive pause';
|
|
6
9
|
static examples = [
|
|
7
10
|
'<%= config.bin %> machines hosted start --name scratch --wait',
|
|
8
11
|
'<%= config.bin %> machines hosted list',
|
|
@@ -8,6 +8,7 @@ export default class MachinesList extends BaseCommand {
|
|
|
8
8
|
static examples: string[];
|
|
9
9
|
static flags: {
|
|
10
10
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
all: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
};
|
|
12
13
|
run(): Promise<void>;
|
|
13
14
|
}
|
|
@@ -14,7 +14,19 @@ class MachinesList extends base_command_1.BaseCommand {
|
|
|
14
14
|
'<%= config.bin %> machines list',
|
|
15
15
|
'<%= config.bin %> machines list --json',
|
|
16
16
|
];
|
|
17
|
-
static flags = {
|
|
17
|
+
static flags = {
|
|
18
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
19
|
+
// `harnesses list` already learned this: "Offline rows accumulate forever,
|
|
20
|
+
// so they are hidden by default." The same reasoning was never applied
|
|
21
|
+
// here, and this listing returned 252 rows for one account — every
|
|
22
|
+
// ephemeral sandbox ever provisioned, months back, all rendered `offline`,
|
|
23
|
+
// with the one live machine at the top and a wall of dead ones after it
|
|
24
|
+
// (OSK-7639). A list exists so someone can pick a row.
|
|
25
|
+
all: core_1.Flags.boolean({
|
|
26
|
+
description: 'Include machines that are offline or terminated. Off by default — dead sandboxes ' +
|
|
27
|
+
'accumulate forever and bury the ones you can use.',
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
18
30
|
async run() {
|
|
19
31
|
this.requireAuth();
|
|
20
32
|
const { flags } = await this.parse(MachinesList);
|
|
@@ -33,10 +45,21 @@ class MachinesList extends base_command_1.BaseCommand {
|
|
|
33
45
|
this.log('No machines. Install a daemon with `skrr harnesses install-token`.');
|
|
34
46
|
return;
|
|
35
47
|
}
|
|
36
|
-
|
|
37
|
-
|
|
48
|
+
const all = machines;
|
|
49
|
+
const shown = flags.all ? all : all.filter((m) => (0, machines_1.isReachableMachine)(m));
|
|
50
|
+
if (shown.length === 0) {
|
|
51
|
+
this.log(`No machine is reachable right now. ${all.length} offline/terminated — see them with --all.`);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
(0, format_1.renderTable)(shown.map((m) => ({
|
|
55
|
+
// Printed in full. A hard 20-character slice with no ellipsis made
|
|
56
|
+
// `machine:03548116-d36` read like a complete id and it is not — and
|
|
57
|
+
// two different hosted machines rendered as byte-identical rows,
|
|
58
|
+
// so the one column a list exists to be picked from could not
|
|
59
|
+
// distinguish them (OSK-7621).
|
|
60
|
+
id: (0, format_1.formatCell)(m.id),
|
|
38
61
|
name: (0, format_1.formatCell)(m.preferences?.name || m.name),
|
|
39
|
-
status: (0, format_1.formatCell)(
|
|
62
|
+
status: (0, format_1.formatCell)((0, machines_1.machineStateLabel)(m)),
|
|
40
63
|
// Both numbers matter: "2/7" is a machine that is up with most of its
|
|
41
64
|
// harnesses signed out, which reads nothing like "7/7". The
|
|
42
65
|
// denominator counts LIVE rows, matching the population
|
|
@@ -48,13 +71,18 @@ class MachinesList extends base_command_1.BaseCommand {
|
|
|
48
71
|
? new Date(m.lastSeenAt).toISOString().slice(0, 16).replace('T', ' ')
|
|
49
72
|
: '-',
|
|
50
73
|
})), [
|
|
51
|
-
{ key: 'id', header: 'ID' },
|
|
74
|
+
{ key: 'id', header: 'ID', verbatim: true },
|
|
52
75
|
{ key: 'name', header: 'NAME', maxWidth: 28 },
|
|
53
76
|
{ key: 'status', header: 'STATUS' },
|
|
54
77
|
{ key: 'harnesses', header: 'ONLINE' },
|
|
55
78
|
{ key: 'platform', header: 'PLATFORM' },
|
|
56
79
|
{ key: 'seen', header: 'LAST SEEN' },
|
|
57
80
|
], (line) => this.log(line));
|
|
81
|
+
const hidden = all.length - shown.length;
|
|
82
|
+
if (hidden > 0) {
|
|
83
|
+
this.log('');
|
|
84
|
+
this.log(`${hidden} offline or terminated machine(s) hidden — pass --all to include them.`);
|
|
85
|
+
}
|
|
58
86
|
}
|
|
59
87
|
}
|
|
60
88
|
exports.default = MachinesList;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ScopedMemoryCommand } from '../../../lib/scoped-memory-command';
|
|
2
|
+
export default class MemoryApprovalsIssue extends ScopedMemoryCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
purpose: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
6
|
+
payload: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
'source-store': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
'source-memory': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
'source-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
ttl: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
agent: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
space: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
store: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
scope: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const scoped_memory_command_1 = require("../../../lib/scoped-memory-command");
|
|
5
|
+
class MemoryApprovalsIssue extends scoped_memory_command_1.ScopedMemoryCommand {
|
|
6
|
+
static description = 'Issue a short-lived user approval for Space PII or Agent-to-Space promotion';
|
|
7
|
+
static flags = {
|
|
8
|
+
...scoped_memory_command_1.scopedMemoryFlags,
|
|
9
|
+
purpose: core_1.Flags.string({
|
|
10
|
+
description: 'Approval purpose',
|
|
11
|
+
options: ['space_pii', 'space_promotion'],
|
|
12
|
+
required: true,
|
|
13
|
+
}),
|
|
14
|
+
payload: core_1.Flags.string({
|
|
15
|
+
description: 'Exact mutation-policy JSON payload for a space_pii approval',
|
|
16
|
+
}),
|
|
17
|
+
'source-store': core_1.Flags.string({ description: 'Agent Store ID for space_promotion' }),
|
|
18
|
+
'source-memory': core_1.Flags.string({ description: 'Agent Memory topic ID for space_promotion' }),
|
|
19
|
+
'source-version': core_1.Flags.string({ description: 'Current Agent Memory version for promotion' }),
|
|
20
|
+
ttl: core_1.Flags.integer({ description: 'Approval lifetime in seconds (30-900)', default: 300 }),
|
|
21
|
+
};
|
|
22
|
+
async run() {
|
|
23
|
+
this.requireAuth();
|
|
24
|
+
const { flags } = await this.parse(MemoryApprovalsIssue);
|
|
25
|
+
const store = await this.resolveStore(flags, { write: true });
|
|
26
|
+
if (store.owner.kind !== 'space' || store.mount?.source !== 'current_space') {
|
|
27
|
+
this.error('MEMORY_APPROVAL_TARGET_INVALID: approvals require the current Space Store.', {
|
|
28
|
+
exit: 5,
|
|
29
|
+
code: 'MEMORY_APPROVAL_TARGET_INVALID',
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
let payload;
|
|
33
|
+
if (flags.purpose === 'space_pii') {
|
|
34
|
+
if (!flags.payload) {
|
|
35
|
+
this.error('--payload JSON is required for --purpose space_pii.', { exit: 2 });
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
payload = JSON.parse(flags.payload);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
this.error('--payload must be valid JSON.', { exit: 2 });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else if (!flags['source-store'] || !flags['source-memory'] || !flags['source-version']) {
|
|
45
|
+
this.error('--source-store, --source-memory, and --source-version are required for space_promotion.', { exit: 2 });
|
|
46
|
+
}
|
|
47
|
+
const result = await this.memoryApi(flags.agent, '/approvals', {
|
|
48
|
+
method: 'POST',
|
|
49
|
+
body: {
|
|
50
|
+
spaceId: flags.space,
|
|
51
|
+
purpose: flags.purpose,
|
|
52
|
+
targetStoreId: store.id,
|
|
53
|
+
ttlSeconds: flags.ttl,
|
|
54
|
+
...(payload ? { payload } : {}),
|
|
55
|
+
...(flags['source-store'] ? { sourceStoreId: flags['source-store'] } : {}),
|
|
56
|
+
...(flags['source-memory'] ? { sourceMemoryId: flags['source-memory'] } : {}),
|
|
57
|
+
...(flags['source-version'] ? { sourceVersionId: flags['source-version'] } : {}),
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
this.print(result, flags.json, `Issued ${result.purpose} approval ${result.approvalId}; expires ${result.expiresAt}.`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.default = MemoryApprovalsIssue;
|
|
@@ -28,8 +28,11 @@ class MemoryCommit extends base_command_1.BaseCommand {
|
|
|
28
28
|
if (flags.json)
|
|
29
29
|
this.log(this.agentJson(flags.agent, result));
|
|
30
30
|
else {
|
|
31
|
-
this.log(`${result.outcome || 'committed'}: ${result.node.
|
|
32
|
-
|
|
31
|
+
this.log(`${result.outcome || 'committed'}: ${result.node?.path || result.node?.id || args.proposal}`);
|
|
32
|
+
if (result.fact?.claim)
|
|
33
|
+
this.log(result.fact.claim);
|
|
34
|
+
else if (result.fact?.id)
|
|
35
|
+
this.log(`Fact: ${result.fact.id}`);
|
|
33
36
|
this.printAgentUrl(flags.agent);
|
|
34
37
|
}
|
|
35
38
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export default class MemoryContext extends
|
|
1
|
+
import { ScopedMemoryCommand } from '../../lib/scoped-memory-command';
|
|
2
|
+
export default class MemoryContext extends ScopedMemoryCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static args: {
|
|
5
5
|
query: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
6
|
};
|
|
7
7
|
static flags: {
|
|
8
8
|
agent: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
space: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
10
|
tokens: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
11
|
level: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
12
|
nodes: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
class MemoryContext extends base_command_1.BaseCommand {
|
|
4
|
+
const scoped_memory_command_1 = require("../../lib/scoped-memory-command");
|
|
5
|
+
class MemoryContext extends scoped_memory_command_1.ScopedMemoryCommand {
|
|
7
6
|
static description = 'Preview the hierarchical memory context assembled for a query';
|
|
8
7
|
static args = { query: core_1.Args.string({ required: true, ignoreStdin: true }) };
|
|
9
8
|
static flags = {
|
|
10
9
|
agent: core_1.Flags.string({ required: true }),
|
|
10
|
+
space: core_1.Flags.string({ description: 'Current Space context; includes its mounted Store' }),
|
|
11
11
|
tokens: core_1.Flags.integer({ default: 2000 }),
|
|
12
12
|
level: core_1.Flags.string({ options: ['L0', 'L1', 'L2'], default: 'L2' }),
|
|
13
13
|
nodes: core_1.Flags.integer({ default: 12 }),
|
|
@@ -17,19 +17,17 @@ class MemoryContext extends base_command_1.BaseCommand {
|
|
|
17
17
|
async run() {
|
|
18
18
|
this.requireAuth();
|
|
19
19
|
const { args, flags } = await this.parse(MemoryContext);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const result = await this.memoryApi(flags.agent, '/context', {
|
|
21
|
+
method: 'POST',
|
|
22
|
+
body: {
|
|
23
23
|
query: args.query,
|
|
24
24
|
maxTokens: flags.tokens,
|
|
25
25
|
maxLevel: flags.level,
|
|
26
26
|
maxNodes: flags.nodes,
|
|
27
27
|
cooldownMinutes: flags.cooldown,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
this.handleApiError(error);
|
|
32
|
-
}
|
|
28
|
+
...(flags.space ? { spaceId: flags.space } : {}),
|
|
29
|
+
},
|
|
30
|
+
});
|
|
33
31
|
if (flags.json) {
|
|
34
32
|
this.log(this.agentJson(flags.agent, result));
|
|
35
33
|
return;
|
|
@@ -8,7 +8,7 @@ export default class MemoryDelete extends BaseCommand {
|
|
|
8
8
|
static flags: {
|
|
9
9
|
agent: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
10
|
tier: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
-
workspace: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
'pool-workspace': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
12
|
yes: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
13
|
};
|
|
14
14
|
run(): Promise<void>;
|
|
@@ -5,7 +5,7 @@ export default class MemoryList extends BaseCommand {
|
|
|
5
5
|
static flags: {
|
|
6
6
|
agent: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
7
|
tier: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
-
workspace: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
'pool-workspace': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
9
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
};
|
|
11
11
|
run(): Promise<void>;
|
|
@@ -12,7 +12,7 @@ class MemoryList extends base_command_1.BaseCommand {
|
|
|
12
12
|
'<%= config.bin %> memory list --json',
|
|
13
13
|
'<%= config.bin %> memory list --agent agent_abc123',
|
|
14
14
|
'<%= config.bin %> memory list --tier user',
|
|
15
|
-
'<%= config.bin %> memory list --tier workspace --workspace ws_123',
|
|
15
|
+
'<%= config.bin %> memory list --tier workspace --pool-workspace ws_123',
|
|
16
16
|
];
|
|
17
17
|
static flags = {
|
|
18
18
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ScopedMemoryCommand } from '../../../lib/scoped-memory-command';
|
|
2
|
+
export default class MemoryMountsResolve extends ScopedMemoryCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
agent: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
6
|
+
space: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const data_schemas_1 = require("@skrr-ai/data-schemas");
|
|
5
|
+
const scoped_memory_command_1 = require("../../../lib/scoped-memory-command");
|
|
6
|
+
class MemoryMountsResolve extends scoped_memory_command_1.ScopedMemoryCommand {
|
|
7
|
+
static description = 'Resolve the ACL-aware Memory mounts for an Agent session';
|
|
8
|
+
static flags = {
|
|
9
|
+
agent: core_1.Flags.string({ required: true }),
|
|
10
|
+
space: core_1.Flags.string({ description: 'Current Space context' }),
|
|
11
|
+
json: core_1.Flags.boolean({ description: 'Output stable JSON' }),
|
|
12
|
+
};
|
|
13
|
+
async run() {
|
|
14
|
+
this.requireAuth();
|
|
15
|
+
const { flags } = await this.parse(MemoryMountsResolve);
|
|
16
|
+
const response = await this.memoryApi(flags.agent, `/mounts${this.query(flags)}`);
|
|
17
|
+
const result = { mounts: response.mounts.map((mount) => data_schemas_1.MemoryMountSchema.parse(mount)) };
|
|
18
|
+
if (flags.json)
|
|
19
|
+
return this.log(JSON.stringify(result, null, 2));
|
|
20
|
+
for (const mount of result.mounts) {
|
|
21
|
+
this.log(`${mount.source} ${mount.uri} ${mount.access} store=${mount.storeId} r${mount.storeRevision} cursor=${mount.cursor}`);
|
|
22
|
+
}
|
|
23
|
+
if (!result.mounts.length)
|
|
24
|
+
this.log('No Memory mounts.');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.default = MemoryMountsResolve;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ScopedMemoryCommand } from '../../../lib/scoped-memory-command';
|
|
2
|
+
export default class MemoryProposalsCommit extends ScopedMemoryCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
proposalId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static flags: {
|
|
8
|
+
reason: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
'idempotency-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
'privacy-approval': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
agent: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
space: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
store: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
scope: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const scoped_memory_command_1 = require("../../../lib/scoped-memory-command");
|
|
5
|
+
class MemoryProposalsCommit extends scoped_memory_command_1.ScopedMemoryCommand {
|
|
6
|
+
static description = 'Commit a reviewed Store-scoped Memory proposal';
|
|
7
|
+
static args = {
|
|
8
|
+
proposalId: core_1.Args.string({ description: 'Proposal ID', required: true, ignoreStdin: true }),
|
|
9
|
+
};
|
|
10
|
+
static flags = {
|
|
11
|
+
...scoped_memory_command_1.scopedMemoryFlags,
|
|
12
|
+
reason: core_1.Flags.string({ description: 'Decision reason recorded on the proposal' }),
|
|
13
|
+
'idempotency-key': core_1.Flags.string({ description: 'Stable retry key for the canonical mutation' }),
|
|
14
|
+
'privacy-approval': core_1.Flags.string({ description: 'One-time approval ID for Space PII' }),
|
|
15
|
+
};
|
|
16
|
+
async run() {
|
|
17
|
+
this.requireAuth();
|
|
18
|
+
const { args, flags } = await this.parse(MemoryProposalsCommit);
|
|
19
|
+
const store = await this.resolveStore(flags, { write: true });
|
|
20
|
+
const result = await this.memoryApi(flags.agent, `/stores/${store.id}/proposals/${encodeURIComponent(args.proposalId)}/commit`, {
|
|
21
|
+
method: 'POST',
|
|
22
|
+
body: {
|
|
23
|
+
...(flags.space ? { spaceId: flags.space } : {}),
|
|
24
|
+
...(flags.reason ? { reason: flags.reason } : {}),
|
|
25
|
+
...(flags['idempotency-key'] ? { idempotencyKey: flags['idempotency-key'] } : {}),
|
|
26
|
+
...(flags['privacy-approval'] ? { privacyApprovalId: flags['privacy-approval'] } : {}),
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
this.print(result, flags.json, `Committed Memory proposal ${args.proposalId}: ${result.mutation?.node?.path || result.proposal?.proposedPath || 'canonical Store updated'}.`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.default = MemoryProposalsCommit;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ScopedMemoryCommand } from '../../../lib/scoped-memory-command';
|
|
2
|
+
export default class MemoryProposalsCreate extends ScopedMemoryCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
path: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
6
|
+
content: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
title: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
kind: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
confidence: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
evidence: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
agent: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
space: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
store: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
scope: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const scoped_memory_command_1 = require("../../../lib/scoped-memory-command");
|
|
5
|
+
const MEMORY_KINDS = [
|
|
6
|
+
'profile',
|
|
7
|
+
'preference',
|
|
8
|
+
'entity',
|
|
9
|
+
'event',
|
|
10
|
+
'belief',
|
|
11
|
+
'experience',
|
|
12
|
+
'procedure',
|
|
13
|
+
'relationship',
|
|
14
|
+
'observation',
|
|
15
|
+
'custom',
|
|
16
|
+
];
|
|
17
|
+
class MemoryProposalsCreate extends scoped_memory_command_1.ScopedMemoryCommand {
|
|
18
|
+
static description = 'Submit a proposal to a mounted Agent or Space Store without changing canonical Memory';
|
|
19
|
+
static flags = {
|
|
20
|
+
...scoped_memory_command_1.scopedMemoryFlags,
|
|
21
|
+
path: core_1.Flags.string({ required: true }),
|
|
22
|
+
content: core_1.Flags.string({ required: true }),
|
|
23
|
+
title: core_1.Flags.string(),
|
|
24
|
+
kind: core_1.Flags.string({ description: 'Canonical Memory kind', options: [...MEMORY_KINDS] }),
|
|
25
|
+
confidence: core_1.Flags.string(),
|
|
26
|
+
evidence: core_1.Flags.string({
|
|
27
|
+
description: 'Attributable source reference (required for Space proposals)',
|
|
28
|
+
multiple: true,
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
31
|
+
async run() {
|
|
32
|
+
this.requireAuth();
|
|
33
|
+
const { flags } = await this.parse(MemoryProposalsCreate);
|
|
34
|
+
const store = await this.resolveStore(flags, { write: true });
|
|
35
|
+
if (store.owner.kind === 'space' && !flags.evidence?.length) {
|
|
36
|
+
this.error('Space proposals require at least one --evidence <source-ref>.', { exit: 2 });
|
|
37
|
+
}
|
|
38
|
+
const result = await this.memoryApi(flags.agent, `/stores/${encodeURIComponent(store.id)}/proposals`, {
|
|
39
|
+
method: 'POST',
|
|
40
|
+
body: {
|
|
41
|
+
spaceId: flags.space,
|
|
42
|
+
path: flags.path,
|
|
43
|
+
claim: flags.content,
|
|
44
|
+
title: flags.title,
|
|
45
|
+
memoryKind: flags.kind,
|
|
46
|
+
confidence: flags.confidence === undefined ? undefined : Number(flags.confidence),
|
|
47
|
+
evidence: (flags.evidence || []).map((sourceRef) => ({
|
|
48
|
+
sourceKind: 'observation',
|
|
49
|
+
sourceRef,
|
|
50
|
+
})),
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
this.print(result, flags.json, `Submitted Memory proposal ${result.proposal.id} to ${store.owner.kind}:${store.owner.id}.`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.default = MemoryProposalsCreate;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ScopedMemoryCommand } from '../../../lib/scoped-memory-command';
|
|
2
|
+
export default class MemoryProposalsList extends ScopedMemoryCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
status: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
6
|
+
agent: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
space: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
store: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
scope: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const scoped_memory_command_1 = require("../../../lib/scoped-memory-command");
|
|
5
|
+
class MemoryProposalsList extends scoped_memory_command_1.ScopedMemoryCommand {
|
|
6
|
+
static description = 'List reviewable proposals in one mounted Memory Store';
|
|
7
|
+
static flags = {
|
|
8
|
+
...scoped_memory_command_1.scopedMemoryFlags,
|
|
9
|
+
status: core_1.Flags.string({
|
|
10
|
+
description: 'Proposal status',
|
|
11
|
+
options: ['proposed', 'accepted', 'merged', 'rejected'],
|
|
12
|
+
default: 'proposed',
|
|
13
|
+
}),
|
|
14
|
+
};
|
|
15
|
+
async run() {
|
|
16
|
+
this.requireAuth();
|
|
17
|
+
const { flags } = await this.parse(MemoryProposalsList);
|
|
18
|
+
const store = await this.resolveStore(flags);
|
|
19
|
+
const result = await this.memoryApi(flags.agent, `/stores/${store.id}/proposals${this.query(flags, { status: flags.status })}`);
|
|
20
|
+
if (flags.json) {
|
|
21
|
+
this.log(JSON.stringify({ storeId: store.id, proposals: result.proposals }, null, 2));
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
for (const proposal of result.proposals) {
|
|
25
|
+
this.log(`${proposal.id} ${proposal.status} ${proposal.proposedPath} ${proposal.title || proposal.claim}`);
|
|
26
|
+
}
|
|
27
|
+
if (!result.proposals.length)
|
|
28
|
+
this.log(`No ${flags.status} Memory proposals.`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.default = MemoryProposalsList;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ScopedMemoryCommand } from '../../../lib/scoped-memory-command';
|
|
2
|
+
export default class MemoryProposalsPromote extends ScopedMemoryCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
'source-store': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
6
|
+
'source-memory': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
'source-version': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
'consent-approval': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
path: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
'authorization-generation': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
'expected-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
'idempotency-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
'privacy-approval': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
'dry-run': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
agent: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
|
+
space: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
|
+
store: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
18
|
+
scope: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
19
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
20
|
+
};
|
|
21
|
+
run(): Promise<void>;
|
|
22
|
+
}
|