@markusylisiurunen/tau 0.3.80 → 0.3.82
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/dist/code_mode/command.js +4 -16
- package/dist/code_mode/command.js.map +1 -1
- package/dist/code_mode/images.js +5 -6
- package/dist/code_mode/images.js.map +1 -1
- package/dist/code_mode/index.d.ts +1 -3
- package/dist/code_mode/index.js +1 -2
- package/dist/code_mode/index.js.map +1 -1
- package/dist/code_mode/runtime.d.ts +8 -4
- package/dist/code_mode/runtime.js +52 -63
- package/dist/code_mode/runtime.js.map +1 -1
- package/dist/core/code_mode/bash.js +269 -0
- package/dist/core/code_mode/bash.js.map +1 -0
- package/dist/core/code_mode/capability.js +2 -0
- package/dist/core/code_mode/capability.js.map +1 -0
- package/dist/core/code_mode/history.js +62 -0
- package/dist/core/code_mode/history.js.map +1 -0
- package/dist/core/code_mode/mcp.js +121 -0
- package/dist/core/code_mode/mcp.js.map +1 -0
- package/dist/core/code_mode/models.js +256 -0
- package/dist/core/code_mode/models.js.map +1 -0
- package/dist/core/{tools → code_mode}/nook.js +13 -77
- package/dist/core/code_mode/nook.js.map +1 -0
- package/dist/core/code_mode/sdk.js +97 -0
- package/dist/core/code_mode/sdk.js.map +1 -0
- package/dist/core/{tools → code_mode}/web.js +31 -90
- package/dist/core/code_mode/web.js.map +1 -0
- package/dist/core/commands/registry.js +0 -22
- package/dist/core/commands/registry.js.map +1 -1
- package/dist/core/config/content_loader.js +3 -1
- package/dist/core/config/content_loader.js.map +1 -1
- package/dist/core/debug.js +1 -1
- package/dist/core/debug.js.map +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/models/openrouter.js +171 -0
- package/dist/core/models/openrouter.js.map +1 -0
- package/dist/core/{tool → models}/openrouter_decisions.js +6 -7
- package/dist/core/models/openrouter_decisions.js.map +1 -0
- package/dist/core/models/openrouter_media.js +128 -0
- package/dist/core/models/openrouter_media.js.map +1 -0
- package/dist/core/personas.js +2 -1
- package/dist/core/personas.js.map +1 -1
- package/dist/core/runtime/chat_runtime.js +2 -13
- package/dist/core/runtime/chat_runtime.js.map +1 -1
- package/dist/core/session/compaction.js +5 -3
- package/dist/core/session/compaction.js.map +1 -1
- package/dist/core/static/code_mode/history/documentation.md +95 -167
- package/dist/core/static/code_mode/mcp/documentation.md +144 -67
- package/dist/core/static/code_mode/nook/documentation.md +108 -169
- package/dist/core/static/code_mode/sandbox_runner.mjs +37 -20
- package/dist/core/static/code_mode/web/documentation.md +115 -213
- package/dist/core/static/tau_docs/client-tools.md +4 -4
- package/dist/core/static/tau_docs/history.md +2 -2
- package/dist/core/static/tau_docs/index.md +1 -1
- package/dist/core/static/tau_docs/node-sdk.md +6 -7
- package/dist/core/static/tau_docs/nook.md +2 -2
- package/dist/core/static/tau_docs/personas.md +2 -2
- package/dist/core/static/tau_docs/remote-sessions.md +2 -2
- package/dist/core/static/tau_docs/security.md +4 -4
- package/dist/core/static/tau_docs/session-protocol-methods.md +1 -46
- package/dist/core/static/tau_docs/session-protocol.md +11 -11
- package/dist/core/static/tau_docs/sessions.md +6 -25
- package/dist/core/static/tau_docs/subagents.md +3 -2
- package/dist/core/static/tau_docs/telegram.md +1 -1
- package/dist/core/static/tau_docs/tools.md +40 -48
- package/dist/core/static/tau_docs/troubleshooting.md +2 -2
- package/dist/core/static/tau_docs/tui.md +8 -7
- package/dist/core/subagents/registry.js +2 -1
- package/dist/core/subagents/registry.js.map +1 -1
- package/dist/core/subagents/types.js +2 -1
- package/dist/core/subagents/types.js.map +1 -1
- package/dist/core/telegram/adapter.js +1 -6
- package/dist/core/telegram/adapter.js.map +1 -1
- package/dist/core/tool/image_generate.js +2 -1
- package/dist/core/tool/image_generate.js.map +1 -1
- package/dist/core/tool/media.js +1 -49
- package/dist/core/tool/media.js.map +1 -1
- package/dist/core/tool/openrouter.js +24 -156
- package/dist/core/tool/openrouter.js.map +1 -1
- package/dist/core/tool/openrouter_input.js +77 -0
- package/dist/core/tool/openrouter_input.js.map +1 -0
- package/dist/core/tool/speech_generate.js +2 -1
- package/dist/core/tool/speech_generate.js.map +1 -1
- package/dist/core/tools/bash.js +2 -1
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/bash_jobs.js +34 -5
- package/dist/core/tools/bash_jobs.js.map +1 -1
- package/dist/core/tools/catalog.js +18 -44
- package/dist/core/tools/catalog.js.map +1 -1
- package/dist/core/tools/code.js +100 -0
- package/dist/core/tools/code.js.map +1 -0
- package/dist/core/tools/code_mode.js +9 -30
- package/dist/core/tools/code_mode.js.map +1 -1
- package/dist/core/tools/code_mode_worker.js +2 -2
- package/dist/core/tools/presentation.js +2 -1
- package/dist/core/tools/presentation.js.map +1 -1
- package/dist/core/tools/tool_names.js +5 -7
- package/dist/core/tools/tool_names.js.map +1 -1
- package/dist/core/utils/gemini_transcription.js +81 -37
- package/dist/core/utils/gemini_transcription.js.map +1 -1
- package/dist/core/utils/media_validation.js +50 -0
- package/dist/core/utils/media_validation.js.map +1 -0
- package/dist/core/utils/user_metadata.js +0 -14
- package/dist/core/utils/user_metadata.js.map +1 -1
- package/dist/core/version.js +2 -2
- package/dist/diff_tool/app/dist/assets/{angular-html-BbLgbIhq.js → angular-html-D20byCHL.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{angular-ts-DXk17TRM.js → angular-ts-CvVQslm2.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{apl-BsvksCXR.js → apl-DNIxlYWe.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{astro-DH775E4V.js → astro-DDOw4EUG.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{blade-Ck99Rm59.js → blade-DlhB-SLW.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{c-DJpHqu5J.js → c-C1f4vhDm.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{chapel-Owff0Csy.js → chapel-Ctt8xOX1.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{cobol-Cv2gZuhO.js → cobol-BXw71PAA.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{coffee-Bji0YCf_.js → coffee-CRh_5Nmr.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{cpp-DTjA_yFF.js → cpp-IlI-zWOZ.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{crystal-Dd00NOeb.js → crystal-CXeL28i7.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{css-D44TN1V6.js → css-BfST9hFI.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{edge-CVmGSi2m.js → edge--Q22k_ty.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{elixir-B8Mq7no2.js → elixir-CIfC_rQx.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{elm-CXS0I3Z2.js → elm-OkZ29XRO.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{erb-B9oDKaUo.js → erb-B8ZXgEqv.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{git-rebase-DT-YFebH.js → git-rebase-CxkO_WGd.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{glimmer-js-s0DXlNjq.js → glimmer-js-BVadyIrr.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{glimmer-ts-QgEB5S2z.js → glimmer-ts-D5J3Qb7n.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{glsl-NA0icwbY.js → glsl-B6iy73-Y.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{graphql-0_dOlfV0.js → graphql-Dc3rUXf5.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{hack-D-mr7l1l.js → hack-q8Utf8Jp.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{haml-B0-oQmz7.js → haml-mjMIlj_2.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{handlebars-Yq9bXpWN.js → handlebars-CA-BL8Ks.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{html-B8bMmdRK.js → html-BmPxhYCX.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{html-derivative-BpxSlQb_.js → html-derivative-CvknIjuB.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{http-hS_53mxt.js → http-DNxLDRIi.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{hurl-B2ST1kwl.js → hurl-kbd3Eq2V.js} +1 -1
- package/dist/diff_tool/app/dist/assets/index-D8ZI_2RC.js +340 -0
- package/dist/diff_tool/app/dist/assets/{java-D4mj0lZJ.js → java-BuZshgf1.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{javascript-wC7rrKiV.js → javascript-DfL2oeFU.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{jinja-DbQ3o87F.js → jinja-Bu0KQihU.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{jison-CrE9FdvP.js → jison-Bqn7Mf3Q.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{json-xjicDyWN.js → json-BuX5LKaB.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{jsx-m28lXojQ.js → jsx-DdVJ-ZBp.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{julia-19xkOmop.js → julia-CQeijOoQ.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{just-Cf7OorTr.js → just-vzAktFGR.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{latex-DDb7GQOy.js → latex-Dm60cg0k.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{liquid-DHOuQ0rf.js → liquid-vxKzm2P8.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{lua-BGyIvonw.js → lua-DIoqi4dd.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{marko-DB5OqI1C.js → marko-BTHgFKby.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{mdc-DTyNMupO.js → mdc-CEfz8gZ9.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{nginx-DfF0fMYD.js → nginx-DNlFDEfJ.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{nim-BbwsXuZD.js → nim-DnvT_0lZ.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{org-BkOBBl1f.js → org-BbD-ElVf.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{perl-BTXTOl4K.js → perl-DTsbnAmK.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{php-DIMVQWiA.js → php-CwEsJe-W.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{pug-B_nrb4dJ.js → pug-BOttMVH-.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{qml-1PXi8G8Z.js → qml-C8KkSItN.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{r-CJrAkc2Z.js → r-K4ksJj_R.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{razor-DgPUftNd.js → razor-yuWRrrG6.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{regexp-C2hS8XvL.js → regexp-CV-jhnUz.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{rst-CDouhKnc.js → rst-CLA3Attc.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{ruby-CAjKW1uO.js → ruby-DiHR2-DX.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{sas-qAHkHLc1.js → sas-DxIjbYJ5.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{scss-Bfx2Ydid.js → scss-CShwEaV4.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{shellscript-Bu76R8y2.js → shellscript-CeezOnrF.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{shellsession-BU8BL0oL.js → shellsession-CjSS2r7j.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{soy-FRl8ozP-.js → soy-CI_v23nJ.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{sql-BacQgsEs.js → sql-D9GaB00A.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{stata-B9kkG-ET.js → stata-hK92TPE_.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{surrealql-qvETr7iY.js → surrealql-UO8LtPJG.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{svelte-B0z1MgHc.js → svelte-kIlaw_oh.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{templ-DTnPshKb.js → templ-DFRz1JP6.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{tex-Cosab9_H.js → tex-CfxIXk_z.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{ts-tags-DNYvLFUH.js → ts-tags-BtUHl0ff.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{tsx-Dstq6j1a.js → tsx-Cd4SAe2C.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{twig-BzqZdwaX.js → twig-CWk4q5Y3.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{typescript-YOQ_oE25.js → typescript-BqxGJiP0.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{typst-DTffwfpc.js → typst-D9nAun2p.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{vue-D4OMj_C5.js → vue-D6HYhg6_.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{vue-html-kT4WrHGK.js → vue-html-1VRlaENS.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{vue-vine-CxeapeMO.js → vue-vine-BaH0We9y.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{xml-DWVpuurg.js → xml-C4RWnUuj.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{xsl-C0ciup5a.js → xsl-D1iD38ga.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{yaml-98Fvyfpc.js → yaml-yAb4W0G-.js} +1 -1
- package/dist/diff_tool/app/dist/index.html +1 -1
- package/dist/host/local_session_host.js +24 -318
- package/dist/host/local_session_host.js.map +1 -1
- package/dist/host/session_host.js.map +1 -1
- package/dist/host/session_protocol_handler.js +0 -98
- package/dist/host/session_protocol_handler.js.map +1 -1
- package/dist/nook/README.md +1 -1
- package/dist/protocol/index.d.ts +1 -1
- package/dist/protocol/index.js.map +1 -1
- package/dist/protocol/session_protocol.d.ts +3 -28
- package/dist/protocol/session_protocol.js +1 -56
- package/dist/protocol/session_protocol.js.map +1 -1
- package/dist/sdk/code_mode.js +11 -17
- package/dist/sdk/code_mode.js.map +1 -1
- package/dist/sdk/index.d.ts +2 -2
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/session.js +0 -20
- package/dist/sdk/session.js.map +1 -1
- package/dist/sdk/types.d.ts +1 -7
- package/dist/store/session_snapshot_migrations.js +72 -1
- package/dist/store/session_snapshot_migrations.js.map +1 -1
- package/dist/tui/session_chat_controller.js +95 -82
- package/dist/tui/session_chat_controller.js.map +1 -1
- package/dist/tui/ui/footer.js +2 -5
- package/dist/tui/ui/footer.js.map +1 -1
- package/package.json +7 -7
- package/dist/code_mode/files.d.ts +0 -47
- package/dist/code_mode/files.js +0 -296
- package/dist/code_mode/files.js.map +0 -1
- package/dist/core/session/goal.js +0 -54
- package/dist/core/session/goal.js.map +0 -1
- package/dist/core/tool/openrouter_decisions.js.map +0 -1
- package/dist/core/tool/openrouter_media.js +0 -180
- package/dist/core/tool/openrouter_media.js.map +0 -1
- package/dist/core/tools/goal.js +0 -167
- package/dist/core/tools/goal.js.map +0 -1
- package/dist/core/tools/history.js +0 -118
- package/dist/core/tools/history.js.map +0 -1
- package/dist/core/tools/mcp.js +0 -167
- package/dist/core/tools/mcp.js.map +0 -1
- package/dist/core/tools/nook.js.map +0 -1
- package/dist/core/tools/web.js.map +0 -1
- package/dist/diff_tool/app/dist/assets/index-CBT_sNIz.js +0 -340
|
@@ -1,205 +1,144 @@
|
|
|
1
|
-
|
|
1
|
+
# tau.nook
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Manage static sites, reusable source templates, and per-site JSON KV on the configured Nook deployment. Use absolute paths for file and directory arguments; these refer to files on your machine.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Interface
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
## Sites
|
|
16
|
-
|
|
17
|
-
### `nook.sites.list()`
|
|
18
|
-
|
|
19
|
-
Return the configured target's sites as an array.
|
|
20
|
-
|
|
21
|
-
```js
|
|
22
|
-
const sites = await nook.sites.list();
|
|
23
|
-
for (const site of sites) {
|
|
24
|
-
console.log(`${site.slug}: ${site.url} (${site.visibility ?? "not deployed"})`);
|
|
25
|
-
}
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Each site may contain:
|
|
29
|
-
|
|
30
|
-
```js
|
|
31
|
-
{
|
|
32
|
-
slug: string,
|
|
33
|
-
url: string,
|
|
34
|
-
createdAt?: string,
|
|
35
|
-
updatedAt?: string,
|
|
36
|
-
latestDeploymentId?: string,
|
|
37
|
-
visibility?: "private" | "public",
|
|
38
|
-
kv?: {
|
|
39
|
-
keyCount: number,
|
|
40
|
-
bytesUsed: number,
|
|
41
|
-
maxKeys: number,
|
|
42
|
-
maxBytes: number,
|
|
43
|
-
},
|
|
44
|
-
}
|
|
7
|
+
```ts
|
|
8
|
+
type NookApi = {
|
|
9
|
+
skill(): Promise<string>;
|
|
10
|
+
sites: SitesApi;
|
|
11
|
+
templates: TemplatesApi;
|
|
12
|
+
kv: KvApi;
|
|
13
|
+
};
|
|
45
14
|
```
|
|
46
15
|
|
|
47
|
-
|
|
16
|
+
## `tau.nook.skill()`
|
|
48
17
|
|
|
49
|
-
|
|
18
|
+
Takes no arguments and returns the app-authoring guide as a string, including the browser SDK and KV contract. When authoring or modifying an app, retrieve it in a separate documentation-only call and read it before subsequent work:
|
|
50
19
|
|
|
51
20
|
```js
|
|
52
|
-
|
|
53
|
-
console.log(`copied ${copied.fileCount} files to ${copied.directory}`);
|
|
21
|
+
printText(await tau.nook.skill());
|
|
54
22
|
```
|
|
55
23
|
|
|
56
|
-
|
|
24
|
+
Do not combine this retrieval with management operations. Reuse a guide already visible in the conversation. This reference describes management methods, not the API available inside a hosted app.
|
|
57
25
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
Deploy a static directory as the site's new active deployment. `options.visibility` is required and must be `"private"` or `"public"`; visibility never defaults implicitly. The directory must contain a root `index.html` and satisfy Nook's path, file-count, and size limits.
|
|
26
|
+
## Sites
|
|
61
27
|
|
|
62
|
-
```
|
|
63
|
-
|
|
28
|
+
```ts
|
|
29
|
+
type Visibility = "private" | "public";
|
|
30
|
+
type Site = {
|
|
31
|
+
slug: string;
|
|
32
|
+
url: string;
|
|
33
|
+
createdAt?: string;
|
|
34
|
+
updatedAt?: string;
|
|
35
|
+
latestDeploymentId?: string;
|
|
36
|
+
visibility?: Visibility;
|
|
37
|
+
kv?: { keyCount: number; bytesUsed: number; maxKeys: number; maxBytes: number };
|
|
38
|
+
};
|
|
39
|
+
type Deployment = {
|
|
40
|
+
site: string;
|
|
41
|
+
url: string;
|
|
42
|
+
visibility: Visibility;
|
|
43
|
+
deploymentId: string;
|
|
44
|
+
fileCount: number;
|
|
45
|
+
byteCount: number;
|
|
46
|
+
};
|
|
47
|
+
type SiteCopy = Omit<Deployment, "url"> & { directory: string };
|
|
48
|
+
|
|
49
|
+
type SitesApi = {
|
|
50
|
+
list(): Promise<Site[]>;
|
|
51
|
+
copy(site: string, directory: string): Promise<SiteCopy>;
|
|
52
|
+
deploy(site: string, directory: string, options: { visibility: Visibility }): Promise<Deployment>;
|
|
53
|
+
delete(site: string): Promise<{ site: string; deleted: boolean }>;
|
|
54
|
+
};
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
These methods are called on `tau.nook.sites`:
|
|
58
|
+
|
|
59
|
+
- `list()`: list site summaries. Deployment and KV metadata may be absent for an undeployed site.
|
|
60
|
+
- `copy(site, directory)`: copy the active deployment into an existing empty directory. Downloads are verified against the manifest before writing. Interruption during file writes can leave a partial destination; inspect it before retrying.
|
|
61
|
+
- `deploy(site, directory, { visibility })`: publish the directory as the new active deployment, creating the site if needed. Visibility is required, never implicit. KV survives redeploys. The result's `url` is the link to return to the user.
|
|
62
|
+
- `delete(site)`: delete the site and its managed state. This is destructive; `deleted` reports whether anything was deleted.
|
|
63
|
+
|
|
64
|
+
Site slugs are 2–63 lowercase letters, digits, or hyphens, starting and ending with a letter or digit. Reserved slugs are `admin`, `api`, `assets`, `login`, `logout`, `nook`, `quick`, `static`, and `www`.
|
|
65
|
+
|
|
66
|
+
Deploy built static output, not an editable source tree unless it is already the complete artifact. A deployment requires root `index.html`. Limits: 1,000 files, 10 MiB per file, 100 MiB total, paths up to 512 characters. Hidden paths, symlinks, traversal, and `/__nook` or its descendants are rejected. Build relative asset URLs or use the site's `/<slug>/` base path.
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
const deployed = await tau.nook.sites.deploy("demo", "/absolute/path/to/built-app", {
|
|
64
70
|
visibility: "private",
|
|
65
71
|
});
|
|
66
|
-
|
|
72
|
+
printText(`${deployed.url} (${deployed.visibility})`);
|
|
67
73
|
```
|
|
68
74
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
Build app artifacts before deploying. When creating a new app, put the complete working tree under a fresh temporary directory rather than scattering files into the project, then deploy its built static output directory.
|
|
72
|
-
|
|
73
|
-
### `nook.sites.delete(site)`
|
|
74
|
-
|
|
75
|
-
Delete a site and its managed state.
|
|
76
|
-
|
|
77
|
-
```js
|
|
78
|
-
const deleted = await nook.sites.delete("demo");
|
|
79
|
-
console.log(`deleted ${deleted.site}: ${deleted.deleted}`);
|
|
80
|
-
```
|
|
75
|
+
Replace the example directory with the absolute path of an existing built artifact. Nook uploads files; it does not run a build command.
|
|
81
76
|
|
|
82
77
|
## Templates
|
|
83
78
|
|
|
84
|
-
|
|
79
|
+
Templates are reusable editable directory snapshots, separate from deployed sites.
|
|
85
80
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
81
|
+
```ts
|
|
82
|
+
type Template = {
|
|
83
|
+
name: string;
|
|
84
|
+
revisionId: string;
|
|
85
|
+
createdAt: string;
|
|
86
|
+
updatedAt: string;
|
|
87
|
+
fileCount: number;
|
|
88
|
+
byteCount: number;
|
|
89
|
+
};
|
|
90
|
+
type TemplatesApi = {
|
|
91
|
+
list(): Promise<Template[]>;
|
|
92
|
+
copy(name: string, directory: string): Promise<Template & { directory: string }>;
|
|
93
|
+
save(name: string, directory: string): Promise<Template>;
|
|
94
|
+
delete(name: string): Promise<{ template: string; deleted: boolean }>;
|
|
95
|
+
};
|
|
93
96
|
```
|
|
94
97
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
### `nook.templates.copy(name, directory)`
|
|
98
|
-
|
|
99
|
-
Copy a verified template revision into an existing empty directory.
|
|
98
|
+
These methods are called on `tau.nook.templates`:
|
|
100
99
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
The result contains the template summary fields plus `directory`.
|
|
107
|
-
|
|
108
|
-
### `nook.templates.save(name, directory)`
|
|
109
|
-
|
|
110
|
-
Save a directory as the template's new active revision. Templates use the same path, file-count, and size validation as deployments but do not require `index.html`.
|
|
111
|
-
|
|
112
|
-
```js
|
|
113
|
-
const saved = await nook.templates.save("starter", "/tmp/app-source");
|
|
114
|
-
console.log(`saved ${saved.name} revision ${saved.revisionId}`);
|
|
115
|
-
```
|
|
100
|
+
- `list()`: discover available templates and revisions.
|
|
101
|
+
- `copy(name, directory)`: copy a verified revision into an existing empty directory. The result includes its summary and the destination.
|
|
102
|
+
- `save(name, directory)`: save the directory as the template's new active revision. File/path limits match deployments, but `index.html` is not required.
|
|
103
|
+
- `delete(name)`: delete a template, not sites built from it.
|
|
116
104
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
Delete a template.
|
|
120
|
-
|
|
121
|
-
```js
|
|
122
|
-
const deleted = await nook.templates.delete("starter");
|
|
123
|
-
console.log(`deleted ${deleted.template}: ${deleted.deleted}`);
|
|
124
|
-
```
|
|
105
|
+
Template names follow the same 2–63-character format as site slugs, without the site reserved-name list. A copied template is a source snapshot, not necessarily a built static artifact. Saving a template does not deploy it.
|
|
125
106
|
|
|
126
107
|
## Per-site KV
|
|
127
108
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
### `nook.kv.get(site, key)`
|
|
131
|
-
|
|
132
|
-
Return the stored JSON value directly.
|
|
133
|
-
|
|
134
|
-
```js
|
|
135
|
-
const settings = await nook.kv.get("demo", "settings");
|
|
136
|
-
console.log(`theme: ${settings.theme}`);
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
### `nook.kv.getToFile(site, key, file)`
|
|
140
|
-
|
|
141
|
-
Write the stored JSON value to a file in the session execution environment. Parent directories are created as needed. Return `{ site, key, file, bytes }`.
|
|
142
|
-
|
|
143
|
-
```js
|
|
144
|
-
const saved = await nook.kv.getToFile("demo", "settings", "/tmp/settings.json");
|
|
145
|
-
console.log(`wrote ${saved.bytes} bytes to ${saved.file}`);
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
### `nook.kv.put(site, key, value)`
|
|
149
|
-
|
|
150
|
-
Store a JSON value and return `{ site, key }`.
|
|
151
|
-
|
|
152
|
-
```js
|
|
153
|
-
const stored = await nook.kv.put("demo", "settings", { theme: "dark" });
|
|
154
|
-
console.log(`stored ${stored.site}/${stored.key}`);
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
### `nook.kv.putFromFile(site, key, file)`
|
|
109
|
+
Values are JSON, not files or arbitrary JavaScript objects. Keys are 1–256 characters, each encoded value is at most 64 KiB, and each site permits up to 1,000 keys and 5 MiB total storage.
|
|
158
110
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
111
|
+
```ts
|
|
112
|
+
type Json = null | boolean | number | string | Json[] | { [key: string]: Json };
|
|
113
|
+
type KvEntry = { key: string; sizeBytes: number; updatedAt: string };
|
|
114
|
+
type KvApi = {
|
|
115
|
+
get(site: string, key: string): Promise<Json>;
|
|
116
|
+
getToFile(site: string, key: string, file: string): Promise<{
|
|
117
|
+
site: string; key: string; file: string; bytes: number;
|
|
118
|
+
}>;
|
|
119
|
+
put(site: string, key: string, value: Json): Promise<{ site: string; key: string }>;
|
|
120
|
+
putFromFile(site: string, key: string, file: string): Promise<{
|
|
121
|
+
site: string; key: string; file: string;
|
|
122
|
+
}>;
|
|
123
|
+
delete(site: string, key: string): Promise<{ site: string; key: string; deleted: boolean }>;
|
|
124
|
+
list(site: string, options?: { prefix?: string }): Promise<KvEntry[]>;
|
|
125
|
+
};
|
|
164
126
|
```
|
|
165
127
|
|
|
166
|
-
|
|
128
|
+
These methods are called on `tau.nook.kv`:
|
|
167
129
|
|
|
168
|
-
|
|
130
|
+
- `get`: returns the stored value directly, not an envelope. Missing keys return `null`, indistinguishable from a stored JSON null; use `list` when existence matters. Inspect the value before accessing fields.
|
|
131
|
+
- `getToFile`: writes JSON to the specified file, creating parent directories as needed. It may overwrite an existing file.
|
|
132
|
+
- `put`: stores or replaces one key's JSON value.
|
|
133
|
+
- `putFromFile`: parses UTF-8 JSON from a file of at most 64 KiB and stores its value.
|
|
134
|
+
- `delete`: removes one key; check `deleted` if existence matters.
|
|
135
|
+
- `list`: returns key metadata, not values; optional `prefix` restricts matching keys. There is no pagination argument.
|
|
169
136
|
|
|
170
137
|
```js
|
|
171
|
-
const
|
|
172
|
-
|
|
138
|
+
const keys = await tau.nook.kv.list("demo", { prefix: "todos/" });
|
|
139
|
+
for (const entry of keys) printText(`${entry.key}: ${entry.sizeBytes} bytes`);
|
|
173
140
|
```
|
|
174
141
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
Return matching key metadata as an array. `options.prefix` optionally filters keys.
|
|
178
|
-
|
|
179
|
-
```js
|
|
180
|
-
const keys = await nook.kv.list("demo", { prefix: "todos/" });
|
|
181
|
-
for (const entry of keys) {
|
|
182
|
-
console.log(`${entry.key}: ${entry.sizeBytes} bytes, updated ${entry.updatedAt}`);
|
|
183
|
-
}
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
Each entry contains `key`, `sizeBytes`, and `updatedAt`.
|
|
187
|
-
|
|
188
|
-
## Common patterns
|
|
189
|
-
|
|
190
|
-
List sites and templates concurrently:
|
|
191
|
-
|
|
192
|
-
```js
|
|
193
|
-
const [sites, templates] = await Promise.all([
|
|
194
|
-
nook.sites.list(),
|
|
195
|
-
nook.templates.list(),
|
|
196
|
-
]);
|
|
197
|
-
console.log(`sites: ${sites.map((site) => site.slug).join(", ") || "none"}`);
|
|
198
|
-
console.log(`templates: ${templates.map((template) => template.name).join(", ") || "none"}`);
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
Copy, inspect or modify with filesystem tools in later calls, build with Bash, then deploy the built directory in a later Nook call. Do not deploy an editable source directory unless it is already the complete static artifact.
|
|
202
|
-
|
|
203
|
-
## Output guidance
|
|
142
|
+
## Limits and failures
|
|
204
143
|
|
|
205
|
-
|
|
144
|
+
Invalid arguments, failed requests, invalid artifacts, and exceeded quotas throw. Mutations and local file writes are not rolled back when a program fails or is interrupted. Inspect current site, template, KV, or file state before retrying an uncertain mutation.
|
|
@@ -167,26 +167,43 @@ compartment.evaluate(String.raw`
|
|
|
167
167
|
delete globalThis._requestApi;
|
|
168
168
|
delete globalThis._writeOutput;
|
|
169
169
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
170
|
+
Object.defineProperty(globalThis, "printText", {
|
|
171
|
+
value: (text) => {
|
|
172
|
+
if (typeof text !== "string") throw new TypeError("printText expects a string");
|
|
173
|
+
writeOutputBridge("stdout", text);
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
delete globalThis.console;
|
|
177
|
+
|
|
178
|
+
function bound(values, limit, position, unit) {
|
|
179
|
+
if (!Number.isSafeInteger(limit) || limit <= 0) throw new TypeError("limit must be a positive integer");
|
|
180
|
+
if (!["middle", "start", "end"].includes(position)) throw new TypeError("invalid truncation position");
|
|
181
|
+
if (values.length <= limit) return values.join(unit === "lines" ? "\n" : "");
|
|
182
|
+
const joiner = unit === "lines" ? "\n" : "";
|
|
183
|
+
let kept = unit === "lines" ? limit - 1 : limit;
|
|
184
|
+
let marker;
|
|
185
|
+
while (true) {
|
|
186
|
+
marker = "[" + (values.length - kept) + " " + unit + " omitted]";
|
|
187
|
+
const next = unit === "lines" ? kept : Math.max(0, limit - Array.from(marker).length);
|
|
188
|
+
if (next === kept) break;
|
|
189
|
+
kept = next;
|
|
190
|
+
}
|
|
191
|
+
if (unit !== "lines" && marker.length > limit) return "…";
|
|
192
|
+
const head = position === "end" ? 0 : position === "start" ? kept : Math.ceil(kept / 2);
|
|
193
|
+
const tail = kept - head;
|
|
194
|
+
return [...values.slice(0, head), marker, ...(tail ? values.slice(-tail) : [])].join(joiner);
|
|
181
195
|
}
|
|
182
|
-
Object.defineProperty(globalThis, "
|
|
183
|
-
value:
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
})
|
|
196
|
+
Object.defineProperty(globalThis, "truncate", {
|
|
197
|
+
value: (text, { maxChars, position = "middle" }) => {
|
|
198
|
+
if (typeof text !== "string") throw new TypeError("truncate expects a string");
|
|
199
|
+
return bound(Array.from(text), maxChars, position, "characters");
|
|
200
|
+
},
|
|
201
|
+
});
|
|
202
|
+
Object.defineProperty(globalThis, "truncateLines", {
|
|
203
|
+
value: (text, { maxLines, position = "middle" }) => {
|
|
204
|
+
if (typeof text !== "string") throw new TypeError("truncateLines expects a string");
|
|
205
|
+
return bound(text.replace(/\r\n?/g, "\n").split("\n"), maxLines, position, "lines");
|
|
206
|
+
},
|
|
190
207
|
});
|
|
191
208
|
|
|
192
209
|
function serializeArguments(args) {
|
|
@@ -205,7 +222,7 @@ compartment.evaluate(String.raw`
|
|
|
205
222
|
});
|
|
206
223
|
}
|
|
207
224
|
|
|
208
|
-
Object.defineProperty(globalThis, "
|
|
225
|
+
Object.defineProperty(globalThis, "printImage", {
|
|
209
226
|
value: async (...args) => {
|
|
210
227
|
await requestApiBridge(imageMethodId, serializeArguments(args));
|
|
211
228
|
},
|