@guildai/cli 0.11.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/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 +8230 -263
- package/dist/index.js.map +7 -0
- package/dist/lib/api-types.d.ts +44 -0
- package/dist/lib/config.d.ts +9 -0
- package/dist/lib/errors.d.ts +1 -1
- package/dist/lib/output.d.ts +11 -1
- package/dist/lib/session-events.d.ts +1 -1
- package/dist/lib/session-polling.d.ts +24 -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 -281
- package/dist/commands/agent/clone.js +0 -118
- package/dist/commands/agent/code.js +0 -87
- package/dist/commands/agent/fork.js +0 -220
- package/dist/commands/agent/get.js +0 -37
- package/dist/commands/agent/grep.js +0 -107
- package/dist/commands/agent/init.js +0 -403
- package/dist/commands/agent/list.js +0 -110
- package/dist/commands/agent/logs.js +0 -62
- package/dist/commands/agent/owners.js +0 -74
- package/dist/commands/agent/publish.js +0 -91
- package/dist/commands/agent/pull.js +0 -194
- package/dist/commands/agent/revalidate.js +0 -56
- package/dist/commands/agent/save.js +0 -345
- 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 -489
- package/dist/commands/agent/unpublish.js +0 -64
- package/dist/commands/agent/update.js +0 -118
- package/dist/commands/agent/versions.js +0 -55
- package/dist/commands/agent/workspaces.js +0 -54
- package/dist/commands/auth/login.js +0 -31
- 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 -1416
- package/dist/commands/config/get.js +0 -64
- package/dist/commands/config/list.js +0 -46
- package/dist/commands/config/path.js +0 -37
- 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 -260
- 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 -54
- package/dist/lib/output.js +0 -622
- 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 -126
- package/dist/lib/session-polling.js +0 -166
- package/dist/lib/session-resume.js +0 -229
- package/dist/lib/spinners.js +0 -770
- package/dist/lib/splash.js +0 -42
- package/dist/lib/stdin.js +0 -91
- 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 -137
- 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,41 +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 { getAuthToken } from '../../lib/auth.js';
|
|
6
|
-
import { handleAxiosError, ErrorCodes } from '../../lib/errors.js';
|
|
7
|
-
import { createOutputWriter } from '../../lib/output.js';
|
|
8
|
-
export function createTriggerDeactivateCommand() {
|
|
9
|
-
const cmd = new Command('deactivate');
|
|
10
|
-
cmd
|
|
11
|
-
.description('Deactivate a trigger')
|
|
12
|
-
.argument('<trigger-id>', 'Trigger ID')
|
|
13
|
-
.action(async (triggerId) => {
|
|
14
|
-
const output = createOutputWriter();
|
|
15
|
-
try {
|
|
16
|
-
const token = await getAuthToken();
|
|
17
|
-
if (!token) {
|
|
18
|
-
output.error('Not authenticated. Run: guild auth login');
|
|
19
|
-
process.exit(1);
|
|
20
|
-
}
|
|
21
|
-
const client = new GuildAPIClient();
|
|
22
|
-
const response = await client.post(`/triggers/${triggerId}/deactivate`, {});
|
|
23
|
-
output.data(response);
|
|
24
|
-
}
|
|
25
|
-
catch (error) {
|
|
26
|
-
const formattedError = handleAxiosError(error);
|
|
27
|
-
if (formattedError.code === ErrorCodes.AUTH_REQUIRED) {
|
|
28
|
-
output.error('Not authenticated. Run: guild auth login');
|
|
29
|
-
process.exit(1);
|
|
30
|
-
}
|
|
31
|
-
if (formattedError.code === ErrorCodes.NOT_FOUND) {
|
|
32
|
-
output.error('Trigger not found.');
|
|
33
|
-
process.exit(1);
|
|
34
|
-
}
|
|
35
|
-
output.error(formattedError.details);
|
|
36
|
-
process.exit(1);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
return cmd;
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=deactivate.js.map
|
|
@@ -1,33 +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 { getAuthToken } from '../../lib/auth.js';
|
|
6
|
-
import { handleAxiosError } from '../../lib/errors.js';
|
|
7
|
-
import { createOutputWriter } from '../../lib/output.js';
|
|
8
|
-
export function createTriggerGetCommand() {
|
|
9
|
-
const cmd = new Command('get');
|
|
10
|
-
cmd
|
|
11
|
-
.description('Get trigger details')
|
|
12
|
-
.argument('<trigger-id>', 'Trigger ID')
|
|
13
|
-
.action(async (triggerId) => {
|
|
14
|
-
const output = createOutputWriter();
|
|
15
|
-
try {
|
|
16
|
-
const token = await getAuthToken();
|
|
17
|
-
if (!token) {
|
|
18
|
-
output.error('Not authenticated. Run: guild auth login');
|
|
19
|
-
process.exit(1);
|
|
20
|
-
}
|
|
21
|
-
const client = new GuildAPIClient();
|
|
22
|
-
const response = await client.get(`/triggers/${triggerId}`);
|
|
23
|
-
output.data(response);
|
|
24
|
-
}
|
|
25
|
-
catch (error) {
|
|
26
|
-
const formattedError = handleAxiosError(error);
|
|
27
|
-
output.error(formattedError.details);
|
|
28
|
-
process.exit(1);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
return cmd;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=get.js.map
|
|
@@ -1,57 +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 { getAuthToken } from '../../lib/auth.js';
|
|
6
|
-
import { getWorkspaceId } from '../../lib/guild-config.js';
|
|
7
|
-
import { handleAxiosError } from '../../lib/errors.js';
|
|
8
|
-
import { isMachineReadable } from '../../lib/output-mode.js';
|
|
9
|
-
import { createOutputWriter, formatTriggerTable } from '../../lib/output.js';
|
|
10
|
-
import { DEFAULT_PAGE_LIMIT } from '../../lib/api-types.js';
|
|
11
|
-
export function createTriggerListCommand() {
|
|
12
|
-
const cmd = new Command('list');
|
|
13
|
-
cmd
|
|
14
|
-
.description('List all triggers in a workspace')
|
|
15
|
-
.option('--workspace <id>', 'Workspace ID or name')
|
|
16
|
-
.option('--limit <number>', `Number of results to return (default: ${DEFAULT_PAGE_LIMIT})`, String(DEFAULT_PAGE_LIMIT))
|
|
17
|
-
.option('--offset <number>', 'Offset for pagination (default: 0)', '0')
|
|
18
|
-
.action(async (options) => {
|
|
19
|
-
const output = createOutputWriter();
|
|
20
|
-
try {
|
|
21
|
-
const token = await getAuthToken();
|
|
22
|
-
if (!token) {
|
|
23
|
-
output.error('Not authenticated. Run: guild auth login');
|
|
24
|
-
process.exit(1);
|
|
25
|
-
}
|
|
26
|
-
// Resolve workspace
|
|
27
|
-
let workspaceId = options.workspace;
|
|
28
|
-
if (!workspaceId) {
|
|
29
|
-
const resolved = await getWorkspaceId();
|
|
30
|
-
if (!resolved) {
|
|
31
|
-
output.error('No workspace specified. Run: guild workspace select');
|
|
32
|
-
process.exit(1);
|
|
33
|
-
}
|
|
34
|
-
workspaceId = resolved.workspaceId;
|
|
35
|
-
}
|
|
36
|
-
const client = new GuildAPIClient();
|
|
37
|
-
// Build query parameters
|
|
38
|
-
const params = new URLSearchParams();
|
|
39
|
-
params.append('limit', options.limit);
|
|
40
|
-
params.append('offset', options.offset);
|
|
41
|
-
const response = await client.get(`/workspaces/${workspaceId}/triggers?${params.toString()}`);
|
|
42
|
-
if (isMachineReadable()) {
|
|
43
|
-
console.log(JSON.stringify(response, null, 2));
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
formatTriggerTable(response.items, response.pagination);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
const formattedError = handleAxiosError(error);
|
|
51
|
-
output.error(formattedError.details);
|
|
52
|
-
process.exit(1);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
return cmd;
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=list.js.map
|
|
@@ -1,48 +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 { getAuthToken } from '../../lib/auth.js';
|
|
6
|
-
import { handleAxiosError, ErrorCodes } from '../../lib/errors.js';
|
|
7
|
-
import { createOutputWriter } from '../../lib/output.js';
|
|
8
|
-
import { DEFAULT_PAGE_LIMIT } from '../../lib/api-types.js';
|
|
9
|
-
export function createTriggerSessionsCommand() {
|
|
10
|
-
const cmd = new Command('sessions');
|
|
11
|
-
cmd
|
|
12
|
-
.description('List sessions spawned by a trigger')
|
|
13
|
-
.argument('<trigger-id>', 'Trigger ID')
|
|
14
|
-
.option('--limit <number>', `Number of results to return (default: ${DEFAULT_PAGE_LIMIT})`, String(DEFAULT_PAGE_LIMIT))
|
|
15
|
-
.option('--offset <number>', 'Offset for pagination (default: 0)', '0')
|
|
16
|
-
.action(async (triggerId, options) => {
|
|
17
|
-
const output = createOutputWriter();
|
|
18
|
-
try {
|
|
19
|
-
const token = await getAuthToken();
|
|
20
|
-
if (!token) {
|
|
21
|
-
output.error('Not authenticated. Run: guild auth login');
|
|
22
|
-
process.exit(1);
|
|
23
|
-
}
|
|
24
|
-
const client = new GuildAPIClient();
|
|
25
|
-
// Build query parameters
|
|
26
|
-
const params = new URLSearchParams();
|
|
27
|
-
params.append('limit', options.limit);
|
|
28
|
-
params.append('offset', options.offset);
|
|
29
|
-
const response = await client.get(`/triggers/${triggerId}/sessions?${params.toString()}`);
|
|
30
|
-
output.data(response);
|
|
31
|
-
}
|
|
32
|
-
catch (error) {
|
|
33
|
-
const formattedError = handleAxiosError(error);
|
|
34
|
-
if (formattedError.code === ErrorCodes.AUTH_REQUIRED) {
|
|
35
|
-
output.error('Not authenticated. Run: guild auth login');
|
|
36
|
-
process.exit(1);
|
|
37
|
-
}
|
|
38
|
-
if (formattedError.code === ErrorCodes.NOT_FOUND) {
|
|
39
|
-
output.error('Trigger not found.');
|
|
40
|
-
process.exit(1);
|
|
41
|
-
}
|
|
42
|
-
output.error(formattedError.details);
|
|
43
|
-
process.exit(1);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
return cmd;
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=sessions.js.map
|
|
@@ -1,128 +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 { getAuthToken } from '../../lib/auth.js';
|
|
6
|
-
import { handleAxiosError, ErrorCodes } from '../../lib/errors.js';
|
|
7
|
-
import { createOutputWriter } from '../../lib/output.js';
|
|
8
|
-
import { TIME_TRIGGER_FREQUENCIES, } from '../../lib/api-types.js';
|
|
9
|
-
export function createTriggerUpdateCommand() {
|
|
10
|
-
const cmd = new Command('update');
|
|
11
|
-
cmd
|
|
12
|
-
.description('Update a trigger')
|
|
13
|
-
.argument('<trigger-id>', 'Trigger ID')
|
|
14
|
-
// Webhook options
|
|
15
|
-
.option('--event <event>', 'Event type (for webhook triggers)')
|
|
16
|
-
.option('--action <action>', 'Event action (for webhook triggers)')
|
|
17
|
-
.option('--service-config <json>', 'Service-specific config as JSON (for webhook triggers)')
|
|
18
|
-
// Time options
|
|
19
|
-
.option('--frequency <freq>', 'Frequency: HOURLY, DAILY, WEEKLY, MONTHLY, CRON (for time triggers)')
|
|
20
|
-
.option('--time <time>', 'Time of day in HH:MM format (for time triggers)')
|
|
21
|
-
.option('--days-of-week <days>', 'Days of week, comma-separated (for time triggers)')
|
|
22
|
-
.option('--days-of-month <days>', 'Days of month, comma-separated (for time triggers)')
|
|
23
|
-
.option('--minutes-of-hour <minutes>', 'Minutes of hour, comma-separated (0-59, for HOURLY triggers)')
|
|
24
|
-
.option('--cron-expression <expression>', '5-field cron expression (for CRON triggers)')
|
|
25
|
-
.option('--cron-timezone <timezone>', 'IANA timezone for --cron-expression (default: UTC)')
|
|
26
|
-
.option('--input <json>', 'Agent input as JSON object (for time triggers)')
|
|
27
|
-
.action(async (triggerId, options) => {
|
|
28
|
-
const output = createOutputWriter();
|
|
29
|
-
try {
|
|
30
|
-
const token = await getAuthToken();
|
|
31
|
-
if (!token) {
|
|
32
|
-
output.error('Not authenticated. Run: guild auth login');
|
|
33
|
-
process.exit(1);
|
|
34
|
-
}
|
|
35
|
-
const client = new GuildAPIClient();
|
|
36
|
-
// Build request body with only provided options
|
|
37
|
-
const body = {};
|
|
38
|
-
// Webhook options
|
|
39
|
-
if (options.event !== undefined) {
|
|
40
|
-
body.event_type = options.event;
|
|
41
|
-
}
|
|
42
|
-
if (options.action !== undefined) {
|
|
43
|
-
body.action = options.action;
|
|
44
|
-
}
|
|
45
|
-
if (options.serviceConfig !== undefined) {
|
|
46
|
-
try {
|
|
47
|
-
body.service_config = JSON.parse(options.serviceConfig);
|
|
48
|
-
}
|
|
49
|
-
catch {
|
|
50
|
-
output.error('--service-config must be valid JSON');
|
|
51
|
-
process.exit(1);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
// Time options
|
|
55
|
-
let frequency;
|
|
56
|
-
if (options.frequency !== undefined) {
|
|
57
|
-
frequency = options.frequency.toUpperCase();
|
|
58
|
-
if (!TIME_TRIGGER_FREQUENCIES.includes(frequency)) {
|
|
59
|
-
output.error(`Invalid frequency "${options.frequency}". Valid: ${TIME_TRIGGER_FREQUENCIES.join(', ')}`);
|
|
60
|
-
process.exit(1);
|
|
61
|
-
}
|
|
62
|
-
body.frequency = frequency;
|
|
63
|
-
}
|
|
64
|
-
// Validate options match the frequency (when frequency is being set)
|
|
65
|
-
if (frequency) {
|
|
66
|
-
const frequencyOptions = {
|
|
67
|
-
HOURLY: new Set(['minutesOfHour']),
|
|
68
|
-
DAILY: new Set(['time']),
|
|
69
|
-
WEEKLY: new Set(['time', 'daysOfWeek']),
|
|
70
|
-
MONTHLY: new Set(['time', 'daysOfMonth']),
|
|
71
|
-
CRON: new Set(['cronExpression', 'cronTimezone']),
|
|
72
|
-
};
|
|
73
|
-
const allOptions = new Set(Object.values(frequencyOptions).flatMap((s) => [...s]));
|
|
74
|
-
const allowed = frequencyOptions[frequency] ?? new Set();
|
|
75
|
-
const invalid = [...allOptions]
|
|
76
|
-
.filter((opt) => !allowed.has(opt) &&
|
|
77
|
-
options[opt] !== undefined)
|
|
78
|
-
.map((opt) => '--' + opt.replace(/[A-Z]/g, (c) => '-' + c.toLowerCase()));
|
|
79
|
-
if (invalid.length > 0) {
|
|
80
|
-
output.error(`${invalid.join(', ')} cannot be used with ${frequency} frequency`);
|
|
81
|
-
process.exit(1);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
if (options.time !== undefined)
|
|
85
|
-
body.time_of_day = options.time;
|
|
86
|
-
if (options.daysOfWeek !== undefined)
|
|
87
|
-
body.days_of_week = options.daysOfWeek;
|
|
88
|
-
if (options.daysOfMonth !== undefined)
|
|
89
|
-
body.days_of_month = options.daysOfMonth;
|
|
90
|
-
if (options.minutesOfHour !== undefined)
|
|
91
|
-
body.minutes_of_hour = options.minutesOfHour;
|
|
92
|
-
if (options.cronExpression !== undefined)
|
|
93
|
-
body.cron_expression = options.cronExpression;
|
|
94
|
-
if (options.cronTimezone !== undefined)
|
|
95
|
-
body.cron_timezone = options.cronTimezone;
|
|
96
|
-
if (options.input !== undefined) {
|
|
97
|
-
try {
|
|
98
|
-
body.agent_input = JSON.parse(options.input);
|
|
99
|
-
}
|
|
100
|
-
catch {
|
|
101
|
-
output.error('--input must be valid JSON');
|
|
102
|
-
process.exit(1);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
if (Object.keys(body).length === 0) {
|
|
106
|
-
output.error('No update options provided. Run: guild trigger update --help');
|
|
107
|
-
process.exit(1);
|
|
108
|
-
}
|
|
109
|
-
const response = await client.patch(`/triggers/${triggerId}`, body);
|
|
110
|
-
output.data(response);
|
|
111
|
-
}
|
|
112
|
-
catch (error) {
|
|
113
|
-
const formattedError = handleAxiosError(error);
|
|
114
|
-
if (formattedError.code === ErrorCodes.AUTH_REQUIRED) {
|
|
115
|
-
output.error('Not authenticated. Run: guild auth login');
|
|
116
|
-
process.exit(1);
|
|
117
|
-
}
|
|
118
|
-
if (formattedError.code === ErrorCodes.NOT_FOUND) {
|
|
119
|
-
output.error('Trigger not found.');
|
|
120
|
-
process.exit(1);
|
|
121
|
-
}
|
|
122
|
-
output.error(formattedError.details);
|
|
123
|
-
process.exit(1);
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
return cmd;
|
|
127
|
-
}
|
|
128
|
-
//# sourceMappingURL=update.js.map
|
package/dist/commands/version.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// Copyright 2026 Guild.ai
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { Command } from 'commander';
|
|
4
|
-
import { readFileSync } from 'fs';
|
|
5
|
-
import path from 'path';
|
|
6
|
-
import { fileURLToPath } from 'url';
|
|
7
|
-
import { createOutputWriter } from '../lib/output.js';
|
|
8
|
-
// ESM equivalent of __dirname
|
|
9
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
-
const __dirname = path.dirname(__filename);
|
|
11
|
-
export function createVersionCommand() {
|
|
12
|
-
const cmd = new Command('version');
|
|
13
|
-
cmd.description('Show Guild CLI version').action(() => {
|
|
14
|
-
const output = createOutputWriter();
|
|
15
|
-
const packageJson = JSON.parse(readFileSync(path.join(__dirname, '../../package.json'), 'utf-8'));
|
|
16
|
-
output.data({
|
|
17
|
-
name: 'Guild CLI',
|
|
18
|
-
version: packageJson.version,
|
|
19
|
-
description: 'Unified interface for Guild.ai agent development',
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
return cmd;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=version.js.map
|
|
@@ -1,114 +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 { getAuthToken } from '../../../lib/auth.js';
|
|
6
|
-
import { getWorkspaceId } from '../../../lib/guild-config.js';
|
|
7
|
-
import { handleAxiosError, ErrorCodes } from '../../../lib/errors.js';
|
|
8
|
-
import { createOutputWriter } from '../../../lib/output.js';
|
|
9
|
-
import { resolveWorkspaceId } from '../../../lib/workspace-helpers.js';
|
|
10
|
-
export function createWorkspaceAgentAddCommand() {
|
|
11
|
-
const cmd = new Command('add');
|
|
12
|
-
cmd
|
|
13
|
-
.description('Add an agent to a workspace')
|
|
14
|
-
.argument('<agent>', 'Agent identifier (e.g., owner~agent-name or UUID)')
|
|
15
|
-
.option('--workspace <id>', 'Workspace ID or name')
|
|
16
|
-
.option('--no-autoupdate', 'Disable automatic updates for this agent (default: autoupdate enabled)')
|
|
17
|
-
.action(async (agentIdentifier, options) => {
|
|
18
|
-
const output = createOutputWriter();
|
|
19
|
-
try {
|
|
20
|
-
const token = await getAuthToken();
|
|
21
|
-
if (!token) {
|
|
22
|
-
output.error('Not authenticated. Please log in first.', 'Run: guild auth login');
|
|
23
|
-
process.exit(1);
|
|
24
|
-
}
|
|
25
|
-
const client = new GuildAPIClient();
|
|
26
|
-
// Resolve workspace
|
|
27
|
-
let workspaceId = options.workspace;
|
|
28
|
-
if (workspaceId) {
|
|
29
|
-
try {
|
|
30
|
-
workspaceId = await resolveWorkspaceId(client, workspaceId);
|
|
31
|
-
}
|
|
32
|
-
catch (err) {
|
|
33
|
-
if (err instanceof Error && err.message.startsWith('Workspace "')) {
|
|
34
|
-
output.error('Workspace not found');
|
|
35
|
-
process.exit(1);
|
|
36
|
-
}
|
|
37
|
-
throw err; // let the outer catch handle network/auth errors via handleAxiosError
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
const resolved = await getWorkspaceId();
|
|
42
|
-
if (!resolved) {
|
|
43
|
-
output.error('No workspace specified.', 'Either use --workspace flag:\n guild workspace agent add <agent> --workspace <workspace-id>\n\nOr select a default workspace:\n guild workspace select');
|
|
44
|
-
process.exit(1);
|
|
45
|
-
}
|
|
46
|
-
workspaceId = resolved.workspaceId;
|
|
47
|
-
}
|
|
48
|
-
// Resolve agent - the backend accepts both UUID and owner~agent-name format
|
|
49
|
-
// First, look up the agent to get its ID and display info
|
|
50
|
-
let agent;
|
|
51
|
-
try {
|
|
52
|
-
agent = await client.get(`/agents/${agentIdentifier}`);
|
|
53
|
-
}
|
|
54
|
-
catch (error) {
|
|
55
|
-
const formattedError = handleAxiosError(error);
|
|
56
|
-
if (formattedError.code === ErrorCodes.NOT_FOUND) {
|
|
57
|
-
output.error(`Agent "${agentIdentifier}" not found`);
|
|
58
|
-
process.exit(1);
|
|
59
|
-
}
|
|
60
|
-
if (formattedError.code === ErrorCodes.FORBIDDEN ||
|
|
61
|
-
formattedError.code === ErrorCodes.AUTH_TOKEN_INVALID) {
|
|
62
|
-
output.error('Cannot add agent: access denied. Ensure the agent is public or check your permissions.');
|
|
63
|
-
process.exit(1);
|
|
64
|
-
}
|
|
65
|
-
throw error;
|
|
66
|
-
}
|
|
67
|
-
// Add agent to workspace
|
|
68
|
-
const response = await client.post(`/workspaces/${workspaceId}/workspace_agents`, {
|
|
69
|
-
agent_id: agent.id,
|
|
70
|
-
should_autoupdate: options.autoupdate,
|
|
71
|
-
});
|
|
72
|
-
// Display success
|
|
73
|
-
const versionDisplay = response.agent_version.version_number
|
|
74
|
-
? `v${response.agent_version.version_number}`
|
|
75
|
-
: (response.agent_version.sha?.slice(0, 7) ?? '-');
|
|
76
|
-
const workspaceName = response.workspace?.name || 'workspace';
|
|
77
|
-
output.success(`Added ${response.agent.full_name} to workspace "${workspaceName}"`, {
|
|
78
|
-
Agent: response.agent.full_name,
|
|
79
|
-
Version: versionDisplay,
|
|
80
|
-
Autoupdate: response.should_autoupdate ? 'enabled' : 'disabled',
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
catch (error) {
|
|
84
|
-
const formattedError = handleAxiosError(error);
|
|
85
|
-
if (formattedError.code === ErrorCodes.AUTH_REQUIRED) {
|
|
86
|
-
output.error('Not authenticated. Please log in first.', 'Run: guild auth login');
|
|
87
|
-
process.exit(1);
|
|
88
|
-
}
|
|
89
|
-
if (formattedError.code === ErrorCodes.BAD_REQUEST) {
|
|
90
|
-
// Handle specific error messages from backend
|
|
91
|
-
const details = formattedError.details || '';
|
|
92
|
-
if (details.includes('already added') ||
|
|
93
|
-
details.includes('already installed')) {
|
|
94
|
-
output.error('This agent is already installed in the workspace');
|
|
95
|
-
}
|
|
96
|
-
else if (details.includes('No published version')) {
|
|
97
|
-
output.error('No published version found for this agent');
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
output.error(details);
|
|
101
|
-
}
|
|
102
|
-
process.exit(1);
|
|
103
|
-
}
|
|
104
|
-
if (formattedError.code === ErrorCodes.NOT_FOUND) {
|
|
105
|
-
output.error('Workspace not found');
|
|
106
|
-
process.exit(1);
|
|
107
|
-
}
|
|
108
|
-
output.error(`Failed to add agent: ${formattedError.details}`);
|
|
109
|
-
process.exit(1);
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
return cmd;
|
|
113
|
-
}
|
|
114
|
-
//# sourceMappingURL=add.js.map
|
|
@@ -1,78 +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 { getAuthToken } from '../../../lib/auth.js';
|
|
6
|
-
import { getWorkspaceId } from '../../../lib/guild-config.js';
|
|
7
|
-
import { handleAxiosError, ErrorCodes } from '../../../lib/errors.js';
|
|
8
|
-
import { createOutputWriter, formatWorkspaceAgentTable } from '../../../lib/output.js';
|
|
9
|
-
import { isMachineReadable } from '../../../lib/output-mode.js';
|
|
10
|
-
import { resolveWorkspaceId } from '../../../lib/workspace-helpers.js';
|
|
11
|
-
import { DEFAULT_PAGE_LIMIT } from '../../../lib/api-types.js';
|
|
12
|
-
export function createWorkspaceAgentListCommand() {
|
|
13
|
-
const cmd = new Command('list');
|
|
14
|
-
cmd
|
|
15
|
-
.description('List agents in a workspace')
|
|
16
|
-
.option('--workspace <id>', 'Workspace ID or name')
|
|
17
|
-
.option('--limit <number>', `Number of results to return (default: ${DEFAULT_PAGE_LIMIT})`, String(DEFAULT_PAGE_LIMIT))
|
|
18
|
-
.option('--offset <number>', 'Offset for pagination (default: 0)', '0')
|
|
19
|
-
.action(async (options) => {
|
|
20
|
-
const output = createOutputWriter();
|
|
21
|
-
try {
|
|
22
|
-
const token = await getAuthToken();
|
|
23
|
-
if (!token) {
|
|
24
|
-
output.error('Not authenticated. Please log in first.', 'Run: guild auth login');
|
|
25
|
-
process.exit(1);
|
|
26
|
-
}
|
|
27
|
-
const client = new GuildAPIClient();
|
|
28
|
-
// Resolve workspace
|
|
29
|
-
let workspaceId = options.workspace;
|
|
30
|
-
if (workspaceId) {
|
|
31
|
-
try {
|
|
32
|
-
workspaceId = await resolveWorkspaceId(client, workspaceId);
|
|
33
|
-
}
|
|
34
|
-
catch (err) {
|
|
35
|
-
if (err instanceof Error && err.message.startsWith('Workspace "')) {
|
|
36
|
-
output.error('Workspace not found');
|
|
37
|
-
process.exit(1);
|
|
38
|
-
}
|
|
39
|
-
throw err; // let the outer catch handle network/auth errors via handleAxiosError
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
const resolved = await getWorkspaceId();
|
|
44
|
-
if (!resolved) {
|
|
45
|
-
output.error('No workspace specified.', 'Either use --workspace flag:\n guild workspace agent list --workspace <workspace-id>\n\nOr select a default workspace:\n guild workspace select');
|
|
46
|
-
process.exit(1);
|
|
47
|
-
}
|
|
48
|
-
workspaceId = resolved.workspaceId;
|
|
49
|
-
}
|
|
50
|
-
// List workspace agents
|
|
51
|
-
const params = new URLSearchParams();
|
|
52
|
-
params.append('limit', options.limit);
|
|
53
|
-
params.append('offset', options.offset);
|
|
54
|
-
const response = await client.get(`/workspaces/${workspaceId}/workspace_agents?${params.toString()}`);
|
|
55
|
-
if (isMachineReadable()) {
|
|
56
|
-
output.data(response);
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
formatWorkspaceAgentTable(response.items);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
catch (error) {
|
|
63
|
-
const formattedError = handleAxiosError(error);
|
|
64
|
-
if (formattedError.code === ErrorCodes.AUTH_REQUIRED) {
|
|
65
|
-
output.error('Not authenticated. Please log in first.', 'Run: guild auth login');
|
|
66
|
-
process.exit(1);
|
|
67
|
-
}
|
|
68
|
-
if (formattedError.code === ErrorCodes.NOT_FOUND) {
|
|
69
|
-
output.error('Workspace not found');
|
|
70
|
-
process.exit(1);
|
|
71
|
-
}
|
|
72
|
-
output.error(`Failed to list agents: ${formattedError.details}`);
|
|
73
|
-
process.exit(1);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
return cmd;
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=list.js.map
|
|
@@ -1,78 +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 { getAuthToken } from '../../../lib/auth.js';
|
|
6
|
-
import { getWorkspaceId } from '../../../lib/guild-config.js';
|
|
7
|
-
import { handleAxiosError, ErrorCodes } from '../../../lib/errors.js';
|
|
8
|
-
import { createOutputWriter } from '../../../lib/output.js';
|
|
9
|
-
import { resolveWorkspaceId } from '../../../lib/workspace-helpers.js';
|
|
10
|
-
export function createWorkspaceAgentRemoveCommand() {
|
|
11
|
-
const cmd = new Command('remove');
|
|
12
|
-
cmd
|
|
13
|
-
.description('Remove an agent from a workspace')
|
|
14
|
-
.argument('<agent>', 'Agent identifier (e.g., owner~agent-name or UUID)')
|
|
15
|
-
.option('--workspace <id>', 'Workspace ID or name')
|
|
16
|
-
.action(async (agentIdentifier, options) => {
|
|
17
|
-
const output = createOutputWriter();
|
|
18
|
-
try {
|
|
19
|
-
const token = await getAuthToken();
|
|
20
|
-
if (!token) {
|
|
21
|
-
output.error('Not authenticated. Please log in first.', 'Run: guild auth login');
|
|
22
|
-
process.exit(1);
|
|
23
|
-
}
|
|
24
|
-
const client = new GuildAPIClient();
|
|
25
|
-
// Resolve workspace
|
|
26
|
-
let workspaceId = options.workspace;
|
|
27
|
-
if (workspaceId) {
|
|
28
|
-
try {
|
|
29
|
-
workspaceId = await resolveWorkspaceId(client, workspaceId);
|
|
30
|
-
}
|
|
31
|
-
catch (err) {
|
|
32
|
-
if (err instanceof Error && err.message.startsWith('Workspace "')) {
|
|
33
|
-
output.error('Workspace not found');
|
|
34
|
-
process.exit(1);
|
|
35
|
-
}
|
|
36
|
-
throw err; // let the outer catch handle network/auth errors via handleAxiosError
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
const resolved = await getWorkspaceId();
|
|
41
|
-
if (!resolved) {
|
|
42
|
-
output.error('No workspace specified.', 'Either use --workspace flag:\n guild workspace agent remove <agent> --workspace <workspace-id>\n\nOr select a default workspace:\n guild workspace select');
|
|
43
|
-
process.exit(1);
|
|
44
|
-
}
|
|
45
|
-
workspaceId = resolved.workspaceId;
|
|
46
|
-
}
|
|
47
|
-
// List all workspace agents to find the one to remove
|
|
48
|
-
const allWorkspaceAgents = await client.fetchAll(`/workspaces/${workspaceId}/workspace_agents`);
|
|
49
|
-
// Find the agent by identifier (match full_name, name, agent id, or workspace_agent id)
|
|
50
|
-
const workspaceAgent = allWorkspaceAgents.find((wa) => wa.id === agentIdentifier ||
|
|
51
|
-
wa.agent.full_name === agentIdentifier ||
|
|
52
|
-
wa.agent.name === agentIdentifier ||
|
|
53
|
-
wa.agent.id === agentIdentifier);
|
|
54
|
-
if (!workspaceAgent) {
|
|
55
|
-
output.error(`Agent "${agentIdentifier}" is not installed in this workspace`);
|
|
56
|
-
process.exit(1);
|
|
57
|
-
}
|
|
58
|
-
// Remove the workspace agent
|
|
59
|
-
await client.delete(`/workspace_agents/${workspaceAgent.id}`);
|
|
60
|
-
output.success(`Removed ${workspaceAgent.agent.full_name} from workspace`);
|
|
61
|
-
}
|
|
62
|
-
catch (error) {
|
|
63
|
-
const formattedError = handleAxiosError(error);
|
|
64
|
-
if (formattedError.code === ErrorCodes.AUTH_REQUIRED) {
|
|
65
|
-
output.error('Not authenticated. Please log in first.', 'Run: guild auth login');
|
|
66
|
-
process.exit(1);
|
|
67
|
-
}
|
|
68
|
-
if (formattedError.code === ErrorCodes.NOT_FOUND) {
|
|
69
|
-
output.error('Workspace or agent not found');
|
|
70
|
-
process.exit(1);
|
|
71
|
-
}
|
|
72
|
-
output.error(`Failed to remove agent: ${formattedError.details}`);
|
|
73
|
-
process.exit(1);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
return cmd;
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=remove.js.map
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// Copyright 2026 Guild.ai
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { Command } from 'commander';
|
|
4
|
-
import * as fs from 'fs/promises';
|
|
5
|
-
import { createOutputWriter } from '../../lib/output.js';
|
|
6
|
-
import { isAgentDirectory, loadLocalConfig, getLocalConfigPath, loadGlobalConfig, getGlobalConfigDir, getGlobalConfigPath, } from '../../lib/guild-config.js';
|
|
7
|
-
export function createWorkspaceClearCommand() {
|
|
8
|
-
const cmd = new Command('clear');
|
|
9
|
-
cmd.description('Clear the default workspace setting').action(async () => {
|
|
10
|
-
const output = createOutputWriter();
|
|
11
|
-
try {
|
|
12
|
-
if (await isAgentDirectory()) {
|
|
13
|
-
// In agent directory: remove workspace_id from guild.json
|
|
14
|
-
const localConfig = await loadLocalConfig();
|
|
15
|
-
if (!localConfig || !('workspace_id' in localConfig)) {
|
|
16
|
-
output.progress('No default workspace was set.');
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
const { workspace_id: _removed, ...updated } = localConfig;
|
|
20
|
-
await fs.writeFile(getLocalConfigPath(), JSON.stringify(updated, null, 2) + '\n');
|
|
21
|
-
output.success('Cleared workspace setting for this agent');
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
// Not in agent directory: remove default_workspace from global config
|
|
25
|
-
const globalConfig = await loadGlobalConfig();
|
|
26
|
-
if (!globalConfig ||
|
|
27
|
-
(!('default_workspace' in globalConfig) &&
|
|
28
|
-
!('default_workspace_name' in globalConfig))) {
|
|
29
|
-
output.progress('No default workspace was set.');
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
const { default_workspace: _ws, default_workspace_name: _wsName, ...rest } = globalConfig;
|
|
33
|
-
await fs.mkdir(getGlobalConfigDir(), { recursive: true });
|
|
34
|
-
await fs.writeFile(getGlobalConfigPath(), JSON.stringify(rest, null, 2) + '\n');
|
|
35
|
-
output.success('Default workspace cleared');
|
|
36
|
-
}
|
|
37
|
-
catch (error) {
|
|
38
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
39
|
-
output.error(`Failed to clear workspace: ${message}`);
|
|
40
|
-
process.exit(1);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
return cmd;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=clear.js.map
|