instar 1.3.1343 → 1.3.1345

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.
Files changed (156) hide show
  1. package/dashboard/index.html +50 -0
  2. package/dashboard/pairing.js +179 -0
  3. package/dist/cli.js +23 -0
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/identity.d.ts +129 -0
  6. package/dist/commands/identity.d.ts.map +1 -0
  7. package/dist/commands/identity.js +411 -0
  8. package/dist/commands/identity.js.map +1 -0
  9. package/dist/commands/machine.d.ts.map +1 -1
  10. package/dist/commands/machine.js +3 -1
  11. package/dist/commands/machine.js.map +1 -1
  12. package/dist/commands/server.d.ts.map +1 -1
  13. package/dist/commands/server.js +215 -1
  14. package/dist/commands/server.js.map +1 -1
  15. package/dist/config/ConfigDefaults.d.ts.map +1 -1
  16. package/dist/config/ConfigDefaults.js +8 -0
  17. package/dist/config/ConfigDefaults.js.map +1 -1
  18. package/dist/core/AgentIdentityAdoption.d.ts +422 -0
  19. package/dist/core/AgentIdentityAdoption.d.ts.map +1 -0
  20. package/dist/core/AgentIdentityAdoption.js +866 -0
  21. package/dist/core/AgentIdentityAdoption.js.map +1 -0
  22. package/dist/core/AgentIdentityAudit.d.ts +41 -0
  23. package/dist/core/AgentIdentityAudit.d.ts.map +1 -0
  24. package/dist/core/AgentIdentityAudit.js +97 -0
  25. package/dist/core/AgentIdentityAudit.js.map +1 -0
  26. package/dist/core/AgentIdentityCoherence.d.ts +220 -0
  27. package/dist/core/AgentIdentityCoherence.d.ts.map +1 -0
  28. package/dist/core/AgentIdentityCoherence.js +465 -0
  29. package/dist/core/AgentIdentityCoherence.js.map +1 -0
  30. package/dist/core/AgentIdentityHandover.d.ts +21 -2
  31. package/dist/core/AgentIdentityHandover.d.ts.map +1 -1
  32. package/dist/core/AgentIdentityHandover.js +56 -4
  33. package/dist/core/AgentIdentityHandover.js.map +1 -1
  34. package/dist/core/AgentIdentityItems.d.ts +73 -0
  35. package/dist/core/AgentIdentityItems.d.ts.map +1 -0
  36. package/dist/core/AgentIdentityItems.js +89 -0
  37. package/dist/core/AgentIdentityItems.js.map +1 -0
  38. package/dist/core/AgentIdentityLock.d.ts +69 -0
  39. package/dist/core/AgentIdentityLock.d.ts.map +1 -0
  40. package/dist/core/AgentIdentityLock.js +199 -0
  41. package/dist/core/AgentIdentityLock.js.map +1 -0
  42. package/dist/core/AgentIdentityRuntime.d.ts +81 -0
  43. package/dist/core/AgentIdentityRuntime.d.ts.map +1 -0
  44. package/dist/core/AgentIdentityRuntime.js +35 -0
  45. package/dist/core/AgentIdentityRuntime.js.map +1 -0
  46. package/dist/core/LeaseCoordinator.d.ts +11 -2
  47. package/dist/core/LeaseCoordinator.d.ts.map +1 -1
  48. package/dist/core/LeaseCoordinator.js +24 -6
  49. package/dist/core/LeaseCoordinator.js.map +1 -1
  50. package/dist/core/MeshRpc.d.ts +9 -0
  51. package/dist/core/MeshRpc.d.ts.map +1 -1
  52. package/dist/core/MeshRpc.js +9 -0
  53. package/dist/core/MeshRpc.js.map +1 -1
  54. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  55. package/dist/core/PostUpdateMigrator.js +60 -12
  56. package/dist/core/PostUpdateMigrator.js.map +1 -1
  57. package/dist/core/WriteDomainRegistry.d.ts.map +1 -1
  58. package/dist/core/WriteDomainRegistry.js +25 -0
  59. package/dist/core/WriteDomainRegistry.js.map +1 -1
  60. package/dist/core/types.d.ts +12 -0
  61. package/dist/core/types.d.ts.map +1 -1
  62. package/dist/core/types.js.map +1 -1
  63. package/dist/data/standards-guard-index.json +1 -1
  64. package/dist/data/standards-guard-index.meta.json +2 -2
  65. package/dist/data/standards-registry.meta.json +1 -1
  66. package/dist/identity/IdentityKeyFile.d.ts +12 -0
  67. package/dist/identity/IdentityKeyFile.d.ts.map +1 -1
  68. package/dist/identity/IdentityKeyFile.js +22 -0
  69. package/dist/identity/IdentityKeyFile.js.map +1 -1
  70. package/dist/scaffold/templates.d.ts.map +1 -1
  71. package/dist/scaffold/templates.js +10 -2
  72. package/dist/scaffold/templates.js.map +1 -1
  73. package/dist/server/AgentServer.d.ts +9 -0
  74. package/dist/server/AgentServer.d.ts.map +1 -1
  75. package/dist/server/AgentServer.js +122 -113
  76. package/dist/server/AgentServer.js.map +1 -1
  77. package/dist/server/CapabilityIndex.d.ts.map +1 -1
  78. package/dist/server/CapabilityIndex.js +10 -0
  79. package/dist/server/CapabilityIndex.js.map +1 -1
  80. package/dist/server/routes/provenance.d.ts +7 -2
  81. package/dist/server/routes/provenance.d.ts.map +1 -1
  82. package/dist/server/routes/provenance.js +12 -1
  83. package/dist/server/routes/provenance.js.map +1 -1
  84. package/dist/server/routes.d.ts +2 -0
  85. package/dist/server/routes.d.ts.map +1 -1
  86. package/dist/server/routes.js +279 -28
  87. package/dist/server/routes.js.map +1 -1
  88. package/dist/testing/selfActionRegistry.d.ts.map +1 -1
  89. package/dist/testing/selfActionRegistry.js +121 -0
  90. package/dist/testing/selfActionRegistry.js.map +1 -1
  91. package/dist/threadline/AgentTrustManager.d.ts +31 -0
  92. package/dist/threadline/AgentTrustManager.d.ts.map +1 -1
  93. package/dist/threadline/AgentTrustManager.js +68 -0
  94. package/dist/threadline/AgentTrustManager.js.map +1 -1
  95. package/dist/threadline/CredentialShareGate.d.ts +31 -10
  96. package/dist/threadline/CredentialShareGate.d.ts.map +1 -1
  97. package/dist/threadline/CredentialShareGate.js +29 -4
  98. package/dist/threadline/CredentialShareGate.js.map +1 -1
  99. package/dist/threadline/InboundMessageGate.d.ts +7 -0
  100. package/dist/threadline/InboundMessageGate.d.ts.map +1 -1
  101. package/dist/threadline/InboundMessageGate.js +9 -0
  102. package/dist/threadline/InboundMessageGate.js.map +1 -1
  103. package/dist/threadline/PairVerifyReceipt.d.ts +14 -2
  104. package/dist/threadline/PairVerifyReceipt.d.ts.map +1 -1
  105. package/dist/threadline/PairVerifyReceipt.js +49 -10
  106. package/dist/threadline/PairVerifyReceipt.js.map +1 -1
  107. package/dist/threadline/ThreadlineBootstrap.d.ts +24 -0
  108. package/dist/threadline/ThreadlineBootstrap.d.ts.map +1 -1
  109. package/dist/threadline/ThreadlineBootstrap.js +189 -61
  110. package/dist/threadline/ThreadlineBootstrap.js.map +1 -1
  111. package/dist/threadline/ThreadlineCrypto.d.ts +15 -0
  112. package/dist/threadline/ThreadlineCrypto.d.ts.map +1 -1
  113. package/dist/threadline/ThreadlineCrypto.js +105 -0
  114. package/dist/threadline/ThreadlineCrypto.js.map +1 -1
  115. package/dist/threadline/ThreadlineEndpoints.d.ts +16 -2
  116. package/dist/threadline/ThreadlineEndpoints.d.ts.map +1 -1
  117. package/dist/threadline/ThreadlineEndpoints.js +21 -2
  118. package/dist/threadline/ThreadlineEndpoints.js.map +1 -1
  119. package/dist/threadline/ThreadlineMCPServer.d.ts +17 -0
  120. package/dist/threadline/ThreadlineMCPServer.d.ts.map +1 -1
  121. package/dist/threadline/ThreadlineMCPServer.js +25 -6
  122. package/dist/threadline/ThreadlineMCPServer.js.map +1 -1
  123. package/dist/threadline/UnifiedTrustWiring.d.ts.map +1 -1
  124. package/dist/threadline/UnifiedTrustWiring.js +13 -0
  125. package/dist/threadline/UnifiedTrustWiring.js.map +1 -1
  126. package/dist/threadline/client/IdentityManager.d.ts +45 -3
  127. package/dist/threadline/client/IdentityManager.d.ts.map +1 -1
  128. package/dist/threadline/client/IdentityManager.js +130 -18
  129. package/dist/threadline/client/IdentityManager.js.map +1 -1
  130. package/dist/threadline/client/JoinedMeshDetector.d.ts +41 -20
  131. package/dist/threadline/client/JoinedMeshDetector.d.ts.map +1 -1
  132. package/dist/threadline/client/JoinedMeshDetector.js +83 -38
  133. package/dist/threadline/client/JoinedMeshDetector.js.map +1 -1
  134. package/dist/threadline/client/ThreadlineClient.d.ts +77 -0
  135. package/dist/threadline/client/ThreadlineClient.d.ts.map +1 -1
  136. package/dist/threadline/client/ThreadlineClient.js +214 -4
  137. package/dist/threadline/client/ThreadlineClient.js.map +1 -1
  138. package/dist/threadline/listener-daemon.d.ts.map +1 -1
  139. package/dist/threadline/listener-daemon.js +12 -7
  140. package/dist/threadline/listener-daemon.js.map +1 -1
  141. package/dist/threadline/mcp-http-client.d.ts +11 -0
  142. package/dist/threadline/mcp-http-client.d.ts.map +1 -1
  143. package/dist/threadline/mcp-http-client.js +29 -0
  144. package/dist/threadline/mcp-http-client.js.map +1 -1
  145. package/dist/threadline/mcp-stdio-entry.js +5 -1
  146. package/dist/threadline/mcp-stdio-entry.js.map +1 -1
  147. package/package.json +1 -1
  148. package/src/data/builtin-manifest.json +96 -96
  149. package/src/data/standards-guard-index.json +1 -1
  150. package/src/data/standards-guard-index.meta.json +2 -2
  151. package/src/data/standards-registry.meta.json +1 -1
  152. package/src/scaffold/templates.ts +10 -2
  153. package/upgrades/1.3.1344.md +29 -0
  154. package/upgrades/1.3.1345.md +38 -0
  155. package/upgrades/side-effects/a2a-single-agent-identity-part-a.md +187 -0
  156. package/upgrades/side-effects/threadline-verified-pairing-v2.md +141 -0
