iranti 0.2.11 → 0.2.12
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/scripts/iranti-cli.js +104 -19
- package/dist/scripts/iranti-mcp.js +1 -1
- package/dist/scripts/seed.js +10 -10
- package/dist/src/api/server.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -245,6 +245,14 @@ iranti run --instance local
|
|
|
245
245
|
|
|
246
246
|
If local PostgreSQL is available, setup can bootstrap a localhost database for you. If local PostgreSQL is not available, setup recommends Docker when Docker is installed, and otherwise steers you to managed PostgreSQL with concrete install guidance.
|
|
247
247
|
|
|
248
|
+
If something still fails and you need more detail, use:
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
iranti doctor --debug
|
|
252
|
+
iranti run --instance local --debug
|
|
253
|
+
iranti upgrade --verbose
|
|
254
|
+
```
|
|
255
|
+
|
|
248
256
|
Advanced/manual path:
|
|
249
257
|
|
|
250
258
|
```bash
|
|
@@ -21,6 +21,15 @@ const resolutionist_1 = require("../src/resolutionist");
|
|
|
21
21
|
const chat_1 = require("../src/chat");
|
|
22
22
|
const backends_1 = require("../src/library/backends");
|
|
23
23
|
const sdk_1 = require("../src/sdk");
|
|
24
|
+
class CliError extends Error {
|
|
25
|
+
constructor(code, message, hints = [], details) {
|
|
26
|
+
super(message);
|
|
27
|
+
this.name = 'CliError';
|
|
28
|
+
this.code = code;
|
|
29
|
+
this.hints = hints;
|
|
30
|
+
this.details = details;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
24
33
|
const PROVIDER_ENV_KEYS = {
|
|
25
34
|
mock: null,
|
|
26
35
|
ollama: null,
|
|
@@ -43,6 +52,8 @@ const ANSI = {
|
|
|
43
52
|
cyan: '\x1b[36m',
|
|
44
53
|
gray: '\x1b[90m',
|
|
45
54
|
};
|
|
55
|
+
let CLI_DEBUG = process.argv.includes('--debug') || process.env.IRANTI_DEBUG === '1';
|
|
56
|
+
let CLI_VERBOSE = CLI_DEBUG || process.argv.includes('--verbose') || process.env.IRANTI_VERBOSE === '1';
|
|
46
57
|
function useColor() {
|
|
47
58
|
return Boolean(process.stdout.isTTY && !process.env.NO_COLOR);
|
|
48
59
|
}
|
|
@@ -81,6 +92,25 @@ function printNextSteps(steps) {
|
|
|
81
92
|
console.log(` ${index + 1}. ${step}`);
|
|
82
93
|
}
|
|
83
94
|
}
|
|
95
|
+
function setCliDebugFlags(args) {
|
|
96
|
+
CLI_DEBUG = CLI_DEBUG || hasFlag(args, 'debug');
|
|
97
|
+
CLI_VERBOSE = CLI_VERBOSE || CLI_DEBUG || hasFlag(args, 'verbose');
|
|
98
|
+
}
|
|
99
|
+
function debugLog(message, details) {
|
|
100
|
+
if (!CLI_DEBUG)
|
|
101
|
+
return;
|
|
102
|
+
const suffix = details && Object.keys(details).length > 0 ? ` ${JSON.stringify(details)}` : '';
|
|
103
|
+
console.log(`${paint('[DEBUG]', 'gray')} ${message}${suffix}`);
|
|
104
|
+
}
|
|
105
|
+
function verboseLog(message, details) {
|
|
106
|
+
if (!CLI_VERBOSE)
|
|
107
|
+
return;
|
|
108
|
+
const suffix = details && Object.keys(details).length > 0 ? ` ${JSON.stringify(details)}` : '';
|
|
109
|
+
console.log(`${paint('[TRACE]', 'gray')} ${message}${suffix}`);
|
|
110
|
+
}
|
|
111
|
+
function cliError(code, message, hints = [], details) {
|
|
112
|
+
return new CliError(code, message, hints, details);
|
|
113
|
+
}
|
|
84
114
|
function parseArgs(argv) {
|
|
85
115
|
const flags = new Map();
|
|
86
116
|
const positionals = [];
|
|
@@ -197,6 +227,7 @@ function formatSetupBootstrapFailure(error) {
|
|
|
197
227
|
}
|
|
198
228
|
async function handoffToScript(scriptName, rawArgs) {
|
|
199
229
|
const builtPath = builtScriptPath(scriptName);
|
|
230
|
+
debugLog('Handing off to companion script.', { scriptName, builtPath, rawArgs: rawArgs.join(' ') });
|
|
200
231
|
if (fs_1.default.existsSync(builtPath)) {
|
|
201
232
|
await new Promise((resolve, reject) => {
|
|
202
233
|
const child = (0, child_process_1.spawn)(process.execPath, [builtPath, ...rawArgs], {
|
|
@@ -219,7 +250,7 @@ async function handoffToScript(scriptName, rawArgs) {
|
|
|
219
250
|
}
|
|
220
251
|
const sourcePath = path_1.default.resolve(process.cwd(), 'scripts', `${scriptName}.ts`);
|
|
221
252
|
if (!fs_1.default.existsSync(sourcePath)) {
|
|
222
|
-
throw
|
|
253
|
+
throw cliError('IRANTI_SCRIPT_NOT_FOUND', `Unable to locate ${scriptName} implementation.`, ['Run from an installed Iranti package or from the Iranti repo root where scripts/ exists.'], { scriptName, sourcePath, builtPath });
|
|
223
254
|
}
|
|
224
255
|
await new Promise((resolve, reject) => {
|
|
225
256
|
const child = (0, child_process_1.spawn)('npx', ['ts-node', sourcePath, ...rawArgs], {
|
|
@@ -428,8 +459,12 @@ function instancePaths(root, name) {
|
|
|
428
459
|
async function loadInstanceEnv(root, name) {
|
|
429
460
|
const paths = instancePaths(root, name);
|
|
430
461
|
if (!fs_1.default.existsSync(paths.envFile)) {
|
|
431
|
-
throw
|
|
462
|
+
throw cliError('IRANTI_INSTANCE_NOT_FOUND', `Instance '${name}' not found at ${paths.instanceDir}`, [
|
|
463
|
+
'Run `iranti instance list` to see known instances.',
|
|
464
|
+
`Run \`iranti setup\` or \`iranti instance create ${name}\` if this instance does not exist yet.`,
|
|
465
|
+
], { instance: name, root, instanceDir: paths.instanceDir });
|
|
432
466
|
}
|
|
467
|
+
debugLog('Loaded instance env target.', { instance: name, envFile: paths.envFile });
|
|
433
468
|
return {
|
|
434
469
|
...paths,
|
|
435
470
|
env: await readEnvFile(paths.envFile),
|
|
@@ -451,15 +486,15 @@ async function resolveProviderKeyTarget(args) {
|
|
|
451
486
|
const projectPath = path_1.default.resolve(getFlag(args, 'project') ?? process.cwd());
|
|
452
487
|
const bindingFile = path_1.default.join(projectPath, '.env.iranti');
|
|
453
488
|
if (!fs_1.default.existsSync(bindingFile)) {
|
|
454
|
-
throw
|
|
489
|
+
throw cliError('IRANTI_PROJECT_BINDING_MISSING', 'No --instance provided and no .env.iranti found in the current project.', ['Run `iranti project init . --instance <name>` or pass `--instance <name>`.'], { projectPath, bindingFile });
|
|
455
490
|
}
|
|
456
491
|
const binding = await readEnvFile(bindingFile);
|
|
457
492
|
const envFile = binding.IRANTI_INSTANCE_ENV?.trim();
|
|
458
493
|
if (!envFile) {
|
|
459
|
-
throw
|
|
494
|
+
throw cliError('IRANTI_BINDING_INSTANCE_ENV_MISSING', `Project binding is missing IRANTI_INSTANCE_ENV: ${bindingFile}`, ['Run `iranti configure project` to refresh the binding.'], { bindingFile });
|
|
460
495
|
}
|
|
461
496
|
if (!fs_1.default.existsSync(envFile)) {
|
|
462
|
-
throw
|
|
497
|
+
throw cliError('IRANTI_BINDING_INSTANCE_ENV_NOT_FOUND', `Instance env referenced by project binding was not found: ${envFile}`, ['Run `iranti configure project` to refresh the binding or recreate the target instance.'], { bindingFile, envFile });
|
|
463
498
|
}
|
|
464
499
|
return {
|
|
465
500
|
instanceName: binding.IRANTI_INSTANCE?.trim() || undefined,
|
|
@@ -1506,6 +1541,7 @@ function resolveDoctorEnvTarget(args) {
|
|
|
1506
1541
|
const explicitEnv = getFlag(args, 'env');
|
|
1507
1542
|
const cwd = process.cwd();
|
|
1508
1543
|
if (explicitEnv) {
|
|
1544
|
+
debugLog('Doctor target resolved from explicit env.', { envFile: path_1.default.resolve(explicitEnv) });
|
|
1509
1545
|
return {
|
|
1510
1546
|
envFile: path_1.default.resolve(explicitEnv),
|
|
1511
1547
|
envSource: 'explicit-env',
|
|
@@ -1513,6 +1549,7 @@ function resolveDoctorEnvTarget(args) {
|
|
|
1513
1549
|
}
|
|
1514
1550
|
if (instanceName) {
|
|
1515
1551
|
const root = resolveInstallRoot(args, scope);
|
|
1552
|
+
debugLog('Doctor target resolved from instance.', { instance: instanceName, root });
|
|
1516
1553
|
return {
|
|
1517
1554
|
envFile: path_1.default.join(root, 'instances', instanceName, '.env'),
|
|
1518
1555
|
envSource: `instance:${instanceName}`,
|
|
@@ -1521,11 +1558,14 @@ function resolveDoctorEnvTarget(args) {
|
|
|
1521
1558
|
const repoEnv = path_1.default.join(cwd, '.env');
|
|
1522
1559
|
const projectEnv = path_1.default.join(cwd, '.env.iranti');
|
|
1523
1560
|
if (fs_1.default.existsSync(repoEnv)) {
|
|
1561
|
+
debugLog('Doctor target resolved from repo env.', { envFile: repoEnv });
|
|
1524
1562
|
return { envFile: repoEnv, envSource: 'repo' };
|
|
1525
1563
|
}
|
|
1526
1564
|
if (fs_1.default.existsSync(projectEnv)) {
|
|
1565
|
+
debugLog('Doctor target resolved from project binding.', { envFile: projectEnv });
|
|
1527
1566
|
return { envFile: projectEnv, envSource: 'project-binding' };
|
|
1528
1567
|
}
|
|
1568
|
+
debugLog('Doctor target resolution found no env file.', { cwd });
|
|
1529
1569
|
return { envFile: null, envSource: 'repo' };
|
|
1530
1570
|
}
|
|
1531
1571
|
function resolveUpgradeTarget(raw) {
|
|
@@ -1646,6 +1686,11 @@ function quoteForCmd(arg) {
|
|
|
1646
1686
|
return `"${arg.replace(/"/g, '\\"')}"`;
|
|
1647
1687
|
}
|
|
1648
1688
|
function runCommandCapture(executable, args, cwd, extraEnv) {
|
|
1689
|
+
verboseLog('Running subprocess (capture).', {
|
|
1690
|
+
executable,
|
|
1691
|
+
args: args.join(' '),
|
|
1692
|
+
cwd: cwd ?? process.cwd(),
|
|
1693
|
+
});
|
|
1649
1694
|
const proc = process.platform === 'win32'
|
|
1650
1695
|
? (0, child_process_1.spawnSync)(process.env.ComSpec ?? 'cmd.exe', [
|
|
1651
1696
|
'/d',
|
|
@@ -1669,13 +1714,24 @@ function runCommandCapture(executable, args, cwd, extraEnv) {
|
|
|
1669
1714
|
...extraEnv,
|
|
1670
1715
|
},
|
|
1671
1716
|
});
|
|
1672
|
-
|
|
1717
|
+
const result = {
|
|
1673
1718
|
status: proc.status,
|
|
1674
1719
|
stdout: proc.stdout ?? '',
|
|
1675
1720
|
stderr: proc.stderr ?? '',
|
|
1676
1721
|
};
|
|
1722
|
+
verboseLog('Subprocess finished (capture).', {
|
|
1723
|
+
executable,
|
|
1724
|
+
status: result.status ?? -1,
|
|
1725
|
+
stderr: result.stderr.trim() || null,
|
|
1726
|
+
});
|
|
1727
|
+
return result;
|
|
1677
1728
|
}
|
|
1678
1729
|
function runCommandInteractive(step) {
|
|
1730
|
+
verboseLog('Running subprocess (interactive).', {
|
|
1731
|
+
label: step.label,
|
|
1732
|
+
command: step.display,
|
|
1733
|
+
cwd: step.cwd ?? process.cwd(),
|
|
1734
|
+
});
|
|
1679
1735
|
const proc = process.platform === 'win32'
|
|
1680
1736
|
? (0, child_process_1.spawnSync)(process.env.ComSpec ?? 'cmd.exe', [
|
|
1681
1737
|
'/d',
|
|
@@ -1689,6 +1745,10 @@ function runCommandInteractive(step) {
|
|
|
1689
1745
|
cwd: step.cwd,
|
|
1690
1746
|
stdio: 'inherit',
|
|
1691
1747
|
});
|
|
1748
|
+
verboseLog('Subprocess finished (interactive).', {
|
|
1749
|
+
label: step.label,
|
|
1750
|
+
status: proc.status ?? -1,
|
|
1751
|
+
});
|
|
1692
1752
|
return proc.status;
|
|
1693
1753
|
}
|
|
1694
1754
|
function deriveDatabaseUrlForMode(mode, instanceName, explicitDatabaseUrl) {
|
|
@@ -3144,19 +3204,21 @@ async function showInstanceCommand(args) {
|
|
|
3144
3204
|
}
|
|
3145
3205
|
async function runInstanceCommand(args) {
|
|
3146
3206
|
const name = getFlag(args, 'instance') ?? args.positionals[0] ?? args.subcommand;
|
|
3147
|
-
if (!name)
|
|
3148
|
-
throw
|
|
3207
|
+
if (!name) {
|
|
3208
|
+
throw cliError('IRANTI_INSTANCE_NAME_REQUIRED', 'Missing instance name. Usage: iranti run --instance <name>', ['Run `iranti instance list` to see configured instances.']);
|
|
3209
|
+
}
|
|
3149
3210
|
const scope = normalizeScope(getFlag(args, 'scope'));
|
|
3150
3211
|
const root = resolveInstallRoot(args, scope);
|
|
3151
3212
|
const envFile = path_1.default.join(root, 'instances', name, '.env');
|
|
3152
|
-
if (!fs_1.default.existsSync(envFile))
|
|
3153
|
-
throw
|
|
3213
|
+
if (!fs_1.default.existsSync(envFile)) {
|
|
3214
|
+
throw cliError('IRANTI_INSTANCE_NOT_FOUND', `Instance '${name}' not found. Create it first.`, [`Run \`iranti setup\` or \`iranti instance create ${name}\` first.`], { instance: name, envFile });
|
|
3215
|
+
}
|
|
3154
3216
|
const env = await readEnvFile(envFile);
|
|
3155
3217
|
for (const [k, v] of Object.entries(env)) {
|
|
3156
3218
|
process.env[k] = v;
|
|
3157
3219
|
}
|
|
3158
3220
|
if (!process.env.DATABASE_URL || process.env.DATABASE_URL.includes('yourpassword')) {
|
|
3159
|
-
throw
|
|
3221
|
+
throw cliError('IRANTI_INSTANCE_DATABASE_PLACEHOLDER', `Instance '${name}' has placeholder DATABASE_URL. Edit ${envFile} first.`, ['Run `iranti configure instance <name> --interactive` or rerun `iranti setup`.'], { instance: name, envFile });
|
|
3160
3222
|
}
|
|
3161
3223
|
console.log(`${infoLabel()} Starting Iranti instance '${name}' on port ${process.env.IRANTI_PORT ?? '3001'}...`);
|
|
3162
3224
|
const serverEntry = path_1.default.resolve(__dirname, '..', 'src', 'api', 'server');
|
|
@@ -3167,7 +3229,7 @@ async function projectInitCommand(args) {
|
|
|
3167
3229
|
const projectPath = path_1.default.resolve(args.positionals[0] ?? process.cwd());
|
|
3168
3230
|
const instanceName = getFlag(args, 'instance');
|
|
3169
3231
|
if (!instanceName) {
|
|
3170
|
-
throw
|
|
3232
|
+
throw cliError('IRANTI_INSTANCE_NAME_REQUIRED', 'Missing --instance <name>. Usage: iranti project init [path] --instance <name>', ['Run `iranti instance list` to see available instances.']);
|
|
3171
3233
|
}
|
|
3172
3234
|
const scope = normalizeScope(getFlag(args, 'scope'));
|
|
3173
3235
|
const root = resolveInstallRoot(args, scope);
|
|
@@ -3178,7 +3240,7 @@ async function projectInitCommand(args) {
|
|
|
3178
3240
|
const projectMode = normalizeProjectMode(getFlag(args, 'mode'), 'isolated');
|
|
3179
3241
|
const outFile = path_1.default.join(projectPath, '.env.iranti');
|
|
3180
3242
|
if (fs_1.default.existsSync(outFile) && !hasFlag(args, 'force')) {
|
|
3181
|
-
throw
|
|
3243
|
+
throw cliError('IRANTI_PROJECT_BINDING_EXISTS', `${outFile} already exists. Use --force to overwrite.`, ['Use `iranti configure project` if you want to refresh the existing binding instead.'], { outFile });
|
|
3182
3244
|
}
|
|
3183
3245
|
await writeProjectBinding(projectPath, {
|
|
3184
3246
|
IRANTI_URL: `http://localhost:${port}`,
|
|
@@ -3633,7 +3695,7 @@ async function claudeSetupCommand(args) {
|
|
|
3633
3695
|
?? (args.command === 'claude-setup' ? args.subcommand ?? undefined : undefined);
|
|
3634
3696
|
const scanDir = path_1.default.resolve(dirArg ?? process.cwd());
|
|
3635
3697
|
if (!fs_1.default.existsSync(scanDir)) {
|
|
3636
|
-
throw
|
|
3698
|
+
throw cliError('IRANTI_SCAN_PATH_NOT_FOUND', `Scan directory not found: ${scanDir}`);
|
|
3637
3699
|
}
|
|
3638
3700
|
const candidates = findClaudeProjects(scanDir, recursive);
|
|
3639
3701
|
if (candidates.length === 0) {
|
|
@@ -3680,10 +3742,10 @@ async function claudeSetupCommand(args) {
|
|
|
3680
3742
|
? path_1.default.resolve(explicitProjectEnv)
|
|
3681
3743
|
: path_1.default.join(projectPath, '.env.iranti');
|
|
3682
3744
|
if (!fs_1.default.existsSync(projectPath)) {
|
|
3683
|
-
throw
|
|
3745
|
+
throw cliError('IRANTI_PROJECT_PATH_NOT_FOUND', `Project path not found: ${projectPath}`);
|
|
3684
3746
|
}
|
|
3685
3747
|
if (!fs_1.default.existsSync(projectEnvPath)) {
|
|
3686
|
-
throw
|
|
3748
|
+
throw cliError('IRANTI_PROJECT_BINDING_MISSING', `Project binding not found at ${projectEnvPath}. Run \`iranti project init\` or \`iranti configure project\` first.`, ['Run `iranti project init . --instance <name>` before `iranti claude-setup`.'], { projectEnvPath });
|
|
3687
3749
|
}
|
|
3688
3750
|
const result = await writeClaudeCodeProjectFiles(projectPath, projectEnvPath, force);
|
|
3689
3751
|
console.log(`${okLabel()} Claude Code integration scaffolded`);
|
|
@@ -3725,6 +3787,7 @@ function printHelp() {
|
|
|
3725
3787
|
console.log(sectionTitle('Iranti CLI'));
|
|
3726
3788
|
console.log('Memory infrastructure for multi-agent systems.');
|
|
3727
3789
|
console.log('Most instance-aware commands also accept --root <path> in addition to --scope.');
|
|
3790
|
+
console.log('Global debugging flags: --debug for extra diagnostics, --verbose for subprocess trace output.');
|
|
3728
3791
|
console.log('');
|
|
3729
3792
|
printRows('Start Here', rows);
|
|
3730
3793
|
printRows('Setup And Runtime', [
|
|
@@ -3750,7 +3813,7 @@ function printHelp() {
|
|
|
3750
3813
|
['iranti remove api-key [provider] [--instance <name>] [--project <path>] [--json]', 'Remove a stored provider key.'],
|
|
3751
3814
|
]);
|
|
3752
3815
|
printRows('Diagnostics And Operator Tools', [
|
|
3753
|
-
['iranti doctor [--instance <name>] [--scope user|system] [--env <file>] [--json]', 'Run environment and runtime diagnostics.'],
|
|
3816
|
+
['iranti doctor [--instance <name>] [--scope user|system] [--env <file>] [--json] [--debug]', 'Run environment and runtime diagnostics.'],
|
|
3754
3817
|
['iranti status [--scope user|system] [--json]', 'Show runtime roots, bindings, and known instances.'],
|
|
3755
3818
|
['iranti upgrade [--check] [--dry-run] [--yes] [--all] [--target auto|npm-global|npm-repo|python[,python]] [--json]', 'Check or run CLI/runtime/package upgrades.'],
|
|
3756
3819
|
['iranti handshake [--instance <name> | --project-env <file>] [--agent <id>] [--task <text>] [--recent <msg1||msg2>] [--recent-file <path>] [--json]', 'Manually inspect Attendant handshake output.'],
|
|
@@ -3825,6 +3888,12 @@ function printProviderKeyHelp() {
|
|
|
3825
3888
|
}
|
|
3826
3889
|
async function main() {
|
|
3827
3890
|
const args = parseArgs(process.argv.slice(2));
|
|
3891
|
+
setCliDebugFlags(args);
|
|
3892
|
+
debugLog('CLI invocation started.', {
|
|
3893
|
+
command: args.command,
|
|
3894
|
+
subcommand: args.subcommand,
|
|
3895
|
+
cwd: process.cwd(),
|
|
3896
|
+
});
|
|
3828
3897
|
if (!args.command || args.command === 'help' || args.command === '--help') {
|
|
3829
3898
|
printHelp();
|
|
3830
3899
|
return;
|
|
@@ -3993,11 +4062,27 @@ async function main() {
|
|
|
3993
4062
|
}
|
|
3994
4063
|
throw new Error(`Unknown integrate target '${args.subcommand ?? ''}'. Use 'claude' or 'codex'.`);
|
|
3995
4064
|
}
|
|
3996
|
-
throw
|
|
4065
|
+
throw cliError('IRANTI_UNKNOWN_COMMAND', `Unknown command '${args.command}'. Run: iranti help`, ['Use `iranti help` to see the current command surface.'], { command: args.command });
|
|
3997
4066
|
}
|
|
3998
4067
|
main().catch((err) => {
|
|
3999
4068
|
const message = err instanceof Error ? err.message : String(err);
|
|
4000
|
-
|
|
4069
|
+
const code = err instanceof CliError ? err.code : null;
|
|
4070
|
+
console.error(`${failLabel('ERROR')}${code ? ` [${code}]` : ''} ${message}`);
|
|
4071
|
+
if (err instanceof CliError && err.hints.length > 0) {
|
|
4072
|
+
console.error('');
|
|
4073
|
+
console.error('Possible fixes:');
|
|
4074
|
+
for (const hint of err.hints) {
|
|
4075
|
+
console.error(` - ${hint}`);
|
|
4076
|
+
}
|
|
4077
|
+
}
|
|
4078
|
+
if (CLI_DEBUG && err instanceof CliError && err.details && Object.keys(err.details).length > 0) {
|
|
4079
|
+
console.error('');
|
|
4080
|
+
console.error(`${paint('[DEBUG]', 'gray')} ${JSON.stringify(err.details, null, 2)}`);
|
|
4081
|
+
}
|
|
4082
|
+
if (CLI_DEBUG && err instanceof Error && err.stack) {
|
|
4083
|
+
console.error('');
|
|
4084
|
+
console.error(err.stack);
|
|
4085
|
+
}
|
|
4001
4086
|
process.exit(1);
|
|
4002
4087
|
});
|
|
4003
4088
|
//# sourceMappingURL=iranti-cli.js.map
|
|
@@ -144,7 +144,7 @@ async function main() {
|
|
|
144
144
|
await ensureDefaultAgent(iranti);
|
|
145
145
|
const server = new mcp_js_1.McpServer({
|
|
146
146
|
name: 'iranti-mcp',
|
|
147
|
-
version: '0.2.
|
|
147
|
+
version: '0.2.12',
|
|
148
148
|
});
|
|
149
149
|
server.registerTool('iranti_handshake', {
|
|
150
150
|
description: `Initialize or refresh an agent's working-memory brief for the current task.
|
package/dist/scripts/seed.js
CHANGED
|
@@ -15,7 +15,7 @@ const STAFF_ENTRIES = [
|
|
|
15
15
|
entityId: 'librarian',
|
|
16
16
|
key: 'operating_rules',
|
|
17
17
|
valueRaw: {
|
|
18
|
-
version: '0.2.
|
|
18
|
+
version: '0.2.12',
|
|
19
19
|
rules: [
|
|
20
20
|
'All writes from external agents go through the Librarian — never directly to the database',
|
|
21
21
|
'Check for existing entries before every write',
|
|
@@ -39,7 +39,7 @@ const STAFF_ENTRIES = [
|
|
|
39
39
|
entityId: 'attendant',
|
|
40
40
|
key: 'operating_rules',
|
|
41
41
|
valueRaw: {
|
|
42
|
-
version: '0.2.
|
|
42
|
+
version: '0.2.12',
|
|
43
43
|
rules: [
|
|
44
44
|
'Assigned one-per-external-agent — serve the agent, not the user',
|
|
45
45
|
'On handshake: read AGENTS.md and MCP config, query Librarian for relevant rules and task context',
|
|
@@ -61,7 +61,7 @@ const STAFF_ENTRIES = [
|
|
|
61
61
|
entityId: 'archivist',
|
|
62
62
|
key: 'operating_rules',
|
|
63
63
|
valueRaw: {
|
|
64
|
-
version: '0.2.
|
|
64
|
+
version: '0.2.12',
|
|
65
65
|
rules: [
|
|
66
66
|
'Run on schedule or when conflict flags exceed threshold — not on every write',
|
|
67
67
|
'Scan for expired, low-confidence, flagged, and duplicate entries',
|
|
@@ -82,7 +82,7 @@ const STAFF_ENTRIES = [
|
|
|
82
82
|
entityType: 'system',
|
|
83
83
|
entityId: 'library',
|
|
84
84
|
key: 'schema_version',
|
|
85
|
-
valueRaw: { version: '0.2.
|
|
85
|
+
valueRaw: { version: '0.2.12' },
|
|
86
86
|
valueSummary: 'Current Library schema version.',
|
|
87
87
|
confidence: 100,
|
|
88
88
|
source: 'seed',
|
|
@@ -95,7 +95,7 @@ const STAFF_ENTRIES = [
|
|
|
95
95
|
key: 'initialization_log',
|
|
96
96
|
valueRaw: {
|
|
97
97
|
initializedAt: new Date().toISOString(),
|
|
98
|
-
seedVersion: '0.2.
|
|
98
|
+
seedVersion: '0.2.12',
|
|
99
99
|
},
|
|
100
100
|
valueSummary: 'Record of when and how this Library was initialized.',
|
|
101
101
|
confidence: 100,
|
|
@@ -108,7 +108,7 @@ const STAFF_ENTRIES = [
|
|
|
108
108
|
entityId: 'ontology',
|
|
109
109
|
key: 'core_schema',
|
|
110
110
|
valueRaw: {
|
|
111
|
-
version: '0.2.
|
|
111
|
+
version: '0.2.12',
|
|
112
112
|
states: ['candidate', 'provisional', 'canonical'],
|
|
113
113
|
coreEntityTypes: [
|
|
114
114
|
'person',
|
|
@@ -156,7 +156,7 @@ const STAFF_ENTRIES = [
|
|
|
156
156
|
entityId: 'ontology',
|
|
157
157
|
key: 'extension_registry',
|
|
158
158
|
valueRaw: {
|
|
159
|
-
version: '0.2.
|
|
159
|
+
version: '0.2.12',
|
|
160
160
|
namespaces: {
|
|
161
161
|
education: {
|
|
162
162
|
status: 'provisional',
|
|
@@ -187,7 +187,7 @@ const STAFF_ENTRIES = [
|
|
|
187
187
|
entityId: 'ontology',
|
|
188
188
|
key: 'candidate_terms',
|
|
189
189
|
valueRaw: {
|
|
190
|
-
version: '0.2.
|
|
190
|
+
version: '0.2.12',
|
|
191
191
|
terms: [],
|
|
192
192
|
},
|
|
193
193
|
valueSummary: 'Staging area for ontology terms detected repeatedly but not yet promoted.',
|
|
@@ -201,7 +201,7 @@ const STAFF_ENTRIES = [
|
|
|
201
201
|
entityId: 'ontology',
|
|
202
202
|
key: 'promotion_policy',
|
|
203
203
|
valueRaw: {
|
|
204
|
-
version: '0.2.
|
|
204
|
+
version: '0.2.12',
|
|
205
205
|
candidateToProvisional: {
|
|
206
206
|
minSeenCount: 3,
|
|
207
207
|
minDistinctAgents: 2,
|
|
@@ -237,7 +237,7 @@ const STAFF_ENTRIES = [
|
|
|
237
237
|
entityId: 'ontology',
|
|
238
238
|
key: 'change_log',
|
|
239
239
|
valueRaw: {
|
|
240
|
-
version: '0.2.
|
|
240
|
+
version: '0.2.12',
|
|
241
241
|
events: [
|
|
242
242
|
{
|
|
243
243
|
at: new Date().toISOString(),
|
package/dist/src/api/server.js
CHANGED
|
@@ -69,7 +69,7 @@ app.use(express_1.default.json({ limit: process.env.IRANTI_MAX_BODY_BYTES ?? '25
|
|
|
69
69
|
app.get(ROUTES.health, (_req, res) => {
|
|
70
70
|
res.json({
|
|
71
71
|
status: 'ok',
|
|
72
|
-
version: '0.2.
|
|
72
|
+
version: '0.2.12',
|
|
73
73
|
provider: process.env.LLM_PROVIDER ?? 'mock',
|
|
74
74
|
});
|
|
75
75
|
});
|