@nimblebrain/synapse 0.7.0 → 0.9.0
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 +33 -0
- package/dist/{chunk-WYWKN3YG.cjs → chunk-42JAT6TK.cjs} +27 -14
- package/dist/{chunk-2HKN2A2J.js.map → chunk-42JAT6TK.cjs.map} +1 -1
- package/dist/{chunk-2HKN2A2J.js → chunk-IQYOVYIR.js} +27 -14
- package/dist/chunk-IQYOVYIR.js.map +1 -0
- package/dist/codegen/index.cjs +5 -5
- package/dist/codegen/index.d.cts +1 -1
- package/dist/codegen/index.d.ts +1 -1
- package/dist/codegen/index.js +1 -1
- package/dist/connect.iife.global.js +8 -8
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/react/index.cjs +3 -3
- package/dist/react/index.d.cts +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +1 -1
- package/dist/synapse-runtime.iife.global.js +8 -8
- package/dist/{types-Beo6hjvb.d.cts → types-C9utGXv_.d.cts} +13 -2
- package/dist/{types-Beo6hjvb.d.ts → types-C9utGXv_.d.ts} +13 -2
- package/dist/ui/fonts.cjs +19 -0
- package/dist/ui/fonts.cjs.map +1 -0
- package/dist/ui/fonts.d.cts +30 -0
- package/dist/ui/fonts.d.ts +30 -0
- package/dist/ui/fonts.js +17 -0
- package/dist/ui/fonts.js.map +1 -0
- package/dist/ui/index.cjs +1397 -0
- package/dist/ui/index.cjs.map +1 -0
- package/dist/ui/index.d.cts +415 -0
- package/dist/ui/index.d.ts +415 -0
- package/dist/ui/index.js +1366 -0
- package/dist/ui/index.js.map +1 -0
- package/package.json +11 -1
- package/dist/chunk-WYWKN3YG.cjs.map +0 -1
|
@@ -185,12 +185,23 @@ interface ToolCallResult<T = unknown> {
|
|
|
185
185
|
[key: string]: unknown;
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
|
-
/**
|
|
188
|
+
/**
|
|
189
|
+
* Result from a file picker request. Returned after the host has
|
|
190
|
+
* persisted the picked file to its workspace store; the bytes never
|
|
191
|
+
* cross the iframe boundary.
|
|
192
|
+
*
|
|
193
|
+
* Tools that need the bytes look the file up by `id` (e.g. by passing
|
|
194
|
+
* it to a tool that calls the host's file APIs server-side). Bytes
|
|
195
|
+
* inline in tool-call arguments was the prior shape and capped uploads
|
|
196
|
+
* at the JSON body limit; this `id`-shaped result removes that ceiling.
|
|
197
|
+
*/
|
|
189
198
|
interface FileResult {
|
|
199
|
+
/** Workspace file ID (`fl_` + 24 hex). Stable identifier for this
|
|
200
|
+
* file in the originating workspace. */
|
|
201
|
+
id: string;
|
|
190
202
|
filename: string;
|
|
191
203
|
mimeType: string;
|
|
192
204
|
size: number;
|
|
193
|
-
base64Data: string;
|
|
194
205
|
}
|
|
195
206
|
/** Options for requesting a file from the user */
|
|
196
207
|
interface RequestFileOptions {
|
|
@@ -185,12 +185,23 @@ interface ToolCallResult<T = unknown> {
|
|
|
185
185
|
[key: string]: unknown;
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
|
-
/**
|
|
188
|
+
/**
|
|
189
|
+
* Result from a file picker request. Returned after the host has
|
|
190
|
+
* persisted the picked file to its workspace store; the bytes never
|
|
191
|
+
* cross the iframe boundary.
|
|
192
|
+
*
|
|
193
|
+
* Tools that need the bytes look the file up by `id` (e.g. by passing
|
|
194
|
+
* it to a tool that calls the host's file APIs server-side). Bytes
|
|
195
|
+
* inline in tool-call arguments was the prior shape and capped uploads
|
|
196
|
+
* at the JSON body limit; this `id`-shaped result removes that ceiling.
|
|
197
|
+
*/
|
|
189
198
|
interface FileResult {
|
|
199
|
+
/** Workspace file ID (`fl_` + 24 hex). Stable identifier for this
|
|
200
|
+
* file in the originating workspace. */
|
|
201
|
+
id: string;
|
|
190
202
|
filename: string;
|
|
191
203
|
mimeType: string;
|
|
192
204
|
size: number;
|
|
193
|
-
base64Data: string;
|
|
194
205
|
}
|
|
195
206
|
/** Options for requesting a file from the user */
|
|
196
207
|
interface RequestFileOptions {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/ui/fonts.ts
|
|
4
|
+
var FONTSHARE_HREF = "https://api.fontshare.com/v2/css?f[]=satoshi@400,500,700&f[]=erode@400,500&display=swap";
|
|
5
|
+
var LINK_ID = "nb-synapse-fonts";
|
|
6
|
+
function injectFonts() {
|
|
7
|
+
if (typeof document === "undefined") return;
|
|
8
|
+
if (document.getElementById(LINK_ID)) return;
|
|
9
|
+
const link = document.createElement("link");
|
|
10
|
+
link.id = LINK_ID;
|
|
11
|
+
link.rel = "stylesheet";
|
|
12
|
+
link.href = FONTSHARE_HREF;
|
|
13
|
+
document.head.appendChild(link);
|
|
14
|
+
}
|
|
15
|
+
injectFonts();
|
|
16
|
+
|
|
17
|
+
exports.injectFonts = injectFonts;
|
|
18
|
+
//# sourceMappingURL=fonts.cjs.map
|
|
19
|
+
//# sourceMappingURL=fonts.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ui/fonts.ts"],"names":[],"mappings":";;;AAuBA,IAAM,cAAA,GACJ,yFAAA;AACF,IAAM,OAAA,GAAU,kBAAA;AAOT,SAAS,WAAA,GAAoB;AAClC,EAAA,IAAI,OAAO,aAAa,WAAA,EAAa;AACrC,EAAA,IAAI,QAAA,CAAS,cAAA,CAAe,OAAO,CAAA,EAAG;AACtC,EAAA,MAAM,IAAA,GAAO,QAAA,CAAS,aAAA,CAAc,MAAM,CAAA;AAC1C,EAAA,IAAA,CAAK,EAAA,GAAK,OAAA;AACV,EAAA,IAAA,CAAK,GAAA,GAAM,YAAA;AACX,EAAA,IAAA,CAAK,IAAA,GAAO,cAAA;AACZ,EAAA,QAAA,CAAS,IAAA,CAAK,YAAY,IAAI,CAAA;AAChC;AAEA,WAAA,EAAY","file":"fonts.cjs","sourcesContent":["/**\n * Loads the NimbleBrain brand fonts into the current document. Import for the\n * side effect:\n *\n * ```ts\n * import \"@nimblebrain/synapse/ui/fonts\";\n * ```\n *\n * The token contract names these fonts (`--font-sans: Satoshi`,\n * `--nb-font-heading: Erode`), but a font *name* only renders if the font\n * *files* are loaded in the iframe document — each app iframe is its own\n * document and does not inherit the host's `@font-face`s. This module injects\n * the Fontshare stylesheet so the named fonts resolve instead of silently\n * falling back.\n *\n * JetBrains Mono (`--font-mono`) is not injected here — apps that render code\n * should add `@fontsource-variable/jetbrains-mono` to their own bundle.\n *\n * CSP note: the host iframe must allow `https://api.fontshare.com` in its\n * `style-src`/`font-src` for this to take effect. If blocked, fonts fall back\n * to the neutral system stack in the token contract.\n */\n\nconst FONTSHARE_HREF =\n \"https://api.fontshare.com/v2/css?f[]=satoshi@400,500,700&f[]=erode@400,500&display=swap\";\nconst LINK_ID = \"nb-synapse-fonts\";\n\n/**\n * Inject the Fontshare brand-font stylesheet once. Idempotent and SSR-safe\n * (no-ops when `document` is unavailable). Called automatically on import;\n * exported for explicit invocation.\n */\nexport function injectFonts(): void {\n if (typeof document === \"undefined\") return;\n if (document.getElementById(LINK_ID)) return;\n const link = document.createElement(\"link\");\n link.id = LINK_ID;\n link.rel = \"stylesheet\";\n link.href = FONTSHARE_HREF;\n document.head.appendChild(link);\n}\n\ninjectFonts();\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads the NimbleBrain brand fonts into the current document. Import for the
|
|
3
|
+
* side effect:
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* import "@nimblebrain/synapse/ui/fonts";
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* The token contract names these fonts (`--font-sans: Satoshi`,
|
|
10
|
+
* `--nb-font-heading: Erode`), but a font *name* only renders if the font
|
|
11
|
+
* *files* are loaded in the iframe document — each app iframe is its own
|
|
12
|
+
* document and does not inherit the host's `@font-face`s. This module injects
|
|
13
|
+
* the Fontshare stylesheet so the named fonts resolve instead of silently
|
|
14
|
+
* falling back.
|
|
15
|
+
*
|
|
16
|
+
* JetBrains Mono (`--font-mono`) is not injected here — apps that render code
|
|
17
|
+
* should add `@fontsource-variable/jetbrains-mono` to their own bundle.
|
|
18
|
+
*
|
|
19
|
+
* CSP note: the host iframe must allow `https://api.fontshare.com` in its
|
|
20
|
+
* `style-src`/`font-src` for this to take effect. If blocked, fonts fall back
|
|
21
|
+
* to the neutral system stack in the token contract.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Inject the Fontshare brand-font stylesheet once. Idempotent and SSR-safe
|
|
25
|
+
* (no-ops when `document` is unavailable). Called automatically on import;
|
|
26
|
+
* exported for explicit invocation.
|
|
27
|
+
*/
|
|
28
|
+
declare function injectFonts(): void;
|
|
29
|
+
|
|
30
|
+
export { injectFonts };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads the NimbleBrain brand fonts into the current document. Import for the
|
|
3
|
+
* side effect:
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* import "@nimblebrain/synapse/ui/fonts";
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* The token contract names these fonts (`--font-sans: Satoshi`,
|
|
10
|
+
* `--nb-font-heading: Erode`), but a font *name* only renders if the font
|
|
11
|
+
* *files* are loaded in the iframe document — each app iframe is its own
|
|
12
|
+
* document and does not inherit the host's `@font-face`s. This module injects
|
|
13
|
+
* the Fontshare stylesheet so the named fonts resolve instead of silently
|
|
14
|
+
* falling back.
|
|
15
|
+
*
|
|
16
|
+
* JetBrains Mono (`--font-mono`) is not injected here — apps that render code
|
|
17
|
+
* should add `@fontsource-variable/jetbrains-mono` to their own bundle.
|
|
18
|
+
*
|
|
19
|
+
* CSP note: the host iframe must allow `https://api.fontshare.com` in its
|
|
20
|
+
* `style-src`/`font-src` for this to take effect. If blocked, fonts fall back
|
|
21
|
+
* to the neutral system stack in the token contract.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Inject the Fontshare brand-font stylesheet once. Idempotent and SSR-safe
|
|
25
|
+
* (no-ops when `document` is unavailable). Called automatically on import;
|
|
26
|
+
* exported for explicit invocation.
|
|
27
|
+
*/
|
|
28
|
+
declare function injectFonts(): void;
|
|
29
|
+
|
|
30
|
+
export { injectFonts };
|
package/dist/ui/fonts.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/ui/fonts.ts
|
|
2
|
+
var FONTSHARE_HREF = "https://api.fontshare.com/v2/css?f[]=satoshi@400,500,700&f[]=erode@400,500&display=swap";
|
|
3
|
+
var LINK_ID = "nb-synapse-fonts";
|
|
4
|
+
function injectFonts() {
|
|
5
|
+
if (typeof document === "undefined") return;
|
|
6
|
+
if (document.getElementById(LINK_ID)) return;
|
|
7
|
+
const link = document.createElement("link");
|
|
8
|
+
link.id = LINK_ID;
|
|
9
|
+
link.rel = "stylesheet";
|
|
10
|
+
link.href = FONTSHARE_HREF;
|
|
11
|
+
document.head.appendChild(link);
|
|
12
|
+
}
|
|
13
|
+
injectFonts();
|
|
14
|
+
|
|
15
|
+
export { injectFonts };
|
|
16
|
+
//# sourceMappingURL=fonts.js.map
|
|
17
|
+
//# sourceMappingURL=fonts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ui/fonts.ts"],"names":[],"mappings":";AAuBA,IAAM,cAAA,GACJ,yFAAA;AACF,IAAM,OAAA,GAAU,kBAAA;AAOT,SAAS,WAAA,GAAoB;AAClC,EAAA,IAAI,OAAO,aAAa,WAAA,EAAa;AACrC,EAAA,IAAI,QAAA,CAAS,cAAA,CAAe,OAAO,CAAA,EAAG;AACtC,EAAA,MAAM,IAAA,GAAO,QAAA,CAAS,aAAA,CAAc,MAAM,CAAA;AAC1C,EAAA,IAAA,CAAK,EAAA,GAAK,OAAA;AACV,EAAA,IAAA,CAAK,GAAA,GAAM,YAAA;AACX,EAAA,IAAA,CAAK,IAAA,GAAO,cAAA;AACZ,EAAA,QAAA,CAAS,IAAA,CAAK,YAAY,IAAI,CAAA;AAChC;AAEA,WAAA,EAAY","file":"fonts.js","sourcesContent":["/**\n * Loads the NimbleBrain brand fonts into the current document. Import for the\n * side effect:\n *\n * ```ts\n * import \"@nimblebrain/synapse/ui/fonts\";\n * ```\n *\n * The token contract names these fonts (`--font-sans: Satoshi`,\n * `--nb-font-heading: Erode`), but a font *name* only renders if the font\n * *files* are loaded in the iframe document — each app iframe is its own\n * document and does not inherit the host's `@font-face`s. This module injects\n * the Fontshare stylesheet so the named fonts resolve instead of silently\n * falling back.\n *\n * JetBrains Mono (`--font-mono`) is not injected here — apps that render code\n * should add `@fontsource-variable/jetbrains-mono` to their own bundle.\n *\n * CSP note: the host iframe must allow `https://api.fontshare.com` in its\n * `style-src`/`font-src` for this to take effect. If blocked, fonts fall back\n * to the neutral system stack in the token contract.\n */\n\nconst FONTSHARE_HREF =\n \"https://api.fontshare.com/v2/css?f[]=satoshi@400,500,700&f[]=erode@400,500&display=swap\";\nconst LINK_ID = \"nb-synapse-fonts\";\n\n/**\n * Inject the Fontshare brand-font stylesheet once. Idempotent and SSR-safe\n * (no-ops when `document` is unavailable). Called automatically on import;\n * exported for explicit invocation.\n */\nexport function injectFonts(): void {\n if (typeof document === \"undefined\") return;\n if (document.getElementById(LINK_ID)) return;\n const link = document.createElement(\"link\");\n link.id = LINK_ID;\n link.rel = \"stylesheet\";\n link.href = FONTSHARE_HREF;\n document.head.appendChild(link);\n}\n\ninjectFonts();\n"]}
|