@@ -1042,6 +1042,24 @@
1042
1042
  .mnd-reason-cell { color: var(--text-dim); }
1043
1043
  .mnd-audit-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
1044
1044
  .mnd-dim { font-size: 13px; color: var(--text-dim); }
1045
+ .pair-card { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-top: 10px; }
1046
+ .pair-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
1047
+ .pair-state { font-size: 13px; color: var(--text-dim); }
1048
+ .pair-state-verification-failed { color: #f85149; }
1049
+ .pair-state-mutual-verified, .pair-state-identity-verified { color: #3fb950; }
1050
+ .pair-step { margin-top: 10px; }
1051
+ .pair-step-title { font-size: 13px; margin-bottom: 6px; }
1052
+ .pair-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
1053
+ .pair-own-words { columns: 3; font-family: ui-monospace, monospace; font-size: 15px; margin: 6px 0; }
1054
+ .pair-words { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
1055
+ .pair-word { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-dim); }
1056
+ .pair-word input { flex: 1; min-width: 0; padding: 6px; font-family: ui-monospace, monospace; font-size: 15px; }
1057
+ .pair-meta { font-size: 11px; color: var(--text-dim); margin-top: 8px; }
1058
+ @media (max-width: 640px) {
1059
+ .pair-own-words { columns: 2; }
1060
+ .pair-words { grid-template-columns: repeat(2, minmax(0, 1fr)); }
1061
+ .pair-row .mnd-pin, .pair-row .mnd-btn { flex: 1 1 100%; width: 100%; }
1062
+ }
1045
1063
  /* Mobile-first (item 5): at phone width the 5-column audit table stacks into
1046
1064
  labelled rows so the reason — the useful column — is never truncated. */
1047
1065
  @media (max-width: 640px) {
@@ -4208,6 +4226,17 @@
4208
4226
  <div id="tlBridgeError" style="color:var(--err, #c44);font-size:12px;display:none"></div>
4209
4227
  </div>
4210
4228
 
4229
+ <!-- Verified pairing — the 12-word check (docs/specs/secure-a2a-verified-pairing.md §3.6) -->
4230
+ <div id="pairCard" class="mnd-card" style="border:1px solid var(--border);border-radius:8px;padding:16px">
4231
+ <div style="display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap">
4232
+ <strong>Verified pairing</strong>
4233
+ <button onclick="startPairingPanel()" class="mnd-btn mnd-btn-quiet" style="padding:6px 12px">Refresh</button>
4234
+ </div>
4235
+ <div class="mnd-hint">Confirm another agent is really who it says it is: compare 12 words with its operator before it can be sent credentials.</div>
4236
+ <div id="pairNotice" class="mnd-notice"></div>
4237
+ <div id="pairList"></div>
4238
+ </div>
4239
+
4211
4240
  <!-- Conversation observability — threads list + message stream + search -->
4212
4241
  <div style="border:1px solid var(--border);border-radius:8px;padding:0;display:flex;flex-direction:column;min-height:480px">
4213
4242
  <!-- Toolbar -->
@@ -5990,6 +6019,7 @@
5990
6019
  onActivate: () => {
5991
6020
  if (typeof loadThreadlineBridgeConfig === 'function') loadThreadlineBridgeConfig();
5992
6021
  if (typeof tlObsLoadThreads === 'function') tlObsLoadThreads();
6022
+ if (typeof startPairingPanel === 'function') startPairingPanel();
5993
6023
  },
5994
6024
  },
5995
6025
  {
@@ -10413,6 +10443,26 @@
10413
10443
  } catch { host.innerHTML = '<div style="opacity:.7">Throughput data is temporarily unavailable.</div>'; }
10414
10444
  }
10415
10445
 
10446
+ // ── Verified pairing panel (Threadline tab; secure-a2a-verified-pairing §3.6) ──
10447
+ // Lazy-loaded like Mandates. The PIN typed here is sent once per action, never stored.
10448
+ let __pairController = null;
10449
+ let __pairModule = null;
10450
+ async function startPairingPanel() {
10451
+ if (!__pairModule) {
10452
+ try { __pairModule = await import('/dashboard/pairing.js'); }
10453
+ catch (e) { console.error('[pairing] module load failed', e); return; }
10454
+ }
10455
+ if (!__pairController) {
10456
+ const els = { list: document.getElementById('pairList'), notice: document.getElementById('pairNotice') };
10457
+ const fetchImpl = (url, opts = {}) => fetch(url, {
10458
+ ...opts,
10459
+ headers: { 'Authorization': `Bearer ${token}`, ...(opts.headers || {}) },
10460
+ });
10461
+ __pairController = __pairModule.createController({ doc: document, els, fetchImpl });
10462
+ }
10463
+ __pairController.start();
10464
+ }
10465
+
10416
10466
  // ── Mandates tab (coordination-mandate spec, decision 2A) ──
10417
10467
  // Same lazy dynamic-import pattern as Process Health. The PIN typed in this
10418
10468
  // tab is sent once per action and never stored anywhere.
@@ -0,0 +1,179 @@
1
+ /**
2
+ * pairing.js — the Verified Pairing panel on the dashboard's Threadline tab
3
+ * (docs/specs/secure-a2a-verified-pairing.md §3.6, Mobile-Complete operator action).
4
+ *
5
+ * The operator's surface for the 12-word check: list pairings; for a pending one,
6
+ * enter the dashboard PIN to see THIS side's 12 words, then type the 12 words the
7
+ * OTHER side shows and confirm (the server compares all 12 in order; any difference
8
+ * is a denial). A denied pairing can be cleared with the PIN. The PIN is typed at
9
+ * action time, sent once, and never stored (no localStorage, no module state).
10
+ *
11
+ * Same shape as mandates.js: pure renderers + createController({ doc, els, fetchImpl }).
12
+ */
13
+
14
+ const REFRESH_MS = 30_000;
15
+ const WORD_COUNT = 12;
16
+
17
+ function esc(s) {
18
+ return String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
19
+ }
20
+
21
+ const STATE_LABEL = {
22
+ 'pending-verification': 'Waiting for you to compare the words',
23
+ 'mutual-verified': 'Verified',
24
+ 'identity-verified': 'Verified on another of my machines',
25
+ 'verification-failed': 'Words did not match — blocked',
26
+ };
27
+
28
+ /** One pairing card. Primary action first; the fingerprint is support metadata. */
29
+ export function renderPairing(p) {
30
+ const fp = esc(p.peerFp);
31
+ const name = esc(p.peerName || 'Unknown agent');
32
+ const state = p.state;
33
+ const label = esc(STATE_LABEL[state] || state || 'Unknown');
34
+ let actions = '';
35
+ if (state === 'pending-verification') {
36
+ const inputs = Array.from({ length: WORD_COUNT }, (_, i) =>
37
+ `<label class="pair-word"><span>${i + 1}</span><input type="text" autocomplete="off" autocapitalize="off" spellcheck="false" data-their-word="${fp}" data-idx="${i}" aria-label="Their word ${i + 1}" /></label>`).join('');
38
+ actions = `
39
+ <div class="pair-step">
40
+ <div class="pair-step-title">1. See the words on this side</div>
41
+ <div class="pair-row"><input type="password" class="mnd-pin" data-show-pin="${fp}" placeholder="Your PIN" autocomplete="off" />
42
+ <button class="mnd-btn mnd-btn-primary" data-show-words="${fp}">Show my words</button></div>
43
+ <ol class="pair-own-words" data-own-words="${fp}"></ol>
44
+ </div>
45
+ <div class="pair-step">
46
+ <div class="pair-step-title">2. Type the 12 words the OTHER agent's operator sees</div>
47
+ <div class="pair-words">${inputs}</div>
48
+ <div class="pair-row"><input type="password" class="mnd-pin" data-confirm-pin="${fp}" placeholder="Your PIN" autocomplete="off" />
49
+ <button class="mnd-btn mnd-btn-primary" data-confirm="${fp}">Confirm they match</button></div>
50
+ <div class="mnd-hint">Compare over a call or in person, not through the agents. Any wrong word blocks this pairing.</div>
51
+ <button class="mnd-btn mnd-btn-quiet mnd-btn-danger" data-deny="${fp}">They don't match</button>
52
+ </div>`;
53
+ } else if (state === 'verification-failed') {
54
+ actions = `
55
+ <div class="pair-step">
56
+ <div class="mnd-hint">Clear this only once you know why the words were different.</div>
57
+ <div class="pair-row"><input type="password" class="mnd-pin" data-clear-pin="${fp}" placeholder="Your PIN" autocomplete="off" />
58
+ <button class="mnd-btn mnd-btn-quiet" data-clear="${fp}">Clear and start again</button></div>
59
+ </div>`;
60
+ }
61
+ return `<div class="pair-card" data-pairing="${fp}">
62
+ <div class="pair-head"><strong>${name}</strong> <span class="pair-state pair-state-${esc(state)}">${label}</span></div>
63
+ ${actions}
64
+ <div class="pair-meta">Agent ${fp.slice(0, 12)}…</div>
65
+ </div>`;
66
+ }
67
+
68
+ export function renderPairings(list) {
69
+ if (!Array.isArray(list) || list.length === 0) {
70
+ return '<div class="mnd-hint">No pairings yet. An agent starts one with <code>threadline_pair</code> start.</div>';
71
+ }
72
+ return list.map(renderPairing).join('');
73
+ }
74
+
75
+ /** Words typed into the 12 inputs for one pairing, in order. */
76
+ export function collectTypedWords(root, fp) {
77
+ const inputs = Array.from(root.querySelectorAll(`[data-their-word="${fp}"]`));
78
+ inputs.sort((a, b) => Number(a.dataset.idx) - Number(b.dataset.idx));
79
+ return inputs.map((i) => String(i.value || '').trim().toLowerCase());
80
+ }
81
+
82
+ export function createController({ doc, els, fetchImpl }) {
83
+ let timer = null;
84
+
85
+ async function fetchJson(url, opts) {
86
+ const res = await fetchImpl(url, opts);
87
+ let body = null;
88
+ try { body = await res.json(); } catch { body = null; }
89
+ return { status: res.status, body };
90
+ }
91
+
92
+ function note(msg, kind) {
93
+ if (!els.notice) return;
94
+ els.notice.textContent = msg;
95
+ els.notice.className = kind === 'error' ? 'mnd-notice mnd-notice-err' : kind === 'success' ? 'mnd-notice mnd-notice-ok' : 'mnd-notice';
96
+ }
97
+
98
+ // A timed refresh must not wipe words or a PIN the operator is typing.
99
+ function operatorIsTyping() {
100
+ const inputs = els.list ? Array.from(els.list.querySelectorAll('input')) : [];
101
+ return inputs.some((i) => i.value);
102
+ }
103
+
104
+ async function load(opts = {}) {
105
+ if (opts.timed && operatorIsTyping()) return;
106
+ try {
107
+ const { status, body } = await fetchJson('/threadline/pairing');
108
+ if (status === 503) { els.list.innerHTML = '<div class="mnd-hint">Verified pairing is turned off on this agent.</div>'; return; }
109
+ if (status !== 200) { note(`Could not load pairings: ${body?.error ?? `HTTP ${status}`}`, 'error'); return; }
110
+ els.list.innerHTML = renderPairings(body?.pairings ?? []);
111
+ } catch (e) {
112
+ note(`Could not reach the agent: ${e?.message ?? e}`, 'error');
113
+ }
114
+ }
115
+
116
+ async function post(url, payload) {
117
+ return fetchJson(url, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload) });
118
+ }
119
+
120
+ async function onClick(ev) {
121
+ const t = ev.target;
122
+ if (!t || !t.dataset) return;
123
+ const root = els.list;
124
+ const take = (attr, fp) => { const el = root.querySelector(`[${attr}="${fp}"]`); const v = el ? el.value : ''; if (el) el.value = ''; return v; };
125
+ try {
126
+ if (t.dataset.showWords) {
127
+ const fp = t.dataset.showWords;
128
+ const pin = take('data-show-pin', fp);
129
+ if (!pin) { note('Enter your PIN to see the words.', 'error'); return; }
130
+ const res = await fetchImpl(`/threadline/pairing/${fp}`, { headers: { 'X-Dashboard-Pin': pin } });
131
+ const body = await res.json().catch(() => null);
132
+ const words = body?.pairing?.sasWords;
133
+ if (!Array.isArray(words)) { note(res.status === 200 ? 'The PIN was not accepted, or this pairing is no longer waiting.' : `Refused: ${body?.error ?? `HTTP ${res.status}`}`, 'error'); return; }
134
+ const ol = root.querySelector(`[data-own-words="${fp}"]`);
135
+ if (ol) ol.innerHTML = words.map((w) => `<li>${esc(w)}</li>`).join('');
136
+ note('These are the words on this side. Read them to the other operator and type theirs below.', 'info');
137
+ } else if (t.dataset.confirm) {
138
+ const fp = t.dataset.confirm;
139
+ const words = collectTypedWords(root, fp);
140
+ const pin = take('data-confirm-pin', fp);
141
+ if (words.some((w) => !w)) { note(`Type all ${WORD_COUNT} of the other side's words first.`, 'error'); return; }
142
+ if (!pin) { note('Enter your PIN to confirm.', 'error'); return; }
143
+ const { status, body } = await post(`/threadline/pairing/${fp}/verify`, { words, pin });
144
+ if (status !== 200) { note(`Not confirmed — the server refused: ${body?.error ?? `HTTP ${status}`}`, 'error'); return; }
145
+ note(body?.state === 'mutual-verified' ? 'Verified. Every word matched.' : 'The words did not match. This pairing is now blocked.', body?.state === 'mutual-verified' ? 'success' : 'error');
146
+ await load();
147
+ } else if (t.dataset.deny) {
148
+ const fp = t.dataset.deny;
149
+ const pin = take('data-confirm-pin', fp);
150
+ if (!pin) { note('Enter your PIN (in the field above) to record that the words did not match.', 'error'); return; }
151
+ const { status, body } = await post(`/threadline/pairing/${fp}/verify`, { match: false, pin });
152
+ if (status !== 200) { note(`Not recorded — the server refused: ${body?.error ?? `HTTP ${status}`}`, 'error'); return; }
153
+ note('Recorded: the words did not match. This pairing is blocked.', 'success');
154
+ await load();
155
+ } else if (t.dataset.clear) {
156
+ const fp = t.dataset.clear;
157
+ const pin = take('data-clear-pin', fp);
158
+ if (!pin) { note('Enter your PIN to clear this pairing.', 'error'); return; }
159
+ const { status, body } = await post(`/threadline/pairing/${fp}/start`, { clearFailed: true, pin });
160
+ if (status !== 200) { note(`Not cleared — the server refused: ${body?.error ?? `HTTP ${status}`}`, 'error'); return; }
161
+ note('Cleared. Compare the words again.', 'success');
162
+ await load();
163
+ }
164
+ } catch (e) {
165
+ note(`Could not reach the agent: ${e?.message ?? e}`, 'error');
166
+ }
167
+ }
168
+
169
+ return {
170
+ start() {
171
+ if (els.list && !els.list.__pairWired) { els.list.addEventListener('click', onClick); els.list.__pairWired = true; }
172
+ load();
173
+ if (!timer) timer = setInterval(() => load({ timed: true }), REFRESH_MS);
174
+ },
175
+ stop() { if (timer) { clearInterval(timer); timer = null; } },
176
+ load,
177
+ onClick,
178
+ };
179
+ }
package/dist/cli.js CHANGED
@@ -31,6 +31,7 @@ import { addUser, listUsers } from './commands/user.js';
31
31
  import { addJob, listJobs } from './commands/job.js';
