@ignitionai/cogitator 0.5.1 → 0.6.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/CHANGELOG.md +86 -0
- package/LICENSE +21 -0
- package/README.md +81 -56
- package/dist/extensions/index.js +66 -29
- package/dist/src/app-updates.js +15 -0
- package/dist/src/auth-cli.js +18 -8
- package/dist/src/auth-http.js +13 -3
- package/dist/src/auth-state.js +41 -6
- package/dist/src/board.js +3 -1
- package/dist/src/browser-http.js +146 -0
- package/dist/src/classic-configuration.js +12 -4
- package/dist/src/cli.js +29 -2
- package/dist/src/config.js +10 -0
- package/dist/src/cron.js +91 -15
- package/dist/src/db.js +55 -3
- package/dist/src/durable/approvals.js +17 -2
- package/dist/src/durable/effect-gateway.js +23 -16
- package/dist/src/durable/manager.js +13 -4
- package/dist/src/durable/mission-runtime.js +204 -46
- package/dist/src/durable/recovery.js +37 -0
- package/dist/src/durable/workers.js +22 -14
- package/dist/src/execution/confinement.js +2 -1
- package/dist/src/execution/worker-supervisor.js +222 -0
- package/dist/src/git-import.js +187 -0
- package/dist/src/github-login.js +101 -0
- package/dist/src/history.js +6 -1
- package/dist/src/host-pi.js +9 -6
- package/dist/src/json-files.js +7 -4
- package/dist/src/machine-metrics.js +49 -0
- package/dist/src/machine-types.js +1 -0
- package/dist/src/mcp-cli.js +63 -0
- package/dist/src/mcp-http.js +164 -0
- package/dist/src/mcp-oauth.js +502 -0
- package/dist/src/mcp-server.js +6 -136
- package/dist/src/mcp-tokens.js +104 -0
- package/dist/src/mcp-tools.js +264 -0
- package/dist/src/native-auth.js +9 -2
- package/dist/src/packages.js +190 -0
- package/dist/src/paths.js +1 -0
- package/dist/src/pi-child.js +180 -0
- package/dist/src/pi-rpc-wrap.js +84 -0
- package/dist/src/pool.js +58 -7
- package/dist/src/project-setup.js +63 -0
- package/dist/src/provider-login.js +72 -13
- package/dist/src/reap-orphans.js +138 -0
- package/dist/src/registry.js +66 -43
- package/dist/src/schemas.js +19 -4
- package/dist/src/server-compat.js +173 -0
- package/dist/src/server-identity.js +69 -0
- package/dist/src/server.js +597 -41
- package/dist/src/shared-browser.js +357 -0
- package/dist/src/skills-import.js +13 -4
- package/dist/src/skills-upload.js +68 -0
- package/dist/src/spawner.js +20 -4
- package/dist/src/subagents.js +242 -0
- package/dist/src/team-queue.js +262 -0
- package/dist/src/terminal-assist.js +96 -0
- package/dist/src/terminal-http.js +167 -0
- package/dist/src/terminal.js +171 -0
- package/package.json +13 -3
- package/web/dist/assets/{BrandLogo3D-BvZPXohP.js → BrandLogo3D-4IJEcixt.js} +1 -1
- package/web/dist/assets/addon-fit-DIOBYJe3.js +1 -0
- package/web/dist/assets/index-Bi_Aag-u.js +85 -0
- package/web/dist/assets/index-DQsw9iul.css +1 -0
- package/web/dist/assets/xterm-ScmBfeDI.js +16 -0
- package/web/dist/index.html +2 -2
- package/web/dist/assets/index-7Dyl-4v7.css +0 -1
- package/web/dist/assets/index-CdqzcBU-.js +0 -83
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { WebSocketServer } from "ws";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { browserHeaders } from "./auth-http.js";
|
|
4
|
+
import { AuthError, ownerSession, requireApproved, sessionById } from "./native-auth.js";
|
|
5
|
+
import { runAssist } from "./terminal-assist.js";
|
|
6
|
+
import { TerminalError } from "./terminal.js";
|
|
7
|
+
export function terminalDisabledReason(protectedMode, env = process.env) {
|
|
8
|
+
if (env.COGITATOR_TERMINAL === "0")
|
|
9
|
+
return "TERMINAL_DISABLED";
|
|
10
|
+
if (!protectedMode)
|
|
11
|
+
return "TERMINAL_PROTECTED_MODE_REQUIRED";
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
const createSchema = z.object({
|
|
15
|
+
agent_id: z.string().min(1).max(64).optional(),
|
|
16
|
+
workspace_id: z.string().min(1).max(64).optional(),
|
|
17
|
+
cols: z.number().int().optional(),
|
|
18
|
+
rows: z.number().int().optional(),
|
|
19
|
+
}).strict();
|
|
20
|
+
const assistSchema = z.object({
|
|
21
|
+
mode: z.enum(["command", "complete", "explain"]),
|
|
22
|
+
input: z.string().min(1).max(4000),
|
|
23
|
+
output: z.string().max(20_000).optional(),
|
|
24
|
+
cwd: z.string().max(1024).optional(),
|
|
25
|
+
exit_code: z.number().int().optional(),
|
|
26
|
+
agent_id: z.string().min(1).max(64).optional(),
|
|
27
|
+
}).strict();
|
|
28
|
+
export function terminalRoutes(d) {
|
|
29
|
+
const guard = (ctx) => {
|
|
30
|
+
if (d.nonBrowser(ctx.req))
|
|
31
|
+
throw new AuthError("FORBIDDEN", 403);
|
|
32
|
+
const reason = terminalDisabledReason(d.protectedMode);
|
|
33
|
+
if (reason) {
|
|
34
|
+
d.send(ctx.res, 403, { error: reason });
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
ctx.check();
|
|
38
|
+
return true;
|
|
39
|
+
};
|
|
40
|
+
const fail = (ctx, error) => {
|
|
41
|
+
if (error instanceof AuthError)
|
|
42
|
+
throw error;
|
|
43
|
+
if (error instanceof TerminalError)
|
|
44
|
+
return d.send(ctx.res, error.status, { error: error.code });
|
|
45
|
+
if (error instanceof z.ZodError)
|
|
46
|
+
return d.send(ctx.res, 400, { error: "TERMINAL_INVALID_INPUT" });
|
|
47
|
+
d.send(ctx.res, 400, { error: error instanceof Error ? error.message : "TERMINAL_FAILED" });
|
|
48
|
+
};
|
|
49
|
+
return [
|
|
50
|
+
["GET", "/api/terminal", (ctx) => {
|
|
51
|
+
if (d.nonBrowser(ctx.req))
|
|
52
|
+
throw new AuthError("FORBIDDEN", 403);
|
|
53
|
+
const reason = terminalDisabledReason(d.protectedMode) ?? (d.manager.available ? null : "TERMINAL_UNAVAILABLE");
|
|
54
|
+
d.send(ctx.res, 200, { enabled: reason === null, reason, sessions: reason ? [] : d.manager.list(), agents: reason ? [] : d.agents() });
|
|
55
|
+
}],
|
|
56
|
+
["POST", "/api/terminal/sessions", (ctx) => {
|
|
57
|
+
if (!guard(ctx))
|
|
58
|
+
return;
|
|
59
|
+
try {
|
|
60
|
+
const b = createSchema.parse(ctx.body);
|
|
61
|
+
const cwd = b.workspace_id ? d.workspaceDir(b.workspace_id) : undefined;
|
|
62
|
+
const launch = b.agent_id ? d.agent(b.agent_id, cwd) : d.shell(cwd);
|
|
63
|
+
ctx.check();
|
|
64
|
+
const info = d.manager.create(launch, { cols: b.cols ?? 80, rows: b.rows ?? 24 });
|
|
65
|
+
d.send(ctx.res, 201, { session: info, shellIntegration: launch.shellIntegration });
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
fail(ctx, error);
|
|
69
|
+
}
|
|
70
|
+
}],
|
|
71
|
+
["DELETE", "/api/terminal/sessions/:id", (ctx) => {
|
|
72
|
+
if (!guard(ctx))
|
|
73
|
+
return;
|
|
74
|
+
if (!d.manager.close(ctx.params.id))
|
|
75
|
+
return d.send(ctx.res, 404, { error: "TERMINAL_NOT_FOUND" });
|
|
76
|
+
d.send(ctx.res, 200, { ok: true });
|
|
77
|
+
}],
|
|
78
|
+
["POST", "/api/terminal/assist", async (ctx) => {
|
|
79
|
+
if (!guard(ctx))
|
|
80
|
+
return;
|
|
81
|
+
try {
|
|
82
|
+
const b = assistSchema.parse(ctx.body);
|
|
83
|
+
const target = d.assistTarget(b.agent_id);
|
|
84
|
+
const abort = new AbortController();
|
|
85
|
+
ctx.res.once("close", () => { if (!ctx.res.writableEnded)
|
|
86
|
+
abort.abort(); });
|
|
87
|
+
const result = await runAssist(d.complete, target, { mode: b.mode, input: b.input, output: b.output, cwd: b.cwd, exitCode: b.exit_code }, abort.signal);
|
|
88
|
+
ctx.check();
|
|
89
|
+
d.send(ctx.res, 200, { ...result, model: `${target.provider}/${target.model}` });
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
fail(ctx, error);
|
|
93
|
+
}
|
|
94
|
+
}],
|
|
95
|
+
];
|
|
96
|
+
}
|
|
97
|
+
const frameSchema = z.discriminatedUnion("t", [
|
|
98
|
+
z.object({ t: z.literal("i"), d: z.string().max(65_536) }),
|
|
99
|
+
z.object({ t: z.literal("r"), c: z.number().int(), r: z.number().int() }),
|
|
100
|
+
]);
|
|
101
|
+
export const TERMINAL_WS_PREFIX = "/api/terminal/ws/";
|
|
102
|
+
/** WebSocket du terminal : session propriétaire exigée et revérifiée chaque seconde. */
|
|
103
|
+
export function attachTerminalSocket(app, manager, state) {
|
|
104
|
+
const wss = new WebSocketServer({ noServer: true, maxPayload: 128 * 1024, perMessageDeflate: false });
|
|
105
|
+
app.once("close", () => { for (const peer of wss.clients)
|
|
106
|
+
peer.terminate(); wss.close(); manager.dispose(); });
|
|
107
|
+
app.on("upgrade", async (req, socket, head) => {
|
|
108
|
+
const url = req.url ?? "";
|
|
109
|
+
if (!url.startsWith(TERMINAL_WS_PREFIX))
|
|
110
|
+
return;
|
|
111
|
+
try {
|
|
112
|
+
const match = /^\/api\/terminal\/ws\/([a-f0-9-]{36})$/.exec(url);
|
|
113
|
+
if (!match || !state || terminalDisabledReason(true))
|
|
114
|
+
throw new Error("route");
|
|
115
|
+
state.assertAvailable();
|
|
116
|
+
if (req.headers.host !== new URL(state.config.origin).host || req.headers.origin !== state.config.origin)
|
|
117
|
+
throw new Error("origin");
|
|
118
|
+
const session = await ownerSession(state.auth, state.db, state.config, browserHeaders(req));
|
|
119
|
+
requireApproved(session, state.config);
|
|
120
|
+
const check = () => { state.assertAvailable(); requireApproved(sessionById(state.db, state.config, session.id), state.config); };
|
|
121
|
+
const id = match[1];
|
|
122
|
+
if (!manager.get(id))
|
|
123
|
+
throw new Error("session");
|
|
124
|
+
wss.handleUpgrade(req, socket, head, (peer) => {
|
|
125
|
+
let detach = () => { };
|
|
126
|
+
const close = () => { detach(); if (peer.readyState === peer.OPEN)
|
|
127
|
+
peer.close(1008); };
|
|
128
|
+
try {
|
|
129
|
+
detach = manager.attach(id, {
|
|
130
|
+
send: (frame) => { if (peer.readyState === peer.OPEN && peer.bufferedAmount < 4 * 1024 * 1024)
|
|
131
|
+
peer.send(frame); },
|
|
132
|
+
close: () => peer.close(1000),
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
peer.close(1011);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const timer = setInterval(() => { try {
|
|
140
|
+
check();
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
close();
|
|
144
|
+
} }, 1000);
|
|
145
|
+
peer.on("message", (data) => {
|
|
146
|
+
try {
|
|
147
|
+
check();
|
|
148
|
+
const frame = frameSchema.parse(JSON.parse(data.toString()));
|
|
149
|
+
if (frame.t === "i")
|
|
150
|
+
manager.input(id, frame.d);
|
|
151
|
+
else
|
|
152
|
+
manager.resize(id, frame.c, frame.r);
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
if (error instanceof AuthError)
|
|
156
|
+
close();
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
peer.on("error", () => peer.terminate());
|
|
160
|
+
peer.once("close", () => { clearInterval(timer); detach(); });
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
socket.end("HTTP/1.1 403 Forbidden\r\nConnection: close\r\n\r\n");
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminal web du serveur : shells et agents pi interactifs dans un pseudo-terminal.
|
|
3
|
+
*
|
|
4
|
+
* Sécurité : un terminal est un shell complet avec les droits du compte serveur.
|
|
5
|
+
* - disponible uniquement en mode protégé (login propriétaire, MFA si activée) ;
|
|
6
|
+
* - jamais pour les jetons MCP ni la socket propriétaire (routes UI uniquement) ;
|
|
7
|
+
* - WebSocket : Origin exacte + session revérifiée chaque seconde (déconnexion = coupure) ;
|
|
8
|
+
* - désactivable par `COGITATOR_TERMINAL=0`.
|
|
9
|
+
* Les sessions survivent à une déconnexion du navigateur (tampon de relecture borné)
|
|
10
|
+
* et sont tuées à l'arrêt du serveur.
|
|
11
|
+
*/
|
|
12
|
+
import { randomUUID } from "node:crypto";
|
|
13
|
+
import { existsSync, mkdirSync, statSync, writeFileSync } from "node:fs";
|
|
14
|
+
import { createRequire } from "node:module";
|
|
15
|
+
import { homedir } from "node:os";
|
|
16
|
+
import { join } from "node:path";
|
|
17
|
+
export const MAX_TERMINALS = 8;
|
|
18
|
+
const REPLAY_BYTES = 256 * 1024;
|
|
19
|
+
const MIN_COLS = 10, MAX_COLS = 500, MIN_ROWS = 4, MAX_ROWS = 200;
|
|
20
|
+
/** node-pty (dépendance optionnelle, binaires précompilés) ; null si indisponible sur cette plateforme. */
|
|
21
|
+
export function loadPty() {
|
|
22
|
+
try {
|
|
23
|
+
const require = createRequire(import.meta.url);
|
|
24
|
+
const mod = require("@lydell/node-pty");
|
|
25
|
+
return (file, args, opts) => mod.spawn(file, args, opts);
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const clampSize = (cols, rows) => ({
|
|
32
|
+
cols: Math.min(MAX_COLS, Math.max(MIN_COLS, Math.floor(cols) || 80)),
|
|
33
|
+
rows: Math.min(MAX_ROWS, Math.max(MIN_ROWS, Math.floor(rows) || 24)),
|
|
34
|
+
});
|
|
35
|
+
export class TerminalError extends Error {
|
|
36
|
+
code;
|
|
37
|
+
status;
|
|
38
|
+
constructor(code, status = 400) {
|
|
39
|
+
super(code);
|
|
40
|
+
this.code = code;
|
|
41
|
+
this.status = status;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export class TerminalManager {
|
|
45
|
+
spawnPty;
|
|
46
|
+
sessions = new Map();
|
|
47
|
+
constructor(spawnPty) {
|
|
48
|
+
this.spawnPty = spawnPty;
|
|
49
|
+
}
|
|
50
|
+
get available() { return this.spawnPty !== null; }
|
|
51
|
+
list() {
|
|
52
|
+
return [...this.sessions.values()].map((s) => ({ ...s.info }));
|
|
53
|
+
}
|
|
54
|
+
get(id) {
|
|
55
|
+
const s = this.sessions.get(id);
|
|
56
|
+
return s ? { ...s.info } : undefined;
|
|
57
|
+
}
|
|
58
|
+
create(launch, size) {
|
|
59
|
+
if (!this.spawnPty)
|
|
60
|
+
throw new TerminalError("TERMINAL_UNAVAILABLE", 503);
|
|
61
|
+
if (this.sessions.size >= MAX_TERMINALS)
|
|
62
|
+
throw new TerminalError("TERMINAL_LIMIT", 409);
|
|
63
|
+
if (!existsSync(launch.cwd) || !statSync(launch.cwd).isDirectory())
|
|
64
|
+
throw new TerminalError("TERMINAL_CWD_INVALID");
|
|
65
|
+
const { cols, rows } = clampSize(size.cols, size.rows);
|
|
66
|
+
const pty = this.spawnPty(launch.file, launch.args, { cwd: launch.cwd, env: launch.env, cols, rows, name: "xterm-256color" });
|
|
67
|
+
const info = {
|
|
68
|
+
id: randomUUID(), title: launch.title, kind: launch.kind, cwd: launch.cwd, createdAt: new Date().toISOString(), exited: false,
|
|
69
|
+
...(launch.agentId ? { agentId: launch.agentId } : {}),
|
|
70
|
+
};
|
|
71
|
+
const session = { info, pty, replay: [], replaySize: 0, peers: new Set() };
|
|
72
|
+
this.sessions.set(info.id, session);
|
|
73
|
+
pty.onData((data) => {
|
|
74
|
+
session.replay.push(data);
|
|
75
|
+
session.replaySize += data.length;
|
|
76
|
+
while (session.replaySize > REPLAY_BYTES && session.replay.length > 1)
|
|
77
|
+
session.replaySize -= session.replay.shift().length;
|
|
78
|
+
const frame = JSON.stringify({ t: "o", d: data });
|
|
79
|
+
for (const peer of session.peers)
|
|
80
|
+
peer.send(frame);
|
|
81
|
+
});
|
|
82
|
+
pty.onExit(({ exitCode }) => {
|
|
83
|
+
session.info.exited = true;
|
|
84
|
+
session.info.exitCode = exitCode;
|
|
85
|
+
const frame = JSON.stringify({ t: "x", code: exitCode });
|
|
86
|
+
for (const peer of session.peers)
|
|
87
|
+
peer.send(frame);
|
|
88
|
+
});
|
|
89
|
+
return { ...info };
|
|
90
|
+
}
|
|
91
|
+
/** Branche un client : relecture du tampon puis flux en direct. Renvoie la fonction de détachement. */
|
|
92
|
+
attach(id, peer) {
|
|
93
|
+
const session = this.sessions.get(id);
|
|
94
|
+
if (!session)
|
|
95
|
+
throw new TerminalError("TERMINAL_NOT_FOUND", 404);
|
|
96
|
+
if (session.replay.length)
|
|
97
|
+
peer.send(JSON.stringify({ t: "o", d: session.replay.join("") }));
|
|
98
|
+
if (session.info.exited)
|
|
99
|
+
peer.send(JSON.stringify({ t: "x", code: session.info.exitCode ?? 0 }));
|
|
100
|
+
session.peers.add(peer);
|
|
101
|
+
return () => { session.peers.delete(peer); };
|
|
102
|
+
}
|
|
103
|
+
input(id, data) {
|
|
104
|
+
const session = this.sessions.get(id);
|
|
105
|
+
if (!session || session.info.exited)
|
|
106
|
+
return;
|
|
107
|
+
session.pty.write(data);
|
|
108
|
+
}
|
|
109
|
+
resize(id, cols, rows) {
|
|
110
|
+
const session = this.sessions.get(id);
|
|
111
|
+
if (!session || session.info.exited)
|
|
112
|
+
return;
|
|
113
|
+
const size = clampSize(cols, rows);
|
|
114
|
+
try {
|
|
115
|
+
session.pty.resize(size.cols, size.rows);
|
|
116
|
+
}
|
|
117
|
+
catch { /* processus en sortie */ }
|
|
118
|
+
}
|
|
119
|
+
close(id) {
|
|
120
|
+
const session = this.sessions.get(id);
|
|
121
|
+
if (!session)
|
|
122
|
+
return false;
|
|
123
|
+
this.sessions.delete(id);
|
|
124
|
+
for (const peer of session.peers)
|
|
125
|
+
peer.close();
|
|
126
|
+
if (!session.info.exited) {
|
|
127
|
+
try {
|
|
128
|
+
session.pty.kill("SIGHUP");
|
|
129
|
+
}
|
|
130
|
+
catch { /* déjà sorti */ }
|
|
131
|
+
}
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
dispose() {
|
|
135
|
+
for (const id of [...this.sessions.keys()])
|
|
136
|
+
this.close(id);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/** Variables du serveur à ne jamais propager aux shells (identité du processus hôte). */
|
|
140
|
+
const STRIPPED_ENV = /^(COGITATOR_AUTH_REQUIRED|COGITATOR_OWNED_PI|NODE_OPTIONS|NODE_CHANNEL_FD)$/;
|
|
141
|
+
export function terminalEnv(extra = {}) {
|
|
142
|
+
const env = {};
|
|
143
|
+
for (const [k, v] of Object.entries(process.env))
|
|
144
|
+
if (v !== undefined && !STRIPPED_ENV.test(k))
|
|
145
|
+
env[k] = v;
|
|
146
|
+
return { ...env, TERM: "xterm-256color", COLORTERM: "truecolor", COGITATOR_TERMINAL_SESSION: "1", ...extra };
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Shell de connexion. Pour bash, un rcfile charge la configuration habituelle puis
|
|
150
|
+
* émet le code de sortie de chaque commande (OSC 133;D) : l'UI propose alors d'expliquer un échec.
|
|
151
|
+
*/
|
|
152
|
+
export function shellLaunch(home, cwd) {
|
|
153
|
+
const shell = process.env.SHELL && existsSync(process.env.SHELL) ? process.env.SHELL : existsSync("/bin/bash") ? "/bin/bash" : "/bin/sh";
|
|
154
|
+
const dir = cwd ?? homedir();
|
|
155
|
+
if (shell.endsWith("/bash")) {
|
|
156
|
+
const rcDir = join(home, "terminal");
|
|
157
|
+
mkdirSync(rcDir, { recursive: true, mode: 0o700 });
|
|
158
|
+
const rc = join(rcDir, "bashrc");
|
|
159
|
+
writeFileSync(rc, [
|
|
160
|
+
"# Généré par Cogitator : configuration habituelle + statut de sortie pour le terminal web.",
|
|
161
|
+
"if [ -f /etc/profile ]; then . /etc/profile; fi",
|
|
162
|
+
// Comme un shell de connexion : le premier fichier trouvé (il charge d'habitude ~/.bashrc).
|
|
163
|
+
"if [ -f ~/.bash_profile ]; then . ~/.bash_profile; elif [ -f ~/.bash_login ]; then . ~/.bash_login; elif [ -f ~/.profile ]; then . ~/.profile; elif [ -f ~/.bashrc ]; then . ~/.bashrc; fi",
|
|
164
|
+
"__cog_status() { local s=$?; printf '\\033]133;D;%s\\007' \"$s\"; return $s; }",
|
|
165
|
+
"PROMPT_COMMAND=\"__cog_status${PROMPT_COMMAND:+;$PROMPT_COMMAND}\"",
|
|
166
|
+
"",
|
|
167
|
+
].join("\n"), { mode: 0o600 });
|
|
168
|
+
return { title: "bash", kind: "shell", file: shell, args: ["--rcfile", rc, "-i"], cwd: dir, env: terminalEnv(), shellIntegration: true };
|
|
169
|
+
}
|
|
170
|
+
return { title: shell.split("/").pop() ?? "shell", kind: "shell", file: shell, args: ["-l"], cwd: dir, env: terminalEnv(), shellIntegration: false };
|
|
171
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ignitionai/cogitator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "A web control panel for pi: composable agents, workspaces, interactive conversations, and scheduled tasks. A pi package.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"dist/src",
|
|
30
30
|
"dist/extensions",
|
|
31
31
|
"web/dist",
|
|
32
|
-
"README.md"
|
|
32
|
+
"README.md",
|
|
33
|
+
"CHANGELOG.md"
|
|
33
34
|
],
|
|
34
35
|
"scripts": {
|
|
35
36
|
"build": "npm run typecheck && vite build web && tsc",
|
|
@@ -46,7 +47,8 @@
|
|
|
46
47
|
"extensions": [
|
|
47
48
|
"./dist/extensions/index.js"
|
|
48
49
|
],
|
|
49
|
-
"image": "https://raw.githubusercontent.com/IgnitionAI/cogitator/dev/
|
|
50
|
+
"image": "https://raw.githubusercontent.com/IgnitionAI/cogitator/dev/docs/images/bots.jpg",
|
|
51
|
+
"changelogPath": "./CHANGELOG.md"
|
|
50
52
|
},
|
|
51
53
|
"peerDependencies": {
|
|
52
54
|
"@earendil-works/pi-ai": "*",
|
|
@@ -61,7 +63,9 @@
|
|
|
61
63
|
"better-auth": "1.7.7",
|
|
62
64
|
"better-sqlite3": "^12.11.1",
|
|
63
65
|
"cron-parser": "^5.10.1",
|
|
66
|
+
"playwright-core": "1.65.0",
|
|
64
67
|
"three": "^0.181.2",
|
|
68
|
+
"ws": "8.22.1",
|
|
65
69
|
"zod": "^4.6.5"
|
|
66
70
|
},
|
|
67
71
|
"devDependencies": {
|
|
@@ -73,11 +77,17 @@
|
|
|
73
77
|
"@types/react": "^19.3.0",
|
|
74
78
|
"@types/react-dom": "^19.3.0",
|
|
75
79
|
"@types/three": "^0.186.0",
|
|
80
|
+
"@types/ws": "8.18.2",
|
|
76
81
|
"@vitejs/plugin-react": "^6.1.2",
|
|
82
|
+
"@xterm/addon-fit": "^0.11.0",
|
|
83
|
+
"@xterm/xterm": "^6.0.0",
|
|
77
84
|
"react": "^19.3.0",
|
|
78
85
|
"react-dom": "^19.3.0",
|
|
79
86
|
"tsx": "^4.20.0",
|
|
80
87
|
"typescript": "^5.9.0",
|
|
81
88
|
"vite": "^8.3.3"
|
|
89
|
+
},
|
|
90
|
+
"optionalDependencies": {
|
|
91
|
+
"@lydell/node-pty": "1.2.0-beta.18"
|
|
82
92
|
}
|
|
83
93
|
}
|