@lazyingart/agintiflow 0.8.1 → 0.8.3
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 +1 -1
- package/package.json +1 -1
- package/public/styles.css +16 -2
- package/scripts/smoke-web-api.js +1 -3
- package/src/cli.js +18 -7
- package/src/interactive-cli.js +25 -0
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ aginti
|
|
|
54
54
|
aginti chat
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
Inside chat, type normal requests such as `write a small Python CLI app with tests`. The default is now Docker workspace mode with approved package installs, so coding, plotting, and LaTeX tasks can set up project-local tools without touching the host. Use `/help` for commands, `/latex on` for PDF work, `/docker off` only when you intentionally want host mode, `/sessions` to list project runs, and `/resume <session-id>` to continue work.
|
|
57
|
+
Inside chat, type normal requests such as `write a small Python CLI app with tests`. The default is now Docker workspace mode with approved package installs, so coding, plotting, and LaTeX tasks can set up project-local tools without touching the host. Use `/help` for commands, `/latex on` for PDF work, `/docker off` only when you intentionally want host mode, `/sessions` to list project runs, and `/resume <session-id>` to continue work. Ctrl+C exits cleanly and prints a resume command when a session exists.
|
|
58
58
|
|
|
59
59
|
Launch the local web UI from an installed package:
|
|
60
60
|
|
package/package.json
CHANGED
package/public/styles.css
CHANGED
|
@@ -536,21 +536,35 @@ button.danger {
|
|
|
536
536
|
overflow: auto;
|
|
537
537
|
display: grid;
|
|
538
538
|
gap: 12px;
|
|
539
|
-
padding:
|
|
539
|
+
padding: 14px;
|
|
540
|
+
border: 1px solid rgba(15, 118, 110, 0.16);
|
|
541
|
+
border-radius: 18px;
|
|
542
|
+
background:
|
|
543
|
+
radial-gradient(circle at 14% 8%, rgba(20, 184, 166, 0.18), transparent 24%),
|
|
544
|
+
radial-gradient(circle at 86% 0%, rgba(245, 158, 11, 0.16), transparent 22%),
|
|
545
|
+
linear-gradient(180deg, rgba(255, 253, 250, 0.86), rgba(241, 245, 249, 0.72));
|
|
546
|
+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
|
|
540
547
|
}
|
|
541
548
|
|
|
542
549
|
.chat-item {
|
|
550
|
+
width: fit-content;
|
|
551
|
+
max-width: min(780px, 88%);
|
|
543
552
|
border: 1px solid var(--line);
|
|
544
|
-
border-radius:
|
|
553
|
+
border-radius: 18px;
|
|
545
554
|
padding: 12px 14px;
|
|
555
|
+
box-shadow: 0 12px 28px rgba(62, 49, 26, 0.08);
|
|
546
556
|
}
|
|
547
557
|
|
|
548
558
|
.chat-item.user {
|
|
559
|
+
justify-self: end;
|
|
549
560
|
background: var(--user);
|
|
561
|
+
border-bottom-right-radius: 6px;
|
|
550
562
|
}
|
|
551
563
|
|
|
552
564
|
.chat-item.assistant {
|
|
565
|
+
justify-self: start;
|
|
553
566
|
background: var(--assistant);
|
|
567
|
+
border-bottom-left-radius: 6px;
|
|
554
568
|
}
|
|
555
569
|
|
|
556
570
|
.chat-meta {
|
package/scripts/smoke-web-api.js
CHANGED
|
@@ -9,12 +9,10 @@ const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."
|
|
|
9
9
|
const runtimeDir = await fs.mkdtemp(path.join(os.tmpdir(), "agintiflow-api-smoke-"));
|
|
10
10
|
const port = 43000 + Math.floor(Math.random() * 1000);
|
|
11
11
|
const baseUrl = `http://127.0.0.1:${port}`;
|
|
12
|
-
const server = spawn(process.execPath, [path.join(repoRoot, "
|
|
12
|
+
const server = spawn(process.execPath, [path.join(repoRoot, "bin/aginti-cli.js"), "web", "--port", String(port), "--host", "127.0.0.1"], {
|
|
13
13
|
cwd: runtimeDir,
|
|
14
14
|
env: {
|
|
15
15
|
...process.env,
|
|
16
|
-
PORT: String(port),
|
|
17
|
-
HOST: "127.0.0.1",
|
|
18
16
|
AGINTIFLOW_RUNTIME_DIR: runtimeDir,
|
|
19
17
|
},
|
|
20
18
|
stdio: ["ignore", "pipe", "pipe"],
|
package/src/cli.js
CHANGED
|
@@ -219,7 +219,7 @@ export function parseArgs(argv) {
|
|
|
219
219
|
|
|
220
220
|
function printUsage() {
|
|
221
221
|
console.log(
|
|
222
|
-
'Usage: aginti [chat] OR aginti web [--port 3210] OR aginti queue <session-id> "message" OR aginti [--latex] [--routing smart|fast|complex|manual] [--provider deepseek|openai|mock] [--sandbox-mode host|docker-readonly|docker-workspace] [--package-install-policy block|prompt|allow] [--approve-package-installs] [--allow-shell|--no-shell] [--allow-destructive] [--allow-file-tools|--no-file-tools] [--allow-wrappers --wrapper codex] [--sandbox-status|--sandbox-preflight] "your task"'
|
|
222
|
+
'Usage: aginti [chat] OR aginti web [--port 3210] OR aginti resume <session-id> ["prompt"] OR aginti queue <session-id> "message" OR aginti [--latex] [--routing smart|fast|complex|manual] [--provider deepseek|openai|mock] [--sandbox-mode host|docker-readonly|docker-workspace] [--package-install-policy block|prompt|allow] [--approve-package-installs] [--allow-shell|--no-shell] [--allow-destructive] [--allow-file-tools|--no-file-tools] [--allow-wrappers --wrapper codex] [--sandbox-status|--sandbox-preflight] "your task"'
|
|
223
223
|
);
|
|
224
224
|
}
|
|
225
225
|
|
|
@@ -458,7 +458,18 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
458
458
|
if (argv[0] === "resume") {
|
|
459
459
|
const sessionId = argv[1] || "";
|
|
460
460
|
const prompt = argv.slice(2).join(" ").trim();
|
|
461
|
-
if (!sessionId
|
|
461
|
+
if (!sessionId) {
|
|
462
|
+
console.error('Usage: aginti resume <session-id> ["new prompt"]');
|
|
463
|
+
process.exit(1);
|
|
464
|
+
}
|
|
465
|
+
if (!prompt && process.stdin.isTTY) {
|
|
466
|
+
await startInteractiveCli(agentDefaults({ ...parseArgs([]), resume: sessionId }), {
|
|
467
|
+
packageDir,
|
|
468
|
+
packageVersion: packageJson.version,
|
|
469
|
+
});
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
if (!prompt) {
|
|
462
473
|
console.error('Usage: aginti resume <session-id> "new prompt"');
|
|
463
474
|
process.exit(1);
|
|
464
475
|
}
|
|
@@ -469,11 +480,6 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
469
480
|
|
|
470
481
|
const args = parseArgs(argv);
|
|
471
482
|
|
|
472
|
-
if (args.interactive || (!args.goal && !args.resume && process.stdin.isTTY)) {
|
|
473
|
-
await startInteractiveCli(agentDefaults(args), { packageDir, packageVersion: packageJson.version });
|
|
474
|
-
return;
|
|
475
|
-
}
|
|
476
|
-
|
|
477
483
|
if (args.web) {
|
|
478
484
|
if (args.port) process.env.PORT = String(args.port);
|
|
479
485
|
if (args.host) process.env.HOST = String(args.host);
|
|
@@ -482,6 +488,11 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
482
488
|
return;
|
|
483
489
|
}
|
|
484
490
|
|
|
491
|
+
if (args.interactive || (!args.goal && !args.resume && process.stdin.isTTY)) {
|
|
492
|
+
await startInteractiveCli(agentDefaults(args), { packageDir, packageVersion: packageJson.version });
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
|
|
485
496
|
if (args.listRoutes) {
|
|
486
497
|
printRoutes();
|
|
487
498
|
return;
|
package/src/interactive-cli.js
CHANGED
|
@@ -45,6 +45,23 @@ function printStatus(state) {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
function isAbortError(error) {
|
|
49
|
+
return error?.code === "ABORT_ERR" || error?.name === "AbortError";
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function printResumeHint(state) {
|
|
53
|
+
const sessionId = state.sessionId || "";
|
|
54
|
+
console.log("");
|
|
55
|
+
if (sessionId) {
|
|
56
|
+
console.log("Interrupted. Session saved.");
|
|
57
|
+
console.log(`Resume: aginti resume ${sessionId}`);
|
|
58
|
+
console.log(`One-shot: aginti resume ${sessionId} "continue"`);
|
|
59
|
+
} else {
|
|
60
|
+
console.log("Interrupted. No active session yet.");
|
|
61
|
+
console.log("Restart: aginti");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
48
65
|
function createState(args = {}) {
|
|
49
66
|
return {
|
|
50
67
|
provider: args.provider || "",
|
|
@@ -219,6 +236,10 @@ export async function startInteractiveCli(args = {}, { packageDir, packageVersio
|
|
|
219
236
|
answer = await rl.question("\naginti> ");
|
|
220
237
|
} catch (error) {
|
|
221
238
|
if (error?.code === "ERR_USE_AFTER_CLOSE") break;
|
|
239
|
+
if (isAbortError(error)) {
|
|
240
|
+
printResumeHint(state);
|
|
241
|
+
break;
|
|
242
|
+
}
|
|
222
243
|
throw error;
|
|
223
244
|
}
|
|
224
245
|
const line = answer.trim();
|
|
@@ -232,6 +253,10 @@ export async function startInteractiveCli(args = {}, { packageDir, packageVersio
|
|
|
232
253
|
try {
|
|
233
254
|
await runPrompt(line, state, packageDir);
|
|
234
255
|
} catch (error) {
|
|
256
|
+
if (isAbortError(error)) {
|
|
257
|
+
printResumeHint(state);
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
235
260
|
console.error(`error: ${error.message}`);
|
|
236
261
|
}
|
|
237
262
|
}
|