@skrr-ai/cli 0.1.92 → 0.1.94
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 +44 -0
- package/dist/base-command.js +96 -0
- package/dist/commands/agents/badge.d.ts +41 -0
- package/dist/commands/agents/badge.js +158 -0
- package/dist/commands/agents/create.d.ts +24 -0
- package/dist/commands/agents/create.js +212 -0
- package/dist/commands/agents/embed.d.ts +20 -0
- package/dist/commands/agents/embed.js +61 -0
- package/dist/commands/agents/operating-plan.d.ts +11 -0
- package/dist/commands/agents/operating-plan.js +54 -0
- package/dist/commands/agents/roles/example.d.ts +11 -0
- package/dist/commands/agents/roles/example.js +30 -0
- package/dist/commands/{commitments/mode.d.ts → agents/roles/export.d.ts} +5 -5
- package/dist/commands/agents/roles/export.js +81 -0
- package/dist/commands/agents/roles/install.d.ts +12 -0
- package/dist/commands/agents/roles/install.js +48 -0
- package/dist/commands/agents/roles/list.d.ts +11 -0
- package/dist/commands/agents/roles/list.js +36 -0
- package/dist/commands/agents/roles/preview.d.ts +14 -0
- package/dist/commands/agents/roles/preview.js +49 -0
- package/dist/commands/agents/roles/withdraw.d.ts +13 -0
- package/dist/commands/agents/roles/withdraw.js +43 -0
- package/dist/commands/agents/share.d.ts +27 -0
- package/dist/commands/agents/share.js +100 -0
- package/dist/commands/agents/vanity.d.ts +21 -0
- package/dist/commands/agents/vanity.js +77 -0
- package/dist/commands/agents/visibility.d.ts +21 -1
- package/dist/commands/agents/visibility.js +112 -0
- package/dist/commands/commands.d.ts +1 -0
- package/dist/commands/commands.js +22 -9
- package/dist/commands/commitments/{autonomy-requests → cadence-requests}/decide.d.ts +5 -7
- package/dist/commands/commitments/{autonomy-requests → cadence-requests}/decide.js +13 -15
- package/dist/commands/commitments/cost.d.ts +1 -1
- package/dist/commands/commitments/cost.js +1 -1
- package/dist/commands/commitments/create.d.ts +0 -7
- package/dist/commands/commitments/create.js +9 -98
- package/dist/commands/commitments/delivery.js +3 -21
- package/dist/commands/commitments/doctor.js +28 -27
- package/dist/commands/commitments/effective-policy.js +5 -36
- package/dist/commands/commitments/evaluations.d.ts +15 -0
- package/dist/commands/commitments/evaluations.js +54 -0
- package/dist/commands/commitments/pack/activate.d.ts +11 -0
- package/dist/commands/commitments/pack/activate.js +22 -0
- package/dist/commands/commitments/pack/bind.js +1 -1
- package/dist/commands/commitments/remediate.js +2 -5
- package/dist/commands/commitments/show.js +1 -1
- package/dist/commands/commitments/update.js +9 -9
- package/dist/commands/commitments/wake-capabilities.d.ts +1 -3
- package/dist/commands/commitments/wake-capabilities.js +5 -21
- package/dist/commands/earnings/attributions.d.ts +17 -0
- package/dist/commands/earnings/attributions.js +82 -0
- package/dist/commands/earnings/index.js +2 -1
- package/dist/commands/generate-recovery-code.js +4 -3
- package/dist/commands/github/allow-tools.d.ts +1 -0
- package/dist/commands/github/app/install.d.ts +1 -0
- package/dist/commands/github/app/status.d.ts +1 -0
- package/dist/commands/github/connect.d.ts +1 -0
- package/dist/commands/github/connections.d.ts +1 -0
- package/dist/commands/github/disconnect.d.ts +1 -0
- package/dist/commands/github/finalize.d.ts +1 -0
- package/dist/commands/github/reconnect.d.ts +1 -0
- package/dist/commands/github/run.d.ts +1 -0
- package/dist/commands/github/tools.d.ts +1 -0
- package/dist/commands/integrations/connections/connect.d.ts +1 -0
- package/dist/commands/integrations/connections/disconnect.d.ts +1 -0
- package/dist/commands/integrations/connections/finalize.d.ts +1 -0
- package/dist/commands/integrations/connections/list.d.ts +1 -0
- package/dist/commands/integrations/connections/reconnect.d.ts +1 -0
- package/dist/commands/integrations/execute.d.ts +1 -0
- package/dist/commands/integrations/search.d.ts +1 -0
- package/dist/commands/integrations/toolkits.d.ts +1 -0
- package/dist/commands/integrations/tools/allow.d.ts +1 -0
- package/dist/commands/integrations/tools/list.d.ts +1 -0
- package/dist/commands/login.js +12 -0
- package/dist/commands/machines/dedicated/logs.d.ts +19 -0
- package/dist/commands/machines/dedicated/logs.js +103 -0
- package/dist/commands/machines/dedicated/power/set.js +1 -1
- package/dist/commands/open.d.ts +24 -0
- package/dist/commands/open.js +74 -0
- package/dist/commands/projects/archive.d.ts +1 -0
- package/dist/commands/projects/archive.js +23 -0
- package/dist/commands/projects/delete.d.ts +1 -0
- package/dist/commands/projects/delete.js +23 -0
- package/dist/commands/projects/list.d.ts +3 -0
- package/dist/commands/projects/list.js +12 -2
- package/dist/commands/spaces/actions/add.js +4 -3
- package/dist/commands/spaces/actions/available.js +3 -2
- package/dist/commands/spaces/actions/list.js +5 -4
- package/dist/commands/spaces/actions/replace.js +6 -5
- package/dist/commands/spaces/archive.js +3 -2
- package/dist/commands/spaces/auto-executor/preview.js +4 -3
- package/dist/commands/spaces/auto-executor/run.js +4 -3
- package/dist/commands/spaces/auto-executor/runs.js +3 -2
- package/dist/commands/spaces/auto-executor/update.js +4 -3
- package/dist/commands/spaces/bootstrap.js +3 -2
- package/dist/commands/spaces/briefs/delete.js +3 -2
- package/dist/commands/spaces/briefs/get.js +3 -2
- package/dist/commands/spaces/briefs/list.js +3 -2
- package/dist/commands/spaces/briefs/set.js +5 -4
- package/dist/commands/spaces/capacity.js +5 -4
- package/dist/commands/spaces/conversations.js +3 -2
- package/dist/commands/spaces/cycles/create.js +3 -2
- package/dist/commands/spaces/cycles/graph.js +2 -1
- package/dist/commands/spaces/cycles/list.js +3 -2
- package/dist/commands/spaces/cycles/settings.js +4 -3
- package/dist/commands/spaces/cycles/show.js +3 -2
- package/dist/commands/spaces/cycles/update.js +3 -2
- package/dist/commands/spaces/delete.js +4 -3
- package/dist/commands/spaces/expertise-suggestions.js +4 -3
- package/dist/commands/spaces/files/delete.js +3 -2
- package/dist/commands/spaces/files/folders/create.js +3 -2
- package/dist/commands/spaces/files/folders/delete.js +3 -2
- package/dist/commands/spaces/files/folders/list.js +3 -2
- package/dist/commands/spaces/files/folders/update.js +3 -2
- package/dist/commands/spaces/files/list.js +3 -2
- package/dist/commands/spaces/files/move.js +3 -2
- package/dist/commands/spaces/files/rename.js +3 -2
- package/dist/commands/spaces/files/upload.js +6 -5
- package/dist/commands/spaces/github-automations/set.js +3 -2
- package/dist/commands/spaces/github-automations/show.js +3 -2
- package/dist/commands/spaces/goals.js +2 -1
- package/dist/commands/spaces/heartbeats/create.js +4 -3
- package/dist/commands/spaces/heartbeats/delete.js +4 -3
- package/dist/commands/spaces/heartbeats/list.js +4 -3
- package/dist/commands/spaces/heartbeats/status.js +3 -2
- package/dist/commands/spaces/heartbeats/update.js +4 -3
- package/dist/commands/spaces/insights.js +5 -4
- package/dist/commands/spaces/labels/add.js +4 -3
- package/dist/commands/spaces/labels/list.js +2 -1
- package/dist/commands/spaces/labels/remove.js +4 -3
- package/dist/commands/spaces/list.d.ts +3 -0
- package/dist/commands/spaces/list.js +11 -2
- package/dist/commands/spaces/live/cards/create.js +3 -2
- package/dist/commands/spaces/live/cards/list.js +3 -2
- package/dist/commands/spaces/live/cards/reorder.js +7 -2
- package/dist/commands/spaces/live/scene.js +4 -3
- package/dist/commands/spaces/members/add.js +7 -6
- package/dist/commands/spaces/members/list.js +4 -3
- package/dist/commands/spaces/members/remove.js +7 -6
- package/dist/commands/spaces/move.js +3 -2
- package/dist/commands/spaces/pin.js +5 -4
- package/dist/commands/spaces/preferences/show.js +4 -3
- package/dist/commands/spaces/preferences/tabs.js +4 -3
- package/dist/commands/spaces/revisions.js +3 -2
- package/dist/commands/spaces/room/ensure.js +5 -4
- package/dist/commands/spaces/room/messages.js +3 -2
- package/dist/commands/spaces/room/show.js +5 -4
- package/dist/commands/spaces/skills/add.js +4 -3
- package/dist/commands/spaces/skills/list.js +3 -2
- package/dist/commands/spaces/skills/pin.js +4 -3
- package/dist/commands/spaces/skills/remove.js +4 -3
- package/dist/commands/spaces/snapshot.js +3 -2
- package/dist/commands/spaces/states/archive.js +3 -2
- package/dist/commands/spaces/states/create.js +3 -2
- package/dist/commands/spaces/states/list.js +3 -2
- package/dist/commands/spaces/states/reorder.js +2 -1
- package/dist/commands/spaces/states/update.js +3 -2
- package/dist/commands/spaces/summary.js +4 -3
- package/dist/commands/spaces/tasks.d.ts +3 -0
- package/dist/commands/spaces/tasks.js +14 -3
- package/dist/commands/spaces/triggers/delete.js +5 -4
- package/dist/commands/spaces/triggers/set.js +4 -3
- package/dist/commands/spaces/triggers/show.js +4 -3
- package/dist/commands/spaces/unarchive.js +3 -2
- package/dist/commands/spaces/update.js +5 -4
- package/dist/commands/spaces/views/create.js +3 -2
- package/dist/commands/spaces/views/list.js +3 -2
- package/dist/commands/spaces/views/reorder.js +6 -3
- package/dist/commands/spaces/views/subscribe.js +2 -1
- package/dist/commands/spaces/views/subscriptions.js +1 -0
- package/dist/commands/spaces/views/unsubscribe.js +2 -1
- package/dist/commands/spaces/widgets/add.js +4 -3
- package/dist/commands/spaces/widgets/list.js +3 -2
- package/dist/commands/spaces/widgets/remove.js +5 -4
- package/dist/commands/spaces/work-graph.js +2 -1
- package/dist/commands/store/install.d.ts +1 -1
- package/dist/commands/store/install.js +24 -8
- package/dist/commands/store/show.d.ts +25 -0
- package/dist/commands/store/show.js +203 -0
- package/dist/commands/store/stats.d.ts +33 -0
- package/dist/commands/store/stats.js +258 -0
- package/dist/commands/tasks/actions/attach.js +1 -1
- package/dist/commands/tasks/actions/detach.js +4 -3
- package/dist/commands/tasks/activity.js +3 -2
- package/dist/commands/tasks/ancestors.js +2 -1
- package/dist/commands/tasks/approvals/create.js +2 -1
- package/dist/commands/tasks/approvals/delete.js +3 -2
- package/dist/commands/tasks/approvals/list.js +5 -4
- package/dist/commands/tasks/approvals/resolve.js +2 -1
- package/dist/commands/tasks/archive.js +3 -2
- package/dist/commands/tasks/assign.js +4 -3
- package/dist/commands/tasks/attachments/delete.js +3 -2
- package/dist/commands/tasks/attachments/download.d.ts +1 -0
- package/dist/commands/tasks/attachments/download.js +20 -1
- package/dist/commands/tasks/attachments/list.js +2 -1
- package/dist/commands/tasks/attachments/set-role.js +2 -1
- package/dist/commands/tasks/attachments/upload.js +2 -1
- package/dist/commands/tasks/bulk-update.d.ts +1 -0
- package/dist/commands/tasks/bulk-update.js +106 -15
- package/dist/commands/tasks/cancel-cascade.d.ts +1 -0
- package/dist/commands/tasks/cancel-cascade.js +13 -3
- package/dist/commands/tasks/cascade-status.js +2 -1
- package/dist/commands/tasks/checkout.js +3 -2
- package/dist/commands/tasks/children.js +2 -1
- package/dist/commands/tasks/comments/add.js +7 -6
- package/dist/commands/tasks/comments/anchor.js +8 -7
- package/dist/commands/tasks/comments/delete.js +3 -2
- package/dist/commands/tasks/comments/list.js +2 -1
- package/dist/commands/tasks/comments/reopen.js +3 -2
- package/dist/commands/tasks/comments/resolve.js +3 -2
- package/dist/commands/tasks/create-tree.d.ts +63 -0
- package/dist/commands/tasks/create-tree.js +197 -4
- package/dist/commands/tasks/delete.js +5 -4
- package/dist/commands/tasks/descendants.js +2 -1
- package/dist/commands/tasks/dri-plan.js +3 -2
- package/dist/commands/tasks/dri-run.js +3 -2
- package/dist/commands/tasks/dri-status.js +2 -1
- package/dist/commands/tasks/duplicate-pipeline.js +2 -1
- package/dist/commands/tasks/execution-summary.js +2 -1
- package/dist/commands/tasks/execution-timeline.js +2 -1
- package/dist/commands/tasks/fork.js +1 -0
- package/dist/commands/tasks/forward.js +4 -3
- package/dist/commands/tasks/handover.js +1 -0
- package/dist/commands/tasks/interrupt.js +3 -2
- package/dist/commands/tasks/labels/attach.js +4 -3
- package/dist/commands/tasks/labels/detach.js +4 -3
- package/dist/commands/tasks/labels/suggest.js +5 -4
- package/dist/commands/tasks/list.d.ts +27 -1
- package/dist/commands/tasks/list.js +101 -3
- package/dist/commands/tasks/move.js +4 -3
- package/dist/commands/tasks/output.js +6 -5
- package/dist/commands/tasks/pause-schedule.js +3 -2
- package/dist/commands/tasks/promote.js +1 -0
- package/dist/commands/tasks/prompt-log.js +2 -1
- package/dist/commands/tasks/release.js +5 -4
- package/dist/commands/tasks/remind.js +2 -1
- package/dist/commands/tasks/replay.js +3 -2
- package/dist/commands/tasks/report.js +1 -0
- package/dist/commands/tasks/resume-schedule.js +3 -2
- package/dist/commands/tasks/retry-schedule.js +3 -2
- package/dist/commands/tasks/retry.js +10 -9
- package/dist/commands/tasks/revisions.js +2 -1
- package/dist/commands/tasks/runs.js +6 -5
- package/dist/commands/tasks/schedule.js +3 -2
- package/dist/commands/tasks/self-schedule.js +6 -5
- package/dist/commands/tasks/skills/pin.js +3 -2
- package/dist/commands/tasks/skills/unpin.js +3 -2
- package/dist/commands/tasks/snooze.js +6 -5
- package/dist/commands/tasks/start-all.js +5 -4
- package/dist/commands/tasks/subscribe.js +1 -0
- package/dist/commands/tasks/tags/add.js +4 -3
- package/dist/commands/tasks/tags/remove.js +4 -3
- package/dist/commands/tasks/timeline.js +3 -2
- package/dist/commands/tasks/today.d.ts +4 -1
- package/dist/commands/tasks/today.js +12 -2
- package/dist/commands/tasks/transcript.js +6 -5
- package/dist/commands/tasks/unschedule.js +3 -2
- package/dist/commands/tasks/unsnooze.js +3 -2
- package/dist/commands/tasks/unsubscribe.js +2 -1
- package/dist/commands/tasks/update.js +5 -4
- package/dist/commands/tasks/wait.js +5 -4
- package/dist/lib/agent-distribution.d.ts +37 -0
- package/dist/lib/agent-distribution.js +63 -0
- package/dist/lib/agent-ref.d.ts +69 -0
- package/dist/lib/agent-ref.js +168 -0
- package/dist/lib/api-fetch.d.ts +2 -0
- package/dist/lib/api-fetch.js +14 -3
- package/dist/lib/command-hygiene.d.ts +13 -0
- package/dist/lib/command-hygiene.js +62 -2
- package/dist/lib/commitment-product.d.ts +0 -6
- package/dist/lib/commitment-product.js +1 -30
- package/dist/lib/commitments.d.ts +9 -45
- package/dist/lib/commitments.js +24 -95
- package/dist/lib/dedicated-power.d.ts +5 -0
- package/dist/lib/dedicated-power.js +30 -2
- package/dist/lib/dry-run-plans.d.ts +50 -0
- package/dist/lib/dry-run-plans.js +85 -0
- package/dist/lib/json-output.d.ts +31 -0
- package/dist/lib/json-output.js +78 -0
- package/dist/lib/list-output.d.ts +75 -0
- package/dist/lib/list-output.js +266 -0
- package/dist/lib/machine-daemon-log.d.ts +36 -0
- package/dist/lib/machine-daemon-log.js +78 -0
- package/dist/lib/node-adapter.js +10 -1
- package/dist/lib/northstars.js +1 -1
- package/dist/lib/open-target.d.ts +12 -0
- package/dist/lib/open-target.js +108 -0
- package/dist/lib/rate-limit-retry.d.ts +45 -0
- package/dist/lib/rate-limit-retry.js +88 -0
- package/dist/lib/roles.d.ts +98 -0
- package/dist/lib/roles.js +45 -0
- package/dist/lib/store-listing.d.ts +45 -0
- package/dist/lib/store-listing.js +186 -0
- package/dist/lib/task-batch.d.ts +67 -0
- package/dist/lib/task-batch.js +227 -0
- package/dist/lib/terminal-qr.d.ts +55 -0
- package/dist/lib/terminal-qr.js +119 -0
- package/dist/lib/web-url.d.ts +11 -0
- package/dist/lib/web-url.js +24 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/commitmentExecutionContract.d.ts +45 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/commitmentExecutionContract.js +550 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.d.ts +68 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.js +47 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.d.ts +7 -44
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.js +8 -47
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/commitmentExecutionContract.d.ts +45 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/commitmentExecutionContract.js +545 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.d.ts +68 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.js +46 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.d.ts +7 -44
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.js +8 -47
- package/dist/node_modules/@skrr-ai/auth-core/package.json +11 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +7285 -6673
- package/dist/node_modules/@skrr-ai/data-provider/package.json +2 -2
- package/oclif.manifest.json +35937 -26820
- package/package.json +6 -2
- package/dist/commands/commitments/autonomy.d.ts +0 -30
- package/dist/commands/commitments/autonomy.js +0 -67
- package/dist/commands/commitments/mode.js +0 -58
- package/dist/commands/commitments/pack/promote.d.ts +0 -19
- package/dist/commands/commitments/pack/promote.js +0 -46
- package/dist/commands/commitments/pack/shadow.d.ts +0 -20
- package/dist/commands/commitments/pack/shadow.js +0 -42
|
@@ -51,15 +51,16 @@ class SpacesHeartbeatsList extends base_command_1.BaseCommand {
|
|
|
51
51
|
async run() {
|
|
52
52
|
this.requireAuth();
|
|
53
53
|
const { args, flags } = await this.parse(SpacesHeartbeatsList);
|
|
54
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
54
55
|
let response;
|
|
55
56
|
try {
|
|
56
|
-
response = await data_provider_1.dataService.listSpaceHeartbeats(
|
|
57
|
+
response = await data_provider_1.dataService.listSpaceHeartbeats(spaceRef);
|
|
57
58
|
}
|
|
58
59
|
catch (err) {
|
|
59
60
|
this.handleApiError(err);
|
|
60
61
|
}
|
|
61
62
|
if (flags.json) {
|
|
62
|
-
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL,
|
|
63
|
+
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, spaceRef, 'schedule', response, [
|
|
63
64
|
'agentId',
|
|
64
65
|
'id',
|
|
65
66
|
'_id',
|
|
@@ -87,7 +88,7 @@ class SpacesHeartbeatsList extends base_command_1.BaseCommand {
|
|
|
87
88
|
], (line) => this.log(line));
|
|
88
89
|
this.log('');
|
|
89
90
|
this.log('For live next-run status of a specific heartbeat:');
|
|
90
|
-
this.log(` skrr spaces heartbeats status ${
|
|
91
|
+
this.log(` skrr spaces heartbeats status ${spaceRef} <agent-id>`);
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
exports.default = SpacesHeartbeatsList;
|
|
@@ -21,9 +21,10 @@ class SpacesHeartbeatsStatus extends base_command_1.BaseCommand {
|
|
|
21
21
|
async run() {
|
|
22
22
|
this.requireAuth();
|
|
23
23
|
const { args, flags } = await this.parse(SpacesHeartbeatsStatus);
|
|
24
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
24
25
|
let result;
|
|
25
26
|
try {
|
|
26
|
-
result = await data_provider_1.dataService.getSpaceHeartbeatStatus(
|
|
27
|
+
result = await data_provider_1.dataService.getSpaceHeartbeatStatus(spaceRef, args.agentId);
|
|
27
28
|
}
|
|
28
29
|
catch (err) {
|
|
29
30
|
this.handleApiError(err);
|
|
@@ -31,7 +32,7 @@ class SpacesHeartbeatsStatus extends base_command_1.BaseCommand {
|
|
|
31
32
|
// --json takes priority over the human-readable "not configured" message
|
|
32
33
|
// so piped consumers always receive valid JSON (null when missing).
|
|
33
34
|
if (flags.json) {
|
|
34
|
-
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL,
|
|
35
|
+
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'schedule', {
|
|
35
36
|
result: result ?? null,
|
|
36
37
|
}), null, 2));
|
|
37
38
|
return;
|
|
@@ -38,6 +38,7 @@ class SpacesHeartbeatsUpdate extends base_command_1.BaseCommand {
|
|
|
38
38
|
async run() {
|
|
39
39
|
this.requireAuth();
|
|
40
40
|
const { args, flags } = await this.parse(SpacesHeartbeatsUpdate);
|
|
41
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
41
42
|
let body = {};
|
|
42
43
|
try {
|
|
43
44
|
body = await (0, prompt_1.readJsonBody)(flags['from-json']);
|
|
@@ -63,7 +64,7 @@ class SpacesHeartbeatsUpdate extends base_command_1.BaseCommand {
|
|
|
63
64
|
let result;
|
|
64
65
|
try {
|
|
65
66
|
result = await data_provider_1.dataService.updateSpaceHeartbeat({
|
|
66
|
-
spaceId:
|
|
67
|
+
spaceId: spaceRef,
|
|
67
68
|
agentId: args.agentId,
|
|
68
69
|
...payload,
|
|
69
70
|
});
|
|
@@ -72,10 +73,10 @@ class SpacesHeartbeatsUpdate extends base_command_1.BaseCommand {
|
|
|
72
73
|
this.handleApiError(err);
|
|
73
74
|
}
|
|
74
75
|
if (flags.json) {
|
|
75
|
-
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL,
|
|
76
|
+
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'schedule', result), null, 2));
|
|
76
77
|
return;
|
|
77
78
|
}
|
|
78
|
-
this.log(`Updated heartbeat for agent ${args.agentId} in space ${
|
|
79
|
+
this.log(`Updated heartbeat for agent ${args.agentId} in space ${spaceRef}`);
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
exports.default = SpacesHeartbeatsUpdate;
|
|
@@ -144,6 +144,7 @@ class SpacesInsights extends base_command_1.BaseCommand {
|
|
|
144
144
|
if ((!args.id && !flags.all) || (args.id && flags.all)) {
|
|
145
145
|
this.error('Pass exactly one Space ID or --all', { exit: 2 });
|
|
146
146
|
}
|
|
147
|
+
const spaceRef = args.id ? await this.resolveEntityRef('space', args.id) : undefined;
|
|
147
148
|
let request;
|
|
148
149
|
try {
|
|
149
150
|
const requestFlags = {
|
|
@@ -166,13 +167,13 @@ class SpacesInsights extends base_command_1.BaseCommand {
|
|
|
166
167
|
}
|
|
167
168
|
try {
|
|
168
169
|
if (flags.csv) {
|
|
169
|
-
process.stdout.write(
|
|
170
|
-
? await data_provider_1.dataService.exportSpaceTaskInsightsCsv(
|
|
170
|
+
process.stdout.write(spaceRef
|
|
171
|
+
? await data_provider_1.dataService.exportSpaceTaskInsightsCsv(spaceRef, request)
|
|
171
172
|
: await data_provider_1.dataService.exportWorkspaceTaskInsightsCsv(request));
|
|
172
173
|
return;
|
|
173
174
|
}
|
|
174
|
-
const result =
|
|
175
|
-
? await data_provider_1.dataService.getSpaceTaskInsights(
|
|
175
|
+
const result = spaceRef
|
|
176
|
+
? await data_provider_1.dataService.getSpaceTaskInsights(spaceRef, request)
|
|
176
177
|
: await data_provider_1.dataService.getWorkspaceTaskInsights(request);
|
|
177
178
|
if (flags.json) {
|
|
178
179
|
this.log(JSON.stringify(result, null, 2));
|
|
@@ -24,6 +24,7 @@ class SpacesLabelsAdd extends base_command_1.BaseCommand {
|
|
|
24
24
|
async run() {
|
|
25
25
|
this.requireAuth();
|
|
26
26
|
const { args, flags } = await this.parse(SpacesLabelsAdd);
|
|
27
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
27
28
|
// `spaces update` deliberately refuses labelIds — the server routes label
|
|
28
29
|
// changes through this atomic $addToSet endpoint so concurrent edits can't
|
|
29
30
|
// clobber each other. Re-attaching an already-attached label is a no-op.
|
|
@@ -45,20 +46,20 @@ class SpacesLabelsAdd extends base_command_1.BaseCommand {
|
|
|
45
46
|
}
|
|
46
47
|
let result;
|
|
47
48
|
try {
|
|
48
|
-
result = await data_provider_1.dataService.addLabelToSpace({ spaceId:
|
|
49
|
+
result = await data_provider_1.dataService.addLabelToSpace({ spaceId: spaceRef, labelId });
|
|
49
50
|
}
|
|
50
51
|
catch (err) {
|
|
51
52
|
this.handleApiError(err);
|
|
52
53
|
}
|
|
53
54
|
const updated = (0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, {
|
|
54
|
-
id:
|
|
55
|
+
id: spaceRef,
|
|
55
56
|
...result,
|
|
56
57
|
});
|
|
57
58
|
if (flags.json) {
|
|
58
59
|
this.log(JSON.stringify(updated, null, 2));
|
|
59
60
|
return;
|
|
60
61
|
}
|
|
61
|
-
this.log(`Attached label ${flags.label} to space ${
|
|
62
|
+
this.log(`Attached label ${flags.label} to space ${spaceRef}`);
|
|
62
63
|
this.log(`URL: ${updated.url ?? '-'}`);
|
|
63
64
|
}
|
|
64
65
|
}
|
|
@@ -19,9 +19,10 @@ class SpacesLabelsList extends base_command_1.BaseCommand {
|
|
|
19
19
|
async run() {
|
|
20
20
|
this.requireAuth();
|
|
21
21
|
const { args, flags } = await this.parse(SpacesLabelsList);
|
|
22
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
22
23
|
let space;
|
|
23
24
|
try {
|
|
24
|
-
space = await data_provider_1.dataService.getSpace(
|
|
25
|
+
space = await data_provider_1.dataService.getSpace(spaceRef);
|
|
25
26
|
}
|
|
26
27
|
catch (err) {
|
|
27
28
|
this.handleApiError(err);
|
|
@@ -24,6 +24,7 @@ class SpacesLabelsRemove extends base_command_1.BaseCommand {
|
|
|
24
24
|
async run() {
|
|
25
25
|
this.requireAuth();
|
|
26
26
|
const { args, flags } = await this.parse(SpacesLabelsRemove);
|
|
27
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
27
28
|
// Detach is intentionally permissive server-side: you can remove a label
|
|
28
29
|
// you can no longer read, so a revoked label never gets stuck on a space.
|
|
29
30
|
// A name is resolved against the DECLARED vocabulary; an unknown one is
|
|
@@ -44,20 +45,20 @@ class SpacesLabelsRemove extends base_command_1.BaseCommand {
|
|
|
44
45
|
}
|
|
45
46
|
let result;
|
|
46
47
|
try {
|
|
47
|
-
result = await data_provider_1.dataService.removeLabelFromSpace({ spaceId:
|
|
48
|
+
result = await data_provider_1.dataService.removeLabelFromSpace({ spaceId: spaceRef, labelId });
|
|
48
49
|
}
|
|
49
50
|
catch (err) {
|
|
50
51
|
this.handleApiError(err);
|
|
51
52
|
}
|
|
52
53
|
const updated = (0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, {
|
|
53
|
-
id:
|
|
54
|
+
id: spaceRef,
|
|
54
55
|
...result,
|
|
55
56
|
});
|
|
56
57
|
if (flags.json) {
|
|
57
58
|
this.log(JSON.stringify(updated, null, 2));
|
|
58
59
|
return;
|
|
59
60
|
}
|
|
60
|
-
this.log(`Detached label ${flags.label} from space ${
|
|
61
|
+
this.log(`Detached label ${flags.label} from space ${spaceRef}`);
|
|
61
62
|
this.log(`URL: ${updated.url ?? '-'}`);
|
|
62
63
|
}
|
|
63
64
|
}
|
|
@@ -34,6 +34,9 @@ export default class SpacesList extends BaseCommand {
|
|
|
34
34
|
static description: string;
|
|
35
35
|
static examples: string[];
|
|
36
36
|
static flags: {
|
|
37
|
+
fields: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
38
|
+
compact: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
39
|
+
ndjson: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
37
40
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
38
41
|
status: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
39
42
|
label: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -7,6 +7,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
7
7
|
const base_command_1 = require("../../base-command");
|
|
8
8
|
const web_url_1 = require("../../lib/web-url");
|
|
9
9
|
const format_1 = require("../../lib/format");
|
|
10
|
+
const list_output_1 = require("../../lib/list-output");
|
|
10
11
|
/**
|
|
11
12
|
* What an empty `--q` result is allowed to claim.
|
|
12
13
|
*
|
|
@@ -55,6 +56,8 @@ class SpacesList extends base_command_1.BaseCommand {
|
|
|
55
56
|
'<%= config.bin %> spaces list --label <label-a> --label <label-b>',
|
|
56
57
|
'<%= config.bin %> spaces list --q "always on"',
|
|
57
58
|
'<%= config.bin %> spaces list --include-archived --json',
|
|
59
|
+
'<%= config.bin %> spaces list --compact --json',
|
|
60
|
+
'<%= config.bin %> spaces list --fields id,identifier,title --ndjson',
|
|
58
61
|
];
|
|
59
62
|
static flags = {
|
|
60
63
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
@@ -87,6 +90,7 @@ class SpacesList extends base_command_1.BaseCommand {
|
|
|
87
90
|
}),
|
|
88
91
|
limit: core_1.Flags.integer({ description: 'Max results', default: 50 }),
|
|
89
92
|
cursor: core_1.Flags.string({ description: 'Pagination cursor from a previous page' }),
|
|
93
|
+
...list_output_1.listOutputFlags,
|
|
90
94
|
};
|
|
91
95
|
async run() {
|
|
92
96
|
this.requireAuth();
|
|
@@ -105,8 +109,13 @@ class SpacesList extends base_command_1.BaseCommand {
|
|
|
105
109
|
catch (err) {
|
|
106
110
|
this.handleApiError(err);
|
|
107
111
|
}
|
|
108
|
-
if (flags.json) {
|
|
109
|
-
this.
|
|
112
|
+
if (flags.json || flags.ndjson) {
|
|
113
|
+
this.printList((0, list_output_1.shapeListResponse)((0, web_url_1.withDataUrls)(this.cliConfig.baseURL, response, web_url_1.spaceUrlFrom), {
|
|
114
|
+
resource: 'space',
|
|
115
|
+
fields: flags.fields,
|
|
116
|
+
compact: flags.compact,
|
|
117
|
+
requestedLimit: flags.limit,
|
|
118
|
+
}), Boolean(flags.ndjson));
|
|
110
119
|
return;
|
|
111
120
|
}
|
|
112
121
|
const r = response;
|
|
@@ -27,6 +27,7 @@ class SpacesLiveCardsCreate extends base_command_1.BaseCommand {
|
|
|
27
27
|
async run() {
|
|
28
28
|
this.requireAuth();
|
|
29
29
|
const { args, flags } = await this.parse(SpacesLiveCardsCreate);
|
|
30
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
30
31
|
let body = {};
|
|
31
32
|
try {
|
|
32
33
|
body = await (0, prompt_1.readJsonBody)(flags['from-json']);
|
|
@@ -54,13 +55,13 @@ class SpacesLiveCardsCreate extends base_command_1.BaseCommand {
|
|
|
54
55
|
this.error('Pass --kind and --title, or provide them in JSON.', { exit: 1 });
|
|
55
56
|
let result;
|
|
56
57
|
try {
|
|
57
|
-
result = await data_provider_1.dataService.createSpace3DCard(
|
|
58
|
+
result = await data_provider_1.dataService.createSpace3DCard(spaceRef, payload);
|
|
58
59
|
}
|
|
59
60
|
catch (err) {
|
|
60
61
|
this.handleApiError(err);
|
|
61
62
|
}
|
|
62
63
|
if (flags.json)
|
|
63
|
-
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL,
|
|
64
|
+
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, spaceRef, 'live', result, ['id']), null, 2));
|
|
64
65
|
else
|
|
65
66
|
this.log(`Created Live card ${result?.id ?? '?'}.`);
|
|
66
67
|
}
|
|
@@ -14,15 +14,16 @@ class SpacesLiveCardsList extends base_command_1.BaseCommand {
|
|
|
14
14
|
async run() {
|
|
15
15
|
this.requireAuth();
|
|
16
16
|
const { args, flags } = await this.parse(SpacesLiveCardsList);
|
|
17
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
17
18
|
let response;
|
|
18
19
|
try {
|
|
19
|
-
response = await data_provider_1.dataService.listSpace3DCards(
|
|
20
|
+
response = await data_provider_1.dataService.listSpace3DCards(spaceRef);
|
|
20
21
|
}
|
|
21
22
|
catch (err) {
|
|
22
23
|
this.handleApiError(err);
|
|
23
24
|
}
|
|
24
25
|
if (flags.json)
|
|
25
|
-
return void this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL,
|
|
26
|
+
return void this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, spaceRef, 'live', response, ['id']), null, 2));
|
|
26
27
|
(0, format_1.renderTable)(response.data.map((c) => ({
|
|
27
28
|
id: c.id,
|
|
28
29
|
title: c.title,
|
|
@@ -18,6 +18,7 @@ class SpacesLiveCardsReorder extends base_command_1.BaseCommand {
|
|
|
18
18
|
async run() {
|
|
19
19
|
this.requireAuth();
|
|
20
20
|
const { args, flags } = await this.parse(SpacesLiveCardsReorder);
|
|
21
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
21
22
|
let raw = {};
|
|
22
23
|
if (flags['from-json']) {
|
|
23
24
|
try {
|
|
@@ -36,7 +37,7 @@ class SpacesLiveCardsReorder extends base_command_1.BaseCommand {
|
|
|
36
37
|
this.error('Provide repeated --card IDs or orderedIds JSON.', { exit: 1 });
|
|
37
38
|
let result;
|
|
38
39
|
try {
|
|
39
|
-
result = await data_provider_1.dataService.reorderSpace3DCards(
|
|
40
|
+
result = await data_provider_1.dataService.reorderSpace3DCards(spaceRef, {
|
|
40
41
|
orderedIds: orderedIds,
|
|
41
42
|
});
|
|
42
43
|
}
|
|
@@ -44,7 +45,11 @@ class SpacesLiveCardsReorder extends base_command_1.BaseCommand {
|
|
|
44
45
|
this.handleApiError(err);
|
|
45
46
|
}
|
|
46
47
|
if (flags.json)
|
|
47
|
-
this.log(JSON.stringify({
|
|
48
|
+
this.log(JSON.stringify({
|
|
49
|
+
result,
|
|
50
|
+
orderedIds,
|
|
51
|
+
url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'live'),
|
|
52
|
+
}, null, 2));
|
|
48
53
|
else
|
|
49
54
|
this.log(`Reordered ${orderedIds.length} Live cards.`);
|
|
50
55
|
}
|
|
@@ -18,6 +18,7 @@ class SpacesLiveScene extends base_command_1.BaseCommand {
|
|
|
18
18
|
async run() {
|
|
19
19
|
this.requireAuth();
|
|
20
20
|
const { args, flags } = await this.parse(SpacesLiveScene);
|
|
21
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
21
22
|
let result;
|
|
22
23
|
if (flags.character || flags['from-json']) {
|
|
23
24
|
let body = {};
|
|
@@ -32,7 +33,7 @@ class SpacesLiveScene extends base_command_1.BaseCommand {
|
|
|
32
33
|
if (!body.characterId || typeof body.characterId !== 'string')
|
|
33
34
|
this.error('Pass --character or characterId in JSON.', { exit: 1 });
|
|
34
35
|
try {
|
|
35
|
-
result = await data_provider_1.dataService.updateSpaceLiveScene(
|
|
36
|
+
result = await data_provider_1.dataService.updateSpaceLiveScene(spaceRef, body);
|
|
36
37
|
}
|
|
37
38
|
catch (err) {
|
|
38
39
|
this.handleApiError(err);
|
|
@@ -40,14 +41,14 @@ class SpacesLiveScene extends base_command_1.BaseCommand {
|
|
|
40
41
|
}
|
|
41
42
|
else {
|
|
42
43
|
try {
|
|
43
|
-
result = await data_provider_1.dataService.getSpaceLiveScene(
|
|
44
|
+
result = await data_provider_1.dataService.getSpaceLiveScene(spaceRef);
|
|
44
45
|
}
|
|
45
46
|
catch (err) {
|
|
46
47
|
this.handleApiError(err);
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
const output = result && typeof result === 'object'
|
|
50
|
-
? (0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL,
|
|
51
|
+
? (0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'live', result)
|
|
51
52
|
: result;
|
|
52
53
|
this.log(JSON.stringify(output, null, 2));
|
|
53
54
|
}
|
|
@@ -76,6 +76,7 @@ class SpacesMembersAdd extends base_command_1.BaseCommand {
|
|
|
76
76
|
async run() {
|
|
77
77
|
this.requireAuth();
|
|
78
78
|
const { args, flags } = await this.parse(SpacesMembersAdd);
|
|
79
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
79
80
|
const userIds = flags.user ?? [];
|
|
80
81
|
const agentIds = flags.agent ?? [];
|
|
81
82
|
if (userIds.length + agentIds.length === 0) {
|
|
@@ -106,8 +107,8 @@ class SpacesMembersAdd extends base_command_1.BaseCommand {
|
|
|
106
107
|
let current;
|
|
107
108
|
let result;
|
|
108
109
|
try {
|
|
109
|
-
current = await data_provider_1.dataService.getResourcePermissions(data_provider_1.ResourceType.SPACE,
|
|
110
|
-
result = await data_provider_1.dataService.updateResourcePermissions(data_provider_1.ResourceType.SPACE,
|
|
110
|
+
current = await data_provider_1.dataService.getResourcePermissions(data_provider_1.ResourceType.SPACE, spaceRef);
|
|
111
|
+
result = await data_provider_1.dataService.updateResourcePermissions(data_provider_1.ResourceType.SPACE, spaceRef, {
|
|
111
112
|
updated: updated,
|
|
112
113
|
removed: [],
|
|
113
114
|
public: Boolean(current.public),
|
|
@@ -117,14 +118,14 @@ class SpacesMembersAdd extends base_command_1.BaseCommand {
|
|
|
117
118
|
if ((brief && brief.trim().length > 0) || (expertise && expertise.length > 0)) {
|
|
118
119
|
const saves = [
|
|
119
120
|
...userIds.map((principalId) => data_provider_1.dataService.upsertSpaceBrief({
|
|
120
|
-
spaceId:
|
|
121
|
+
spaceId: spaceRef,
|
|
121
122
|
principalType: 'user',
|
|
122
123
|
principalId,
|
|
123
124
|
content: brief && brief.trim().length > 0 ? brief : undefined,
|
|
124
125
|
expertise,
|
|
125
126
|
})),
|
|
126
127
|
...agentIds.map((principalId) => data_provider_1.dataService.upsertSpaceBrief({
|
|
127
|
-
spaceId:
|
|
128
|
+
spaceId: spaceRef,
|
|
128
129
|
principalType: 'agent',
|
|
129
130
|
principalId,
|
|
130
131
|
content: brief && brief.trim().length > 0 ? brief : undefined,
|
|
@@ -138,14 +139,14 @@ class SpacesMembersAdd extends base_command_1.BaseCommand {
|
|
|
138
139
|
this.handleApiError(err);
|
|
139
140
|
}
|
|
140
141
|
if (flags.json) {
|
|
141
|
-
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL,
|
|
142
|
+
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'members', result), null, 2));
|
|
142
143
|
return;
|
|
143
144
|
}
|
|
144
145
|
const parts = [
|
|
145
146
|
userIds.length ? `${userIds.length} user(s)` : '',
|
|
146
147
|
agentIds.length ? `${agentIds.length} agent(s)` : '',
|
|
147
148
|
].filter(Boolean);
|
|
148
|
-
this.log(`Added ${parts.join(' and ')} to space ${
|
|
149
|
+
this.log(`Added ${parts.join(' and ')} to space ${spaceRef} as ${flags.role}.`);
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
152
|
exports.default = SpacesMembersAdd;
|
|
@@ -21,17 +21,18 @@ class SpacesMembersList extends base_command_1.BaseCommand {
|
|
|
21
21
|
async run() {
|
|
22
22
|
this.requireAuth();
|
|
23
23
|
const { args, flags } = await this.parse(SpacesMembersList);
|
|
24
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
24
25
|
let response;
|
|
25
26
|
let briefs = [];
|
|
26
27
|
try {
|
|
27
|
-
response = await data_provider_1.dataService.getResourcePermissions(data_provider_1.ResourceType.SPACE,
|
|
28
|
-
briefs = (await data_provider_1.dataService.listSpaceBriefs(
|
|
28
|
+
response = await data_provider_1.dataService.getResourcePermissions(data_provider_1.ResourceType.SPACE, spaceRef);
|
|
29
|
+
briefs = (await data_provider_1.dataService.listSpaceBriefs(spaceRef).catch(() => [])).filter((b) => Array.isArray(b.expertise) && b.expertise.length > 0);
|
|
29
30
|
}
|
|
30
31
|
catch (err) {
|
|
31
32
|
this.handleApiError(err);
|
|
32
33
|
}
|
|
33
34
|
if (flags.json) {
|
|
34
|
-
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL,
|
|
35
|
+
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'members', response), null, 2));
|
|
35
36
|
return;
|
|
36
37
|
}
|
|
37
38
|
const principals = (response.principals ?? []);
|
|
@@ -32,6 +32,7 @@ class SpacesMembersRemove extends base_command_1.BaseCommand {
|
|
|
32
32
|
async run() {
|
|
33
33
|
this.requireAuth();
|
|
34
34
|
const { args, flags } = await this.parse(SpacesMembersRemove);
|
|
35
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
35
36
|
const userIds = flags.user ?? [];
|
|
36
37
|
const agentIds = flags.agent ?? [];
|
|
37
38
|
if (userIds.length + agentIds.length === 0) {
|
|
@@ -44,8 +45,8 @@ class SpacesMembersRemove extends base_command_1.BaseCommand {
|
|
|
44
45
|
let current;
|
|
45
46
|
let result;
|
|
46
47
|
try {
|
|
47
|
-
current = await data_provider_1.dataService.getResourcePermissions(data_provider_1.ResourceType.SPACE,
|
|
48
|
-
result = await data_provider_1.dataService.updateResourcePermissions(data_provider_1.ResourceType.SPACE,
|
|
48
|
+
current = await data_provider_1.dataService.getResourcePermissions(data_provider_1.ResourceType.SPACE, spaceRef);
|
|
49
|
+
result = await data_provider_1.dataService.updateResourcePermissions(data_provider_1.ResourceType.SPACE, spaceRef, {
|
|
49
50
|
updated: [],
|
|
50
51
|
removed: removed,
|
|
51
52
|
public: Boolean(current.public),
|
|
@@ -53,8 +54,8 @@ class SpacesMembersRemove extends base_command_1.BaseCommand {
|
|
|
53
54
|
});
|
|
54
55
|
if (!flags['keep-brief']) {
|
|
55
56
|
const deletes = [
|
|
56
|
-
...userIds.map((principalId) => data_provider_1.dataService.deleteSpaceBrief(
|
|
57
|
-
...agentIds.map((principalId) => data_provider_1.dataService.deleteSpaceBrief(
|
|
57
|
+
...userIds.map((principalId) => data_provider_1.dataService.deleteSpaceBrief(spaceRef, 'user', principalId).catch(() => undefined)),
|
|
58
|
+
...agentIds.map((principalId) => data_provider_1.dataService.deleteSpaceBrief(spaceRef, 'agent', principalId).catch(() => undefined)),
|
|
58
59
|
];
|
|
59
60
|
await Promise.all(deletes);
|
|
60
61
|
}
|
|
@@ -63,14 +64,14 @@ class SpacesMembersRemove extends base_command_1.BaseCommand {
|
|
|
63
64
|
this.handleApiError(err);
|
|
64
65
|
}
|
|
65
66
|
if (flags.json) {
|
|
66
|
-
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL,
|
|
67
|
+
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'members', result), null, 2));
|
|
67
68
|
return;
|
|
68
69
|
}
|
|
69
70
|
const parts = [
|
|
70
71
|
userIds.length ? `${userIds.length} user(s)` : '',
|
|
71
72
|
agentIds.length ? `${agentIds.length} agent(s)` : '',
|
|
72
73
|
].filter(Boolean);
|
|
73
|
-
this.log(`Removed ${parts.join(' and ')} from space ${
|
|
74
|
+
this.log(`Removed ${parts.join(' and ')} from space ${spaceRef}.`);
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
exports.default = SpacesMembersRemove;
|
|
@@ -50,6 +50,7 @@ class SpacesMove extends base_command_1.BaseCommand {
|
|
|
50
50
|
async run() {
|
|
51
51
|
this.requireAuth();
|
|
52
52
|
const { args, flags } = await this.parse(SpacesMove);
|
|
53
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
53
54
|
let parentSpaceId;
|
|
54
55
|
try {
|
|
55
56
|
parentSpaceId = resolveReparentTarget(flags);
|
|
@@ -59,7 +60,7 @@ class SpacesMove extends base_command_1.BaseCommand {
|
|
|
59
60
|
}
|
|
60
61
|
let updated;
|
|
61
62
|
try {
|
|
62
|
-
updated = await data_provider_1.dataService.reparentSpace(
|
|
63
|
+
updated = await data_provider_1.dataService.reparentSpace(spaceRef, parentSpaceId);
|
|
63
64
|
}
|
|
64
65
|
catch (err) {
|
|
65
66
|
this.handleApiError(err);
|
|
@@ -70,7 +71,7 @@ class SpacesMove extends base_command_1.BaseCommand {
|
|
|
70
71
|
}
|
|
71
72
|
const s = updated;
|
|
72
73
|
const dest = parentSpaceId ? `under ${parentSpaceId}` : 'to the root';
|
|
73
|
-
this.log(`Moved space ${s.id ?? s._id ??
|
|
74
|
+
this.log(`Moved space ${s.id ?? s._id ?? spaceRef} - ${s.title ?? '(no title)'} ${dest} (depth ${s.depth ?? 0})`);
|
|
74
75
|
// The move committed; something downstream of it did not. The server used
|
|
75
76
|
// to spend a 500 on this, which said the move had not happened. Now it says
|
|
76
77
|
// what is stale, and the only way that reaches a human is if we print it.
|
|
@@ -13,21 +13,22 @@ class SpacesPin extends base_command_1.BaseCommand {
|
|
|
13
13
|
async run() {
|
|
14
14
|
this.requireAuth();
|
|
15
15
|
const { args, flags } = await this.parse(SpacesPin);
|
|
16
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
16
17
|
let result;
|
|
17
18
|
try {
|
|
18
|
-
result = await data_provider_1.dataService.toggleSpacePin(
|
|
19
|
+
result = await data_provider_1.dataService.toggleSpacePin(spaceRef);
|
|
19
20
|
}
|
|
20
21
|
catch (err) {
|
|
21
22
|
this.handleApiError(err);
|
|
22
23
|
}
|
|
23
24
|
if (flags.json)
|
|
24
25
|
this.log(JSON.stringify({
|
|
25
|
-
spaceId:
|
|
26
|
+
spaceId: spaceRef,
|
|
26
27
|
...result,
|
|
27
|
-
url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL,
|
|
28
|
+
url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'settings'),
|
|
28
29
|
}, null, 2));
|
|
29
30
|
else
|
|
30
|
-
this.log(`${result?.isPinned ? 'Pinned' : 'Unpinned'} space ${
|
|
31
|
+
this.log(`${result?.isPinned ? 'Pinned' : 'Unpinned'} space ${spaceRef}.`);
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
exports.default = SpacesPin;
|
|
@@ -13,6 +13,7 @@ class SpacesPreferencesShow extends base_command_1.BaseCommand {
|
|
|
13
13
|
async run() {
|
|
14
14
|
this.requireAuth();
|
|
15
15
|
const { args, flags } = await this.parse(SpacesPreferencesShow);
|
|
16
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
16
17
|
let response;
|
|
17
18
|
try {
|
|
18
19
|
response = await data_provider_1.dataService.getAllSpacePreferences();
|
|
@@ -20,9 +21,9 @@ class SpacesPreferencesShow extends base_command_1.BaseCommand {
|
|
|
20
21
|
catch (err) {
|
|
21
22
|
this.handleApiError(err);
|
|
22
23
|
}
|
|
23
|
-
const preferences = response.spacePreferences?.[
|
|
24
|
-
const output = (0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL,
|
|
25
|
-
spaceId:
|
|
24
|
+
const preferences = response.spacePreferences?.[spaceRef] ?? {};
|
|
25
|
+
const output = (0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'settings', {
|
|
26
|
+
spaceId: spaceRef,
|
|
26
27
|
preferences,
|
|
27
28
|
});
|
|
28
29
|
if (flags.json)
|
|
@@ -19,6 +19,7 @@ class SpacesPreferencesTabs extends base_command_1.BaseCommand {
|
|
|
19
19
|
async run() {
|
|
20
20
|
this.requireAuth();
|
|
21
21
|
const { args, flags } = await this.parse(SpacesPreferencesTabs);
|
|
22
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
22
23
|
let raw = {};
|
|
23
24
|
if (flags['from-json']) {
|
|
24
25
|
try {
|
|
@@ -34,7 +35,7 @@ class SpacesPreferencesTabs extends base_command_1.BaseCommand {
|
|
|
34
35
|
this.error('Provide --visible/--hidden values or JSON arrays.', { exit: 1 });
|
|
35
36
|
let result;
|
|
36
37
|
try {
|
|
37
|
-
result = await data_provider_1.dataService.updateSpaceTabVisibility(
|
|
38
|
+
result = await data_provider_1.dataService.updateSpaceTabVisibility(spaceRef, {
|
|
38
39
|
visible: visible,
|
|
39
40
|
hidden: hidden,
|
|
40
41
|
});
|
|
@@ -43,9 +44,9 @@ class SpacesPreferencesTabs extends base_command_1.BaseCommand {
|
|
|
43
44
|
this.handleApiError(err);
|
|
44
45
|
}
|
|
45
46
|
if (flags.json)
|
|
46
|
-
this.log(JSON.stringify({ result, url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL,
|
|
47
|
+
this.log(JSON.stringify({ result, url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'settings') }, null, 2));
|
|
47
48
|
else
|
|
48
|
-
this.log(`Updated tab visibility for space ${
|
|
49
|
+
this.log(`Updated tab visibility for space ${spaceRef}.`);
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
exports.default = SpacesPreferencesTabs;
|
|
@@ -20,15 +20,16 @@ class SpacesRevisions extends base_command_1.BaseCommand {
|
|
|
20
20
|
async run() {
|
|
21
21
|
this.requireAuth();
|
|
22
22
|
const { args, flags } = await this.parse(SpacesRevisions);
|
|
23
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
23
24
|
let result;
|
|
24
25
|
try {
|
|
25
|
-
result = await data_provider_1.dataService.listSpaceRevisions(
|
|
26
|
+
result = await data_provider_1.dataService.listSpaceRevisions(spaceRef);
|
|
26
27
|
}
|
|
27
28
|
catch (err) {
|
|
28
29
|
this.handleApiError(err);
|
|
29
30
|
}
|
|
30
31
|
if (flags.json) {
|
|
31
|
-
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL,
|
|
32
|
+
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'settings', result), null, 2));
|
|
32
33
|
return;
|
|
33
34
|
}
|
|
34
35
|
const items = result?.data ?? [];
|
|
@@ -18,12 +18,13 @@ class SpacesRoomEnsure extends space_room_1.SpaceRoomCommand {
|
|
|
18
18
|
async run() {
|
|
19
19
|
this.requireAuth();
|
|
20
20
|
const { args, flags } = await this.parse(SpacesRoomEnsure);
|
|
21
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
21
22
|
// Idempotent — the same POST the web Room tab issues on mount. Safe to run
|
|
22
23
|
// repeatedly: it creates the room only when absent, and otherwise just
|
|
23
24
|
// reconciles the chat's participants/agents against the space membership.
|
|
24
|
-
const payload = await this.fetchRoom(
|
|
25
|
+
const payload = await this.fetchRoom(spaceRef, { ensure: true });
|
|
25
26
|
if (flags.json) {
|
|
26
|
-
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL,
|
|
27
|
+
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'room', payload), null, 2));
|
|
27
28
|
return;
|
|
28
29
|
}
|
|
29
30
|
const room = payload.spaceRoom;
|
|
@@ -32,8 +33,8 @@ class SpacesRoomEnsure extends space_room_1.SpaceRoomCommand {
|
|
|
32
33
|
const changes = (0, space_room_1.describeReconciliation)(room);
|
|
33
34
|
this.log(changes ? `Reconciled: ${changes}` : 'Membership already up to date.');
|
|
34
35
|
this.log('');
|
|
35
|
-
this.log(`Read: ${this.config.bin} spaces room messages ${
|
|
36
|
-
this.log(`Send: ${this.config.bin} spaces room send ${
|
|
36
|
+
this.log(`Read: ${this.config.bin} spaces room messages ${spaceRef}`);
|
|
37
|
+
this.log(`Send: ${this.config.bin} spaces room send ${spaceRef} -m "..."`);
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
exports.default = SpacesRoomEnsure;
|
|
@@ -29,7 +29,8 @@ class SpacesRoomMessages extends space_room_1.SpaceRoomCommand {
|
|
|
29
29
|
async run() {
|
|
30
30
|
this.requireAuth();
|
|
31
31
|
const { args, flags } = await this.parse(SpacesRoomMessages);
|
|
32
|
-
const
|
|
32
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
33
|
+
const groupChatId = await this.resolveRoomChatId(spaceRef);
|
|
33
34
|
let response;
|
|
34
35
|
try {
|
|
35
36
|
response = await data_provider_1.dataService.getGroupChatMessages(groupChatId, {
|
|
@@ -42,7 +43,7 @@ class SpacesRoomMessages extends space_room_1.SpaceRoomCommand {
|
|
|
42
43
|
this.handleApiError(err);
|
|
43
44
|
}
|
|
44
45
|
if (flags.json) {
|
|
45
|
-
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL,
|
|
46
|
+
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, spaceRef, 'room', response, [
|
|
46
47
|
'id',
|
|
47
48
|
'messageId',
|
|
48
49
|
'_id',
|