@wingman-ai/gateway 0.3.0 → 0.3.1
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 +8 -0
- package/dist/agent/config/agentConfig.cjs +12 -0
- package/dist/agent/config/agentConfig.d.ts +22 -0
- package/dist/agent/config/agentConfig.js +10 -1
- package/dist/agent/config/agentLoader.cjs +9 -0
- package/dist/agent/config/agentLoader.js +9 -0
- package/dist/agent/config/toolRegistry.cjs +17 -0
- package/dist/agent/config/toolRegistry.d.ts +15 -0
- package/dist/agent/config/toolRegistry.js +17 -0
- package/dist/agent/tests/agentConfig.test.cjs +6 -1
- package/dist/agent/tests/agentConfig.test.js +6 -1
- package/dist/agent/tests/browserControlHelpers.test.cjs +35 -0
- package/dist/agent/tests/browserControlHelpers.test.d.ts +1 -0
- package/dist/agent/tests/browserControlHelpers.test.js +29 -0
- package/dist/agent/tests/browserControlTool.test.cjs +2117 -0
- package/dist/agent/tests/browserControlTool.test.d.ts +1 -0
- package/dist/agent/tests/browserControlTool.test.js +2111 -0
- package/dist/agent/tests/toolRegistry.test.cjs +6 -0
- package/dist/agent/tests/toolRegistry.test.js +6 -0
- package/dist/agent/tools/browser_control.cjs +1282 -0
- package/dist/agent/tools/browser_control.d.ts +478 -0
- package/dist/agent/tools/browser_control.js +1242 -0
- package/dist/cli/commands/agent.cjs +16 -2
- package/dist/cli/commands/agent.js +16 -2
- package/dist/cli/commands/browser.cjs +603 -0
- package/dist/cli/commands/browser.d.ts +13 -0
- package/dist/cli/commands/browser.js +566 -0
- package/dist/cli/commands/gateway.cjs +18 -7
- package/dist/cli/commands/gateway.d.ts +5 -1
- package/dist/cli/commands/gateway.js +18 -7
- package/dist/cli/commands/init.cjs +134 -45
- package/dist/cli/commands/init.js +134 -45
- package/dist/cli/commands/skill.cjs +3 -2
- package/dist/cli/commands/skill.js +3 -2
- package/dist/cli/config/loader.cjs +15 -0
- package/dist/cli/config/loader.js +15 -0
- package/dist/cli/config/schema.cjs +51 -2
- package/dist/cli/config/schema.d.ts +49 -0
- package/dist/cli/config/schema.js +44 -1
- package/dist/cli/core/workspace.cjs +89 -0
- package/dist/cli/core/workspace.d.ts +1 -0
- package/dist/cli/core/workspace.js +55 -0
- package/dist/cli/index.cjs +53 -5
- package/dist/cli/index.js +53 -5
- package/dist/cli/types/browser.cjs +18 -0
- package/dist/cli/types/browser.d.ts +9 -0
- package/dist/cli/types/browser.js +0 -0
- package/dist/gateway/browserRelayServer.cjs +338 -0
- package/dist/gateway/browserRelayServer.d.ts +38 -0
- package/dist/gateway/browserRelayServer.js +301 -0
- package/dist/gateway/http/agents.cjs +22 -0
- package/dist/gateway/http/agents.js +22 -0
- package/dist/gateway/http/fs.cjs +57 -0
- package/dist/gateway/http/fs.js +58 -1
- package/dist/gateway/server.cjs +43 -6
- package/dist/gateway/server.d.ts +4 -1
- package/dist/gateway/server.js +36 -5
- package/dist/gateway/transport/websocket.cjs +45 -10
- package/dist/gateway/transport/websocket.d.ts +1 -0
- package/dist/gateway/transport/websocket.js +41 -9
- package/dist/gateway/types.d.ts +4 -0
- package/dist/tests/agents-api.test.cjs +52 -0
- package/dist/tests/agents-api.test.js +53 -1
- package/dist/tests/browser-command.test.cjs +264 -0
- package/dist/tests/browser-command.test.d.ts +1 -0
- package/dist/tests/browser-command.test.js +258 -0
- package/dist/tests/browser-relay-server.test.cjs +20 -0
- package/dist/tests/browser-relay-server.test.d.ts +1 -0
- package/dist/tests/browser-relay-server.test.js +14 -0
- package/dist/tests/cli-config-loader.test.cjs +43 -0
- package/dist/tests/cli-config-loader.test.js +43 -0
- package/dist/tests/cli-init.test.cjs +25 -2
- package/dist/tests/cli-init.test.js +25 -2
- package/dist/tests/cli-workspace-root.test.cjs +114 -0
- package/dist/tests/cli-workspace-root.test.d.ts +1 -0
- package/dist/tests/cli-workspace-root.test.js +108 -0
- package/dist/tests/fs-api.test.cjs +138 -0
- package/dist/tests/fs-api.test.d.ts +1 -0
- package/dist/tests/fs-api.test.js +132 -0
- package/dist/tests/gateway-command-workspace.test.cjs +150 -0
- package/dist/tests/gateway-command-workspace.test.d.ts +1 -0
- package/dist/tests/gateway-command-workspace.test.js +144 -0
- package/dist/tests/gateway-request-execution-overrides.test.cjs +42 -0
- package/dist/tests/gateway-request-execution-overrides.test.d.ts +1 -0
- package/dist/tests/gateway-request-execution-overrides.test.js +36 -0
- package/dist/tests/gateway.test.cjs +31 -0
- package/dist/tests/gateway.test.js +31 -0
- package/dist/tests/websocket-transport.test.cjs +31 -0
- package/dist/tests/websocket-transport.test.d.ts +1 -0
- package/dist/tests/websocket-transport.test.js +25 -0
- package/dist/webui/assets/index-BW9nM0J2.css +11 -0
- package/dist/webui/assets/{index-0nUBsUUq.js → index-C8-oboEC.js} +107 -107
- package/dist/webui/index.html +2 -2
- package/extensions/wingman-browser-extension/README.md +27 -0
- package/extensions/wingman-browser-extension/background.js +416 -0
- package/extensions/wingman-browser-extension/manifest.json +19 -0
- package/extensions/wingman-browser-extension/options.html +156 -0
- package/extensions/wingman-browser-extension/options.js +106 -0
- package/package.json +8 -6
- package/{.wingman → templates}/agents/README.md +2 -1
- package/{.wingman → templates}/agents/coding/agent.md +0 -1
- package/{.wingman → templates}/agents/coding-v2/agent.md +0 -1
- package/{.wingman → templates}/agents/game-dev/agent.md +8 -1
- package/{.wingman → templates}/agents/game-dev/art-generation.md +1 -0
- package/{.wingman → templates}/agents/main/agent.md +5 -0
- package/{.wingman → templates}/agents/researcher/agent.md +9 -0
- package/{.wingman → templates}/agents/stock-trader/agent.md +1 -0
- package/dist/webui/assets/index-kk7OrD-G.css +0 -11
- /package/{.wingman → templates}/agents/coding-v2/implementor.md +0 -0
- /package/{.wingman → templates}/agents/game-dev/asset-refinement.md +0 -0
- /package/{.wingman → templates}/agents/game-dev/planning-idea.md +0 -0
- /package/{.wingman → templates}/agents/game-dev/ui-specialist.md +0 -0
- /package/{.wingman → templates}/agents/stock-trader/chain-curator.md +0 -0
- /package/{.wingman → templates}/agents/stock-trader/goal-translator.md +0 -0
- /package/{.wingman → templates}/agents/stock-trader/guardrails-veto.md +0 -0
- /package/{.wingman → templates}/agents/stock-trader/path-planner.md +0 -0
- /package/{.wingman → templates}/agents/stock-trader/regime-analyst.md +0 -0
- /package/{.wingman → templates}/agents/stock-trader/risk.md +0 -0
- /package/{.wingman → templates}/agents/stock-trader/selection.md +0 -0
- /package/{.wingman → templates}/agents/stock-trader/strategy-composer.md +0 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
resolveWorkspaceRoot: ()=>resolveWorkspaceRoot
|
|
28
|
+
});
|
|
29
|
+
const external_node_fs_namespaceObject = require("node:fs");
|
|
30
|
+
const external_node_os_namespaceObject = require("node:os");
|
|
31
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
32
|
+
const DEFAULT_CONFIG_DIR = ".wingman";
|
|
33
|
+
const WORKSPACE_MARKERS = [
|
|
34
|
+
"wingman.config.json",
|
|
35
|
+
"agents"
|
|
36
|
+
];
|
|
37
|
+
function resolveWorkspaceRoot(cwd = process.cwd(), explicitWorkspace, configDir = DEFAULT_CONFIG_DIR) {
|
|
38
|
+
if ("string" == typeof explicitWorkspace && explicitWorkspace.trim()) return (0, external_node_path_namespaceObject.resolve)(cwd, explicitWorkspace.trim());
|
|
39
|
+
const startDir = (0, external_node_path_namespaceObject.resolve)(cwd);
|
|
40
|
+
const gitRoot = findGitRoot(startDir);
|
|
41
|
+
const homeDir = (0, external_node_path_namespaceObject.resolve)((0, external_node_os_namespaceObject.homedir)());
|
|
42
|
+
let current = startDir;
|
|
43
|
+
while(true){
|
|
44
|
+
if (hasWorkspaceMarker(current, configDir)) return current;
|
|
45
|
+
if (gitRoot && current === gitRoot) break;
|
|
46
|
+
const parent = (0, external_node_path_namespaceObject.dirname)(current);
|
|
47
|
+
if (parent === current) break;
|
|
48
|
+
if (parent === homeDir && startDir !== homeDir) break;
|
|
49
|
+
current = parent;
|
|
50
|
+
}
|
|
51
|
+
const nestedWorkspace = findNestedWorkspaceRoot(startDir, configDir);
|
|
52
|
+
if (nestedWorkspace) return nestedWorkspace;
|
|
53
|
+
return startDir;
|
|
54
|
+
}
|
|
55
|
+
function hasWorkspaceMarker(dir, configDir) {
|
|
56
|
+
return WORKSPACE_MARKERS.some((marker)=>(0, external_node_fs_namespaceObject.existsSync)((0, external_node_path_namespaceObject.join)(dir, configDir, marker)));
|
|
57
|
+
}
|
|
58
|
+
function findGitRoot(startDir) {
|
|
59
|
+
let current = (0, external_node_path_namespaceObject.resolve)(startDir);
|
|
60
|
+
while(true){
|
|
61
|
+
if ((0, external_node_fs_namespaceObject.existsSync)((0, external_node_path_namespaceObject.join)(current, ".git"))) return current;
|
|
62
|
+
const parent = (0, external_node_path_namespaceObject.dirname)(current);
|
|
63
|
+
if (parent === current) return null;
|
|
64
|
+
current = parent;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function findNestedWorkspaceRoot(startDir, configDir) {
|
|
68
|
+
const homeDir = (0, external_node_path_namespaceObject.resolve)((0, external_node_os_namespaceObject.homedir)());
|
|
69
|
+
let current = (0, external_node_path_namespaceObject.resolve)(startDir);
|
|
70
|
+
while(true){
|
|
71
|
+
const candidates = [
|
|
72
|
+
(0, external_node_path_namespaceObject.join)(current, "apps", "wingman"),
|
|
73
|
+
(0, external_node_path_namespaceObject.join)(current, "wingman")
|
|
74
|
+
];
|
|
75
|
+
for (const candidate of candidates)if ((0, external_node_fs_namespaceObject.existsSync)((0, external_node_path_namespaceObject.join)(candidate, configDir, "wingman.config.json"))) return candidate;
|
|
76
|
+
const parent = (0, external_node_path_namespaceObject.dirname)(current);
|
|
77
|
+
if (parent === current) break;
|
|
78
|
+
if (parent === homeDir && startDir !== homeDir) break;
|
|
79
|
+
current = parent;
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
exports.resolveWorkspaceRoot = __webpack_exports__.resolveWorkspaceRoot;
|
|
84
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
85
|
+
"resolveWorkspaceRoot"
|
|
86
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
87
|
+
Object.defineProperty(exports, '__esModule', {
|
|
88
|
+
value: true
|
|
89
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function resolveWorkspaceRoot(cwd?: string, explicitWorkspace?: string, configDir?: string): string;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { dirname, join, resolve } from "node:path";
|
|
4
|
+
const DEFAULT_CONFIG_DIR = ".wingman";
|
|
5
|
+
const WORKSPACE_MARKERS = [
|
|
6
|
+
"wingman.config.json",
|
|
7
|
+
"agents"
|
|
8
|
+
];
|
|
9
|
+
function resolveWorkspaceRoot(cwd = process.cwd(), explicitWorkspace, configDir = DEFAULT_CONFIG_DIR) {
|
|
10
|
+
if ("string" == typeof explicitWorkspace && explicitWorkspace.trim()) return resolve(cwd, explicitWorkspace.trim());
|
|
11
|
+
const startDir = resolve(cwd);
|
|
12
|
+
const gitRoot = findGitRoot(startDir);
|
|
13
|
+
const homeDir = resolve(homedir());
|
|
14
|
+
let current = startDir;
|
|
15
|
+
while(true){
|
|
16
|
+
if (hasWorkspaceMarker(current, configDir)) return current;
|
|
17
|
+
if (gitRoot && current === gitRoot) break;
|
|
18
|
+
const parent = dirname(current);
|
|
19
|
+
if (parent === current) break;
|
|
20
|
+
if (parent === homeDir && startDir !== homeDir) break;
|
|
21
|
+
current = parent;
|
|
22
|
+
}
|
|
23
|
+
const nestedWorkspace = findNestedWorkspaceRoot(startDir, configDir);
|
|
24
|
+
if (nestedWorkspace) return nestedWorkspace;
|
|
25
|
+
return startDir;
|
|
26
|
+
}
|
|
27
|
+
function hasWorkspaceMarker(dir, configDir) {
|
|
28
|
+
return WORKSPACE_MARKERS.some((marker)=>existsSync(join(dir, configDir, marker)));
|
|
29
|
+
}
|
|
30
|
+
function findGitRoot(startDir) {
|
|
31
|
+
let current = resolve(startDir);
|
|
32
|
+
while(true){
|
|
33
|
+
if (existsSync(join(current, ".git"))) return current;
|
|
34
|
+
const parent = dirname(current);
|
|
35
|
+
if (parent === current) return null;
|
|
36
|
+
current = parent;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function findNestedWorkspaceRoot(startDir, configDir) {
|
|
40
|
+
const homeDir = resolve(homedir());
|
|
41
|
+
let current = resolve(startDir);
|
|
42
|
+
while(true){
|
|
43
|
+
const candidates = [
|
|
44
|
+
join(current, "apps", "wingman"),
|
|
45
|
+
join(current, "wingman")
|
|
46
|
+
];
|
|
47
|
+
for (const candidate of candidates)if (existsSync(join(candidate, configDir, "wingman.config.json"))) return candidate;
|
|
48
|
+
const parent = dirname(current);
|
|
49
|
+
if (parent === current) break;
|
|
50
|
+
if (parent === homeDir && startDir !== homeDir) break;
|
|
51
|
+
current = parent;
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
export { resolveWorkspaceRoot };
|
package/dist/cli/index.cjs
CHANGED
|
@@ -4,12 +4,14 @@ var __webpack_exports__ = {};
|
|
|
4
4
|
const env_cjs_namespaceObject = require("../gateway/env.cjs");
|
|
5
5
|
const external_logger_cjs_namespaceObject = require("../logger.cjs");
|
|
6
6
|
const agent_cjs_namespaceObject = require("./commands/agent.cjs");
|
|
7
|
+
const browser_cjs_namespaceObject = require("./commands/browser.cjs");
|
|
7
8
|
const gateway_cjs_namespaceObject = require("./commands/gateway.cjs");
|
|
8
9
|
const init_cjs_namespaceObject = require("./commands/init.cjs");
|
|
9
10
|
const provider_cjs_namespaceObject = require("./commands/provider.cjs");
|
|
10
11
|
const skill_cjs_namespaceObject = require("./commands/skill.cjs");
|
|
11
12
|
const loader_cjs_namespaceObject = require("./config/loader.cjs");
|
|
12
13
|
const outputManager_cjs_namespaceObject = require("./core/outputManager.cjs");
|
|
14
|
+
const workspace_cjs_namespaceObject = require("./core/workspace.cjs");
|
|
13
15
|
function parseArgs(argv) {
|
|
14
16
|
const args = argv.slice(2);
|
|
15
17
|
if (args.includes("--help") || args.includes("-h")) return {
|
|
@@ -44,6 +46,7 @@ function parseArgs(argv) {
|
|
|
44
46
|
parsed.verbosity = vCount >= 2 ? "debug" : "info";
|
|
45
47
|
} else if (arg.startsWith("--")) {
|
|
46
48
|
const [key, value] = arg.slice(2).split("=");
|
|
49
|
+
parsed.commandOptions ||= {};
|
|
47
50
|
if (void 0 !== value) parsed.commandOptions[key] = value;
|
|
48
51
|
else if (i + 1 < args.length && !args[i + 1].startsWith("--")) {
|
|
49
52
|
parsed.commandOptions[key] = args[i + 1];
|
|
@@ -67,6 +70,12 @@ function determineVerbosity(cliVerbosity, configLevel) {
|
|
|
67
70
|
}
|
|
68
71
|
return configLevel;
|
|
69
72
|
}
|
|
73
|
+
function getStringCommandOption(options, key) {
|
|
74
|
+
const value = options?.[key];
|
|
75
|
+
if ("string" != typeof value) return;
|
|
76
|
+
const trimmed = value.trim();
|
|
77
|
+
return trimmed || void 0;
|
|
78
|
+
}
|
|
70
79
|
function showHelp() {
|
|
71
80
|
console.log(`
|
|
72
81
|
Wingman CLI - AI coding assistant
|
|
@@ -76,11 +85,12 @@ Usage:
|
|
|
76
85
|
wingman init [options]
|
|
77
86
|
wingman skill <subcommand> [args]
|
|
78
87
|
wingman provider <subcommand> [options]
|
|
88
|
+
wingman browser <subcommand> [options]
|
|
79
89
|
wingman gateway <subcommand> [options]
|
|
80
90
|
|
|
81
91
|
Commands:
|
|
82
92
|
agent Invoke a specific agent directly
|
|
83
|
-
init
|
|
93
|
+
init Onboard workspace and sync bundled agents
|
|
84
94
|
skill browse Browse available skills from repository
|
|
85
95
|
skill install <name> Install a skill
|
|
86
96
|
skill list List installed skills
|
|
@@ -88,6 +98,11 @@ Commands:
|
|
|
88
98
|
provider login <provider> Store provider credentials
|
|
89
99
|
provider logout <provider> Remove stored provider credentials
|
|
90
100
|
provider status Show provider configuration status
|
|
101
|
+
browser profile init <id> Create/configure a browser_control profile
|
|
102
|
+
browser profile open [id] Open a profile in Chrome for interactive login
|
|
103
|
+
browser extension install [id] Register bundled Wingman extension or custom unpacked extension
|
|
104
|
+
browser extension pair Configure secure local relay pairing token
|
|
105
|
+
browser extension list List configured browser extensions
|
|
91
106
|
gateway start Start the gateway server
|
|
92
107
|
gateway stop Stop the gateway server
|
|
93
108
|
gateway status Show gateway status
|
|
@@ -95,6 +110,8 @@ Commands:
|
|
|
95
110
|
|
|
96
111
|
Options:
|
|
97
112
|
--agent <name> Agent name to invoke (required for agent command)
|
|
113
|
+
--workspace <path> Workspace root (defaults to nearest ancestor with .wingman/)
|
|
114
|
+
--config-dir <dir> Config directory name (default: .wingman)
|
|
98
115
|
--local Run agent locally instead of via gateway
|
|
99
116
|
--gateway <url> Gateway URL (default from config)
|
|
100
117
|
--token <token> Gateway auth token
|
|
@@ -110,12 +127,18 @@ Examples:
|
|
|
110
127
|
wingman agent --agent coder --local "fix the tests"
|
|
111
128
|
wingman agent --agent coder --gateway ws://localhost:18789/ws --token sk-... "ship it"
|
|
112
129
|
wingman init
|
|
130
|
+
wingman init --mode sync --only agents --force
|
|
113
131
|
wingman skill browse
|
|
114
132
|
wingman skill install pdf
|
|
115
133
|
wingman skill list
|
|
116
134
|
wingman provider status
|
|
117
135
|
wingman provider login codex
|
|
118
136
|
wingman provider login copilot --token="<token>"
|
|
137
|
+
wingman browser profile init trading
|
|
138
|
+
wingman browser profile open trading --url https://robinhood.com/login
|
|
139
|
+
wingman browser extension install --default
|
|
140
|
+
wingman browser extension pair
|
|
141
|
+
wingman browser extension install relay --source ./relay-extension --default
|
|
119
142
|
wingman gateway start
|
|
120
143
|
wingman gateway join ws://localhost:3000/ws --name="agent-1"
|
|
121
144
|
|
|
@@ -133,7 +156,9 @@ async function main() {
|
|
|
133
156
|
showHelp();
|
|
134
157
|
process.exit(0);
|
|
135
158
|
}
|
|
136
|
-
const
|
|
159
|
+
const configDir = getStringCommandOption(parsed.commandOptions, "config-dir") || getStringCommandOption(parsed.commandOptions, "configDir") || ".wingman";
|
|
160
|
+
const workspace = (0, workspace_cjs_namespaceObject.resolveWorkspaceRoot)(process.cwd(), getStringCommandOption(parsed.commandOptions, "workspace"), configDir);
|
|
161
|
+
const configLoader = new loader_cjs_namespaceObject.WingmanConfigLoader(configDir, workspace);
|
|
137
162
|
const config = configLoader.loadConfig();
|
|
138
163
|
let outputMode;
|
|
139
164
|
outputMode = "interactive" === parsed.outputMode || "json" === parsed.outputMode ? parsed.outputMode : "auto" === config.cli.outputMode ? outputManager_cjs_namespaceObject.OutputManager.detectMode() : config.cli.outputMode;
|
|
@@ -150,6 +175,8 @@ async function main() {
|
|
|
150
175
|
const token = parsed.commandOptions?.token || gatewayConfig?.auth?.token || (0, env_cjs_namespaceObject.getGatewayTokenFromEnv)();
|
|
151
176
|
const password = parsed.commandOptions?.password || gatewayConfig?.auth?.password;
|
|
152
177
|
await (0, agent_cjs_namespaceObject.executeAgentCommand)(commandArgs, {
|
|
178
|
+
workspace,
|
|
179
|
+
configDir,
|
|
153
180
|
local: Boolean(parsed.commandOptions?.local),
|
|
154
181
|
gatewayUrl,
|
|
155
182
|
token,
|
|
@@ -162,14 +189,20 @@ async function main() {
|
|
|
162
189
|
verbosity,
|
|
163
190
|
outputMode
|
|
164
191
|
};
|
|
165
|
-
await (0, skill_cjs_namespaceObject.executeSkillCommand)(commandArgs
|
|
192
|
+
await (0, skill_cjs_namespaceObject.executeSkillCommand)(commandArgs, {
|
|
193
|
+
workspace,
|
|
194
|
+
configDir
|
|
195
|
+
});
|
|
166
196
|
} else if ("gateway" === parsed.command) {
|
|
167
197
|
const commandArgs = {
|
|
168
198
|
subcommand: parsed.subcommand,
|
|
169
199
|
args: parsed.subcommandArgs,
|
|
170
200
|
options: parsed.commandOptions || {}
|
|
171
201
|
};
|
|
172
|
-
await (0, gateway_cjs_namespaceObject.executeGatewayCommand)(commandArgs
|
|
202
|
+
await (0, gateway_cjs_namespaceObject.executeGatewayCommand)(commandArgs, {
|
|
203
|
+
workspace,
|
|
204
|
+
configDir
|
|
205
|
+
});
|
|
173
206
|
} else if ("provider" === parsed.command) {
|
|
174
207
|
const commandArgs = {
|
|
175
208
|
subcommand: parsed.subcommand,
|
|
@@ -179,6 +212,18 @@ async function main() {
|
|
|
179
212
|
options: parsed.commandOptions || {}
|
|
180
213
|
};
|
|
181
214
|
await (0, provider_cjs_namespaceObject.executeProviderCommand)(commandArgs);
|
|
215
|
+
} else if ("browser" === parsed.command) {
|
|
216
|
+
const commandArgs = {
|
|
217
|
+
subcommand: parsed.subcommand,
|
|
218
|
+
args: parsed.subcommandArgs,
|
|
219
|
+
verbosity,
|
|
220
|
+
outputMode,
|
|
221
|
+
options: parsed.commandOptions || {}
|
|
222
|
+
};
|
|
223
|
+
await (0, browser_cjs_namespaceObject.executeBrowserCommand)(commandArgs, {
|
|
224
|
+
workspace,
|
|
225
|
+
configDir
|
|
226
|
+
});
|
|
182
227
|
} else if ("init" === parsed.command || "onboard" === parsed.command) {
|
|
183
228
|
const commandArgs = {
|
|
184
229
|
subcommand: parsed.subcommand,
|
|
@@ -188,7 +233,10 @@ async function main() {
|
|
|
188
233
|
options: parsed.commandOptions || {},
|
|
189
234
|
agent: parsed.agent
|
|
190
235
|
};
|
|
191
|
-
await (0, init_cjs_namespaceObject.executeInitCommand)(commandArgs
|
|
236
|
+
await (0, init_cjs_namespaceObject.executeInitCommand)(commandArgs, {
|
|
237
|
+
workspace,
|
|
238
|
+
configDir
|
|
239
|
+
});
|
|
192
240
|
} else {
|
|
193
241
|
const logFile = (0, external_logger_cjs_namespaceObject.getLogFilePath)();
|
|
194
242
|
(0, external_logger_cjs_namespaceObject.createLogger)(verbosity).error(`Unknown command: ${parsed.command}`);
|
package/dist/cli/index.js
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
import { getGatewayTokenFromEnv } from "../gateway/env.js";
|
|
3
3
|
import { createLogger, getLogFilePath } from "../logger.js";
|
|
4
4
|
import { executeAgentCommand } from "./commands/agent.js";
|
|
5
|
+
import { executeBrowserCommand } from "./commands/browser.js";
|
|
5
6
|
import { executeGatewayCommand } from "./commands/gateway.js";
|
|
6
7
|
import { executeInitCommand } from "./commands/init.js";
|
|
7
8
|
import { executeProviderCommand } from "./commands/provider.js";
|
|
8
9
|
import { executeSkillCommand } from "./commands/skill.js";
|
|
9
10
|
import { WingmanConfigLoader } from "./config/loader.js";
|
|
10
11
|
import { OutputManager } from "./core/outputManager.js";
|
|
12
|
+
import { resolveWorkspaceRoot } from "./core/workspace.js";
|
|
11
13
|
function parseArgs(argv) {
|
|
12
14
|
const args = argv.slice(2);
|
|
13
15
|
if (args.includes("--help") || args.includes("-h")) return {
|
|
@@ -42,6 +44,7 @@ function parseArgs(argv) {
|
|
|
42
44
|
parsed.verbosity = vCount >= 2 ? "debug" : "info";
|
|
43
45
|
} else if (arg.startsWith("--")) {
|
|
44
46
|
const [key, value] = arg.slice(2).split("=");
|
|
47
|
+
parsed.commandOptions ||= {};
|
|
45
48
|
if (void 0 !== value) parsed.commandOptions[key] = value;
|
|
46
49
|
else if (i + 1 < args.length && !args[i + 1].startsWith("--")) {
|
|
47
50
|
parsed.commandOptions[key] = args[i + 1];
|
|
@@ -65,6 +68,12 @@ function determineVerbosity(cliVerbosity, configLevel) {
|
|
|
65
68
|
}
|
|
66
69
|
return configLevel;
|
|
67
70
|
}
|
|
71
|
+
function getStringCommandOption(options, key) {
|
|
72
|
+
const value = options?.[key];
|
|
73
|
+
if ("string" != typeof value) return;
|
|
74
|
+
const trimmed = value.trim();
|
|
75
|
+
return trimmed || void 0;
|
|
76
|
+
}
|
|
68
77
|
function showHelp() {
|
|
69
78
|
console.log(`
|
|
70
79
|
Wingman CLI - AI coding assistant
|
|
@@ -74,11 +83,12 @@ Usage:
|
|
|
74
83
|
wingman init [options]
|
|
75
84
|
wingman skill <subcommand> [args]
|
|
76
85
|
wingman provider <subcommand> [options]
|
|
86
|
+
wingman browser <subcommand> [options]
|
|
77
87
|
wingman gateway <subcommand> [options]
|
|
78
88
|
|
|
79
89
|
Commands:
|
|
80
90
|
agent Invoke a specific agent directly
|
|
81
|
-
init
|
|
91
|
+
init Onboard workspace and sync bundled agents
|
|
82
92
|
skill browse Browse available skills from repository
|
|
83
93
|
skill install <name> Install a skill
|
|
84
94
|
skill list List installed skills
|
|
@@ -86,6 +96,11 @@ Commands:
|
|
|
86
96
|
provider login <provider> Store provider credentials
|
|
87
97
|
provider logout <provider> Remove stored provider credentials
|
|
88
98
|
provider status Show provider configuration status
|
|
99
|
+
browser profile init <id> Create/configure a browser_control profile
|
|
100
|
+
browser profile open [id] Open a profile in Chrome for interactive login
|
|
101
|
+
browser extension install [id] Register bundled Wingman extension or custom unpacked extension
|
|
102
|
+
browser extension pair Configure secure local relay pairing token
|
|
103
|
+
browser extension list List configured browser extensions
|
|
89
104
|
gateway start Start the gateway server
|
|
90
105
|
gateway stop Stop the gateway server
|
|
91
106
|
gateway status Show gateway status
|
|
@@ -93,6 +108,8 @@ Commands:
|
|
|
93
108
|
|
|
94
109
|
Options:
|
|
95
110
|
--agent <name> Agent name to invoke (required for agent command)
|
|
111
|
+
--workspace <path> Workspace root (defaults to nearest ancestor with .wingman/)
|
|
112
|
+
--config-dir <dir> Config directory name (default: .wingman)
|
|
96
113
|
--local Run agent locally instead of via gateway
|
|
97
114
|
--gateway <url> Gateway URL (default from config)
|
|
98
115
|
--token <token> Gateway auth token
|
|
@@ -108,12 +125,18 @@ Examples:
|
|
|
108
125
|
wingman agent --agent coder --local "fix the tests"
|
|
109
126
|
wingman agent --agent coder --gateway ws://localhost:18789/ws --token sk-... "ship it"
|
|
110
127
|
wingman init
|
|
128
|
+
wingman init --mode sync --only agents --force
|
|
111
129
|
wingman skill browse
|
|
112
130
|
wingman skill install pdf
|
|
113
131
|
wingman skill list
|
|
114
132
|
wingman provider status
|
|
115
133
|
wingman provider login codex
|
|
116
134
|
wingman provider login copilot --token="<token>"
|
|
135
|
+
wingman browser profile init trading
|
|
136
|
+
wingman browser profile open trading --url https://robinhood.com/login
|
|
137
|
+
wingman browser extension install --default
|
|
138
|
+
wingman browser extension pair
|
|
139
|
+
wingman browser extension install relay --source ./relay-extension --default
|
|
117
140
|
wingman gateway start
|
|
118
141
|
wingman gateway join ws://localhost:3000/ws --name="agent-1"
|
|
119
142
|
|
|
@@ -131,7 +154,9 @@ async function main() {
|
|
|
131
154
|
showHelp();
|
|
132
155
|
process.exit(0);
|
|
133
156
|
}
|
|
134
|
-
const
|
|
157
|
+
const configDir = getStringCommandOption(parsed.commandOptions, "config-dir") || getStringCommandOption(parsed.commandOptions, "configDir") || ".wingman";
|
|
158
|
+
const workspace = resolveWorkspaceRoot(process.cwd(), getStringCommandOption(parsed.commandOptions, "workspace"), configDir);
|
|
159
|
+
const configLoader = new WingmanConfigLoader(configDir, workspace);
|
|
135
160
|
const config = configLoader.loadConfig();
|
|
136
161
|
let outputMode;
|
|
137
162
|
outputMode = "interactive" === parsed.outputMode || "json" === parsed.outputMode ? parsed.outputMode : "auto" === config.cli.outputMode ? OutputManager.detectMode() : config.cli.outputMode;
|
|
@@ -148,6 +173,8 @@ async function main() {
|
|
|
148
173
|
const token = parsed.commandOptions?.token || gatewayConfig?.auth?.token || getGatewayTokenFromEnv();
|
|
149
174
|
const password = parsed.commandOptions?.password || gatewayConfig?.auth?.password;
|
|
150
175
|
await executeAgentCommand(commandArgs, {
|
|
176
|
+
workspace,
|
|
177
|
+
configDir,
|
|
151
178
|
local: Boolean(parsed.commandOptions?.local),
|
|
152
179
|
gatewayUrl,
|
|
153
180
|
token,
|
|
@@ -160,14 +187,20 @@ async function main() {
|
|
|
160
187
|
verbosity,
|
|
161
188
|
outputMode
|
|
162
189
|
};
|
|
163
|
-
await executeSkillCommand(commandArgs
|
|
190
|
+
await executeSkillCommand(commandArgs, {
|
|
191
|
+
workspace,
|
|
192
|
+
configDir
|
|
193
|
+
});
|
|
164
194
|
} else if ("gateway" === parsed.command) {
|
|
165
195
|
const commandArgs = {
|
|
166
196
|
subcommand: parsed.subcommand,
|
|
167
197
|
args: parsed.subcommandArgs,
|
|
168
198
|
options: parsed.commandOptions || {}
|
|
169
199
|
};
|
|
170
|
-
await executeGatewayCommand(commandArgs
|
|
200
|
+
await executeGatewayCommand(commandArgs, {
|
|
201
|
+
workspace,
|
|
202
|
+
configDir
|
|
203
|
+
});
|
|
171
204
|
} else if ("provider" === parsed.command) {
|
|
172
205
|
const commandArgs = {
|
|
173
206
|
subcommand: parsed.subcommand,
|
|
@@ -177,6 +210,18 @@ async function main() {
|
|
|
177
210
|
options: parsed.commandOptions || {}
|
|
178
211
|
};
|
|
179
212
|
await executeProviderCommand(commandArgs);
|
|
213
|
+
} else if ("browser" === parsed.command) {
|
|
214
|
+
const commandArgs = {
|
|
215
|
+
subcommand: parsed.subcommand,
|
|
216
|
+
args: parsed.subcommandArgs,
|
|
217
|
+
verbosity,
|
|
218
|
+
outputMode,
|
|
219
|
+
options: parsed.commandOptions || {}
|
|
220
|
+
};
|
|
221
|
+
await executeBrowserCommand(commandArgs, {
|
|
222
|
+
workspace,
|
|
223
|
+
configDir
|
|
224
|
+
});
|
|
180
225
|
} else if ("init" === parsed.command || "onboard" === parsed.command) {
|
|
181
226
|
const commandArgs = {
|
|
182
227
|
subcommand: parsed.subcommand,
|
|
@@ -186,7 +231,10 @@ async function main() {
|
|
|
186
231
|
options: parsed.commandOptions || {},
|
|
187
232
|
agent: parsed.agent
|
|
188
233
|
};
|
|
189
|
-
await executeInitCommand(commandArgs
|
|
234
|
+
await executeInitCommand(commandArgs, {
|
|
235
|
+
workspace,
|
|
236
|
+
configDir
|
|
237
|
+
});
|
|
190
238
|
} else {
|
|
191
239
|
const logFile = getLogFilePath();
|
|
192
240
|
createLogger(verbosity).error(`Unknown command: ${parsed.command}`);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.r = (exports1)=>{
|
|
5
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
6
|
+
value: 'Module'
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
})();
|
|
13
|
+
var __webpack_exports__ = {};
|
|
14
|
+
__webpack_require__.r(__webpack_exports__);
|
|
15
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
16
|
+
Object.defineProperty(exports, '__esModule', {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LogLevel } from "../../logger.js";
|
|
2
|
+
import type { OutputMode } from "../types.js";
|
|
3
|
+
export interface BrowserCommandArgs {
|
|
4
|
+
subcommand: string;
|
|
5
|
+
args: string[];
|
|
6
|
+
verbosity: LogLevel;
|
|
7
|
+
outputMode: OutputMode;
|
|
8
|
+
options: Record<string, unknown>;
|
|
9
|
+
}
|
|
File without changes
|