libfx 0.0.15 → 0.0.17
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 +12 -2
- package/browser-agent.js +21 -0
- package/browser-terminal.js +7 -0
- package/browser.js +12 -37
- package/bundled-asset.js +12 -0
- package/custom-provider.js +53 -21
- package/durable/local.mjs +3 -0
- package/durable/local.mjs.map +1 -0
- package/durable/vercel.mjs +3 -0
- package/durable/vercel.mjs.map +1 -0
- package/durable/world.mjs +3 -0
- package/durable/world.mjs.map +1 -0
- package/durable.js +274 -71
- package/engine.js +2498 -0
- package/fetch-cleanup.js +8 -0
- package/fx-core.wasm +0 -0
- package/fx-harness.js +1 -1
- package/fx-sdk.js +27 -3694
- package/fx-term.wasm +0 -0
- package/node-wasm.js +63 -0
- package/node.cjs +8 -8095
- package/node.js +100 -105
- package/package.json +10 -3
- package/types/libfx.d.cts +21 -8
- package/types/node.d.ts +1 -1
- package/wasm-runtime.js +1056 -0
- package/wasm-terminal.js +80 -0
- package/xterm.js +112 -0
- package/libfx.darwin-arm64.node +0 -0
- package/libfx.darwin-x64.node +0 -0
- package/libfx.linux-arm64.node +0 -0
- package/libfx.linux-x64.node +0 -0
package/fetch-cleanup.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
export const cleanupTimeoutMs = 100;
|
|
2
2
|
export const cleanupByteLimit = 64 * 1024;
|
|
3
3
|
|
|
4
|
+
// A response's Retry-After in whole seconds, read as native fx reads it
|
|
5
|
+
// (digits only), or -1 when it has none. Both hosts pass it to fx.
|
|
6
|
+
export function retryAfterSeconds(headers) {
|
|
7
|
+
const value = headers.get("retry-after")?.trim();
|
|
8
|
+
if (!value || !/^\d+$/.test(value)) return -1;
|
|
9
|
+
return Math.min(Number(value), 0x7fffffff);
|
|
10
|
+
}
|
|
11
|
+
|
|
4
12
|
// Policy only; the host owns the reader, clock, cancellation and teardown.
|
|
5
13
|
export function fetchCleanupAction(state, maxAge = cleanupTimeoutMs, maxBytes = cleanupByteLimit) {
|
|
6
14
|
if (state.eof) return "done";
|
package/fx-core.wasm
CHANGED
|
Binary file
|
package/fx-harness.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// fx as a harness of the durable core in durable.js: `createFxAgent` is that
|
|
2
2
|
// core running fx engines. Everything the core needs to know about fx is
|
|
3
3
|
// here; the core itself knows only the harness contract.
|
|
4
|
-
import { checkPromptInput, coreAnswered, engineInternals, journalMarksWanted, normalizeInstructions, normalizeModelChoice, resumeOutputShown } from "./
|
|
4
|
+
import { checkPromptInput, coreAnswered, engineInternals, journalMarksWanted, normalizeInstructions, normalizeModelChoice, resumeOutputShown } from "./engine.js";
|
|
5
5
|
import { createCredentialMemory, credentialMemory } from "./subscription.js";
|
|
6
6
|
|
|
7
7
|
const encoder = new TextEncoder();
|