@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
|
@@ -81,6 +81,7 @@ class SpacesBriefsSet extends base_command_1.BaseCommand {
|
|
|
81
81
|
async run() {
|
|
82
82
|
this.requireAuth();
|
|
83
83
|
const { args, flags } = await this.parse(SpacesBriefsSet);
|
|
84
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
84
85
|
let content;
|
|
85
86
|
let expertise;
|
|
86
87
|
let dismissed;
|
|
@@ -131,7 +132,7 @@ class SpacesBriefsSet extends base_command_1.BaseCommand {
|
|
|
131
132
|
if (needsMerge) {
|
|
132
133
|
let existing = {};
|
|
133
134
|
try {
|
|
134
|
-
existing = (await data_provider_1.dataService.getSpaceBrief(
|
|
135
|
+
existing = (await data_provider_1.dataService.getSpaceBrief(spaceRef, flags.principal, flags.id));
|
|
135
136
|
}
|
|
136
137
|
catch {
|
|
137
138
|
existing = {};
|
|
@@ -153,7 +154,7 @@ class SpacesBriefsSet extends base_command_1.BaseCommand {
|
|
|
153
154
|
let result;
|
|
154
155
|
try {
|
|
155
156
|
result = await data_provider_1.dataService.upsertSpaceBrief({
|
|
156
|
-
spaceId:
|
|
157
|
+
spaceId: spaceRef,
|
|
157
158
|
principalType: flags.principal,
|
|
158
159
|
principalId: flags.id,
|
|
159
160
|
content,
|
|
@@ -165,7 +166,7 @@ class SpacesBriefsSet extends base_command_1.BaseCommand {
|
|
|
165
166
|
this.handleApiError(err);
|
|
166
167
|
}
|
|
167
168
|
if (flags.json) {
|
|
168
|
-
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL,
|
|
169
|
+
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'members', result), null, 2));
|
|
169
170
|
return;
|
|
170
171
|
}
|
|
171
172
|
const changed = [
|
|
@@ -175,7 +176,7 @@ class SpacesBriefsSet extends base_command_1.BaseCommand {
|
|
|
175
176
|
]
|
|
176
177
|
.filter(Boolean)
|
|
177
178
|
.join(', ');
|
|
178
|
-
this.log(`Saved brief for ${flags.principal} ${flags.id} in space ${
|
|
179
|
+
this.log(`Saved brief for ${flags.principal} ${flags.id} in space ${spaceRef}: ${changed}`);
|
|
179
180
|
}
|
|
180
181
|
}
|
|
181
182
|
exports.default = SpacesBriefsSet;
|
|
@@ -22,15 +22,16 @@ class SpacesCapacity extends base_command_1.BaseCommand {
|
|
|
22
22
|
async run() {
|
|
23
23
|
this.requireAuth();
|
|
24
24
|
const { args, flags } = await this.parse(SpacesCapacity);
|
|
25
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
25
26
|
let capacity;
|
|
26
27
|
try {
|
|
27
|
-
capacity = await (0, task_execution_1.getSpaceCapacity)(
|
|
28
|
+
capacity = await (0, task_execution_1.getSpaceCapacity)(spaceRef, flags.limit);
|
|
28
29
|
}
|
|
29
30
|
catch (err) {
|
|
30
31
|
this.handleApiError(err);
|
|
31
32
|
}
|
|
32
33
|
if (flags.json) {
|
|
33
|
-
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL,
|
|
34
|
+
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'execution', capacity), null, 2));
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
36
37
|
const space = capacity.space;
|
|
@@ -38,8 +39,8 @@ class SpacesCapacity extends base_command_1.BaseCommand {
|
|
|
38
39
|
// Interpolating them directly is what produced `0/null active` (OSK-7087);
|
|
39
40
|
// the shared formatters in @skrr-ai/data-provider are the one place that
|
|
40
41
|
// decides how an absent ceiling reads, for the web and the CLI alike.
|
|
41
|
-
this.log(`Space: ${space.title ??
|
|
42
|
-
this.log(`ID: ${space.id ??
|
|
42
|
+
this.log(`Space: ${space.title ?? spaceRef}`);
|
|
43
|
+
this.log(`ID: ${space.id ?? spaceRef}`);
|
|
43
44
|
this.log(`Auto exec: ${space.autoExecuteEnabled ? 'enabled' : 'disabled'}`);
|
|
44
45
|
this.log(`Capacity: ${(0, data_provider_1.formatRunningCapacity)(capacity.activeCount, capacity.maxActiveTasks)} active` +
|
|
45
46
|
(capacity.maxActiveTasks === null ? ' (no concurrency cap)' : ''));
|
|
@@ -24,9 +24,10 @@ class SpacesConversations extends base_command_1.BaseCommand {
|
|
|
24
24
|
async run() {
|
|
25
25
|
this.requireAuth();
|
|
26
26
|
const { args, flags } = await this.parse(SpacesConversations);
|
|
27
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
27
28
|
let response;
|
|
28
29
|
try {
|
|
29
|
-
response = await data_provider_1.dataService.listSpaceConversations(
|
|
30
|
+
response = await data_provider_1.dataService.listSpaceConversations(spaceRef, {
|
|
30
31
|
limit: flags.limit,
|
|
31
32
|
cursor: flags.cursor,
|
|
32
33
|
});
|
|
@@ -35,7 +36,7 @@ class SpacesConversations extends base_command_1.BaseCommand {
|
|
|
35
36
|
this.handleApiError(err);
|
|
36
37
|
}
|
|
37
38
|
if (flags.json) {
|
|
38
|
-
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL,
|
|
39
|
+
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, spaceRef, 'execution', response, [
|
|
39
40
|
'conversationId',
|
|
40
41
|
'id',
|
|
41
42
|
'_id',
|
|
@@ -20,9 +20,10 @@ class SpacesCyclesCreate extends base_command_1.BaseCommand {
|
|
|
20
20
|
async run() {
|
|
21
21
|
this.requireAuth();
|
|
22
22
|
const { args, flags } = await this.parse(SpacesCyclesCreate);
|
|
23
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
23
24
|
let cycle;
|
|
24
25
|
try {
|
|
25
|
-
cycle = await data_provider_1.dataService.createSpaceCycle(
|
|
26
|
+
cycle = await data_provider_1.dataService.createSpaceCycle(spaceRef, {
|
|
26
27
|
name: flags.name,
|
|
27
28
|
startsAt: flags.starts,
|
|
28
29
|
endsAt: flags.ends,
|
|
@@ -35,7 +36,7 @@ class SpacesCyclesCreate extends base_command_1.BaseCommand {
|
|
|
35
36
|
return;
|
|
36
37
|
}
|
|
37
38
|
if (flags.json) {
|
|
38
|
-
this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { ...cycle, id:
|
|
39
|
+
this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { ...cycle, id: spaceRef }), null, 2));
|
|
39
40
|
return;
|
|
40
41
|
}
|
|
41
42
|
this.log(`Created ${cycle.name} (#${cycle.number}) — ${cycle.id}`);
|
|
@@ -22,9 +22,10 @@ class SpacesCyclesGraph extends base_command_1.BaseCommand {
|
|
|
22
22
|
async run() {
|
|
23
23
|
this.requireAuth();
|
|
24
24
|
const { args, flags } = await this.parse(SpacesCyclesGraph);
|
|
25
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
25
26
|
let result;
|
|
26
27
|
try {
|
|
27
|
-
result = await data_provider_1.dataService.getSpaceCycleGraph(
|
|
28
|
+
result = await data_provider_1.dataService.getSpaceCycleGraph(spaceRef, args.cycleId, {
|
|
28
29
|
unit: flags.unit,
|
|
29
30
|
});
|
|
30
31
|
}
|
|
@@ -18,9 +18,10 @@ class SpacesCyclesList extends base_command_1.BaseCommand {
|
|
|
18
18
|
async run() {
|
|
19
19
|
this.requireAuth();
|
|
20
20
|
const { args, flags } = await this.parse(SpacesCyclesList);
|
|
21
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
21
22
|
let result;
|
|
22
23
|
try {
|
|
23
|
-
result = await data_provider_1.dataService.listSpaceCycles(
|
|
24
|
+
result = await data_provider_1.dataService.listSpaceCycles(spaceRef, {
|
|
24
25
|
status: flags.status,
|
|
25
26
|
limit: flags.limit,
|
|
26
27
|
});
|
|
@@ -30,7 +31,7 @@ class SpacesCyclesList extends base_command_1.BaseCommand {
|
|
|
30
31
|
return;
|
|
31
32
|
}
|
|
32
33
|
if (flags.json) {
|
|
33
|
-
this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { id:
|
|
34
|
+
this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { id: spaceRef, ...result }), null, 2));
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
36
37
|
if (result.data.length === 0) {
|
|
@@ -21,6 +21,7 @@ class SpacesCyclesSettings extends base_command_1.BaseCommand {
|
|
|
21
21
|
async run() {
|
|
22
22
|
this.requireAuth();
|
|
23
23
|
const { args, flags } = await this.parse(SpacesCyclesSettings);
|
|
24
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
24
25
|
const hasPatch = [
|
|
25
26
|
flags['length-weeks'],
|
|
26
27
|
flags['start-day'],
|
|
@@ -29,7 +30,7 @@ class SpacesCyclesSettings extends base_command_1.BaseCommand {
|
|
|
29
30
|
].some((value) => value !== undefined);
|
|
30
31
|
let result;
|
|
31
32
|
try {
|
|
32
|
-
const current = await data_provider_1.dataService.getSpaceCycleSettings(
|
|
33
|
+
const current = await data_provider_1.dataService.getSpaceCycleSettings(spaceRef);
|
|
33
34
|
if (!hasPatch) {
|
|
34
35
|
result = current;
|
|
35
36
|
}
|
|
@@ -41,7 +42,7 @@ class SpacesCyclesSettings extends base_command_1.BaseCommand {
|
|
|
41
42
|
autoCreateUpcoming: 2,
|
|
42
43
|
timezone: 'UTC',
|
|
43
44
|
};
|
|
44
|
-
result = await data_provider_1.dataService.updateSpaceCycleSettings(
|
|
45
|
+
result = await data_provider_1.dataService.updateSpaceCycleSettings(spaceRef, {
|
|
45
46
|
...base,
|
|
46
47
|
...(flags['length-weeks'] !== undefined
|
|
47
48
|
? { cycleLengthWeeks: flags['length-weeks'] }
|
|
@@ -59,7 +60,7 @@ class SpacesCyclesSettings extends base_command_1.BaseCommand {
|
|
|
59
60
|
return;
|
|
60
61
|
}
|
|
61
62
|
if (flags.json) {
|
|
62
|
-
this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { id:
|
|
63
|
+
this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { id: spaceRef, ...result }), null, 2));
|
|
63
64
|
return;
|
|
64
65
|
}
|
|
65
66
|
if (!result.settings) {
|
|
@@ -14,16 +14,17 @@ class SpacesCyclesShow extends base_command_1.BaseCommand {
|
|
|
14
14
|
async run() {
|
|
15
15
|
this.requireAuth();
|
|
16
16
|
const { args, flags } = await this.parse(SpacesCyclesShow);
|
|
17
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
17
18
|
let cycle;
|
|
18
19
|
try {
|
|
19
|
-
cycle = await data_provider_1.dataService.getSpaceCycle(
|
|
20
|
+
cycle = await data_provider_1.dataService.getSpaceCycle(spaceRef, args.cycleId);
|
|
20
21
|
}
|
|
21
22
|
catch (error) {
|
|
22
23
|
this.handleApiError(error);
|
|
23
24
|
return;
|
|
24
25
|
}
|
|
25
26
|
if (flags.json) {
|
|
26
|
-
this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { ...cycle, id:
|
|
27
|
+
this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { ...cycle, id: spaceRef }), null, 2));
|
|
27
28
|
return;
|
|
28
29
|
}
|
|
29
30
|
this.log(`${cycle.name} (#${cycle.number})`);
|
|
@@ -21,6 +21,7 @@ class SpacesCyclesUpdate extends base_command_1.BaseCommand {
|
|
|
21
21
|
async run() {
|
|
22
22
|
this.requireAuth();
|
|
23
23
|
const { args, flags } = await this.parse(SpacesCyclesUpdate);
|
|
24
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
24
25
|
const data = {
|
|
25
26
|
...(flags.name !== undefined ? { name: flags.name } : {}),
|
|
26
27
|
...(flags.starts !== undefined ? { startsAt: flags.starts } : {}),
|
|
@@ -34,14 +35,14 @@ class SpacesCyclesUpdate extends base_command_1.BaseCommand {
|
|
|
34
35
|
this.error('Pass at least one update flag.', { exit: 1 });
|
|
35
36
|
let cycle;
|
|
36
37
|
try {
|
|
37
|
-
cycle = await data_provider_1.dataService.updateSpaceCycle(
|
|
38
|
+
cycle = await data_provider_1.dataService.updateSpaceCycle(spaceRef, args.cycleId, data);
|
|
38
39
|
}
|
|
39
40
|
catch (error) {
|
|
40
41
|
this.handleApiError(error);
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
43
44
|
if (flags.json) {
|
|
44
|
-
this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { ...cycle, id:
|
|
45
|
+
this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { ...cycle, id: spaceRef }), null, 2));
|
|
45
46
|
return;
|
|
46
47
|
}
|
|
47
48
|
this.log(`Updated ${cycle.name} (#${cycle.number})`);
|
|
@@ -19,9 +19,10 @@ class SpacesDelete extends base_command_1.BaseCommand {
|
|
|
19
19
|
async run() {
|
|
20
20
|
this.requireAuth();
|
|
21
21
|
const { args, flags } = await this.parse(SpacesDelete);
|
|
22
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
22
23
|
let confirmed;
|
|
23
24
|
try {
|
|
24
|
-
confirmed = await (0, prompt_1.confirmDestructive)(`Delete space ${
|
|
25
|
+
confirmed = await (0, prompt_1.confirmDestructive)(`Delete space ${spaceRef}? This cannot be undone.`, flags.yes);
|
|
25
26
|
}
|
|
26
27
|
catch (err) {
|
|
27
28
|
if (err.exit === 7) {
|
|
@@ -34,12 +35,12 @@ class SpacesDelete extends base_command_1.BaseCommand {
|
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
36
37
|
try {
|
|
37
|
-
await data_provider_1.dataService.deleteSpace(
|
|
38
|
+
await data_provider_1.dataService.deleteSpace(spaceRef);
|
|
38
39
|
}
|
|
39
40
|
catch (err) {
|
|
40
41
|
this.handleApiError(err);
|
|
41
42
|
}
|
|
42
|
-
this.log(`Deleted space ${
|
|
43
|
+
this.log(`Deleted space ${spaceRef}`);
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
exports.default = SpacesDelete;
|
|
@@ -20,17 +20,18 @@ class SpacesExpertiseSuggestions extends base_command_1.BaseCommand {
|
|
|
20
20
|
async run() {
|
|
21
21
|
this.requireAuth();
|
|
22
22
|
const { args, flags } = await this.parse(SpacesExpertiseSuggestions);
|
|
23
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
23
24
|
let response;
|
|
24
25
|
let members;
|
|
25
26
|
try {
|
|
26
|
-
response = await data_provider_1.dataService.getSpaceExpertiseSuggestions(
|
|
27
|
-
members = await data_provider_1.dataService.getSpaceMembers(
|
|
27
|
+
response = await data_provider_1.dataService.getSpaceExpertiseSuggestions(spaceRef);
|
|
28
|
+
members = await data_provider_1.dataService.getSpaceMembers(spaceRef).catch(() => undefined);
|
|
28
29
|
}
|
|
29
30
|
catch (err) {
|
|
30
31
|
this.handleApiError(err);
|
|
31
32
|
}
|
|
32
33
|
if (flags.json) {
|
|
33
|
-
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL,
|
|
34
|
+
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'members', response), null, 2));
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
36
37
|
const suggestions = response.suggestions ?? [];
|
|
@@ -18,6 +18,7 @@ class SpacesFilesDelete extends base_command_1.BaseCommand {
|
|
|
18
18
|
async run() {
|
|
19
19
|
this.requireAuth();
|
|
20
20
|
const { args, flags } = await this.parse(SpacesFilesDelete);
|
|
21
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
21
22
|
let confirmed;
|
|
22
23
|
try {
|
|
23
24
|
confirmed = await (0, prompt_1.confirmDestructive)(`Delete file ${args.file}?`, flags.yes);
|
|
@@ -29,7 +30,7 @@ class SpacesFilesDelete extends base_command_1.BaseCommand {
|
|
|
29
30
|
if (!confirmed)
|
|
30
31
|
return void this.log('Cancelled.');
|
|
31
32
|
try {
|
|
32
|
-
await data_provider_1.dataService.deleteSpaceFile({ spaceId:
|
|
33
|
+
await data_provider_1.dataService.deleteSpaceFile({ spaceId: spaceRef, file_id: args.file });
|
|
33
34
|
}
|
|
34
35
|
catch (err) {
|
|
35
36
|
this.handleApiError(err);
|
|
@@ -38,7 +39,7 @@ class SpacesFilesDelete extends base_command_1.BaseCommand {
|
|
|
38
39
|
this.log(JSON.stringify({
|
|
39
40
|
success: true,
|
|
40
41
|
fileId: args.file,
|
|
41
|
-
url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL,
|
|
42
|
+
url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'files'),
|
|
42
43
|
}, null, 2));
|
|
43
44
|
else
|
|
44
45
|
this.log(`Deleted file ${args.file}.`);
|
|
@@ -19,6 +19,7 @@ class SpacesFilesFoldersCreate extends base_command_1.BaseCommand {
|
|
|
19
19
|
async run() {
|
|
20
20
|
this.requireAuth();
|
|
21
21
|
const { args, flags } = await this.parse(SpacesFilesFoldersCreate);
|
|
22
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
22
23
|
let body = {};
|
|
23
24
|
try {
|
|
24
25
|
body = await (0, prompt_1.readJsonBody)(flags['from-json']);
|
|
@@ -32,7 +33,7 @@ class SpacesFilesFoldersCreate extends base_command_1.BaseCommand {
|
|
|
32
33
|
let result;
|
|
33
34
|
try {
|
|
34
35
|
result = await data_provider_1.dataService.createSpaceFolder({
|
|
35
|
-
spaceId:
|
|
36
|
+
spaceId: spaceRef,
|
|
36
37
|
data: payload,
|
|
37
38
|
});
|
|
38
39
|
}
|
|
@@ -40,7 +41,7 @@ class SpacesFilesFoldersCreate extends base_command_1.BaseCommand {
|
|
|
40
41
|
this.handleApiError(err);
|
|
41
42
|
}
|
|
42
43
|
if (flags.json)
|
|
43
|
-
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL,
|
|
44
|
+
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, spaceRef, 'files', result, ['folder_id']), null, 2));
|
|
44
45
|
else
|
|
45
46
|
this.log(`Created folder ${result?.folder_id ?? '?'}.`);
|
|
46
47
|
}
|
|
@@ -21,6 +21,7 @@ class SpacesFilesFoldersDelete extends base_command_1.BaseCommand {
|
|
|
21
21
|
async run() {
|
|
22
22
|
this.requireAuth();
|
|
23
23
|
const { args, flags } = await this.parse(SpacesFilesFoldersDelete);
|
|
24
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
24
25
|
let confirmed;
|
|
25
26
|
try {
|
|
26
27
|
confirmed = await (0, prompt_1.confirmDestructive)(`Delete folder ${args.folder}?`, flags.yes);
|
|
@@ -33,7 +34,7 @@ class SpacesFilesFoldersDelete extends base_command_1.BaseCommand {
|
|
|
33
34
|
return void this.log('Cancelled.');
|
|
34
35
|
try {
|
|
35
36
|
await data_provider_1.dataService.deleteSpaceFolder({
|
|
36
|
-
spaceId:
|
|
37
|
+
spaceId: spaceRef,
|
|
37
38
|
folder_id: args.folder,
|
|
38
39
|
options: { deleteContents: flags['delete-contents'] },
|
|
39
40
|
});
|
|
@@ -45,7 +46,7 @@ class SpacesFilesFoldersDelete extends base_command_1.BaseCommand {
|
|
|
45
46
|
this.log(JSON.stringify({
|
|
46
47
|
success: true,
|
|
47
48
|
folderId: args.folder,
|
|
48
|
-
url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL,
|
|
49
|
+
url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'files'),
|
|
49
50
|
}, null, 2));
|
|
50
51
|
else
|
|
51
52
|
this.log(`Deleted folder ${args.folder}.`);
|
|
@@ -14,15 +14,16 @@ class SpacesFilesFoldersList extends base_command_1.BaseCommand {
|
|
|
14
14
|
async run() {
|
|
15
15
|
this.requireAuth();
|
|
16
16
|
const { args, flags } = await this.parse(SpacesFilesFoldersList);
|
|
17
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
17
18
|
let response;
|
|
18
19
|
try {
|
|
19
|
-
response = await data_provider_1.dataService.listSpaceFolders(
|
|
20
|
+
response = await data_provider_1.dataService.listSpaceFolders(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, 'files', response, ['folder_id']), null, 2));
|
|
26
27
|
if (!response.data.length)
|
|
27
28
|
return void this.log('No folders.');
|
|
28
29
|
(0, format_1.renderTable)(response.data.map((f) => ({
|
|
@@ -21,6 +21,7 @@ class SpacesFilesFoldersUpdate extends base_command_1.BaseCommand {
|
|
|
21
21
|
async run() {
|
|
22
22
|
this.requireAuth();
|
|
23
23
|
const { args, flags } = await this.parse(SpacesFilesFoldersUpdate);
|
|
24
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
24
25
|
let body = {};
|
|
25
26
|
try {
|
|
26
27
|
body = await (0, prompt_1.readJsonBody)(flags['from-json']);
|
|
@@ -38,7 +39,7 @@ class SpacesFilesFoldersUpdate extends base_command_1.BaseCommand {
|
|
|
38
39
|
let result;
|
|
39
40
|
try {
|
|
40
41
|
result = await data_provider_1.dataService.updateSpaceFolder({
|
|
41
|
-
spaceId:
|
|
42
|
+
spaceId: spaceRef,
|
|
42
43
|
folder_id: args.folder,
|
|
43
44
|
data: payload,
|
|
44
45
|
});
|
|
@@ -47,7 +48,7 @@ class SpacesFilesFoldersUpdate extends base_command_1.BaseCommand {
|
|
|
47
48
|
this.handleApiError(err);
|
|
48
49
|
}
|
|
49
50
|
if (flags.json)
|
|
50
|
-
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL,
|
|
51
|
+
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, spaceRef, 'files', result, ['folder_id']), null, 2));
|
|
51
52
|
else
|
|
52
53
|
this.log(`Updated folder ${args.folder}.`);
|
|
53
54
|
}
|
|
@@ -20,15 +20,16 @@ class SpacesFilesList extends base_command_1.BaseCommand {
|
|
|
20
20
|
async run() {
|
|
21
21
|
this.requireAuth();
|
|
22
22
|
const { args, flags } = await this.parse(SpacesFilesList);
|
|
23
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
23
24
|
let response;
|
|
24
25
|
try {
|
|
25
|
-
response = await data_provider_1.dataService.listSpaceFiles(
|
|
26
|
+
response = await data_provider_1.dataService.listSpaceFiles(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.withSpaceResourceUrls)(this.cliConfig.baseURL,
|
|
32
|
+
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, spaceRef, 'files', response, [
|
|
32
33
|
'file_id',
|
|
33
34
|
'folder_id',
|
|
34
35
|
]), null, 2));
|
|
@@ -21,10 +21,11 @@ class SpacesFilesMove extends base_command_1.BaseCommand {
|
|
|
21
21
|
async run() {
|
|
22
22
|
this.requireAuth();
|
|
23
23
|
const { args, flags } = await this.parse(SpacesFilesMove);
|
|
24
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
24
25
|
let result;
|
|
25
26
|
try {
|
|
26
27
|
result = await data_provider_1.dataService.moveSpaceFile({
|
|
27
|
-
spaceId:
|
|
28
|
+
spaceId: spaceRef,
|
|
28
29
|
file_id: args.file,
|
|
29
30
|
target_folder_id: flags.root ? null : flags.folder,
|
|
30
31
|
});
|
|
@@ -33,7 +34,7 @@ class SpacesFilesMove extends base_command_1.BaseCommand {
|
|
|
33
34
|
this.handleApiError(err);
|
|
34
35
|
}
|
|
35
36
|
if (flags.json)
|
|
36
|
-
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL,
|
|
37
|
+
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, spaceRef, 'files', result, ['file_id']), null, 2));
|
|
37
38
|
else
|
|
38
39
|
this.log(`Moved file ${args.file} ${flags.root ? 'to the root' : `to folder ${flags.folder}`}.`);
|
|
39
40
|
}
|
|
@@ -17,10 +17,11 @@ class SpacesFilesRename extends base_command_1.BaseCommand {
|
|
|
17
17
|
async run() {
|
|
18
18
|
this.requireAuth();
|
|
19
19
|
const { args, flags } = await this.parse(SpacesFilesRename);
|
|
20
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
20
21
|
let result;
|
|
21
22
|
try {
|
|
22
23
|
result = await data_provider_1.dataService.renameSpaceFile({
|
|
23
|
-
spaceId:
|
|
24
|
+
spaceId: spaceRef,
|
|
24
25
|
file_id: args.file,
|
|
25
26
|
filename: flags.filename,
|
|
26
27
|
});
|
|
@@ -29,7 +30,7 @@ class SpacesFilesRename extends base_command_1.BaseCommand {
|
|
|
29
30
|
this.handleApiError(err);
|
|
30
31
|
}
|
|
31
32
|
if (flags.json)
|
|
32
|
-
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL,
|
|
33
|
+
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, spaceRef, 'files', result, ['file_id']), null, 2));
|
|
33
34
|
else
|
|
34
35
|
this.log(`Renamed file ${args.file} to ${flags.filename}.`);
|
|
35
36
|
}
|
|
@@ -60,19 +60,20 @@ class SpacesFilesUpload extends base_command_1.BaseCommand {
|
|
|
60
60
|
async run() {
|
|
61
61
|
this.requireAuth();
|
|
62
62
|
const { args, flags } = await this.parse(SpacesFilesUpload);
|
|
63
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
63
64
|
if (!fs.existsSync(flags.file)) {
|
|
64
65
|
this.error(`File not found: ${flags.file}`, { exit: 1 });
|
|
65
66
|
}
|
|
66
67
|
if (flags.folder) {
|
|
67
68
|
let folders;
|
|
68
69
|
try {
|
|
69
|
-
folders = await data_provider_1.dataService.listSpaceFolders(
|
|
70
|
+
folders = await data_provider_1.dataService.listSpaceFolders(spaceRef);
|
|
70
71
|
}
|
|
71
72
|
catch (err) {
|
|
72
73
|
this.handleApiError(err);
|
|
73
74
|
}
|
|
74
75
|
if (!folders.data.some((folder) => folder.folder_id === flags.folder)) {
|
|
75
|
-
this.error(`Folder not found in space ${
|
|
76
|
+
this.error(`Folder not found in space ${spaceRef}: ${flags.folder}`, { exit: 1 });
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
const filename = path.basename(flags.file);
|
|
@@ -82,7 +83,7 @@ class SpacesFilesUpload extends base_command_1.BaseCommand {
|
|
|
82
83
|
// the file, so add all fields before the file part.
|
|
83
84
|
formData.append('endpoint', 'default');
|
|
84
85
|
formData.append('file_id', (0, node_crypto_1.randomUUID)());
|
|
85
|
-
formData.append('spaceId',
|
|
86
|
+
formData.append('spaceId', spaceRef);
|
|
86
87
|
if (flags.folder)
|
|
87
88
|
formData.append('folder_id', flags.folder);
|
|
88
89
|
formData.append('file', new node_buffer_1.Blob([bytes], { type: (0, file_mime_1.mimeTypeForFilename)(filename) }), filename);
|
|
@@ -94,10 +95,10 @@ class SpacesFilesUpload extends base_command_1.BaseCommand {
|
|
|
94
95
|
this.handleApiError(err);
|
|
95
96
|
}
|
|
96
97
|
if (flags.json) {
|
|
97
|
-
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL,
|
|
98
|
+
this.log(JSON.stringify((0, space_output_1.withSpaceResourceUrls)(this.cliConfig.baseURL, spaceRef, 'files', uploaded, ['file_id']), null, 2));
|
|
98
99
|
return;
|
|
99
100
|
}
|
|
100
|
-
this.log(`Uploaded ${uploaded.filename} (${uploaded.bytes} bytes) → file ${uploaded.file_id} in space ${
|
|
101
|
+
this.log(`Uploaded ${uploaded.filename} (${uploaded.bytes} bytes) → file ${uploaded.file_id} in space ${spaceRef}`);
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
exports.default = SpacesFilesUpload;
|
|
@@ -19,6 +19,7 @@ class SpacesGitHubAutomationsSet extends base_command_1.BaseCommand {
|
|
|
19
19
|
async run() {
|
|
20
20
|
this.requireAuth();
|
|
21
21
|
const { args, flags } = await this.parse(SpacesGitHubAutomationsSet);
|
|
22
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
22
23
|
let config;
|
|
23
24
|
try {
|
|
24
25
|
const parsed = JSON.parse(flags.config);
|
|
@@ -33,14 +34,14 @@ class SpacesGitHubAutomationsSet extends base_command_1.BaseCommand {
|
|
|
33
34
|
}
|
|
34
35
|
let result;
|
|
35
36
|
try {
|
|
36
|
-
result = await data_provider_1.dataService.updateSpaceGitHubAutomations(
|
|
37
|
+
result = await data_provider_1.dataService.updateSpaceGitHubAutomations(spaceRef, config);
|
|
37
38
|
}
|
|
38
39
|
catch (error) {
|
|
39
40
|
this.handleApiError(error);
|
|
40
41
|
return;
|
|
41
42
|
}
|
|
42
43
|
if (flags.json) {
|
|
43
|
-
this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { id:
|
|
44
|
+
this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { id: spaceRef, ...result }), null, 2));
|
|
44
45
|
return;
|
|
45
46
|
}
|
|
46
47
|
this.log(config === null
|
|
@@ -13,16 +13,17 @@ class SpacesGitHubAutomationsShow extends base_command_1.BaseCommand {
|
|
|
13
13
|
async run() {
|
|
14
14
|
this.requireAuth();
|
|
15
15
|
const { args, flags } = await this.parse(SpacesGitHubAutomationsShow);
|
|
16
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
16
17
|
let result;
|
|
17
18
|
try {
|
|
18
|
-
result = await data_provider_1.dataService.getSpaceGitHubAutomations(
|
|
19
|
+
result = await data_provider_1.dataService.getSpaceGitHubAutomations(spaceRef);
|
|
19
20
|
}
|
|
20
21
|
catch (error) {
|
|
21
22
|
this.handleApiError(error);
|
|
22
23
|
return;
|
|
23
24
|
}
|
|
24
25
|
if (flags.json) {
|
|
25
|
-
this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { id:
|
|
26
|
+
this.log(JSON.stringify((0, web_url_1.withSpaceUrl)(this.cliConfig.baseURL, { id: spaceRef, ...result }), null, 2));
|
|
26
27
|
return;
|
|
27
28
|
}
|
|
28
29
|
const policy = result.githubAutomations?.prLifecycle;
|
|
@@ -20,9 +20,10 @@ class SpacesGoals extends base_command_1.BaseCommand {
|
|
|
20
20
|
async run() {
|
|
21
21
|
this.requireAuth();
|
|
22
22
|
const { args, flags } = await this.parse(SpacesGoals);
|
|
23
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
23
24
|
let response;
|
|
24
25
|
try {
|
|
25
|
-
response = await data_provider_1.dataService.listSpaceGoals(
|
|
26
|
+
response = await data_provider_1.dataService.listSpaceGoals(spaceRef);
|
|
26
27
|
}
|
|
27
28
|
catch (err) {
|
|
28
29
|
this.handleApiError(err);
|
|
@@ -39,6 +39,7 @@ class SpacesHeartbeatsCreate extends base_command_1.BaseCommand {
|
|
|
39
39
|
async run() {
|
|
40
40
|
this.requireAuth();
|
|
41
41
|
const { args, flags } = await this.parse(SpacesHeartbeatsCreate);
|
|
42
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
42
43
|
let body = {};
|
|
43
44
|
try {
|
|
44
45
|
body = await (0, prompt_1.readJsonBody)(flags['from-json']);
|
|
@@ -75,7 +76,7 @@ class SpacesHeartbeatsCreate extends base_command_1.BaseCommand {
|
|
|
75
76
|
let result;
|
|
76
77
|
try {
|
|
77
78
|
result = await data_provider_1.dataService.createSpaceHeartbeat({
|
|
78
|
-
spaceId:
|
|
79
|
+
spaceId: spaceRef,
|
|
79
80
|
...payload,
|
|
80
81
|
});
|
|
81
82
|
}
|
|
@@ -83,10 +84,10 @@ class SpacesHeartbeatsCreate extends base_command_1.BaseCommand {
|
|
|
83
84
|
this.handleApiError(err);
|
|
84
85
|
}
|
|
85
86
|
if (flags.json) {
|
|
86
|
-
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL,
|
|
87
|
+
this.log(JSON.stringify((0, space_output_1.withSpacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'schedule', result), null, 2));
|
|
87
88
|
return;
|
|
88
89
|
}
|
|
89
|
-
this.log(`Created heartbeat for agent ${agentId} in space ${
|
|
90
|
+
this.log(`Created heartbeat for agent ${agentId} in space ${spaceRef}`);
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
exports.default = SpacesHeartbeatsCreate;
|
|
@@ -22,9 +22,10 @@ class SpacesHeartbeatsDelete extends base_command_1.BaseCommand {
|
|
|
22
22
|
async run() {
|
|
23
23
|
this.requireAuth();
|
|
24
24
|
const { args, flags } = await this.parse(SpacesHeartbeatsDelete);
|
|
25
|
+
const spaceRef = await this.resolveEntityRef('space', args.id);
|
|
25
26
|
let confirmed;
|
|
26
27
|
try {
|
|
27
|
-
confirmed = await (0, prompt_1.confirmDestructive)(`Delete heartbeat for agent ${args.agentId} in space ${
|
|
28
|
+
confirmed = await (0, prompt_1.confirmDestructive)(`Delete heartbeat for agent ${args.agentId} in space ${spaceRef}? This cannot be undone.`, flags.yes);
|
|
28
29
|
}
|
|
29
30
|
catch (err) {
|
|
30
31
|
this.error(err.message, {
|
|
@@ -36,7 +37,7 @@ class SpacesHeartbeatsDelete extends base_command_1.BaseCommand {
|
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
38
39
|
try {
|
|
39
|
-
await data_provider_1.dataService.deleteSpaceHeartbeat(
|
|
40
|
+
await data_provider_1.dataService.deleteSpaceHeartbeat(spaceRef, args.agentId);
|
|
40
41
|
}
|
|
41
42
|
catch (err) {
|
|
42
43
|
this.handleApiError(err);
|
|
@@ -45,7 +46,7 @@ class SpacesHeartbeatsDelete extends base_command_1.BaseCommand {
|
|
|
45
46
|
this.log(JSON.stringify({
|
|
46
47
|
success: true,
|
|
47
48
|
agentId: args.agentId,
|
|
48
|
-
url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL,
|
|
49
|
+
url: (0, space_output_1.spacePerspectiveUrl)(this.cliConfig.baseURL, spaceRef, 'schedule'),
|
|
49
50
|
}, null, 2));
|
|
50
51
|
return;
|
|
51
52
|
}
|