32
32
  import { listRelationships, importRelationships, exportRelationships } from './commands/relationship.js';
33
33
  import { listMachines, removeMachine, whoami, startPairing, joinMesh, leaveMesh, wakeup, doctor } from './commands/machine.js';
34
+ import { identityAdopt, identityInit, identityStatus } from './commands/identity.js';
34
35
  import pc from 'picocolors';
35
36
  import { getInstarVersion } from './core/Config.js';
36
37
  import { resolveAgentDir } from './core/Config.js';
@@ -1969,6 +1970,28 @@ machineCmd
1969
1970
  .description('Revoke a machine from the mesh')
1970
1971
  .option('-d, --dir <path>', 'Project directory')
1971
1972
  .action(removeMachine);
1973
+ // ── Agent identity (a2a-single-agent-identity §1.4) ──────────────────
1974
+ const identityCmd = program
1975
+ .command('identity')
1976
+ .description('This machine\'s AGENT identity: adopt it from a sibling, or mint a standalone one');
1977
+ identityCmd
1978
+ .command('status')
1979
+ .description('The on-disk posture + routing fingerprint (never key material)')
1980
+ .option('-d, --dir <path>', 'Project directory')
1981
+ .action(identityStatus);
1982
+ identityCmd
1983
+ .command('adopt')
1984
+ .description('Move this machine\'s existing identity aside and adopt the one a named sibling publishes (run ON the affected machine, after the operator\'s yes)')
1985
+ .requiredOption('--from <machine-name-or-id>', 'The sibling to adopt the identity from')
1986
+ .option('-d, --dir <path>', 'Project directory')
1987
+ .action(identityAdopt);
1988
+ identityCmd
1989
+ .command('init')
1990
+ .description('Mint a NEW agent identity on a fleet with no usable candidate (peers must re-pin)')
1991
+ .option('--standalone', 'Required: this is a standalone recovery mint')
1992
+ .option('--i-understand-peers-must-repin', 'Required: acknowledge every peer must re-pin the new address')
1993
+ .option('-d, --dir <path>', 'Project directory')
1994
+ .action(identityInit);
1972
1995
  program
1973
1996
  .command('whoami')
1974
1997
  .description("Show this machine's identity and role")