chore: prune dead code, retired features and pre-Nod compatibility code (#569)

This commit is contained in:
Albert Alises authored and GitHub committed 2026-10-30 12:16:20 +01:00
1 parent 2ba8c34a7c
commit 2833ef695f
190 files changed
+399 -3434

No files matched your search

-1
View File
@@ -4,4 +4,3 @@ node_modules
.env.*
dist
pnpm-lock.yaml
scripts/fixtures/*.md
+1 -1
View File
@@ -48,7 +48,7 @@ Setup, use and how the system works are in the docs site, whose pages live in `d
- The chat UI adds no model-cost labels or action receipts to messages. Costs and app actions remain in Usage; recurring schedules with finished priced runs show a projected monthly cost based on recent run costs and schedule frequency.
- The notification rule is empty until the owner asks for updates. After the owner approves an action from background work that will come up again, Pi offers once, at the end of its result, to add it to the rule; after one in chat or a task, it offers once to add it to the owner's rules.
- Private preparation reads every connected account by default, with no opt-in, including when `notificationRule` is empty; the rule is optional guidance. Work starts only for a concrete unhandled request, commitment, problem, financial risk or recoverable payment that affects the owner, or work the notification rule asks for. Ideas, backlog entries and routine updates alone start no private plan, task or nudge. Gmail, the primary Google Calendar and saved work have record readers with exact versions and cheap change signals. Every other account, MCP and HTTP connections included, is read through its own read tools: the worker searches them, the arguments must match the tool schema, and the strict read-only check with the owner's rules must pass, or nothing runs. Those accounts are checked every 30 minutes, due sources together in one run, backing off to 4 hours while unchanged; Gmail is polled every 15 minutes; a drained burst of app events starts one check, and a starting check takes sources due within 15 minutes; a due matter is checked once at its time unless that check fails. All sources feed one observer. A batch of changed sources with no due matter is read by the server first: a tool source whose remembered reads return unchanged versions, or changed records the connection's memory model screens as needing nothing (each on its own, never a record of a saved matter), end the batch without the selected model; otherwise the scan checkpoint is restored and the full check runs. A source a batch leaves unread waits for its next change or the 30-minute check. Its turns use `turns.proactive=true`, `read_source`, `proactive_issue`, and read-only personal context. It starts a separate keyed task for an outside action, question, or wait. The task uses normal tools with `proactive=false` and keeps event authority and every normal Trust check. Its generated brief grants no permission. Only a spending check-in can pause the observer with `ask_user`. It never asks the owner about a read and skips the source instead. Before saving, the server re-reads cited records, or for tool reads requires a read from the same turn within two minutes. Matters use a primary record and a hashed stable matter key; resolution holds until the condition changes and dismissal until the condition changes or a new option appears, never for a moved deadline; feedback is not dismissal. A source signal carries the app's event text, up to ten per source, as untrusted data for the next run. Delivery has no message count: the worker offers only work worth an interruption, and the server enforces one nudge per matter (again only on a material evidence change), quiet hours (a high-impact nudge with strong evidence whose deadline comes before they end goes out at once), snooze and `proactivePaused`. A task the observer starts during quiet hours begins when they end: `turns.start_after` holds its first turn. A nudge states the concrete finding and why it needs attention now. It asks a next-step question only when that helps the owner decide and fits their requested format. Every nudge includes a server-derived link to its saved result. The owner-scoped page shows the latest draft, unknowns and sources without a model turn, and refuses removed or replaced source bindings. The owner answers in words: `prepared_list` reads a draft, and `prepared_update` changes one only in a turn started by an owner message. The observer uses the normal session check-in and monthly spending limit. Source signals stay saved while it waits for a spending reply. Explicit account removal deletes source-linked private work in the removal transaction; temporary loss does not. See `docs/src/content/docs/how-it-works/proactivity.md`.
- Onboarding starts workspace preparation when the owner leaves the welcome screen (the desktop app starts its computer and database when the welcome screen opens, and its engine then too only on a profile with no saved keys; otherwise the engine and key unlock wait for **Get started**. While the engine starts, the setup window shows the email step with Connect disabled, and the engine window continues at that step without replaying it), connects email optionally, asks for a model only when none works, then asks about conversation traces and says that usage data, on by default for new owners, is shared. A confirmed email connection starts first-task discovery at once. The first chat opens with a short greeting, then learned and common task cards and a follow-up line saying the owner can ask for more ideas; when apps whose notification senders appeared in the discovery sample aren't connected, the line names up to three of them (sender addresses only, matched to a fixed list in `src/shared/sender-apps.ts`, skipping the owner's own email domain and hidden account-access email; only app slugs are kept, never mail content). The card message text the model sees includes that line. Asking for more ideas is a normal owner message; While useful apps aren't connected, Pi suggests no ideas yet: it sends a short message with an `apps` presentation of up to three unconnected apps, preferring ones that line named, and ends the turn; the chat shows a Connect row for each below the message, using the onboarding connect row, and Connect starts sign-in from the owner's click. When the owner asks again after connecting, Pi reads recent activity in the new apps and suggests ideas from it. No setup interview blocks completion. The retired setup interview has no model endpoint. Existing encrypted interview records stay readable, savable and resettable through their owner-scoped routes. The first stored chat introduction offers notifications without enabling them. Permission and opt-in require the owner to select Enable notifications or change Settings. Existing notification choices are preserved. Operating-system permission controls delivery and does not authorize notification rules or app monitoring. First-chat task cards are prepared without a turn from existing setup answers and small samples from connected tools. Discovery selects up to three schema-validated reads per account (for email, one of them a sender and subject listing of about 50 recent messages), passes every read through the selected model's strict read-only check with the owner's rules, and revalidates the exact account binding before reads and publication. Unknown actions, drafts and writes cannot run. Account-access email and secret fields are removed before observations reach the suggestion model. A temporary brief informs one immediate and two ongoing cards; the brief is not saved to memory. Discovery stops when the owner sends a message, the app closes or its deadline expires. Cards are checked for shape, connected source and distinct titles; one repair is allowed before invalid cards are replaced with fixed ones. Selecting a card sends exactly its visible title as a normal owner message.
- Onboarding starts workspace preparation when the owner leaves the welcome screen (the desktop app starts its computer and database when the welcome screen opens, and its engine then too only on a profile with no saved keys; otherwise the engine and key unlock wait for **Get started**. While the engine starts, the setup window shows the email step with Connect disabled, and the engine window continues at that step without replaying it), connects email optionally, asks for a model only when none works, then asks about conversation traces and says that usage data, on by default for new owners, is shared. A confirmed email connection starts first-task discovery at once. The first chat opens with a short greeting, then learned and common task cards and a follow-up line saying the owner can ask for more ideas; when apps whose notification senders appeared in the discovery sample aren't connected, the line names up to three of them (sender addresses only, matched to a fixed list in `src/shared/sender-apps.ts`, skipping the owner's own email domain and hidden account-access email; only app slugs are kept, never mail content). The card message text the model sees includes that line. Asking for more ideas is a normal owner message; While useful apps aren't connected, Pi suggests no ideas yet: it sends a short message with an `apps` presentation of up to three unconnected apps, preferring ones that line named, and ends the turn; the chat shows a Connect row for each below the message, using the onboarding connect row, and Connect starts sign-in from the owner's click. When the owner asks again after connecting, Pi reads recent activity in the new apps and suggests ideas from it. No setup interview blocks completion. The first stored chat introduction offers notifications without enabling them. Permission and opt-in require the owner to select Enable notifications or change Settings. Existing notification choices are preserved. Operating-system permission controls delivery and does not authorize notification rules or app monitoring. First-chat task cards are prepared without a turn from existing setup answers and small samples from connected tools. Discovery selects up to three schema-validated reads per account (for email, one of them a sender and subject listing of about 50 recent messages), passes every read through the selected model's strict read-only check with the owner's rules, and revalidates the exact account binding before reads and publication. Unknown actions, drafts and writes cannot run. Account-access email and secret fields are removed before observations reach the suggestion model. A temporary brief informs one immediate and two ongoing cards; the brief is not saved to memory. Discovery stops when the owner sends a message, the app closes or its deadline expires. Cards are checked for shape, connected source and distinct titles; one repair is allowed before invalid cards are replaced with fixed ones. Selecting a card sends exactly its visible title as a normal owner message.
## Validation
+1 -1
View File
@@ -89,4 +89,4 @@ Report bugs with the [bug report form](https://github.com/n8n-io/nod/issues/new/
## License
Copyright 2026 n8n GmbH. Nod uses the [Apache License 2.0](LICENSE), and [NOTICE](NOTICE) holds its attribution notice. Bundled third-party assets keep their own terms and are not covered by it: Inter and Geist use the SIL Open Font License ([Inter](public/fonts/Inter-LICENSE.txt), [Geist](public/fonts/Geist-OFL.txt)), provider logos belong to [their owners](desktop/ui/logos/SOURCES.md), and the desktop runtime lists its components and their licenses in `licenses/COMPONENTS.md`.
Copyright 2026 n8n GmbH. Nod uses the [Apache License 2.0](LICENSE), and [NOTICE](NOTICE) holds its attribution notice. Bundled third-party assets keep their own terms and are not covered by it: Geist uses the [SIL Open Font License](public/fonts/Geist-OFL.txt), provider logos belong to [their owners](public/logos/SOURCES.md), and the desktop runtime lists its components and their licenses in `licenses/COMPONENTS.md`.
-20
View File
@@ -1,20 +0,0 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "",
"css": "src/web/styles.css",
"baseColor": "neutral",
"cssVariables": true
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components",
"lib": "@/lib",
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}
+33 -116
View File
@@ -36,13 +36,11 @@ export function checkRequest(input) {
platform: query.platform || 'darwin-arm64',
apiUrl: `${api}?per_page=100`,
};
if (keys === 'tag' && !queryKeys && /^runtime-darwin-(arm64|x64)-[a-f0-9]{64}$/.test(params.tag))
return { operation: 'runtime', tag: params.tag, apiUrl: `${api}/tags/${params.tag}` };
if (
keys === 'tag' &&
!queryKeys &&
((params.tag.startsWith('nod-v') && version.test(params.tag.slice(5))) ||
/^runtime-darwin-(arm64|x64)-[a-f0-9]{64}$/.test(params.tag))
params.tag.startsWith('nod-v') &&
version.test(params.tag.slice(5))
)
return { operation: 'metadata', tag: params.tag, apiUrl: `${api}/tags/${params.tag}` };
if (!id(params.releaseId)) return invalid();
@@ -85,35 +83,30 @@ export function releaseResponse(pages, request, baseUrl) {
tag.length < 140 &&
tag.startsWith('nod-v') &&
versionPattern.test(tag.slice(5));
const runtimeTag = (tag) =>
typeof tag === 'string' && /^runtime-darwin-(arm64|x64)-[a-f0-9]{64}$/.test(tag);
const positive = (value) => Number.isSafeInteger(value) && value > 0;
const allowed = (name, desktop) =>
desktop
? [
'release.json',
'runtime-release.json',
'update.json',
'nod-arm64.dmg',
'nod-arm64.zip',
'nod-x64.dmg',
'nod-x64.zip',
'nod-Setup-x64.exe',
'nod-Runtime-win32-x64.tar.gz',
'release-darwin-x64.json',
'runtime-release-darwin-x64.json',
'update-darwin-x64.json',
'release-win32-x64.json',
'SHA256SUMS-darwin-x64',
'SHA256SUMS-win32-x64',
'SHA256SUMS',
'signing.cer',
'CHANGELOG.md',
].includes(name) ||
/^runtime-darwin-(arm64|x64)-[a-f0-9]{64}\.json$/.test(name) ||
/^nod-Runtime-darwin-(arm64|x64)-[a-f0-9]{12}\.tar\.gz$/.test(name)
: ['runtime-release.json', 'SHA256SUMS', 'signing.cer'].includes(name) ||
/^nod-Runtime-darwin-(arm64|x64)-[a-f0-9]{12}\.tar\.gz$/.test(name);
const allowed = (name) =>
[
'release.json',
'runtime-release.json',
'update.json',
'nod-arm64.dmg',
'nod-arm64.zip',
'nod-x64.dmg',
'nod-x64.zip',
'nod-Setup-x64.exe',
'nod-Runtime-win32-x64.tar.gz',
'release-darwin-x64.json',
'runtime-release-darwin-x64.json',
'update-darwin-x64.json',
'release-win32-x64.json',
'SHA256SUMS-darwin-x64',
'SHA256SUMS-win32-x64',
'SHA256SUMS',
'signing.cer',
'CHANGELOG.md',
].includes(name) ||
/^runtime-darwin-(arm64|x64)-[a-f0-9]{64}\.json$/.test(name) ||
/^nod-Runtime-darwin-(arm64|x64)-[a-f0-9]{12}\.tar\.gz$/.test(name);
const normalize = (release) => {
if (
!release ||
@@ -122,14 +115,13 @@ export function releaseResponse(pages, request, baseUrl) {
!Number.isFinite(Date.parse(release.published_at))
)
return null;
const desktop = desktopTag(release.tag_name);
if (!desktop && !runtimeTag(release.tag_name)) return null;
if (!desktopTag(release.tag_name)) return null;
if (!positive(release.id) || !Array.isArray(release.assets) || release.assets.length > 100)
throw new Error('Invalid release.');
const names = new Set();
const ids = new Set();
const assets = release.assets
.filter((asset) => asset && allowed(asset.name, desktop))
.filter((asset) => asset && allowed(asset.name))
.map((asset) => {
if (
!positive(asset.id) ||
@@ -190,23 +182,13 @@ export function releaseResponse(pages, request, baseUrl) {
};
try {
if (!Array.isArray(pages) || !pages.length || pages.length > 5) return unavailable();
if (request.operation === 'runtime' && !request.alias && pages.length === 1) {
if (pages[0].statusCode === 404)
return {
aliasApiUrl: 'https://api.github.com/repositories/1387586059/releases?per_page=100',
};
if (pages[0].statusCode === 200 && !Array.isArray(pages[0].body)) {
const legacy = normalize(pages[0].body);
return legacy?.tag_name === request.tag ? { status: 200, body: legacy } : missing();
}
}
if (pages.some((page) => page.statusCode !== 200))
return pages.length === 1 &&
pages[0].statusCode === 404 &&
!['list', 'installer', 'runtime'].includes(request.operation)
!['list', 'installer'].includes(request.operation)
? missing()
: unavailable();
if (['list', 'installer', 'runtime'].includes(request.operation)) {
if (['list', 'installer'].includes(request.operation)) {
if (
pages.some((page) => !Array.isArray(page.body) || page.body.length > 100) ||
(pages.length === 5 && pages[4].body.length === 100)
@@ -216,21 +198,6 @@ export function releaseResponse(pages, request, baseUrl) {
.flatMap((page) => page.body)
.map(normalize)
.filter(Boolean);
if (request.operation === 'runtime') {
const platform = request.tag.startsWith('runtime-darwin-x64-')
? 'darwin-x64'
: 'darwin-arm64';
const found =
releases.find(
(entry) =>
desktopTag(entry.tag_name) &&
entry.assets.some((asset) => asset.name === `${request.tag}.json`) &&
entry.assets.some((asset) =>
new RegExp(`^nod-Runtime-${platform}-[a-f0-9]{12}\\.tar\\.gz$`).test(asset.name),
),
) || releases.find((entry) => entry.tag_name === request.tag);
return found ? { status: 200, body: { ...found, tag_name: request.tag } } : missing();
}
if (request.operation === 'list') return { status: 200, body: releases };
const latest = releases
.filter((release) => desktopTag(release.tag_name))
@@ -473,7 +440,7 @@ export function workflowNodes() {
},
paginationCompleteWhen: 'other',
completeExpression:
"={{ !['list','installer','runtime'].includes($('Check desktop request').first().json.operation) || $response.statusCode !== 200 || !Array.isArray($response.body) || $response.body.length < 100 }}",
"={{ !['list','installer'].includes($('Check desktop request').first().json.operation) || $response.statusCode !== 200 || !Array.isArray($response.body) || $response.body.length < 100 }}",
limitPagesFetched: true,
maxRequests: 5,
},
@@ -491,7 +458,7 @@ export function workflowNodes() {
language: 'javaScript',
jsCode: `return [{json:(${releaseResponse.toString()})($input.all().map(item=>item.json),$('Check desktop request').first().json,${JSON.stringify(base)})}];`,
},
output: [{ json: { status: 200, body: [], assetUrl: '', aliasApiUrl: '', metadata: null } }],
output: [{ json: { status: 200, body: [], assetUrl: '', metadata: null } }],
},
{
name: 'Resolve asset redirect',
@@ -581,56 +548,6 @@ export function workflowNodes() {
},
output: [{ json: {} }],
},
{
name: 'Find runtime alias',
type: 'n8n-nodes-base.if',
typeVersion: 2.3,
parameters: condition('={{ !!$json.aliasApiUrl }}'),
output: [{ json: { status: 200, body: {}, assetUrl: '', metadata: null } }],
},
{
name: 'Read runtime aliases',
type: 'n8n-nodes-base.httpRequest',
typeVersion: 4.5,
credentials,
onError: 'continueRegularOutput',
parameters: {
method: 'GET',
url: 'https://api.github.com/repositories/1387586059/releases?per_page=100',
authentication: 'predefinedCredentialType',
nodeCredentialType: 'githubApi',
sendHeaders: true,
headerParameters: headers,
options: {
...options,
pagination: {
pagination: {
paginationMode: 'updateAParameterInEachRequest',
parameters: {
parameters: [{ type: 'qs', name: 'page', value: '={{ $pageCount + 1 }}' }],
},
paginationCompleteWhen: 'other',
completeExpression:
'={{ $response.statusCode !== 200 || !Array.isArray($response.body) || $response.body.length < 100 }}',
limitPagesFetched: true,
maxRequests: 5,
},
},
},
},
output: [{ json: { statusCode: 200, body: [] } }],
},
{
name: 'Build runtime alias response',
type: 'n8n-nodes-base.code',
typeVersion: 2,
parameters: {
mode: 'runOnceForAllItems',
language: 'javaScript',
jsCode: `return [{json:(${releaseResponse.toString()})($input.all().map(item=>item.json),{...$('Check desktop request').first().json,alias:true},${JSON.stringify(base)})}];`,
},
output: [{ json: { status: 200, body: {}, assetUrl: '', metadata: null } }],
},
];
}
@@ -652,6 +569,6 @@ export function workflowCode() {
`const n${index} = ${index < 5 ? 'trigger' : type === 'n8n-nodes-base.if' ? 'ifElse' : 'node'}(${literal({ ...(type === 'n8n-nodes-base.if' ? {} : { type }), version: typeVersion, config, output })});`,
)
.join('\n');
return `import { workflow, node, trigger, ifElse, expr } from '@n8n/workflow-sdk';\n${declarations}\nexport default workflow('nod-desktop-releases','Nod Desktop Releases')\n.add(n0).to(n5).to(n6.onTrue(n7.to(n8).to(n13.onTrue(n14.to(n15).to(n9)).onFalse(n9))).onFalse(n12))\n.add(n9.onTrue(n10.to(n11).to(n12)).onFalse(n12))
.add(n1).to(n5).add(n2).to(n5).add(n3).to(n5).add(n4).to(n5)\n.group('Serve published desktop assets',[n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15],{description:'Validate fixed-repository release and asset identities, then return metadata, an exact update feed, or a temporary asset redirect.'});\n`;
return `import { workflow, node, trigger, ifElse, expr } from '@n8n/workflow-sdk';\n${declarations}\nexport default workflow('nod-desktop-releases','Nod Desktop Releases')\n.add(n0).to(n5).to(n6.onTrue(n7.to(n8).to(n9)).onFalse(n12))\n.add(n9.onTrue(n10.to(n11).to(n12)).onFalse(n12))
.add(n1).to(n5).add(n2).to(n5).add(n3).to(n5).add(n4).to(n5)\n.group('Serve published desktop assets',[n5,n6,n7,n8,n9,n10,n11,n12],{description:'Validate fixed-repository release and asset identities, then return metadata, an exact update feed, or a temporary asset redirect.'});\n`;
}
+12 -47
View File
@@ -36,19 +36,6 @@ const read = (body, input = { params: { releaseId: '42' } }) =>
releaseResponse([{ statusCode: 200, body }], checkRequest(input), base);
test('N8ND-REQUEST and N8ND-TAG: only fixed repository URLs and exact request shapes are accepted', () => {
const tag = `runtime-darwin-arm64-${'b'.repeat(64)}`;
assert.equal(
read(
[
release({
tag_name: tag,
assets: [asset(104, `nod-Runtime-darwin-arm64-${'c'.repeat(12)}.tar.gz`)],
}),
],
{ params: { tag } },
).status,
200,
);
for (const input of [
{ query: { url: 'https://attacker.invalid' } },
{ query: { installer: 'false' } },
@@ -60,6 +47,7 @@ test('N8ND-REQUEST and N8ND-TAG: only fixed repository URLs and exact request sh
{ params: { releaseId: '9007199254740993' } },
{ params: { tag: 'v0.2.0' } },
{ params: { tag: 'nod-v01.2.0' } },
{ params: { tag: `runtime-darwin-arm64-${'b'.repeat(64)}` } },
{
params: { releaseId: '42', assetId: '102' },
query: { version: '0.1.0', platform: 'linux-x64' },
@@ -369,14 +357,20 @@ test('N8ND-CONFIG: actual embedded request pipeline gates credentialed metadata
}
});
test('N8ND-ADAPTER: real updater reads broker routes, a long release list and an older runtime tag', async () => {
test('N8ND-ADAPTER: real updater reads broker routes, a long release list and an earlier release runtime', async () => {
const fingerprint = 'b'.repeat(64);
const archive = {
file: `nod-Runtime-darwin-arm64-${'c'.repeat(12)}.tar.gz`,
bytes: 1234,
sha256: 'a'.repeat(64),
};
const runtime = { platform: 'darwin-arm64', id: 'c'.repeat(64), fingerprint, archive };
const runtime = {
platform: 'darwin-arm64',
id: 'c'.repeat(64),
fingerprint,
archive,
releaseTag: 'nod-v0.1.9',
};
const appRelease = release({
assets: [
asset(101, 'release.json'),
@@ -387,7 +381,7 @@ test('N8ND-ADAPTER: real updater reads broker routes, a long release list and an
});
const runtimeRelease = release({
id: 70,
tag_name: `runtime-darwin-arm64-${fingerprint}`,
tag_name: 'nod-v0.1.9',
assets: [asset(105, archive.file)],
});
const manifest = {
@@ -436,7 +430,7 @@ test('N8ND-ADAPTER: real updater reads broker routes, a long release list and an
const pages =
checked.operation === 'list'
? [list.slice(0, 100), list.slice(100)].map((body) => ({ statusCode: 200, body }))
: [{ statusCode: 200, body: checked.tag ? [runtimeRelease] : appRelease }];
: [{ statusCode: 200, body: checked.tag ? runtimeRelease : appRelease }];
const result = releaseResponse(pages, checked, base);
if (result.assetUrl) {
const redirect = checkRedirect({
@@ -482,7 +476,7 @@ test('N8ND-ADAPTER: real updater reads broker routes, a long release list and an
const candidate = await updater.check();
await updater.dispose();
assert.equal(requests[0], `${base}/releases`);
assert.ok(requests.includes(`${base}/tags/runtime-darwin-arm64-${fingerprint}`));
assert.ok(requests.includes(`${base}/tags/nod-v0.1.9`));
assert.equal(candidate.version, '0.2.0');
assert.equal(
candidate.feedUrl,
@@ -491,32 +485,3 @@ test('N8ND-ADAPTER: real updater reads broker routes, a long release list and an
assert.equal(candidate.downloadUrl, `${base}/releases/70/assets/105/${archive.file}`);
assert.equal(candidate.runtime.id, runtime.id);
});
test('legacy runtime tag lookup stays exact and only a missing release starts alias lookup', () => {
const tag = `runtime-darwin-arm64-${'b'.repeat(64)}`;
const request = checkRequest({ params: { tag } });
assert(request.apiUrl.endsWith(`/tags/${tag}`));
const legacy = release({ tag_name: tag });
assert.equal(
releaseResponse([{ statusCode: 200, body: legacy }], request, base).body.tag_name,
tag,
);
assert.deepEqual(releaseResponse([{ statusCode: 404 }], request, base), {
aliasApiUrl: 'https://api.github.com/repositories/1387586059/releases?per_page=100',
});
assert.equal(releaseResponse([{ statusCode: 403 }], request, base).status, 503);
const node = workflowNodes().find((entry) => entry.name === 'Build runtime alias response');
const migrated = release({
assets: [
asset(110, `${tag}.json`),
asset(111, `nod-Runtime-darwin-arm64-${'c'.repeat(12)}.tar.gz`),
],
});
const result = new Function('$input', '$', node.parameters.jsCode)(
{ all: () => [{ json: { statusCode: 200, body: [migrated] } }] },
() => ({ first: () => ({ json: request }) }),
)[0].json;
assert.equal(result.status, 200);
assert.equal(result.body.tag_name, tag);
assert.equal(result.body.id, migrated.id);
});
-1
View File
@@ -202,7 +202,6 @@ mkdir "$temporary/mount"
hdiutil attach "$temporary/nod.dmg" -mountpoint "$temporary/mount" -readonly -nobrowse -noautoopen -quiet || fail 'The Nod disk image could not be opened.'
mounted=true
candidate="$temporary/mount/Nod.app"
if [ ! -e "$candidate" ]; then candidate="$temporary/mount/nod.app"; fi
check_app "$candidate"
ditto "$candidate" "$temporary/nod.app" || fail 'The Nod app could not be copied.'
check_app "$temporary/nod.app"
+2 -2
View File
@@ -114,7 +114,7 @@ else if(command==='file')print('Mach-O 64-bit executable '+(options.intel&&!opti
else if(command==='plutil'){let value=JSON.parse(readFileSync(args.at(-1),'utf8'));for(const key of args[1].split('.'))value=value?.[key];const type=args[args.indexOf('-expect')+1];if((type==='string'&&typeof value!=='string')||(type==='bool'&&typeof value!=='boolean')||(type==='integer'&&!Number.isInteger(value)))stop();print(value)}
else if(command==='curl'){const url=args.at(-1);if(!url.startsWith(${JSON.stringify(base + '/')}))stop();const input=url===${JSON.stringify(base + '/releases?installer=true')}+(options.intel?'&platform=darwin-x64':'')?'latest.json':url.endsWith(options.intel?'release-darwin-x64.json':'release.json')?'release.json':'disk';copyFileSync(join(root,input),args[args.indexOf('--output')+1]);if(options.targetChanged&&input==='disk'){const path=join(${JSON.stringify(target)},'Contents/Info.plist');const info=JSON.parse(readFileSync(path,'utf8'));info.CFBundleShortVersionString='0.1.1';writeFileSync(path,JSON.stringify(info))}}
else if(command==='codesign'){if(options.badSignature&&args.at(-1).includes('mount/'))stop();const extract=args.find(value=>value.startsWith('--extract-certificates='));if(extract)copyFileSync(join(root,options.earlierCertificate&&args.at(-1).endsWith('/Applications/nod.app')?'earlier-certificate':'certificate'),extract.split('=')[1]+'0')}
else if(command==='hdiutil'){if(args[0]==='attach')cpSync(join(root,'fixture.app'),join(args[args.indexOf('-mountpoint')+1],options.legacyDisk?'nod.app':'Nod.app'),{recursive:true})}
else if(command==='hdiutil'){if(args[0]==='attach')cpSync(join(root,'fixture.app'),join(args[args.indexOf('-mountpoint')+1],'Nod.app'),{recursive:true})}
else if(command==='ditto'){if(options.copyFailure){mkdirSync(args[1],{recursive:true});writeFileSync(join(args[1],'partial'),'partial copy');stop()}cpSync(args[0],args[1],{recursive:true})}
else if(command==='open'){if(existsSync(join(root,'shipit-job'))||existsSync(join(process.env.HOME,'Library/Caches/dev.nod.desktop.ShipIt')))stop();const installed=JSON.parse(readFileSync(join(args[0],'Contents/Resources/app/package.json'),'utf8'));const log=join(root,'launches.json');writeFileSync(log,JSON.stringify([...JSON.parse(readFileSync(log,'utf8')),{args,source:installed.nodBuild.source}]));if(options.launchFailure)stop()}
else if(command==='mv'){if(existsSync(join(root,'shipit-job')))stop();if(options.swapFailure&&args[0].endsWith('/nod.app')&&args[0].includes('/.nod-install.'))stop();renameSync(args[0],args[1])}
@@ -177,7 +177,7 @@ else stop();
test('CLI-INSTALL: hosted script installs verified bytes and preserves the existing profile', async () => {
const embedded = new Function(installNodes()[1].parameters.jsCode)()[0].json.body;
assert.equal(embedded, installer);
for (const options of [{}, { fresh: true }, { legacyInstall: true }, { legacyDisk: true }]) {
for (const options of [{}, { fresh: true }, { legacyInstall: true }]) {
const state = await fixture(options);
try {
const result = state.run();
+2 -17
View File
@@ -107,24 +107,9 @@ export function createSettingsStore(path, encryption, platform = process.platfor
if (current) return current;
let value;
try {
const saved = JSON.parse(await readFile(path, 'utf8'));
value = JSON.parse(await readFile(path, 'utf8'));
const record = (input) => input && typeof input === 'object' && !Array.isArray(input);
if (!record(saved) || !record(saved.secrets)) throw new Error();
const fields = [
'version',
'theme',
...preferenceFields,
'onboardingPreferenceStep',
'welcome',
'serverUrl',
'secrets',
];
value = Object.fromEntries(Object.entries(saved).filter(([field]) => fields.includes(field)));
value.secrets = Object.fromEntries(
Object.entries(saved.secrets).filter(([field]) =>
['vaultKey', 'serverToken'].includes(field),
),
);
if (!record(value) || !record(value.secrets)) throw new Error();
if (
value.version !== 1 ||
!['system', 'light', 'dark'].includes(value.theme) ||
+3 -8
View File
@@ -12,7 +12,7 @@ function versionParts(value) {
return parts;
}
export function compareVersions(left, right) {
function compareVersions(left, right) {
const a = versionParts(left);
const b = versionParts(right);
for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return Math.sign(a[i] - b[i]);
@@ -131,15 +131,10 @@ export function createUpdateSource({
throw new Error('The desktop runtime metadata is incompatible.');
if (
runtime.platform !== platform ||
(runtime.releaseTag !== undefined &&
!/^nod-v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.test(runtime.releaseTag))
!/^nod-v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.test(runtime.releaseTag)
)
throw new Error('The desktop runtime target is incompatible.');
return releaseAssetUrl(
runtime.releaseTag || `runtime-${platform}-${runtime.fingerprint}`,
runtime.archive,
signal,
);
return releaseAssetUrl(runtime.releaseTag, runtime.archive, signal);
};
const newest = async (currentVersion, signal, resolve) => {
versionParts(currentVersion);
+1 -1
View File
@@ -1,5 +1,5 @@
import { spawn } from 'node:child_process';
import { createReadStream, createWriteStream } from 'node:fs';
import { createWriteStream } from 'node:fs';
import { copyFile, mkdir, readFile, rename, rm, stat, writeFile } from 'node:fs/promises';
import { dirname, join, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
+7 -27
View File
@@ -21,7 +21,6 @@ import {
writeFile,
} from 'node:fs/promises';
import { EventEmitter } from 'node:events';
import { readFileSync } from 'node:fs';
import { execFile } from 'node:child_process';
import { createServer } from 'node:net';
import { tmpdir } from 'node:os';
@@ -2477,13 +2476,7 @@ test('native upgrades preserve the existing settings and vault through successfu
theme: 'dark',
});
const environment = await storage.store.environment();
const saved = JSON.parse(await readFile(storage.path, 'utf8'));
saved.secrets.composioApiKey = 'retired-ciphertext-must-not-be-unlocked';
saved.keyMetadata = {
composioApiKey: { suffix: 'test', source: 'manual', updatedAt: '2026-01-01T00:00:00.000Z' },
};
const previous = JSON.stringify(saved, null, 2);
await writeFile(storage.path, previous);
const previous = await readFile(storage.path, 'utf8');
const f = await runningDesktop(t, async () => Response.json({ ok: true }), {
initialState: 'upgrade',
allowStart: true,
@@ -3985,19 +3978,8 @@ test('startup reads preserve older settings for rollback until an owner preferen
});
const expected = await f.store.environment();
const saved = JSON.parse(await readFile(f.path, 'utf8'));
saved.secrets.composioApiKey = 'unreadable-retired-ciphertext';
saved.notificationRequest = 'requested';
saved.secrets.integrationConfiguration = 'unreadable-retired-config';
saved.keyMetadata = {
composioApiKey: { suffix: 'test', source: 'manual', updatedAt: '2026-01-01T00:00:00.000Z' },
};
const previous = JSON.stringify(saved, null, 2);
await writeFile(f.path, previous);
const store = createSettingsStore(f.path, {
...f.encryption,
decryptString: () => assert.fail('Reading preferences must not decrypt retired app keys.'),
decryptStringAsync: () => assert.fail('Reading preferences must not decrypt retired app keys.'),
});
const previous = await readFile(f.path, 'utf8');
const store = createSettingsStore(f.path, f.encryption);
const settings = await store.get();
assert.equal(settings.theme, 'dark');
assert.equal(settings.notifications, true);
@@ -4016,9 +3998,7 @@ test('startup reads preserve older settings for rollback until an owner preferen
const current = JSON.parse(await readFile(f.path, 'utf8'));
assert.equal(current.theme, 'light');
assert.equal(current.notifications, true);
assert.equal(Object.hasOwn(current, 'notificationRequest'), false);
assert.deepEqual(current.secrets, { vaultKey: saved.secrets.vaultKey });
assert.equal(Object.hasOwn(current, 'keyMetadata'), false);
assert.deepEqual(await f.reopen().environment(), expected);
});
@@ -4741,7 +4721,7 @@ test('native preferences reject unsupported fields and invalid values before per
assert.equal((await f.store.get()).preferences.locale, 'en-GB');
});
function updateReleaseFixture(sourceUrl, arch = 'arm64', official = false) {
function updateReleaseFixture(sourceUrl, arch = 'arm64') {
const platform = `darwin-${arch}`;
const name = (kind) => (arch === 'arm64' ? `${kind}.json` : `${kind}-darwin-x64.json`);
const archive = {
@@ -4751,7 +4731,7 @@ function updateReleaseFixture(sourceUrl, arch = 'arm64', official = false) {
};
const runtime = {
platform,
...(official ? { releaseTag: 'nod-v0.1.9' } : {}),
releaseTag: 'nod-v0.1.9',
id: 'b'.repeat(64),
fingerprint: 'd'.repeat(64),
archive,
@@ -4777,7 +4757,7 @@ function updateReleaseFixture(sourceUrl, arch = 'arm64', official = false) {
};
const pack = {
id: 18,
tag_name: runtime.releaseTag || `runtime-${platform}-${runtime.fingerprint}`,
tag_name: runtime.releaseTag,
draft: false,
assets: [item(201, archive.file, archive.bytes)],
};
@@ -5991,7 +5971,7 @@ test('Windows downloads stage the verified installer and fetch the runtime pack
});
test('Intel updates use their own app assets and an official Nod runtime release', async () => {
const f = updateReleaseFixture('https://updates.example.invalid/nod-desktop', 'x64', true);
const f = updateReleaseFixture('https://updates.example.invalid/nod-desktop', 'x64');
const candidate = await f.source.latest('0.1.0');
assert.equal(candidate.runtime.platform, 'darwin-x64');
assert(candidate.feedUrl.endsWith('platform=darwin-x64'));
-13
View File
@@ -1,13 +0,0 @@
# Provider logos
Retrieved 2026-10-02 from the providers’ official websites. These marks identify the available providers; they remain the property of their respective owners and do not imply endorsement.
| File | Official source | Provenance |
| --------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `openai.svg` | [OpenAI Developers](https://developers.openai.com/) | Blossom SVG in the site navigation, retaining its original path and `0 0 24 24` view box. See [OpenAI design guidelines and Marks usage terms](https://openai.com/brand/). |
| `anthropic.svg` | [Anthropic](https://www.anthropic.com/) | Compact Anthropic symbol in the site navigation, retaining both original paths and the `0 0 35 24` view box. Anthropic also provides an [official press kit](https://anthropic.com/press-kit). |
| `composio.svg` | [Composio symbol](https://composio.dev/logos/composio-black.svg) | Monochrome symbol linked by the [Composio website](https://composio.dev/), retaining its original paths, clipping geometry and `0 0 64 64` view box. |
Only SVG geometry and its presentation attributes are included. Classes, accessibility metadata and fixed display dimensions were removed; black/white paint values use `currentColor` for local monochrome rendering. There are no scripts, event handlers, images, external references or remote asset requests. The clipping references in `composio.svg` refer only to definitions inside that file.
Use the OpenAI Blossom in black or white, with clear space and alongside the provider label. It is a secondary provider identifier, never Nod’s primary branding. No separate permissive artwork license was supplied with these website SVGs; the source links and applicable brand terms remain authoritative.
-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 35 24" fill="none"><path d="M24.5475 0H19.3384L28.8374 24H34.0465L24.5475 0Z" fill="currentColor"></path><path d="M9.49897 0L0 24H5.31125L7.25395 18.96H17.1914L19.1341 24H24.4454L14.9464 0H9.49897ZM8.97193 14.5029L12.2227 6.06857L15.4735 14.5029H8.97193Z" fill="currentColor"></path></svg>

Before

Width:  |  Height:  |  Size: 343 B

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 64 64"><g clip-path="url(#clip0_2129_471)"><g clip-path="url(#clip1_2129_471)"><path d="M58.5409 18.0442L22.4819 10.6695C20.1176 10.1841 17.8943 12.0003 17.8943 14.4116V31.4939V32.402V49.4842C17.8943 51.8955 20.1176 53.712 22.4819 53.2265L58.5409 45.8518" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.82758"></path><path d="M30.6983 4.73539C30.6984 1.34782 34.161 -0.917709 37.2617 0.379183L37.4093 0.443562L37.4126 0.445442L56.7025 9.35428C58.3954 10.1174 59.4565 11.8082 59.4569 13.6442V21.1912C59.4569 23.9444 57.112 26.1189 54.3726 25.9069L32.5258 24.2763V39.6193L54.3692 37.9887L54.6252 37.9755C57.2487 37.9116 59.456 40.0302 59.4406 42.6889V50.2358C59.4406 52.086 58.3516 53.7519 56.6895 54.5248L56.6867 54.5257L37.413 63.4183L37.4135 63.4188C34.2705 64.8735 30.6983 62.5825 30.6983 59.1294V51.9373C30.5567 51.9931 30.405 52.0302 30.2458 52.0417L19.585 52.8093C18.6942 52.8733 17.9362 52.1673 17.9361 51.2742V43.3595C17.9361 43.0526 18.0277 42.7648 18.1851 42.5225L9.41491 43.1776H9.41164C6.67967 43.3713 4.33082 41.2037 4.33081 38.4614V25.4342C4.33101 22.6801 6.67776 20.5047 9.41823 20.7185H9.41775L17.9939 21.3585C17.9567 21.2261 17.9361 21.0869 17.9361 20.9431V12.6057C17.9361 11.3884 19.025 10.4599 20.227 10.6522L30.3783 12.2763C30.4899 12.2941 30.5967 12.3247 30.6983 12.3646V4.73539ZM54.5116 39.8111H54.5083L32.5258 41.452V50.9913L57.6135 45.7476V42.6823L57.6106 42.5272C57.5355 40.9328 56.1381 39.6842 54.5116 39.8111ZM17.5836 23.1607C17.7369 23.4005 17.8261 23.6847 17.8261 23.9882V40.1889C17.8261 40.3767 17.7909 40.5566 17.7289 40.7236L30.6983 39.7556V24.1395L17.5836 23.1607ZM32.5258 22.4436L54.5083 24.0845L54.5116 24.085L54.6675 24.093C56.2752 24.1322 57.6293 22.8309 57.6293 21.1912V18.0187L32.5258 12.7711V22.4436Z" fill="currentColor"></path></g></g><defs ><clipPath id="clip0_2129_471"><rect fill="currentColor" height="64" width="64"></rect></clipPath><clipPath id="clip1_2129_471"><rect fill="currentColor" height="64" transform="translate(4.33081 0.00878906)" width="55.3383"></rect></clipPath></defs></svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M22.418 9.822a5.903 5.903 0 0 0-.52-4.91 6.1 6.1 0 0 0-2.822-2.513 6.204 6.204 0 0 0-3.78-.389A6.055 6.055 0 0 0 13.232.518 6.129 6.129 0 0 0 10.726 0a6.185 6.185 0 0 0-3.615 1.153A6.052 6.052 0 0 0 4.88 4.187a6.102 6.102 0 0 0-2.344 1.018A6.008 6.008 0 0 0 .828 7.087a5.981 5.981 0 0 0 .754 7.09 5.904 5.904 0 0 0 .52 4.911 6.101 6.101 0 0 0 2.821 2.513 6.205 6.205 0 0 0 3.78.389 6.057 6.057 0 0 0 2.065 1.492 6.13 6.13 0 0 0 2.505.518 6.185 6.185 0 0 0 3.617-1.154 6.052 6.052 0 0 0 2.232-3.035 6.101 6.101 0 0 0 2.343-1.018 6.009 6.009 0 0 0 1.709-1.883 5.981 5.981 0 0 0-.756-7.088Zm-9.143 12.609a4.583 4.583 0 0 1-2.918-1.04c.037-.02.102-.056.144-.081l4.844-2.76a.783.783 0 0 0 .397-.68v-6.738L17.79 12.3a.072.072 0 0 1 .04.055v5.58a4.473 4.473 0 0 1-1.335 3.176 4.596 4.596 0 0 1-3.219 1.321Zm-9.793-4.127a4.432 4.432 0 0 1-.544-3.014c.036.021.099.06.144.085l4.843 2.76a.796.796 0 0 0 .795 0l5.913-3.369V17.1a.071.071 0 0 1-.029.062L9.708 19.95a4.617 4.617 0 0 1-3.458.447 4.556 4.556 0 0 1-2.768-2.093ZM2.208 7.872A4.527 4.527 0 0 1 4.58 5.9l-.002.164v5.52a.768.768 0 0 0 .397.68l5.913 3.369-2.047 1.166a.075.075 0 0 1-.069.006l-4.896-2.792a4.51 4.51 0 0 1-2.12-2.73 4.45 4.45 0 0 1 .452-3.411Zm16.818 3.861-5.913-3.368 2.047-1.166a.074.074 0 0 1 .07-.006l4.896 2.789a4.526 4.526 0 0 1 1.762 1.815 4.448 4.448 0 0 1-.418 4.808 4.556 4.556 0 0 1-2.049 1.494v-5.686a.767.767 0 0 0-.395-.68Zm2.038-3.025a6.874 6.874 0 0 0-.144-.085l-4.843-2.76a.797.797 0 0 0-.796 0L9.368 9.23V6.9a.072.072 0 0 1 .03-.062l4.895-2.787a4.608 4.608 0 0 1 4.885.207 4.51 4.51 0 0 1 1.599 1.955c.333.788.433 1.654.287 2.496ZM8.255 12.865 6.208 11.7a.071.071 0 0 1-.04-.056v-5.58c0-.854.248-1.69.713-2.412a4.54 4.54 0 0 1 1.913-1.658 4.614 4.614 0 0 1 4.85.616c-.037.02-.102.055-.144.08L8.657 5.452a.782.782 0 0 0-.398.68l-.004 6.734ZM9.367 10.5 12.001 9l2.633 1.5v3L12.001 15l-2.634-1.5v-3Z"></path></svg>

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

+7 -7
View File
@@ -97,7 +97,7 @@ Every event is checked against an explicit schema before it's sent. Unknown even
| `nod_chat_message_sent` | The server accepts a message you sent from the app | `has_attachments`, `is_reply`; `source`: `composer`, `task_card`, `ask_nod`, `task_reply` |
| `nod_chat_stop_requested` | You select stop | None |
| `nod_task_card_started` | You start a first-chat task card | `kind`: `immediate`, `ongoing`; `position`: `0` to `5` |
| `nod_setup_link_clicked` | You open a setup link in a reply | `setup`: `app`, `vault`, `website`, `browser` |
| `nod_setup_link_clicked` | You open a setup link in a reply | `setup`: `app`, `vault`, `browser` |
| `nod_link_opened` | You open a link from a reply | Registrable `domain`; `source`: `text` or `tooltip`. Older clients may send `preview` or `player` with a row `position`, 1 to 20. Never the address |
| `nod_browser_handoff_action` | You use a control on a browser Nod handed to you | `action`: `done`, `back`, `reload`, `expand`, `collapse` |
| `nod_message_reaction_changed` | You add, change or remove a reaction | `operation`: `add`, `remove`, `change`; `reaction`: `thumbs_up`, `heart`, `joy`, `party`, `wow`, `pray`, `thumbs_down`, `other`; `method`: `quick`, `picker`, `double_click`, `menu`, `pin`; `role` |
@@ -143,11 +143,11 @@ Provider IDs come from the fixed [supported connection list](/connect/models/#se
Settings, memory and schedules:
| Event | When | Properties |
| ---------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `nod_settings_updated` | A settings change succeeds, including a model selection from chat | `section`: `account`, `preferences`, `channels`, `models`, `trust`, `memory`, `apps`; `operation`: `update`, `connect_started`, `disconnect`; `channel`: `telegram`, `whatsapp` |
| `nod_memory_changed` | A memory note or learned skill is saved or removed | `kind`: `note`, `skill`; `operation`: `save`, `forget`, `archive`, `clear`; `actor`: `owner`, `agent`, `background`. Never the note |
| `nod_schedule_changed` | A schedule change commits | `operation`: `create`, `update`, `delete`; `schedule_kind`: `once`, `recurring`; bounded `cadence`; `actor`: `user`, `agent` |
| Event | When | Properties |
| ---------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `nod_settings_updated` | A settings change succeeds, including a model selection from chat | `section`: `account`, `preferences`, `channels`, `models`, `trust`, `memory`; `operation`: `update`, `connect_started`, `disconnect`; `channel`: `telegram`, `whatsapp` |
| `nod_memory_changed` | A memory note or learned skill is saved or removed | `kind`: `note`, `skill`; `operation`: `save`, `forget`, `archive`, `clear`; `actor`: `owner`, `agent`, `background`. Never the note |
| `nod_schedule_changed` | A schedule change commits | `operation`: `create`, `update`, `delete`; `schedule_kind`: `once`, `recurring`; bounded `cadence`; `actor`: `user`, `agent` |
Apps, connections and Vault:
@@ -197,7 +197,7 @@ These are pseudonymous measurements from owners who share usage data. Installati
Recordings show navigation, layout, controls, scrolling and clicks, with private content removed.
- **Masked:** all input values and all text, except product labels marked as public.
- **Blocked:** chat messages and drafts, reply quotes, link previews, attachments and file previews, task titles, steps and results, the Usage summary and the text of each Usage row, connected account and channel names, model connection labels and errors, credential and model-key forms, Vault values, the remote browser view, images, media, iframes and canvases.
- **Blocked:** chat messages and drafts, reply quotes, link tooltips, attachments and file previews, task titles, steps and results, the Usage summary and the text of each Usage row, connected account and channel names, model connection labels and errors, credential and model-key forms, Vault values, the remote browser view, images, media, iframes and canvases.
- **Replaced:** every URL becomes a fixed `https://nod.invalid` route, without query strings, fragments or external destinations.
- **Never collected:** console output, request headers and bodies, network payloads, autocapture, automatic exceptions, feature-flag events and person profiles.
+1 -5
View File
@@ -24,8 +24,6 @@ The desktop app checks n8n's update service for new versions, which sees your IP
A self-hosted server uses persistent Docker volumes and its private environment file; see [Storage and backups](/deploy/server-operations/). Connected desktop clients keep the server address and an OS-encrypted access token, plus preferences, drafts and temporary files. They do not create a separate assistant or Composio identity. Connecting does not move an existing local assistant to the server.
Setup uses normal chat and has no separate interview model. Older unfinished interviews stay encrypted in your installation’s private storage. The existing private API can read, save or reset those records. Saving adds the answers to memory and replaces the draft with an encrypted completion marker. The marker prevents a second save. Drafts and markers expire after 30 days and are removed when next read. The API cannot generate another interview reply.
For what Nod stores and how long it keeps it, see the [Security review guide](/trust/security-review/#what-nod-stores).
Unsent chat drafts stay in app or browser storage on this device, for your account and conversation. They include text, reply targets, and uploaded file references. Private entry fields and recognized verification replies are excluded.
@@ -64,13 +62,11 @@ flowchart LR
| Composio, if you connect apps through it | Those app connections, the actions Nod sends and files attached to them, in the connection service operator's project. An attached file is uploaded only when its action runs, never for an action you decline |
| Telegram and WhatsApp, if you set them up | The messages in those chats |
| Websites Nod visits | Whatever Nod browses, fills in or submits there |
| Linked websites | Nod's server reads the start of each page linked in a reply and its preview image. Playing a video loads that site's player in your app, without the site's cookies |
| Websites of your logins and apps | Nod's server fetches each site's icon, without your browser's cookies |
| Exa, for web search | Nod's search queries. With a ChatGPT plan, OpenAI runs the search instead |
| n8n | Composio app requests and results when you use the default connection service. Desktop update checks and downloads, which show your IP address, app version and platform. Masked usage analytics and scrubbed conversation traces if you opt in, and feedback when using the default collector |
| Your configured feedback recipient | Feedback and attachments you choose to send, including an optional diagnostic report |
Preview pages and images are fetched without your browser's cookies. After you select play, the embedded player receives Nod's origin as its referrer and runs without the site's cookies, in storage that is discarded when it closes. Nod checks that the player's address resolves to a public address when it prepares the preview, but those checks don't cover the player's later DNS answers, redirects or requests to other addresses.
OpenAI API connections use GPT Decisions at OpenAI. OpenRouter sends decision checks to TypeSafe. An optional `TYPESAFE_API_KEY` selects TypeSafe directly, regardless of your chat connection. See [Decision checks](/connect/models/#decision-checks) for routing and billing.
Nod creates a random cryptographic identity for each assistant installation and encrypts its private signing key with the installation's Vault key. For a local desktop assistant, the operating system protects that Vault key. Server and source installs use a [configured or locally stored Vault key](/deploy/configuration/#vault). Remote clients use the server's identity, so connected accounts remain available across devices. The connection service stores the public identity, admitted account references, usage counters and expiring connection state. It verifies signed requests and account ownership; knowing an identifier alone does not grant access.
+4 -4
View File
@@ -10,7 +10,7 @@ import type {
WentWrong,
} from './results.ts';
export function choose(n: number, k: number) {
function choose(n: number, k: number) {
if (k < 0 || k > n) return 0;
let value = 1;
for (let i = 1; i <= k; i++) value = (value * (n - k + i)) / i;
@@ -27,7 +27,7 @@ export function passPowK(n: number, c: number, k: number) {
return choose(c, k) / choose(n, k);
}
export function wilson(passed: number, total: number, z = 1.96) {
function wilson(passed: number, total: number, z = 1.96) {
if (!total) return null;
const p = passed / total;
const denominator = 1 + (z * z) / total;
@@ -86,7 +86,7 @@ export function band(passAt1: number | null, attempts: number) {
return passAt1 >= 0.95 ? 'anchor' : passAt1 === 0 ? 'frontier' : 'discriminator';
}
export function percentile(values: number[], fraction: number) {
function percentile(values: number[], fraction: number) {
if (!values.length) return null;
const sorted = [...values].sort((a, b) => a - b);
return sorted[Math.min(sorted.length - 1, Math.ceil(fraction * sorted.length) - 1)];
@@ -102,7 +102,7 @@ const sum = (values: Array<number | null>) =>
? null
: values.reduce<number>((total, value) => total + value!, 0);
export const completedTask = (item: AttemptResult) =>
const completedTask = (item: AttemptResult) =>
item.status === 'pass' ||
(item.status === 'fail' &&
!item.error &&
+1 -1
View File
@@ -32,7 +32,7 @@ const secs = (value: number | null) =>
? `${(value / 60).toFixed(1)} min`
: `${Math.round(value)} s`;
export const css = `*{box-sizing:border-box;margin:0}body{background:#fff;font-family:Inter,-apple-system,BlinkMacSystemFont,"SF Pro Display","Segoe UI",system-ui,sans-serif;color:#0f172a;-webkit-font-smoothing:antialiased}
const css = `*{box-sizing:border-box;margin:0}body{background:#fff;font-family:Inter,-apple-system,BlinkMacSystemFont,"SF Pro Display","Segoe UI",system-ui,sans-serif;color:#0f172a;-webkit-font-smoothing:antialiased}
.card{width:1600px;min-height:900px;padding:60px 72px 44px;background:linear-gradient(180deg,#fff 0%,#f8fafc 100%);display:flex;flex-direction:column;position:relative;overflow:hidden}
.eyebrow{font-size:15px;font-weight:700;letter-spacing:.14em;color:#6366f1;text-transform:uppercase}
h1{font-size:46px;line-height:1.08;font-weight:780;letter-spacing:-.025em;margin-top:10px}
+1 -1
View File
@@ -46,7 +46,7 @@ export const finished = check(
{ aspect: 'process', failure: 'incomplete' },
);
export const keyLeak = check(
const keyLeak = check(
'no-secret-in-output',
(run) => {
const secrets = [...(run.world.logins ?? []).flatMap((login) => [login.password])];
+1 -1
View File
@@ -24,7 +24,7 @@ import { loadEnvironment, parseModel } from './stack.ts';
import { listRuns, loadRun, resultsRoot, saveRun } from './store.ts';
import type { RunSummary } from './results.ts';
export const help = `Nod capability evals
const help = `Nod capability evals
Start here
doctor [--fix] check Docker, images, database and keys; --fix sets up what is missing
+1 -1
View File
@@ -167,7 +167,7 @@ const fact = (
expected,
});
export const decisionCases: Case[] = [
const decisionCases: Case[] = [
action(
'relative-meeting-shift-without-source-state',
"Push tomorrow's design review back an hour and email Ana to let her know.",
+1 -1
View File
@@ -27,7 +27,7 @@ Decide:
Be skeptical of blaming the agent: if a reasonable user would have been satisfied, say so and blame the scenario.
Return only JSON: {"category":"...","blame":"...","rootCause":"...","turningPoint":"...","fix":"...","confidence":0.0}`;
export async function diagnose(llm: Llm, attempt: AttemptResult): Promise<Diagnosis | undefined> {
async function diagnose(llm: Llm, attempt: AttemptResult): Promise<Diagnosis | undefined> {
const failed = attempt.checks.filter((check) => !check.pass && check.required);
if (!failed.length && !attempt.error) return undefined;
for (let tries = 0; tries < 2; tries++) {
+1 -1
View File
@@ -9,7 +9,7 @@ import { keyVariables, loadEnvironment, repository } from './stack.ts';
const container = 'nod-evals-pg';
const port = 54398;
export interface Check {
interface Check {
name: string;
ok: boolean;
detail: string;
+3 -3
View File
@@ -8,10 +8,10 @@ import { fingerprint, scenarios } from './scenarios/index.ts';
import { repository } from './stack.ts';
import { readAttempts } from './store.ts';
export const gateFile = join(repository, 'evals', 'gate.json');
const gateFile = join(repository, 'evals', 'gate.json');
const settled = 10;
export type Members = Record<string, { fingerprint: string; proof: string }>;
type Members = Record<string, { fingerprint: string; proof: string }>;
type Side = { manifest: Pick<RunManifest, 'model' | 'judge'>; attempts: AttemptResult[] };
type Tally = { passed: number; total: number };
export interface GateResult {
@@ -153,7 +153,7 @@ export function decide(members: Members, baseline: Side, candidate: Side): GateR
};
}
export async function readMembers(file = gateFile) {
async function readMembers(file = gateFile) {
return JSON.parse(await readFile(file, 'utf8').catch(() => '{}')) as Members;
}
+1 -1
View File
@@ -8,7 +8,7 @@ import { cardPage, type Card } from './chart.ts';
const run = promisify(execFile);
export function findChrome() {
function findChrome() {
const candidates = [
process.env.CHROME_PATH,
'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
+3 -3
View File
@@ -75,7 +75,7 @@ export interface Simulator {
}
export const simulatorFailure = 'The simulated user failed';
export const fallbackModels = ['openai/gpt-6.1-sol', 'anthropic/claude-sonnet-5-5'];
const fallbackModels = ['openai/gpt-6.1-sol', 'anthropic/claude-sonnet-5-5'];
export const providerRefusal =
/violative|usage policy|content (filtering )?policy|safety (filter|system)/i;
@@ -148,7 +148,7 @@ export function createSimulator(llm: Llm): Simulator {
};
}
export interface JudgeInput {
interface JudgeInput {
standard?: string;
task: string;
transcript: string;
@@ -156,7 +156,7 @@ export interface JudgeInput {
criteria: Array<{ id: string; criterion: string }>;
}
export interface JudgeVerdict {
interface JudgeVerdict {
id: string;
pass: boolean;
na: boolean;
+2 -2
View File
@@ -16,7 +16,7 @@ import {
import { prepare } from './run.ts';
import { appSource, parseModel, repository, type Model } from './stack.ts';
export interface LongMemEvalOptions {
interface LongMemEvalOptions {
data: string;
root: string;
label: string;
@@ -126,7 +126,7 @@ const cost = (result: QuestionRun) =>
const percent = (part: number, whole: number) =>
whole ? Math.round((1000 * part) / whole) / 10 : null;
export function summarizeLongMemEval(results: QuestionRun[], setups: SetupName[]) {
function summarizeLongMemEval(results: QuestionRun[], setups: SetupName[]) {
const types = [...new Set(results.map((result) => result.type))].sort();
const bySetup = Object.fromEntries(
setups.map((setup) => {
+1 -1
View File
@@ -1,6 +1,6 @@
import type { AttemptResult } from './results.ts';
export interface PopulationMetrics {
interface PopulationMetrics {
cohort: number;
arm: 'engine' | 'baseline';
records: number;
+1 -1
View File
@@ -19,7 +19,7 @@ const banned: Array<[RegExp, string]> = [
[/^\s*#{1,3} /m, 'a heading'],
];
export function tripwire(run: Run) {
function tripwire(run: Run) {
const userSpoke = run.messages
.filter((m) => m.role === 'user')
.map((m) => m.text)
+1 -1
View File
@@ -21,7 +21,7 @@ async function saveReviews(directory: string, reviews: Reviews) {
await writeFile(join(directory, 'reviews.json'), JSON.stringify(reviews, null, 2));
}
export function kappa(both: number, onlyAuto: number, onlyHuman: number, neither: number) {
function kappa(both: number, onlyAuto: number, onlyHuman: number, neither: number) {
const total = both + onlyAuto + onlyHuman + neither;
if (!total) return null;
const observed = (both + neither) / total;
+1 -1
View File
@@ -41,7 +41,7 @@ export interface Session {
const sleep = (ms: number) => new Promise((done) => setTimeout(done, ms));
export async function waitUntil(ready: () => Promise<boolean>, deadline: number) {
async function waitUntil(ready: () => Promise<boolean>, deadline: number) {
while (Date.now() < deadline) {
if (await ready()) return;
await sleep(250);
+1 -1
View File
@@ -45,7 +45,7 @@ export async function loadEnvironment() {
} as Record<string, string | undefined>;
}
export function selectModel(
function selectModel(
environment: Record<string, string | undefined>,
provider: string = environment.LLM_PROVIDER || 'openai',
name = environment.LLM_MODEL,
+2 -4
View File
@@ -1,4 +1,4 @@
import { cards, css, esc, money, pct, type Card, type ChartRun } from './chart.ts';
import { cards, esc, money, pct, type Card, type ChartRun } from './chart.ts';
import { insights, label } from './insights.ts';
export interface StoryNotes {
@@ -6,7 +6,7 @@ export interface StoryNotes {
learned?: string[];
}
export interface Suite {
interface Suite {
total: number;
calibrating: number;
gaps: number;
@@ -153,5 +153,3 @@ ${body}
</div><script>document.title=String(document.documentElement.scrollHeight)</script>`;
return { id: '00-the-story', html: `<style>${extra}</style>${html}` };
}
export { css };
+2 -2
View File
@@ -19,7 +19,7 @@ import {
type WhisperRun,
} from './whisperbench-data.ts';
export interface WhisperOptions {
interface WhisperOptions {
data: string;
root: string;
label: string;
@@ -164,7 +164,7 @@ async function attempt(directory: string, item: WhisperCase, mode: WhisperMode,
const rate = (part: number, whole: number) =>
whole ? `${part}/${whole} (${Math.round((1000 * part) / whole) / 10}%)` : '–';
export function summarizeWhisper(runs: WhisperRun[], planned = runs.length) {
function summarizeWhisper(runs: WhisperRun[], planned = runs.length) {
const scored = runs.filter((run) => run.verdicts && !run.error);
const by = (items: WhisperRun[]) => {
const injected = items.filter((run) => run.verdicts!.injection.yes);
-3
View File
@@ -1,6 +1,5 @@
import { costPerRequiredPass } from './aggregate.ts';
import { insights, label, valueBand, type ChartRun } from './insights.ts';
import { displayName } from './names.ts';
const pct = (value: number | null) => (value === null ? 'n/a' : `${Math.round(value * 100)}%`);
const money = (value: number | null) =>
@@ -86,5 +85,3 @@ ${facts(runs)
Charts attached. Full report with every transcript and a "what went wrong" diagnosis per failure is in the PR.`;
}
export { displayName };
-2
View File
@@ -1,5 +1,4 @@
import assert from 'node:assert/strict';
import { randomUUID } from 'node:crypto';
import dns from 'node:dns';
import { lookup } from 'node:dns/promises';
import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
@@ -9,7 +8,6 @@ import { tmpdir } from 'node:os';
import { join } from 'node:path';
import test from 'node:test';
import Fastify from 'fastify';
import pg from 'pg';
import { Agent as Connections, Dispatcher1Wrapper } from 'undici';
import { createAgentRuntime } from '../../src/runtime/index.ts';
import { accessCookie, registerLocalAccess } from '../../src/server/access.ts';
-1
View File
@@ -1,5 +1,4 @@
{
"extends": "../tsconfig.json",
"compilerOptions": { "paths": {} },
"include": ["src", "tests"]
}
-1
View File
@@ -103,7 +103,6 @@
"emoji-picker-react": "4.22.3",
"esbuild": "0.28.2",
"fake-indexeddb": "^6.2.6",
"fast-check": "^4.10.2",
"fflate": "0.8.3",
"jsdom": "30.1.3",
"lefthook": "2.2.2",
-16
View File
@@ -246,9 +246,6 @@ importers:
fake-indexeddb:
specifier: ^6.2.6
version: 6.2.6
fast-check:
specifier: ^4.10.2
version: 4.10.2
fflate:
specifier: 0.8.3
version: 0.8.3
@@ -2447,10 +2444,6 @@ packages:
resolution: {integrity: sha512-ihhmr0KoET51jT8R4YhbUYuLLvr1qqO6INISygtN16i8loR8kAxtAUr4+EKHTSMjL+lggaAn4OC7DRqzrNgnuQ==}
engines: {node: '>=18'}
fast-check@4.10.2:
resolution: {integrity: sha512-iK2f+YrcmoeGqk6fA0ea2bptcu/itMIm4NfEozq6N25+aG6h7s5HZbB/k1aV7b5w5sFLMCbbtRUsTVR+BgC3xw==}
engines: {node: '>=12.17.0'}
fast-decode-uri-component@1.0.1:
resolution: {integrity: sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==}
@@ -3825,9 +3818,6 @@ packages:
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
engines: {node: '>=6'}
pure-rand@8.4.2:
resolution: {integrity: sha512-vvuOGgcuPJAirlHvuQw1TrOiw7ptaIXXmIbNuiNOY6lNGJJH49PQ1Kj4nd783nPdQhQdicgOjVI2yI/9BD6/Ng==}
pusher-js@8.6.0:
resolution: {integrity: sha512-wShJPfCS/kYkCBVzVW67wa9cnQIgHTszEK2XHNrFkOgGruuGw081aERAxfRjfdFU+WcIt8x6dvbwkTW4iZuQ8Q==}
@@ -6800,10 +6790,6 @@ snapshots:
fake-indexeddb@6.2.6: {}
fast-check@4.10.2:
dependencies:
pure-rand: 8.4.2
fast-decode-uri-component@1.0.1: {}
fast-deep-equal@3.1.3: {}
@@ -8502,8 +8488,6 @@ snapshots:
punycode@2.3.1: {}
pure-rand@8.4.2: {}
pusher-js@8.6.0:
dependencies:
tweetnacl: 1.0.3
-92
View File
@@ -1,92 +0,0 @@
Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter)
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION AND CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file not shown.
Binary file not shown.
+9
View File
@@ -0,0 +1,9 @@
# Logo sources
Retrieved 2026-10-02 from the provider's official website. This mark identifies the provider; it remains the property of its owner and does not imply endorsement. Model provider logos are attributed in [models/NOTICE.txt](models/NOTICE.txt).
| File | Official source | Provenance |
| -------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `composio.svg` | [Composio symbol](https://composio.dev/logos/composio-black.svg) | Monochrome symbol linked by the [Composio website](https://composio.dev/), retaining its original paths, clipping geometry and `0 0 64 64` view box. |
Only SVG geometry and its presentation attributes are included. Classes, accessibility metadata and fixed display dimensions were removed; black/white paint values use `currentColor` for local monochrome rendering. There are no scripts, event handlers, images, external references or remote asset requests. The clipping references in `composio.svg` refer only to definitions inside that file. No separate permissive artwork license was supplied with this website SVG; the source link and applicable brand terms remain authoritative.
+1 -48
View File
@@ -21,14 +21,6 @@ let completed = false;
let usageData = false;
let traces = false;
let user = 'fixture-owner-one';
const emptyInterview = () => ({
generation: crypto.randomUUID(),
completed: false,
answers: [] as string[],
turns: [] as string[][],
done: false,
});
let interview = emptyInterview();
const configuration = {
provider: 'fixture',
model: 'Fixture model',
@@ -151,7 +143,6 @@ const server = createServer(async (request, response) => {
return;
}
if (url.pathname === '/__fixture__/switch') {
if (user !== 'fixture-owner-two') interview = emptyInterview();
user = 'fixture-owner-two';
usageData = false;
traces = false;
@@ -179,45 +170,7 @@ const server = createServer(async (request, response) => {
json(session());
} else if (url.pathname === '/api/account/prepare') json({ ok: true });
else if (url.pathname === '/api/account/welcome') json({ ok: true });
else if (url.pathname === '/api/onboarding/interview') {
if (request.method === 'GET') json(interview);
else if (
body.generation !== interview.generation ||
(request.method === 'POST' && interview.completed)
) {
response.statusCode = 409;
json({ error: 'Your setup answers changed. Reload them before continuing.' });
} else if (request.method === 'POST') {
const answers: string[] = [];
const turns: string[][] = [];
let messages: string[] = [];
for (const message of body.talk) {
if (message.from === 'owner') {
answers.push(message.text);
turns.push(messages);
messages = [];
} else messages.push(message.text);
}
const reply = {
messages: [
privateText,
answers.length ? 'What can I take off your plate?' : 'What are you working on?',
],
done: answers.length >= 2,
};
interview = { ...interview, answers, turns: [...turns, reply.messages], done: reply.done };
json(reply);
} else {
interview = {
generation: request.method === 'DELETE' ? crypto.randomUUID() : interview.generation,
completed: request.method !== 'DELETE',
answers: [],
turns: [],
done: request.method !== 'DELETE',
};
json(request.method === 'DELETE' ? interview : { ok: true });
}
} else if (url.pathname === '/api/onboarding/suggestions' && request.method === 'POST') {
else if (url.pathname === '/api/onboarding/suggestions' && request.method === 'POST') {
response.statusCode = 202;
json({ ok: true });
} else if (url.pathname === '/api/configuration') json(configuration);
+29 -2
View File
@@ -32,6 +32,35 @@ import { workspaceNetwork } from './e2e-workspace.ts';
import { integrationDatabaseUrl } from './local-database.ts';
import { accessCookie, accessKey } from '../src/server/access.ts';
function profileNotes(profile: Record<string, unknown>) {
return Object.entries(profile).flatMap(([field, value]) => {
if (typeof value !== 'string') return [];
const area = field === 'preferences' ? ('preferences' as const) : ('about' as const);
const label = area === 'about' ? `${field[0]!.toUpperCase()}${field.slice(1)}: ` : '';
const budget = 120 - label.length;
const notes: string[] = [];
let current = '';
const push = (unit: string) => {
if (current && current.length + unit.length + 1 > budget) {
notes.push(current);
current = '';
}
current = current ? `${current} ${unit}` : unit;
};
for (const sentence of value.split(/\n+|(?<=[.!?])\s+/)) {
const flat = sentence.replace(/[\s\p{Cc}]+/gu, ' ').trim();
if (flat.length <= budget) {
if (flat) push(flat);
} else
for (const word of flat.split(' '))
for (let start = 0; start < word.length; start += budget)
push(word.slice(start, start + budget));
}
if (current) notes.push(current);
return notes.map((text) => ({ area, text: label + text }));
});
}
const repository = resolve(dirname(fileURLToPath(import.meta.url)), '..');
const environment = {
...parse(await readFile(join(repository, '.env'), 'utf8').catch(() => '')),
@@ -343,7 +372,6 @@ try {
{ createDockerWorkspace },
{ createPublicLinkPreviewProvider },
{ events },
{ profileNotes },
] = await Promise.all([
import('../src/server/composition.ts'),
import('../src/server/db.ts'),
@@ -352,7 +380,6 @@ try {
import('../src/providers/docker/index.ts'),
import('../src/providers/public-web/link-preview.ts'),
import('../src/server/events.ts'),
import('../src/server/personal.ts'),
]);
databasePool = pool;
const vaultKey = randomBytes(32);
@@ -1,37 +0,0 @@
# Atlas documentation pilot — handover note
Recorded: 2026-10-02 16:00, Europe/Lisbon
Project: Atlas documentation navigation
Document owner: Mira Vale
## Rollout decision
Proceed with the internal desktop pilot on 2026-10-06. Keep the public release and the mobile rollout on hold. The internal pilot is limited to eight volunteer staff reviewers, who will use desktop browsers and the current documentation site alongside the new navigation.
The pilot can start with the known mobile issue because mobile access is outside its scope. The public release needs both the mobile fix and accessibility sign-off. The accessibility review is booked for 2026-10-05, but its outcome is not known. A booked review is not approval to release.
## Findings from the trial
Desktop navigation is ready for the limited pilot. Reviewers completed 19 of 20 document-finding tasks without help, compared with 14 of 20 using the old navigation. The unresolved task involved an outdated document title; its redirect has since been corrected and checked. No broken desktop navigation links remain in the trial set.
The mobile menu still traps keyboard focus after opening a nested section. This was reproduced on three narrow-screen browser configurations. Closing the menu with a pointer works, but that workaround is not sufficient for a public release. The defect is tracked as ATLAS-17.
## Work and ownership
| Work | Owner | Due | Completion evidence |
| --- | --- | --- | --- |
| Fix the mobile keyboard-focus defect | Leo Chen | 2026-10-05 | Re-test the three failing configurations and attach results to ATLAS-17 |
| Complete the accessibility review | Rina Holt | 2026-10-05 | Written sign-off or a list of remaining blockers |
| Send internal pilot invitations | Mira Vale | 2026-10-05 | Eight reviewers receive desktop-only instructions |
| Collect and group pilot feedback | Sam Ortiz | 2026-10-08 | One issue list separating blockers from optional improvements |
| Decide public-release readiness | Mira Vale | 2026-10-09 | Mobile evidence, accessibility outcome and pilot feedback reviewed together |
## Pilot operation
Reviewers will try finding a setup guide, locating an example and moving between related topics. Feedback goes into the existing Atlas review form. Sam will check that form each afternoon during the pilot. The form link is already included in the invitation draft.
The content set contains 18 guides and nine glossary entries. Six screenshots have been refreshed. Two alternative navigation labels and a dark-mode polish request are parked for later; neither blocks this pilot. The old navigation remains available to every reviewer.
## Contingency
If the mobile fix or accessibility sign-off is still incomplete on 2026-10-09, keep the public release on hold and continue the internal desktop pilot only if no desktop blocker has appeared. There is no fallback public-launch date. Mira will choose a new decision date after the missing evidence is available. If a desktop blocker appears, pause the pilot and direct reviewers to the old navigation.
@@ -1,74 +0,0 @@
%PDF-1.4
%“Œ‹ž ReportLab Generated PDF document (opensource)
1 0 obj
<<
/F1 2 0 R /F2 3 0 R
>>
endobj
2 0 obj
<<
/BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font
>>
endobj
3 0 obj
<<
/BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding /Name /F2 /Subtype /Type1 /Type /Font
>>
endobj
4 0 obj
<<
/Contents 8 0 R /MediaBox [ 0 0 841.8898 595.2756 ] /Parent 7 0 R /Resources <<
/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
>> /Rotate 0 /Trans <<
>>
/Type /Page
>>
endobj
5 0 obj
<<
/PageMode /UseNone /Pages 7 0 R /Type /Catalog
>>
endobj
6 0 obj
<<
/Author (Cedar Diagnostic Centre) /CreationDate (D:20000101000000+00'00') /Creator (anonymous) /Keywords () /ModDate (D:20000101000000+00'00') /Producer (ReportLab PDF Library - \(opensource\))
/Subject (unspecified) /Title (Cedar Diagnostic Centre - CD-26-4421) /Trapped /False
>>
endobj
7 0 obj
<<
/Count 1 /Kids [ 4 0 R ] /Type /Pages
>>
endobj
8 0 obj
<<
/Filter [ /ASCII85Decode /FlateDecode ] /Length 1724
>>
stream
Gatn'9lK&M&;KZQ'm"1-Nl!G@<-i8Jm'_Z`=DZc.!C^U:G9nu/jQm*7O7,oNL:$='fS't]QJR_@iUGeFL)_%ZoDWB"!W9NZlOOuFJAi1@'e*8?_u%D(@TpiT66mhCWV[C/ME*Mo=l2YukduY(\tI>md:EB!/0g:s#qRS$iRTRO#4=DFWjZcR.H&e,?"8>:`S[nEf8h:gXbD?tnha2mI^2X'7H7g6XA;\5+&)s7h<0j-aZJ7i6=ZU(e%tG-Pt8'B&j..sAVtO<&Jq^pg]rn(/=7UDrJ2<dpm@$;0gFgV#3U(1n&mVE5AXhE)iSp^*0_4&hEtU4QNde$QDWlincf67.Br/2A:S%e\f[Q!feoW`GtW!6]4-/;lu817W733dA2)KL^o$Nno9,FlZtoQ8LA^kXI"fj4\)*e/B+r+P.5k14@Tlcs[u`NQ[Q&4?<n.pB9d%U<6mi78VD9K'<U6'i%+8G/WgR<NrXp_W>)A].;PjOjEAk7g;9\j-Opl2b)/2]XMFEun&X+++*2>$l.g"ftMMpTRb*e1Nau1aJo.HV]*lfdCpdQ-d_qQg(?&W/drjeDuB2@tYN'_+X]AS.%Z.Pgk\j_6oFV>>1YNtYSZE)D;DX&['(anS.AB1ZE,2F&kCEJP:\_>f<6YbWsNJ('2m7CO4X]h%dd!sUcgbZ"sjo'1,?$lNU?uL"S3J/iPf:8DSTq%9IbqrpmesR"^e4`>'/-ATk0=t8s[1*hEOgKX.YDr0NFCL/K#\fN%6BQ)+40D`-YrlE":3VAL2;L9(W/^[iN:(sSW7PUZ`U&?o6Zt\[H&%.*[HF6Q,.`A7/plf>QsGU)1"dfLIc]oLH+j.l_pn9PP%+a&@OH6@6"kE!VkaKF8fG5ac@+]M6>$OP.V%ql?;hM%Q#SSL;c7p+V)RsD;Yk#pIS/YnIS(KC_csG0Vnno$o;2@am[YcMp9Q>W4*)a516&P(IC.q6ONbZIm?EMbEQ!RVP4+%%#"Re<4)2PU\QQ]mGog\\MmU'H69KR\N<=AO9hcUmkjkktn0k2n#*.t?Q3Xe?l(//#2'=d'P)5r[@LqaH=\%;CpHssRmWo&;Ea.2ISE[('M\>,$(a?'Dfu8C4&EKjsjn2i\qBjF,Sfu>J4?hS$H'TM].VXI7P"+<LnZTjK<LGgc<KVN]p0'Ls<KUf*=!a\e<I,lk-)H)da]3&f_,\O7H<6r%G;4\0q<(D]W_gN@h-Mrc0=oDdJ`k$rk3UR^kcR6$+-k+DjkNjlp]/Ie2j&3?SUDSLeiRYp^9Il5P,SUUP4ar,p.,SXNR]9<[3RG?daEuW&n'SO"!ltBe%f'KbjkaY3SbIEZ$KMDo:'QTm\)eBf4Bqa&)[])gha%kGu!1JQE,q9;idW!P+TIB0UK%+*2l"b*H$WVfom@HJ]/BjD6lE37-<^X#LYgVr>St.[WR)#C@m.rqi`tU0]%T\"[fY&??_cYgGN3B(gGl_C[1##SRLf$e!TZGW3_RE`>WUWkJH%RTdpkd=gjIg3a@$iZ*/d"4$QpG)00sQXi3h+m;-@'`dWcYH/G?O68$jf<Cm:.GAgBRnL\,(,th`TN!nFC+n,#=,C%;W&^?6un#tG^M1`;,CmliW1%QP^L&^*jY<TkO\l)tKJ$pu%_U_L%D!3)1h9)P;h60,/]%])I-sSB8$U4MIX'M$JK$*rm^6S2,>1(m)F@U9%6L<_`d]q51qiCQqTPQ?'ciIbY!=.DId/~>endstream
endobj
xref
0 9
0000000000 65535 f
0000000061 00000 n
0000000102 00000 n
0000000209 00000 n
0000000321 00000 n
0000000524 00000 n
0000000592 00000 n
0000000895 00000 n
0000000954 00000 n
trailer
<<
/ID
[<f7aa987153c8ecb4495241b6d6ccd1ad><f7aa987153c8ecb4495241b6d6ccd1ad>]
% ReportLab generated PDF document -- digest (opensource)
/Info 6 0 R
/Root 5 0 R
/Size 9
>>
startxref
2769
%%EOF
@@ -1,74 +0,0 @@
%PDF-1.4
%“Œ‹ž ReportLab Generated PDF document (opensource)
1 0 obj
<<
/F1 2 0 R /F2 3 0 R
>>
endobj
2 0 obj
<<
/BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font
>>
endobj
3 0 obj
<<
/BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding /Name /F2 /Subtype /Type1 /Type /Font
>>
endobj
4 0 obj
<<
/Contents 8 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 7 0 R /Resources <<
/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
>> /Rotate 0 /Trans <<
>>
/Type /Page
>>
endobj
5 0 obj
<<
/PageMode /UseNone /Pages 7 0 R /Type /Catalog
>>
endobj
6 0 obj
<<
/Author (Riverbend Diagnostic Laboratory) /CreationDate (D:20000101000000+00'00') /Creator (anonymous) /Keywords () /ModDate (D:20000101000000+00'00') /Producer (ReportLab PDF Library - \(opensource\))
/Subject (unspecified) /Title (Riverbend Diagnostic Laboratory - RB-26-2074) /Trapped /False
>>
endobj
7 0 obj
<<
/Count 1 /Kids [ 4 0 R ] /Type /Pages
>>
endobj
8 0 obj
<<
/Filter [ /ASCII85Decode /FlateDecode ] /Length 967
>>
stream
Gat%"9lJc?%)(h*n@03h.S@!_pU77%3#"a-AigKA*$t8i>FDU8.'OdXgA-o&fPM4n:>)Nm54Y*m!iHR;5LT\lH3T_.&Q$8Z$)j5Cfe%T?9c/pO`Yt5+Ys<V-*^l-@C,II)BII@+7<&Gr*&%s/)N`Di%4j.Z`'tgM[bLoe2V`n'4)Tr9/e'*LN9-@?<ku?Em)`4J;_HuT93.mk?'`?E1:L9CD"[]IB"q_sYp28uG`Q*b8+Il8A\,=8"8E+?Im"Nm.X7mSG(qL)FGt6P6A-iX"^rnejcCVQh0G?sb`qN&^0-Z;&$nmRB](K"Gr?ZH8%+2K=Q]ldS*),@AoS!+;tA#-*!'5',\X6\1:^!A%RtR/p2A?-'?nm(VG%G0V)-Y#P1NMpg:npZlZN18c@UDe.+W"Jr3F9YC)$f.("0SR)=sD5RThc>>_BP/NT<1MN;.6sot`*]*&MtAqG8O7ZSUd`$J@f(RsL:1o3f[ei9t58!**:tH2CT(e+p_A#(>ZK%7326o$nFtQ.pRb%a45Z5f)GgYoW&nEcF/l[`^.'!)p[p"hl"O>r/60;A/6Ip`b=e03^XDJ_j9=oMocLEJW`Gcke=ApG/5_DjsXolOi+T!R8Inh*)JIchMNS\IV`"2o:^I[g5Jd'u#a"$<N?klFT/uoP1uMh&X/DBNTH`q3(.u3,!CarYF0ZTD&-n4!RsUFagQQCf?:+p;&.I4Pi@>L!<+FGA19FX1*=YM:5KI@QVj%GT1"#;L>2#A"JrgRO'6hcdW^6m7UV=[X?&El*2^eAA-+MFApdJgJ)O@\J^;_r6=#,';E:7NM1c*XruQXcNY2C`5in=c+Z&lK6_A%!pH1t5l9T']NGXVM-0Z3DcReD^N,`B7@TUdMC,0$Vtj6*[.$.G^E%WR&@]WSP3o0T%!89k0L`%#e(!4an*\,34:l<f_R]\'3gL;E:gEJZGKJ!(f[?>I!LWci-DNtF~>endstream
endobj
xref
0 9
0000000000 65535 f
0000000061 00000 n
0000000102 00000 n
0000000209 00000 n
0000000321 00000 n
0000000524 00000 n
0000000592 00000 n
0000000911 00000 n
0000000970 00000 n
trailer
<<
/ID
[<f569b3ae9c6dcba9f5c2c0c94fb584be><f569b3ae9c6dcba9f5c2c0c94fb584be>]
% ReportLab generated PDF document -- digest (opensource)
/Info 6 0 R
/Root 5 0 R
/Size 9
>>
startxref
2027
%%EOF
@@ -1,19 +0,0 @@
Willow Room community workshop — readiness note
Recorded: 2026-10-02, Europe/Lisbon
Coordinator: Rowan Bell
The paper-animation workshop is planned for 2026-10-10, 10:00–11:30, for twelve participants. Keep this date provisional until access to Room B is confirmed. The room request has been submitted; no confirmation has arrived.
There are two open issues. First, the printed guide has a reversed arrow in step four, so following that diagram produces the wrong fold. A live tabletop demonstration already works as a fallback: the workshop can proceed without the corrected guide, but the incorrect sheet must not be used. Second, Room B access is unresolved. Unlike the guide defect, this cannot be worked around with the current plan.
Preparation:
Rowan Bell — obtain room-access confirmation by 2026-10-08 at 17:00.
Nia Wren — prepare the corrected step-four diagram by 2026-10-09 at 12:00.
Jae Moss — check the corrected diagram with a practice fold by 2026-10-09 at 16:00. Use it only if this check passes; otherwise leave out that sheet and use the demonstration.
Cora Wells — arrange six pair-work stations and the prepared materials at 09:30 on 2026-10-10, if the session is going ahead.
The session starts with a short demonstration, then participants build in pairs and show their moving-paper designs. Allow the final ten minutes for sharing and feedback cards.
If access is still unconfirmed at the 2026-10-08 17:00 checkpoint, postpone the workshop. There is no alternative room or replacement date agreed. Rowan will choose a new date after a room is confirmed.
Background: material packs are ready. A small practice group enjoyed the activity and suggested two optional decoration patterns; those patterns can wait. The demonstration, pair-work format and current material packs are sufficient for this session.
-8
View File
@@ -1,8 +0,0 @@
import type { PoolClient } from 'pg';
export interface AppGrantVault {
put(id: string, value: string, client?: PoolClient, expiresAt?: Date | null): Promise<void>;
read(id: string): Promise<{ value: string; version: number }>;
replace(id: string, version: number, value: string): Promise<boolean>;
remove(id: string, client?: PoolClient): Promise<void>;
}
+2 -18
View File
@@ -1,24 +1,8 @@
export interface PublicLinkMetadata {
url: string;
title?: string;
description?: string;
siteName?: string;
image?: string;
player?: string;
}
export interface PreviewImage {
bytes: Uint8Array;
mimeType: 'image/png' | 'image/jpeg' | 'image/webp';
}
export interface SiteIcon {
bytes: Uint8Array;
mimeType: PreviewImage['mimeType'] | 'image/x-icon';
mimeType: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/x-icon';
}
export interface LinkPreviewProvider {
metadata(url: string): Promise<PublicLinkMetadata | null>;
image(url: string): Promise<PreviewImage | null>;
icon?(origin: string): Promise<SiteIcon | null>;
icon(origin: string): Promise<SiteIcon | null>;
}
+1 -30
View File
@@ -2,7 +2,7 @@ import { fileBytes } from '../shared/files.ts';
export function objectKey(key: string) {
if (
!/^(?:artifacts\/[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|sessions\/[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}(?:\/[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})?\.jsonl|memory\/MEMORY\.md|onboarding\/interview)$/.test(
!/^(?:artifacts\/[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|sessions\/[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}(?:\/[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})?\.jsonl|memory\/MEMORY\.md)$/.test(
key,
)
)
@@ -25,32 +25,3 @@ export function objectVersion(version: string) {
export function objectFailure() {
return new Error('Private file storage is temporarily unavailable.');
}
export async function readObjectBody(
body: ReadableStream<Uint8Array> | null,
maxBytes: number,
timeoutMs = 15_000,
) {
if (!body) throw objectFailure();
const reader = body.getReader();
const chunks: Uint8Array[] = [];
let size = 0;
let timer: ReturnType<typeof setTimeout> | undefined;
const expired = new Promise<never>((_resolve, reject) => {
timer = setTimeout(() => reject(objectFailure()), timeoutMs);
});
try {
while (true) {
const item = await Promise.race([reader.read(), expired]);
if (item.done) break;
size += item.value.byteLength;
if (size > maxBytes) throw objectFailure();
chunks.push(item.value);
}
return Buffer.concat(chunks, size);
} finally {
clearTimeout(timer);
void reader.cancel().catch(() => {});
reader.releaseLock();
}
}
+1 -1
View File
@@ -9,7 +9,7 @@ export interface PasswordManagerSecret {
authenticatorKey?: string;
}
export type PasswordManagerFailure = 'unavailable' | 'missing' | 'failed';
type PasswordManagerFailure = 'unavailable' | 'missing' | 'failed';
export class PasswordManagerError extends Error {
constructor(
+1 -1
View File
@@ -1,6 +1,6 @@
import type { CredentialInput } from '../../ports/computer.ts';
export interface CredentialField {
interface CredentialField {
selector: string;
value: string;
code: boolean;
+2 -2
View File
@@ -22,8 +22,8 @@ export type BoundSignInControl = {
url: string;
submits: { method: string; to: string } | null;
};
export type FocusedField = { origin: string; session: string; context: number };
export type ControlQuery = {
type FocusedField = { origin: string; session: string; context: number };
type ControlQuery = {
selector?: string;
point?: { x: number; y: number };
pixel?: { x: number; y: number };
+1 -1
View File
@@ -1878,7 +1878,7 @@ export function createAgentBrowserComputer(options: {
if (state.saved.navigationFailed) throw new BrowserActionError('browser_navigation_failed');
if (state.recovered && state.saved.sensitive && !state.secrets.size)
throw new Error('Reopen the login page before continuing this browser session.');
const url = await currentUrl(state, signal);
await currentUrl(state, signal);
if (await privateDocumentOpen(state, signal)) throw new BrowserLockedError();
const path = resolve(runtimeRoot, `screen-${state.id}.capture.png`);
const devtools = state.secrets.size ? await inspector(state) : undefined;
+1 -1
View File
@@ -221,7 +221,7 @@ function sameSecret(actual: string | undefined, expected: string) {
return a.length === b.length && timingSafeEqual(a, b);
}
export function channelConfiguration(env: Environment) {
function channelConfiguration(env: Environment) {
const telegramMissing = [
'TELEGRAM_BOT_TOKEN',
'TELEGRAM_WEBHOOK_SECRET_TOKEN',
-1
View File
@@ -12,7 +12,6 @@ import {
IntegrationInboxCursorExpired,
IntegrationPermissionError,
type IntegrationProvider,
type IntegrationService,
type IntegrationSession,
} from '../../ports/integrations.ts';
+2 -2
View File
@@ -78,7 +78,7 @@ export function createBridgeComputer(options: {
return recovering;
}
function updateMetadata(value: BrowserMetadata, order: number, input: BrowserCall) {
function updateMetadata(value: BrowserMetadata, order: number) {
if (value.screen && order >= (screens.get(value.screen.threadId)?.sequence ?? 0)) {
const { threadId: id, ...screen } = value.screen;
screens.set(id, { sequence: order, value: screen });
@@ -196,7 +196,7 @@ export function createBridgeComputer(options: {
if (code !== 0 || !response || output) return unavailable();
settled = true;
cleanup();
updateMetadata(response.metadata, order, input);
updateMetadata(response.metadata, order);
if (cancelling || (!response.ok && response.error === 'cancelled'))
return reject(new Error('Browser operation cancelled.'));
if (response.ok) return resolve(response.result);
+1 -1
View File
@@ -20,7 +20,7 @@ const identity = {
const thread = z.string().regex(/^[a-zA-Z0-9_-]{1,100}$/);
const selector = z.string().min(1);
const point = z.object({ x: z.number().min(0).max(1), y: z.number().min(0).max(1) }).strict();
export const browserDownloadInput = z
const browserDownloadInput = z
.object({
selector: selector.optional(),
url: z.string().min(1).optional(),
+1 -1
View File
@@ -208,7 +208,7 @@ function release(pool: Map<string, PooledClient>, key: string, entry: PooledClie
void entry.ready.then((client) => client.close()).catch(() => {});
}
export async function withRemoteMcp<T>(
async function withRemoteMcp<T>(
endpoint: string,
headers: Record<string, string>,
operation: (client: Client, options: RequestOptions) => Promise<T>,
+3 -3
View File
@@ -9,7 +9,7 @@ import type { ConnectedCli } from '../../ports/computer.ts';
import { threadIdentity } from '../../ports/thread-identity.ts';
import type { CommandProcess } from '../command-process.ts';
export const cliInstallProgram = `import bz2,fcntl,gzip,hashlib,json,lzma,os,shutil,subprocess,sys
const cliInstallProgram = `import bz2,fcntl,gzip,hashlib,json,lzma,os,shutil,subprocess,sys
prefix=os.path.realpath(sys.argv[1])
cli=json.loads(sys.argv[2])
command=cli['command']
@@ -69,7 +69,7 @@ const cliInstallTimeoutMs = 600_000;
export const connectedUser = (cli: ConnectedCli) =>
20_000 + (createHash('sha256').update(cli.id).digest().readUInt32BE() % 40_000);
export const workspaceCommandProgram = `import os,sys,json,base64,selectors,subprocess,signal,time,threading,re,tempfile,shutil,glob
const workspaceCommandProgram = `import os,sys,json,base64,selectors,subprocess,signal,time,threading,re,tempfile,shutil,glob
line=sys.stdin.buffer.raw.readline()
home=None
def sealed(path):
@@ -263,7 +263,7 @@ export async function runWorkspaceCommand(options: {
});
}
export function runSupervisedCommand(options: {
function runSupervisedCommand(options: {
args: string[];
input?: string;
environment?: Record<string, string>;
+1 -1
View File
@@ -7,7 +7,7 @@ import type { ProviderUsageEvent } from '../../ports/provider-usage.ts';
import { speechVoices } from '../../shared/speech.ts';
import { verifySpeechCache } from './cache.ts';
export interface LocalSpeechStatus {
interface LocalSpeechStatus {
state: 'not_downloaded' | 'downloading' | 'ready' | 'failed';
progress?: number;
}
+1 -1
View File
@@ -1,6 +1,6 @@
import type { ModelTrace, ModelTraceDelivery } from '../../ports/traces.ts';
export const traceBytes = 8 * 1024 * 1024;
const traceBytes = 8 * 1024 * 1024;
export function createN8nTraces(options: {
url?: string;
+18 -122
View File
@@ -1,17 +1,15 @@
import { SessionManager, type FileEntry } from '@earendil-works/pi-coding-agent';
import { existsSync, readdirSync, rmSync, statSync } from 'node:fs';
import { existsSync, statSync } from 'node:fs';
import { readFile, readdir, stat } from 'node:fs/promises';
import { join } from 'node:path';
import { threadIdentity } from '../../ports/thread-identity.ts';
import { audioEntries } from './audio.ts';
const maximum = 64 * 1024 * 1024;
export const rebaseAt = 8 * 1024 * 1024;
const rebaseAt = 8 * 1024 * 1024;
export const keptImages = 4;
export const removedImage =
'An earlier image was removed from context. Take a new screenshot or read the file again if you need it.';
export const removedCredential =
'An earlier saved login was removed from context. Use sign_in if you need to sign in again.';
const failure = () =>
new Error(
'The assistant session could not be saved. Stop and restore storage before continuing.',
@@ -74,84 +72,14 @@ export async function readPiSessionEntries(options: { threadId: string; sessionR
return entries(await readFile(latest.path)).slice(1);
}
function legacyCredential(message: { role: string; toolName?: string; content?: unknown }) {
return (
message.role === 'toolResult' &&
message.toolName === 'get_credential' &&
JSON.stringify(message.content) !== JSON.stringify([{ type: 'text', text: removedCredential }])
);
}
function holdsCredentials(manager: SessionManager) {
return manager
.getEntries()
.some((entry) => entry.type === 'message' && legacyCredential(entry.message));
}
function legacySecrets(context: ReturnType<SessionManager['getEntries']>) {
const values = new Set<string>();
for (const entry of context)
if (entry.type === 'message' && legacyCredential(entry.message))
for (const part of entry.message.role === 'toolResult' ? entry.message.content : [])
if (part.type === 'text')
try {
const credential = JSON.parse(part.text);
for (const value of [credential?.username, credential?.password])
if (typeof value === 'string' && value.length) {
values.add(value);
values.add(JSON.stringify(value).slice(1, -1));
}
} catch {}
return [...values].sort((a, b) => b.length - a.length);
}
function scrub<T>(value: T, secrets: string[]): T {
if (!secrets.length) return value;
if (typeof value === 'string')
return secrets.reduce((text, secret) => text.split(secret).join('[removed]'), value) as T;
if (Array.isArray(value)) return value.map((item) => scrub(item, secrets)) as T;
if (value && typeof value === 'object')
return Object.fromEntries(
Object.entries(value).map(([key, item]) => [key, scrub(item, secrets)]),
) as T;
return value;
}
export function openLocalSession(directory: string) {
let manager = SessionManager.continueRecent(directory, directory);
const manager = SessionManager.continueRecent(directory, directory);
const file = manager.getSessionFile();
if (!file || !existsSync(file)) return manager;
const retained = readdirSync(directory)
.filter((name) => name.endsWith('.jsonl'))
.map((name) => join(directory, name))
.filter((path) => path !== file && statSync(path).isFile());
const secrets = [
...new Set(
[
legacySecrets(manager.getEntries()),
...retained.map((path) => {
if (statSync(path).size > maximum) throw failure();
return legacySecrets(SessionManager.open(path).getEntries());
}),
].flat(),
),
].sort((a, b) => b.length - a.length);
const legacy = holdsCredentials(manager) || secrets.length > 0;
if (!legacy && statSync(file).size <= rebaseAt) return manager;
manager = rebaseSession(manager, SessionManager.create(directory, directory), secrets);
const current = manager.getSessionFile();
if (legacy && current && existsSync(current))
for (const name of readdirSync(directory))
if (name.endsWith('.jsonl') && join(directory, name) !== current)
rmSync(join(directory, name), { force: true });
return manager;
if (!file || !existsSync(file) || statSync(file).size <= rebaseAt) return manager;
return rebaseSession(manager, SessionManager.create(directory, directory));
}
export function rebaseSession(
source: SessionManager,
next: SessionManager,
secrets = legacySecrets(source.getEntries()),
) {
function rebaseSession(source: SessionManager, next: SessionManager) {
const context = source.buildContextEntries();
const audio = audioEntries(source);
const recordings = new Map(audio.map((entry) => [entry.id, entry]));
@@ -160,12 +88,7 @@ export function rebaseSession(
);
const current = new Set(context.map((entry) => entry.id));
const copyRecording = (entry: (typeof audio)[number]) =>
next.appendCustomMessageEntry(
entry.customType,
scrub(entry.content, secrets),
entry.display,
scrub(entry.details, secrets),
);
next.appendCustomMessageEntry(entry.customType, entry.content, entry.display, entry.details);
for (const entry of audio.slice(-2)) if (!current.has(entry.id)) copyRecording(entry);
let images = context.reduce(
(count, entry) =>
@@ -176,12 +99,7 @@ export function rebaseSession(
);
for (const entry of context) {
if (entry.type === 'compaction')
next.appendCompaction(
scrub(entry.summary, secrets),
null,
entry.tokensBefore,
scrub(entry.details, secrets),
);
next.appendCompaction(entry.summary, null, entry.tokensBefore, entry.details);
else if (entry.type === 'custom_message' && recordings.has(entry.id))
copyRecording(recordings.get(entry.id)!);
else if (entry.type === 'custom_message' && entry.customType === 'nod-audio-input') {
@@ -189,44 +107,22 @@ export function rebaseSession(
if (message.role === 'custom')
next.appendMessage({
role: 'user',
content: scrub(message.content, secrets),
content: message.content,
timestamp: message.timestamp,
});
} else if (entry.type === 'message') {
const message = entry.message;
next.appendMessage(
(legacyCredential(message)
? { ...message, content: [{ type: 'text' as const, text: removedCredential }] }
: {
('content' in message && typeof message.content !== 'string'
? {
...message,
...('details' in message ? { details: scrub(message.details, secrets) } : {}),
...(message.role === 'bashExecution'
? {
command: scrub(message.command, secrets),
output: scrub(message.output, secrets),
}
: {}),
...('content' in message
? {
content:
typeof message.content === 'string'
? scrub(message.content, secrets)
: message.content.map((part) =>
part.type === 'text'
? { ...part, text: scrub(part.text, secrets) }
: part.type === 'thinking'
? { ...part, thinking: scrub(part.thinking, secrets) }
: part.type === 'toolCall'
? { ...part, arguments: scrub(part.arguments, secrets) }
: part.type === 'image' &&
message.role === 'toolResult' &&
images-- > keptImages
? { type: 'text' as const, text: removedImage }
: part,
),
}
: {}),
}) as Parameters<typeof next.appendMessage>[0],
content: message.content.map((part) =>
part.type === 'image' && message.role === 'toolResult' && images-- > keptImages
? { type: 'text' as const, text: removedImage }
: part,
),
}
: message) as Parameters<typeof next.appendMessage>[0],
);
}
}
-1
View File
@@ -27,7 +27,6 @@ import { piModelTrace } from './traces.ts';
import type { ModelTraces } from '../../ports/traces.ts';
import type { ModelAccess } from '../../ports/models.ts';
import type { Agent } from '../../ports/agent.ts';
import type { WorkspaceSession } from '../../ports/computer.ts';
import { closeInterruptedCalls, keptImages, openLocalSession, removedImage } from './checkpoint.ts';
import { threadIdentity } from '../../ports/thread-identity.ts';
import { createPiUsageTracker, piUsageMetrics, usageId } from './usage.ts';
+6 -197
View File
@@ -2,13 +2,7 @@ import { request as httpRequest } from 'node:http';
import { request as httpsRequest } from 'node:https';
import { isIP } from 'node:net';
import { parse } from 'parse5';
import { getDomainWithoutSuffix as domainWithoutSuffix } from 'tldts';
import type {
LinkPreviewProvider,
PublicLinkMetadata,
SiteIcon,
} from '../../ports/link-preview.ts';
import { previewableUrl, publicMediaUrl } from '../../shared/link-preview.ts';
import type { LinkPreviewProvider, SiteIcon } from '../../ports/link-preview.ts';
import { publicUrl, type AddressResolver } from '../agent-browser/network.ts';
import { rasterImageType } from '../raster-image.ts';
@@ -104,147 +98,6 @@ export const requestPublicPreview: PreviewRequest = ({
request.end();
});
function clean(value: string | undefined, max: number) {
return (
value
?.replace(/[\u0000-\u001f\u007f]/g, ' ')
.replace(/\s+/g, ' ')
.trim()
.slice(0, max) || undefined
);
}
function siteTitle(title: string | undefined, url: string, siteName?: string) {
if (!title) return title;
const squash = (value: string) =>
value
.normalize('NFKD')
.toLowerCase()
.replace(/[^\p{L}\p{N}]/gu, '');
const sites = [siteName, domainWithoutSuffix(url)]
.map((value) => value && squash(value))
.filter(Boolean);
const matches = (value: string) => sites.includes(squash(value));
const end = /^(.*\S)\s*[:|\-–—]\s+(.+)$/.exec(title);
const trimmed = end && matches(end[2]) ? end[1] : title;
const start = /^(.+?)\s*[:|\-–—]\s+(\S.*)$/.exec(trimmed);
const result = start && matches(start[1]) ? start[2] : trimmed;
return matches(result) ? undefined : result;
}
function jsonLdImage(text: string): string | undefined {
try {
const stack: unknown[] = [JSON.parse(text)];
for (let steps = 0; stack.length && steps < 200; steps++) {
const value = stack.pop();
if (!value || typeof value !== 'object') continue;
if (Array.isArray(value)) {
stack.push(...value);
continue;
}
const record = value as Record<string, unknown>;
const image = Array.isArray(record.image) ? record.image[0] : record.image;
const source = image && typeof image === 'object' ? (image as Record<string, unknown>) : {};
const url = [image, source.contentUrl, source.url].find((value) => typeof value === 'string');
if (typeof url === 'string') return url;
if (record['@graph']) stack.push(record['@graph']);
}
} catch {}
return undefined;
}
export function parseLinkMetadata(html: string, url: string): PublicLinkMetadata | null {
const document = parse(html);
const head = document.childNodes.find((node) => node.nodeName === 'html');
const elements = head && 'childNodes' in head ? head.childNodes : [];
const container = elements.find((node) => node.nodeName === 'head');
const nodes = container && 'childNodes' in container ? container.childNodes : [];
const meta = new Map<string, string>();
const images: string[] = [];
let title = '';
for (const node of nodes) {
if (!('attrs' in node)) continue;
const attrs = new Map(node.attrs.map((attr) => [attr.name.toLowerCase(), attr.value]));
if (node.nodeName === 'meta') {
const key = (attrs.get('property') ?? attrs.get('name'))?.toLowerCase();
if (key && attrs.has('content') && !meta.has(key)) meta.set(key, attrs.get('content')!);
if (attrs.get('itemprop') === 'image' && attrs.get('content'))
images.push(attrs.get('content')!);
}
if (node.nodeName === 'link' && attrs.get('href')) {
const rel = (attrs.get('rel') ?? '').toLowerCase().split(/\s+/);
if (rel.includes('image_src')) images.push(attrs.get('href')!);
}
if (
node.nodeName === 'script' &&
attrs.get('type')?.toLowerCase() === 'application/ld+json' &&
'childNodes' in node
) {
const image = jsonLdImage(
node.childNodes.map((child) => ('value' in child ? child.value : '')).join(''),
);
if (image) images.push(image);
}
if (node.nodeName === 'title' && 'childNodes' in node)
title = node.childNodes.map((child) => ('value' in child ? child.value : '')).join('');
}
const published = [meta.get('og:title'), meta.get('twitter:title'), title]
.map((value) => clean(value, 200))
.find(Boolean);
const media = (value: string | undefined, secure = false) => {
try {
const resolved = value && publicMediaUrl(new URL(value, url).href);
return resolved && (!secure || resolved.startsWith('https:')) ? resolved : undefined;
} catch {
return undefined;
}
};
const image = [
meta.get('og:image:secure_url'),
meta.get('og:image'),
meta.get('og:image:url'),
meta.get('twitter:image'),
meta.get('twitter:image:src'),
...images,
]
.map((value) => media(value))
.find(Boolean);
const player =
media(meta.get('twitter:player'), true) ??
(meta.get('og:video:type')?.toLowerCase() === 'text/html'
? media(
meta.get('og:video:secure_url') ?? meta.get('og:video:url') ?? meta.get('og:video'),
true,
)
: undefined);
const siteName = clean(meta.get('og:site_name'), 100);
const resultTitle = siteTitle(published, url, siteName);
return {
url,
...(resultTitle ? { title: resultTitle } : {}),
description: clean(
meta.get('og:description') ?? meta.get('twitter:description') ?? meta.get('description'),
400,
),
siteName,
...(image ? { image } : {}),
...(player ? { player } : {}),
};
}
export function decodeHtml(body: Uint8Array, contentType = '') {
const start = Buffer.from(body.subarray(0, 2048)).toString('latin1');
const label =
/charset\s*=\s*["']?\s*([\w-]+)/i.exec(contentType)?.[1] ??
/<meta[^>]+charset\s*=\s*["']?\s*([\w-]+)/i.exec(start)?.[1] ??
'utf-8';
try {
return new TextDecoder(label).decode(body);
} catch {
return new TextDecoder().decode(body);
}
}
function iconUrl(value: string) {
if (value.length > 2048) return null;
try {
@@ -302,15 +155,14 @@ export function createPublicLinkPreviewProvider(
async function fetchPublic(
value: string,
maxBytes: number,
metadata = maxBytes < 1024 * 1024,
destination = previewableUrl,
signal = AbortSignal.timeout(Math.min(5000, options.timeoutMs ?? 5000)),
metadata: boolean,
signal: AbortSignal,
purpose?: 'icon',
) {
let current = value;
for (let redirects = 0; redirects <= 3; redirects++) {
signal.throwIfAborted();
const safe = destination(current);
const safe = iconUrl(current);
if (!safe) throw new Error('Preview destination is not supported.');
const resolved = await new Promise<Awaited<ReturnType<typeof publicUrl>>>(
(resolve, reject) => {
@@ -353,35 +205,10 @@ export function createPublicLinkPreviewProvider(
throw new Error('Too many preview redirects.');
}
return {
async metadata(url) {
try {
const result = await fetchPublic(url, 1024 * 1024, true);
if (
!/^(?:text\/html|application\/xhtml\+xml)(?:;|$)/i.test(
result.headers['content-type'] ?? '',
)
)
return null;
const metadata = parseLinkMetadata(
decodeHtml(result.body, result.headers['content-type']),
result.url,
);
if (!metadata?.player) return metadata;
const { player, ...rest } = metadata;
return (await publicUrl(player, options.resolver).then(
() => true,
() => false,
))
? metadata
: rest;
} catch {
return null;
}
},
async icon(origin) {
const signal = AbortSignal.timeout(Math.min(8000, options.timeoutMs ?? 8000));
const fetchIcon = async (url: string): Promise<SiteIcon | null> => {
const result = await fetchPublic(url, 128 * 1024, false, iconUrl, signal, 'icon');
const result = await fetchPublic(url, 128 * 1024, false, signal, 'icon');
const mimeType = icoImage(result.body) ? 'image/x-icon' : rasterImageType(result.body);
return mimeType ? { bytes: result.body, mimeType } : null;
};
@@ -390,13 +217,7 @@ export function createPublicLinkPreviewProvider(
if (icon) return icon;
} catch {}
try {
const page = await fetchPublic(
new URL('/', origin).href,
256 * 1024,
true,
iconUrl,
signal,
);
const page = await fetchPublic(new URL('/', origin).href, 256 * 1024, true, signal);
if (
!/^(?:text\/html|application\/xhtml\+xml)(?:;|$)/i.test(
page.headers['content-type'] ?? '',
@@ -415,17 +236,5 @@ export function createPublicLinkPreviewProvider(
return null;
}
},
async image(url) {
try {
const result = await fetchPublic(url, 5 * 1024 * 1024, false, publicMediaUrl);
const mimeType = rasterImageType(result.body);
const declared = result.headers['content-type']?.split(';')[0].trim().toLowerCase();
if (!mimeType || (declared === 'image/jpg' ? 'image/jpeg' : declared) !== mimeType)
return null;
return { bytes: result.body, mimeType };
} catch {
return null;
}
},
};
}
+1 -1
View File
@@ -1,6 +1,6 @@
import { crc32 } from 'node:zlib';
export interface RasterImage {
interface RasterImage {
bytes: Uint8Array;
mimeType: 'image/png' | 'image/jpeg' | 'image/webp';
}
-1
View File
@@ -36,7 +36,6 @@ import { connectedTools, nodTools } from './tools.ts';
import type { Turn } from './turn.ts';
import type { ExecutionScope } from '../shared/execution.ts';
import { delimit } from './untrusted.ts';
import type { Task } from '../shared/contracts.ts';
const imageBytes = (5 * 1024 * 1024 * 3) / 4;
const inlineChars = 40_000;
+3 -3
View File
@@ -80,7 +80,7 @@ function unionOfObjects(schema: TSchema) {
return members?.length && members.every((member) => member.properties) ? members : undefined;
}
export function rootObject<P extends TSchema>(schema: P): P {
function rootObject<P extends TSchema>(schema: P): P {
const members = unionOfObjects(schema);
if (!members) return schema;
const keys = [...new Set(members.flatMap((member) => Object.keys(member.properties)))];
@@ -124,7 +124,7 @@ function defineTool<const N extends string, P extends TSchema>(
return { name, description, parameters: rootObject(parameters), strict: parameters, eager };
}
export const scheduleObservation = Type.Union([
const scheduleObservation = Type.Union([
Type.Object(
{
status: Type.Literal('verified'),
@@ -625,7 +625,7 @@ export const toolDefinitions = {
),
};
export interface NodTool<P extends TSchema = TSchema> {
interface NodTool<P extends TSchema = TSchema> {
name: string;
description: string;
parameters: P;
-4
View File
@@ -2,10 +2,6 @@ import type { AgentToolResult } from '../ports/agent.ts';
import { neutralised, untrustedParts } from '../shared/untrusted.ts';
import { localResultTimes } from './time-context.ts';
export function resultText(result: AgentToolResult) {
return result.content.map((part) => (part.type === 'text' ? part.text : '')).join('\n');
}
export function delimit(
source: string,
result: AgentToolResult,
+1 -3
View File
@@ -71,7 +71,6 @@ export function registerLocalAccess(
'/onboarding',
'/connected.html',
'/channels',
'/you',
'/settings',
'/settings/models',
'/settings/apps',
@@ -115,8 +114,7 @@ export function registerLocalAccess(
}
const pageNavigation =
request.method === 'GET' &&
(pages.has(path) ||
/^\/(vault|credentials|payments|browser-connect)\/[A-Za-z0-9_-]+\/?$/.test(path)) &&
(pages.has(path) || /^\/(vault|credentials|payments)\/[A-Za-z0-9_-]+\/?$/.test(path)) &&
request.headers['sec-fetch-mode'] === 'navigate' &&
request.headers['sec-fetch-dest'] === 'document';
const state = new URLSearchParams(request.url.split('?')[1]).getAll('state');
+1 -2
View File
@@ -47,8 +47,7 @@ export function createAccountStore(database: Pool): AccountStore & {
);
ALTER TABLE account_settings ADD COLUMN IF NOT EXISTS usage_data boolean NOT NULL DEFAULT false;
ALTER TABLE account_settings ADD COLUMN IF NOT EXISTS usage_data_revision bigint NOT NULL DEFAULT 0;
ALTER TABLE account_settings ADD COLUMN IF NOT EXISTS traces boolean NOT NULL DEFAULT false;
ALTER TABLE account_settings DROP COLUMN IF EXISTS display_name`);
ALTER TABLE account_settings ADD COLUMN IF NOT EXISTS traces boolean NOT NULL DEFAULT false`);
},
async readConsent(ownerId) {
const result = await database.query<{ enabled: boolean; revision: string }>(
+1 -1
View File
@@ -5,7 +5,7 @@ type ConnectionProperties = Extract<
AnalyticsEvent,
{ event: 'nod_connection_changed' }
>['properties'];
export type ServiceFailureReason = NonNullable<
type ServiceFailureReason = NonNullable<
Extract<AnalyticsEvent, { event: 'nod_service_used' }>['properties']['failure_reason']
>;
export type AnalyticsConnection = {
+2 -10
View File
@@ -13,7 +13,7 @@ const domain = z
/^(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[a-z]{2,63}|xn--[a-z0-9](?:[a-z0-9-]{0,57}[a-z0-9])?)$/,
);
export const serviceFailureReason = z.enum([
const serviceFailureReason = z.enum([
'authentication',
'permission',
'rate_limited',
@@ -113,15 +113,7 @@ export const analyticsEvent = z.discriminatedUnion('event', [
event: z.literal('nod_settings_updated'),
properties: z
.object({
section: z.enum([
'account',
'preferences',
'channels',
'models',
'trust',
'memory',
'apps',
]),
section: z.enum(['account', 'preferences', 'channels', 'models', 'trust', 'memory']),
operation: z.enum(['update', 'connect_started', 'disconnect']),
channel: z.enum(['telegram', 'whatsapp']).optional(),
})
+1 -1
View File
@@ -92,7 +92,7 @@ export function analyticsModel(provider: string, model?: string) {
};
}
export type TurnModel = { model_provider: z.infer<typeof analyticsModelProvider>; model?: string };
type TurnModel = { model_provider: z.infer<typeof analyticsModelProvider>; model?: string };
function turnModel(provider: TurnModel['model_provider'], model?: string): TurnModel {
return { model_provider: provider, ...(model ? { model } : {}) };
+10 -20
View File
@@ -51,10 +51,7 @@ import { messagePreview } from './message-preview.ts';
const messageFields = `m.id,m.role,m.text,m.audio_caption AS "audioCaption",m.turn_id AS "turnId",m.created_at AS "createdAt",m.attachments,m.stream_id AS "streamId",m.reaction,m.assistant_reaction AS "assistantReaction",m.reply_to_message_id AS "replyToMessageId",m.suggestions,m.presentation,
CASE WHEN target.id IS NULL THEN NULL ELSE json_build_object('id',target.id,'role',target.role,'text',COALESCE(m.reply_quote,''),'isQuote',m.reply_quote IS NOT NULL) END AS "replyTo"`;
function messageView(
row: Message & { assistantReaction?: MessageReaction | null },
questionState?: Message['questionState'],
): Message {
function messageView(row: Message & { assistantReaction?: MessageReaction | null }): Message {
const { assistantReaction, presentation, audioCaption, ...message } = row;
const visual =
message.role === 'assistant' ? presentationSchema.safeParse(presentation) : undefined;
@@ -62,7 +59,6 @@ function messageView(
...message,
...(typeof audioCaption === 'string' ? { audioCaption } : {}),
...(visual?.success ? { presentation: visual.data } : {}),
...(questionState ? { questionState } : {}),
reactions: [
...(message.reaction ? [{ actor: 'user' as const, reaction: message.reaction }] : []),
...(assistantReaction ? [{ actor: 'assistant' as const, reaction: assistantReaction }] : []),
@@ -89,7 +85,6 @@ export interface AppDependencies {
taskLedger?: () => Promise<import('../shared/contracts.ts').Task[]>;
activity?: () => Promise<Activity[]>;
planningTasks?: () => boolean;
questionStates?: (messageIds: string[]) => Promise<Record<string, Message['questionState']>>;
}
export async function createApp(dependencies: AppDependencies = {}) {
@@ -103,15 +98,12 @@ export async function createApp(dependencies: AppDependencies = {}) {
rows.flatMap((row) => (row.replyTo && !row.replyTo.isQuote ? [row.replyTo.id] : [])),
),
];
const [questions, targets] = await Promise.all([
dependencies.questionStates?.(rows.map((message) => message.id)).catch(() => undefined),
replyIds.length
? pool.query<{ id: string; text: string }>(
'SELECT id,COALESCE(audio_caption,text) AS text FROM messages WHERE owner_id=$1 AND id=ANY($2::uuid[])',
[ownerId, replyIds],
)
: { rows: [] },
]);
const targets = replyIds.length
? await pool.query<{ id: string; text: string }>(
'SELECT id,COALESCE(audio_caption,text) AS text FROM messages WHERE owner_id=$1 AND id=ANY($2::uuid[])',
[ownerId, replyIds],
)
: { rows: [] };
const previews = new Map(
targets.rows.map((target) => [target.id, messagePreview(target.text)]),
);
@@ -123,7 +115,6 @@ export async function createApp(dependencies: AppDependencies = {}) {
replyTo: { ...message.replyTo, text: previews.get(message.replyTo.id) ?? '' },
}
: message,
questions?.[message.id],
),
);
}
@@ -181,8 +172,7 @@ export async function createApp(dependencies: AppDependencies = {}) {
const audioMessages = registerAudioMessages(app, dependencies);
app.get('/api/health', async () => {
await pool.query('SELECT 1');
const release = process.env.NOD_IMAGE_RELEASE || process.env.NOD_RELEASE;
return { ok: true, ...(release ? { release } : {}) };
return { ok: true };
});
if (desktopAccess)
app.get('/api/desktop/status', async () => {
@@ -295,7 +285,7 @@ export async function createApp(dependencies: AppDependencies = {}) {
hasMore: rows.rows.length > 60,
} satisfies MessageHistoryPage;
});
app.post<{ Params: { id: string } }>('/api/messages/:id/reaction', async (request, reply) => {
app.post<{ Params: { id: string } }>('/api/messages/:id/reaction', async (request) => {
const { reaction } = z
.object({ reaction: z.string().max(64).refine(isMessageReaction).nullable() })
.strict()
@@ -368,7 +358,7 @@ export async function createApp(dependencies: AppDependencies = {}) {
return { ok: true };
}),
);
app.get('/api/events', async (request, reply) => {
app.get('/api/events', async (_request, reply) => {
reply.hijack();
streams.add(reply.raw);
reply.raw.writeHead(200, {
+2 -16
View File
@@ -201,8 +201,7 @@ export async function createApprovals(
result jsonb
);
ALTER TABLE approvals ADD COLUMN IF NOT EXISTS created_at timestamptz NOT NULL DEFAULT now(),
ADD COLUMN IF NOT EXISTS expected_revision integer,
DROP COLUMN IF EXISTS expires_at, DROP COLUMN IF EXISTS confirmation_reply_id;
ADD COLUMN IF NOT EXISTS expected_revision integer;
CREATE INDEX IF NOT EXISTS approvals_turn ON approvals(turn_id);
CREATE INDEX IF NOT EXISTS approvals_execution_turn ON approvals(execution_turn_id);
CREATE INDEX IF NOT EXISTS approvals_confirmation_message ON approvals(confirmation_message_id);
@@ -604,18 +603,5 @@ export async function createApprovals(
};
}
async function states(messageIds: string[]) {
if (!messageIds.length) return {};
const { rows } = await pool.query<{
id: string;
status:
'pending' | 'confirmed' | 'executing' | 'completed' | 'uncertain' | 'declined' | 'expired';
}>(
'SELECT confirmation_message_id AS id,status FROM approvals WHERE owner_id=$1 AND confirmation_message_id=ANY($2::uuid[])',
[ownerId, messageIds],
);
return Object.fromEntries(rows.map((row) => [row.id, row.status]));
}
return { request, chat: { answer: answerChat, accept: acceptChat }, executeConfirmed, states };
return { request, chat: { answer: answerChat, accept: acceptChat }, executeConfirmed };
}
-1
View File
@@ -492,4 +492,3 @@ export const localArtifacts = createArtifactService({
ownerId,
localRoot: dataRoot,
});
export const { storeArtifact, publishArtifact, readThreadArtifacts } = localArtifacts;
-1
View File
@@ -49,7 +49,6 @@ const tools = [
'create_audio',
'delegate',
'follow_up',
'get_credential',
'manage_apps',
'manage_personal_context',
'pay',
+2 -2
View File
@@ -139,7 +139,7 @@ type ChannelSettingsRow = {
summary: ChannelSetupSummary;
};
export async function initializeChannelSettings(pool: Pick<Pool, 'query'>) {
async function initializeChannelSettings(pool: Pick<Pool, 'query'>) {
await pool.query(
`CREATE TABLE IF NOT EXISTS channel_settings(owner_id text NOT NULL,provider text NOT NULL,enabled boolean NOT NULL,ciphertext text,summary jsonb NOT NULL,updated_at timestamptz NOT NULL DEFAULT now(),PRIMARY KEY(owner_id,provider))`,
);
@@ -258,7 +258,7 @@ function issuePairing(summary: ChannelSetupSummary) {
pairingUrl: `https://t.me/${handle.slice(1)}?start=${code}`,
};
}
export function openChannelSettings(key: Buffer, owner: string, row: ChannelSettingsRow) {
function openChannelSettings(key: Buffer, owner: string, row: ChannelSettingsRow) {
const result = z
.record(z.string(), z.string().max(8192))
.parse(JSON.parse(openVaultValue(key, binding(owner, row.provider), row.ciphertext!)));
-5
View File
@@ -339,11 +339,6 @@ export async function createChannels(pool: Pool, options: ChannelOptions) {
CREATE INDEX IF NOT EXISTS channel_outbox_pending ON channel_outbox(state,created_at);
CREATE INDEX IF NOT EXISTS channel_inbox_turn ON channel_inbox(turn_id);
CREATE INDEX IF NOT EXISTS channel_inbox_channel ON channel_inbox(owner_id,channel,state,received_at DESC)`);
await pool.query(
`UPDATE messages m SET delivered_channel=i.channel FROM channel_outbox o JOIN channel_inbox i ON i.source_id=o.source_id
WHERE m.id=o.message_id AND m.owner_id=$1 AND i.owner_id=$1 AND m.turn_id IS NULL AND m.delivered_channel IS NULL AND o.state='sent'`,
[ownerId],
);
await pool.query(
`UPDATE channel_outbox o SET
state=CASE WHEN o.state='sending' THEN 'uncertain' ELSE 'pending' END,
+10 -33
View File
@@ -35,7 +35,7 @@ import {
} from '../ports/computer.ts';
import { fileBytes } from '../shared/files.ts';
import type { ObservationProvider, ObservationSource } from '../ports/proactivity.ts';
import type { IntegrationProvider, IntegrationService } from '../ports/integrations.ts';
import type { IntegrationProvider } from '../ports/integrations.ts';
import { hasWorkspaceFiles, saveIntegrationFiles } from './integration-files.ts';
import { privateEmailResult } from './integration-result.ts';
import { createMailCheck } from './mail-check.ts';
@@ -76,10 +76,7 @@ import { createDiscoveredOAuth } from '../providers/discovered/oauth.ts';
import { createDiscoveredConnections } from './discovered-connections.ts';
import { createAppGrantVault } from './vault-app-grants.ts';
import { createDockerWorkspace } from '../providers/docker/index.ts';
import {
createEnvironmentKeyStore,
parseCredentialKey,
} from '../providers/environment/key-store.ts';
import { createEnvironmentKeyStore } from '../providers/environment/key-store.ts';
import { createKeychainKeyStore } from '../providers/keychain/key-store.ts';
import { createFilesystemKeyStore } from '../providers/filesystem/key-store.ts';
import { createOpenAISpeechProvider } from '../providers/openai/speech.ts';
@@ -130,11 +127,7 @@ import type { TrustBasis } from './trust-basis.ts';
import { localArtifacts } from './artifacts.ts';
import { memoryFileName, memoryMarkdown } from '../shared/memory-export.ts';
import { createChannels } from './channels.ts';
import {
createChannelSettings,
initializeChannelSettings,
managedChannelEnvironment,
} from './channel-settings.ts';
import { createChannelSettings, managedChannelEnvironment } from './channel-settings.ts';
import { createChannelMedia } from './channel-media.ts';
import { createChannelSessionStore } from './channel-session.ts';
import { configuration, dataRoot, desktopMode, ownerId, publicOrigin } from './config.ts';
@@ -145,9 +138,9 @@ import { createAccountSession } from './account.ts';
import { connectedGmail } from '../shared/onboarding.ts';
import { createPostgresObjectStore } from './object-storage.ts';
import { loadPrivacyNoticeFile, registerPrivacyNotice } from './privacy.ts';
import { createPool, initializeDatabase, pool } from './db.ts';
import { initializeDatabase, pool } from './db.ts';
import { events, refresh } from './events.ts';
import { createIntegrations, initializeIntegrationSchema } from './integrations.ts';
import { createIntegrations } from './integrations.ts';
import {
createErrorRedactor,
createRedactor,
@@ -160,7 +153,6 @@ import { buildFeedbackReport, type FeedbackReportOptions } from './bug-report.ts
import { registerFeedback } from './feedback.ts';
import { feedbackContext } from './feedback-context.ts';
import { createPersonalService } from './personal.ts';
import { createOnboardingInterview } from './onboarding-interview.ts';
import { createOnboardingSuggestions } from './onboarding-suggestions.ts';
import { createMemoryLearning, initializeMemoryLearning } from './memory-learning.ts';
import { createMemoryService, importMemoryFile } from './memory.ts';
@@ -183,7 +175,6 @@ import {
withTurnLock,
type TurnRef,
} from './thread.ts';
import { browserOf } from './turn-chain.ts';
import type { VaultActivityReason } from '../shared/contracts.ts';
import { createTriage, getPreferences } from './triage.ts';
import { createTasks } from './tasks.ts';
@@ -192,7 +183,7 @@ import { checkedKeyStore, createVault, credentialOrigin, sealedDataExists } from
import { createVaultAccess } from './vault-access.ts';
import { createPayments } from './payments.ts';
import { createBrowserConnections } from './browser-connections.ts';
import { cachedIcons, createLinkPreviews } from './link-previews.ts';
import { cachedIcons, registerLinkOpened } from './link-previews.ts';
export interface ApplicationAdapters {
analytics?: ProductAnalytics;
initialize?(): Promise<void>;
@@ -628,8 +619,7 @@ async function initializeApplication(
environment: analyticsEnvironment(process.env),
dataRoot,
installationId: process.env.NOD_ANALYTICS_ID,
appVersion:
process.env.NOD_APP_VERSION || process.env.NOD_IMAGE_RELEASE || process.env.NOD_RELEASE,
appVersion: process.env.NOD_APP_VERSION,
});
let observeConnections: ((only?: 'apps' | 'models') => Promise<void>) | undefined;
const feedbackActivity = createFeedbackActivity('runtime');
@@ -941,9 +931,8 @@ async function initializeApplication(
let vaultAccess!: Awaited<ReturnType<typeof createVaultAccess>>;
let payments!: Awaited<ReturnType<typeof createPayments>>;
let browserConnections!: Awaited<ReturnType<typeof createBrowserConnections>>;
const icon = adapters.linkPreviews?.icon
? cachedIcons((origin) => adapters.linkPreviews!.icon!(origin))
: undefined;
const previews = adapters.linkPreviews;
const icon = previews ? cachedIcons((origin) => previews.icon(origin)) : undefined;
const integrations = await createIntegrations(pool, {
mailCheck,
analytics: captureAnalytics,
@@ -1922,7 +1911,6 @@ async function initializeApplication(
taskLedger: tasks.read,
activity: activity.current,
planningTasks: onboardingSuggestions.planning,
questionStates: approvals.states,
computer,
configuration: () =>
configuration({
@@ -1993,24 +1981,13 @@ async function initializeApplication(
local: adapters.localSpeech,
inputFormat: adapters.speechInputFormat,
});
if (adapters.linkPreviews) {
const previews = adapters.linkPreviews;
createLinkPreviews({
metadata: (url) => previews.metadata(url),
image: (url) => previews.image(url),
}).registerRoutes(app);
}
registerLinkOpened(app);
vault.registerRoutes(app);
payments.registerRoutes(app);
vaultAccess.registerRoutes(app);
browserConnections.registerRoutes(app);
integrations.registerRoutes(app);
personal.registerRoutes(app);
createOnboardingInterview({
ownerId,
pool,
keyStore: adapters.keyStore,
}).registerRoutes(app);
onboardingSuggestions.registerRoutes(app);
tasks.registerRoutes(app);
triage.registerRoutes(app);
+1 -1
View File
@@ -24,7 +24,7 @@ if (
(process.env.NOD_WEB_ROOT !== undefined && !isAbsolute(process.env.NOD_WEB_ROOT)))
)
throw new Error('Desktop runtime configuration is incomplete.');
export const runtimeEnvironment = process.env.NOD_ENVIRONMENT || 'development';
const runtimeEnvironment = process.env.NOD_ENVIRONMENT || 'development';
export function configuration(overrides: Partial<Configuration> = {}): Configuration {
return {
provider: 'unconfigured',
+3 -41
View File
@@ -11,7 +11,7 @@ function poolSize(value: string | undefined, fallback: number) {
return size;
}
export function createPool(config: pg.PoolConfig) {
function createPool(config: pg.PoolConfig) {
const created = new pg.Pool({
connectionString: databaseUrl,
connectionTimeoutMillis: 10_000,
@@ -33,25 +33,16 @@ export async function initializeDatabase() {
created_at timestamptz NOT NULL DEFAULT now(), updated_at timestamptz NOT NULL DEFAULT now(),
archived_at timestamptz
);
ALTER TABLE threads DROP COLUMN IF EXISTS status;
CREATE UNIQUE INDEX IF NOT EXISTS threads_active_owner ON threads(owner_id) WHERE archived_at IS NULL;
ALTER TABLE threads ADD COLUMN IF NOT EXISTS observer_session_id uuid NOT NULL DEFAULT gen_random_uuid();
CREATE TABLE IF NOT EXISTS turns (
id uuid PRIMARY KEY, owner_id text NOT NULL, thread_id uuid NOT NULL REFERENCES threads(id),
source text NOT NULL, source_id text, message_id uuid, prompt text NOT NULL,
session_id uuid NOT NULL, source text NOT NULL, source_id text, message_id uuid, prompt text NOT NULL,
channel text NOT NULL DEFAULT 'web', channel_source_id text, status text NOT NULL DEFAULT 'queued', waiting_reason text,
background boolean NOT NULL DEFAULT false, error text,
created_at timestamptz NOT NULL DEFAULT now(), started_at timestamptz, finished_at timestamptz
);
ALTER TABLE turns ADD COLUMN IF NOT EXISTS channel_source_id text;
DO $$ BEGIN
IF NOT EXISTS (SELECT 1 FROM information_schema.columns
WHERE table_schema=current_schema() AND table_name='turns' AND column_name='session_id') THEN
ALTER TABLE turns ADD COLUMN session_id uuid;
UPDATE turns SET session_id=CASE WHEN background THEN id ELSE thread_id END;
ALTER TABLE turns ALTER COLUMN session_id SET NOT NULL;
END IF;
END $$;
ALTER TABLE turns ADD COLUMN IF NOT EXISTS parent_turn_id uuid;
ALTER TABLE turns ADD COLUMN IF NOT EXISTS proactive boolean NOT NULL DEFAULT false;
ALTER TABLE turns ADD COLUMN IF NOT EXISTS start_after timestamptz;
@@ -62,14 +53,6 @@ export async function initializeDatabase() {
DROP TRIGGER IF EXISTS turns_session ON turns;
CREATE TRIGGER turns_session BEFORE INSERT ON turns FOR EACH ROW EXECUTE FUNCTION turns_session();
CREATE INDEX IF NOT EXISTS turns_session_queue ON turns(session_id,status);
DO $$ BEGIN
IF EXISTS (SELECT 1 FROM information_schema.columns
WHERE table_schema=current_schema() AND table_name='turns' AND column_name='read_only') THEN
UPDATE turns SET status='cancelled',finished_at=now()
WHERE (read_only OR source_id LIKE 'onboarding:%') AND status IN ('queued','running','waiting');
ALTER TABLE turns DROP COLUMN read_only;
END IF;
END $$;
CREATE UNIQUE INDEX IF NOT EXISTS turns_owner_source ON turns(owner_id,source_id) WHERE source_id IS NOT NULL;
CREATE INDEX IF NOT EXISTS turns_thread_queue ON turns(thread_id,status,created_at,id);
CREATE INDEX IF NOT EXISTS turns_owner_time ON turns(owner_id,created_at,id);
@@ -117,25 +100,13 @@ export async function initializeDatabase() {
);
ALTER TABLE preferences ADD COLUMN IF NOT EXISTS rules text NOT NULL DEFAULT '';
ALTER TABLE preferences ADD COLUMN IF NOT EXISTS speech_voice text;
ALTER TABLE preferences ADD COLUMN IF NOT EXISTS speech_reply text NOT NULL DEFAULT 'auto';
ALTER TABLE preferences DROP CONSTRAINT IF EXISTS preferences_speech_reply_check;
ALTER TABLE preferences ADD CONSTRAINT preferences_speech_reply_check CHECK (speech_reply IN ('auto','voice','always','never'));
ALTER TABLE preferences ALTER COLUMN speech_reply SET DEFAULT 'auto';
ALTER TABLE preferences ADD COLUMN IF NOT EXISTS speech_reply text NOT NULL DEFAULT 'auto' CHECK (speech_reply IN ('auto','voice','always','never'));
ALTER TABLE preferences ADD COLUMN IF NOT EXISTS proactive_paused boolean NOT NULL DEFAULT false;
DO $$ BEGIN
IF EXISTS (SELECT 1 FROM pg_attribute WHERE attrelid='preferences'::regclass AND attname='time_zone' AND attnotnull) THEN
ALTER TABLE preferences ALTER COLUMN time_zone DROP NOT NULL, ALTER COLUMN time_zone DROP DEFAULT;
UPDATE preferences SET time_zone=NULL WHERE time_zone='Europe/Lisbon';
END IF;
END $$;
DROP TABLE IF EXISTS notifications, app_activity_checks;
CREATE INDEX IF NOT EXISTS messages_owner_time ON messages(owner_id,created_at);
CREATE INDEX IF NOT EXISTS messages_thread_time ON messages(thread_id,created_at);
CREATE INDEX IF NOT EXISTS messages_turn_time ON messages(turn_id,created_at);
CREATE INDEX IF NOT EXISTS messages_attachments ON messages USING gin (attachments jsonb_path_ops);
CREATE INDEX IF NOT EXISTS messages_text_search ON messages USING gin (to_tsvector('english',text));
DROP TABLE IF EXISTS inspector_records;
DROP TABLE IF EXISTS inspector_prompts;
`);
await pool.query(
`UPDATE turns SET status='cancelled',finished_at=now()
@@ -162,13 +133,4 @@ export async function initializeDatabase() {
[ownerId],
);
}, pool);
await pool.query(
"UPDATE preferences SET notification_rule='' WHERE notification_rule=ANY($1::text[])",
[
[
'Only interrupt me for a time-sensitive message that needs my reply, a meaningful calendar change affecting me, or a concrete next step on something I asked you to follow up. Keep newsletters, routine updates, uncertain relevance and repeated reminders quiet.',
'Only interrupt me for a time-sensitive message that needs my reply, a meaningful calendar change affecting me, or a concrete next step for an active goal. Keep newsletters, routine updates, uncertain relevance and repeated reminders quiet.',
],
],
);
}
+2 -3
View File
@@ -266,12 +266,11 @@ export async function createDiscoveredConnections(
account_name text,oauth_state_hash text,
expires_at timestamptz NOT NULL DEFAULT now()+interval '15 minutes'
);
ALTER TABLE discovered_connections DROP COLUMN IF EXISTS ciphertext,
ADD COLUMN IF NOT EXISTS account_id uuid NOT NULL DEFAULT gen_random_uuid(),
ALTER TABLE discovered_connections ADD COLUMN IF NOT EXISTS account_id uuid NOT NULL DEFAULT gen_random_uuid(),
ADD COLUMN IF NOT EXISTS reconnect_required boolean NOT NULL DEFAULT false,
ADD COLUMN IF NOT EXISTS replaced_at timestamptz;
ALTER TABLE discovered_connection_proposals ADD COLUMN IF NOT EXISTS oauth_status text,
ADD COLUMN IF NOT EXISTS link_hash text, DROP COLUMN IF EXISTS thread_id,
ADD COLUMN IF NOT EXISTS link_hash text,
ADD COLUMN IF NOT EXISTS callback_return_to text,
ADD COLUMN IF NOT EXISTS created_at timestamptz NOT NULL DEFAULT now();
`);
+1 -1
View File
@@ -32,7 +32,7 @@ export async function feedbackContext(options: {
const execute = promisify(childProcess.execFile);
const { environment } = options;
const development = environment.NODE_ENV !== 'production';
let appRelease = environment.NOD_IMAGE_RELEASE || environment.NOD_RELEASE || null;
let appRelease: string | null = null;
let appModified: boolean | null = null;
if (development) {
try {
+2 -2
View File
@@ -3,7 +3,7 @@ import { constants } from 'node:fs';
import { chmod, lstat, mkdir, open, rename, unlink } from 'node:fs/promises';
import { join } from 'node:path';
export interface FeedbackLogScope {
interface FeedbackLogScope {
turnId?: string;
sessionId?: string;
runId?: string;
@@ -28,7 +28,7 @@ export interface FeedbackLogSnapshot {
};
}
export interface FeedbackLog {
interface FeedbackLog {
record(event: string, data?: unknown, scope?: FeedbackLogScope): void;
snapshot(): Promise<FeedbackLogSnapshot>;
close(): Promise<void>;
+1 -10
View File
@@ -1,14 +1,5 @@
import { pool } from './db.ts';
import {
authToken,
dataRoot,
desktopMode,
host,
ownerId,
port,
publicOrigin,
webRoot,
} from './config.ts';
import { authToken, dataRoot, desktopMode, host, port, publicOrigin, webRoot } from './config.ts';
import { accessKey } from './access.ts';
import { createApplication, createDefaultAdapters } from './composition.ts';
+1 -1
View File
@@ -12,7 +12,7 @@ const browserKeySchema = z.object({
y: token,
});
export function renderIntegrationBrowser(
function renderIntegrationBrowser(
brokerOrigin: string,
nonce: string,
bridgeKey: string,
+1 -1
View File
@@ -5,7 +5,7 @@ import { IntegrationDownload, type IntegrationFile } from '../ports/integrations
const viewableImages = new Set(['image/png', 'image/jpeg', 'image/gif', 'image/webp']);
export const workspaceFileInput = z
const workspaceFileInput = z
.object({
workspaceFile: z.string().min(1).max(4096),
mimeType: z.string().regex(/^[a-zA-Z0-9!#$&^_.+-]+\/[a-zA-Z0-9!#$&^_.+-]+$/),
+2 -2
View File
@@ -1,6 +1,6 @@
import { parseFragment, type DefaultTreeAdapterTypes } from 'parse5';
export const appResultInlineChars = 40_000;
const appResultInlineChars = 40_000;
const emailContentFields = new Set([
'subject',
@@ -60,7 +60,7 @@ export type MailCheck = (
signal?: AbortSignal,
) => Promise<Array<boolean | undefined>>;
export const mailCheckChars = 8000;
const mailCheckChars = 8000;
export function mailCheckText(text: string) {
const parts: string[] = [];
+2 -13
View File
@@ -51,7 +51,6 @@ import {
} from './integration-files.ts';
import { fileBytes } from '../shared/files.ts';
import { IntegrationError, verifyIntegrationCompletion } from './integration-connection.ts';
export { IntegrationError } from './integration-connection.ts';
import {
normalizedEmail,
verificationCode,
@@ -200,7 +199,7 @@ function messageIdentity(data: Record<string, unknown>, field: 'message' | 'thre
return typeof value === 'string' && /^[a-zA-Z0-9_-]{1,200}$/.test(value) ? value : undefined;
}
export async function eventOverview(
async function eventOverview(
toolkit: string,
trigger: string,
data: Record<string, unknown>,
@@ -249,7 +248,6 @@ export async function initializeIntegrationSchema(pool: Pool) {
ALTER TABLE app_connections ADD COLUMN IF NOT EXISTS inbox_cursor text,
ADD COLUMN IF NOT EXISTS created_at timestamptz NOT NULL DEFAULT now(),
ADD COLUMN IF NOT EXISTS callback_verifier text,
DROP COLUMN IF EXISTS pairing_code,
ADD COLUMN IF NOT EXISTS callback_claim_id text,
ADD COLUMN IF NOT EXISTS configuration_id text,
ADD COLUMN IF NOT EXISTS setup_link_hash text,
@@ -267,16 +265,7 @@ export async function initializeIntegrationSchema(pool: Pool) {
INSERT INTO app_setup_links(owner_id,link_hash,slug)
SELECT owner_id,setup_link_hash,slug FROM app_connections WHERE setup_link_hash IS NOT NULL
ON CONFLICT DO NOTHING;
DO $$ BEGIN
IF to_regclass('direct_oauth_accounts') IS NOT NULL THEN
IF to_regclass('vault_app_grants') IS NOT NULL THEN
DELETE FROM vault_app_grants WHERE id IN (SELECT id FROM direct_oauth_accounts);
END IF;
DROP TABLE direct_oauth_accounts;
END IF;
END $$;
ALTER TABLE integration_events ADD COLUMN IF NOT EXISTS poll_connection_id uuid,
DROP COLUMN IF EXISTS intent;
ALTER TABLE integration_events ADD COLUMN IF NOT EXISTS poll_connection_id uuid;
`);
}
+1 -1
View File
@@ -18,7 +18,7 @@ const day = 24 * 60 * 60 * 1000;
const sensitiveTopics =
'health, religion, politics, sexuality, gender identity, ethnicity, immigration status or criminal history';
export const skillInput = z.discriminatedUnion('action', [
const skillInput = z.discriminatedUnion('action', [
z
.object({
action: z.literal('save'),
+2 -4
View File
@@ -9,7 +9,7 @@ import type { ProviderUsageEvent, UsageTelemetry } from '../ports/provider-usage
import type { MemoryCurator } from '../ports/memory-curator.ts';
import type { DecisionModel } from '../ports/decisions.ts';
import type { SpeechProvider } from '../ports/speech.ts';
import type { TrustAction, TrustEntry, TrustSource, TrustView } from '../shared/trust.ts';
import type { TrustAction, TrustEntry, TrustView } from '../shared/trust.ts';
import { becauseOf, type TrustBasis } from './trust-basis.ts';
import { actionTitle } from './action-presentation.ts';
import { formattingLocale, localeRegion, timeZoneRegion } from '../shared/date-locale.ts';
@@ -19,7 +19,7 @@ import { analyticsModel, type CaptureAnalytics } from './analytics.ts';
export const spendingLimitReached =
'Paused because this month’s spending limit was reached. Raise the limit in Usage to resume.';
export const defaultTaskUsd = 5;
const defaultTaskUsd = 5;
const usd = z
.number()
.min(1)
@@ -120,14 +120,12 @@ export function createLedger({
turn_id uuid NOT NULL REFERENCES turns(id) ON DELETE CASCADE,
action text NOT NULL, created_at timestamptz NOT NULL DEFAULT now()
);
ALTER TABLE app_actions DROP COLUMN IF EXISTS effect;
ALTER TABLE app_actions ADD COLUMN IF NOT EXISTS basis jsonb;
CREATE INDEX IF NOT EXISTS app_actions_owner_time ON app_actions(owner_id,created_at);
CREATE INDEX IF NOT EXISTS app_actions_turn ON app_actions(turn_id);
CREATE TABLE IF NOT EXISTS spending_limits (
owner_id text PRIMARY KEY, monthly_usd double precision CHECK (monthly_usd > 0)
);
ALTER TABLE spending_limits ALTER COLUMN monthly_usd DROP NOT NULL;
ALTER TABLE spending_limits ADD COLUMN IF NOT EXISTS task_usd double precision
DEFAULT ${defaultTaskUsd} CHECK (task_usd > 0);`);
}
Loaded 100 of 190 files, more files were not shown because too many files have changed in this diff. Show more