pilotswarm 0.0.1 → 0.4.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/README.md +37 -1
- package/mcp/README.md +484 -0
- package/mcp/dist/bin/pilotswarm-mcp.d.ts +3 -0
- package/mcp/dist/bin/pilotswarm-mcp.d.ts.map +1 -0
- package/mcp/dist/bin/pilotswarm-mcp.js +367 -0
- package/mcp/dist/bin/pilotswarm-mcp.js.map +1 -0
- package/mcp/dist/src/auth.d.ts +7 -0
- package/mcp/dist/src/auth.d.ts.map +1 -0
- package/mcp/dist/src/auth.js +99 -0
- package/mcp/dist/src/auth.js.map +1 -0
- package/mcp/dist/src/context.d.ts +48 -0
- package/mcp/dist/src/context.d.ts.map +1 -0
- package/mcp/dist/src/context.js +83 -0
- package/mcp/dist/src/context.js.map +1 -0
- package/mcp/dist/src/index.d.ts +4 -0
- package/mcp/dist/src/index.d.ts.map +1 -0
- package/mcp/dist/src/index.js +3 -0
- package/mcp/dist/src/index.js.map +1 -0
- package/mcp/dist/src/prompts/skills.d.ts +4 -0
- package/mcp/dist/src/prompts/skills.d.ts.map +1 -0
- package/mcp/dist/src/prompts/skills.js +11 -0
- package/mcp/dist/src/prompts/skills.js.map +1 -0
- package/mcp/dist/src/resources/agents.d.ts +4 -0
- package/mcp/dist/src/resources/agents.d.ts.map +1 -0
- package/mcp/dist/src/resources/agents.js +64 -0
- package/mcp/dist/src/resources/agents.js.map +1 -0
- package/mcp/dist/src/resources/facts.d.ts +4 -0
- package/mcp/dist/src/resources/facts.d.ts.map +1 -0
- package/mcp/dist/src/resources/facts.js +125 -0
- package/mcp/dist/src/resources/facts.js.map +1 -0
- package/mcp/dist/src/resources/models.d.ts +4 -0
- package/mcp/dist/src/resources/models.d.ts.map +1 -0
- package/mcp/dist/src/resources/models.js +43 -0
- package/mcp/dist/src/resources/models.js.map +1 -0
- package/mcp/dist/src/resources/sessions.d.ts +4 -0
- package/mcp/dist/src/resources/sessions.d.ts.map +1 -0
- package/mcp/dist/src/resources/sessions.js +190 -0
- package/mcp/dist/src/resources/sessions.js.map +1 -0
- package/mcp/dist/src/resources/subscriptions.d.ts +9 -0
- package/mcp/dist/src/resources/subscriptions.d.ts.map +1 -0
- package/mcp/dist/src/resources/subscriptions.js +157 -0
- package/mcp/dist/src/resources/subscriptions.js.map +1 -0
- package/mcp/dist/src/server.d.ts +4 -0
- package/mcp/dist/src/server.d.ts.map +1 -0
- package/mcp/dist/src/server.js +59 -0
- package/mcp/dist/src/server.js.map +1 -0
- package/mcp/dist/src/tools/agents.d.ts +4 -0
- package/mcp/dist/src/tools/agents.d.ts.map +1 -0
- package/mcp/dist/src/tools/agents.js +317 -0
- package/mcp/dist/src/tools/agents.js.map +1 -0
- package/mcp/dist/src/tools/facts.d.ts +4 -0
- package/mcp/dist/src/tools/facts.d.ts.map +1 -0
- package/mcp/dist/src/tools/facts.js +151 -0
- package/mcp/dist/src/tools/facts.js.map +1 -0
- package/mcp/dist/src/tools/models.d.ts +4 -0
- package/mcp/dist/src/tools/models.d.ts.map +1 -0
- package/mcp/dist/src/tools/models.js +256 -0
- package/mcp/dist/src/tools/models.js.map +1 -0
- package/mcp/dist/src/tools/sessions.d.ts +4 -0
- package/mcp/dist/src/tools/sessions.d.ts.map +1 -0
- package/mcp/dist/src/tools/sessions.js +606 -0
- package/mcp/dist/src/tools/sessions.js.map +1 -0
- package/mcp/dist/src/util/command.d.ts +52 -0
- package/mcp/dist/src/util/command.d.ts.map +1 -0
- package/mcp/dist/src/util/command.js +78 -0
- package/mcp/dist/src/util/command.js.map +1 -0
- package/package.json +81 -6
- package/tui/README.md +35 -0
- package/tui/bin/tui.js +30 -0
- package/tui/plugins/.mcp.json +7 -0
- package/tui/plugins/plugin.json +13 -0
- package/tui/plugins/session-policy.json +8 -0
- package/tui/src/app.js +850 -0
- package/tui/src/auth/cli.js +111 -0
- package/tui/src/auth/entra-auth.js +218 -0
- package/tui/src/bootstrap-env.js +176 -0
- package/tui/src/embedded-workers.js +79 -0
- package/tui/src/http-transport-host.js +106 -0
- package/tui/src/index.js +340 -0
- package/tui/src/node-sdk-transport.js +1793 -0
- package/tui/src/platform.js +984 -0
- package/tui/src/plugin-config.js +239 -0
- package/tui/src/portal.js +7 -0
- package/tui/src/version.js +7 -0
- package/tui/tui-splash.txt +11 -0
- package/ui/core/README.md +6 -0
- package/ui/core/src/commands.js +93 -0
- package/ui/core/src/context-usage.js +212 -0
- package/ui/core/src/controller.js +6104 -0
- package/ui/core/src/formatting.js +1036 -0
- package/ui/core/src/history.js +932 -0
- package/ui/core/src/index.js +13 -0
- package/ui/core/src/layout.js +332 -0
- package/ui/core/src/reducer.js +1935 -0
- package/ui/core/src/selectors.js +5409 -0
- package/ui/core/src/session-errors.js +14 -0
- package/ui/core/src/session-tree.js +151 -0
- package/ui/core/src/state.js +248 -0
- package/ui/core/src/store.js +23 -0
- package/ui/core/src/system-titles.js +24 -0
- package/ui/core/src/themes/catppuccin-mocha.js +56 -0
- package/ui/core/src/themes/cobalt2.js +56 -0
- package/ui/core/src/themes/dark-high-contrast.js +56 -0
- package/ui/core/src/themes/daylight.js +62 -0
- package/ui/core/src/themes/dracula.js +56 -0
- package/ui/core/src/themes/github-dark.js +56 -0
- package/ui/core/src/themes/github-light.js +59 -0
- package/ui/core/src/themes/gruvbox-dark.js +56 -0
- package/ui/core/src/themes/hacker-x-matrix.js +56 -0
- package/ui/core/src/themes/hacker-x-orion-prime.js +56 -0
- package/ui/core/src/themes/helpers.js +79 -0
- package/ui/core/src/themes/high-contrast-mono.js +59 -0
- package/ui/core/src/themes/index.js +52 -0
- package/ui/core/src/themes/light-high-contrast.js +62 -0
- package/ui/core/src/themes/noctis-obscuro.js +56 -0
- package/ui/core/src/themes/noctis.js +56 -0
- package/ui/core/src/themes/paper-ink.js +62 -0
- package/ui/core/src/themes/solarized-ops.js +59 -0
- package/ui/core/src/themes/terminal-green.js +59 -0
- package/ui/core/src/themes/tokyo-night.js +56 -0
- package/ui/react/README.md +5 -0
- package/ui/react/src/chat-status.js +39 -0
- package/ui/react/src/components.js +1989 -0
- package/ui/react/src/index.js +4 -0
- package/ui/react/src/platform.js +15 -0
- package/ui/react/src/use-controller-state.js +38 -0
- package/ui/react/src/web-app.js +4390 -0
- package/web/README.md +198 -0
- package/web/api/router.js +196 -0
- package/web/api/ws.js +152 -0
- package/web/auth/authz/engine.js +204 -0
- package/web/auth/config.js +115 -0
- package/web/auth/index.js +175 -0
- package/web/auth/normalize/entra.js +22 -0
- package/web/auth/providers/entra.js +76 -0
- package/web/auth/providers/none.js +24 -0
- package/web/auth.js +10 -0
- package/web/bin/serve.js +53 -0
- package/web/config.js +20 -0
- package/web/dist/app.js +469 -0
- package/web/dist/assets/index-CBgQQk-j.css +1 -0
- package/web/dist/assets/index-DMefB7Wb.js +24 -0
- package/web/dist/assets/msal-CytV9RFv.js +7 -0
- package/web/dist/assets/pilotswarm-DyBlqVTY.js +87 -0
- package/web/dist/assets/react-BZwsW8pe.js +1 -0
- package/web/dist/index.html +16 -0
- package/web/runtime.js +454 -0
- package/web/server.js +276 -0
- package/index.js +0 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { CommandResponse, PilotSwarmManagementClient } from "pilotswarm-sdk";
|
|
2
|
+
type CommandResponseLike = CommandResponse & {
|
|
3
|
+
version?: number;
|
|
4
|
+
emittedAt?: number;
|
|
5
|
+
};
|
|
6
|
+
export declare class CommandRejectedError extends Error {
|
|
7
|
+
readonly cmd: string;
|
|
8
|
+
readonly cmdId: string;
|
|
9
|
+
readonly response: CommandResponseLike;
|
|
10
|
+
constructor(response: CommandResponseLike);
|
|
11
|
+
}
|
|
12
|
+
export declare class CommandTimeoutError extends Error {
|
|
13
|
+
readonly cmd: string;
|
|
14
|
+
readonly cmdId: string;
|
|
15
|
+
readonly timeoutMs: number;
|
|
16
|
+
constructor(cmd: string, cmdId: string, timeoutMs: number);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Send a command to a session's orchestration and wait for the orchestration's
|
|
20
|
+
* response.
|
|
21
|
+
*
|
|
22
|
+
* The bare `mgmt.sendCommand(...)` call is fire-and-forget — it returns once the
|
|
23
|
+
* command is enqueued, regardless of whether the orchestration ultimately
|
|
24
|
+
* accepts it. Unknown commands (e.g. anything other than the orchestration's
|
|
25
|
+
* recognized set: `set_model` / `list_models` / `get_info` / `done` /
|
|
26
|
+
* `cancel` / `delete`) are queued, processed, and rejected with
|
|
27
|
+
* `error: "Unknown command: ..."` written to KV — but the caller never sees
|
|
28
|
+
* that error if it doesn't poll.
|
|
29
|
+
*
|
|
30
|
+
* This helper closes the loop: enqueue with a fresh `cmdId`, poll the
|
|
31
|
+
* orchestration's KV-backed response channel until the response shows up,
|
|
32
|
+
* then return the response or throw `CommandRejectedError` /
|
|
33
|
+
* `CommandTimeoutError`.
|
|
34
|
+
*
|
|
35
|
+
* @param mgmt - PilotSwarmManagementClient instance
|
|
36
|
+
* @param sessionId - target session id
|
|
37
|
+
* @param cmd - command name (e.g. "set_model")
|
|
38
|
+
* @param args - command-specific arguments
|
|
39
|
+
* @param opts.timeoutMs - max time to wait for the orchestration's response
|
|
40
|
+
* (default 15s)
|
|
41
|
+
* @param opts.pollIntervalMs - KV poll interval (default 200ms)
|
|
42
|
+
* @param opts.signal - optional abort signal
|
|
43
|
+
* @throws CommandRejectedError if the orchestration writes an `error` response
|
|
44
|
+
* @throws CommandTimeoutError if no response shows up within `timeoutMs`
|
|
45
|
+
*/
|
|
46
|
+
export declare function sendCommandAndWait(mgmt: PilotSwarmManagementClient, sessionId: string, cmd: string, args?: Record<string, unknown>, opts?: {
|
|
47
|
+
timeoutMs?: number;
|
|
48
|
+
pollIntervalMs?: number;
|
|
49
|
+
signal?: AbortSignal;
|
|
50
|
+
}): Promise<CommandResponseLike>;
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/util/command.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAKlF,KAAK,mBAAmB,GAAG,eAAe,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtF,qBAAa,oBAAqB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;gBAE3B,QAAQ,EAAE,mBAAmB;CAO5C;AAED,qBAAa,mBAAoB,SAAQ,KAAK;IAC1C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBAEf,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAO5D;AAKD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,kBAAkB,CACpC,IAAI,EAAE,0BAA0B,EAChC,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,IAAI,CAAC,EAAE;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,WAAW,CAAC;CACxB,GACF,OAAO,CAAC,mBAAmB,CAAC,CAqB9B"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
export class CommandRejectedError extends Error {
|
|
3
|
+
cmd;
|
|
4
|
+
cmdId;
|
|
5
|
+
response;
|
|
6
|
+
constructor(response) {
|
|
7
|
+
super(response.error ?? `Command "${response.cmd}" was rejected with no error message`);
|
|
8
|
+
this.name = "CommandRejectedError";
|
|
9
|
+
this.cmd = response.cmd;
|
|
10
|
+
this.cmdId = response.id;
|
|
11
|
+
this.response = response;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export class CommandTimeoutError extends Error {
|
|
15
|
+
cmd;
|
|
16
|
+
cmdId;
|
|
17
|
+
timeoutMs;
|
|
18
|
+
constructor(cmd, cmdId, timeoutMs) {
|
|
19
|
+
super(`Timed out after ${timeoutMs}ms waiting for response to command "${cmd}" (id=${cmdId})`);
|
|
20
|
+
this.name = "CommandTimeoutError";
|
|
21
|
+
this.cmd = cmd;
|
|
22
|
+
this.cmdId = cmdId;
|
|
23
|
+
this.timeoutMs = timeoutMs;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const DEFAULT_TIMEOUT_MS = 15_000;
|
|
27
|
+
const DEFAULT_POLL_INTERVAL_MS = 200;
|
|
28
|
+
/**
|
|
29
|
+
* Send a command to a session's orchestration and wait for the orchestration's
|
|
30
|
+
* response.
|
|
31
|
+
*
|
|
32
|
+
* The bare `mgmt.sendCommand(...)` call is fire-and-forget — it returns once the
|
|
33
|
+
* command is enqueued, regardless of whether the orchestration ultimately
|
|
34
|
+
* accepts it. Unknown commands (e.g. anything other than the orchestration's
|
|
35
|
+
* recognized set: `set_model` / `list_models` / `get_info` / `done` /
|
|
36
|
+
* `cancel` / `delete`) are queued, processed, and rejected with
|
|
37
|
+
* `error: "Unknown command: ..."` written to KV — but the caller never sees
|
|
38
|
+
* that error if it doesn't poll.
|
|
39
|
+
*
|
|
40
|
+
* This helper closes the loop: enqueue with a fresh `cmdId`, poll the
|
|
41
|
+
* orchestration's KV-backed response channel until the response shows up,
|
|
42
|
+
* then return the response or throw `CommandRejectedError` /
|
|
43
|
+
* `CommandTimeoutError`.
|
|
44
|
+
*
|
|
45
|
+
* @param mgmt - PilotSwarmManagementClient instance
|
|
46
|
+
* @param sessionId - target session id
|
|
47
|
+
* @param cmd - command name (e.g. "set_model")
|
|
48
|
+
* @param args - command-specific arguments
|
|
49
|
+
* @param opts.timeoutMs - max time to wait for the orchestration's response
|
|
50
|
+
* (default 15s)
|
|
51
|
+
* @param opts.pollIntervalMs - KV poll interval (default 200ms)
|
|
52
|
+
* @param opts.signal - optional abort signal
|
|
53
|
+
* @throws CommandRejectedError if the orchestration writes an `error` response
|
|
54
|
+
* @throws CommandTimeoutError if no response shows up within `timeoutMs`
|
|
55
|
+
*/
|
|
56
|
+
export async function sendCommandAndWait(mgmt, sessionId, cmd, args, opts) {
|
|
57
|
+
const cmdId = randomUUID();
|
|
58
|
+
const timeoutMs = opts?.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
59
|
+
const pollIntervalMs = opts?.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS;
|
|
60
|
+
await mgmt.sendCommand(sessionId, { cmd, id: cmdId, ...(args ? { args } : {}) });
|
|
61
|
+
const deadline = Date.now() + timeoutMs;
|
|
62
|
+
while (Date.now() < deadline) {
|
|
63
|
+
if (opts?.signal?.aborted)
|
|
64
|
+
throw opts.signal.reason ?? new Error("Aborted");
|
|
65
|
+
const response = await mgmt.getCommandResponse(sessionId, cmdId);
|
|
66
|
+
if (response) {
|
|
67
|
+
if (response.error)
|
|
68
|
+
throw new CommandRejectedError(response);
|
|
69
|
+
return response;
|
|
70
|
+
}
|
|
71
|
+
const remaining = deadline - Date.now();
|
|
72
|
+
if (remaining <= 0)
|
|
73
|
+
break;
|
|
74
|
+
await new Promise((resolve) => setTimeout(resolve, Math.min(pollIntervalMs, remaining)));
|
|
75
|
+
}
|
|
76
|
+
throw new CommandTimeoutError(cmd, cmdId, timeoutMs);
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/util/command.ts"],"names":[],"mappings":"AAAA,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Affan Dar",
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "PilotSwarm application package: terminal UI, browser portal + Web API server, and MCP server — one install, three bins.",
|
|
5
|
+
"type": "module",
|
|
7
6
|
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/affandar/pilotswarm.git",
|
|
10
|
+
"directory": "packages/app"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/affandar/pilotswarm#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/affandar/pilotswarm/issues"
|
|
15
|
+
},
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=24"
|
|
18
|
+
},
|
|
19
|
+
"bin": {
|
|
20
|
+
"pilotswarm": "./tui/bin/tui.js",
|
|
21
|
+
"pilotswarm-cli": "./tui/bin/tui.js",
|
|
22
|
+
"pilotswarm-web": "./web/bin/serve.js",
|
|
23
|
+
"pilotswarm-mcp": "./mcp/dist/bin/pilotswarm-mcp.js"
|
|
24
|
+
},
|
|
25
|
+
"exports": {
|
|
26
|
+
".": "./tui/src/index.js",
|
|
27
|
+
"./host": "./tui/src/portal.js",
|
|
28
|
+
"./web": "./web/server.js",
|
|
29
|
+
"./ui-core": "./ui/core/src/index.js",
|
|
30
|
+
"./ui-react": "./ui/react/src/index.js",
|
|
31
|
+
"./package.json": "./package.json"
|
|
32
|
+
},
|
|
8
33
|
"files": [
|
|
9
|
-
"
|
|
34
|
+
"tui/bin/**/*",
|
|
35
|
+
"tui/src/**/*",
|
|
36
|
+
"tui/plugins/**/*",
|
|
37
|
+
"tui/tui-splash.txt",
|
|
38
|
+
"web/auth.js",
|
|
39
|
+
"web/auth/**/*",
|
|
40
|
+
"web/api/**/*",
|
|
41
|
+
"web/bin/**/*",
|
|
42
|
+
"web/config.js",
|
|
43
|
+
"web/dist/**/*",
|
|
44
|
+
"web/runtime.js",
|
|
45
|
+
"web/server.js",
|
|
46
|
+
"mcp/dist/**/*",
|
|
47
|
+
"ui/core/src/**/*",
|
|
48
|
+
"ui/react/src/**/*",
|
|
10
49
|
"README.md"
|
|
11
|
-
]
|
|
50
|
+
],
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "npm run build:web && npm run build:mcp",
|
|
53
|
+
"build:web": "cd web && node ../node_modules/vite/bin/vite.js build",
|
|
54
|
+
"build:mcp": "cd mcp && tsc",
|
|
55
|
+
"prepack": "npm run build",
|
|
56
|
+
"start": "node ./tui/bin/tui.js local --env ../../.env.remote",
|
|
57
|
+
"start:remote": "node ./tui/bin/tui.js remote --env ../../.env.remote",
|
|
58
|
+
"web:start": "node web/server.js",
|
|
59
|
+
"web:dev": "cd web && node ../node_modules/vite/bin/vite.js --host 0.0.0.0",
|
|
60
|
+
"test": "npm run test:tui && npm run test:web && npm run test:ui && npm run test:mcp",
|
|
61
|
+
"test:tui": "node --test tui/test/*.test.mjs",
|
|
62
|
+
"test:web": "node --test web/test/*.test.mjs",
|
|
63
|
+
"test:ui": "node --test ui/core/test/*.test.mjs",
|
|
64
|
+
"test:mcp": "node mcp/test/unit/sendCommandAndWait.unit.mjs",
|
|
65
|
+
"test:mcp:integration": "node mcp/test/integration/smoke.live.mjs",
|
|
66
|
+
"test:mcp:integration:all": "node mcp/test/integration/smoke.live.mjs && node mcp/test/integration/tools.live.mjs && node mcp/test/integration/edge-cases.live.mjs && node mcp/test/integration/verify.live.mjs",
|
|
67
|
+
"clean": "rm -rf web/dist mcp/dist"
|
|
68
|
+
},
|
|
69
|
+
"dependencies": {
|
|
70
|
+
"@azure/msal-browser": "^4.26.1",
|
|
71
|
+
"@azure/msal-node": "^5.3.1",
|
|
72
|
+
"@hono/node-server": "^1.19.12",
|
|
73
|
+
"@modelcontextprotocol/sdk": "^1.28.0",
|
|
74
|
+
"express": "^5.1.0",
|
|
75
|
+
"hono": "^4.12.10",
|
|
76
|
+
"ink": "^6.8.0",
|
|
77
|
+
"jose": "^6.2.2",
|
|
78
|
+
"pilotswarm-sdk": "^0.4.0",
|
|
79
|
+
"react": "^19.2.4",
|
|
80
|
+
"react-dom": "^19.2.4",
|
|
81
|
+
"ws": "^8.18.2"
|
|
82
|
+
},
|
|
83
|
+
"devDependencies": {
|
|
84
|
+
"@vitejs/plugin-react": "^5.1.0",
|
|
85
|
+
"vite": "^7.2.0"
|
|
86
|
+
}
|
|
12
87
|
}
|
package/tui/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# pilotswarm-cli
|
|
2
|
+
|
|
3
|
+
Terminal UI for PilotSwarm.
|
|
4
|
+
|
|
5
|
+
Install:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install pilotswarm-cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
For app-specific worker modules or direct SDK imports, also add:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install pilotswarm-sdk
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Run locally against a plugin directory:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx pilotswarm local --env .env --plugin ./plugin --worker ./worker-module.js
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`pilotswarm-cli` provides the shipped TUI. Your app customizes it with `plugin/plugin.json`, `plugin/agents/*.agent.md`, `plugin/skills/*/SKILL.md`, and optional worker-side tools.
|
|
24
|
+
|
|
25
|
+
The shipped files inspector supports shared artifact browsing, download, local open, and delete flows. Binary artifacts download intact rather than being coerced through UTF-8 text previews.
|
|
26
|
+
|
|
27
|
+
Portal/runtime helpers that are intentionally shared with `pilotswarm-web`
|
|
28
|
+
are exported from `pilotswarm-cli/portal`.
|
|
29
|
+
|
|
30
|
+
Common docs:
|
|
31
|
+
|
|
32
|
+
- CLI apps: `https://github.com/affandar/PilotSwarm/blob/main/docs/developer/building/cli-apps.md`
|
|
33
|
+
- CLI agents: `https://github.com/affandar/PilotSwarm/blob/main/docs/developer/building/cli-agents.md`
|
|
34
|
+
- Keybindings: `https://github.com/affandar/PilotSwarm/blob/main/docs/user-guide/keybindings.md`
|
|
35
|
+
- DevOps sample: `https://github.com/affandar/PilotSwarm/tree/main/examples/devops-command-center`
|
package/tui/bin/tui.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// Force the shipped TUI onto production React/Ink unless the caller
|
|
4
|
+
// explicitly opts into another environment for debugging.
|
|
5
|
+
process.env.NODE_ENV ??= "production";
|
|
6
|
+
|
|
7
|
+
const { syncBundledWorkspaceUiPackages } = await import("../src/sync-workspace-ui.js");
|
|
8
|
+
syncBundledWorkspaceUiPackages({ linkWorkspacePackages: true });
|
|
9
|
+
|
|
10
|
+
const argv = process.argv.slice(2);
|
|
11
|
+
if (argv[0] === "auth") {
|
|
12
|
+
const { runAuthCommand } = await import("../src/auth/cli.js");
|
|
13
|
+
process.exitCode = await runAuthCommand(argv.slice(1)).catch((error) => {
|
|
14
|
+
console.error(`[pilotswarm] ${error?.message || error}`);
|
|
15
|
+
return 1;
|
|
16
|
+
});
|
|
17
|
+
} else {
|
|
18
|
+
const { parseCliIntoEnv } = await import("../src/bootstrap-env.js");
|
|
19
|
+
const config = parseCliIntoEnv(argv);
|
|
20
|
+
const { startTuiApp } = await import("../src/index.js");
|
|
21
|
+
try {
|
|
22
|
+
// startTuiApp exits the process on normal quit; a thrown error here is
|
|
23
|
+
// a startup failure (e.g. Web API auth). Show it cleanly instead of an
|
|
24
|
+
// unhandled-rejection stack trace — the Ink screen is not up yet.
|
|
25
|
+
await startTuiApp(config);
|
|
26
|
+
} catch (error) {
|
|
27
|
+
console.error(`[pilotswarm] ${error?.message || error}`);
|
|
28
|
+
process.exitCode = 1;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pilotswarm",
|
|
3
|
+
"description": "Durable execution building blocks — skills, agents, and tools for long-running Copilot sessions with timers, dehydration, and worker migration.",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "affandar",
|
|
7
|
+
"url": "https://github.com/affandar/pilotswarm"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"keywords": ["pilotswarm", "durable", "copilot", "timers", "orchestration"],
|
|
11
|
+
"agents": "agents/",
|
|
12
|
+
"skills": "skills/"
|
|
13
|
+
}
|