@causyne/agent 1.20.60 → 1.20.62
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/package.json +1 -1
- package/src/acp/agentCatalog.js +1 -1
- package/src/acp/agentCatalog.ts +1 -1
- package/src/acp/peerProfiles.js +3 -3
- package/src/acp/peerProfiles.ts +3 -3
- package/src/agentLoop.js +58 -22
- package/src/agentLoop.ts +64 -25
- package/src/checkpoints.js +23 -5
- package/src/cliMode.js +4 -2
- package/src/commands.js +503 -78
- package/src/contextManager.d.ts +3 -0
- package/src/contextManager.js +78 -5
- package/src/cortex/autoCondenser.js +105 -145
- package/src/cortex/autoCondenser.ts +185 -0
- package/src/cortex/cortexEngine.js +179 -0
- package/src/cortex/cortexEngine.ts +209 -0
- package/src/cortex/provisioner.js +12 -14
- package/src/cortex/provisioner.ts +29 -0
- package/src/cortex/vectorDb.js +307 -386
- package/src/cortex/vectorDb.ts +473 -0
- package/src/reporting.js +30 -7
- package/src/sessionJournal.js +13 -0
- package/src/sessionJournal.ts +13 -0
- package/src/tokenTracker.js +22 -0
- package/src/tokenTracker.ts +28 -0
- package/src/tui/chatRenderer.js +6 -2
- package/src/tui/completion.js +34 -15
- package/src/tui/composerControls.js +5 -0
- package/src/tui/composerControls.ts +5 -0
- package/src/tui/layout.js +1 -1
- package/src/tui/layout.ts +1 -1
- package/src/tui/observerPicker.js +323 -0
- package/src/tui/observerPicker.ts +386 -0
- package/src/tui/prompt.js +184 -22
- package/src/tui/stageSurface.js +18 -8
- package/src/tui/usageCard.js +178 -0
- package/src/tui/usageCard.ts +240 -0
- package/src/utils/paths.js +30 -1
- package/src/utils/paths.ts +32 -1
- package/src/cortex/autoCondenser.d.ts +0 -2
- package/src/cortex/vectorDb.d.ts +0 -1
package/src/commands.js
CHANGED
|
@@ -45,7 +45,12 @@ import {
|
|
|
45
45
|
import fs from 'fs';
|
|
46
46
|
import os from 'os';
|
|
47
47
|
import path from 'path';
|
|
48
|
+
import { execSync } from 'child_process';
|
|
48
49
|
import { runCopyCommand, runPasteCommand } from './tui/chatboxClipboard.js';
|
|
50
|
+
import { getPackageVersion } from './version.js';
|
|
51
|
+
import { listGroups } from './checkpoints.js';
|
|
52
|
+
import { renameSession, getSession } from './sessionStore.js';
|
|
53
|
+
import { listPlugins } from './plugins/pluginManager.js';
|
|
49
54
|
|
|
50
55
|
export const SCOPES = ['local'];
|
|
51
56
|
|
|
@@ -79,6 +84,13 @@ export const COMMANDS = [
|
|
|
79
84
|
usage: '/help [command]',
|
|
80
85
|
description: 'List the available commands',
|
|
81
86
|
dialogTitle: 'Commands',
|
|
87
|
+
complete: () => {
|
|
88
|
+
return listCommands('terminal').map((c) => ({
|
|
89
|
+
value: c.name,
|
|
90
|
+
label: c.name,
|
|
91
|
+
description: c.description
|
|
92
|
+
}));
|
|
93
|
+
},
|
|
82
94
|
run: (argv, ctx) => {
|
|
83
95
|
const [wanted] = argv;
|
|
84
96
|
if (wanted) {
|
|
@@ -368,7 +380,28 @@ export const COMMANDS = [
|
|
|
368
380
|
scope: 'local',
|
|
369
381
|
usage: '/undo [taskId] [--step] [--full] [--apply]',
|
|
370
382
|
description: "Preview rolling back the last task's file changes (--apply to write)",
|
|
371
|
-
|
|
383
|
+
dialogTitle: 'Undo',
|
|
384
|
+
complete: () => {
|
|
385
|
+
try {
|
|
386
|
+
const groups = listGroups(10);
|
|
387
|
+
return [
|
|
388
|
+
{ value: '--apply', label: '--apply', description: 'apply rollback directly to workspace' },
|
|
389
|
+
{ value: '--step', label: '--step', description: 'roll back just the single last file change' },
|
|
390
|
+
{ value: '--full', label: '--full', description: 'roll back entire workspace tree drift' },
|
|
391
|
+
...groups.map((g) => ({
|
|
392
|
+
value: g.taskId,
|
|
393
|
+
label: g.taskId,
|
|
394
|
+
description: g.prompt ? `${g.prompt.slice(0, 36)} (${g.fileEntries.length} files)` : `${g.fileEntries.length} files`
|
|
395
|
+
}))
|
|
396
|
+
];
|
|
397
|
+
} catch (e) {
|
|
398
|
+
return [
|
|
399
|
+
{ value: '--apply', label: '--apply', description: 'apply rollback directly' },
|
|
400
|
+
{ value: '--step', label: '--step', description: 'roll back just the single last file change' }
|
|
401
|
+
];
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
run: (argv, ctx = {}) => {
|
|
372
405
|
const flags = new Set(argv.filter(a => a.startsWith('--')));
|
|
373
406
|
const taskId = argv.find(a => !a.startsWith('--'));
|
|
374
407
|
|
|
@@ -378,15 +411,17 @@ export const COMMANDS = [
|
|
|
378
411
|
// should be able to overwrite a day's work, so the destructive form has
|
|
379
412
|
// to be asked for by name.
|
|
380
413
|
const apply = flags.has('--apply');
|
|
414
|
+
const workspaceRoot = ctx.loop?.workspaceRoot || process.cwd();
|
|
381
415
|
|
|
382
416
|
const { ok: succeeded, text } = buildUndoText(taskId, {
|
|
383
417
|
step: flags.has('--step'),
|
|
384
418
|
full: flags.has('--full'),
|
|
385
|
-
dryRun: !apply
|
|
419
|
+
dryRun: !apply,
|
|
420
|
+
workspaceRoot
|
|
386
421
|
});
|
|
387
422
|
|
|
388
423
|
if (!succeeded) return fail(text);
|
|
389
|
-
if (apply) return ok(text);
|
|
424
|
+
if (apply) return ok(text, { effect: 'inline' });
|
|
390
425
|
return ok(`${text}\n\nNothing was written. Run the same command with --apply to restore these files.`);
|
|
391
426
|
}
|
|
392
427
|
},
|
|
@@ -438,70 +473,61 @@ export const COMMANDS = [
|
|
|
438
473
|
usage: '/usage',
|
|
439
474
|
description: 'Show token usage and estimated cost',
|
|
440
475
|
dialogTitle: 'Usage',
|
|
441
|
-
run: async () =>
|
|
476
|
+
run: async (argv, ctx = {}) => {
|
|
477
|
+
if (ctx.prompt && typeof ctx.prompt.toggleUsageCard === 'function') {
|
|
478
|
+
await ctx.prompt.toggleUsageCard(ctx.loop);
|
|
479
|
+
return ok('', { effect: 'silent' });
|
|
480
|
+
}
|
|
481
|
+
return ok(await buildUsageText());
|
|
482
|
+
}
|
|
442
483
|
},
|
|
443
484
|
|
|
444
485
|
{
|
|
445
|
-
name: '
|
|
446
|
-
aliases: ['
|
|
486
|
+
name: 'diff',
|
|
487
|
+
aliases: ['changes', 'git-diff'],
|
|
447
488
|
scope: 'local',
|
|
448
|
-
usage: '/
|
|
449
|
-
description: '
|
|
450
|
-
dialogTitle: '
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
run:
|
|
456
|
-
const
|
|
457
|
-
const
|
|
458
|
-
|
|
489
|
+
usage: '/diff [staged | stat]',
|
|
490
|
+
description: 'Show working tree or staged diff for the active workspace',
|
|
491
|
+
dialogTitle: 'Diff',
|
|
492
|
+
complete: () => [
|
|
493
|
+
{ value: 'staged', label: 'staged', description: 'show staged changes only (--cached)' },
|
|
494
|
+
{ value: 'stat', label: 'stat', description: 'show diff summary statistics' }
|
|
495
|
+
],
|
|
496
|
+
run: (argv, ctx = {}) => {
|
|
497
|
+
const ws = ctx.loop?.workspaceRoot || process.cwd();
|
|
498
|
+
const sub = (argv[0] || '').toLowerCase();
|
|
459
499
|
try {
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
? 'Nothing was learned in this project yet.'
|
|
469
|
-
: `Forgot ${removed} memor${removed === 1 ? 'y' : 'ies'} from this project. Global lessons are untouched.`);
|
|
500
|
+
let isGit = fs.existsSync(path.join(ws, '.git'));
|
|
501
|
+
if (!isGit) {
|
|
502
|
+
try {
|
|
503
|
+
execSync('git rev-parse --is-inside-work-tree', { cwd: ws, stdio: 'pipe' });
|
|
504
|
+
isGit = true;
|
|
505
|
+
} catch {
|
|
506
|
+
isGit = false;
|
|
507
|
+
}
|
|
470
508
|
}
|
|
471
509
|
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
return ok('Nothing learned yet. Cortex records a lesson when a task recovers from a real error.');
|
|
510
|
+
if (!isGit) {
|
|
511
|
+
return ok(`Workspace "${ws}" is not a git repository.`);
|
|
475
512
|
}
|
|
476
513
|
|
|
477
|
-
const
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
if (verb !== 'list') {
|
|
482
|
-
return ok(header + '\n\nSee them with /cortex list. Forget this project\'s with /cortex forget-here.');
|
|
514
|
+
const status = execSync('git status --short', { cwd: ws, encoding: 'utf8' }).trim();
|
|
515
|
+
if (!status) {
|
|
516
|
+
return ok('Working tree is clean. No uncommitted changes in this workspace.');
|
|
483
517
|
}
|
|
484
518
|
|
|
485
|
-
|
|
486
|
-
if (
|
|
487
|
-
|
|
519
|
+
let diffCmd = 'git diff';
|
|
520
|
+
if (sub === 'staged' || sub === '--cached') {
|
|
521
|
+
diffCmd = 'git diff --cached';
|
|
522
|
+
} else if (sub === 'stat') {
|
|
523
|
+
diffCmd = 'git diff --stat HEAD';
|
|
488
524
|
}
|
|
489
525
|
|
|
490
|
-
const
|
|
491
|
-
const
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
return ` ${r.id} ${when} ${String(r.hits).padStart(3)} hits [${r.kind}] ${where}\n ${first}`;
|
|
496
|
-
});
|
|
497
|
-
|
|
498
|
-
return ok(header + '\n\nApplying to this project:\n' + lines.join('\n')
|
|
499
|
-
+ '\n\nForget one with /cortex forget <id>.');
|
|
500
|
-
} catch (e) {
|
|
501
|
-
// The neural engine is provisioned at runtime and can be absent. Saying
|
|
502
|
-
// so is the point: a silent Cortex is indistinguishable from an empty
|
|
503
|
-
// one, and the user is entitled to know which they have.
|
|
504
|
-
return fail(`Cortex is unavailable: ${e.message}. Memories are not being recorded or retrieved.`);
|
|
526
|
+
const diffOutput = execSync(diffCmd, { cwd: ws, encoding: 'utf8', maxBuffer: 1024 * 1024 }).trim();
|
|
527
|
+
const header = `Git Status (${ws}):\n${status}\n\n${'─'.repeat(50)}\n${diffCmd}:\n`;
|
|
528
|
+
return ok(diffOutput ? `${header}\n${diffOutput}` : `${header}\n(no file diff for ${diffCmd})`);
|
|
529
|
+
} catch (err) {
|
|
530
|
+
return fail(`Could not inspect git diff: ${err.message}`);
|
|
505
531
|
}
|
|
506
532
|
}
|
|
507
533
|
},
|
|
@@ -512,6 +538,10 @@ export const COMMANDS = [
|
|
|
512
538
|
usage: '/plans [import <json-file> | forget]',
|
|
513
539
|
description: 'Inspect, pre-warm, or clear reusable task plans',
|
|
514
540
|
dialogTitle: 'Plan cache',
|
|
541
|
+
complete: () => [
|
|
542
|
+
{ value: 'import', label: 'import', description: 'import seed plans from a JSON file' },
|
|
543
|
+
{ value: 'forget', label: 'forget', description: 'clear all cached plans' }
|
|
544
|
+
],
|
|
515
545
|
run: async (args = []) => {
|
|
516
546
|
const cache = await import('./planCache.js');
|
|
517
547
|
const verb = String(args[0] || '').toLowerCase();
|
|
@@ -557,9 +587,33 @@ export const COMMANDS = [
|
|
|
557
587
|
{
|
|
558
588
|
name: 'plugins',
|
|
559
589
|
scope: 'local',
|
|
560
|
-
usage: '/plugins [enable <name> | disable <name>]',
|
|
590
|
+
usage: '/plugins [list | enable <name> | disable <name>]',
|
|
561
591
|
description: 'Inspect or change trust for local plugins',
|
|
562
592
|
dialogTitle: 'Plugins',
|
|
593
|
+
complete: () => {
|
|
594
|
+
try {
|
|
595
|
+
const rows = listPlugins();
|
|
596
|
+
return [
|
|
597
|
+
{ value: 'list', label: 'list', description: 'list local plugins and trust status' },
|
|
598
|
+
...rows.map((p) => ({
|
|
599
|
+
value: `enable ${p.name}`,
|
|
600
|
+
label: `enable ${p.name}`,
|
|
601
|
+
description: `enable plugin ${p.name}`
|
|
602
|
+
})),
|
|
603
|
+
...rows.map((p) => ({
|
|
604
|
+
value: `disable ${p.name}`,
|
|
605
|
+
label: `disable ${p.name}`,
|
|
606
|
+
description: `disable plugin ${p.name}`
|
|
607
|
+
}))
|
|
608
|
+
];
|
|
609
|
+
} catch (e) {
|
|
610
|
+
return [
|
|
611
|
+
{ value: 'list', label: 'list', description: 'list local plugins' },
|
|
612
|
+
{ value: 'enable', label: 'enable', description: 'enable a local plugin' },
|
|
613
|
+
{ value: 'disable', label: 'disable', description: 'disable a local plugin' }
|
|
614
|
+
];
|
|
615
|
+
}
|
|
616
|
+
},
|
|
563
617
|
run: async (args = []) => {
|
|
564
618
|
const manager = await import('./plugins/pluginManager.js');
|
|
565
619
|
const verb = String(args[0] || '').toLowerCase();
|
|
@@ -863,6 +917,11 @@ export const COMMANDS = [
|
|
|
863
917
|
usage: '/continuum [list | read <id> | adopt <id>]',
|
|
864
918
|
description: 'Cross-agent session extraction and resumption (Antigravity, OpenCode, Codex, Claude Code)',
|
|
865
919
|
dialogTitle: 'Continuum',
|
|
920
|
+
complete: () => [
|
|
921
|
+
{ value: 'list', label: 'list', description: 'scan and list cross-agent sessions' },
|
|
922
|
+
{ value: 'adopt', label: 'adopt', description: 'adopt and resume a peer agent session' },
|
|
923
|
+
{ value: 'read', label: 'read', description: 'preview transcript of a peer session' }
|
|
924
|
+
],
|
|
866
925
|
run: async (args = [], context = {}) => {
|
|
867
926
|
const {
|
|
868
927
|
ContinuumScanner,
|
|
@@ -936,6 +995,9 @@ export const COMMANDS = [
|
|
|
936
995
|
usage: '/approvals [clear]',
|
|
937
996
|
description: 'List tools granted "Allow always", or revoke them',
|
|
938
997
|
dialogTitle: 'Approvals',
|
|
998
|
+
complete: () => [
|
|
999
|
+
{ value: 'clear', label: 'clear', description: 'revoke all standing "Allow always" grants' }
|
|
1000
|
+
],
|
|
939
1001
|
// A standing grant with no way to see or revoke it is a trap, not a
|
|
940
1002
|
// convenience. This is the way out, and the confirm dialog that grants one
|
|
941
1003
|
// names this command so the user is told about it at the moment it matters.
|
|
@@ -967,16 +1029,17 @@ export const COMMANDS = [
|
|
|
967
1029
|
scope: 'local',
|
|
968
1030
|
usage: '/thinking [toggle|expand|collapse]',
|
|
969
1031
|
description: 'Toggle or fold thinking process chunks in the conversation transcript',
|
|
1032
|
+
complete: () => [
|
|
1033
|
+
{ value: 'toggle', label: 'toggle', description: 'toggle collapsed state of thinking blocks' },
|
|
1034
|
+
{ value: 'expand', label: 'expand', description: 'expand all thinking blocks' },
|
|
1035
|
+
{ value: 'collapse', label: 'collapse', description: 'collapse all thinking blocks' }
|
|
1036
|
+
],
|
|
970
1037
|
run: (argv, ctx) => {
|
|
971
1038
|
const surface = ctx?.prompt?.surface;
|
|
972
1039
|
const transcript = surface?.transcript;
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
const reasoningFrames = transcript.frames.filter((f) => f.kind === 'reasoning');
|
|
977
|
-
if (reasoningFrames.length === 0) {
|
|
978
|
-
return ok('No thinking process frames found in the current conversation.');
|
|
979
|
-
}
|
|
1040
|
+
const reasoningFrames = Array.isArray(transcript?.frames)
|
|
1041
|
+
? transcript.frames.filter((f) => f.kind === 'reasoning' || f.meta?.reasoning === true)
|
|
1042
|
+
: [];
|
|
980
1043
|
const sub = (argv[0] || 'toggle').toLowerCase();
|
|
981
1044
|
let newCollapsed;
|
|
982
1045
|
if (sub === 'expand') {
|
|
@@ -994,11 +1057,22 @@ export const COMMANDS = [
|
|
|
994
1057
|
frame.renderedWidth = -1;
|
|
995
1058
|
}
|
|
996
1059
|
}
|
|
997
|
-
transcript
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1060
|
+
if (transcript) {
|
|
1061
|
+
transcript.cache = null;
|
|
1062
|
+
transcript.revision++;
|
|
1063
|
+
transcript.changed?.();
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
const msg = reasoningFrames.length === 0
|
|
1067
|
+
? 'No thinking process frames found in the current conversation.'
|
|
1068
|
+
: `${newCollapsed ? 'Collapsed' : 'Expanded'} ${reasoningFrames.length} thinking frame${reasoningFrames.length === 1 ? '' : 's'}.`;
|
|
1069
|
+
|
|
1070
|
+
if (ctx.prompt) {
|
|
1071
|
+
ctx.prompt.notice = msg;
|
|
1072
|
+
if (ctx.prompt.scheduleDraw) ctx.prompt.scheduleDraw();
|
|
1073
|
+
return ok(msg, { effect: 'silent' });
|
|
1074
|
+
}
|
|
1075
|
+
return ok(msg);
|
|
1002
1076
|
}
|
|
1003
1077
|
},
|
|
1004
1078
|
|
|
@@ -1053,9 +1127,15 @@ export const COMMANDS = [
|
|
|
1053
1127
|
scope: 'local',
|
|
1054
1128
|
usage: '/copy [input | last | <text>]',
|
|
1055
1129
|
description: 'Copy chatbox input, last assistant response, or text to system clipboard',
|
|
1130
|
+
complete: () => [
|
|
1131
|
+
{ value: 'last', label: 'last', description: 'copy last assistant response to clipboard' },
|
|
1132
|
+
{ value: 'input', label: 'input', description: 'copy current chatbox input to clipboard' }
|
|
1133
|
+
],
|
|
1056
1134
|
run: (argv, ctx) => {
|
|
1057
1135
|
const res = runCopyCommand(argv, ctx);
|
|
1058
|
-
return res.ok
|
|
1136
|
+
return res.ok
|
|
1137
|
+
? ok(res.output, { effect: ctx.prompt ? 'silent' : undefined })
|
|
1138
|
+
: fail(res.output);
|
|
1059
1139
|
}
|
|
1060
1140
|
},
|
|
1061
1141
|
|
|
@@ -1067,7 +1147,9 @@ export const COMMANDS = [
|
|
|
1067
1147
|
description: 'Paste clipboard content or text into the chatbox input',
|
|
1068
1148
|
run: (argv, ctx) => {
|
|
1069
1149
|
const res = runPasteCommand(argv, ctx);
|
|
1070
|
-
return res.ok
|
|
1150
|
+
return res.ok
|
|
1151
|
+
? ok(res.output, { effect: ctx.prompt ? 'silent' : undefined })
|
|
1152
|
+
: fail(res.output);
|
|
1071
1153
|
}
|
|
1072
1154
|
},
|
|
1073
1155
|
|
|
@@ -1081,7 +1163,8 @@ export const COMMANDS = [
|
|
|
1081
1163
|
const loop = ctx.loop;
|
|
1082
1164
|
if (loop && typeof loop.abort === 'function') {
|
|
1083
1165
|
loop.abort();
|
|
1084
|
-
|
|
1166
|
+
if (ctx.prompt) ctx.prompt.notice = 'stop requested';
|
|
1167
|
+
return ok('Stop requested.', { effect: ctx.prompt ? 'silent' : undefined });
|
|
1085
1168
|
}
|
|
1086
1169
|
return fail('Nothing is running.');
|
|
1087
1170
|
}
|
|
@@ -1453,6 +1536,25 @@ export const COMMANDS = [
|
|
|
1453
1536
|
usage: '/mcp [add <name> <cmd…> | add <name> --url <url> | remove|grant|revoke|connect|disconnect|test|refresh <name>]',
|
|
1454
1537
|
description: 'Manage and diagnose MCP server connections',
|
|
1455
1538
|
dialogTitle: 'MCP servers',
|
|
1539
|
+
complete: () => {
|
|
1540
|
+
try {
|
|
1541
|
+
const servers = serverStatus();
|
|
1542
|
+
const base = [
|
|
1543
|
+
{ value: 'add', label: 'add', description: 'add a new stdio or SSE/HTTP MCP server' }
|
|
1544
|
+
];
|
|
1545
|
+
for (const s of servers) {
|
|
1546
|
+
base.push({ value: `test ${s.name}`, label: `test ${s.name}`, description: `test ${s.name} connection` });
|
|
1547
|
+
base.push({ value: `grant ${s.name}`, label: `grant ${s.name}`, description: `grant consent to ${s.name}` });
|
|
1548
|
+
base.push({ value: `revoke ${s.name}`, label: `revoke ${s.name}`, description: `revoke consent from ${s.name}` });
|
|
1549
|
+
base.push({ value: `remove ${s.name}`, label: `remove ${s.name}`, description: `remove ${s.name}` });
|
|
1550
|
+
base.push({ value: `refresh ${s.name}`, label: `refresh ${s.name}`, description: `refresh tools for ${s.name}` });
|
|
1551
|
+
base.push({ value: `disconnect ${s.name}`, label: `disconnect ${s.name}`, description: `disconnect ${s.name}` });
|
|
1552
|
+
}
|
|
1553
|
+
return base;
|
|
1554
|
+
} catch (e) {
|
|
1555
|
+
return [{ value: 'add', label: 'add', description: 'add an MCP server' }];
|
|
1556
|
+
}
|
|
1557
|
+
},
|
|
1456
1558
|
run: async (argv) => {
|
|
1457
1559
|
const [action, serverName, ...rest] = argv;
|
|
1458
1560
|
|
|
@@ -1554,6 +1656,26 @@ export const COMMANDS = [
|
|
|
1554
1656
|
usage: '/peers [detect | test <id> | add <id> <command…> | remove <id>]',
|
|
1555
1657
|
description: 'Manage, discover, and test external ACP peer agents (Claude Code, OpenCode, Codex, Gemini, Hermes, etc.)',
|
|
1556
1658
|
dialogTitle: 'ACP peer agents',
|
|
1659
|
+
complete: () => {
|
|
1660
|
+
try {
|
|
1661
|
+
const peers = listAllPeers();
|
|
1662
|
+
return [
|
|
1663
|
+
{ value: 'detect', label: 'detect', description: 'scan system for installed ACP agents' },
|
|
1664
|
+
...peers.map((p) => ({
|
|
1665
|
+
value: `test ${p.id}`,
|
|
1666
|
+
label: `test ${p.id}`,
|
|
1667
|
+
description: `test zero-token handshake with ${p.label}`
|
|
1668
|
+
})),
|
|
1669
|
+
...peers.map((p) => ({
|
|
1670
|
+
value: `remove ${p.id}`,
|
|
1671
|
+
label: `remove ${p.id}`,
|
|
1672
|
+
description: `remove peer profile for ${p.label}`
|
|
1673
|
+
}))
|
|
1674
|
+
];
|
|
1675
|
+
} catch (e) {
|
|
1676
|
+
return [{ value: 'detect', label: 'detect', description: 'scan system for installed ACP agents' }];
|
|
1677
|
+
}
|
|
1678
|
+
},
|
|
1557
1679
|
run: async (argv) => {
|
|
1558
1680
|
const [action, peerId, ...rest] = argv;
|
|
1559
1681
|
|
|
@@ -1626,14 +1748,14 @@ export const COMMANDS = [
|
|
|
1626
1748
|
command: rest[0],
|
|
1627
1749
|
args: rest.slice(1),
|
|
1628
1750
|
cwd: null,
|
|
1629
|
-
policy: '
|
|
1751
|
+
policy: 'workspace',
|
|
1630
1752
|
timeoutSeconds: 180,
|
|
1631
1753
|
env: {}
|
|
1632
1754
|
};
|
|
1633
1755
|
|
|
1634
1756
|
const res = addPeerProfile(newProfile);
|
|
1635
1757
|
if (!res.ok) return fail(`Could not save peer: ${res.error}`);
|
|
1636
|
-
return ok(`Added peer "${peerId}" [policy:
|
|
1758
|
+
return ok(`Added peer "${peerId}" [policy: workspace]. Edit ~/.causyne/peers.json to customize policy, timeout, or environment.`);
|
|
1637
1759
|
}
|
|
1638
1760
|
|
|
1639
1761
|
if (action === 'remove') {
|
|
@@ -1668,6 +1790,10 @@ export const COMMANDS = [
|
|
|
1668
1790
|
scope: 'local',
|
|
1669
1791
|
usage: '/slop <file… | directory> [--movements]',
|
|
1670
1792
|
description: 'Score HTML/CSS against the anti-AI-slop rules (Vision §7)',
|
|
1793
|
+
dialogTitle: 'Slop audit',
|
|
1794
|
+
complete: () => [
|
|
1795
|
+
{ value: '--movements', label: '--movements', description: 'show recommended design movements' }
|
|
1796
|
+
],
|
|
1671
1797
|
run: (argv) => {
|
|
1672
1798
|
const wantsMovements = argv.includes('--movements');
|
|
1673
1799
|
const targets = argv.filter(a => !a.startsWith('--'));
|
|
@@ -1675,9 +1801,7 @@ export const COMMANDS = [
|
|
|
1675
1801
|
if (wantsMovements && targets.length === 0) {
|
|
1676
1802
|
return ok('Design movements to commit to:\n\n' + formatMovementBrief(DESIGN_MOVEMENTS));
|
|
1677
1803
|
}
|
|
1678
|
-
|
|
1679
|
-
return fail('Usage: slop <file… | directory> (or: slop --movements to see the catalogue)');
|
|
1680
|
-
}
|
|
1804
|
+
const scanTargets = targets.length > 0 ? targets : ['.'];
|
|
1681
1805
|
|
|
1682
1806
|
const files = [];
|
|
1683
1807
|
const collect = (target) => {
|
|
@@ -1708,9 +1832,9 @@ export const COMMANDS = [
|
|
|
1708
1832
|
return null;
|
|
1709
1833
|
};
|
|
1710
1834
|
|
|
1711
|
-
const problems =
|
|
1835
|
+
const problems = scanTargets.map(collect).filter(Boolean);
|
|
1712
1836
|
if (files.length === 0) {
|
|
1713
|
-
return
|
|
1837
|
+
return ok(problems.length > 0 ? problems.join('\n') : 'No HTML/CSS/component files found — nothing to score. Try: /slop <path> or /slop --movements.');
|
|
1714
1838
|
}
|
|
1715
1839
|
|
|
1716
1840
|
const result = analyzeFiles(files);
|
|
@@ -1741,8 +1865,27 @@ export const COMMANDS = [
|
|
|
1741
1865
|
usage: '/observer [status|toggle|mode <deterministic|advisory>|endpoint <url|none>|model <name>|strictness <relaxed|standard|strict>|test|audit|reset]',
|
|
1742
1866
|
description: 'Inspect or configure the Cold Observer',
|
|
1743
1867
|
dialogTitle: 'Cold Observer',
|
|
1744
|
-
|
|
1868
|
+
complete: () => [
|
|
1869
|
+
{ value: 'status', label: 'status', description: 'view Cold Observer status and audits' },
|
|
1870
|
+
{ value: 'toggle', label: 'toggle', description: 'toggle Cold Observer on/off' },
|
|
1871
|
+
{ value: 'mode deterministic', label: 'mode deterministic', description: 'fast deterministic rules' },
|
|
1872
|
+
{ value: 'mode advisory', label: 'mode advisory', description: 'neural advisory verification' },
|
|
1873
|
+
{ value: 'strictness standard', label: 'strictness standard', description: 'standard safety strictness' },
|
|
1874
|
+
{ value: 'strictness strict', label: 'strictness strict', description: 'maximum safety strictness' },
|
|
1875
|
+
{ value: 'test', label: 'test', description: 'test advisory endpoint' },
|
|
1876
|
+
{ value: 'audit', label: 'audit', description: 'show recent audit history' },
|
|
1877
|
+
{ value: 'reset', label: 'reset', description: 'restore default settings' }
|
|
1878
|
+
],
|
|
1879
|
+
run: async (argv, ctx = {}) => {
|
|
1745
1880
|
const { coldObserver } = await import('./observer/coldObserver.js');
|
|
1881
|
+
|
|
1882
|
+
// If interactive prompt is active and no sub-arguments or 'status' is given, open the interactive setup menu
|
|
1883
|
+
if ((!argv || argv.length === 0 || argv[0] === '' || argv[0] === 'status') && ctx.prompt) {
|
|
1884
|
+
const { runInteractiveObserverPicker } = await import('./tui/observerPicker.js');
|
|
1885
|
+
const message = await runInteractiveObserverPicker(ctx.prompt);
|
|
1886
|
+
return ok(message, { effect: 'silent' });
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1746
1889
|
const sub = (argv[0] || 'status').toLowerCase();
|
|
1747
1890
|
|
|
1748
1891
|
if (sub === 'toggle') {
|
|
@@ -1858,6 +2001,10 @@ export const COMMANDS = [
|
|
|
1858
2001
|
usage: '/acp [status|peers]',
|
|
1859
2002
|
description: 'Agent Client Protocol (ACP) server and peer delegation status',
|
|
1860
2003
|
dialogTitle: 'Agent Client Protocol',
|
|
2004
|
+
complete: () => [
|
|
2005
|
+
{ value: 'status', label: 'status', description: 'view ACP protocol server status' },
|
|
2006
|
+
{ value: 'peers', label: 'peers', description: 'view ACP peer delegation configuration' }
|
|
2007
|
+
],
|
|
1861
2008
|
run: async (argv) => {
|
|
1862
2009
|
const sub = (argv[0] || 'status').toLowerCase();
|
|
1863
2010
|
if (sub === 'peer' || sub === 'peers') {
|
|
@@ -1888,6 +2035,284 @@ export const COMMANDS = [
|
|
|
1888
2035
|
}
|
|
1889
2036
|
},
|
|
1890
2037
|
|
|
2038
|
+
{
|
|
2039
|
+
name: 'init',
|
|
2040
|
+
aliases: ['initialize'],
|
|
2041
|
+
scope: 'local',
|
|
2042
|
+
usage: '/init',
|
|
2043
|
+
description: 'Inspect active workspace architecture and generate or update AGENTS.md instructions',
|
|
2044
|
+
dialogTitle: 'Workspace Init',
|
|
2045
|
+
run: async (argv, ctx = {}) => {
|
|
2046
|
+
const ws = ctx.loop?.workspaceRoot || process.cwd();
|
|
2047
|
+
const files = fs.existsSync(ws) ? fs.readdirSync(ws) : [];
|
|
2048
|
+
const hasPkg = files.includes('package.json');
|
|
2049
|
+
const hasCargo = files.includes('Cargo.toml');
|
|
2050
|
+
const hasPy = files.includes('pyproject.toml') || files.includes('requirements.txt');
|
|
2051
|
+
const hasGo = files.includes('go.mod');
|
|
2052
|
+
const hasAgents = files.includes('AGENTS.md');
|
|
2053
|
+
|
|
2054
|
+
const detected = [];
|
|
2055
|
+
if (hasPkg) detected.push('Node.js / JavaScript / TypeScript');
|
|
2056
|
+
if (hasCargo) detected.push('Rust / Cargo');
|
|
2057
|
+
if (hasPy) detected.push('Python');
|
|
2058
|
+
if (hasGo) detected.push('Go');
|
|
2059
|
+
if (detected.length === 0) detected.push('Generic workspace');
|
|
2060
|
+
|
|
2061
|
+
const summary = [
|
|
2062
|
+
`Workspace Initializer: ${ws}`,
|
|
2063
|
+
`Ecosystem: ${detected.join(', ')}`,
|
|
2064
|
+
`AGENTS.md: ${hasAgents ? 'Present (ready for refresh)' : 'Not found (needs creation)'}`,
|
|
2065
|
+
'',
|
|
2066
|
+
'To have Causyne Agent inspect and establish conventions for this project,',
|
|
2067
|
+
'run this turn or press Enter to prompt the agent:'
|
|
2068
|
+
].join('\n');
|
|
2069
|
+
|
|
2070
|
+
if (ctx.prompt) {
|
|
2071
|
+
ctx.prompt.editor.setText('Analyze this project architecture, testing setup, and style conventions, then create or update AGENTS.md for this workspace.');
|
|
2072
|
+
ctx.prompt.scheduleDraw();
|
|
2073
|
+
return ok(summary, { effect: 'inline' });
|
|
2074
|
+
}
|
|
2075
|
+
return ok(summary);
|
|
2076
|
+
}
|
|
2077
|
+
},
|
|
2078
|
+
|
|
2079
|
+
{
|
|
2080
|
+
name: 'review',
|
|
2081
|
+
aliases: ['code-review', 'pr-review'],
|
|
2082
|
+
scope: 'local',
|
|
2083
|
+
usage: '/review [target]',
|
|
2084
|
+
description: 'Run an immediate code review on working tree changes or a file',
|
|
2085
|
+
dialogTitle: 'Code Review',
|
|
2086
|
+
run: async (argv, ctx = {}) => {
|
|
2087
|
+
const ws = ctx.loop?.workspaceRoot || process.cwd();
|
|
2088
|
+
const target = argv.join(' ').trim();
|
|
2089
|
+
let promptText = '';
|
|
2090
|
+
if (target) {
|
|
2091
|
+
promptText = `Please review ${target} for security vulnerabilities, logic correctness, performance, and best practices.`;
|
|
2092
|
+
} else {
|
|
2093
|
+
try {
|
|
2094
|
+
const status = execSync('git status --short', { cwd: ws, encoding: 'utf8' }).trim();
|
|
2095
|
+
if (!status) {
|
|
2096
|
+
return ok('Working tree is clean. To review a specific file, run: /review <path>');
|
|
2097
|
+
}
|
|
2098
|
+
promptText = `Please review current uncommitted workspace changes (git diff) for correctness, edge cases, regression risk, and code quality.`;
|
|
2099
|
+
} catch {
|
|
2100
|
+
promptText = `Please review the files in this workspace for code quality, architectural consistency, and potential bugs.`;
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
|
|
2104
|
+
if (ctx.prompt) {
|
|
2105
|
+
ctx.prompt.editor.setText(promptText);
|
|
2106
|
+
ctx.prompt.scheduleDraw();
|
|
2107
|
+
return ok(`Ready to review: "${promptText}"`, { effect: 'inline' });
|
|
2108
|
+
}
|
|
2109
|
+
return ok(`Code review target: ${promptText}`);
|
|
2110
|
+
}
|
|
2111
|
+
},
|
|
2112
|
+
|
|
2113
|
+
{
|
|
2114
|
+
name: 'retry',
|
|
2115
|
+
aliases: ['again', 'redo'],
|
|
2116
|
+
scope: 'local',
|
|
2117
|
+
usage: '/retry',
|
|
2118
|
+
description: 'Re-send the last user prompt in this session',
|
|
2119
|
+
run: async (argv, ctx = {}) => {
|
|
2120
|
+
const messages = ctx.loop?.messages || [];
|
|
2121
|
+
const lastUser = [...messages].reverse().find(m => m.role === 'user' && typeof m.content === 'string');
|
|
2122
|
+
if (!lastUser || !lastUser.content) {
|
|
2123
|
+
return fail('No previous user prompt found in this session to retry.');
|
|
2124
|
+
}
|
|
2125
|
+
const promptText = lastUser.content;
|
|
2126
|
+
if (ctx.prompt) {
|
|
2127
|
+
ctx.prompt.editor.setText(promptText);
|
|
2128
|
+
ctx.prompt.scheduleDraw();
|
|
2129
|
+
return ok(`Re-loaded last prompt: "${promptText.slice(0, 80)}"`, { effect: 'inline' });
|
|
2130
|
+
}
|
|
2131
|
+
return ok(`Last prompt: ${promptText}`);
|
|
2132
|
+
}
|
|
2133
|
+
},
|
|
2134
|
+
|
|
2135
|
+
{
|
|
2136
|
+
name: 'title',
|
|
2137
|
+
aliases: ['rename'],
|
|
2138
|
+
scope: 'local',
|
|
2139
|
+
usage: '/title [new title]',
|
|
2140
|
+
description: 'View or rename the active chat session title',
|
|
2141
|
+
dialogTitle: 'Session Title',
|
|
2142
|
+
run: async (argv, ctx = {}) => {
|
|
2143
|
+
const activeId = getActiveSessionId();
|
|
2144
|
+
if (!activeId) return fail('No active session.');
|
|
2145
|
+
const session = getSession(activeId);
|
|
2146
|
+
const currentTitle = session ? session.title : 'Untitled';
|
|
2147
|
+
|
|
2148
|
+
const newTitle = argv.join(' ').trim();
|
|
2149
|
+
if (!newTitle) {
|
|
2150
|
+
return ok(`Active session ID: ${activeId}\nCurrent title: "${currentTitle}"\n\nTo rename, run: /title <new name>`);
|
|
2151
|
+
}
|
|
2152
|
+
|
|
2153
|
+
const renamed = renameSession(activeId, newTitle);
|
|
2154
|
+
if (!renamed) return fail(`Could not rename session "${activeId}".`);
|
|
2155
|
+
|
|
2156
|
+
if (ctx.loop?.memoryManager?.session) {
|
|
2157
|
+
ctx.loop.memoryManager.session.title = newTitle;
|
|
2158
|
+
}
|
|
2159
|
+
if (ctx.prompt?.renderer?.status) {
|
|
2160
|
+
ctx.prompt.renderer.status.setSession({ title: newTitle });
|
|
2161
|
+
}
|
|
2162
|
+
if (ctx.prompt?.surface?.stage) {
|
|
2163
|
+
ctx.prompt.scheduleDraw();
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
return ok(`Session renamed to: "${newTitle}"`, { effect: 'inline' });
|
|
2167
|
+
}
|
|
2168
|
+
},
|
|
2169
|
+
|
|
2170
|
+
{
|
|
2171
|
+
name: 'mode',
|
|
2172
|
+
aliases: ['autonomy'],
|
|
2173
|
+
scope: 'local',
|
|
2174
|
+
usage: '/mode [A | B | C]',
|
|
2175
|
+
description: 'View or switch autonomy mode (A: Ask, B: Balanced, C: Autonomous)',
|
|
2176
|
+
dialogTitle: 'Autonomy Mode',
|
|
2177
|
+
complete: () => [
|
|
2178
|
+
{ value: 'A', label: 'A', description: 'Ask — review actions before execution' },
|
|
2179
|
+
{ value: 'B', label: 'B', description: 'Balanced — normal supervised autonomy' },
|
|
2180
|
+
{ value: 'C', label: 'C', description: 'Autonomous — maximum runway within policy' }
|
|
2181
|
+
],
|
|
2182
|
+
run: async (argv, ctx = {}) => {
|
|
2183
|
+
const config = loadConfig();
|
|
2184
|
+
const target = (argv[0] || '').toUpperCase().trim();
|
|
2185
|
+
if (!target) {
|
|
2186
|
+
if (ctx.prompt) {
|
|
2187
|
+
const { openModeControl } = await import('./tui/composerControls.js');
|
|
2188
|
+
if (ctx.loop) {
|
|
2189
|
+
openModeControl(ctx.prompt, ctx.loop);
|
|
2190
|
+
return ok('Opened mode selector.', { effect: 'silent' });
|
|
2191
|
+
}
|
|
2192
|
+
}
|
|
2193
|
+
return ok(`Current autonomy mode: ${config.autonomyMode || 'B'}\nModes:\n A: Ask (confirm gated actions)\n B: Balanced (supervised execution)\n C: Autonomous (independent execution)`);
|
|
2194
|
+
}
|
|
2195
|
+
|
|
2196
|
+
if (!['A', 'B', 'C'].includes(target)) {
|
|
2197
|
+
return fail(`Invalid mode "${target}". Choose A, B, or C.`);
|
|
2198
|
+
}
|
|
2199
|
+
|
|
2200
|
+
config.autonomyMode = target;
|
|
2201
|
+
saveConfig(config);
|
|
2202
|
+
if (ctx.loop && typeof ctx.loop.setAutonomyMode === 'function') {
|
|
2203
|
+
ctx.loop.setAutonomyMode(target);
|
|
2204
|
+
}
|
|
2205
|
+
if (ctx.prompt) {
|
|
2206
|
+
ctx.prompt.notice = `Mode ${target} active`;
|
|
2207
|
+
if (ctx.prompt.scheduleDraw) ctx.prompt.scheduleDraw();
|
|
2208
|
+
return ok(`Autonomy mode switched to ${target}.`, { effect: 'inline' });
|
|
2209
|
+
}
|
|
2210
|
+
return ok(`Autonomy mode switched to ${target}.`);
|
|
2211
|
+
}
|
|
2212
|
+
},
|
|
2213
|
+
|
|
2214
|
+
{
|
|
2215
|
+
name: 'doctor',
|
|
2216
|
+
aliases: ['health', 'diagnostics'],
|
|
2217
|
+
scope: 'local',
|
|
2218
|
+
usage: '/doctor',
|
|
2219
|
+
description: 'Run environment, provider, and tool health diagnostics',
|
|
2220
|
+
dialogTitle: 'Doctor',
|
|
2221
|
+
run: async (_argv, ctx = {}) => {
|
|
2222
|
+
const config = loadConfig();
|
|
2223
|
+
const lines = ['Causyne Health & Diagnostics', ''];
|
|
2224
|
+
|
|
2225
|
+
const nodeVer = process.version;
|
|
2226
|
+
const nodeOk = parseInt(nodeVer.slice(1).split('.')[0], 10) >= 24;
|
|
2227
|
+
lines.push(` ${nodeOk ? '✅' : '⚠️'} Node.js version : ${nodeVer} ${nodeOk ? '(supported)' : '(Node >= 24 required)'}`);
|
|
2228
|
+
lines.push(` ℹ️ Platform : ${process.platform} (${process.arch})`);
|
|
2229
|
+
|
|
2230
|
+
const ws = ctx.loop?.workspaceRoot || process.cwd();
|
|
2231
|
+
let isGit = false;
|
|
2232
|
+
try {
|
|
2233
|
+
execSync('git rev-parse --is-inside-work-tree', { cwd: ws, stdio: 'pipe' });
|
|
2234
|
+
isGit = true;
|
|
2235
|
+
} catch {}
|
|
2236
|
+
lines.push(` ✅ Workspace root : ${ws}`);
|
|
2237
|
+
lines.push(` ${isGit ? '✅' : 'ℹ️'} Git repository : ${isGit ? 'active' : 'not a git repo'}`);
|
|
2238
|
+
|
|
2239
|
+
const provider = config.provider || 'not configured';
|
|
2240
|
+
const model = config.model || 'default';
|
|
2241
|
+
lines.push(` ℹ️ Provider / Model : ${provider} / ${model}`);
|
|
2242
|
+
|
|
2243
|
+
const servers = serverStatus();
|
|
2244
|
+
const grantedCount = servers.filter(s => s.granted).length;
|
|
2245
|
+
lines.push(` ℹ️ MCP Servers : ${servers.length} configured (${grantedCount} granted)`);
|
|
2246
|
+
|
|
2247
|
+
const peers = listAllPeers();
|
|
2248
|
+
lines.push(` ℹ️ ACP Peers : ${peers.length} available`);
|
|
2249
|
+
|
|
2250
|
+
lines.push('');
|
|
2251
|
+
lines.push('All diagnostic invariants passed. Run /peers detect or /model list for component details.');
|
|
2252
|
+
return ok(lines.join('\n'));
|
|
2253
|
+
}
|
|
2254
|
+
},
|
|
2255
|
+
|
|
2256
|
+
{
|
|
2257
|
+
name: 'export',
|
|
2258
|
+
aliases: ['share', 'save'],
|
|
2259
|
+
scope: 'local',
|
|
2260
|
+
usage: '/export [filename.md]',
|
|
2261
|
+
description: 'Export conversation transcript to a Markdown document in the workspace',
|
|
2262
|
+
dialogTitle: 'Export Conversation',
|
|
2263
|
+
run: async (argv, ctx = {}) => {
|
|
2264
|
+
const activeId = getActiveSessionId();
|
|
2265
|
+
if (!activeId) return fail('No active session to export.');
|
|
2266
|
+
const session = getSession(activeId);
|
|
2267
|
+
if (!session || !session.messages || session.messages.length === 0) {
|
|
2268
|
+
return fail('Session has no messages to export.');
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
const ws = ctx.loop?.workspaceRoot || process.cwd();
|
|
2272
|
+
const defaultFilename = `causyne-session-${activeId}.md`;
|
|
2273
|
+
const filename = argv.join(' ').trim() || defaultFilename;
|
|
2274
|
+
const targetPath = path.resolve(ws, filename);
|
|
2275
|
+
|
|
2276
|
+
const header = `# Causyne Agent Conversation Export\n\n- **Session ID**: \`${session.id}\`\n- **Title**: ${session.title}\n- **Date**: ${new Date(session.createdAt).toISOString()}\n- **Workspace**: \`${session.workspace}\`\n- **Total Messages**: ${session.messages.length}\n\n---\n\n`;
|
|
2277
|
+
|
|
2278
|
+
const body = session.messages
|
|
2279
|
+
.filter(m => m.role !== 'system')
|
|
2280
|
+
.map(m => {
|
|
2281
|
+
const roleLabel = m.role === 'user' ? '### 👤 User' : '### 🤖 Causyne Agent';
|
|
2282
|
+
return `${roleLabel}\n\n${typeof m.content === 'string' ? m.content : JSON.stringify(m.content, null, 2)}\n`;
|
|
2283
|
+
})
|
|
2284
|
+
.join('\n---\n\n');
|
|
2285
|
+
|
|
2286
|
+
try {
|
|
2287
|
+
fs.writeFileSync(targetPath, header + body, { encoding: 'utf8', mode: 0o644 });
|
|
2288
|
+
return ok(`Exported conversation to: ${targetPath}`);
|
|
2289
|
+
} catch (err) {
|
|
2290
|
+
return fail(`Could not export conversation: ${err.message}`);
|
|
2291
|
+
}
|
|
2292
|
+
}
|
|
2293
|
+
},
|
|
2294
|
+
|
|
2295
|
+
{
|
|
2296
|
+
name: 'version',
|
|
2297
|
+
aliases: ['v', 'about'],
|
|
2298
|
+
scope: 'local',
|
|
2299
|
+
usage: '/version',
|
|
2300
|
+
description: 'Display Causyne Agent version and runtime environment',
|
|
2301
|
+
dialogTitle: 'Version',
|
|
2302
|
+
run: async () => {
|
|
2303
|
+
const version = getPackageVersion();
|
|
2304
|
+
const config = loadConfig();
|
|
2305
|
+
return ok([
|
|
2306
|
+
`Causyne Agent v${version}`,
|
|
2307
|
+
` Runtime : Node.js ${process.version} (${process.platform} ${process.arch})`,
|
|
2308
|
+
` Provider : ${config.provider || 'default'}`,
|
|
2309
|
+
` Model : ${config.model || 'default'}`,
|
|
2310
|
+
` License : Business Source License 1.1 (BUSL-1.1)`,
|
|
2311
|
+
` Website : https://causyne.com`
|
|
2312
|
+
].join('\n'));
|
|
2313
|
+
}
|
|
2314
|
+
},
|
|
2315
|
+
|
|
1891
2316
|
{
|
|
1892
2317
|
name: 'exit',
|
|
1893
2318
|
aliases: ['quit'],
|