@nyte-ai/host 0.0.21 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/THIRD-PARTY-NOTICES.md +2 -38
- package/dist/chunks/{canvas-preview-w54ymtb3.js → canvas-preview-9e15hp6q.js} +1 -1
- package/dist/chunks/{canvas-preview-aq5j4p25.js → canvas-preview-d97wvref.js} +1 -1
- package/dist/chunks/{canvas-preview-55s0y68g.js → canvas-preview-gm0frf4b.js} +2 -2
- package/dist/chunks/{canvas-preview-y7kq0c8q.js → canvas-preview-w0mr5bkn.js} +148 -5
- package/dist/chunks/{canvas-preview-ycepb05s.js → canvas-preview-whfdhma6.js} +1 -1
- package/dist/src/durable-object.d.ts +1 -1
- package/dist/src/index.js +5 -5
- package/dist/src/listen-fetch.js +3 -3
- package/dist/src/listen.js +4 -4
- package/dist/src/open.js +5 -5
- package/dist/src/serve/binding.d.ts +1 -1
- package/dist/src/serve/binding.js +1 -1
- package/dist/src/serve/handler.js +2 -2
- package/package.json +18 -40
- package/src/durable-object.ts +1 -1
- package/src/open.ts +7 -1
- package/src/serve/binding.ts +3 -3
- package/src/usage-history.ts +0 -1
- package/dist/chunks/canvas-preview-2zdyh9ny.js +0 -26
- package/dist/chunks/canvas-preview-3a6tst4d.js +0 -36
- package/dist/chunks/canvas-preview-65xqjw7f.js +0 -20
- package/dist/chunks/canvas-preview-8hr08aeh.js +0 -166
- package/dist/chunks/canvas-preview-b3r1tna2.js +0 -81
- package/dist/src/deploy/cloudflare/worker.d.ts +0 -50
- package/dist/src/deploy/cloudflare/worker.js +0 -196
- package/dist/src/deploy/vercel/nitro.config.d.ts +0 -2
- package/dist/src/deploy/vercel/nitro.config.js +0 -30
- package/dist/src/deploy/vercel/server/routes/[...].d.ts +0 -2
- package/dist/src/deploy/vercel/server/routes/[...].js +0 -18
- package/dist/src/deploy/vercel/server/utils/host.d.ts +0 -13
- package/dist/src/deploy/vercel/server/utils/host.js +0 -7
- package/dist/src/deploy/vercel/server/utils/repair.d.ts +0 -1
- package/dist/src/deploy/vercel/server/utils/repair.js +0 -6
- package/dist/src/deploy/vercel/server/utils/step.d.ts +0 -10
- package/dist/src/deploy/vercel/server/utils/step.js +0 -6
- package/dist/src/deploy/vercel/server/workflows/drive.d.ts +0 -14
- package/dist/src/deploy/vercel/server/workflows/drive.js +0 -13
- package/src/deploy/cloudflare/README.md +0 -3
- package/src/deploy/cloudflare/worker.ts +0 -306
- package/src/deploy/cloudflare/wrangler.jsonc +0 -12
- package/src/deploy/vercel/README.md +0 -3
- package/src/deploy/vercel/nitro.config.ts +0 -29
- package/src/deploy/vercel/server/routes/[...].ts +0 -10
- package/src/deploy/vercel/server/utils/host.ts +0 -104
- package/src/deploy/vercel/server/utils/repair.ts +0 -35
- package/src/deploy/vercel/server/utils/step.ts +0 -25
- package/src/deploy/vercel/server/workflows/drive.ts +0 -46
- package/src/deploy/vercel/tsconfig.json +0 -9
- package/src/deploy/vercel/types/bun.d.ts +0 -2
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @nyte-ai/host
|
|
2
2
|
|
|
3
|
-
The Node and edge sides of a Nyte host, around the host `composeHost` builds in `@nyte-ai/core`: `listen` serves it over `node:http` or as a bare fetch handler, and `listenFetch` (`@nyte-ai/host/listen-fetch`, node-free) is that fetch handler for Workers, both through `src/serve`'s handler, which binds `@nyte-ai/protocol`'s table to the server port `composeHost` returns, with token, pairing and custom authentication, CORS, the `/.nyte/identity` and `/.nyte/describe` routes, and in-process driving when the kernel only admits; `sqliteStore` (`node:sqlite`), `postgresStore` (any `pg`-shaped pool) and `durableObjectStore` (`@nyte-ai/host/durable-object`, a Durable Object's SQLite) implement core's `Store`, each publish one transaction with its compare-and-set and log append; `localProvider` serves a folder on this machine, with files over `node:fs` versioned by content, `.gitignore`-aware scan, find, search (ripgrep, else a scan) and watch, processes over pipes or a pty (`@lydell/node-pty`, loaded on first use), git over its CLI, each file's patch sent as its unified diff text, and run snapshots kept as hidden git refs or a content-addressed tree walk; `chatOnlyProvider` and `sandboxProvider` (`@nyte-ai/host/providers`, node-free) serve a workspace with no files and one in a remote sandbox; `loadPluginFiles` and `pluginLoader` import the core plugins in `.nyte/plugins` directories
|
|
3
|
+
The Node and edge sides of a Nyte host, around the host `composeHost` builds in `@nyte-ai/core`: `listen` serves it over `node:http` or as a bare fetch handler, and `listenFetch` (`@nyte-ai/host/listen-fetch`, node-free) is that fetch handler for Workers, both through `src/serve`'s handler, which binds `@nyte-ai/protocol`'s table to the server port `composeHost` returns, with token, pairing and custom authentication, CORS, the `/.nyte/identity` and `/.nyte/describe` routes, and in-process driving when the kernel only admits; `sqliteStore` (`node:sqlite`), `postgresStore` (any `pg`-shaped pool) and `durableObjectStore` (`@nyte-ai/host/durable-object`, a Durable Object's SQLite) implement core's `Store`, each publish one transaction with its compare-and-set and log append; `localProvider` serves a folder on this machine, with files over `node:fs` versioned by content, `.gitignore`-aware scan, find, search (ripgrep, else a scan) and watch, processes over pipes or a pty (`@lydell/node-pty`, loaded on first use), git over its CLI, each file's patch sent as its unified diff text, and run snapshots kept as hidden git refs or a content-addressed tree walk; `chatOnlyProvider` and `sandboxProvider` (`@nyte-ai/host/providers`, node-free) serve a workspace with no files and one in a remote sandbox; and `loadPluginFiles` and `pluginLoader` import the core plugins in `.nyte/plugins` directories. Deployments built on these live in `packages/examples`: a Cloudflare Worker whose Durable Object runs one host from its alarm, and a Nitro app for Vercel whose heads run as workflows.
|
|
4
4
|
|
|
5
5
|
## Tests
|
|
6
6
|
|
|
7
|
-
`pnpm --dir packages/host test` runs every store against one conformance suite: sqlite, postgres over pglite, and the Durable Object store over a `node:sqlite` stand-in of its SQL storage (`test/do-sql-stub.ts`)
|
|
7
|
+
`pnpm --dir packages/host test` runs every store against one conformance suite: sqlite, postgres over pglite, and the Durable Object store over a `node:sqlite` stand-in of its SQL storage (`test/do-sql-stub.ts`). The Worker's alarm `pass` and `NyteHost` cold-start tests live with the Worker in `packages/examples/cloudflare`. Deferred (Part 2 §43i): running the Worker and the Durable Object store inside workerd, and checking that the Worker's import graph reaches no `node:*` module, until a package that already depends on `wrangler` takes them; host itself carries neither `miniflare` nor `esbuild`.
|
package/THIRD-PARTY-NOTICES.md
CHANGED
|
@@ -45,39 +45,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
45
45
|
SOFTWARE.
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
## pi-claude-code (`earendil-works/pi-claude-code`)
|
|
49
|
-
|
|
50
|
-
- Repository: https://github.com/earendil-works/pi-claude-code
|
|
51
|
-
- What: the Claude Code CLI provider, single-turn relay, transcript replay,
|
|
52
|
-
process reuse, and billing guards in `packages/plugin/examples/claude-code`
|
|
53
|
-
are adapted from commit `70abb65186592ca788b29b3db22c3160d629c41f`.
|
|
54
|
-
|
|
55
|
-
License: MIT, with the following notice:
|
|
56
|
-
|
|
57
|
-
```text
|
|
58
|
-
MIT License
|
|
59
|
-
|
|
60
|
-
Copyright (c) 2026 Armin Ronacher
|
|
61
|
-
|
|
62
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
63
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
64
|
-
in the Software without restriction, including without limitation the rights
|
|
65
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
66
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
67
|
-
furnished to do so, subject to the following conditions:
|
|
68
|
-
|
|
69
|
-
The above copyright notice and this permission notice shall be included in all
|
|
70
|
-
copies or substantial portions of the Software.
|
|
71
|
-
|
|
72
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
73
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
74
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
75
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
76
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
77
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
78
|
-
SOFTWARE.
|
|
79
|
-
```
|
|
80
|
-
|
|
81
48
|
## pi (`earendil-works/pi`)
|
|
82
49
|
|
|
83
50
|
- Repository: https://github.com/earendil-works/pi
|
|
@@ -345,8 +312,8 @@ Copyright 2025 OpenAI
|
|
|
345
312
|
front of the queue (`packages/tui/src/model/interactions.ts`) is its
|
|
346
313
|
`onEmptySubmit`. The rename
|
|
347
314
|
plugin's context construction, prompt, model fallback, and output cleanup
|
|
348
|
-
(`packages/plugin/
|
|
349
|
-
plugin set (`packages/plugin/
|
|
315
|
+
(`packages/plugin/src/rename.ts`) port OpenCode v2. The web-search
|
|
316
|
+
plugin set (`packages/plugin/src/web-search.ts`) ports its Exa, Firecrawl,
|
|
350
317
|
Parallel, and Tavily adapters, its stateless MCP `tools/call` transport and
|
|
351
318
|
response bounds, its result and error vocabulary, and its arrangement of one
|
|
352
319
|
plugin per provider from OpenCode v2.
|
|
@@ -429,9 +396,6 @@ SOFTWARE.
|
|
|
429
396
|
bypass, and connection tuning in `packages/host/src/sqlite*.ts` are adapted
|
|
430
397
|
from `bf8ffe81a63c82d3de5fbaa9991fd5f30034a452`.
|
|
431
398
|
- Homepage: https://t3.codes
|
|
432
|
-
- What: the demo desktop app (`packages/demo/desktop`) follows T3 Code's
|
|
433
|
-
control-surface shape — agents in a sidebar, a conversation workspace, a
|
|
434
|
-
shared composer, and settings behind a dialog.
|
|
435
399
|
|
|
436
400
|
License: MIT, with the following notice:
|
|
437
401
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/serve/binding.ts
|
|
2
2
|
import { isJson, SdkError } from "@nyte-ai/schema";
|
|
3
|
-
import { mapped, viewFrames } from "@nyte-ai/protocol";
|
|
3
|
+
import { mapped, sessionsFrames, viewFrames } from "@nyte-ai/protocol";
|
|
4
4
|
var LOGIN_LIFETIME = 10 * 60 * 1000;
|
|
5
5
|
var attempts = new WeakMap;
|
|
6
6
|
var holds = new WeakMap;
|
|
@@ -116,7 +116,7 @@ function bindConnection2(connection, options) {
|
|
|
116
116
|
"workspaces.inspect": ({ target }) => connection.workspaces.inspect(target),
|
|
117
117
|
"workspaces.add": ({ target, options }) => connection.workspaces.add(target, options),
|
|
118
118
|
"workspaces.forget": ({ id }) => connection.workspaces.forget(id),
|
|
119
|
-
"sessions.watch": async (input) => connection.sessions.watch(input),
|
|
119
|
+
"sessions.watch": async (input) => sessionsFrames(connection.sessions.watch(input)),
|
|
120
120
|
"sessions.start": async (input) => {
|
|
121
121
|
const { session, receipt } = await connection.sessions.start(input);
|
|
122
122
|
return { session: session.id, receipt: receipt.id, message: receipt.message };
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from "./canvas-preview-4e0pxa32.js";
|
|
22
22
|
import {
|
|
23
23
|
listen2
|
|
24
|
-
} from "./canvas-preview-
|
|
24
|
+
} from "./canvas-preview-whfdhma6.js";
|
|
25
25
|
import {
|
|
26
26
|
nodeImages2
|
|
27
27
|
} from "./canvas-preview-y5y6ghaw.js";
|
|
@@ -39,9 +39,6 @@ import {
|
|
|
39
39
|
storePath2,
|
|
40
40
|
sqliteStore2
|
|
41
41
|
} from "./canvas-preview-mstbvwz3.js";
|
|
42
|
-
import {
|
|
43
|
-
package_default
|
|
44
|
-
} from "./canvas-preview-8hr08aeh.js";
|
|
45
42
|
|
|
46
43
|
// src/open.ts
|
|
47
44
|
import { watch } from "node:fs";
|
|
@@ -70,6 +67,148 @@ import question from "@nyte-ai/plugin/core/question";
|
|
|
70
67
|
import rename from "@nyte-ai/plugin/core/rename";
|
|
71
68
|
import telemetry from "@nyte-ai/plugin/core/telemetry";
|
|
72
69
|
import webSearch from "@nyte-ai/plugin/core/web-search";
|
|
70
|
+
// package.json
|
|
71
|
+
var package_default = {
|
|
72
|
+
name: "@nyte-ai/host",
|
|
73
|
+
version: "0.0.24",
|
|
74
|
+
private: false,
|
|
75
|
+
license: "MIT",
|
|
76
|
+
repository: {
|
|
77
|
+
type: "git",
|
|
78
|
+
url: "git+https://github.com/interfaces-lab/nyte.git",
|
|
79
|
+
directory: "packages/host"
|
|
80
|
+
},
|
|
81
|
+
files: [
|
|
82
|
+
"dist",
|
|
83
|
+
"src",
|
|
84
|
+
"LICENSE",
|
|
85
|
+
"THIRD-PARTY-NOTICES.md"
|
|
86
|
+
],
|
|
87
|
+
type: "module",
|
|
88
|
+
exports: {
|
|
89
|
+
".": "./src/index.ts",
|
|
90
|
+
"./canvas-preview": "./src/canvas-preview.ts",
|
|
91
|
+
"./credentials": "./src/credentials.ts",
|
|
92
|
+
"./durable-object": "./src/durable-object.ts",
|
|
93
|
+
"./identity": "./src/identity.ts",
|
|
94
|
+
"./images": "./src/images/node.ts",
|
|
95
|
+
"./image-worker": "./src/images/worker.ts",
|
|
96
|
+
"./listen-fetch": "./src/listen-fetch.ts",
|
|
97
|
+
"./providers": "./src/providers.ts",
|
|
98
|
+
"./secrets": "./src/secrets.ts",
|
|
99
|
+
"./shell-env": "./src/shell-env.ts",
|
|
100
|
+
"./usage": "./src/usage.ts",
|
|
101
|
+
"./store-usage": "./src/store-usage.ts",
|
|
102
|
+
"./usage-service": "./src/usage-service.ts",
|
|
103
|
+
"./usage-scan": "./src/usage-scan.ts",
|
|
104
|
+
"./usage-worker": "./src/usage-worker.ts"
|
|
105
|
+
},
|
|
106
|
+
publishConfig: {
|
|
107
|
+
exports: {
|
|
108
|
+
".": {
|
|
109
|
+
types: "./dist/src/index.d.ts",
|
|
110
|
+
import: "./dist/src/index.js"
|
|
111
|
+
},
|
|
112
|
+
"./canvas-preview": {
|
|
113
|
+
types: "./dist/src/canvas-preview.d.ts",
|
|
114
|
+
import: "./dist/src/canvas-preview.js"
|
|
115
|
+
},
|
|
116
|
+
"./credentials": {
|
|
117
|
+
types: "./dist/src/credentials.d.ts",
|
|
118
|
+
import: "./dist/src/credentials.js"
|
|
119
|
+
},
|
|
120
|
+
"./durable-object": {
|
|
121
|
+
types: "./dist/src/durable-object.d.ts",
|
|
122
|
+
import: "./dist/src/durable-object.js"
|
|
123
|
+
},
|
|
124
|
+
"./identity": {
|
|
125
|
+
types: "./dist/src/identity.d.ts",
|
|
126
|
+
import: "./dist/src/identity.js"
|
|
127
|
+
},
|
|
128
|
+
"./images": {
|
|
129
|
+
types: "./dist/src/images/node.d.ts",
|
|
130
|
+
import: "./dist/src/images/node.js"
|
|
131
|
+
},
|
|
132
|
+
"./image-worker": {
|
|
133
|
+
types: "./dist/src/images/worker.d.ts",
|
|
134
|
+
import: "./dist/src/images/worker.js"
|
|
135
|
+
},
|
|
136
|
+
"./listen-fetch": {
|
|
137
|
+
types: "./dist/src/listen-fetch.d.ts",
|
|
138
|
+
import: "./dist/src/listen-fetch.js"
|
|
139
|
+
},
|
|
140
|
+
"./providers": {
|
|
141
|
+
types: "./dist/src/providers.d.ts",
|
|
142
|
+
import: "./dist/src/providers.js"
|
|
143
|
+
},
|
|
144
|
+
"./secrets": {
|
|
145
|
+
types: "./dist/src/secrets.d.ts",
|
|
146
|
+
import: "./dist/src/secrets.js"
|
|
147
|
+
},
|
|
148
|
+
"./shell-env": {
|
|
149
|
+
types: "./dist/src/shell-env.d.ts",
|
|
150
|
+
import: "./dist/src/shell-env.js"
|
|
151
|
+
},
|
|
152
|
+
"./usage": {
|
|
153
|
+
types: "./dist/src/usage.d.ts",
|
|
154
|
+
import: "./dist/src/usage.js"
|
|
155
|
+
},
|
|
156
|
+
"./store-usage": {
|
|
157
|
+
types: "./dist/src/store-usage.d.ts",
|
|
158
|
+
import: "./dist/src/store-usage.js"
|
|
159
|
+
},
|
|
160
|
+
"./usage-service": {
|
|
161
|
+
types: "./dist/src/usage-service.d.ts",
|
|
162
|
+
import: "./dist/src/usage-service.js"
|
|
163
|
+
},
|
|
164
|
+
"./usage-scan": {
|
|
165
|
+
types: "./dist/src/usage-scan.d.ts",
|
|
166
|
+
import: "./dist/src/usage-scan.js"
|
|
167
|
+
},
|
|
168
|
+
"./usage-worker": {
|
|
169
|
+
types: "./dist/src/usage-worker.d.ts",
|
|
170
|
+
import: "./dist/src/usage-worker.js"
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
access: "public",
|
|
174
|
+
provenance: true
|
|
175
|
+
},
|
|
176
|
+
scripts: {
|
|
177
|
+
clean: "rm -rf node_modules .turbo",
|
|
178
|
+
typecheck: "tsrs --noEmit",
|
|
179
|
+
test: "vitest --run",
|
|
180
|
+
"check:store": "node scripts/check-store.ts",
|
|
181
|
+
"build:package": "bun ../../scripts/sdk-packages.mjs build host"
|
|
182
|
+
},
|
|
183
|
+
dependencies: {
|
|
184
|
+
"@earendil-works/pi-mcp": "^1.3.0",
|
|
185
|
+
"@lydell/node-pty": "^1.2.0-beta.15",
|
|
186
|
+
"@nyte-ai/ai": "workspace:*",
|
|
187
|
+
"@nyte-ai/core": "workspace:*",
|
|
188
|
+
"@nyte-ai/plugin": "workspace:*",
|
|
189
|
+
"@nyte-ai/protocol": "workspace:*",
|
|
190
|
+
"@nyte-ai/schema": "workspace:*",
|
|
191
|
+
"@silvia-odwyer/photon": "^0.3.3",
|
|
192
|
+
fflate: "^0.8.3",
|
|
193
|
+
ignore: "^7.0.13",
|
|
194
|
+
pg: "^8.23.1",
|
|
195
|
+
typebox: "^1.4.2"
|
|
196
|
+
},
|
|
197
|
+
devDependencies: {
|
|
198
|
+
"@electric-sql/pglite": "^0.5.11",
|
|
199
|
+
"@nyte-ai/canvas": "workspace:*",
|
|
200
|
+
"@types/node": "^26.6.5",
|
|
201
|
+
"@types/pg": "^8.23.1",
|
|
202
|
+
"fast-check": "^4.10.2",
|
|
203
|
+
typescript: "6.0.3",
|
|
204
|
+
vitest: "^5.0.5"
|
|
205
|
+
},
|
|
206
|
+
engines: {
|
|
207
|
+
node: ">=26.4.0"
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
// src/open.ts
|
|
73
212
|
var RELOAD_DEBOUNCE_MS = 250;
|
|
74
213
|
var STORE_POLL_MS = 500;
|
|
75
214
|
async function openHost2(options) {
|
|
@@ -343,7 +482,11 @@ async function settingsSeed(home) {
|
|
|
343
482
|
return { seed: { settings, path }, issue: null };
|
|
344
483
|
}
|
|
345
484
|
function hostDescription() {
|
|
346
|
-
return {
|
|
485
|
+
return {
|
|
486
|
+
name: hostname(),
|
|
487
|
+
platform: process.platform,
|
|
488
|
+
version: typeof NYTE_BUILT_VERSION === "string" ? NYTE_BUILT_VERSION : package_default.version
|
|
489
|
+
};
|
|
347
490
|
}
|
|
348
491
|
function settingsPath(home) {
|
|
349
492
|
return join(home, ".nyte", "settings.json");
|
|
@@ -10,5 +10,5 @@ export type DurableObjectSql = {
|
|
|
10
10
|
};
|
|
11
11
|
transactionSync<T>(closure: () => T): T;
|
|
12
12
|
};
|
|
13
|
-
/** Returns a `Store` over a Durable Object's SQLite storage, node-free, with the sqlite store's tables, row helpers (`store-rows.ts`) and semantics (§41f): `objects(id TEXT PRIMARY KEY, body TEXT NULL, bytes BLOB NULL)`, `refs(name TEXT PRIMARY KEY, target TEXT NULL, revision TEXT NOT NULL)` and `log(session TEXT, seq INTEGER, at INTEGER, event TEXT, PRIMARY KEY (session, seq))`, brought to core's `STORE_VERSION` by `migrateStore` on first `open()`, each commit one `transactionSync` and no backup; the open rejects with `SdkError("unavailable")` for a store a newer Nyte migrated. `put` ids the value with core's `objectId` and stores its JSON once; `putBlob` buffers the stream, ids it with `blobId` and stores the bytes once as an `ArrayBuffer`; an object and a blob that share an id share the row, each column filled once; `blob` reads the bytes back with their size and a null mime; a body, blob or logged event past the Durable Object's 2 MB row limit throws `SdkError("invalid")` before anything is written (§42k). `refs.set` runs inside one `transactionSync` with no await between its reads and writes, first rejecting with `SdkError("unavailable")` when a newer Nyte has migrated the store, with `RefStore.set`'s semantics, each revision a random UUID, any throw inside rolling the whole batch back. `list(prefix)` reads the name range from `prefix` in name order; `log` returns the events after `after` in seq order up to `limit`, each validated as a `SessionEvent`; `tail` is the session's last seq, or 0. Every `open()` returns a connection over the one storage; `close()` releases nothing, the storage being the object's. In workerd, which allows code generation only while modules load, the Worker turns TypeBox acceleration off at startup (`Settings.Set({ useAcceleration: false })` from `typebox/system`, as `
|
|
13
|
+
/** Returns a `Store` over a Durable Object's SQLite storage, node-free, with the sqlite store's tables, row helpers (`store-rows.ts`) and semantics (§41f): `objects(id TEXT PRIMARY KEY, body TEXT NULL, bytes BLOB NULL)`, `refs(name TEXT PRIMARY KEY, target TEXT NULL, revision TEXT NOT NULL)` and `log(session TEXT, seq INTEGER, at INTEGER, event TEXT, PRIMARY KEY (session, seq))`, brought to core's `STORE_VERSION` by `migrateStore` on first `open()`, each commit one `transactionSync` and no backup; the open rejects with `SdkError("unavailable")` for a store a newer Nyte migrated. `put` ids the value with core's `objectId` and stores its JSON once; `putBlob` buffers the stream, ids it with `blobId` and stores the bytes once as an `ArrayBuffer`; an object and a blob that share an id share the row, each column filled once; `blob` reads the bytes back with their size and a null mime; a body, blob or logged event past the Durable Object's 2 MB row limit throws `SdkError("invalid")` before anything is written (§42k). `refs.set` runs inside one `transactionSync` with no await between its reads and writes, first rejecting with `SdkError("unavailable")` when a newer Nyte has migrated the store, with `RefStore.set`'s semantics, each revision a random UUID, any throw inside rolling the whole batch back. `list(prefix)` reads the name range from `prefix` in name order; `log` returns the events after `after` in seq order up to `limit`, each validated as a `SessionEvent`; `tail` is the session's last seq, or 0. Every `open()` returns a connection over the one storage; `close()` releases nothing, the storage being the object's. In workerd, which allows code generation only while modules load, the Worker turns TypeBox acceleration off at startup (`Settings.Set({ useAcceleration: false })` from `typebox/system`, as `packages/examples/cloudflare/worker.ts` does), or `log`'s validation throws inside a request. */
|
|
14
14
|
export declare function durableObjectStore(storage: DurableObjectSql): Store;
|
package/dist/src/index.js
CHANGED
|
@@ -11,15 +11,15 @@ import"../chunks/canvas-preview-wg80rbc2.js";
|
|
|
11
11
|
import {
|
|
12
12
|
identitySigner2
|
|
13
13
|
} from "../chunks/canvas-preview-5mex725c.js";
|
|
14
|
-
import"../chunks/canvas-preview-
|
|
14
|
+
import"../chunks/canvas-preview-gm0frf4b.js";
|
|
15
15
|
import"../chunks/canvas-preview-rp4x6y1h.js";
|
|
16
|
-
import"../chunks/canvas-preview-
|
|
16
|
+
import"../chunks/canvas-preview-d97wvref.js";
|
|
17
17
|
import {
|
|
18
18
|
listenFetch2
|
|
19
|
-
} from "../chunks/canvas-preview-
|
|
19
|
+
} from "../chunks/canvas-preview-9e15hp6q.js";
|
|
20
20
|
import {
|
|
21
21
|
listen2
|
|
22
|
-
} from "../chunks/canvas-preview-
|
|
22
|
+
} from "../chunks/canvas-preview-whfdhma6.js";
|
|
23
23
|
import"../chunks/canvas-preview-0nq75h9k.js";
|
|
24
24
|
import"../chunks/canvas-preview-bxnqt8cd.js";
|
|
25
25
|
import"../chunks/canvas-preview-yjz0f7n4.js";
|
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
} from "../chunks/canvas-preview-mstbvwz3.js";
|
|
85
85
|
import {
|
|
86
86
|
openHost2
|
|
87
|
-
} from "../chunks/canvas-preview-
|
|
87
|
+
} from "../chunks/canvas-preview-w0mr5bkn.js";
|
|
88
88
|
import {
|
|
89
89
|
postgresStore2
|
|
90
90
|
} from "../chunks/canvas-preview-4b6sayhg.js";
|
package/dist/src/listen-fetch.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listenFetch2
|
|
3
|
-
} from "../chunks/canvas-preview-
|
|
4
|
-
import"../chunks/canvas-preview-
|
|
5
|
-
import"../chunks/canvas-preview-
|
|
3
|
+
} from "../chunks/canvas-preview-9e15hp6q.js";
|
|
4
|
+
import"../chunks/canvas-preview-d97wvref.js";
|
|
5
|
+
import"../chunks/canvas-preview-gm0frf4b.js";
|
|
6
6
|
import"../chunks/canvas-preview-rp4x6y1h.js";
|
|
7
7
|
export {
|
|
8
8
|
listenFetch2 as listenFetch
|
package/dist/src/listen.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listen2
|
|
3
|
-
} from "../chunks/canvas-preview-
|
|
4
|
-
import"../chunks/canvas-preview-
|
|
5
|
-
import"../chunks/canvas-preview-
|
|
6
|
-
import"../chunks/canvas-preview-
|
|
3
|
+
} from "../chunks/canvas-preview-whfdhma6.js";
|
|
4
|
+
import"../chunks/canvas-preview-9e15hp6q.js";
|
|
5
|
+
import"../chunks/canvas-preview-d97wvref.js";
|
|
6
|
+
import"../chunks/canvas-preview-gm0frf4b.js";
|
|
7
7
|
import"../chunks/canvas-preview-rp4x6y1h.js";
|
|
8
8
|
export {
|
|
9
9
|
listen2 as listen
|
package/dist/src/open.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openHost2
|
|
3
|
-
} from "../chunks/canvas-preview-
|
|
3
|
+
} from "../chunks/canvas-preview-w0mr5bkn.js";
|
|
4
4
|
import"../chunks/canvas-preview-4e0pxa32.js";
|
|
5
5
|
import"../chunks/canvas-preview-y5y6ghaw.js";
|
|
6
6
|
import"../chunks/canvas-preview-ec2mt7es.js";
|
|
@@ -26,10 +26,10 @@ import"../chunks/canvas-preview-s94ebwf5.js";
|
|
|
26
26
|
import"../chunks/canvas-preview-kdqgrstc.js";
|
|
27
27
|
import"../chunks/canvas-preview-mstbvwz3.js";
|
|
28
28
|
import"../chunks/canvas-preview-zaaj99wd.js";
|
|
29
|
-
import"../chunks/canvas-preview-
|
|
30
|
-
import"../chunks/canvas-preview-
|
|
31
|
-
import"../chunks/canvas-preview-
|
|
32
|
-
import"../chunks/canvas-preview-
|
|
29
|
+
import"../chunks/canvas-preview-whfdhma6.js";
|
|
30
|
+
import"../chunks/canvas-preview-9e15hp6q.js";
|
|
31
|
+
import"../chunks/canvas-preview-d97wvref.js";
|
|
32
|
+
import"../chunks/canvas-preview-gm0frf4b.js";
|
|
33
33
|
import"../chunks/canvas-preview-rp4x6y1h.js";
|
|
34
34
|
import"../chunks/canvas-preview-skzwvw4d.js";
|
|
35
35
|
import"../chunks/canvas-preview-bxnqt8cd.js";
|
|
@@ -34,6 +34,6 @@ export type Binding = CallBinding & FrameBinding & ByteBinding & OutputBinding;
|
|
|
34
34
|
export type BindingOptions = {
|
|
35
35
|
readonly server: ServerHost;
|
|
36
36
|
};
|
|
37
|
-
/** Returns each row bound to the call it names: ids bind handles on the connection, handles returned become ids, `Set`s and `Map`s become their wire forms; `head.move`, `files.batch` and `browser.open` go through the server port's wire operations with their wire id (§40o, §40x). `head.watch` sends the head's view from the host's fold whole, then each later view as its changes (`viewFrames`), the core watch marking the principal's seen tip (§40a, §54a). Authority is the caller's gate: the server checks each row's before binding. */
|
|
37
|
+
/** Returns each row bound to the call it names: ids bind handles on the connection, handles returned become ids, `Set`s and `Map`s become their wire forms; `head.move`, `files.batch` and `browser.open` go through the server port's wire operations with their wire id (§40o, §40x). `head.watch` sends the head's view from the host's fold whole, then each later view as its changes (`viewFrames`), the core watch marking the principal's seen tip (§40a, §54a); `sessions.watch` sends the list whole, then each later list as its order and changed rows (`sessionsFrames`). Authority is the caller's gate: the server checks each row's before binding. */
|
|
38
38
|
export declare function bindConnection(connection: Connection, options: BindingOptions): Binding;
|
|
39
39
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createHandler2
|
|
3
|
-
} from "../../chunks/canvas-preview-
|
|
4
|
-
import"../../chunks/canvas-preview-
|
|
3
|
+
} from "../../chunks/canvas-preview-d97wvref.js";
|
|
4
|
+
import"../../chunks/canvas-preview-gm0frf4b.js";
|
|
5
5
|
import"../../chunks/canvas-preview-rp4x6y1h.js";
|
|
6
6
|
export {
|
|
7
7
|
createHandler2 as createHandler
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nyte-ai/host",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -79,14 +79,6 @@
|
|
|
79
79
|
"./usage-worker": {
|
|
80
80
|
"types": "./dist/src/usage-worker.d.ts",
|
|
81
81
|
"import": "./dist/src/usage-worker.js"
|
|
82
|
-
},
|
|
83
|
-
"./deploy/cloudflare": {
|
|
84
|
-
"types": "./dist/src/deploy/cloudflare/worker.d.ts",
|
|
85
|
-
"import": "./dist/src/deploy/cloudflare/worker.js"
|
|
86
|
-
},
|
|
87
|
-
"./deploy/vercel": {
|
|
88
|
-
"types": "./dist/src/deploy/vercel/nitro.config.d.ts",
|
|
89
|
-
"import": "./dist/src/deploy/vercel/nitro.config.js"
|
|
90
82
|
}
|
|
91
83
|
},
|
|
92
84
|
"publishConfig": {
|
|
@@ -94,48 +86,34 @@
|
|
|
94
86
|
"provenance": true
|
|
95
87
|
},
|
|
96
88
|
"dependencies": {
|
|
97
|
-
"@earendil-works/pi-mcp": "1.3.0",
|
|
98
|
-
"@lydell/node-pty": "1.2.0-beta.15",
|
|
99
|
-
"@nyte-ai/ai": "0.0.
|
|
100
|
-
"@nyte-ai/core": "0.0.
|
|
101
|
-
"@nyte-ai/plugin": "0.0.
|
|
102
|
-
"@nyte-ai/protocol": "0.0.
|
|
103
|
-
"@nyte-ai/schema": "0.0.
|
|
104
|
-
"@silvia-odwyer/photon": "0.3.3",
|
|
105
|
-
"fflate": "0.8.3",
|
|
106
|
-
"ignore": "7.0.
|
|
107
|
-
"pg": "8.23.
|
|
108
|
-
"typebox": "1.
|
|
89
|
+
"@earendil-works/pi-mcp": "^1.3.0",
|
|
90
|
+
"@lydell/node-pty": "^1.2.0-beta.15",
|
|
91
|
+
"@nyte-ai/ai": "0.0.24",
|
|
92
|
+
"@nyte-ai/core": "0.0.24",
|
|
93
|
+
"@nyte-ai/plugin": "0.0.24",
|
|
94
|
+
"@nyte-ai/protocol": "0.0.24",
|
|
95
|
+
"@nyte-ai/schema": "0.0.24",
|
|
96
|
+
"@silvia-odwyer/photon": "^0.3.3",
|
|
97
|
+
"fflate": "^0.8.3",
|
|
98
|
+
"ignore": "^7.0.13",
|
|
99
|
+
"pg": "^8.23.1",
|
|
100
|
+
"typebox": "^1.4.2"
|
|
109
101
|
},
|
|
110
102
|
"devDependencies": {
|
|
111
|
-
"@electric-sql/pglite": "0.5.
|
|
103
|
+
"@electric-sql/pglite": "^0.5.11",
|
|
112
104
|
"@nyte-ai/canvas": "0.0.0",
|
|
113
105
|
"@types/node": "^26.6.5",
|
|
114
|
-
"@types/pg": "8.23.1",
|
|
115
|
-
"fast-check": "4.10.2",
|
|
116
|
-
"nitro": "3.0.260903-beta",
|
|
106
|
+
"@types/pg": "^8.23.1",
|
|
107
|
+
"fast-check": "^4.10.2",
|
|
117
108
|
"typescript": "6.0.3",
|
|
118
|
-
"vitest": "^5.0.5"
|
|
119
|
-
"workflow": "4.8.8"
|
|
120
|
-
},
|
|
121
|
-
"peerDependencies": {
|
|
122
|
-
"nitro": "3.0.260903-beta",
|
|
123
|
-
"workflow": "4.8.8"
|
|
124
|
-
},
|
|
125
|
-
"peerDependenciesMeta": {
|
|
126
|
-
"nitro": {
|
|
127
|
-
"optional": true
|
|
128
|
-
},
|
|
129
|
-
"workflow": {
|
|
130
|
-
"optional": true
|
|
131
|
-
}
|
|
109
|
+
"vitest": "^5.0.5"
|
|
132
110
|
},
|
|
133
111
|
"engines": {
|
|
134
112
|
"node": ">=26.4.0"
|
|
135
113
|
},
|
|
136
114
|
"scripts": {
|
|
137
115
|
"clean": "rm -rf node_modules .turbo",
|
|
138
|
-
"typecheck": "tsrs --noEmit
|
|
116
|
+
"typecheck": "tsrs --noEmit",
|
|
139
117
|
"test": "vitest --run",
|
|
140
118
|
"check:store": "node scripts/check-store.ts",
|
|
141
119
|
"build:package": "bun ../../scripts/sdk-packages.mjs build host"
|
package/src/durable-object.ts
CHANGED
|
@@ -44,7 +44,7 @@ const ROW_LIMIT = 2_000_000;
|
|
|
44
44
|
|
|
45
45
|
const encoder = new TextEncoder();
|
|
46
46
|
|
|
47
|
-
/** Returns a `Store` over a Durable Object's SQLite storage, node-free, with the sqlite store's tables, row helpers (`store-rows.ts`) and semantics (§41f): `objects(id TEXT PRIMARY KEY, body TEXT NULL, bytes BLOB NULL)`, `refs(name TEXT PRIMARY KEY, target TEXT NULL, revision TEXT NOT NULL)` and `log(session TEXT, seq INTEGER, at INTEGER, event TEXT, PRIMARY KEY (session, seq))`, brought to core's `STORE_VERSION` by `migrateStore` on first `open()`, each commit one `transactionSync` and no backup; the open rejects with `SdkError("unavailable")` for a store a newer Nyte migrated. `put` ids the value with core's `objectId` and stores its JSON once; `putBlob` buffers the stream, ids it with `blobId` and stores the bytes once as an `ArrayBuffer`; an object and a blob that share an id share the row, each column filled once; `blob` reads the bytes back with their size and a null mime; a body, blob or logged event past the Durable Object's 2 MB row limit throws `SdkError("invalid")` before anything is written (§42k). `refs.set` runs inside one `transactionSync` with no await between its reads and writes, first rejecting with `SdkError("unavailable")` when a newer Nyte has migrated the store, with `RefStore.set`'s semantics, each revision a random UUID, any throw inside rolling the whole batch back. `list(prefix)` reads the name range from `prefix` in name order; `log` returns the events after `after` in seq order up to `limit`, each validated as a `SessionEvent`; `tail` is the session's last seq, or 0. Every `open()` returns a connection over the one storage; `close()` releases nothing, the storage being the object's. In workerd, which allows code generation only while modules load, the Worker turns TypeBox acceleration off at startup (`Settings.Set({ useAcceleration: false })` from `typebox/system`, as `
|
|
47
|
+
/** Returns a `Store` over a Durable Object's SQLite storage, node-free, with the sqlite store's tables, row helpers (`store-rows.ts`) and semantics (§41f): `objects(id TEXT PRIMARY KEY, body TEXT NULL, bytes BLOB NULL)`, `refs(name TEXT PRIMARY KEY, target TEXT NULL, revision TEXT NOT NULL)` and `log(session TEXT, seq INTEGER, at INTEGER, event TEXT, PRIMARY KEY (session, seq))`, brought to core's `STORE_VERSION` by `migrateStore` on first `open()`, each commit one `transactionSync` and no backup; the open rejects with `SdkError("unavailable")` for a store a newer Nyte migrated. `put` ids the value with core's `objectId` and stores its JSON once; `putBlob` buffers the stream, ids it with `blobId` and stores the bytes once as an `ArrayBuffer`; an object and a blob that share an id share the row, each column filled once; `blob` reads the bytes back with their size and a null mime; a body, blob or logged event past the Durable Object's 2 MB row limit throws `SdkError("invalid")` before anything is written (§42k). `refs.set` runs inside one `transactionSync` with no await between its reads and writes, first rejecting with `SdkError("unavailable")` when a newer Nyte has migrated the store, with `RefStore.set`'s semantics, each revision a random UUID, any throw inside rolling the whole batch back. `list(prefix)` reads the name range from `prefix` in name order; `log` returns the events after `after` in seq order up to `limit`, each validated as a `SessionEvent`; `tail` is the session's last seq, or 0. Every `open()` returns a connection over the one storage; `close()` releases nothing, the storage being the object's. In workerd, which allows code generation only while modules load, the Worker turns TypeBox acceleration off at startup (`Settings.Set({ useAcceleration: false })` from `typebox/system`, as `packages/examples/cloudflare/worker.ts` does), or `log`'s validation throws inside a request. */
|
|
48
48
|
export function durableObjectStore(storage: DurableObjectSql): Store {
|
|
49
49
|
let connection: StoreConnection | null = null;
|
|
50
50
|
|
package/src/open.ts
CHANGED
|
@@ -50,6 +50,8 @@ import { defaultSecrets } from "./secrets.ts";
|
|
|
50
50
|
import type { SecretsSource } from "./secrets.ts";
|
|
51
51
|
import { sqliteStore, storePath } from "./sqlite.ts";
|
|
52
52
|
|
|
53
|
+
declare const NYTE_BUILT_VERSION: string | undefined;
|
|
54
|
+
|
|
53
55
|
const RELOAD_DEBOUNCE_MS = 250;
|
|
54
56
|
|
|
55
57
|
const STORE_POLL_MS = 500;
|
|
@@ -441,7 +443,11 @@ async function settingsSeed(home: string): Promise<{
|
|
|
441
443
|
}
|
|
442
444
|
|
|
443
445
|
function hostDescription(): HostDescription {
|
|
444
|
-
return {
|
|
446
|
+
return {
|
|
447
|
+
name: hostname(),
|
|
448
|
+
platform: process.platform,
|
|
449
|
+
version: typeof NYTE_BUILT_VERSION === "string" ? NYTE_BUILT_VERSION : manifest.version,
|
|
450
|
+
};
|
|
445
451
|
}
|
|
446
452
|
|
|
447
453
|
function settingsPath(home: string): string {
|
package/src/serve/binding.ts
CHANGED
|
@@ -30,7 +30,7 @@ import type {
|
|
|
30
30
|
Receipt,
|
|
31
31
|
} from "@nyte-ai/core";
|
|
32
32
|
import type { ServerHost } from "@nyte-ai/core/server";
|
|
33
|
-
import { mapped, viewFrames } from "@nyte-ai/protocol";
|
|
33
|
+
import { mapped, sessionsFrames, viewFrames } from "@nyte-ai/protocol";
|
|
34
34
|
import type {
|
|
35
35
|
ByteName,
|
|
36
36
|
CallName,
|
|
@@ -103,7 +103,7 @@ const attempts = new WeakMap<ServerHost, Map<string, Attempt>>();
|
|
|
103
103
|
|
|
104
104
|
const holds = new WeakMap<ServerHost, Map<string, Page[]>>();
|
|
105
105
|
|
|
106
|
-
/** Returns each row bound to the call it names: ids bind handles on the connection, handles returned become ids, `Set`s and `Map`s become their wire forms; `head.move`, `files.batch` and `browser.open` go through the server port's wire operations with their wire id (§40o, §40x). `head.watch` sends the head's view from the host's fold whole, then each later view as its changes (`viewFrames`), the core watch marking the principal's seen tip (§40a, §54a). Authority is the caller's gate: the server checks each row's before binding. */
|
|
106
|
+
/** Returns each row bound to the call it names: ids bind handles on the connection, handles returned become ids, `Set`s and `Map`s become their wire forms; `head.move`, `files.batch` and `browser.open` go through the server port's wire operations with their wire id (§40o, §40x). `head.watch` sends the head's view from the host's fold whole, then each later view as its changes (`viewFrames`), the core watch marking the principal's seen tip (§40a, §54a); `sessions.watch` sends the list whole, then each later list as its order and changed rows (`sessionsFrames`). Authority is the caller's gate: the server checks each row's before binding. */
|
|
107
107
|
export function bindConnection(connection: Connection, options: BindingOptions): Binding {
|
|
108
108
|
const { wire } = options.server;
|
|
109
109
|
const { principal } = connection;
|
|
@@ -257,7 +257,7 @@ export function bindConnection(connection: Connection, options: BindingOptions):
|
|
|
257
257
|
"workspaces.add": ({ target, options }) => connection.workspaces.add(target, options),
|
|
258
258
|
"workspaces.forget": ({ id }) => connection.workspaces.forget(id),
|
|
259
259
|
|
|
260
|
-
"sessions.watch": async (input) => connection.sessions.watch(input),
|
|
260
|
+
"sessions.watch": async (input) => sessionsFrames(connection.sessions.watch(input)),
|
|
261
261
|
"sessions.start": async (input) => {
|
|
262
262
|
const { session, receipt } = await connection.sessions.start(input);
|
|
263
263
|
|
package/src/usage-history.ts
CHANGED
|
@@ -159,7 +159,6 @@ async function* historyLines(path: string, start: number, signal: AbortSignal |
|
|
|
159
159
|
const chunk = pending.length === 0 ? read : Buffer.concat([pending, read]);
|
|
160
160
|
let from = 0;
|
|
161
161
|
|
|
162
|
-
// oxlint-disable-next-line nyte-code/no-index-of -- a byte search keeps offsets exact, which decoded text cannot
|
|
163
162
|
for (let newline = chunk.indexOf(0x0a); newline !== -1; newline = chunk.indexOf(0x0a, from)) {
|
|
164
163
|
yield {
|
|
165
164
|
text: chunk.toString("utf8", from, newline),
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// src/deploy/vercel/server/utils/repair.ts
|
|
2
|
-
import { createHash, timingSafeEqual } from "node:crypto";
|
|
3
|
-
import { SdkError } from "@nyte-ai/schema";
|
|
4
|
-
import { encodeError, errorStatus } from "@nyte-ai/protocol";
|
|
5
|
-
async function answerRepair2(request, secret, repair) {
|
|
6
|
-
if (request.method !== "GET" || new URL(request.url).pathname !== "/.nyte/repair")
|
|
7
|
-
return;
|
|
8
|
-
if (secret === undefined || secret === "")
|
|
9
|
-
return failure(new SdkError("unknown", "This deployment sets no CRON_SECRET."));
|
|
10
|
-
const given = /^Bearer\s+(\S+)\s*$/i.exec(request.headers.get("Authorization") ?? "")?.[1] ?? "";
|
|
11
|
-
if (!timingSafeEqual(digest(given), digest(secret)))
|
|
12
|
-
return failure(new SdkError("unauthenticated", "Send Authorization: Bearer <CRON_SECRET>."));
|
|
13
|
-
await repair();
|
|
14
|
-
return new Response(null, { status: 204 });
|
|
15
|
-
}
|
|
16
|
-
function digest(text) {
|
|
17
|
-
return createHash("sha256").update(text).digest();
|
|
18
|
-
}
|
|
19
|
-
function failure(error) {
|
|
20
|
-
return new Response(JSON.stringify(encodeError(error)), {
|
|
21
|
-
status: errorStatus[error.code],
|
|
22
|
-
headers: { "Content-Type": "application/json" }
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { answerRepair2 };
|