@guildai/cli 0.10.0 → 0.12.0
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/auth-CRMO5O3N.js +29 -0
- package/dist/auth-CRMO5O3N.js.map +7 -0
- package/dist/chat-5VX2WJH2.js +303 -0
- package/dist/chat-5VX2WJH2.js.map +7 -0
- package/dist/chat-SIKDYZQK.js +31 -0
- package/dist/chat-SIKDYZQK.js.map +7 -0
- package/dist/chunk-56YCMGL3.js +522 -0
- package/dist/chunk-56YCMGL3.js.map +7 -0
- package/dist/chunk-6EX6E7WP.js +7042 -0
- package/dist/chunk-6EX6E7WP.js.map +7 -0
- package/dist/chunk-B7VAF5UG.js +532 -0
- package/dist/chunk-B7VAF5UG.js.map +7 -0
- package/dist/chunk-DOIYVBNY.js +3057 -0
- package/dist/chunk-DOIYVBNY.js.map +7 -0
- package/dist/chunk-ENKEEJ45.js +17 -0
- package/dist/chunk-ENKEEJ45.js.map +7 -0
- package/dist/chunk-IBRKVGMZ.js +97041 -0
- package/dist/chunk-IBRKVGMZ.js.map +7 -0
- package/dist/chunk-LFMQJOKC.js +19778 -0
- package/dist/chunk-LFMQJOKC.js.map +7 -0
- package/dist/chunk-M347HP6M.js +22896 -0
- package/dist/chunk-M347HP6M.js.map +7 -0
- package/dist/chunk-OYQ476FQ.js +44 -0
- package/dist/chunk-OYQ476FQ.js.map +7 -0
- package/dist/chunk-PNCUR4OB.js +257 -0
- package/dist/chunk-PNCUR4OB.js.map +7 -0
- package/dist/chunk-RIG2HZWM.js +317 -0
- package/dist/chunk-RIG2HZWM.js.map +7 -0
- package/dist/chunk-SPZPZXUN.js +826 -0
- package/dist/chunk-SPZPZXUN.js.map +7 -0
- package/dist/chunk-VVSOU6ON.js +53 -0
- package/dist/chunk-VVSOU6ON.js.map +7 -0
- package/dist/chunk-X3ADGWOF.js +3643 -0
- package/dist/chunk-X3ADGWOF.js.map +7 -0
- package/dist/commands/agent/logs.d.ts +3 -0
- package/dist/commands/setup.d.ts +16 -0
- package/dist/commands/skill/create.d.ts +3 -0
- package/dist/commands/skill/get.d.ts +3 -0
- package/dist/commands/skill/list.d.ts +3 -0
- package/dist/commands/skill/update.d.ts +3 -0
- package/dist/commands/skill/version/create.d.ts +3 -0
- package/dist/commands/skill/version/get.d.ts +3 -0
- package/dist/commands/skill/version/list.d.ts +3 -0
- package/dist/devtools-AO7YSDOD.js +67 -0
- package/dist/devtools-AO7YSDOD.js.map +7 -0
- package/dist/dist-4CBK6X5H.js +1566 -0
- package/dist/dist-4CBK6X5H.js.map +7 -0
- package/dist/esm-FRAVZP4J.js +13 -0
- package/dist/esm-FRAVZP4J.js.map +7 -0
- package/dist/execa-XQMWSABC.js +35 -0
- package/dist/execa-XQMWSABC.js.map +7 -0
- package/dist/index.js +8231 -253
- package/dist/index.js.map +7 -0
- package/dist/lib/api-types.d.ts +44 -0
- package/dist/lib/auth.d.ts +1 -1
- package/dist/lib/config.d.ts +9 -0
- package/dist/lib/errors.d.ts +1 -1
- package/dist/lib/output-mode.d.ts +9 -2
- package/dist/lib/output.d.ts +17 -1
- package/dist/lib/session-events.d.ts +14 -3
- package/dist/lib/session-polling.d.ts +24 -1
- package/dist/lib/session-resume.d.ts +15 -1
- package/dist/lib/stdin.d.ts +5 -1
- package/dist/lib/websocket-client.d.ts +46 -0
- package/dist/open-RF4X5MOP.js +13 -0
- package/dist/open-RF4X5MOP.js.map +7 -0
- package/dist/server-JYVH64FD.js +27659 -0
- package/dist/server-JYVH64FD.js.map +7 -0
- package/dist/test-SNIYRJ32.js +692 -0
- package/dist/test-SNIYRJ32.js.map +7 -0
- package/docs/skills/codex-agent-dev.md +2 -2
- package/package.json +8 -12
- package/dist/commands/agent/chat.js +0 -278
- package/dist/commands/agent/clone.js +0 -116
- package/dist/commands/agent/code.js +0 -87
- package/dist/commands/agent/fork.js +0 -218
- package/dist/commands/agent/get.js +0 -37
- package/dist/commands/agent/grep.js +0 -107
- package/dist/commands/agent/init.js +0 -390
- package/dist/commands/agent/list.js +0 -110
- package/dist/commands/agent/owners.js +0 -74
- package/dist/commands/agent/publish.js +0 -91
- package/dist/commands/agent/pull.js +0 -198
- package/dist/commands/agent/revalidate.js +0 -56
- package/dist/commands/agent/save.js +0 -346
- package/dist/commands/agent/search.js +0 -61
- package/dist/commands/agent/tags/add.js +0 -73
- package/dist/commands/agent/tags/list.js +0 -43
- package/dist/commands/agent/tags/remove.js +0 -84
- package/dist/commands/agent/tags/set.js +0 -71
- package/dist/commands/agent/test.js +0 -486
- package/dist/commands/agent/unpublish.js +0 -64
- package/dist/commands/agent/update.js +0 -110
- package/dist/commands/agent/versions.js +0 -55
- package/dist/commands/agent/workspaces.js +0 -54
- package/dist/commands/auth/login.js +0 -33
- package/dist/commands/auth/logout.js +0 -24
- package/dist/commands/auth/status.js +0 -38
- package/dist/commands/auth/token.js +0 -19
- package/dist/commands/chat.js +0 -1345
- package/dist/commands/config/get.js +0 -64
- package/dist/commands/config/list.js +0 -47
- package/dist/commands/config/path.js +0 -38
- package/dist/commands/config/set.js +0 -132
- package/dist/commands/credentials/endpoint-list.js +0 -88
- package/dist/commands/credentials/list.js +0 -50
- package/dist/commands/credentials/policy-create.js +0 -66
- package/dist/commands/credentials/policy-delete.js +0 -33
- package/dist/commands/credentials/policy-list.js +0 -45
- package/dist/commands/credentials/policy-update.js +0 -66
- package/dist/commands/doctor.js +0 -233
- package/dist/commands/integration/connect.js +0 -76
- package/dist/commands/integration/create.js +0 -298
- package/dist/commands/integration/get.js +0 -95
- package/dist/commands/integration/list.js +0 -62
- package/dist/commands/integration/operation/create.js +0 -164
- package/dist/commands/integration/operation/list.js +0 -92
- package/dist/commands/integration/update.js +0 -139
- package/dist/commands/integration/version/build.js +0 -86
- package/dist/commands/integration/version/create.js +0 -45
- package/dist/commands/integration/version/get.js +0 -72
- package/dist/commands/integration/version/list.js +0 -45
- package/dist/commands/integration/version/publish.js +0 -79
- package/dist/commands/integration/version/test.js +0 -104
- package/dist/commands/job/get-step.js +0 -40
- package/dist/commands/job/get.js +0 -44
- package/dist/commands/mcp.js +0 -34
- package/dist/commands/session/create.js +0 -59
- package/dist/commands/session/events.js +0 -56
- package/dist/commands/session/get.js +0 -33
- package/dist/commands/session/interrupt.js +0 -33
- package/dist/commands/session/list.js +0 -59
- package/dist/commands/session/send.js +0 -54
- package/dist/commands/session/tasks.js +0 -45
- package/dist/commands/setup.js +0 -230
- package/dist/commands/trigger/activate.js +0 -41
- package/dist/commands/trigger/create.js +0 -197
- package/dist/commands/trigger/deactivate.js +0 -41
- package/dist/commands/trigger/get.js +0 -33
- package/dist/commands/trigger/list.js +0 -57
- package/dist/commands/trigger/sessions.js +0 -48
- package/dist/commands/trigger/update.js +0 -128
- package/dist/commands/version.js +0 -24
- package/dist/commands/workspace/agent/add.js +0 -114
- package/dist/commands/workspace/agent/list.js +0 -78
- package/dist/commands/workspace/agent/remove.js +0 -78
- package/dist/commands/workspace/clear.js +0 -45
- package/dist/commands/workspace/context/edit.js +0 -107
- package/dist/commands/workspace/context/get.js +0 -47
- package/dist/commands/workspace/context/list.js +0 -51
- package/dist/commands/workspace/context/publish.js +0 -42
- package/dist/commands/workspace/create.js +0 -51
- package/dist/commands/workspace/current.js +0 -63
- package/dist/commands/workspace/get.js +0 -39
- package/dist/commands/workspace/list.js +0 -70
- package/dist/commands/workspace/select.js +0 -184
- package/dist/components/AgentInstallPrompt.js +0 -97
- package/dist/components/SplashAnimation.js +0 -321
- package/dist/components/TaskView.js +0 -268
- package/dist/lib/agent-helpers.js +0 -306
- package/dist/lib/alternate-screen.js +0 -59
- package/dist/lib/api-client.js +0 -154
- package/dist/lib/api-types.js +0 -10
- package/dist/lib/auth.js +0 -284
- package/dist/lib/braille-canvas.js +0 -321
- package/dist/lib/colors.js +0 -46
- package/dist/lib/config-cache.js +0 -45
- package/dist/lib/config.js +0 -153
- package/dist/lib/did-you-mean.js +0 -144
- package/dist/lib/errors.js +0 -375
- package/dist/lib/event-filter.js +0 -91
- package/dist/lib/generated-types.js +0 -56
- package/dist/lib/git.js +0 -176
- package/dist/lib/gk.js +0 -91
- package/dist/lib/guild-config.js +0 -178
- package/dist/lib/iap.js +0 -117
- package/dist/lib/integration-helpers.js +0 -38
- package/dist/lib/loading-messages.js +0 -72
- package/dist/lib/logo.js +0 -141
- package/dist/lib/lottie-serverside.js +0 -181
- package/dist/lib/markdown.js +0 -38
- package/dist/lib/npmrc.js +0 -59
- package/dist/lib/output-mode.js +0 -33
- package/dist/lib/output.js +0 -591
- package/dist/lib/owner-helpers.js +0 -112
- package/dist/lib/polling.js +0 -76
- package/dist/lib/progress.js +0 -324
- package/dist/lib/session-events-fetch.js +0 -25
- package/dist/lib/session-events.js +0 -112
- package/dist/lib/session-polling.js +0 -160
- package/dist/lib/session-resume.js +0 -96
- package/dist/lib/spinners.js +0 -770
- package/dist/lib/splash.js +0 -41
- package/dist/lib/stdin.js +0 -84
- package/dist/lib/svg-to-braille.js +0 -76
- package/dist/lib/table.js +0 -59
- package/dist/lib/update-check.js +0 -65
- package/dist/lib/validate-input-schema.js +0 -208
- package/dist/lib/version-helpers.js +0 -121
- package/dist/lib/workspace-helpers.js +0 -49
- package/dist/mcp/resources.js +0 -67
- package/dist/mcp/server.js +0 -64
- package/dist/mcp/tools.js +0 -753
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// Copyright 2026 Guild.ai
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { Command } from 'commander';
|
|
4
|
-
import { GuildAPIClient } from '../../../lib/api-client.js';
|
|
5
|
-
import { getAgentId, resolveAgentRef } from '../../../lib/agent-helpers.js';
|
|
6
|
-
import { handleAxiosError, ErrorCodes } from '../../../lib/errors.js';
|
|
7
|
-
import { createOutputWriter } from '../../../lib/output.js';
|
|
8
|
-
export function createAgentTagsAddCommand() {
|
|
9
|
-
const cmd = new Command('add');
|
|
10
|
-
cmd
|
|
11
|
-
.description('Add tags to an agent')
|
|
12
|
-
.argument('[agent-id]', 'Agent ID (optional if in agent directory)')
|
|
13
|
-
.argument('<tags...>', 'Tags to add')
|
|
14
|
-
.action(async (agentIdOrFirstTag, remainingTags) => {
|
|
15
|
-
const output = createOutputWriter();
|
|
16
|
-
try {
|
|
17
|
-
const client = new GuildAPIClient();
|
|
18
|
-
// Parse arguments - need to determine if first arg is agent-id or tag
|
|
19
|
-
let agentIdArg;
|
|
20
|
-
let tagsToAdd;
|
|
21
|
-
// Try to resolve agent ID from first argument
|
|
22
|
-
try {
|
|
23
|
-
await getAgentId(agentIdOrFirstTag);
|
|
24
|
-
// If successful, first arg was agent-id
|
|
25
|
-
agentIdArg = agentIdOrFirstTag;
|
|
26
|
-
tagsToAdd = remainingTags;
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
// First arg is not agent-id, must be a tag
|
|
30
|
-
// Try to get agent-id from guild.json
|
|
31
|
-
await getAgentId(undefined);
|
|
32
|
-
agentIdArg = undefined;
|
|
33
|
-
tagsToAdd = [agentIdOrFirstTag, ...remainingTags];
|
|
34
|
-
}
|
|
35
|
-
// Now resolve agent ID properly
|
|
36
|
-
const { agentId, config } = await getAgentId(agentIdArg);
|
|
37
|
-
const resolvedId = await resolveAgentRef(client, agentId);
|
|
38
|
-
if (tagsToAdd.length === 0) {
|
|
39
|
-
output.error('At least one tag is required.', 'Usage: guild agent tags add [agent-id] <tag...>');
|
|
40
|
-
process.exit(1);
|
|
41
|
-
}
|
|
42
|
-
// Fetch current tags
|
|
43
|
-
const response = await client.get(`/agents/${resolvedId}/tags`);
|
|
44
|
-
const currentTags = response.names;
|
|
45
|
-
// Add new tags (deduplicate)
|
|
46
|
-
const updatedTags = Array.from(new Set([...currentTags, ...tagsToAdd]));
|
|
47
|
-
// Update tags
|
|
48
|
-
await client.post(`/agents/${resolvedId}/tags`, { names: updatedTags });
|
|
49
|
-
const agentName = config?.name || `agent ${agentId}`;
|
|
50
|
-
const label = `${agentName}${config ? '' : ` (${agentId})`}`;
|
|
51
|
-
output.success(`Updated tags for agent: ${label}`);
|
|
52
|
-
output.data({ names: updatedTags });
|
|
53
|
-
}
|
|
54
|
-
catch (error) {
|
|
55
|
-
const formattedError = handleAxiosError(error);
|
|
56
|
-
if (formattedError.code === ErrorCodes.AUTH_REQUIRED) {
|
|
57
|
-
output.error('Not authenticated.', 'Run: guild auth login');
|
|
58
|
-
}
|
|
59
|
-
else if (formattedError.code === ErrorCodes.NOT_FOUND) {
|
|
60
|
-
output.error('Agent not found.', 'Run: guild agent list');
|
|
61
|
-
}
|
|
62
|
-
else if (formattedError.code === ErrorCodes.CONN_REFUSED) {
|
|
63
|
-
output.error('Cannot connect to Guild servers');
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
output.error(`Failed to add tags: ${formattedError.details}`);
|
|
67
|
-
}
|
|
68
|
-
process.exit(1);
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
return cmd;
|
|
72
|
-
}
|
|
73
|
-
//# sourceMappingURL=add.js.map
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// Copyright 2026 Guild.ai
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { Command } from 'commander';
|
|
4
|
-
import { GuildAPIClient } from '../../../lib/api-client.js';
|
|
5
|
-
import { getAgentId, resolveAgentRef } from '../../../lib/agent-helpers.js';
|
|
6
|
-
import { handleAxiosError, ErrorCodes } from '../../../lib/errors.js';
|
|
7
|
-
import { createOutputWriter } from '../../../lib/output.js';
|
|
8
|
-
export function createAgentTagsListCommand() {
|
|
9
|
-
const cmd = new Command('list');
|
|
10
|
-
cmd
|
|
11
|
-
.description('List tags for an agent')
|
|
12
|
-
.argument('[agent-id]', 'Agent ID (optional if in agent directory)')
|
|
13
|
-
.action(async (agentIdArg) => {
|
|
14
|
-
const output = createOutputWriter();
|
|
15
|
-
try {
|
|
16
|
-
const client = new GuildAPIClient();
|
|
17
|
-
// Resolve agent ID
|
|
18
|
-
const { agentId } = await getAgentId(agentIdArg);
|
|
19
|
-
const resolvedId = await resolveAgentRef(client, agentId);
|
|
20
|
-
// Fetch tags
|
|
21
|
-
const response = await client.get(`/agents/${resolvedId}/tags`);
|
|
22
|
-
output.data(response);
|
|
23
|
-
}
|
|
24
|
-
catch (error) {
|
|
25
|
-
const formattedError = handleAxiosError(error);
|
|
26
|
-
if (formattedError.code === ErrorCodes.AUTH_REQUIRED) {
|
|
27
|
-
output.error('Not authenticated.', 'Run: guild auth login');
|
|
28
|
-
}
|
|
29
|
-
else if (formattedError.code === ErrorCodes.NOT_FOUND) {
|
|
30
|
-
output.error('Agent not found.', 'Run: guild agent list');
|
|
31
|
-
}
|
|
32
|
-
else if (formattedError.code === ErrorCodes.CONN_REFUSED) {
|
|
33
|
-
output.error('Cannot connect to Guild servers');
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
output.error(`Failed to fetch tags: ${formattedError.details}`);
|
|
37
|
-
}
|
|
38
|
-
process.exit(1);
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
return cmd;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=list.js.map
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
// Copyright 2026 Guild.ai
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { Command } from 'commander';
|
|
4
|
-
import { GuildAPIClient } from '../../../lib/api-client.js';
|
|
5
|
-
import { getAgentId, resolveAgentRef } from '../../../lib/agent-helpers.js';
|
|
6
|
-
import { handleAxiosError, ErrorCodes } from '../../../lib/errors.js';
|
|
7
|
-
import { createOutputWriter } from '../../../lib/output.js';
|
|
8
|
-
export function createAgentTagsRemoveCommand() {
|
|
9
|
-
const cmd = new Command('remove');
|
|
10
|
-
cmd
|
|
11
|
-
.description('Remove tags from an agent')
|
|
12
|
-
.argument('[agent-id]', 'Agent ID (optional if in agent directory)')
|
|
13
|
-
.argument('<tags...>', 'Tags to remove')
|
|
14
|
-
.action(async (agentIdOrFirstTag, remainingTags) => {
|
|
15
|
-
const output = createOutputWriter();
|
|
16
|
-
try {
|
|
17
|
-
const client = new GuildAPIClient();
|
|
18
|
-
// Parse arguments - need to determine if first arg is agent-id or tag
|
|
19
|
-
let agentIdArg;
|
|
20
|
-
let tagsToRemove;
|
|
21
|
-
// Try to resolve agent ID from first argument
|
|
22
|
-
try {
|
|
23
|
-
await getAgentId(agentIdOrFirstTag);
|
|
24
|
-
// If successful, first arg was agent-id
|
|
25
|
-
agentIdArg = agentIdOrFirstTag;
|
|
26
|
-
tagsToRemove = remainingTags;
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
// First arg is not agent-id, must be a tag
|
|
30
|
-
// Try to get agent-id from guild.json
|
|
31
|
-
await getAgentId(undefined);
|
|
32
|
-
agentIdArg = undefined;
|
|
33
|
-
tagsToRemove = [agentIdOrFirstTag, ...remainingTags];
|
|
34
|
-
}
|
|
35
|
-
// Now resolve agent ID properly
|
|
36
|
-
const { agentId, config } = await getAgentId(agentIdArg);
|
|
37
|
-
const resolvedId = await resolveAgentRef(client, agentId);
|
|
38
|
-
if (tagsToRemove.length === 0) {
|
|
39
|
-
output.error('At least one tag is required.', 'Usage: guild agent tags remove [agent-id] <tag...>');
|
|
40
|
-
process.exit(1);
|
|
41
|
-
}
|
|
42
|
-
// Fetch current tags
|
|
43
|
-
const response = await client.get(`/agents/${resolvedId}/tags`);
|
|
44
|
-
const currentTags = response.names;
|
|
45
|
-
// Remove specified tags
|
|
46
|
-
const updatedTags = currentTags.filter((tag) => !tagsToRemove.includes(tag));
|
|
47
|
-
// Track which tags were not present
|
|
48
|
-
const notPresentTags = tagsToRemove.filter((tag) => !currentTags.includes(tag));
|
|
49
|
-
// Update tags
|
|
50
|
-
await client.post(`/agents/${resolvedId}/tags`, { names: updatedTags });
|
|
51
|
-
const agentName = config?.name || `agent ${agentId}`;
|
|
52
|
-
const label = `${agentName}${config ? '' : ` (${agentId})`}`;
|
|
53
|
-
output.success(`Updated tags for agent: ${label}`);
|
|
54
|
-
output.data({ names: updatedTags });
|
|
55
|
-
// Show warning for tags that weren't present
|
|
56
|
-
if (notPresentTags.length > 0) {
|
|
57
|
-
if (notPresentTags.length === 1) {
|
|
58
|
-
output.progress(`Note: Tag '${notPresentTags[0]}' was not present`);
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
output.progress(`Note: Tags not present: ${notPresentTags.map((t) => `'${t}'`).join(', ')}`);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
catch (error) {
|
|
66
|
-
const formattedError = handleAxiosError(error);
|
|
67
|
-
if (formattedError.code === ErrorCodes.AUTH_REQUIRED) {
|
|
68
|
-
output.error('Not authenticated.', 'Run: guild auth login');
|
|
69
|
-
}
|
|
70
|
-
else if (formattedError.code === ErrorCodes.NOT_FOUND) {
|
|
71
|
-
output.error('Agent not found.', 'Run: guild agent list');
|
|
72
|
-
}
|
|
73
|
-
else if (formattedError.code === ErrorCodes.CONN_REFUSED) {
|
|
74
|
-
output.error('Cannot connect to Guild servers');
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
output.error(`Failed to remove tags: ${formattedError.details}`);
|
|
78
|
-
}
|
|
79
|
-
process.exit(1);
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
return cmd;
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=remove.js.map
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
// Copyright 2026 Guild.ai
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { Command } from 'commander';
|
|
4
|
-
import { GuildAPIClient } from '../../../lib/api-client.js';
|
|
5
|
-
import { getAgentId, resolveAgentRef } from '../../../lib/agent-helpers.js';
|
|
6
|
-
import { handleAxiosError, ErrorCodes } from '../../../lib/errors.js';
|
|
7
|
-
import { createOutputWriter } from '../../../lib/output.js';
|
|
8
|
-
export function createAgentTagsSetCommand() {
|
|
9
|
-
const cmd = new Command('set');
|
|
10
|
-
cmd
|
|
11
|
-
.description('Set tags for an agent (replaces all existing tags)')
|
|
12
|
-
.argument('[agent-id]', 'Agent ID (optional if in agent directory)')
|
|
13
|
-
.argument('[tags...]', 'Tags to set (omit to clear all tags)')
|
|
14
|
-
.action(async (agentIdOrFirstTag, remainingTags) => {
|
|
15
|
-
const output = createOutputWriter();
|
|
16
|
-
try {
|
|
17
|
-
const client = new GuildAPIClient();
|
|
18
|
-
// Parse arguments - need to determine if first arg is agent-id or tag
|
|
19
|
-
let agentIdArg;
|
|
20
|
-
let tagsToSet;
|
|
21
|
-
// Try to resolve agent ID from first argument
|
|
22
|
-
try {
|
|
23
|
-
await getAgentId(agentIdOrFirstTag);
|
|
24
|
-
// If successful, first arg was agent-id
|
|
25
|
-
agentIdArg = agentIdOrFirstTag;
|
|
26
|
-
tagsToSet = remainingTags;
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
// First arg is not agent-id, must be a tag (or undefined for clearing)
|
|
30
|
-
// Try to get agent-id from guild.json
|
|
31
|
-
await getAgentId(undefined);
|
|
32
|
-
agentIdArg = undefined;
|
|
33
|
-
tagsToSet = agentIdOrFirstTag
|
|
34
|
-
? [agentIdOrFirstTag, ...remainingTags]
|
|
35
|
-
: [];
|
|
36
|
-
}
|
|
37
|
-
// Now resolve agent ID properly
|
|
38
|
-
const { agentId, config } = await getAgentId(agentIdArg);
|
|
39
|
-
const resolvedId = await resolveAgentRef(client, agentId);
|
|
40
|
-
// Update tags (direct replacement)
|
|
41
|
-
await client.post(`/agents/${resolvedId}/tags`, { names: tagsToSet });
|
|
42
|
-
const agentName = config?.name || `agent ${agentId}`;
|
|
43
|
-
const label = `${agentName}${config ? '' : ` (${agentId})`}`;
|
|
44
|
-
if (tagsToSet.length === 0) {
|
|
45
|
-
output.success(`Cleared all tags for agent: ${label}`);
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
output.success(`Updated tags for agent: ${label}`);
|
|
49
|
-
}
|
|
50
|
-
output.data({ names: tagsToSet });
|
|
51
|
-
}
|
|
52
|
-
catch (error) {
|
|
53
|
-
const formattedError = handleAxiosError(error);
|
|
54
|
-
if (formattedError.code === ErrorCodes.AUTH_REQUIRED) {
|
|
55
|
-
output.error('Not authenticated.', 'Run: guild auth login');
|
|
56
|
-
}
|
|
57
|
-
else if (formattedError.code === ErrorCodes.NOT_FOUND) {
|
|
58
|
-
output.error('Agent not found.', 'Run: guild agent list');
|
|
59
|
-
}
|
|
60
|
-
else if (formattedError.code === ErrorCodes.CONN_REFUSED) {
|
|
61
|
-
output.error('Cannot connect to Guild servers');
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
output.error(`Failed to set tags: ${formattedError.details}`);
|
|
65
|
-
}
|
|
66
|
-
process.exit(1);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
return cmd;
|
|
70
|
-
}
|
|
71
|
-
//# sourceMappingURL=set.js.map
|