iranti 0.2.8 → 0.2.9

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 CHANGED
@@ -495,6 +495,7 @@ iranti upgrade --yes
495
495
  This validates the active env file, database URL, API key presence, provider selection, and provider-specific credentials.
496
496
  `iranti status` shows the current runtime root, known instances, and local binding files.
497
497
  `iranti upgrade` detects repo/global/Python install paths, compares current vs latest published versions, prints the exact plan, and executes the selected upgrade path when you pass `--yes`.
498
+ On Windows, if the currently running CLI is itself the global npm install being upgraded, Iranti now hands that npm-global step off to a detached updater process instead of trying to replace the live binary in place.
498
499
  `iranti configure ...` updates instance/project credentials without manual env editing.
499
500
  `iranti auth ...` manages registry-backed API keys and can sync them into instance or project bindings.
500
501
 
@@ -1635,6 +1635,7 @@ function detectUpgradeContext(args) {
1635
1635
  const globalNpmRoot = detectGlobalNpmRoot();
1636
1636
  const globalNpmVersion = detectGlobalNpmInstalledVersion();
1637
1637
  const globalNpmInstall = globalNpmVersion !== null;
1638
+ const runningFromGlobalNpmInstall = Boolean(globalNpmRoot && isPathInside(globalNpmRoot, packageRootPath));
1638
1639
  const python = detectPythonLauncher();
1639
1640
  const pythonVersion = detectPythonInstalledVersion(python);
1640
1641
  const availableTargets = [];
@@ -1654,6 +1655,7 @@ function detectUpgradeContext(args) {
1654
1655
  globalNpmInstall,
1655
1656
  globalNpmRoot,
1656
1657
  globalNpmVersion,
1658
+ runningFromGlobalNpmInstall,
1657
1659
  python,
1658
1660
  pythonVersion,
1659
1661
  availableTargets,
@@ -1820,6 +1822,21 @@ function verifyGlobalNpmInstall() {
1820
1822
  };
1821
1823
  }
1822
1824
  }
1825
+ function canScheduleWindowsGlobalNpmSelfUpgrade(context) {
1826
+ return process.platform === 'win32' && context.runningFromGlobalNpmInstall;
1827
+ }
1828
+ function scheduleDetachedWindowsGlobalNpmUpgrade(command) {
1829
+ const shell = process.env.ComSpec ?? 'cmd.exe';
1830
+ const commandLine = `ping 127.0.0.1 -n 3 >nul & ${command.display}`;
1831
+ const child = (0, child_process_1.spawn)(shell, ['/d', '/c', commandLine], {
1832
+ detached: true,
1833
+ stdio: 'ignore',
1834
+ windowsHide: true,
1835
+ cwd: command.cwd,
1836
+ env: process.env,
1837
+ });
1838
+ child.unref();
1839
+ }
1823
1840
  function verifyPythonInstall(command) {
1824
1841
  const version = detectPythonInstalledVersion(command);
1825
1842
  return version
@@ -1832,6 +1849,20 @@ async function executeUpgradeTarget(target, context) {
1832
1849
  }
1833
1850
  const commands = commandListForTarget(target, context);
1834
1851
  const steps = [];
1852
+ if (target === 'npm-global' && canScheduleWindowsGlobalNpmSelfUpgrade(context)) {
1853
+ const command = commands[0];
1854
+ console.log(`${infoLabel()} ${command.display} (scheduled in a detached updater because the current Windows CLI cannot replace its own live global install)`);
1855
+ scheduleDetachedWindowsGlobalNpmUpgrade(command);
1856
+ steps.push({ label: `${command.label} (detached)`, command: command.display });
1857
+ return {
1858
+ target,
1859
+ steps,
1860
+ verification: {
1861
+ status: 'warn',
1862
+ detail: 'Scheduled detached npm global upgrade. Wait a few seconds, then open a new shell or rerun `iranti upgrade --check` to confirm the new global CLI is active.',
1863
+ },
1864
+ };
1865
+ }
1835
1866
  for (const command of commands) {
1836
1867
  console.log(`${infoLabel()} ${command.display}`);
1837
1868
  const status = runCommandInteractive(command);
@@ -2570,6 +2601,7 @@ async function upgradeCommand(args) {
2570
2601
  globalNpmInstall: context.globalNpmInstall,
2571
2602
  globalNpmRoot: context.globalNpmRoot,
2572
2603
  globalNpmVersion: context.globalNpmVersion,
2604
+ runningFromGlobalNpmInstall: context.runningFromGlobalNpmInstall,
2573
2605
  pythonLauncher: context.python?.executable ?? null,
2574
2606
  pythonVersion: context.pythonVersion,
2575
2607
  },
@@ -2594,6 +2626,9 @@ async function upgradeCommand(args) {
2594
2626
  console.log(` runtime_root ${context.runtimeRoot}`);
2595
2627
  console.log(` repo_checkout ${context.repoCheckout ? paint('yes', 'green') : paint('no', 'gray')}${context.repoDirty ? paint(' (dirty)', 'yellow') : ''}`);
2596
2628
  console.log(` npm_global ${context.globalNpmInstall ? paint('yes', 'green') : paint('no', 'gray')}${context.globalNpmVersion ? ` (${context.globalNpmVersion})` : ''}`);
2629
+ if (context.runningFromGlobalNpmInstall) {
2630
+ console.log(` npm_global_mode ${paint('self-update requires detached handoff on Windows', 'yellow')}`);
2631
+ }
2597
2632
  console.log(` python ${context.python?.executable ?? paint('not found', 'yellow')}${context.pythonVersion ? ` (${context.pythonVersion})` : ''}`);
2598
2633
  console.log('');
2599
2634
  if (selectedTargets.length > 0) {
@@ -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.8',
147
+ version: '0.2.9',
148
148
  });
149
149
  server.registerTool('iranti_handshake', {
150
150
  description: `Initialize or refresh an agent's working-memory brief for the current task.
@@ -15,7 +15,7 @@ const STAFF_ENTRIES = [
15
15
  entityId: 'librarian',
16
16
  key: 'operating_rules',
17
17
  valueRaw: {
18
- version: '0.2.8',
18
+ version: '0.2.9',
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.8',
42
+ version: '0.2.9',
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.8',
64
+ version: '0.2.9',
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.8' },
85
+ valueRaw: { version: '0.2.9' },
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.8',
98
+ seedVersion: '0.2.9',
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.8',
111
+ version: '0.2.9',
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.8',
159
+ version: '0.2.9',
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.8',
190
+ version: '0.2.9',
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.8',
204
+ version: '0.2.9',
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.8',
240
+ version: '0.2.9',
241
241
  events: [
242
242
  {
243
243
  at: new Date().toISOString(),
@@ -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.8',
72
+ version: '0.2.9',
73
73
  provider: process.env.LLM_PROVIDER ?? 'mock',
74
74
  });
75
75
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iranti",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "Memory infrastructure for multi-agent AI systems",
5
5
  "main": "dist/src/sdk/index.js",
6
6
  "files": [