instar 1.3.1653 → 1.3.1655
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/dashboard/console/allowed.js +1 -1
- package/dashboard/console/services-model.js +3 -0
- package/dashboard-pair/service-yes.html +17 -0
- package/dashboard-pair/service-yes.js +109 -0
- package/dist/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +13 -0
- package/dist/commands/server.js.map +1 -1
- package/dist/core/PinAttemptStore.d.ts +3 -0
- package/dist/core/PinAttemptStore.d.ts.map +1 -1
- package/dist/core/PinAttemptStore.js +3 -0
- package/dist/core/PinAttemptStore.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts +6 -0
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +25 -0
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/rebalanceProof.d.ts +22 -0
- package/dist/core/rebalanceProof.d.ts.map +1 -1
- package/dist/core/rebalanceProof.js +44 -5
- package/dist/core/rebalanceProof.js.map +1 -1
- package/dist/data/standards-guard-index.json +1 -1
- package/dist/data/standards-guard-index.meta.json +2 -2
- package/dist/data/standards-registry.meta.json +1 -1
- package/dist/native/InstarWedgeCanary.app/Contents/MacOS/InstarWedgeCanary +0 -0
- package/dist/native/instar-desktop-host +0 -0
- package/dist/recommended/RecommendedServicesLedger.d.ts +18 -0
- package/dist/recommended/RecommendedServicesLedger.d.ts.map +1 -1
- package/dist/recommended/RecommendedServicesLedger.js +39 -2
- package/dist/recommended/RecommendedServicesLedger.js.map +1 -1
- package/dist/recommended/catalog.d.ts +2 -10
- package/dist/recommended/catalog.d.ts.map +1 -1
- package/dist/recommended/catalog.js +6 -0
- package/dist/recommended/catalog.js.map +1 -1
- package/dist/recommended/confirmTokens.d.ts +43 -0
- package/dist/recommended/confirmTokens.d.ts.map +1 -0
- package/dist/recommended/confirmTokens.js +94 -0
- package/dist/recommended/confirmTokens.js.map +1 -0
- package/dist/server/AgentServer.d.ts.map +1 -1
- package/dist/server/AgentServer.js +3 -2
- package/dist/server/AgentServer.js.map +1 -1
- package/dist/server/CapabilityIndex.d.ts.map +1 -1
- package/dist/server/CapabilityIndex.js +12 -2
- package/dist/server/CapabilityIndex.js.map +1 -1
- package/dist/server/dashboardEntry.d.ts.map +1 -1
- package/dist/server/dashboardEntry.js +3 -0
- package/dist/server/dashboardEntry.js.map +1 -1
- package/dist/server/middleware.d.ts.map +1 -1
- package/dist/server/middleware.js +7 -0
- package/dist/server/middleware.js.map +1 -1
- package/dist/server/mobilePairingRoutes.d.ts.map +1 -1
- package/dist/server/mobilePairingRoutes.js +5 -0
- package/dist/server/mobilePairingRoutes.js.map +1 -1
- package/dist/server/mobilePlansPeopleRoutes.d.ts +182 -0
- package/dist/server/mobilePlansPeopleRoutes.d.ts.map +1 -0
- package/dist/server/mobilePlansPeopleRoutes.js +657 -0
- package/dist/server/mobilePlansPeopleRoutes.js.map +1 -0
- package/dist/server/recommendedServiceRoutes.d.ts +14 -1
- package/dist/server/recommendedServiceRoutes.d.ts.map +1 -1
- package/dist/server/recommendedServiceRoutes.js +168 -3
- package/dist/server/recommendedServiceRoutes.js.map +1 -1
- package/dist/server/routes.d.ts +4 -0
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +174 -17
- package/dist/server/routes.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +64 -64
- package/src/data/standards-guard-index.json +1 -1
- package/src/data/standards-guard-index.meta.json +2 -2
- package/src/data/standards-registry.meta.json +1 -1
- package/src/data/state-coherence-registry.json +15 -0
- package/upgrades/1.3.1654.md +30 -0
- package/upgrades/1.3.1655.md +28 -0
- package/upgrades/side-effects/mobile-native-plans-people.md +104 -0
- package/upgrades/side-effects/rebalance-proof-via-holder.md +48 -0
- package/upgrades/side-effects/recommended-services-no.md +66 -0
- package/upgrades/side-effects/recommended-services-yes.md +78 -0
|
@@ -183,7 +183,7 @@ function suggestionsBlock(sg, post, refresh) {
|
|
|
183
183
|
// ── Outside services ──────────────────────────────────────────────────────
|
|
184
184
|
function servicesBlock(services) {
|
|
185
185
|
if (!services.ok) return el('section', { class: 'list-section', id: 'sec-services' }, el('div', { class: 'list-head' }, el('h2', { class: 'eyebrow', text: 'Outside services' })), cantTell(services.reason));
|
|
186
|
-
const wrap = section({ id: 'services', title: 'Outside services', rows: services.rows, onRow: (r) => sheet({ title: r.main }, story(r.lines)) });
|
|
186
|
+
const wrap = section({ id: 'services', title: 'Outside services', rows: services.rows, onRow: (r) => sheet({ title: r.main }, story(r.lines), r.action ? el('a', { class: 'btn-primary btn-inline', href: r.action.href, text: r.action.label }) : null) });
|
|
187
187
|
if (services.note) wrap.querySelector('.list-head').after(note(services.note));
|
|
188
188
|
return wrap;
|
|
189
189
|
}
|
|
@@ -30,6 +30,9 @@ export function buildServices(res) {
|
|
|
30
30
|
main: s.name || s.service,
|
|
31
31
|
sub: s.benefit || '',
|
|
32
32
|
end: choiceWord(s),
|
|
33
|
+
// The same page takes a yes or a no. A yes on another machine, or one a later no cancelled, leaves
|
|
34
|
+
// this machine still needing its own, so the choice alone doesn't decide this.
|
|
35
|
+
action: s.available ? { href: `/dashboard/service-yes?service=${encodeURIComponent(s.service)}`, label: s.grantedHere ? 'Change my answer' : 'Yes or no' } : null,
|
|
33
36
|
lines: [
|
|
34
37
|
{ label: 'What you get', text: s.benefit },
|
|
35
38
|
{ label: 'What leaves this machine', text: s.dataLeaves },
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
6
|
+
<meta name="color-scheme" content="dark light">
|
|
7
|
+
<meta name="referrer" content="no-referrer">
|
|
8
|
+
<title>Set up a service</title>
|
|
9
|
+
<link rel="icon" href="/dashboard/favicon.png">
|
|
10
|
+
<link rel="stylesheet" href="/dashboard/pair.css">
|
|
11
|
+
<script type="module" src="/dashboard/service-yes.js"></script>
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
<div id="pair-root"></div>
|
|
15
|
+
<noscript>This page needs JavaScript. Your agent can do this another way: tell it in chat.</noscript>
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// A recommended service's confirm page (docs/specs/recommended-services.md, Yes). The person reads
|
|
2
|
+
// what the service involves and confirms with their PIN. Nothing is stored in the browser.
|
|
3
|
+
|
|
4
|
+
const root = document.getElementById('pair-root');
|
|
5
|
+
const service = new URLSearchParams(location.search).get('service') || '';
|
|
6
|
+
|
|
7
|
+
const REFUSED = {
|
|
8
|
+
'unknown-service': 'I don’t know that service.',
|
|
9
|
+
'not-available': 'I can’t set this up yet, because I haven’t proven its setup works. Nothing changed.',
|
|
10
|
+
'no-owner': 'I can’t tell who the owner of this agent is yet, so I can’t take a yes here. Nothing changed. Send me a message first, then open this page again.',
|
|
11
|
+
'token-refused': 'This page has expired or was already used. Nothing changed. Open it again to confirm.',
|
|
12
|
+
'text-changed': 'What this service involves has changed since this page opened. Nothing changed. Open it again to read the new version.',
|
|
13
|
+
'no-since-open': 'You said no to this after this page opened, so I haven’t changed anything. Open it again if you’ve changed your mind.',
|
|
14
|
+
'insecure-connection': 'This connection isn’t secure enough to take your PIN. Nothing changed. Open this page through your agent’s secure address.',
|
|
15
|
+
'wrong-owner': 'The owner of this agent changed since this page opened. Nothing changed. Open it again.',
|
|
16
|
+
'wrong-machine': 'This page belongs to a different machine. Nothing changed. Open it again.',
|
|
17
|
+
'too-many-pages': 'This page has been opened too many times in a short while. Nothing changed. Wait a minute, then open it again.',
|
|
18
|
+
'recommended-services-unavailable': 'I can’t save a choice on this machine right now. Nothing changed.',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const REASONS = [['none', 'No particular reason'], ['cost', 'The cost'], ['privacy', 'Privacy'], ['not-needed', 'I don’t need it'], ['have-another', 'I use something else'], ['other', 'Something else']];
|
|
22
|
+
|
|
23
|
+
function el(tag, attrs = {}, ...kids) {
|
|
24
|
+
const n = document.createElement(tag);
|
|
25
|
+
for (const [k, v] of Object.entries(attrs)) {
|
|
26
|
+
if (k === 'text') n.textContent = v;
|
|
27
|
+
else if (k === 'class') n.className = v;
|
|
28
|
+
else if (k === 'onsubmit') n.addEventListener('submit', v);
|
|
29
|
+
else n.setAttribute(k, v);
|
|
30
|
+
}
|
|
31
|
+
n.append(...kids.filter(Boolean));
|
|
32
|
+
return n;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function show(...kids) { root.replaceChildren(...kids); }
|
|
36
|
+
function message(title, text) { show(el('div', { class: 'pair-head' }, el('h1', { text: title })), el('p', { text })); }
|
|
37
|
+
function line(label, text) { return text ? el('section', {}, el('h2', { text: label }), el('p', { text })) : null; }
|
|
38
|
+
|
|
39
|
+
function page(d) {
|
|
40
|
+
const error = el('p', { class: 'pair-error', role: 'alert' });
|
|
41
|
+
const pin = el('input', { type: 'password', inputmode: 'numeric', autocomplete: 'off', 'aria-label': 'Your PIN', placeholder: 'Your PIN' });
|
|
42
|
+
const button = el('button', { class: 'pair-button', type: 'button', text: `Yes, set up ${d.name}` });
|
|
43
|
+
const reason = el('select', { 'aria-label': 'Why not? This is optional.' },
|
|
44
|
+
...REASONS.map(([value, text]) => el('option', { value, text })));
|
|
45
|
+
const noButton = el('button', { class: 'pair-link-button', type: 'button', text: `No, don’t set up ${d.name}` });
|
|
46
|
+
const send = async (answer) => {
|
|
47
|
+
error.textContent = '';
|
|
48
|
+
button.disabled = true;
|
|
49
|
+
noButton.disabled = true;
|
|
50
|
+
try {
|
|
51
|
+
const r = await fetch(`/recommended-services/${encodeURIComponent(service)}/confirm`, {
|
|
52
|
+
method: 'POST', cache: 'no-store',
|
|
53
|
+
headers: { 'Content-Type': 'application/json', 'X-Instar-Request': '1' },
|
|
54
|
+
body: JSON.stringify({ token: d.token, pin: pin.value, answer, reason: answer === 'no' ? reason.value : 'none' }),
|
|
55
|
+
});
|
|
56
|
+
const body = await r.json().catch(() => ({}));
|
|
57
|
+
if (r.ok && answer === 'no') {
|
|
58
|
+
message('Got it', `I won’t set up ${d.name} or bring it up again, unless a real problem comes up that it would help with, something changes that matters to you, or a long time has passed and there’s good reason to think you’d answer differently. If it’s already running, it stays on until you ask me to stop it.`);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (r.ok) {
|
|
62
|
+
message('Thank you', `I’ll set up ${d.name} from here and tell you when it’s working. I’ll only come back to you for a decision or a credential.`);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if ((r.status === 403 && body.error !== 'insecure-connection') || r.status === 429) {
|
|
66
|
+
error.textContent = r.status === 429 ? 'Too many tries. Wait a while, then try again.' : 'That PIN didn’t work. Try again.';
|
|
67
|
+
pin.value = '';
|
|
68
|
+
pin.focus();
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
message('That didn’t go through', REFUSED[body.error] || 'Something went wrong on my side. Nothing changed.');
|
|
72
|
+
} catch {
|
|
73
|
+
error.textContent = 'I couldn’t reach your agent. Nothing changed. Try again.';
|
|
74
|
+
} finally {
|
|
75
|
+
button.disabled = false;
|
|
76
|
+
noButton.disabled = false;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
noButton.addEventListener('click', () => send('no'));
|
|
80
|
+
button.addEventListener('click', () => send('yes'));
|
|
81
|
+
// Enter does nothing: someone typing their PIN to say no must never record a yes by pressing Go.
|
|
82
|
+
const form = el('form', { class: 'pair-pin', onsubmit: (e) => e.preventDefault() }, pin, error, button);
|
|
83
|
+
show(
|
|
84
|
+
el('div', { class: 'pair-head' }, el('h1', { text: `Set up ${d.name}?` })),
|
|
85
|
+
line('What you get', d.benefit),
|
|
86
|
+
line('What leaves this machine', d.dataLeaves),
|
|
87
|
+
line('Cost', d.cost),
|
|
88
|
+
line('Account', d.account),
|
|
89
|
+
el('section', {}, el('h2', { text: 'Whose accounts' }), el('p', { text: 'I can fully manage your own accounts, use accounts of my own, or both. That’s your choice, and you can tell me in chat.' })),
|
|
90
|
+
line('If you say no', d.backup || 'There’s no backup yet.'),
|
|
91
|
+
el('section', {}, el('h2', { text: 'After you say yes' }), el('p', { text: 'Setup is my job. I’ll only ask you for a decision, such as a payment, or a credential.' })),
|
|
92
|
+
form,
|
|
93
|
+
el('section', {}, el('h2', { text: 'Or say no' }), el('p', { class: 'pair-hint', text: 'Type your PIN above first. The reason is optional. Saying no stops me setting this up or offering it. If it’s already running, it stays on until you ask me to stop it.' }), reason, noButton),
|
|
94
|
+
el('p', { class: 'pair-hint', text: 'If you’re not sure yet, just close this page. Nothing changes.' }),
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
async function start() {
|
|
99
|
+
try {
|
|
100
|
+
const r = await fetch(`/recommended-services/${encodeURIComponent(service)}/confirm`, { cache: 'no-store' });
|
|
101
|
+
const d = await r.json().catch(() => ({}));
|
|
102
|
+
if (r.ok && d.token) { page(d); return; }
|
|
103
|
+
message('This can’t be set up right now', REFUSED[d.error] || 'Something went wrong on my side. Nothing changed.');
|
|
104
|
+
} catch {
|
|
105
|
+
message('This can’t be set up right now', 'I couldn’t reach your agent. Nothing changed.');
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
start();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAkIA,OAAO,EAAE,cAAc,EAAwD,MAAM,2BAA2B,CAAC;AAgBjH,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AA6BjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AA8J7D,OAAO,KAAK,EAAW,oBAAoB,EAAE,WAAW,E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AM;IAC3B,YAAY,EAAE,OAAO,kBAAkB,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACrE,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IAC3C,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,GACP,IAAI,CA85BN;AAwsBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAgp3BtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuDzE;AA+BD,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAkE5E"}
|
package/dist/commands/server.js
CHANGED
|
@@ -24787,6 +24787,19 @@ export async function startServer(options) {
|
|
|
24787
24787
|
return false;
|
|
24788
24788
|
},
|
|
24789
24789
|
move: (t, to) => planner.proofMove(String(t), to),
|
|
24790
|
+
probeViaHolder: async (t, nonce) => {
|
|
24791
|
+
const holderUrl = _resolveRouterUrl?.() ?? null;
|
|
24792
|
+
if (!holderUrl)
|
|
24793
|
+
return null;
|
|
24794
|
+
const r = await fetch(`${holderUrl}/session-pool/rebalance-proof/probe`, {
|
|
24795
|
+
method: 'POST',
|
|
24796
|
+
headers: { Authorization: `Bearer ${config.authToken}`, 'Content-Type': 'application/json', 'X-Instar-AgentId': config.projectName },
|
|
24797
|
+
body: JSON.stringify({ topic: t, nonce }),
|
|
24798
|
+
signal: AbortSignal.timeout(30_000),
|
|
24799
|
+
});
|
|
24800
|
+
const j = await r.json().catch(() => ({})); // @silent-fallback-ok: a body we cannot read is reported as the status below
|
|
24801
|
+
return { action: j.action ?? j.refused ?? `holder-status-${r.status}`, holder: j.holder ?? null };
|
|
24802
|
+
},
|
|
24790
24803
|
sendProbe: async (t, text, messageId) => {
|
|
24791
24804
|
if (!_sessionRouter)
|
|
24792
24805
|
return 'no-router';
|