@skrr-ai/cli 0.1.36 → 0.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -4
- package/bin/dev-fallback.js +167 -4
- package/dist/base-command.js +46 -2
- package/dist/commands/agents/actions/create.d.ts +5 -0
- package/dist/commands/agents/actions/create.js +42 -5
- package/dist/commands/agents/actions/delete.d.ts +1 -0
- package/dist/commands/agents/actions/delete.js +7 -0
- package/dist/commands/agents/actions/update.d.ts +5 -0
- package/dist/commands/agents/actions/update.js +27 -1
- package/dist/commands/agents/api-actions/add.d.ts +41 -0
- package/dist/commands/agents/api-actions/add.js +205 -0
- package/dist/commands/agents/api-actions/index.d.ts +39 -0
- package/dist/commands/agents/api-actions/index.js +103 -0
- package/dist/commands/agents/api-actions/remove.d.ts +14 -0
- package/dist/commands/agents/api-actions/remove.js +36 -0
- package/dist/commands/agents/avatar/default/apply.d.ts +25 -0
- package/dist/commands/agents/avatar/default/apply.js +56 -0
- package/dist/commands/agents/avatar/default/index.d.ts +29 -0
- package/dist/commands/agents/avatar/default/index.js +61 -0
- package/dist/commands/agents/avatar/default/set.d.ts +24 -0
- package/dist/commands/agents/avatar/default/set.js +120 -0
- package/dist/commands/agents/avatar/library/delete.d.ts +20 -0
- package/dist/commands/agents/avatar/library/delete.js +47 -0
- package/dist/commands/agents/avatar/library/index.d.ts +16 -0
- package/dist/commands/agents/avatar/library/index.js +56 -0
- package/dist/commands/agents/avatar/presets.d.ts +19 -0
- package/dist/commands/agents/avatar/presets.js +56 -0
- package/dist/commands/agents/avatar/upload.js +7 -1
- package/dist/commands/agents/categories/create.d.ts +14 -0
- package/dist/commands/agents/categories/create.js +46 -0
- package/dist/commands/agents/categories/delete.d.ts +13 -0
- package/dist/commands/agents/categories/delete.js +41 -0
- package/dist/commands/agents/categories/index.d.ts +36 -0
- package/dist/commands/agents/categories/index.js +135 -0
- package/dist/commands/agents/categories/update.d.ts +22 -0
- package/dist/commands/agents/categories/update.js +59 -0
- package/dist/commands/agents/chat.d.ts +21 -0
- package/dist/commands/agents/chat.js +94 -7
- package/dist/commands/agents/create.d.ts +10 -0
- package/dist/commands/agents/create.js +64 -3
- package/dist/commands/agents/ensure-default.d.ts +27 -0
- package/dist/commands/agents/ensure-default.js +65 -0
- package/dist/commands/agents/list.d.ts +15 -0
- package/dist/commands/agents/list.js +31 -1
- package/dist/commands/agents/mute.d.ts +16 -0
- package/dist/commands/agents/mute.js +38 -0
- package/dist/commands/agents/pin.d.ts +16 -0
- package/dist/commands/agents/pin.js +38 -0
- package/dist/commands/agents/scene-background/upload.d.ts +30 -0
- package/dist/commands/agents/scene-background/upload.js +97 -0
- package/dist/commands/agents/show.js +13 -0
- package/dist/commands/agents/tools/auth.d.ts +19 -0
- package/dist/commands/agents/tools/auth.js +41 -0
- package/dist/commands/agents/tools/calls.d.ts +36 -0
- package/dist/commands/agents/tools/calls.js +117 -0
- package/dist/commands/agents/tools/index.d.ts +20 -0
- package/dist/commands/agents/tools/index.js +77 -0
- package/dist/commands/agents/unmute.d.ts +16 -0
- package/dist/commands/agents/unmute.js +38 -0
- package/dist/commands/agents/unpin.d.ts +16 -0
- package/dist/commands/agents/unpin.js +38 -0
- package/dist/commands/agents/update.d.ts +12 -0
- package/dist/commands/agents/update.js +74 -3
- package/dist/commands/code/{oversky-agent.d.ts → skrr-agent.d.ts} +3 -3
- package/dist/commands/code/{oversky-agent.js → skrr-agent.js} +11 -8
- package/dist/commands/convos/messages.d.ts +13 -0
- package/dist/commands/convos/messages.js +40 -16
- package/dist/commands/daemon/index.js +8 -1
- package/dist/commands/daemon/logs.d.ts +26 -0
- package/dist/commands/daemon/logs.js +56 -0
- package/dist/commands/daemon/uninstall.js +1 -1
- package/dist/commands/followups/act.d.ts +22 -0
- package/dist/commands/followups/act.js +103 -0
- package/dist/commands/followups/cancel.d.ts +20 -0
- package/dist/commands/followups/cancel.js +50 -0
- package/dist/commands/followups/checkin.d.ts +27 -0
- package/dist/commands/followups/checkin.js +107 -0
- package/dist/commands/followups/list.d.ts +24 -0
- package/dist/commands/followups/list.js +90 -0
- package/dist/commands/followups/observability.d.ts +23 -0
- package/dist/commands/followups/observability.js +114 -0
- package/dist/commands/followups/remind.d.ts +26 -0
- package/dist/commands/followups/remind.js +106 -0
- package/dist/commands/followups/reschedule.d.ts +15 -0
- package/dist/commands/followups/reschedule.js +48 -0
- package/dist/commands/followups/resolve.d.ts +23 -0
- package/dist/commands/followups/resolve.js +54 -0
- package/dist/commands/followups/show.d.ts +12 -0
- package/dist/commands/followups/show.js +46 -0
- package/dist/commands/followups/watch.d.ts +51 -0
- package/dist/commands/followups/watch.js +211 -0
- package/dist/commands/goals/labels/add.js +19 -2
- package/dist/commands/goals/labels/remove.js +22 -2
- package/dist/commands/harnesses/forget.js +28 -0
- package/dist/commands/harnesses/install.d.ts +41 -0
- package/dist/commands/harnesses/install.js +165 -0
- package/dist/commands/harnesses/installers.d.ts +45 -0
- package/dist/commands/harnesses/installers.js +155 -0
- package/dist/commands/harnesses/list.d.ts +82 -1
- package/dist/commands/harnesses/list.js +104 -12
- package/dist/commands/harnesses/models.js +10 -1
- package/dist/commands/harnesses/show.d.ts +15 -0
- package/dist/commands/harnesses/show.js +44 -3
- package/dist/commands/harnesses/update.js +1 -1
- package/dist/commands/harnesses/usage.d.ts +25 -0
- package/dist/commands/harnesses/usage.js +24 -2
- package/dist/commands/instructions/status.js +13 -1
- package/dist/commands/labels/list.d.ts +24 -1
- package/dist/commands/labels/list.js +62 -19
- package/dist/commands/machines/dedicated/catalog.js +4 -15
- package/dist/commands/machines/dedicated/create.d.ts +8 -0
- package/dist/commands/machines/dedicated/create.js +58 -1
- package/dist/commands/machines/dedicated/destroy.js +18 -4
- package/dist/commands/machines/dedicated/list.js +9 -6
- package/dist/commands/machines/hosted/list.js +12 -0
- package/dist/commands/machines/list.js +11 -0
- package/dist/commands/machines/show.d.ts +1 -0
- package/dist/commands/machines/show.js +40 -11
- package/dist/commands/memory/governance/index.d.ts +21 -0
- package/dist/commands/memory/governance/index.js +64 -0
- package/dist/commands/memory/governance/set.d.ts +24 -0
- package/dist/commands/memory/governance/set.js +95 -0
- package/dist/commands/memory/provenance.d.ts +18 -0
- package/dist/commands/memory/provenance.js +66 -0
- package/dist/commands/profiles/list.d.ts +23 -0
- package/dist/commands/profiles/list.js +96 -0
- package/dist/commands/search/skills.d.ts +11 -1
- package/dist/commands/search/skills.js +26 -8
- package/dist/commands/skills/details.d.ts +2 -0
- package/dist/commands/skills/details.js +24 -1
- package/dist/commands/skills/import-as-actions.d.ts +32 -0
- package/dist/commands/skills/import-as-actions.js +175 -0
- package/dist/commands/skills/install.d.ts +2 -0
- package/dist/commands/skills/install.js +24 -1
- package/dist/commands/skills/invocable.js +6 -2
- package/dist/commands/skills/local.d.ts +40 -0
- package/dist/commands/skills/local.js +160 -0
- package/dist/commands/skills/search.d.ts +11 -1
- package/dist/commands/skills/search.js +29 -8
- package/dist/commands/spaces/actions/add.js +23 -5
- package/dist/commands/spaces/actions/available.js +3 -0
- package/dist/commands/spaces/actions/list.d.ts +5 -0
- package/dist/commands/spaces/actions/list.js +49 -3
- package/dist/commands/spaces/actions/run.d.ts +28 -0
- package/dist/commands/spaces/actions/run.js +146 -0
- package/dist/commands/spaces/actions/update.js +27 -5
- package/dist/commands/spaces/create.d.ts +3 -0
- package/dist/commands/spaces/create.js +32 -2
- package/dist/commands/spaces/label-summaries.d.ts +27 -0
- package/dist/commands/spaces/label-summaries.js +64 -0
- package/dist/commands/spaces/labels/add.js +19 -2
- package/dist/commands/spaces/labels/remove.js +22 -2
- package/dist/commands/spaces/show.js +2 -0
- package/dist/commands/spaces/task-rollups.d.ts +5 -0
- package/dist/commands/spaces/task-rollups.js +15 -4
- package/dist/commands/spaces/update.d.ts +5 -0
- package/dist/commands/spaces/update.js +41 -4
- package/dist/commands/spaces/workflows/lifecycle-diagnostics.d.ts +11 -0
- package/dist/commands/spaces/workflows/lifecycle-diagnostics.js +105 -0
- package/dist/commands/tasks/actions/attach.js +32 -7
- package/dist/commands/tasks/complete.d.ts +1 -0
- package/dist/commands/tasks/complete.js +21 -1
- package/dist/commands/tasks/create.d.ts +3 -0
- package/dist/commands/tasks/create.js +34 -2
- package/dist/commands/tasks/events/append.js +29 -6
- package/dist/commands/tasks/expectations/assess.d.ts +12 -0
- package/dist/commands/tasks/expectations/assess.js +123 -14
- package/dist/commands/tasks/expectations.js +95 -17
- package/dist/commands/tasks/follow-up.js +2 -2
- package/dist/commands/tasks/labels/attach.js +20 -3
- package/dist/commands/tasks/labels/detach.js +21 -3
- package/dist/commands/tasks/lifecycle/attach.d.ts +14 -0
- package/dist/commands/tasks/lifecycle/attach.js +47 -0
- package/dist/commands/tasks/lifecycle/definitions.d.ts +11 -0
- package/dist/commands/tasks/lifecycle/definitions.js +59 -0
- package/dist/commands/tasks/lifecycle/detach.d.ts +19 -0
- package/dist/commands/tasks/lifecycle/detach.js +72 -0
- package/dist/commands/tasks/lifecycle/history.d.ts +13 -0
- package/dist/commands/tasks/lifecycle/history.js +38 -0
- package/dist/commands/tasks/lifecycle/migrate.d.ts +14 -0
- package/dist/commands/tasks/lifecycle/migrate.js +68 -0
- package/dist/commands/tasks/lifecycle/reconcile.d.ts +11 -0
- package/dist/commands/tasks/lifecycle/reconcile.js +27 -0
- package/dist/commands/tasks/lifecycle/reopen.d.ts +15 -0
- package/dist/commands/tasks/lifecycle/reopen.js +71 -0
- package/dist/commands/tasks/lifecycle/show.d.ts +11 -0
- package/dist/commands/tasks/lifecycle/show.js +27 -0
- package/dist/commands/tasks/lifecycle/start.d.ts +12 -0
- package/dist/commands/tasks/lifecycle/start.js +30 -0
- package/dist/commands/tasks/lifecycle/transition.d.ts +15 -0
- package/dist/commands/tasks/lifecycle/transition.js +109 -0
- package/dist/commands/tasks/list.js +16 -9
- package/dist/commands/tasks/move.d.ts +1 -0
- package/dist/commands/tasks/move.js +29 -0
- package/dist/commands/tasks/result/submit.js +11 -1
- package/dist/commands/tasks/review-queue.d.ts +44 -0
- package/dist/commands/tasks/review-queue.js +314 -0
- package/dist/commands/tasks/show.d.ts +11 -0
- package/dist/commands/tasks/show.js +139 -4
- package/dist/commands/tasks/trust.js +7 -2
- package/dist/commands/tasks/update.d.ts +1 -0
- package/dist/commands/tasks/update.js +83 -0
- package/dist/commands/tasks/updates/add.js +1 -1
- package/dist/commands/token/list.d.ts +22 -0
- package/dist/commands/token/list.js +68 -0
- package/dist/commands/token/revoke.d.ts +23 -0
- package/dist/commands/token/revoke.js +53 -0
- package/dist/lib/agent-actions.d.ts +92 -11
- package/dist/lib/agent-actions.js +171 -25
- package/dist/lib/agent-config.d.ts +11 -0
- package/dist/lib/agent-config.js +85 -3
- package/dist/lib/agent-pin-mute.d.ts +29 -0
- package/dist/lib/agent-pin-mute.js +30 -0
- package/dist/lib/agent-visual-refs.d.ts +33 -0
- package/dist/lib/agent-visual-refs.js +267 -0
- package/dist/lib/agentic-stream.d.ts +6 -0
- package/dist/lib/agentic-stream.js +34 -3
- package/dist/lib/assignee-resolver.d.ts +1 -1
- package/dist/lib/assignee-resolver.js +8 -0
- package/dist/lib/bulk-task-targets.d.ts +12 -0
- package/dist/lib/bulk-task-targets.js +34 -1
- package/dist/lib/cli-installers.d.ts +130 -0
- package/dist/lib/cli-installers.js +145 -0
- package/dist/lib/command-miss.js +55 -7
- package/dist/lib/dedicated-lease-command.d.ts +13 -0
- package/dist/lib/dedicated-lease-command.js +22 -1
- package/dist/lib/dedicated-machines.d.ts +95 -1
- package/dist/lib/dedicated-machines.js +236 -2
- package/dist/lib/failed-lookup.d.ts +3 -0
- package/dist/lib/failed-lookup.js +40 -0
- package/dist/lib/first-party-harness-agent.js +16 -2
- package/dist/lib/first-party-harness-doctor.d.ts +15 -0
- package/dist/lib/first-party-harness-doctor.js +126 -27
- package/dist/lib/followups.d.ts +115 -0
- package/dist/lib/followups.js +127 -0
- package/dist/lib/harnesses.d.ts +8 -0
- package/dist/lib/instruction-input.d.ts +19 -1
- package/dist/lib/instruction-input.js +52 -1
- package/dist/lib/label-ref.d.ts +95 -0
- package/dist/lib/label-ref.js +163 -0
- package/dist/lib/label-scope.d.ts +17 -2
- package/dist/lib/label-scope.js +27 -7
- package/dist/lib/local-skills.d.ts +98 -0
- package/dist/lib/local-skills.js +195 -0
- package/dist/lib/machines.d.ts +10 -10
- package/dist/lib/machines.js +23 -1
- package/dist/lib/search-query.d.ts +19 -0
- package/dist/lib/search-query.js +35 -0
- package/dist/lib/space-custom-actions.d.ts +72 -0
- package/dist/lib/space-custom-actions.js +117 -0
- package/dist/lib/space-resolver.d.ts +1 -21
- package/dist/lib/space-resolver.js +19 -10
- package/dist/lib/task-closure.d.ts +33 -0
- package/dist/lib/task-closure.js +104 -0
- package/dist/lib/task-lifecycle-output.d.ts +14 -0
- package/dist/lib/task-lifecycle-output.js +209 -0
- package/dist/lib/task-ref-resolver.d.ts +1 -17
- package/dist/lib/task-ref-resolver.js +18 -8
- package/dist/lib/tasks.d.ts +3 -0
- package/dist/lib/tasks.js +40 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessTrust.js +4 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessTrust.js +4 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +5559 -4897
- package/oclif.manifest.json +33890 -28690
- package/package.json +24 -6
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../base-command");
|
|
5
|
+
const agent_pin_mute_1 = require("../../lib/agent-pin-mute");
|
|
6
|
+
/**
|
|
7
|
+
* Per-USER preference, not agent config: it changes your view of the agent and
|
|
8
|
+
* nobody else's. Idempotent over a toggle endpoint — see `lib/agent-pin-mute.ts`.
|
|
9
|
+
*/
|
|
10
|
+
class AgentsMute extends base_command_1.BaseCommand {
|
|
11
|
+
static description = "Silence an agent's notifications for you";
|
|
12
|
+
static examples = ['<%= config.bin %> agents mute <agent-id>'];
|
|
13
|
+
static args = {
|
|
14
|
+
id: core_1.Args.string({ description: 'Agent ID', required: true, ignoreStdin: true }),
|
|
15
|
+
};
|
|
16
|
+
static flags = {
|
|
17
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
this.requireAuth();
|
|
21
|
+
const { args, flags } = await this.parse(AgentsMute);
|
|
22
|
+
let result;
|
|
23
|
+
try {
|
|
24
|
+
result = await (0, agent_pin_mute_1.setAgentFlag)(args.id, 'mute', true);
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
this.handleApiError(err);
|
|
28
|
+
}
|
|
29
|
+
if (flags.json) {
|
|
30
|
+
this.log(this.agentJson(args.id, { mute: result.value, changed: result.changed }));
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
this.log(result.changed
|
|
34
|
+
? `Agent ${args.id}: mute is now ${result.value}`
|
|
35
|
+
: `Agent ${args.id}: mute was already ${result.value} — nothing to do`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.default = AgentsMute;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* Per-USER preference, not agent config: it changes your view of the agent and
|
|
4
|
+
* nobody else's. Idempotent over a toggle endpoint — see `lib/agent-pin-mute.ts`.
|
|
5
|
+
*/
|
|
6
|
+
export default class AgentsPin extends BaseCommand {
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static args: {
|
|
10
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
11
|
+
};
|
|
12
|
+
static flags: {
|
|
13
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../base-command");
|
|
5
|
+
const agent_pin_mute_1 = require("../../lib/agent-pin-mute");
|
|
6
|
+
/**
|
|
7
|
+
* Per-USER preference, not agent config: it changes your view of the agent and
|
|
8
|
+
* nobody else's. Idempotent over a toggle endpoint — see `lib/agent-pin-mute.ts`.
|
|
9
|
+
*/
|
|
10
|
+
class AgentsPin extends base_command_1.BaseCommand {
|
|
11
|
+
static description = 'Pin an agent to the top of your list';
|
|
12
|
+
static examples = ['<%= config.bin %> agents pin <agent-id>'];
|
|
13
|
+
static args = {
|
|
14
|
+
id: core_1.Args.string({ description: 'Agent ID', required: true, ignoreStdin: true }),
|
|
15
|
+
};
|
|
16
|
+
static flags = {
|
|
17
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
this.requireAuth();
|
|
21
|
+
const { args, flags } = await this.parse(AgentsPin);
|
|
22
|
+
let result;
|
|
23
|
+
try {
|
|
24
|
+
result = await (0, agent_pin_mute_1.setAgentFlag)(args.id, 'pin', true);
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
this.handleApiError(err);
|
|
28
|
+
}
|
|
29
|
+
if (flags.json) {
|
|
30
|
+
this.log(this.agentJson(args.id, { pin: result.value, changed: result.changed }));
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
this.log(result.changed
|
|
34
|
+
? `Agent ${args.id}: pin is now ${result.value}`
|
|
35
|
+
: `Agent ${args.id}: pin was already ${result.value} — nothing to do`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.default = AgentsPin;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* Upload an image as an agent's 3D backdrop.
|
|
4
|
+
*
|
|
5
|
+
* `--scene-background image:<filepath>@<source>` was documented and had no value
|
|
6
|
+
* that could succeed from the CLI. The server accepts an image backdrop only from
|
|
7
|
+
* the writer's own WALLPAPER upload namespace (`/images/<userId>/wallpaper-…`),
|
|
8
|
+
* and the only thing that writes there is `POST /api/files/images/wallpaper` —
|
|
9
|
+
* which nothing in `skrr` called. Every attempt ended in
|
|
10
|
+
* "Scene background image must be one you uploaded", and the flag's word
|
|
11
|
+
* `<filepath>` read like a path on disk, which sent people looking in the wrong
|
|
12
|
+
* place.
|
|
13
|
+
*
|
|
14
|
+
* This is that upload, followed by setting it, so the documented form finally
|
|
15
|
+
* has a producer. `--upload-only` prints the `--scene-background` value instead,
|
|
16
|
+
* for scripts that set it later or on several agents.
|
|
17
|
+
*/
|
|
18
|
+
export default class AgentsSceneBackgroundUpload extends BaseCommand {
|
|
19
|
+
static description: string;
|
|
20
|
+
static examples: string[];
|
|
21
|
+
static args: {
|
|
22
|
+
agentId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
23
|
+
};
|
|
24
|
+
static flags: {
|
|
25
|
+
file: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
26
|
+
'upload-only': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
27
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
28
|
+
};
|
|
29
|
+
run(): Promise<void>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const promises_1 = require("node:fs/promises");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
7
|
+
const base_command_1 = require("../../../base-command");
|
|
8
|
+
const agent_visual_refs_1 = require("../../../lib/agent-visual-refs");
|
|
9
|
+
/**
|
|
10
|
+
* Upload an image as an agent's 3D backdrop.
|
|
11
|
+
*
|
|
12
|
+
* `--scene-background image:<filepath>@<source>` was documented and had no value
|
|
13
|
+
* that could succeed from the CLI. The server accepts an image backdrop only from
|
|
14
|
+
* the writer's own WALLPAPER upload namespace (`/images/<userId>/wallpaper-…`),
|
|
15
|
+
* and the only thing that writes there is `POST /api/files/images/wallpaper` —
|
|
16
|
+
* which nothing in `skrr` called. Every attempt ended in
|
|
17
|
+
* "Scene background image must be one you uploaded", and the flag's word
|
|
18
|
+
* `<filepath>` read like a path on disk, which sent people looking in the wrong
|
|
19
|
+
* place.
|
|
20
|
+
*
|
|
21
|
+
* This is that upload, followed by setting it, so the documented form finally
|
|
22
|
+
* has a producer. `--upload-only` prints the `--scene-background` value instead,
|
|
23
|
+
* for scripts that set it later or on several agents.
|
|
24
|
+
*/
|
|
25
|
+
class AgentsSceneBackgroundUpload extends base_command_1.BaseCommand {
|
|
26
|
+
static description = "Upload an image as an agent's 3D backdrop and set it";
|
|
27
|
+
static examples = [
|
|
28
|
+
'<%= config.bin %> agents scene-background upload agent_abc --file ./room.png',
|
|
29
|
+
'<%= config.bin %> agents scene-background upload agent_abc --file ./room.jpg --upload-only',
|
|
30
|
+
];
|
|
31
|
+
static args = {
|
|
32
|
+
agentId: core_1.Args.string({ description: 'Agent ID', required: true, ignoreStdin: true }),
|
|
33
|
+
};
|
|
34
|
+
static flags = {
|
|
35
|
+
file: core_1.Flags.string({
|
|
36
|
+
description: 'Image to upload: PNG, JPEG, WebP or GIF (not SVG). Resized to at most 2560px wide.',
|
|
37
|
+
required: true,
|
|
38
|
+
}),
|
|
39
|
+
'upload-only': core_1.Flags.boolean({
|
|
40
|
+
description: 'Upload, then print the --scene-background value without changing the agent',
|
|
41
|
+
}),
|
|
42
|
+
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
43
|
+
};
|
|
44
|
+
async run() {
|
|
45
|
+
this.requireAuth();
|
|
46
|
+
const { args, flags } = await this.parse(AgentsSceneBackgroundUpload);
|
|
47
|
+
// The server gates on the part's MIME type, so an untyped Blob would be
|
|
48
|
+
// refused as "Unsupported file type" whatever its bytes were.
|
|
49
|
+
const type = (0, agent_visual_refs_1.imageUploadMimeType)(flags.file);
|
|
50
|
+
if (!type) {
|
|
51
|
+
this.error(`--file must be a .png, .jpg, .jpeg, .webp or .gif image (got ${(0, node_path_1.basename)(flags.file)}).`, { exit: 1 });
|
|
52
|
+
}
|
|
53
|
+
let bytes;
|
|
54
|
+
try {
|
|
55
|
+
bytes = await (0, promises_1.readFile)(flags.file);
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
this.error(`Could not read --file ${flags.file}: ${err.message}`, { exit: 1 });
|
|
59
|
+
}
|
|
60
|
+
const form = new FormData();
|
|
61
|
+
form.append('file', new Blob([new Uint8Array(bytes)], { type }), (0, node_path_1.basename)(flags.file));
|
|
62
|
+
let uploaded;
|
|
63
|
+
try {
|
|
64
|
+
uploaded = (await data_provider_1.dataService.uploadWallpaper(form));
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
this.handleApiError(err);
|
|
68
|
+
}
|
|
69
|
+
const sceneBackground = {
|
|
70
|
+
type: 'image',
|
|
71
|
+
filepath: uploaded.filepath,
|
|
72
|
+
source: uploaded.source,
|
|
73
|
+
};
|
|
74
|
+
const flagValue = `image:${sceneBackground.filepath}@${sceneBackground.source}`;
|
|
75
|
+
if (!flags['upload-only']) {
|
|
76
|
+
try {
|
|
77
|
+
await data_provider_1.dataService.updateAgent({
|
|
78
|
+
agent_id: args.agentId,
|
|
79
|
+
data: { sceneBackground },
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
this.handleApiError(err);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (flags.json) {
|
|
87
|
+
this.log(JSON.stringify({ agentId: args.agentId, sceneBackground, flagValue, applied: !flags['upload-only'] }, null, 2));
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
this.log(flags['upload-only']
|
|
91
|
+
? `Uploaded. Set it with: --scene-background ${flagValue}`
|
|
92
|
+
: `Backdrop for agent ${args.agentId} is now the uploaded image.`);
|
|
93
|
+
if (!flags['upload-only'])
|
|
94
|
+
this.printAgentUrl(args.agentId);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.default = AgentsSceneBackgroundUpload;
|
|
@@ -8,6 +8,7 @@ const base_command_1 = require("../../base-command");
|
|
|
8
8
|
const harness_provider_input_1 = require("../../lib/harness-provider-input");
|
|
9
9
|
const web_url_1 = require("../../lib/web-url");
|
|
10
10
|
const hosted_machines_1 = require("../../lib/hosted-machines");
|
|
11
|
+
const agent_visual_refs_1 = require("../../lib/agent-visual-refs");
|
|
11
12
|
/**
|
|
12
13
|
* OSK-4901 — the tone line for `agents show` text output.
|
|
13
14
|
*
|
|
@@ -139,6 +140,18 @@ class AgentsShow extends base_command_1.BaseCommand {
|
|
|
139
140
|
this.log(`Provider: ${a.provider ?? '-'}`);
|
|
140
141
|
this.log(`Model: ${a.model ?? '-'}`);
|
|
141
142
|
this.log(`Tone: ${agentToneLine(a)}`);
|
|
143
|
+
this.log(`Avatar: ${(0, agent_visual_refs_1.agentAvatarLine)(a.avatar)}`);
|
|
144
|
+
this.log(`Backdrop: ${(0, agent_visual_refs_1.agentSceneBackgroundLine)(a.sceneBackground)}`);
|
|
145
|
+
// Pin and mute are per-user, so they live in preferences rather than on the
|
|
146
|
+
// agent — which is why this view never showed either. Best-effort read.
|
|
147
|
+
try {
|
|
148
|
+
const prefs = (await data_provider_1.dataService.getAgentPreferences(String(a.id ?? args.id)))?.preferences;
|
|
149
|
+
this.log(`Pinned: ${prefs?.isPinned ? 'yes' : 'no'}`);
|
|
150
|
+
this.log(`Muted: ${prefs?.isMuted ? 'yes' : 'no'}`);
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
/* preferences unreadable — omit rather than claim "no" */
|
|
154
|
+
}
|
|
142
155
|
this.log(`Category: ${a.category ?? '-'}`);
|
|
143
156
|
this.log(`Author: ${a.author ?? '-'}`);
|
|
144
157
|
// A cap the user cannot see is a cap they cannot diagnose: a saturated
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* Whether this account has credentials for one tool.
|
|
4
|
+
*
|
|
5
|
+
* Separate from the `AUTH` column in `agents tools` because that column reports
|
|
6
|
+
* what the catalog said in one batch read, and this asks the server about one
|
|
7
|
+
* tool now — which is the question worth asking after wiring up a key.
|
|
8
|
+
*/
|
|
9
|
+
export default class AgentsToolsAuth extends BaseCommand {
|
|
10
|
+
static description: string;
|
|
11
|
+
static examples: string[];
|
|
12
|
+
static args: {
|
|
13
|
+
toolId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
14
|
+
};
|
|
15
|
+
static flags: {
|
|
16
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
};
|
|
18
|
+
run(): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
|
+
const base_command_1 = require("../../../base-command");
|
|
6
|
+
/**
|
|
7
|
+
* Whether this account has credentials for one tool.
|
|
8
|
+
*
|
|
9
|
+
* Separate from the `AUTH` column in `agents tools` because that column reports
|
|
10
|
+
* what the catalog said in one batch read, and this asks the server about one
|
|
11
|
+
* tool now — which is the question worth asking after wiring up a key.
|
|
12
|
+
*/
|
|
13
|
+
class AgentsToolsAuth extends base_command_1.BaseCommand {
|
|
14
|
+
static description = 'Check whether this account is authenticated for one tool';
|
|
15
|
+
static examples = ['<%= config.bin %> agents tools auth <plugin-key>'];
|
|
16
|
+
static args = {
|
|
17
|
+
toolId: core_1.Args.string({ description: 'Plugin key', required: true, ignoreStdin: true }),
|
|
18
|
+
};
|
|
19
|
+
static flags = {
|
|
20
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
21
|
+
};
|
|
22
|
+
async run() {
|
|
23
|
+
this.requireAuth();
|
|
24
|
+
const { args, flags } = await this.parse(AgentsToolsAuth);
|
|
25
|
+
let result;
|
|
26
|
+
try {
|
|
27
|
+
result = await data_provider_1.dataService.getVerifyAgentToolAuth({ toolId: args.toolId });
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
this.handleApiError(err);
|
|
31
|
+
}
|
|
32
|
+
if (flags.json) {
|
|
33
|
+
this.log(JSON.stringify(result, null, 2));
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
this.log(result.authenticated
|
|
37
|
+
? `${args.toolId}: authenticated`
|
|
38
|
+
: `${args.toolId}: not authenticated${result.message ? ` — ${result.message}` : ''}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.default = AgentsToolsAuth;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
type ToolCallRow = {
|
|
3
|
+
messageId: string;
|
|
4
|
+
toolUseId: string;
|
|
5
|
+
name: string;
|
|
6
|
+
args: string;
|
|
7
|
+
output: string;
|
|
8
|
+
complete: boolean;
|
|
9
|
+
source: 'message' | 'ledger';
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The tool calls in a conversation, read from the conversation's own messages.
|
|
13
|
+
*
|
|
14
|
+
* This command read `GET /api/agents/tools/calls`, the `ToolCall` ledger — and
|
|
15
|
+
* nothing in the codebase writes that ledger: `createToolCall` has no caller. So
|
|
16
|
+
* it answered "No tool calls recorded" for EVERY conversation, including one where
|
|
17
|
+
* the agent had just run a Bash command, and for a conversation id that did not
|
|
18
|
+
* exist at all. Nobody could tell a broken command from an empty answer.
|
|
19
|
+
*
|
|
20
|
+
* Every agent turn records its tool calls as `tool_call` content parts on the
|
|
21
|
+
* assistant message (name, arguments, output), so that is the primary source. A
|
|
22
|
+
* conversation that does not exist is a NOT_FOUND, not an empty list. Ledger rows
|
|
23
|
+
* are still read and merged, so the endpoint stays reachable and a future writer
|
|
24
|
+
* is not silently ignored.
|
|
25
|
+
*/
|
|
26
|
+
export declare function toolCallsFromMessages(messages: unknown): ToolCallRow[];
|
|
27
|
+
export default class AgentsToolsCalls extends BaseCommand {
|
|
28
|
+
static description: string;
|
|
29
|
+
static examples: string[];
|
|
30
|
+
static flags: {
|
|
31
|
+
conversation: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
32
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
33
|
+
};
|
|
34
|
+
run(): Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toolCallsFromMessages = toolCallsFromMessages;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
6
|
+
const base_command_1 = require("../../../base-command");
|
|
7
|
+
const format_1 = require("../../../lib/format");
|
|
8
|
+
const clip = (value, width) => {
|
|
9
|
+
const text = value == null
|
|
10
|
+
? ''
|
|
11
|
+
: typeof value === 'string'
|
|
12
|
+
? value
|
|
13
|
+
: (JSON.stringify(value) ?? String(value));
|
|
14
|
+
const flat = text.replace(/\s+/g, ' ').trim();
|
|
15
|
+
return flat.length > width ? `${flat.slice(0, width - 1)}…` : flat;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The tool calls in a conversation, read from the conversation's own messages.
|
|
19
|
+
*
|
|
20
|
+
* This command read `GET /api/agents/tools/calls`, the `ToolCall` ledger — and
|
|
21
|
+
* nothing in the codebase writes that ledger: `createToolCall` has no caller. So
|
|
22
|
+
* it answered "No tool calls recorded" for EVERY conversation, including one where
|
|
23
|
+
* the agent had just run a Bash command, and for a conversation id that did not
|
|
24
|
+
* exist at all. Nobody could tell a broken command from an empty answer.
|
|
25
|
+
*
|
|
26
|
+
* Every agent turn records its tool calls as `tool_call` content parts on the
|
|
27
|
+
* assistant message (name, arguments, output), so that is the primary source. A
|
|
28
|
+
* conversation that does not exist is a NOT_FOUND, not an empty list. Ledger rows
|
|
29
|
+
* are still read and merged, so the endpoint stays reachable and a future writer
|
|
30
|
+
* is not silently ignored.
|
|
31
|
+
*/
|
|
32
|
+
function toolCallsFromMessages(messages) {
|
|
33
|
+
const rows = [];
|
|
34
|
+
for (const message of Array.isArray(messages) ? messages : []) {
|
|
35
|
+
const m = message;
|
|
36
|
+
for (const part of Array.isArray(m.content) ? m.content : []) {
|
|
37
|
+
const p = part;
|
|
38
|
+
if (p?.type !== 'tool_call' || !p.tool_call)
|
|
39
|
+
continue;
|
|
40
|
+
const call = p.tool_call;
|
|
41
|
+
rows.push({
|
|
42
|
+
messageId: String(m.messageId ?? '-'),
|
|
43
|
+
toolUseId: String(call.id ?? '-'),
|
|
44
|
+
name: String(call.name ?? '-'),
|
|
45
|
+
args: clip(call.args, 200),
|
|
46
|
+
output: clip(call.output, 200),
|
|
47
|
+
complete: Number(call.progress ?? 0) >= 1 || call.output != null,
|
|
48
|
+
source: 'message',
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return rows;
|
|
53
|
+
}
|
|
54
|
+
class AgentsToolsCalls extends base_command_1.BaseCommand {
|
|
55
|
+
static description = 'List the tool calls an agent made in one conversation';
|
|
56
|
+
static examples = [
|
|
57
|
+
'<%= config.bin %> agents tools calls --conversation <conversation-id>',
|
|
58
|
+
];
|
|
59
|
+
static flags = {
|
|
60
|
+
conversation: core_1.Flags.string({ description: 'Conversation ID', required: true }),
|
|
61
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
62
|
+
};
|
|
63
|
+
async run() {
|
|
64
|
+
this.requireAuth();
|
|
65
|
+
const { flags } = await this.parse(AgentsToolsCalls);
|
|
66
|
+
let messages;
|
|
67
|
+
try {
|
|
68
|
+
// NOT_FOUND here is the honest answer for a conversation that does not
|
|
69
|
+
// exist, and handleApiError reports it as such.
|
|
70
|
+
messages = await data_provider_1.dataService.getMessagesByConvoId(flags.conversation);
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
this.handleApiError(err);
|
|
74
|
+
}
|
|
75
|
+
const rows = toolCallsFromMessages(messages);
|
|
76
|
+
try {
|
|
77
|
+
const ledger = (await data_provider_1.dataService.getToolCalls({
|
|
78
|
+
conversationId: flags.conversation,
|
|
79
|
+
}));
|
|
80
|
+
for (const entry of ledger ?? []) {
|
|
81
|
+
rows.push({
|
|
82
|
+
messageId: String(entry.messageId ?? '-'),
|
|
83
|
+
toolUseId: String(entry.toolId ?? '-'),
|
|
84
|
+
name: String(entry.toolId ?? '-'),
|
|
85
|
+
args: '',
|
|
86
|
+
output: clip(entry.result, 200),
|
|
87
|
+
complete: true,
|
|
88
|
+
source: 'ledger',
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
/* the ledger is supplementary; the messages already answered */
|
|
94
|
+
}
|
|
95
|
+
if (flags.json) {
|
|
96
|
+
this.log(JSON.stringify(rows, null, 2));
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (rows.length === 0) {
|
|
100
|
+
const count = Array.isArray(messages) ? messages.length : 0;
|
|
101
|
+
this.log(`Conversation ${flags.conversation} has ${count} message${count === 1 ? '' : 's'} and no tool calls.`);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
(0, format_1.renderTable)(rows.map((row) => ({
|
|
105
|
+
name: row.name,
|
|
106
|
+
args: row.args || '-',
|
|
107
|
+
output: row.complete ? row.output || '(empty)' : '(no result recorded)',
|
|
108
|
+
toolUseId: row.toolUseId,
|
|
109
|
+
})), [
|
|
110
|
+
{ key: 'name', header: 'TOOL', maxWidth: 28 },
|
|
111
|
+
{ key: 'args', header: 'ARGUMENTS', maxWidth: 48 },
|
|
112
|
+
{ key: 'output', header: 'OUTPUT', maxWidth: 40 },
|
|
113
|
+
{ key: 'toolUseId', header: 'TOOL USE ID', verbatim: true },
|
|
114
|
+
], (line) => this.log(line));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exports.default = AgentsToolsCalls;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* The tool catalog `--tools` is chosen from.
|
|
4
|
+
*
|
|
5
|
+
* `agents create --tools '["..."]'` has always taken an array of plugin keys the
|
|
6
|
+
* caller had no way to enumerate — the web fills the same field from a picker
|
|
7
|
+
* backed by this endpoint, so the flag was only usable by someone reading the
|
|
8
|
+
* server's source or copying another agent's array.
|
|
9
|
+
*
|
|
10
|
+
* PLUGIN KEY is the column that matters: it is the string the field stores.
|
|
11
|
+
*/
|
|
12
|
+
export default class AgentsToolsList extends BaseCommand {
|
|
13
|
+
static description: string;
|
|
14
|
+
static examples: string[];
|
|
15
|
+
static flags: {
|
|
16
|
+
authenticated: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
18
|
+
};
|
|
19
|
+
run(): Promise<void>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
|
+
const base_command_1 = require("../../../base-command");
|
|
6
|
+
const format_1 = require("../../../lib/format");
|
|
7
|
+
/**
|
|
8
|
+
* The tool catalog `--tools` is chosen from.
|
|
9
|
+
*
|
|
10
|
+
* `agents create --tools '["..."]'` has always taken an array of plugin keys the
|
|
11
|
+
* caller had no way to enumerate — the web fills the same field from a picker
|
|
12
|
+
* backed by this endpoint, so the flag was only usable by someone reading the
|
|
13
|
+
* server's source or copying another agent's array.
|
|
14
|
+
*
|
|
15
|
+
* PLUGIN KEY is the column that matters: it is the string the field stores.
|
|
16
|
+
*/
|
|
17
|
+
class AgentsToolsList extends base_command_1.BaseCommand {
|
|
18
|
+
static description = 'List the tools `agents create/update --tools` accepts';
|
|
19
|
+
static examples = [
|
|
20
|
+
'<%= config.bin %> agents tools',
|
|
21
|
+
'<%= config.bin %> agents tools --authenticated',
|
|
22
|
+
'<%= config.bin %> agents tools --json',
|
|
23
|
+
];
|
|
24
|
+
static flags = {
|
|
25
|
+
authenticated: core_1.Flags.boolean({
|
|
26
|
+
description: 'Only tools this account has already authenticated',
|
|
27
|
+
}),
|
|
28
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
29
|
+
};
|
|
30
|
+
async run() {
|
|
31
|
+
this.requireAuth();
|
|
32
|
+
const { flags } = await this.parse(AgentsToolsList);
|
|
33
|
+
let tools;
|
|
34
|
+
try {
|
|
35
|
+
tools = await data_provider_1.dataService.getAvailableTools();
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
this.handleApiError(err);
|
|
39
|
+
}
|
|
40
|
+
const rows = flags.authenticated
|
|
41
|
+
? tools.filter((tool) => tool.authenticated === true)
|
|
42
|
+
: tools;
|
|
43
|
+
if (flags.json) {
|
|
44
|
+
this.log(JSON.stringify(rows, null, 2));
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (rows.length === 0) {
|
|
48
|
+
this.log(flags.authenticated ? 'No authenticated tools.' : 'No tools available.');
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Three states, not two. `authConfig` present means the tool needs
|
|
53
|
+
* credentials; `authenticated` says whether this account has supplied them.
|
|
54
|
+
* A tool that needs nothing is neither — printing "no" for it would send
|
|
55
|
+
* someone to configure a key that does not exist.
|
|
56
|
+
*/
|
|
57
|
+
const authState = (tool) => {
|
|
58
|
+
if (!tool.authConfig || tool.authConfig.length === 0)
|
|
59
|
+
return '-';
|
|
60
|
+
return tool.authenticated ? 'yes' : 'needed';
|
|
61
|
+
};
|
|
62
|
+
(0, format_1.renderTable)(rows.map((tool) => ({
|
|
63
|
+
pluginKey: tool.pluginKey,
|
|
64
|
+
name: tool.name,
|
|
65
|
+
auth: authState(tool),
|
|
66
|
+
description: String(tool.description ?? ''),
|
|
67
|
+
})), [
|
|
68
|
+
{ key: 'pluginKey', header: 'PLUGIN KEY', verbatim: true },
|
|
69
|
+
{ key: 'name', header: 'NAME', maxWidth: 28 },
|
|
70
|
+
{ key: 'auth', header: 'AUTH' },
|
|
71
|
+
{ key: 'description', header: 'DESCRIPTION', maxWidth: 52 },
|
|
72
|
+
], (line) => this.log(line));
|
|
73
|
+
this.log('');
|
|
74
|
+
this.log('PLUGIN KEY is what --tools stores, e.g. --tools \'["web_search"]\'.');
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.default = AgentsToolsList;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* Per-USER preference, not agent config: it changes your view of the agent and
|
|
4
|
+
* nobody else's. Idempotent over a toggle endpoint — see `lib/agent-pin-mute.ts`.
|
|
5
|
+
*/
|
|
6
|
+
export default class AgentsUnmute extends BaseCommand {
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static args: {
|
|
10
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
11
|
+
};
|
|
12
|
+
static flags: {
|
|
13
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../base-command");
|
|
5
|
+
const agent_pin_mute_1 = require("../../lib/agent-pin-mute");
|
|
6
|
+
/**
|
|
7
|
+
* Per-USER preference, not agent config: it changes your view of the agent and
|
|
8
|
+
* nobody else's. Idempotent over a toggle endpoint — see `lib/agent-pin-mute.ts`.
|
|
9
|
+
*/
|
|
10
|
+
class AgentsUnmute extends base_command_1.BaseCommand {
|
|
11
|
+
static description = "Un-silence an agent's notifications for you";
|
|
12
|
+
static examples = ['<%= config.bin %> agents unmute <agent-id>'];
|
|
13
|
+
static args = {
|
|
14
|
+
id: core_1.Args.string({ description: 'Agent ID', required: true, ignoreStdin: true }),
|
|
15
|
+
};
|
|
16
|
+
static flags = {
|
|
17
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
this.requireAuth();
|
|
21
|
+
const { args, flags } = await this.parse(AgentsUnmute);
|
|
22
|
+
let result;
|
|
23
|
+
try {
|
|
24
|
+
result = await (0, agent_pin_mute_1.setAgentFlag)(args.id, 'mute', false);
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
this.handleApiError(err);
|
|
28
|
+
}
|
|
29
|
+
if (flags.json) {
|
|
30
|
+
this.log(this.agentJson(args.id, { mute: result.value, changed: result.changed }));
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
this.log(result.changed
|
|
34
|
+
? `Agent ${args.id}: mute is now ${result.value}`
|
|
35
|
+
: `Agent ${args.id}: mute was already ${result.value} — nothing to do`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.default = AgentsUnmute;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* Per-USER preference, not agent config: it changes your view of the agent and
|
|
4
|
+
* nobody else's. Idempotent over a toggle endpoint — see `lib/agent-pin-mute.ts`.
|
|
5
|
+
*/
|
|
6
|
+
export default class AgentsUnpin extends BaseCommand {
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static args: {
|
|
10
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
11
|
+
};
|
|
12
|
+
static flags: {
|
|
13
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<void>;
|
|
16
|
+
}
|