@guildai/cli 0.5.6 → 0.5.8
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/commands/agent/chat.js +2 -1
- package/dist/commands/agent/clone.js +2 -1
- package/dist/commands/agent/code.js +2 -1
- package/dist/commands/agent/create.js +2 -1
- package/dist/commands/agent/fork.js +2 -1
- package/dist/commands/agent/get.js +2 -1
- package/dist/commands/agent/grep.js +2 -1
- package/dist/commands/agent/init.js +2 -1
- package/dist/commands/agent/list.js +2 -1
- package/dist/commands/agent/owners.js +2 -1
- package/dist/commands/agent/publish.js +2 -1
- package/dist/commands/agent/pull.js +2 -1
- package/dist/commands/agent/revalidate.js +2 -1
- package/dist/commands/agent/save.js +2 -1
- package/dist/commands/agent/search.js +2 -1
- package/dist/commands/agent/tags/add.js +2 -1
- package/dist/commands/agent/tags/list.js +2 -1
- package/dist/commands/agent/tags/remove.js +2 -1
- package/dist/commands/agent/tags/set.js +2 -1
- package/dist/commands/agent/test.js +2 -1
- package/dist/commands/agent/unpublish.js +2 -1
- package/dist/commands/agent/update.js +2 -1
- package/dist/commands/agent/versions.js +2 -1
- package/dist/commands/agent/workspaces.js +2 -1
- package/dist/commands/auth/login.js +2 -1
- package/dist/commands/auth/logout.js +2 -1
- package/dist/commands/auth/status.js +2 -1
- package/dist/commands/auth/token.js +2 -1
- package/dist/commands/chat.js +2 -1
- package/dist/commands/config/get.js +2 -1
- package/dist/commands/config/list.js +2 -1
- package/dist/commands/config/path.js +2 -1
- package/dist/commands/config/set.js +2 -1
- package/dist/commands/doctor.js +2 -1
- package/dist/commands/mcp.d.ts +3 -0
- package/dist/commands/mcp.js +34 -0
- package/dist/commands/session/create.js +2 -1
- package/dist/commands/session/events.js +2 -1
- package/dist/commands/session/get.js +2 -1
- package/dist/commands/session/list.js +2 -1
- package/dist/commands/session/send.js +2 -1
- package/dist/commands/session/tasks.js +2 -1
- package/dist/commands/setup.js +39 -1
- package/dist/commands/trigger/activate.js +2 -1
- package/dist/commands/trigger/create.js +2 -1
- package/dist/commands/trigger/deactivate.js +2 -1
- package/dist/commands/trigger/get.js +2 -1
- package/dist/commands/trigger/list.js +2 -1
- package/dist/commands/trigger/sessions.js +2 -1
- package/dist/commands/trigger/update.js +2 -1
- package/dist/commands/version.js +2 -1
- package/dist/commands/workspace/agent/add.js +2 -1
- package/dist/commands/workspace/agent/list.js +2 -1
- package/dist/commands/workspace/agent/remove.js +2 -1
- package/dist/commands/workspace/context/edit.js +2 -1
- package/dist/commands/workspace/context/get.js +2 -1
- package/dist/commands/workspace/context/list.js +2 -1
- package/dist/commands/workspace/context/publish.js +2 -1
- package/dist/commands/workspace/create.js +2 -1
- package/dist/commands/workspace/current.js +2 -1
- package/dist/commands/workspace/get.js +2 -1
- package/dist/commands/workspace/list.js +2 -1
- package/dist/commands/workspace/select.js +2 -1
- package/dist/components/AgentInstallPrompt.js +2 -1
- package/dist/components/SplashAnimation.js +2 -1
- package/dist/components/TaskView.js +2 -1
- package/dist/index.js +11 -4
- package/dist/lib/agent-helpers.js +2 -1
- package/dist/lib/alternate-screen.js +2 -1
- package/dist/lib/api-client.js +2 -1
- package/dist/lib/api-types.js +2 -1
- package/dist/lib/auth.js +2 -1
- package/dist/lib/braille-canvas.js +2 -1
- package/dist/lib/colors.js +2 -1
- package/dist/lib/config-cache.js +2 -1
- package/dist/lib/config.js +2 -1
- package/dist/lib/did-you-mean.js +2 -1
- package/dist/lib/errors.js +2 -1
- package/dist/lib/git.js +2 -1
- package/dist/lib/guild-config.js +2 -1
- package/dist/lib/iap.js +2 -1
- package/dist/lib/loading-messages.js +2 -1
- package/dist/lib/logo.js +2 -1
- package/dist/lib/lottie-renderer.js +2 -1
- package/dist/lib/lottie-serverside.js +2 -1
- package/dist/lib/markdown.js +2 -1
- package/dist/lib/npmrc.js +2 -1
- package/dist/lib/output-mode.js +2 -1
- package/dist/lib/output.js +2 -1
- package/dist/lib/owner-helpers.js +2 -1
- package/dist/lib/polling.js +2 -1
- package/dist/lib/progress.js +2 -1
- package/dist/lib/session-events.js +2 -1
- package/dist/lib/session-polling.js +2 -1
- package/dist/lib/session-resume.js +2 -1
- package/dist/lib/spinners.js +2 -1
- package/dist/lib/splash.js +2 -1
- package/dist/lib/stdin.js +2 -1
- package/dist/lib/svg-renderer.js +2 -1
- package/dist/lib/svg-to-braille.js +2 -1
- package/dist/lib/update-check.js +2 -1
- package/dist/mcp/resources.d.ts +4 -0
- package/dist/mcp/resources.js +67 -0
- package/dist/mcp/server.d.ts +6 -0
- package/dist/mcp/server.js +64 -0
- package/dist/mcp/tools.d.ts +4 -0
- package/dist/mcp/tools.js +783 -0
- package/docs/skills/agent-dev.md +993 -0
- package/package.json +6 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Guild.ai
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
3
|
import React, { useState, useEffect } from 'react';
|
|
3
4
|
import { Box, Text, useInput } from 'ink';
|
|
4
5
|
import { getTaskDisplayName, isFilteredTaskName, } from '../lib/session-events.js';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Guild.ai
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
3
|
import { Command, Option } from 'commander';
|
|
3
4
|
import { readFileSync, existsSync } from 'fs';
|
|
4
5
|
import path from 'path';
|
|
@@ -65,6 +66,7 @@ import { createConfigSetCommand } from './commands/config/set.js';
|
|
|
65
66
|
import { createConfigPathCommand } from './commands/config/path.js';
|
|
66
67
|
import { createDoctorCommand } from './commands/doctor.js';
|
|
67
68
|
import { createSetupCommand } from './commands/setup.js';
|
|
69
|
+
import { createMcpCommand } from './commands/mcp.js';
|
|
68
70
|
import { showSplashScreen, shouldShowSplash } from './lib/splash.js';
|
|
69
71
|
import { checkForUpdate } from './lib/update-check.js';
|
|
70
72
|
import { setupUnknownCommandSuggestions } from './lib/did-you-mean.js';
|
|
@@ -74,13 +76,17 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
74
76
|
const program = new Command();
|
|
75
77
|
// Read version from package.json
|
|
76
78
|
const packageJson = JSON.parse(readFileSync(path.join(__dirname, '../package.json'), 'utf-8'));
|
|
77
|
-
//
|
|
78
|
-
|
|
79
|
+
// MCP mode must not write to stdout (JSON-RPC transport)
|
|
80
|
+
const isMcpMode = process.argv.includes('mcp');
|
|
81
|
+
// Show splash screen conditionally (skip in MCP mode — stdout is JSON-RPC)
|
|
82
|
+
if (!isMcpMode && shouldShowSplash()) {
|
|
79
83
|
showSplashScreen({
|
|
80
84
|
version: packageJson.version,
|
|
81
85
|
});
|
|
82
86
|
}
|
|
83
|
-
|
|
87
|
+
if (!isMcpMode) {
|
|
88
|
+
checkForUpdate(packageJson.version);
|
|
89
|
+
}
|
|
84
90
|
program
|
|
85
91
|
.name('guild')
|
|
86
92
|
.description('Guild.ai CLI - Build, test, and deploy AI agents')
|
|
@@ -104,6 +110,7 @@ program
|
|
|
104
110
|
// Register commands
|
|
105
111
|
program.addCommand(createVersionCommand());
|
|
106
112
|
program.addCommand(createChatCommand());
|
|
113
|
+
program.addCommand(createMcpCommand());
|
|
107
114
|
program.addCommand(createDoctorCommand());
|
|
108
115
|
program.addCommand(createSetupCommand());
|
|
109
116
|
// Auth command group
|
package/dist/lib/api-client.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Guild.ai
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
3
|
import axios from 'axios';
|
|
3
4
|
import { getAuthToken, clearAuthToken } from './auth.js';
|
|
4
5
|
import { retry, debug, GuildCLIError, ErrorCodes } from './errors.js';
|
package/dist/lib/api-types.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Guild.ai
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
3
|
// Import and re-export generated types (from cli/scripts/sync-types-from-python.py)
|
|
3
4
|
import { WEBHOOK_SERVICES, TIME_TRIGGER_FREQUENCIES, } from './generated-types.js';
|
|
4
5
|
export { WEBHOOK_SERVICES, TIME_TRIGGER_FREQUENCIES, };
|
package/dist/lib/auth.js
CHANGED
package/dist/lib/colors.js
CHANGED
package/dist/lib/config-cache.js
CHANGED
package/dist/lib/config.js
CHANGED
package/dist/lib/did-you-mean.js
CHANGED
package/dist/lib/errors.js
CHANGED
package/dist/lib/git.js
CHANGED
package/dist/lib/guild-config.js
CHANGED
package/dist/lib/iap.js
CHANGED
package/dist/lib/logo.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Guild.ai
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
3
|
// Guild logo & variations
|
|
3
4
|
// Small logos from main branch (too small for CLI startup, preserved for reference/spinners)
|
|
4
5
|
// const LOGO_3 = ['⣌⠿⣡', '⢋⣶⡙'];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Guild.ai
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
3
|
/**
|
|
3
4
|
* Server-side Lottie renderer using svgdom + lottie-web
|
|
4
5
|
* Based on: https://medium.com/@facuparedes/server-side-lottie-rendering-a-technical-journey-3bee81d7b6c8
|
package/dist/lib/markdown.js
CHANGED
package/dist/lib/npmrc.js
CHANGED
package/dist/lib/output-mode.js
CHANGED
package/dist/lib/output.js
CHANGED
package/dist/lib/polling.js
CHANGED
package/dist/lib/progress.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Guild.ai
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
3
|
// =============================================================================
|
|
3
4
|
// Task Filtering
|
|
4
5
|
// =============================================================================
|
package/dist/lib/spinners.js
CHANGED
package/dist/lib/splash.js
CHANGED
package/dist/lib/stdin.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Guild.ai
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
3
|
/**
|
|
3
4
|
* Exit with a helpful error when stdin is piped but no --mode flag was given.
|
|
4
5
|
* Call this before rendering an interactive UI (Ink render()) so users who
|
package/dist/lib/svg-renderer.js
CHANGED
package/dist/lib/update-check.js
CHANGED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import type { GuildAPIClient } from '../lib/api-client.js';
|
|
3
|
+
export declare function registerResources(server: McpServer, apiClient: GuildAPIClient, workspaceId: string): void;
|
|
4
|
+
//# sourceMappingURL=resources.d.ts.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Copyright 2026 Guild.ai
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
export function registerResources(server, apiClient, workspaceId) {
|
|
4
|
+
// guild://workspace — Current workspace info
|
|
5
|
+
server.resource('workspace', 'guild://workspace', async () => {
|
|
6
|
+
try {
|
|
7
|
+
const workspace = await apiClient.get(`/workspaces/${workspaceId}`);
|
|
8
|
+
const text = JSON.stringify({
|
|
9
|
+
id: workspace.id,
|
|
10
|
+
name: workspace.name,
|
|
11
|
+
full_name: workspace.full_name,
|
|
12
|
+
}, null, 2);
|
|
13
|
+
return {
|
|
14
|
+
contents: [
|
|
15
|
+
{
|
|
16
|
+
uri: 'guild://workspace',
|
|
17
|
+
mimeType: 'application/json',
|
|
18
|
+
text,
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return {
|
|
25
|
+
contents: [
|
|
26
|
+
{
|
|
27
|
+
uri: 'guild://workspace',
|
|
28
|
+
mimeType: 'application/json',
|
|
29
|
+
text: JSON.stringify({ id: workspaceId }),
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
// guild://agents — Agent list
|
|
36
|
+
server.resource('agents', 'guild://agents', async () => {
|
|
37
|
+
try {
|
|
38
|
+
const agents = await apiClient.fetchAll(`/workspaces/${workspaceId}/workspace_agents`);
|
|
39
|
+
const text = JSON.stringify(agents.map((a) => ({
|
|
40
|
+
id: a.id,
|
|
41
|
+
name: a.full_name || a.name,
|
|
42
|
+
description: a.description,
|
|
43
|
+
})), null, 2);
|
|
44
|
+
return {
|
|
45
|
+
contents: [
|
|
46
|
+
{
|
|
47
|
+
uri: 'guild://agents',
|
|
48
|
+
mimeType: 'application/json',
|
|
49
|
+
text,
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return {
|
|
56
|
+
contents: [
|
|
57
|
+
{
|
|
58
|
+
uri: 'guild://agents',
|
|
59
|
+
mimeType: 'application/json',
|
|
60
|
+
text: '[]',
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=resources.js.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// Copyright 2026 Guild.ai
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
5
|
+
import { readFileSync } from 'fs';
|
|
6
|
+
import path from 'path';
|
|
7
|
+
import { fileURLToPath } from 'url';
|
|
8
|
+
import { GuildAPIClient } from '../lib/api-client.js';
|
|
9
|
+
import { getAuthToken } from '../lib/auth.js';
|
|
10
|
+
import { getWorkspaceId } from '../lib/guild-config.js';
|
|
11
|
+
import { registerTools } from './tools.js';
|
|
12
|
+
import { registerResources } from './resources.js';
|
|
13
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
function debugLog(debug, message) {
|
|
15
|
+
if (debug) {
|
|
16
|
+
process.stderr.write(`[guild-mcp] ${message}\n`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export async function startMcpServer(options) {
|
|
20
|
+
const { debug = false } = options;
|
|
21
|
+
// Read version from package.json
|
|
22
|
+
const packageJson = JSON.parse(readFileSync(path.join(__dirname, '../../package.json'), 'utf-8'));
|
|
23
|
+
// Resolve auth token
|
|
24
|
+
const token = await getAuthToken();
|
|
25
|
+
if (!token) {
|
|
26
|
+
process.stderr.write('Error: Not authenticated. Run: guild auth login\n');
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
// Resolve workspace ID
|
|
30
|
+
let workspaceId = options.workspace;
|
|
31
|
+
if (!workspaceId) {
|
|
32
|
+
const resolved = await getWorkspaceId();
|
|
33
|
+
if (!resolved) {
|
|
34
|
+
process.stderr.write('Error: No workspace configured. Run: guild workspace select\n');
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
workspaceId = resolved.workspaceId;
|
|
38
|
+
}
|
|
39
|
+
debugLog(debug, `Starting MCP server v${packageJson.version}`);
|
|
40
|
+
debugLog(debug, `Workspace: ${workspaceId}`);
|
|
41
|
+
// Create API client
|
|
42
|
+
const apiClient = new GuildAPIClient();
|
|
43
|
+
// Create MCP server
|
|
44
|
+
const server = new McpServer({
|
|
45
|
+
name: 'guild',
|
|
46
|
+
version: packageJson.version,
|
|
47
|
+
});
|
|
48
|
+
// Register tools and resources
|
|
49
|
+
registerTools(server, apiClient, workspaceId, debug);
|
|
50
|
+
registerResources(server, apiClient, workspaceId);
|
|
51
|
+
// Create stdio transport and connect
|
|
52
|
+
const transport = new StdioServerTransport();
|
|
53
|
+
await server.connect(transport);
|
|
54
|
+
debugLog(debug, 'MCP server connected via stdio');
|
|
55
|
+
// Graceful shutdown
|
|
56
|
+
const shutdown = async () => {
|
|
57
|
+
debugLog(debug, 'Shutting down MCP server');
|
|
58
|
+
await server.close();
|
|
59
|
+
process.exit(0);
|
|
60
|
+
};
|
|
61
|
+
process.on('SIGINT', () => void shutdown());
|
|
62
|
+
process.on('SIGTERM', () => void shutdown());
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import type { GuildAPIClient } from '../lib/api-client.js';
|
|
3
|
+
export declare function registerTools(server: McpServer, apiClient: GuildAPIClient, workspaceId: string, debug: boolean): void;
|
|
4
|
+
//# sourceMappingURL=tools.d.ts.map
|