@poe-platform/safe-js 0.1.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/LICENSE +21 -0
- package/README.md +206 -0
- package/dist/agent-defs/agents/claude-code.d.ts +2 -0
- package/dist/agent-defs/agents/claude-desktop.d.ts +2 -0
- package/dist/agent-defs/agents/codex.d.ts +2 -0
- package/dist/agent-defs/agents/cursor.d.ts +2 -0
- package/dist/agent-defs/agents/gemini-cli.d.ts +2 -0
- package/dist/agent-defs/agents/goose.d.ts +2 -0
- package/dist/agent-defs/agents/index.d.ts +10 -0
- package/dist/agent-defs/agents/kimi.d.ts +2 -0
- package/dist/agent-defs/agents/opencode.d.ts +2 -0
- package/dist/agent-defs/agents/pi.d.ts +2 -0
- package/dist/agent-defs/agents/poe-agent.d.ts +2 -0
- package/dist/agent-defs/capabilities.d.ts +14 -0
- package/dist/agent-defs/index.d.ts +6 -0
- package/dist/agent-defs/registry.d.ts +3 -0
- package/dist/agent-defs/specifier.d.ts +7 -0
- package/dist/agent-defs/types.d.ts +35 -0
- package/dist/agent-harness-tools/binary-exists.d.ts +10 -0
- package/dist/agent-harness-tools/execution-env.d.ts +108 -0
- package/dist/agent-harness-tools/hooks.d.ts +30 -0
- package/dist/agent-harness-tools/index.d.ts +18 -0
- package/dist/agent-harness-tools/log-stream.d.ts +28 -0
- package/dist/agent-harness-tools/participant.d.ts +10 -0
- package/dist/agent-harness-tools/paths.d.ts +14 -0
- package/dist/agent-harness-tools/plan-readiness.d.ts +7 -0
- package/dist/agent-harness-tools/plans.d.ts +35 -0
- package/dist/agent-harness-tools/poe-command-execution.d.ts +37 -0
- package/dist/agent-harness-tools/run-logs.d.ts +17 -0
- package/dist/agent-harness-tools/run-poe-command.d.ts +33 -0
- package/dist/agent-harness-tools/runner.d.ts +33 -0
- package/dist/agent-harness-tools/select-agent.d.ts +18 -0
- package/dist/agent-harness-tools/sequence.d.ts +7 -0
- package/dist/agent-harness-tools/skill-config.d.ts +1 -0
- package/dist/agent-harness-tools/stage.d.ts +22 -0
- package/dist/agent-harness-tools/workspace-transfer.d.ts +3 -0
- package/dist/agent-spawn/acp/middleware.d.ts +38 -0
- package/dist/agent-spawn/acp/types.d.ts +180 -0
- package/dist/agent-spawn/adapters/claude.d.ts +3 -0
- package/dist/agent-spawn/adapters/codex.d.ts +2 -0
- package/dist/agent-spawn/adapters/cursor.d.ts +2 -0
- package/dist/agent-spawn/adapters/index.d.ts +12 -0
- package/dist/agent-spawn/adapters/kimi.d.ts +2 -0
- package/dist/agent-spawn/adapters/native.d.ts +5 -0
- package/dist/agent-spawn/adapters/opencode.d.ts +2 -0
- package/dist/agent-spawn/adapters/pi.d.ts +2 -0
- package/dist/agent-spawn/environment.d.ts +2 -0
- package/dist/agent-spawn/parallel.d.ts +30 -0
- package/dist/agent-spawn/retry.d.ts +26 -0
- package/dist/agent-spawn/types.d.ts +272 -0
- package/dist/auth-store/create-secret-store.d.ts +2 -0
- package/dist/auth-store/encrypted-file-store.d.ts +47 -0
- package/dist/auth-store/index.d.ts +7 -0
- package/dist/auth-store/keychain-store.d.ts +25 -0
- package/dist/auth-store/provider-store.d.ts +14 -0
- package/dist/auth-store/types.d.ts +22 -0
- package/dist/config-mutations/execution/run-mutations.d.ts +7 -0
- package/dist/config-mutations/fs-utils.d.ts +18 -0
- package/dist/config-mutations/index.d.ts +8 -0
- package/dist/config-mutations/mutations/config-mutation.d.ts +47 -0
- package/dist/config-mutations/mutations/file-mutation.d.ts +62 -0
- package/dist/config-mutations/mutations/template-mutation.d.ts +40 -0
- package/dist/config-mutations/template/render.d.ts +6 -0
- package/dist/config-mutations/types.d.ts +168 -0
- package/dist/poe-code-config/compile/schema-compiler.d.ts +11 -0
- package/dist/poe-code-config/config.d.ts +2 -0
- package/dist/poe-code-config/configured-services.d.ts +29 -0
- package/dist/poe-code-config/index.d.ts +16 -0
- package/dist/poe-code-config/inspect.d.ts +13 -0
- package/dist/poe-code-config/memory.d.ts +14 -0
- package/dist/poe-code-config/merge-callbacks.d.ts +38 -0
- package/dist/poe-code-config/merge.d.ts +2 -0
- package/dist/poe-code-config/plan-scope.d.ts +8 -0
- package/dist/poe-code-config/provider-config.d.ts +16 -0
- package/dist/poe-code-config/resolve.d.ts +2 -0
- package/dist/poe-code-config/runtime.d.ts +114 -0
- package/dist/poe-code-config/schema.d.ts +14 -0
- package/dist/poe-code-config/state/fs.d.ts +24 -0
- package/dist/poe-code-config/state/index.d.ts +12 -0
- package/dist/poe-code-config/state/jobs.d.ts +34 -0
- package/dist/poe-code-config/state/templates.d.ts +18 -0
- package/dist/poe-code-config/store.d.ts +12 -0
- package/dist/poe-code-config/types.d.ts +88 -0
- package/dist/process-runner/docker/build-context.d.ts +5 -0
- package/dist/process-runner/docker/context.d.ts +3 -0
- package/dist/process-runner/docker/docker-execution-env.d.ts +28 -0
- package/dist/process-runner/docker/docker-runner.d.ts +2 -0
- package/dist/process-runner/docker/engine.d.ts +3 -0
- package/dist/process-runner/host/host-execution-env.d.ts +2 -0
- package/dist/process-runner/host/host-runner.d.ts +3 -0
- package/dist/process-runner/index.d.ts +10 -0
- package/dist/process-runner/testing/index.d.ts +2 -0
- package/dist/process-runner/testing/mock-runner.d.ts +3 -0
- package/dist/process-runner/types.d.ts +191 -0
- package/dist/process-runner/workspace-transfer.d.ts +61 -0
- package/dist/providers/auth/api-key.d.ts +5 -0
- package/dist/providers/auth/types.d.ts +14 -0
- package/dist/providers/compatibility.d.ts +4 -0
- package/dist/providers/index.d.ts +8 -0
- package/dist/providers/providers/anthropic.d.ts +1 -0
- package/dist/providers/providers/cloudflare.d.ts +1 -0
- package/dist/providers/providers/generated.d.ts +5 -0
- package/dist/providers/providers/openai.d.ts +1 -0
- package/dist/providers/providers/poe.d.ts +2 -0
- package/dist/providers/registry.d.ts +44 -0
- package/dist/providers/types.d.ts +54 -0
- package/dist/safe-fs/bridge/filesystem.d.ts +88 -0
- package/dist/safe-fs/bridge/index.d.ts +6 -0
- package/dist/safe-fs/bridge/types.d.ts +75 -0
- package/dist/safe-fs/config.d.ts +15 -0
- package/dist/safe-fs/config.node.d.ts +2 -0
- package/dist/safe-fs/contracts/errors.d.ts +50 -0
- package/dist/safe-fs/contracts/filesystem.d.ts +96 -0
- package/dist/safe-fs/contracts/index.d.ts +4 -0
- package/dist/safe-fs/contracts/io.d.ts +8 -0
- package/dist/safe-fs/contracts/path.d.ts +8 -0
- package/dist/safe-fs/contracts/portable-path.d.ts +13 -0
- package/dist/safe-fs/contracts/virtual-path.d.ts +7 -0
- package/dist/safe-fs/core.d.ts +12 -0
- package/dist/safe-fs/fs/memory/index.d.ts +58 -0
- package/dist/safe-fs/fs/mount/comparison.d.ts +19 -0
- package/dist/safe-fs/fs/mount/index.d.ts +44 -0
- package/dist/safe-fs/fs/overlay/index.d.ts +73 -0
- package/dist/safe-fs/fs/readonly/index.d.ts +31 -0
- package/dist/safe-fs/fs/real/index.d.ts +76 -0
- package/dist/safe-fs/fs/s3/filesystem.d.ts +93 -0
- package/dist/safe-fs/fs/s3/http/index.d.ts +2 -0
- package/dist/safe-fs/fs/s3/http/transport.d.ts +3 -0
- package/dist/safe-fs/fs/s3/http/types.d.ts +30 -0
- package/dist/safe-fs/fs/s3/index.d.ts +6 -0
- package/dist/safe-fs/fs/s3/mock.d.ts +48 -0
- package/dist/safe-fs/fs/s3/transport.d.ts +103 -0
- package/dist/safe-fs/fs/webdav/index.d.ts +2 -0
- package/dist/safe-fs/fs/webdav/webdav.d.ts +101 -0
- package/dist/safe-fs/index.d.ts +14 -0
- package/dist/safe-fs/node/filesystem.d.ts +11 -0
- package/dist/safe-fs/node/index.d.ts +2 -0
- package/dist/safe-fs/node-host.d.ts +1 -0
- package/dist/safe-fs/node-unavailable.d.ts +1 -0
- package/dist/safe-fs/platform/browser.d.ts +12 -0
- package/dist/safe-fs/platform/node.d.ts +13 -0
- package/dist/safe-js/browser/chunks/chunk-QGN6DKT5.js +4335 -0
- package/dist/safe-js/browser/chunks/chunk-QGN6DKT5.js.map +7 -0
- package/dist/safe-js/browser/safe-fs-core.js +67 -0
- package/dist/safe-js/browser/safe-fs-core.js.map +7 -0
- package/dist/safe-js/browser/safe-fs.js +67 -0
- package/dist/safe-js/browser/safe-fs.js.map +7 -0
- package/dist/safe-js/chunks/chunk-2QRYPKQQ.js +4315 -0
- package/dist/safe-js/chunks/chunk-2QRYPKQQ.js.map +7 -0
- package/dist/safe-js/chunks/chunk-4YIDX44G.js +40 -0
- package/dist/safe-js/chunks/chunk-4YIDX44G.js.map +7 -0
- package/dist/safe-js/chunks/chunk-7M2SJPSZ.js +2613 -0
- package/dist/safe-js/chunks/chunk-7M2SJPSZ.js.map +7 -0
- package/dist/safe-js/chunks/chunk-DC5B3GYM.js +8248 -0
- package/dist/safe-js/chunks/chunk-DC5B3GYM.js.map +7 -0
- package/dist/safe-js/chunks/chunk-Z3D76J4U.js +30732 -0
- package/dist/safe-js/chunks/chunk-Z3D76J4U.js.map +7 -0
- package/dist/safe-js/cli.d.ts +36 -0
- package/dist/safe-js/cli.js +724 -0
- package/dist/safe-js/cli.js.map +7 -0
- package/dist/safe-js/core.d.ts +6 -0
- package/dist/safe-js/core.js +14 -0
- package/dist/safe-js/core.js.map +7 -0
- package/dist/safe-js/dump.d.ts +2 -0
- package/dist/safe-js/error/format.d.ts +15 -0
- package/dist/safe-js/error/shape.d.ts +28 -0
- package/dist/safe-js/index.d.ts +56 -0
- package/dist/safe-js/index.js +454 -0
- package/dist/safe-js/index.js.map +7 -0
- package/dist/safe-js/interp/arguments.d.ts +10 -0
- package/dist/safe-js/interp/async.d.ts +56 -0
- package/dist/safe-js/interp/budget.d.ts +95 -0
- package/dist/safe-js/interp/exceptions.d.ts +45 -0
- package/dist/safe-js/interp/generator.d.ts +16 -0
- package/dist/safe-js/interp/globals/console-json.d.ts +14 -0
- package/dist/safe-js/interp/host-bridge.d.ts +29 -0
- package/dist/safe-js/interp/host-call.d.ts +130 -0
- package/dist/safe-js/interp/interpreter.d.ts +63 -0
- package/dist/safe-js/interp/promise-replay.d.ts +70 -0
- package/dist/safe-js/interp/regex/compile-guard.d.ts +33 -0
- package/dist/safe-js/interp/regex/parse.d.ts +62 -0
- package/dist/safe-js/interp/scope.d.ts +43 -0
- package/dist/safe-js/interp/values.d.ts +136 -0
- package/dist/safe-js/lint/index.d.ts +38 -0
- package/dist/safe-js/lint/rules/AS-export-import-meta.d.ts +21 -0
- package/dist/safe-js/lint/rules/module-registry.d.ts +33 -0
- package/dist/safe-js/lint.d.ts +1 -0
- package/dist/safe-js/loader/extract-block.d.ts +10 -0
- package/dist/safe-js/loader/find-exported.d.ts +2 -0
- package/dist/safe-js/loader/frontmatter.d.ts +5 -0
- package/dist/safe-js/migrate.d.ts +33 -0
- package/dist/safe-js/migration-file.d.ts +55 -0
- package/dist/safe-js/modules/agent.d.ts +132 -0
- package/dist/safe-js/modules/env.d.ts +14 -0
- package/dist/safe-js/modules/fail.d.ts +6 -0
- package/dist/safe-js/modules/fs-config.d.ts +12 -0
- package/dist/safe-js/modules/fs.d.ts +82 -0
- package/dist/safe-js/modules/harness.d.ts +19 -0
- package/dist/safe-js/modules/log.d.ts +16 -0
- package/dist/safe-js/modules/mcp-transport.d.ts +26 -0
- package/dist/safe-js/modules/mcp.d.ts +63 -0
- package/dist/safe-js/modules/metric.d.ts +4 -0
- package/dist/safe-js/modules/registry.d.ts +16 -0
- package/dist/safe-js/modules/time.d.ts +12 -0
- package/dist/safe-js/observability/otel.d.ts +21 -0
- package/dist/safe-js/output-stream.d.ts +12 -0
- package/dist/safe-js/parse/parse-export.d.ts +36 -0
- package/dist/safe-js/parse/parser.d.ts +356 -0
- package/dist/safe-js/parse/tokenizer.d.ts +26 -0
- package/dist/safe-js/parse.d.ts +4 -0
- package/dist/safe-js/random.d.ts +9 -0
- package/dist/safe-js/restore.d.ts +26 -0
- package/dist/safe-js/run.d.ts +74 -0
- package/dist/safe-js/runner/run-harness.d.ts +32 -0
- package/dist/safe-js/safe-fs-core.js +130 -0
- package/dist/safe-js/safe-fs-core.js.map +7 -0
- package/dist/safe-js/safe-fs-node.js +94 -0
- package/dist/safe-js/safe-fs-node.js.map +7 -0
- package/dist/safe-js/safe-fs.js +94 -0
- package/dist/safe-js/safe-fs.js.map +7 -0
- package/dist/safe-js/snapshot/arguments.d.ts +17 -0
- package/dist/safe-js/snapshot/backend.d.ts +19 -0
- package/dist/safe-js/snapshot/dump-format.d.ts +7 -0
- package/dist/safe-js/snapshot/dump.d.ts +23 -0
- package/dist/safe-js/snapshot/float32array.d.ts +12 -0
- package/dist/safe-js/snapshot/migration.d.ts +35 -0
- package/dist/safe-js/snapshot/policy.d.ts +49 -0
- package/dist/safe-js/snapshot/replay-data.d.ts +71 -0
- package/dist/safe-js/snapshot/validation.d.ts +15 -0
- package/dist/task-list/backends/gh-issues-client.d.ts +19 -0
- package/dist/task-list/backends/gh-issues-sync.d.ts +46 -0
- package/dist/task-list/backends/gh-issues.d.ts +21 -0
- package/dist/task-list/index.d.ts +9 -0
- package/dist/task-list/move.d.ts +2 -0
- package/dist/task-list/open.d.ts +5 -0
- package/dist/task-list/state-machine.d.ts +16 -0
- package/dist/task-list/state.d.ts +29 -0
- package/dist/task-list/types.d.ts +206 -0
- package/dist/tiny-mcp-client/index.d.ts +662 -0
- package/dist/tiny-stdio-mcp-server/content/audio.d.ts +15 -0
- package/dist/tiny-stdio-mcp-server/content/convert.d.ts +16 -0
- package/dist/tiny-stdio-mcp-server/content/file-type.d.ts +11 -0
- package/dist/tiny-stdio-mcp-server/content/file.d.ts +28 -0
- package/dist/tiny-stdio-mcp-server/content/image.d.ts +15 -0
- package/dist/tiny-stdio-mcp-server/content/index.d.ts +7 -0
- package/dist/tiny-stdio-mcp-server/content/mime.d.ts +7 -0
- package/dist/tiny-stdio-mcp-server/content/remote.d.ts +5 -0
- package/dist/tiny-stdio-mcp-server/index.d.ts +9 -0
- package/dist/tiny-stdio-mcp-server/schema.d.ts +20 -0
- package/dist/tiny-stdio-mcp-server/server.d.ts +35 -0
- package/dist/tiny-stdio-mcp-server/types.d.ts +247 -0
- package/dist/toolcraft-design/acp/components.d.ts +19 -0
- package/dist/toolcraft-design/acp/index.d.ts +4 -0
- package/dist/toolcraft-design/acp/writer.d.ts +13 -0
- package/dist/toolcraft-design/components/browser.d.ts +15 -0
- package/dist/toolcraft-design/components/catalog.d.ts +26 -0
- package/dist/toolcraft-design/components/color.d.ts +31 -0
- package/dist/toolcraft-design/components/command-errors.d.ts +18 -0
- package/dist/toolcraft-design/components/detail-card.d.ts +22 -0
- package/dist/toolcraft-design/components/file-changes.d.ts +16 -0
- package/dist/toolcraft-design/components/help-formatter-plain.d.ts +5 -0
- package/dist/toolcraft-design/components/help-formatter.d.ts +50 -0
- package/dist/toolcraft-design/components/inspector-card.d.ts +21 -0
- package/dist/toolcraft-design/components/logger.d.ts +11 -0
- package/dist/toolcraft-design/components/resource-browser.d.ts +21 -0
- package/dist/toolcraft-design/components/symbols.d.ts +12 -0
- package/dist/toolcraft-design/components/table.d.ts +16 -0
- package/dist/toolcraft-design/components/template.d.ts +19 -0
- package/dist/toolcraft-design/components/text.d.ts +16 -0
- package/dist/toolcraft-design/dashboard/buffer.d.ts +25 -0
- package/dist/toolcraft-design/dashboard/components/footer.d.ts +8 -0
- package/dist/toolcraft-design/dashboard/dashboard.d.ts +20 -0
- package/dist/toolcraft-design/dashboard/index.d.ts +8 -0
- package/dist/toolcraft-design/dashboard/should-use-dashboard.d.ts +10 -0
- package/dist/toolcraft-design/dashboard/snapshot.d.ts +10 -0
- package/dist/toolcraft-design/dashboard/terminal.d.ts +37 -0
- package/dist/toolcraft-design/dashboard/types.d.ts +38 -0
- package/dist/toolcraft-design/explorer/events.d.ts +77 -0
- package/dist/toolcraft-design/explorer/index.d.ts +8 -0
- package/dist/toolcraft-design/explorer/keymap.d.ts +31 -0
- package/dist/toolcraft-design/explorer/runtime.d.ts +2 -0
- package/dist/toolcraft-design/explorer/state.d.ts +224 -0
- package/dist/toolcraft-design/index.d.ts +62 -0
- package/dist/toolcraft-design/internal/output-format.d.ts +6 -0
- package/dist/toolcraft-design/internal/strip-ansi.d.ts +1 -0
- package/dist/toolcraft-design/internal/theme-detect.d.ts +12 -0
- package/dist/toolcraft-design/internal/theme-state.d.ts +12 -0
- package/dist/toolcraft-design/prompts/index.d.ts +91 -0
- package/dist/toolcraft-design/prompts/interactive/cancel-symbol.d.ts +2 -0
- package/dist/toolcraft-design/prompts/interactive/select.d.ts +18 -0
- package/dist/toolcraft-design/prompts/primitives/cancel.d.ts +2 -0
- package/dist/toolcraft-design/prompts/primitives/intro.d.ts +1 -0
- package/dist/toolcraft-design/prompts/primitives/log.d.ts +18 -0
- package/dist/toolcraft-design/prompts/primitives/note.d.ts +1 -0
- package/dist/toolcraft-design/prompts/primitives/outro.d.ts +1 -0
- package/dist/toolcraft-design/prompts/primitives/spinner.d.ts +6 -0
- package/dist/toolcraft-design/prompts/theme.d.ts +11 -0
- package/dist/toolcraft-design/screen/screen.d.ts +40 -0
- package/dist/toolcraft-design/screen/style.d.ts +16 -0
- package/dist/toolcraft-design/static/index.d.ts +4 -0
- package/dist/toolcraft-design/static/menu.d.ts +11 -0
- package/dist/toolcraft-design/static/spinner.d.ts +14 -0
- package/dist/toolcraft-design/terminal/driver.d.ts +34 -0
- package/dist/toolcraft-design/terminal/input.d.ts +25 -0
- package/dist/toolcraft-design/terminal-markdown/ast.d.ts +98 -0
- package/dist/toolcraft-design/terminal-markdown/html-renderer.d.ts +7 -0
- package/dist/toolcraft-design/terminal-markdown/index.d.ts +12 -0
- package/dist/toolcraft-design/terminal-markdown/parser.d.ts +5 -0
- package/dist/toolcraft-design/terminal-markdown/plaintext-renderer.d.ts +11 -0
- package/dist/toolcraft-design/terminal-markdown/renderer.d.ts +7 -0
- package/dist/toolcraft-design/tokens/brand.d.ts +5 -0
- package/dist/toolcraft-design/tokens/colors.d.ts +37 -0
- package/dist/toolcraft-design/tokens/index.d.ts +6 -0
- package/dist/toolcraft-design/tokens/spacing.d.ts +6 -0
- package/dist/toolcraft-design/tokens/typography.d.ts +7 -0
- package/dist/toolcraft-design/tokens/widths.d.ts +5 -0
- package/dist/toolcraft-schema/index.d.ts +184 -0
- package/dist/toolcraft-schema/json-schema/index.d.ts +5 -0
- package/dist/toolcraft-schema/json-schema/types.d.ts +33 -0
- package/dist/toolcraft-schema/json-schema-document.d.ts +14 -0
- package/dist/toolcraft-schema/json.d.ts +10 -0
- package/dist/toolcraft-schema/oneof.d.ts +15 -0
- package/dist/toolcraft-schema/record.d.ts +5 -0
- package/dist/toolcraft-schema/union.d.ts +8 -0
- package/dist/toolcraft-schema/validate.d.ts +17 -0
- package/package.json +89 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type Diagnostic } from "../lint.js";
|
|
2
|
+
import type { ModuleRegistry } from "../modules/registry.js";
|
|
3
|
+
import type { OtelSink } from "../observability/otel.js";
|
|
4
|
+
import { type RunOptions, type RunResult } from "../run.js";
|
|
5
|
+
import type { SnapshotBackend } from "../snapshot/backend.js";
|
|
6
|
+
type HarnessMeta = {
|
|
7
|
+
filepath: string;
|
|
8
|
+
kind: unknown;
|
|
9
|
+
version: unknown;
|
|
10
|
+
};
|
|
11
|
+
export type RunHarnessOptions = {
|
|
12
|
+
budget?: RunOptions["budget"];
|
|
13
|
+
modulesFor: (frontmatter: Record<string, unknown>, meta: HarnessMeta) => ModuleRegistry;
|
|
14
|
+
otelSink?: OtelSink;
|
|
15
|
+
signal?: AbortSignal;
|
|
16
|
+
snapshotBackend?: SnapshotBackend;
|
|
17
|
+
snapshotIntervalMs?: number;
|
|
18
|
+
snapshotPath?: string;
|
|
19
|
+
};
|
|
20
|
+
export type RunHarnessExecutionErrorResult = {
|
|
21
|
+
aborted?: true;
|
|
22
|
+
error: unknown;
|
|
23
|
+
ok: false;
|
|
24
|
+
};
|
|
25
|
+
export type RunHarnessResult = RunResult | RunHarnessExecutionErrorResult;
|
|
26
|
+
export declare class LintError extends Error {
|
|
27
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
28
|
+
constructor(diagnostics: readonly Diagnostic[]);
|
|
29
|
+
}
|
|
30
|
+
export declare function runHarness(filepath: string, options: RunHarnessOptions): Promise<RunHarnessResult>;
|
|
31
|
+
export declare function runHarnessPair(filepath: string, options: RunHarnessOptions): Promise<RunHarnessResult>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ACCESS_MODES,
|
|
3
|
+
FileSystemBridge,
|
|
4
|
+
FsError,
|
|
5
|
+
MemoryFileSystem,
|
|
6
|
+
MountFileSystem,
|
|
7
|
+
OverlayFileSystem,
|
|
8
|
+
ReadOnlyFileSystem,
|
|
9
|
+
WebDavFileSystem,
|
|
10
|
+
assertPathWithin,
|
|
11
|
+
collectBytes,
|
|
12
|
+
compareEntries,
|
|
13
|
+
createMemoryFileSystem,
|
|
14
|
+
createMountFileSystem,
|
|
15
|
+
createOverlayFileSystem,
|
|
16
|
+
createReadOnlyFileSystem,
|
|
17
|
+
dirname,
|
|
18
|
+
isErrnoCode,
|
|
19
|
+
isFsError,
|
|
20
|
+
isPathWithin,
|
|
21
|
+
normalizePath,
|
|
22
|
+
platform,
|
|
23
|
+
readBytes,
|
|
24
|
+
relativePath,
|
|
25
|
+
resolvePath,
|
|
26
|
+
toByteSource,
|
|
27
|
+
toFsError,
|
|
28
|
+
validatePath
|
|
29
|
+
} from "./chunks/chunk-2QRYPKQQ.js";
|
|
30
|
+
import "./chunks/chunk-4YIDX44G.js";
|
|
31
|
+
|
|
32
|
+
// packages/safe-fs/src/contracts/portable-path.ts
|
|
33
|
+
function assertString(value) {
|
|
34
|
+
if (typeof value !== "string") throw new TypeError("path must be a string");
|
|
35
|
+
}
|
|
36
|
+
function basename(path, suffix = "") {
|
|
37
|
+
assertString(path);
|
|
38
|
+
assertString(suffix);
|
|
39
|
+
if (suffix && path === suffix) return "";
|
|
40
|
+
let end = path.length;
|
|
41
|
+
while (end > 0 && path[end - 1] === "/") end--;
|
|
42
|
+
if (end === 0 && suffix && suffix.length <= path.length) return path;
|
|
43
|
+
const start = path.lastIndexOf("/", end - 1) + 1;
|
|
44
|
+
const base = path.slice(start, end);
|
|
45
|
+
if (suffix.length > base.length && suffix.length <= path.length && suffix.endsWith(base)) return path.slice(start);
|
|
46
|
+
return suffix && suffix.length < base.length && base.endsWith(suffix) ? base.slice(0, -suffix.length) : base;
|
|
47
|
+
}
|
|
48
|
+
var dirname2 = dirname;
|
|
49
|
+
function extname(path) {
|
|
50
|
+
const base = basename(path);
|
|
51
|
+
const position = base.lastIndexOf(".");
|
|
52
|
+
return position <= 0 || base === ".." ? "" : base.slice(position);
|
|
53
|
+
}
|
|
54
|
+
function isAbsolutePath(path) {
|
|
55
|
+
assertString(path);
|
|
56
|
+
return path.startsWith("/");
|
|
57
|
+
}
|
|
58
|
+
function joinPath(...paths) {
|
|
59
|
+
for (const path of paths) assertString(path);
|
|
60
|
+
const joined = paths.filter(Boolean).join("/");
|
|
61
|
+
if (!joined) return ".";
|
|
62
|
+
const absolute = joined.startsWith("/");
|
|
63
|
+
const components = [];
|
|
64
|
+
for (const component of joined.split("/")) {
|
|
65
|
+
if (!component || component === ".") continue;
|
|
66
|
+
if (component === "..") {
|
|
67
|
+
if (components.length && components.at(-1) !== "..") components.pop();
|
|
68
|
+
else if (!absolute) components.push(component);
|
|
69
|
+
} else components.push(component);
|
|
70
|
+
}
|
|
71
|
+
const result = `${absolute ? "/" : ""}${components.join("/")}` || ".";
|
|
72
|
+
return joined.endsWith("/") && result !== "/" ? `${result}/` : result;
|
|
73
|
+
}
|
|
74
|
+
var posixPath = Object.freeze({ basename, dirname: dirname2, extname, join: joinPath, isAbsolute: isAbsolutePath });
|
|
75
|
+
|
|
76
|
+
// packages/safe-fs/src/bridge/index.ts
|
|
77
|
+
function createFsBridge(fs, options) {
|
|
78
|
+
if (options === void 0 || options === null) throw new TypeError("An explicit filesystem codec is required");
|
|
79
|
+
return new FileSystemBridge(fs, options, {
|
|
80
|
+
codec: options.codec,
|
|
81
|
+
copyBytes(bytes) {
|
|
82
|
+
return new Uint8Array(bytes);
|
|
83
|
+
},
|
|
84
|
+
randomSuffix() {
|
|
85
|
+
return platform.randomUUID().slice(0, 6);
|
|
86
|
+
},
|
|
87
|
+
paths: {
|
|
88
|
+
isAbsolute(path) {
|
|
89
|
+
return typeof path === "string" && path.startsWith("/");
|
|
90
|
+
},
|
|
91
|
+
dirname,
|
|
92
|
+
relative: relativePath,
|
|
93
|
+
resolve: resolvePath
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
ACCESS_MODES,
|
|
99
|
+
FsError,
|
|
100
|
+
MemoryFileSystem,
|
|
101
|
+
MountFileSystem,
|
|
102
|
+
OverlayFileSystem,
|
|
103
|
+
ReadOnlyFileSystem,
|
|
104
|
+
WebDavFileSystem,
|
|
105
|
+
assertPathWithin,
|
|
106
|
+
basename,
|
|
107
|
+
collectBytes,
|
|
108
|
+
compareEntries,
|
|
109
|
+
createFsBridge,
|
|
110
|
+
createMemoryFileSystem,
|
|
111
|
+
createMountFileSystem,
|
|
112
|
+
createOverlayFileSystem,
|
|
113
|
+
createReadOnlyFileSystem,
|
|
114
|
+
dirname2 as dirname,
|
|
115
|
+
extname,
|
|
116
|
+
isAbsolutePath,
|
|
117
|
+
isErrnoCode,
|
|
118
|
+
isFsError,
|
|
119
|
+
isPathWithin,
|
|
120
|
+
joinPath,
|
|
121
|
+
normalizePath,
|
|
122
|
+
posixPath,
|
|
123
|
+
readBytes,
|
|
124
|
+
relativePath,
|
|
125
|
+
resolvePath,
|
|
126
|
+
toByteSource,
|
|
127
|
+
toFsError,
|
|
128
|
+
validatePath
|
|
129
|
+
};
|
|
130
|
+
//# sourceMappingURL=safe-fs-core.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../safe-fs/src/contracts/portable-path.ts", "../../safe-fs/src/bridge/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { dirname as virtualDirname } from \"./virtual-path.js\";\n\nfunction assertString(value: unknown): asserts value is string {\n if (typeof value !== \"string\") throw new TypeError(\"path must be a string\");\n}\n\nexport function basename(path: string, suffix = \"\"): string {\n assertString(path);\n assertString(suffix);\n if (suffix && path === suffix) return \"\";\n let end = path.length;\n while (end > 0 && path[end - 1] === \"/\") end--;\n if (end === 0 && suffix && suffix.length <= path.length) return path;\n const start = path.lastIndexOf(\"/\", end - 1) + 1;\n const base = path.slice(start, end);\n if (suffix.length > base.length && suffix.length <= path.length && suffix.endsWith(base)) return path.slice(start);\n return suffix && suffix.length < base.length && base.endsWith(suffix)\n ? base.slice(0, -suffix.length)\n : base;\n}\n\nexport const dirname = virtualDirname;\n\nexport function extname(path: string): string {\n const base = basename(path);\n const position = base.lastIndexOf(\".\");\n return position <= 0 || base === \"..\" ? \"\" : base.slice(position);\n}\n\nexport function isAbsolutePath(path: string): boolean {\n assertString(path);\n return path.startsWith(\"/\");\n}\n\nexport function joinPath(...paths: string[]): string {\n for (const path of paths) assertString(path);\n const joined = paths.filter(Boolean).join(\"/\");\n if (!joined) return \".\";\n const absolute = joined.startsWith(\"/\");\n const components: string[] = [];\n for (const component of joined.split(\"/\")) {\n if (!component || component === \".\") continue;\n if (component === \"..\") {\n if (components.length && components.at(-1) !== \"..\") components.pop();\n else if (!absolute) components.push(component);\n } else components.push(component);\n }\n const result = `${absolute ? \"/\" : \"\"}${components.join(\"/\")}` || \".\";\n return joined.endsWith(\"/\") && result !== \"/\" ? `${result}/` : result;\n}\n\nexport const posixPath = Object.freeze({ basename, dirname, extname, join: joinPath, isAbsolute: isAbsolutePath });\n", "import { platform } from \"#safe-fs-platform\";\nimport type { FileSystem } from \"../contracts/filesystem.js\";\nimport { dirname, relativePath, resolvePath } from \"../contracts/virtual-path.js\";\nimport { FileSystemBridge } from \"./filesystem.js\";\nimport type { FsBridgeOptions } from \"./types.js\";\n\nexport type {\n FsBridgeCodec, FsBridgeDirent, FsBridgeEncoding, FsBridgeFileSystem, FsBridgeOptions, FsBridgeStats\n} from \"./types.js\";\nexport type FsBridge = FileSystemBridge<Uint8Array<ArrayBuffer>>;\n\nexport function createFsBridge(fs: FileSystem, options: FsBridgeOptions): FsBridge {\n if (options === undefined || options === null) throw new TypeError(\"An explicit filesystem codec is required\");\n return new FileSystemBridge(fs, options, {\n codec: options.codec,\n copyBytes(bytes) { return new Uint8Array(bytes); },\n randomSuffix() { return platform.randomUUID().slice(0, 6); },\n paths: {\n isAbsolute(path) { return typeof path === \"string\" && path.startsWith(\"/\"); },\n dirname,\n relative: relativePath,\n resolve: resolvePath\n }\n });\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,aAAa,OAAyC;AAC7D,MAAI,OAAO,UAAU,SAAU,OAAM,IAAI,UAAU,uBAAuB;AAC5E;AAEO,SAAS,SAAS,MAAc,SAAS,IAAY;AAC1D,eAAa,IAAI;AACjB,eAAa,MAAM;AACnB,MAAI,UAAU,SAAS,OAAQ,QAAO;AACtC,MAAI,MAAM,KAAK;AACf,SAAO,MAAM,KAAK,KAAK,MAAM,CAAC,MAAM,IAAK;AACzC,MAAI,QAAQ,KAAK,UAAU,OAAO,UAAU,KAAK,OAAQ,QAAO;AAChE,QAAM,QAAQ,KAAK,YAAY,KAAK,MAAM,CAAC,IAAI;AAC/C,QAAM,OAAO,KAAK,MAAM,OAAO,GAAG;AAClC,MAAI,OAAO,SAAS,KAAK,UAAU,OAAO,UAAU,KAAK,UAAU,OAAO,SAAS,IAAI,EAAG,QAAO,KAAK,MAAM,KAAK;AACjH,SAAO,UAAU,OAAO,SAAS,KAAK,UAAU,KAAK,SAAS,MAAM,IAChE,KAAK,MAAM,GAAG,CAAC,OAAO,MAAM,IAC5B;AACN;AAEO,IAAMA,WAAU;AAEhB,SAAS,QAAQ,MAAsB;AAC5C,QAAM,OAAO,SAAS,IAAI;AAC1B,QAAM,WAAW,KAAK,YAAY,GAAG;AACrC,SAAO,YAAY,KAAK,SAAS,OAAO,KAAK,KAAK,MAAM,QAAQ;AAClE;AAEO,SAAS,eAAe,MAAuB;AACpD,eAAa,IAAI;AACjB,SAAO,KAAK,WAAW,GAAG;AAC5B;AAEO,SAAS,YAAY,OAAyB;AACnD,aAAW,QAAQ,MAAO,cAAa,IAAI;AAC3C,QAAM,SAAS,MAAM,OAAO,OAAO,EAAE,KAAK,GAAG;AAC7C,MAAI,CAAC,OAAQ,QAAO;AACpB,QAAM,WAAW,OAAO,WAAW,GAAG;AACtC,QAAM,aAAuB,CAAC;AAC9B,aAAW,aAAa,OAAO,MAAM,GAAG,GAAG;AACzC,QAAI,CAAC,aAAa,cAAc,IAAK;AACrC,QAAI,cAAc,MAAM;AACtB,UAAI,WAAW,UAAU,WAAW,GAAG,EAAE,MAAM,KAAM,YAAW,IAAI;AAAA,eAC3D,CAAC,SAAU,YAAW,KAAK,SAAS;AAAA,IAC/C,MAAO,YAAW,KAAK,SAAS;AAAA,EAClC;AACA,QAAM,SAAS,GAAG,WAAW,MAAM,EAAE,GAAG,WAAW,KAAK,GAAG,CAAC,MAAM;AAClE,SAAO,OAAO,SAAS,GAAG,KAAK,WAAW,MAAM,GAAG,MAAM,MAAM;AACjE;AAEO,IAAM,YAAY,OAAO,OAAO,EAAE,UAAU,SAAAA,UAAS,SAAS,MAAM,UAAU,YAAY,eAAe,CAAC;;;ACxC1G,SAAS,eAAe,IAAgB,SAAoC;AACjF,MAAI,YAAY,UAAa,YAAY,KAAM,OAAM,IAAI,UAAU,0CAA0C;AAC7G,SAAO,IAAI,iBAAiB,IAAI,SAAS;AAAA,IACvC,OAAO,QAAQ;AAAA,IACf,UAAU,OAAO;AAAE,aAAO,IAAI,WAAW,KAAK;AAAA,IAAG;AAAA,IACjD,eAAe;AAAE,aAAO,SAAS,WAAW,EAAE,MAAM,GAAG,CAAC;AAAA,IAAG;AAAA,IAC3D,OAAO;AAAA,MACL,WAAW,MAAM;AAAE,eAAO,OAAO,SAAS,YAAY,KAAK,WAAW,GAAG;AAAA,MAAG;AAAA,MAC5E;AAAA,MACA,UAAU;AAAA,MACV,SAAS;AAAA,IACX;AAAA,EACF,CAAC;AACH;",
|
|
6
|
+
"names": ["dirname"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MockS3Client,
|
|
3
|
+
RealFileSystem,
|
|
4
|
+
S3FileSystem,
|
|
5
|
+
S3RenameError,
|
|
6
|
+
S3ServiceError,
|
|
7
|
+
basename,
|
|
8
|
+
createFileSystem,
|
|
9
|
+
createNodeFileSystemAdapterRegistry,
|
|
10
|
+
createNodeFsBridge,
|
|
11
|
+
createRealFileSystem,
|
|
12
|
+
createS3HttpTransport,
|
|
13
|
+
createS3Transport,
|
|
14
|
+
dirname,
|
|
15
|
+
encodeCopySource,
|
|
16
|
+
extname,
|
|
17
|
+
isAbsolutePath,
|
|
18
|
+
joinPath,
|
|
19
|
+
posixPath,
|
|
20
|
+
readConfigRecord,
|
|
21
|
+
validateFileSystemConfig
|
|
22
|
+
} from "./chunks/chunk-7M2SJPSZ.js";
|
|
23
|
+
import {
|
|
24
|
+
ACCESS_MODES,
|
|
25
|
+
FsError,
|
|
26
|
+
MemoryFileSystem,
|
|
27
|
+
MountFileSystem,
|
|
28
|
+
OverlayFileSystem,
|
|
29
|
+
ReadOnlyFileSystem,
|
|
30
|
+
WebDavFileSystem,
|
|
31
|
+
assertPathWithin,
|
|
32
|
+
collectBytes,
|
|
33
|
+
createMemoryFileSystem,
|
|
34
|
+
createMountFileSystem,
|
|
35
|
+
createOverlayFileSystem,
|
|
36
|
+
createReadOnlyFileSystem,
|
|
37
|
+
isErrnoCode,
|
|
38
|
+
isFsError,
|
|
39
|
+
isPathWithin,
|
|
40
|
+
normalizePath,
|
|
41
|
+
readBytes,
|
|
42
|
+
relativePath,
|
|
43
|
+
resolvePath,
|
|
44
|
+
toByteSource,
|
|
45
|
+
toFsError,
|
|
46
|
+
validatePath
|
|
47
|
+
} from "./chunks/chunk-2QRYPKQQ.js";
|
|
48
|
+
import "./chunks/chunk-4YIDX44G.js";
|
|
49
|
+
export {
|
|
50
|
+
ACCESS_MODES,
|
|
51
|
+
FsError,
|
|
52
|
+
MemoryFileSystem,
|
|
53
|
+
MockS3Client,
|
|
54
|
+
MountFileSystem,
|
|
55
|
+
OverlayFileSystem,
|
|
56
|
+
ReadOnlyFileSystem,
|
|
57
|
+
RealFileSystem,
|
|
58
|
+
S3FileSystem,
|
|
59
|
+
S3RenameError,
|
|
60
|
+
S3ServiceError,
|
|
61
|
+
WebDavFileSystem,
|
|
62
|
+
assertPathWithin,
|
|
63
|
+
basename,
|
|
64
|
+
collectBytes,
|
|
65
|
+
createFileSystem,
|
|
66
|
+
createMemoryFileSystem,
|
|
67
|
+
createMountFileSystem,
|
|
68
|
+
createNodeFileSystemAdapterRegistry,
|
|
69
|
+
createNodeFsBridge,
|
|
70
|
+
createOverlayFileSystem,
|
|
71
|
+
createReadOnlyFileSystem,
|
|
72
|
+
createRealFileSystem,
|
|
73
|
+
createS3HttpTransport,
|
|
74
|
+
createS3Transport,
|
|
75
|
+
dirname,
|
|
76
|
+
encodeCopySource,
|
|
77
|
+
extname,
|
|
78
|
+
isAbsolutePath,
|
|
79
|
+
isErrnoCode,
|
|
80
|
+
isFsError,
|
|
81
|
+
isPathWithin,
|
|
82
|
+
joinPath,
|
|
83
|
+
normalizePath,
|
|
84
|
+
posixPath,
|
|
85
|
+
readBytes,
|
|
86
|
+
readConfigRecord,
|
|
87
|
+
relativePath,
|
|
88
|
+
resolvePath,
|
|
89
|
+
toByteSource,
|
|
90
|
+
toFsError,
|
|
91
|
+
validateFileSystemConfig,
|
|
92
|
+
validatePath
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=safe-fs-node.js.map
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MockS3Client,
|
|
3
|
+
RealFileSystem,
|
|
4
|
+
S3FileSystem,
|
|
5
|
+
S3RenameError,
|
|
6
|
+
S3ServiceError,
|
|
7
|
+
basename,
|
|
8
|
+
createFileSystem,
|
|
9
|
+
createNodeFileSystemAdapterRegistry,
|
|
10
|
+
createNodeFsBridge,
|
|
11
|
+
createRealFileSystem,
|
|
12
|
+
createS3HttpTransport,
|
|
13
|
+
createS3Transport,
|
|
14
|
+
dirname,
|
|
15
|
+
encodeCopySource,
|
|
16
|
+
extname,
|
|
17
|
+
isAbsolutePath,
|
|
18
|
+
joinPath,
|
|
19
|
+
posixPath,
|
|
20
|
+
readConfigRecord,
|
|
21
|
+
validateFileSystemConfig
|
|
22
|
+
} from "./chunks/chunk-7M2SJPSZ.js";
|
|
23
|
+
import {
|
|
24
|
+
ACCESS_MODES,
|
|
25
|
+
FsError,
|
|
26
|
+
MemoryFileSystem,
|
|
27
|
+
MountFileSystem,
|
|
28
|
+
OverlayFileSystem,
|
|
29
|
+
ReadOnlyFileSystem,
|
|
30
|
+
WebDavFileSystem,
|
|
31
|
+
assertPathWithin,
|
|
32
|
+
collectBytes,
|
|
33
|
+
createMemoryFileSystem,
|
|
34
|
+
createMountFileSystem,
|
|
35
|
+
createOverlayFileSystem,
|
|
36
|
+
createReadOnlyFileSystem,
|
|
37
|
+
isErrnoCode,
|
|
38
|
+
isFsError,
|
|
39
|
+
isPathWithin,
|
|
40
|
+
normalizePath,
|
|
41
|
+
readBytes,
|
|
42
|
+
relativePath,
|
|
43
|
+
resolvePath,
|
|
44
|
+
toByteSource,
|
|
45
|
+
toFsError,
|
|
46
|
+
validatePath
|
|
47
|
+
} from "./chunks/chunk-2QRYPKQQ.js";
|
|
48
|
+
import "./chunks/chunk-4YIDX44G.js";
|
|
49
|
+
export {
|
|
50
|
+
ACCESS_MODES,
|
|
51
|
+
FsError,
|
|
52
|
+
MemoryFileSystem,
|
|
53
|
+
MockS3Client,
|
|
54
|
+
MountFileSystem,
|
|
55
|
+
OverlayFileSystem,
|
|
56
|
+
ReadOnlyFileSystem,
|
|
57
|
+
RealFileSystem,
|
|
58
|
+
S3FileSystem,
|
|
59
|
+
S3RenameError,
|
|
60
|
+
S3ServiceError,
|
|
61
|
+
WebDavFileSystem,
|
|
62
|
+
assertPathWithin,
|
|
63
|
+
basename,
|
|
64
|
+
collectBytes,
|
|
65
|
+
createFileSystem,
|
|
66
|
+
createMemoryFileSystem,
|
|
67
|
+
createMountFileSystem,
|
|
68
|
+
createNodeFileSystemAdapterRegistry,
|
|
69
|
+
createNodeFsBridge,
|
|
70
|
+
createOverlayFileSystem,
|
|
71
|
+
createReadOnlyFileSystem,
|
|
72
|
+
createRealFileSystem,
|
|
73
|
+
createS3HttpTransport,
|
|
74
|
+
createS3Transport,
|
|
75
|
+
dirname,
|
|
76
|
+
encodeCopySource,
|
|
77
|
+
extname,
|
|
78
|
+
isAbsolutePath,
|
|
79
|
+
isErrnoCode,
|
|
80
|
+
isFsError,
|
|
81
|
+
isPathWithin,
|
|
82
|
+
joinPath,
|
|
83
|
+
normalizePath,
|
|
84
|
+
posixPath,
|
|
85
|
+
readBytes,
|
|
86
|
+
readConfigRecord,
|
|
87
|
+
relativePath,
|
|
88
|
+
resolvePath,
|
|
89
|
+
toByteSource,
|
|
90
|
+
toFsError,
|
|
91
|
+
validateFileSystemConfig,
|
|
92
|
+
validatePath
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=safe-fs.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SandboxObject, SandboxValue } from "../interp/values.js";
|
|
2
|
+
type PropertyFlags = {
|
|
3
|
+
configurable: boolean;
|
|
4
|
+
enumerable: boolean;
|
|
5
|
+
writable: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type SerializedArguments<TValue> = {
|
|
8
|
+
kind: "arguments";
|
|
9
|
+
extensible: boolean;
|
|
10
|
+
lengthBeforeCallee: boolean;
|
|
11
|
+
iterator: PropertyFlags | null;
|
|
12
|
+
properties: Record<string, PropertyFlags & {
|
|
13
|
+
value: TValue;
|
|
14
|
+
}>;
|
|
15
|
+
};
|
|
16
|
+
export declare function serializeArguments<TValue>(value: SandboxObject, serializeValue: (entry: SandboxValue, key: string) => TValue): SerializedArguments<TValue>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SafeJSSnapshot } from "../restore.js";
|
|
2
|
+
export type Snapshot = SafeJSSnapshot;
|
|
3
|
+
export interface SnapshotBackend {
|
|
4
|
+
read(): Promise<Snapshot | undefined>;
|
|
5
|
+
write(snapshot: Snapshot): Promise<void>;
|
|
6
|
+
remove(): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export type FileSnapshotBackendOptions = {
|
|
9
|
+
writeMaxAttempts?: number;
|
|
10
|
+
writeRetryDelayMs?: number;
|
|
11
|
+
};
|
|
12
|
+
export declare class FileSnapshotBackend implements SnapshotBackend {
|
|
13
|
+
#private;
|
|
14
|
+
readonly path: string;
|
|
15
|
+
constructor(path: string, options?: FileSnapshotBackendOptions);
|
|
16
|
+
read(): Promise<Snapshot | undefined>;
|
|
17
|
+
write(snapshot: Snapshot): Promise<void>;
|
|
18
|
+
remove(): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const DUMP_FORMAT_VERSION = 1;
|
|
2
|
+
export declare const EXECUTION_SEMANTICS = "jobs-v7";
|
|
3
|
+
export type DumpableSnapshot = {
|
|
4
|
+
sourceHash: string;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
};
|
|
7
|
+
export declare function serializeSafeJSSnapshot(snapshot: DumpableSnapshot): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
import type { RunResult, RunSnapshot } from "../run.js";
|
|
3
|
+
export type DumpOptions = {
|
|
4
|
+
mode?: "capture" | "replay";
|
|
5
|
+
onFailure?: "throw" | "checkpoint";
|
|
6
|
+
};
|
|
7
|
+
type DumpController = {
|
|
8
|
+
fail(error: unknown): void;
|
|
9
|
+
finalize(snapshot: RunSnapshot): void;
|
|
10
|
+
onYield(createSnapshot: () => RunSnapshot): void;
|
|
11
|
+
requestCurrentSnapshot(options?: DumpOptions): Promise<string>;
|
|
12
|
+
requestSnapshot(options?: DumpOptions): Promise<string>;
|
|
13
|
+
};
|
|
14
|
+
export type RunLifecycle = {
|
|
15
|
+
hostCallbackContext: AsyncLocalStorage<boolean>;
|
|
16
|
+
hostCallbackDepth: number;
|
|
17
|
+
};
|
|
18
|
+
export declare function attachDumpController(result: Promise<RunResult>, controller: DumpController): Promise<RunResult>;
|
|
19
|
+
export declare function createDumpController(lifecycle?: RunLifecycle): DumpController;
|
|
20
|
+
export declare function dump(result: Pick<RunResult, "snapshot"> | PromiseLike<RunResult>, options?: DumpOptions): Promise<string>;
|
|
21
|
+
export declare function dumpCurrent(result: Pick<RunResult, "snapshot"> | PromiseLike<RunResult>): Promise<string>;
|
|
22
|
+
export declare function serializeRunSnapshot(snapshot: RunSnapshot): string;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type Float32Data<TReference> = {
|
|
2
|
+
kind: "float32array";
|
|
3
|
+
byteOffset: number;
|
|
4
|
+
length: number;
|
|
5
|
+
} & ({
|
|
6
|
+
bytes: number[];
|
|
7
|
+
} | {
|
|
8
|
+
buffer: TReference;
|
|
9
|
+
});
|
|
10
|
+
export declare function encodeFloat32Storage<TReference>(value: Float32Array, id: number, buffers: WeakMap<ArrayBuffer, number>, reference: (id: number) => TReference): Float32Data<TReference>;
|
|
11
|
+
export declare function validateFloat32Storage(value: Record<string, unknown>): void;
|
|
12
|
+
export declare function decodeFloat32Storage(value: Record<string, unknown>, resolve: (reference: unknown) => unknown): Float32Array;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type HostCallReplay } from "../interp/host-call.js";
|
|
2
|
+
import { type ReplayData } from "./replay-data.js";
|
|
3
|
+
import type { CompileOwner } from "../interp/budget.js";
|
|
4
|
+
export type SnapshotMigrationResolution = {
|
|
5
|
+
callId: string;
|
|
6
|
+
disposition: "not-performed";
|
|
7
|
+
} | {
|
|
8
|
+
callId: string;
|
|
9
|
+
disposition: "fulfilled";
|
|
10
|
+
value: unknown;
|
|
11
|
+
} | {
|
|
12
|
+
callId: string;
|
|
13
|
+
disposition: "rejected";
|
|
14
|
+
reason: unknown;
|
|
15
|
+
};
|
|
16
|
+
export type SnapshotMigrationReconciliation = {
|
|
17
|
+
checkpointDigest: string;
|
|
18
|
+
quiescent: boolean;
|
|
19
|
+
calls: SnapshotMigrationResolution[];
|
|
20
|
+
};
|
|
21
|
+
export type SnapshotMigration = {
|
|
22
|
+
version: 1;
|
|
23
|
+
state: ReplayData;
|
|
24
|
+
history: Array<{
|
|
25
|
+
sourceHash: string;
|
|
26
|
+
targetSourceHash: string;
|
|
27
|
+
executionSemantics: string;
|
|
28
|
+
replay: HostCallReplay;
|
|
29
|
+
reconciliation: SnapshotMigrationReconciliation;
|
|
30
|
+
}>;
|
|
31
|
+
};
|
|
32
|
+
export declare function validateMigrationSemantics(value: unknown): asserts value is string;
|
|
33
|
+
export declare function validateMigrationJournal(sourceHash: string, replay: unknown, hostCalls?: unknown, owner?: CompileOwner): HostCallReplay;
|
|
34
|
+
export declare function validateMigrationReconciliation(value: unknown, checkpointDigest: string, calls: HostCallReplay["calls"]): asserts value is SnapshotMigrationReconciliation;
|
|
35
|
+
export declare function validateSnapshotMigration(value: unknown, sourceHash: string, owner?: CompileOwner): SnapshotMigration | undefined;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
type SnapshotId = number | string;
|
|
2
|
+
export type PendingHostCallResumeIdentity = {
|
|
3
|
+
argumentDigest: string;
|
|
4
|
+
callId: string;
|
|
5
|
+
moduleId: string;
|
|
6
|
+
operation: string;
|
|
7
|
+
sourceHash: string;
|
|
8
|
+
};
|
|
9
|
+
export type PendingHostCallDescriptor = {
|
|
10
|
+
id: SnapshotId;
|
|
11
|
+
moduleId?: string;
|
|
12
|
+
operation?: string;
|
|
13
|
+
};
|
|
14
|
+
export type PendingHostCallSideEffectTag = {
|
|
15
|
+
kind: "host-call-side-effect";
|
|
16
|
+
callId: string;
|
|
17
|
+
moduleId: string;
|
|
18
|
+
operation: string;
|
|
19
|
+
};
|
|
20
|
+
export type PendingHostCallIssuePolicy = {
|
|
21
|
+
kind: "re-issue";
|
|
22
|
+
} | {
|
|
23
|
+
kind: "read-side-effect";
|
|
24
|
+
sideEffectTag: PendingHostCallSideEffectTag;
|
|
25
|
+
};
|
|
26
|
+
export type PendingHostCallResumePolicy = PendingHostCallIssuePolicy;
|
|
27
|
+
export type PendingHostCallPolicyMode = PendingHostCallIssuePolicy["kind"];
|
|
28
|
+
export type PendingHostCallPolicyRegistration = {
|
|
29
|
+
moduleId: string;
|
|
30
|
+
operation: string;
|
|
31
|
+
policy: PendingHostCallPolicyMode;
|
|
32
|
+
};
|
|
33
|
+
export declare class HostOperationResumePolicyError extends Error {
|
|
34
|
+
readonly moduleId: string;
|
|
35
|
+
readonly operation: string;
|
|
36
|
+
constructor(moduleId: string, operation: string);
|
|
37
|
+
}
|
|
38
|
+
export declare function registerPendingHostCallPolicy(registration: PendingHostCallPolicyRegistration): void;
|
|
39
|
+
export declare function readRegisteredPendingHostCallPolicy(moduleId: string, operation: string): PendingHostCallPolicyMode | undefined;
|
|
40
|
+
export declare function resolvePendingHostCallIssuePolicy(call: PendingHostCallDescriptor): PendingHostCallIssuePolicy;
|
|
41
|
+
export declare function tagPendingHostCallAtIssue<TCall extends PendingHostCallDescriptor>(call: TCall): TCall & {
|
|
42
|
+
sideEffectTag?: PendingHostCallSideEffectTag;
|
|
43
|
+
};
|
|
44
|
+
export declare function resolvePendingHostCallResumePolicy(call: PendingHostCallDescriptor & {
|
|
45
|
+
sideEffectTag?: PendingHostCallSideEffectTag;
|
|
46
|
+
}): PendingHostCallResumePolicy;
|
|
47
|
+
export declare function createPendingHostCallSideEffectTag(call: PendingHostCallDescriptor): PendingHostCallSideEffectTag;
|
|
48
|
+
export declare function pendingHostCallResumeIdentityMatches(expected: PendingHostCallResumeIdentity, actual: PendingHostCallResumeIdentity): boolean;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { CompileScope } from "../interp/regex/compile-guard.js";
|
|
2
|
+
import { type Float32Data } from "./float32array.js";
|
|
3
|
+
import { type SandboxErrorName } from "../error/shape.js";
|
|
4
|
+
import { type SandboxClosure, type SandboxPromise, type SandboxValue } from "../interp/values.js";
|
|
5
|
+
import { type SerializedArguments } from "./arguments.js";
|
|
6
|
+
type Atom = boolean | null | number | string | {
|
|
7
|
+
tag: "undefined";
|
|
8
|
+
} | {
|
|
9
|
+
tag: "number";
|
|
10
|
+
value: "NaN" | "Infinity" | "-Infinity" | "-0";
|
|
11
|
+
} | {
|
|
12
|
+
tag: "capability";
|
|
13
|
+
id: string;
|
|
14
|
+
} | {
|
|
15
|
+
tag: "promise-capability";
|
|
16
|
+
id: string;
|
|
17
|
+
} | {
|
|
18
|
+
tag: "ref";
|
|
19
|
+
id: number;
|
|
20
|
+
};
|
|
21
|
+
type Properties = Record<string, {
|
|
22
|
+
value: Atom;
|
|
23
|
+
configurable: boolean;
|
|
24
|
+
enumerable: boolean;
|
|
25
|
+
writable: boolean;
|
|
26
|
+
}>;
|
|
27
|
+
type DataNode = (Float32Data<Atom> & {
|
|
28
|
+
properties: Properties;
|
|
29
|
+
extensible: boolean;
|
|
30
|
+
}) | {
|
|
31
|
+
kind: "capability";
|
|
32
|
+
id: string;
|
|
33
|
+
properties: Atom;
|
|
34
|
+
} | {
|
|
35
|
+
kind: "array" | "object";
|
|
36
|
+
properties: Properties;
|
|
37
|
+
extensible: boolean;
|
|
38
|
+
nullPrototype: boolean;
|
|
39
|
+
errorType?: SandboxErrorName;
|
|
40
|
+
} | {
|
|
41
|
+
kind: "arguments";
|
|
42
|
+
data: SerializedArguments<Atom>;
|
|
43
|
+
} | {
|
|
44
|
+
kind: "map";
|
|
45
|
+
entries: Array<[Atom, Atom]>;
|
|
46
|
+
} | {
|
|
47
|
+
kind: "set";
|
|
48
|
+
values: Atom[];
|
|
49
|
+
} | {
|
|
50
|
+
kind: "regex";
|
|
51
|
+
source: string;
|
|
52
|
+
flags: string;
|
|
53
|
+
lastIndex: number;
|
|
54
|
+
};
|
|
55
|
+
export type ReplayData = {
|
|
56
|
+
root: Atom;
|
|
57
|
+
nodes: DataNode[];
|
|
58
|
+
};
|
|
59
|
+
export declare class MissingReplayCapabilityError extends TypeError {
|
|
60
|
+
}
|
|
61
|
+
export declare function encodeReplayData(value: SandboxValue, options?: {
|
|
62
|
+
identifyCapability?: (value: SandboxClosure, path: readonly string[]) => string | undefined;
|
|
63
|
+
captureCapabilityProperties?: boolean;
|
|
64
|
+
identifyPromise?: (value: SandboxPromise, path: readonly string[]) => string | undefined;
|
|
65
|
+
}): ReplayData;
|
|
66
|
+
export declare function decodeReplayData(input: unknown, options?: {
|
|
67
|
+
resolveCapability?: (id: string) => SandboxClosure | undefined;
|
|
68
|
+
resolvePromise?: (id: string) => SandboxPromise | undefined;
|
|
69
|
+
onCapabilityRestored?: (original: SandboxClosure, restored: SandboxClosure) => void;
|
|
70
|
+
}, parent?: CompileScope): SandboxValue;
|
|
71
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Budget } from "../interp/budget.js";
|
|
2
|
+
import type { ParseResult } from "../parse/parser.js";
|
|
3
|
+
export type SnapshotValidationCode = "budgetExceeded" | "danglingReference" | "duplicateId" | "invalidCycle" | "invalidState" | "invalidType" | "invalidValue" | "unknownTag" | "unsupportedVersion";
|
|
4
|
+
export declare class SnapshotValidationError extends Error {
|
|
5
|
+
readonly code: SnapshotValidationCode;
|
|
6
|
+
readonly path: string;
|
|
7
|
+
constructor(code: SnapshotValidationCode, path: string, detail: string);
|
|
8
|
+
}
|
|
9
|
+
export declare function validateSnapshotData(value: unknown): void;
|
|
10
|
+
export declare function validateDumpEnvelope(snapshot: unknown): asserts snapshot is Record<string, unknown>;
|
|
11
|
+
export declare function validateInterpreterSnapshot(snapshot: unknown, nodeById: ReadonlyMap<number, ParseResult>, budget: Budget): asserts snapshot is Record<string, unknown>;
|
|
12
|
+
export declare function validateSnapshotSourceHash(snapshot: unknown): asserts snapshot is {
|
|
13
|
+
sourceHash: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function validateArgumentsProperties(record: Record<string, unknown>, path: string): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Runner } from "../../process-runner/index.js";
|
|
2
|
+
export interface GhClientOptions {
|
|
3
|
+
token: string;
|
|
4
|
+
endpoint?: string;
|
|
5
|
+
fetch?: typeof fetch;
|
|
6
|
+
}
|
|
7
|
+
export interface GhClient {
|
|
8
|
+
graphql<T>(query: string, variables: Record<string, unknown>): Promise<T>;
|
|
9
|
+
}
|
|
10
|
+
export declare function createGhClient(options: GhClientOptions): GhClient;
|
|
11
|
+
export interface ResolveAuthOptions {
|
|
12
|
+
explicitToken?: string;
|
|
13
|
+
runner?: Runner;
|
|
14
|
+
}
|
|
15
|
+
export declare function resolveAuth(options: ResolveAuthOptions): Promise<string>;
|
|
16
|
+
export interface ResolveEndpointOptions {
|
|
17
|
+
env?: Record<string, string | undefined>;
|
|
18
|
+
}
|
|
19
|
+
export declare function resolveEndpoint(options?: ResolveEndpointOptions): string;
|