@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,30 @@
|
|
|
1
|
+
import type { ClientRequest, IncomingMessage, RequestOptions } from "node:http";
|
|
2
|
+
export interface S3HttpCredentials {
|
|
3
|
+
readonly accessKeyId: string;
|
|
4
|
+
readonly secretAccessKey: string;
|
|
5
|
+
readonly sessionToken?: string;
|
|
6
|
+
}
|
|
7
|
+
export type S3HttpCredentialProvider = (options: {
|
|
8
|
+
readonly signal: AbortSignal;
|
|
9
|
+
}) => Promise<S3HttpCredentials>;
|
|
10
|
+
export type S3HttpRequestFactory = (options: RequestOptions, onResponse: (response: IncomingMessage) => void) => ClientRequest;
|
|
11
|
+
export interface S3HttpTransportOptions {
|
|
12
|
+
readonly endpoint: string;
|
|
13
|
+
readonly region: string;
|
|
14
|
+
readonly credentials: S3HttpCredentials | S3HttpCredentialProvider;
|
|
15
|
+
readonly addressingStyle?: "path" | "virtual-hosted";
|
|
16
|
+
readonly listUrlEncoding?: "percent" | "form";
|
|
17
|
+
readonly clock?: () => Date;
|
|
18
|
+
readonly request?: S3HttpRequestFactory;
|
|
19
|
+
readonly allowInsecureHttp?: boolean;
|
|
20
|
+
readonly maxPutBytes?: number;
|
|
21
|
+
readonly maxGetBytes?: number;
|
|
22
|
+
readonly maxXmlBytes?: number;
|
|
23
|
+
readonly requestTimeoutMs?: number;
|
|
24
|
+
readonly enableCopy?: boolean;
|
|
25
|
+
readonly verifiedConditionalOperations?: {
|
|
26
|
+
readonly put?: boolean;
|
|
27
|
+
readonly copy?: boolean;
|
|
28
|
+
readonly delete?: boolean;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { S3FileSystem, S3RenameError } from "./filesystem.js";
|
|
2
|
+
export type { S3FileSystemOptions } from "./filesystem.js";
|
|
3
|
+
export { MockS3Client } from "./mock.js";
|
|
4
|
+
export type { MockS3ClientOptions, MockS3Operation, MockS3Request } from "./mock.js";
|
|
5
|
+
export { createS3Transport, encodeCopySource, S3ServiceError } from "./transport.js";
|
|
6
|
+
export type { S3Body, S3Client, S3CopyInput, S3CopyOutput, S3DeleteInput, S3GetOutput, S3HeadOutput, S3ListInput, S3ListOutput, S3ObjectInput, S3ObjectSummary, S3PutInput, S3RequestOptions, S3Transport, S3TransportCapabilities, } from "./transport.js";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { S3StreamGetInput, S3StreamGetOutput, S3StreamPutInput } from "./transport.js";
|
|
2
|
+
import type { S3CopyInput, S3CopyOutput, S3DeleteInput, S3GetOutput, S3HeadOutput, S3ListInput, S3ListOutput, S3ObjectInput, S3PutInput, S3RequestOptions, S3Transport } from "./transport.js";
|
|
3
|
+
export type MockS3Operation = "headObject" | "getObject" | "putObject" | "deleteObject" | "copyObject" | "listObjectsV2";
|
|
4
|
+
export interface MockS3Request {
|
|
5
|
+
readonly operation: MockS3Operation;
|
|
6
|
+
readonly input: S3ObjectInput | S3ListInput | S3CopyInput | S3PutInput | S3DeleteInput;
|
|
7
|
+
}
|
|
8
|
+
export interface MockS3ClientOptions {
|
|
9
|
+
readonly buckets: readonly string[];
|
|
10
|
+
readonly pageSize?: number;
|
|
11
|
+
readonly now?: () => Date;
|
|
12
|
+
readonly authorize?: (request: MockS3Request) => void | Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare class MockS3Client implements S3Transport {
|
|
15
|
+
readonly capabilities: Readonly<{
|
|
16
|
+
conditionalPut: true;
|
|
17
|
+
conditionalCopy: true;
|
|
18
|
+
conditionalDelete: true;
|
|
19
|
+
streamingRead: true;
|
|
20
|
+
streamingWrite: true;
|
|
21
|
+
}>;
|
|
22
|
+
private readonly buckets;
|
|
23
|
+
private readonly cursors;
|
|
24
|
+
private readonly history;
|
|
25
|
+
private readonly pageSize;
|
|
26
|
+
private readonly now;
|
|
27
|
+
private readonly authorize;
|
|
28
|
+
private nextToken;
|
|
29
|
+
constructor(options: MockS3ClientOptions);
|
|
30
|
+
get requests(): readonly MockS3Request[];
|
|
31
|
+
private begin;
|
|
32
|
+
private bucket;
|
|
33
|
+
private object;
|
|
34
|
+
private head;
|
|
35
|
+
private store;
|
|
36
|
+
headObject(input: S3ObjectInput, options?: S3RequestOptions): Promise<S3HeadOutput>;
|
|
37
|
+
getObject(input: S3ObjectInput, options?: S3RequestOptions): Promise<S3GetOutput>;
|
|
38
|
+
putObject(input: S3PutInput, options?: S3RequestOptions): Promise<{
|
|
39
|
+
ETag: string;
|
|
40
|
+
}>;
|
|
41
|
+
getObjectStream(input: S3StreamGetInput, options?: S3RequestOptions): Promise<S3StreamGetOutput>;
|
|
42
|
+
putObjectStream(input: S3StreamPutInput, options?: S3RequestOptions): Promise<{
|
|
43
|
+
ETag: string;
|
|
44
|
+
}>;
|
|
45
|
+
deleteObject(input: S3DeleteInput, options?: S3RequestOptions): Promise<Record<string, never>>;
|
|
46
|
+
copyObject(input: S3CopyInput, options?: S3RequestOptions): Promise<S3CopyOutput>;
|
|
47
|
+
listObjectsV2(input: S3ListInput, options?: S3RequestOptions): Promise<S3ListOutput>;
|
|
48
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export interface S3RequestOptions {
|
|
2
|
+
readonly abortSignal?: AbortSignal;
|
|
3
|
+
}
|
|
4
|
+
export interface S3ObjectInput {
|
|
5
|
+
readonly Bucket: string;
|
|
6
|
+
readonly Key: string;
|
|
7
|
+
}
|
|
8
|
+
export interface S3HeadOutput {
|
|
9
|
+
readonly ContentLength?: number | undefined;
|
|
10
|
+
readonly LastModified?: Date | undefined;
|
|
11
|
+
readonly ETag?: string | undefined;
|
|
12
|
+
readonly Metadata?: Record<string, string> | undefined;
|
|
13
|
+
}
|
|
14
|
+
export type S3Body = Uint8Array | AsyncIterable<Uint8Array> | {
|
|
15
|
+
transformToByteArray(): Promise<Uint8Array>;
|
|
16
|
+
};
|
|
17
|
+
export interface S3GetOutput extends S3HeadOutput {
|
|
18
|
+
readonly Body?: S3Body | undefined;
|
|
19
|
+
}
|
|
20
|
+
export interface S3StreamGetInput extends S3ObjectInput {
|
|
21
|
+
readonly Range?: string;
|
|
22
|
+
readonly IfMatch?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface S3StreamGetOutput extends S3HeadOutput {
|
|
25
|
+
readonly Body: AsyncIterable<Uint8Array>;
|
|
26
|
+
}
|
|
27
|
+
export interface S3StreamPutInput extends Omit<S3PutInput, "Body"> {
|
|
28
|
+
readonly Body: AsyncIterable<Uint8Array>;
|
|
29
|
+
}
|
|
30
|
+
export interface S3PutInput extends S3ObjectInput {
|
|
31
|
+
readonly Body: Uint8Array;
|
|
32
|
+
readonly IfMatch?: string;
|
|
33
|
+
readonly IfNoneMatch?: "*";
|
|
34
|
+
readonly Metadata?: Record<string, string>;
|
|
35
|
+
}
|
|
36
|
+
export interface S3DeleteInput extends S3ObjectInput {
|
|
37
|
+
readonly IfMatch?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface S3CopyInput extends S3ObjectInput {
|
|
40
|
+
readonly CopySource: string;
|
|
41
|
+
readonly CopySourceIfMatch?: string;
|
|
42
|
+
readonly IfNoneMatch?: "*";
|
|
43
|
+
readonly IfMatch?: string;
|
|
44
|
+
readonly MetadataDirective?: "COPY" | "REPLACE";
|
|
45
|
+
readonly Metadata?: Record<string, string>;
|
|
46
|
+
}
|
|
47
|
+
export interface S3CopyOutput {
|
|
48
|
+
readonly CopyObjectResult?: {
|
|
49
|
+
readonly ETag?: string | undefined;
|
|
50
|
+
readonly LastModified?: Date | undefined;
|
|
51
|
+
} | undefined;
|
|
52
|
+
}
|
|
53
|
+
export interface S3ListInput {
|
|
54
|
+
readonly Bucket: string;
|
|
55
|
+
readonly Prefix?: string;
|
|
56
|
+
readonly Delimiter?: string;
|
|
57
|
+
readonly MaxKeys?: number;
|
|
58
|
+
readonly ContinuationToken?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface S3ObjectSummary {
|
|
61
|
+
readonly Key?: string | undefined;
|
|
62
|
+
readonly Size?: number | undefined;
|
|
63
|
+
readonly ETag?: string | undefined;
|
|
64
|
+
readonly LastModified?: Date | undefined;
|
|
65
|
+
}
|
|
66
|
+
export interface S3ListOutput {
|
|
67
|
+
readonly Contents?: readonly S3ObjectSummary[] | undefined;
|
|
68
|
+
readonly CommonPrefixes?: readonly {
|
|
69
|
+
readonly Prefix?: string | undefined;
|
|
70
|
+
}[] | undefined;
|
|
71
|
+
readonly IsTruncated?: boolean | undefined;
|
|
72
|
+
readonly NextContinuationToken?: string | undefined;
|
|
73
|
+
readonly KeyCount?: number | undefined;
|
|
74
|
+
}
|
|
75
|
+
export interface S3Client {
|
|
76
|
+
getObjectStream?(input: S3StreamGetInput, options?: S3RequestOptions): Promise<S3StreamGetOutput>;
|
|
77
|
+
putObjectStream?(input: S3StreamPutInput, options?: S3RequestOptions): Promise<unknown>;
|
|
78
|
+
headObject(input: S3ObjectInput, options?: S3RequestOptions): Promise<S3HeadOutput>;
|
|
79
|
+
getObject(input: S3ObjectInput, options?: S3RequestOptions): Promise<S3GetOutput>;
|
|
80
|
+
putObject(input: S3PutInput, options?: S3RequestOptions): Promise<unknown>;
|
|
81
|
+
deleteObject(input: S3DeleteInput, options?: S3RequestOptions): Promise<unknown>;
|
|
82
|
+
copyObject(input: S3CopyInput, options?: S3RequestOptions): Promise<S3CopyOutput>;
|
|
83
|
+
listObjectsV2(input: S3ListInput, options?: S3RequestOptions): Promise<S3ListOutput>;
|
|
84
|
+
}
|
|
85
|
+
export interface S3TransportCapabilities {
|
|
86
|
+
readonly streamingRead?: boolean;
|
|
87
|
+
readonly streamingWrite?: boolean;
|
|
88
|
+
readonly conditionalPut?: boolean;
|
|
89
|
+
readonly conditionalCopy?: boolean;
|
|
90
|
+
readonly conditionalDelete?: boolean;
|
|
91
|
+
}
|
|
92
|
+
export interface S3Transport extends S3Client {
|
|
93
|
+
readonly capabilities?: S3TransportCapabilities;
|
|
94
|
+
}
|
|
95
|
+
export declare function createS3Transport(client: S3Client, capabilities?: S3TransportCapabilities): S3Transport;
|
|
96
|
+
export declare class S3ServiceError extends Error {
|
|
97
|
+
readonly code: string;
|
|
98
|
+
readonly $metadata: {
|
|
99
|
+
readonly httpStatusCode: number;
|
|
100
|
+
};
|
|
101
|
+
constructor(code: string, status: number, message?: string);
|
|
102
|
+
}
|
|
103
|
+
export declare function encodeCopySource(bucket: string, key: string): string;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { PlatformComparisonCallback } from "#safe-fs-platform";
|
|
2
|
+
import type { ByteSource } from "../../contracts/io.js";
|
|
3
|
+
import type { AppendFileOptions, CopyFileOptions, DirectoryEntry, EntryComparison, FileStat, FileSystem, FsOptions, MkdirOptions, ReadFileOptions, ReadStreamOptions, RemoveOptions, WriteFileOptions } from "../../contracts/filesystem.js";
|
|
4
|
+
export type WebDavFetch = (url: string, init: RequestInit) => Promise<Response>;
|
|
5
|
+
export interface WebDavAtomicEmptyDirectoryRequest {
|
|
6
|
+
readonly operation: "atomic-empty-rmdir/v1";
|
|
7
|
+
readonly namespaceUrl: string;
|
|
8
|
+
readonly path: string;
|
|
9
|
+
readonly signal?: AbortSignal;
|
|
10
|
+
}
|
|
11
|
+
export interface WebDavAtomicEmptyDirectoryResult {
|
|
12
|
+
readonly operation: "atomic-empty-rmdir/v1";
|
|
13
|
+
readonly namespaceUrl: string;
|
|
14
|
+
readonly path: string;
|
|
15
|
+
readonly outcome: "removed";
|
|
16
|
+
}
|
|
17
|
+
export interface WebDavAtomicEmptyDirectoryBinding {
|
|
18
|
+
readonly namespaceUrl: string;
|
|
19
|
+
readonly removeEmptyDirectory: (request: WebDavAtomicEmptyDirectoryRequest) => Promise<WebDavAtomicEmptyDirectoryResult>;
|
|
20
|
+
}
|
|
21
|
+
export interface WebDavFileSystemOptions {
|
|
22
|
+
readonly baseUrl: string;
|
|
23
|
+
readonly fetch: WebDavFetch;
|
|
24
|
+
readonly requestStreamSupport?: "native" | boolean;
|
|
25
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
26
|
+
readonly maxResponseBytes?: number;
|
|
27
|
+
readonly maxXmlBytes?: number;
|
|
28
|
+
readonly maxEntries?: number;
|
|
29
|
+
readonly timeoutMs?: number;
|
|
30
|
+
readonly overwritePolicy?: "lock" | "etag";
|
|
31
|
+
readonly atomicEmptyDirectory?: WebDavAtomicEmptyDirectoryBinding;
|
|
32
|
+
readonly compareEntry?: PlatformComparisonCallback<(this: FileSystem, ...args: Parameters<NonNullable<FileSystem["compareEntry"]>>) => ReturnType<NonNullable<FileSystem["compareEntry"]>>>;
|
|
33
|
+
}
|
|
34
|
+
export declare class WebDavFileSystem implements FileSystem {
|
|
35
|
+
readonly capabilities: Readonly<{
|
|
36
|
+
symlinks: false;
|
|
37
|
+
hardlinks: false;
|
|
38
|
+
permissions: false;
|
|
39
|
+
timestamps: true;
|
|
40
|
+
atomicRename: false;
|
|
41
|
+
streamingRead: true;
|
|
42
|
+
streamingWrite: true;
|
|
43
|
+
}>;
|
|
44
|
+
private readonly base;
|
|
45
|
+
private readonly baseSegments;
|
|
46
|
+
private readonly transport;
|
|
47
|
+
private readonly requestStreamSupport;
|
|
48
|
+
private readonly headers;
|
|
49
|
+
private readonly maxResponseBytes;
|
|
50
|
+
private readonly maxXmlBytes;
|
|
51
|
+
private readonly maxEntries;
|
|
52
|
+
private readonly timeoutMs;
|
|
53
|
+
private readonly overwritePolicy;
|
|
54
|
+
private readonly configuredComparison;
|
|
55
|
+
private readonly atomicEmptyDirectory;
|
|
56
|
+
private readonly etags;
|
|
57
|
+
constructor(options: WebDavFileSystemOptions);
|
|
58
|
+
compareEntry(path: string, peer: FileSystem, peerPath: string, options?: FsOptions): Promise<EntryComparison>;
|
|
59
|
+
private resourceId;
|
|
60
|
+
private url;
|
|
61
|
+
private hrefPath;
|
|
62
|
+
private httpError;
|
|
63
|
+
private request;
|
|
64
|
+
private requestStream;
|
|
65
|
+
private bytes;
|
|
66
|
+
private bodyChunks;
|
|
67
|
+
private xml;
|
|
68
|
+
private multistatus;
|
|
69
|
+
private lockFailure;
|
|
70
|
+
private entryStat;
|
|
71
|
+
private entries;
|
|
72
|
+
private mutation;
|
|
73
|
+
private unsupported;
|
|
74
|
+
private maybeStat;
|
|
75
|
+
stat(path: string, options?: FsOptions): Promise<FileStat>;
|
|
76
|
+
lstat(path: string, options?: FsOptions): Promise<FileStat>;
|
|
77
|
+
readdir(path: string, options?: FsOptions): Promise<DirectoryEntry[]>;
|
|
78
|
+
readFile(path: string, options?: ReadFileOptions): Promise<Uint8Array>;
|
|
79
|
+
readStream(path: string, options?: ReadStreamOptions): AsyncGenerator<Uint8Array>;
|
|
80
|
+
private prepareWrite;
|
|
81
|
+
writeFile(path: string, data: Uint8Array, options?: WriteFileOptions): Promise<void>;
|
|
82
|
+
writeStream(path: string, source: ByteSource, options?: WriteFileOptions): Promise<void>;
|
|
83
|
+
appendFile(path: string, data: Uint8Array, options?: AppendFileOptions): Promise<void>;
|
|
84
|
+
mkdir(path: string, options?: MkdirOptions): Promise<void>;
|
|
85
|
+
rmdir(path: string, options?: FsOptions): Promise<void>;
|
|
86
|
+
private atomicRmdir;
|
|
87
|
+
rm(path: string, options?: RemoveOptions): Promise<void>;
|
|
88
|
+
private guardTransferIdentity;
|
|
89
|
+
private transfer;
|
|
90
|
+
private withDestinationLock;
|
|
91
|
+
rename(source: string, destination: string, options?: FsOptions): Promise<void>;
|
|
92
|
+
copyFile(source: string, destination: string, options?: CopyFileOptions): Promise<void>;
|
|
93
|
+
realpath(path: string, options?: FsOptions): Promise<string>;
|
|
94
|
+
access(path: string, mode?: number, options?: FsOptions): Promise<void>;
|
|
95
|
+
readlink(path: string, _options?: FsOptions): Promise<string>;
|
|
96
|
+
symlink(_target: string, path: string, _options?: FsOptions): Promise<void>;
|
|
97
|
+
link(_source: string, path: string, _options?: FsOptions): Promise<void>;
|
|
98
|
+
chmod(path: string, _mode: number, _options?: FsOptions): Promise<void>;
|
|
99
|
+
utimes(path: string, atimeMs: number, mtimeMs: number, options?: FsOptions): Promise<void>;
|
|
100
|
+
truncate(path: string, _length?: number, _options?: FsOptions): Promise<void>;
|
|
101
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from "./contracts/index.js";
|
|
2
|
+
export * from "./fs/memory/index.js";
|
|
3
|
+
export * from "./fs/real/index.js";
|
|
4
|
+
export * from "./fs/s3/index.js";
|
|
5
|
+
export type { S3StreamGetInput, S3StreamGetOutput, S3StreamPutInput } from "./fs/s3/transport.js";
|
|
6
|
+
export * from "./fs/s3/http/index.js";
|
|
7
|
+
export * from "./fs/webdav/index.js";
|
|
8
|
+
export * from "./fs/readonly/index.js";
|
|
9
|
+
export * from "./fs/mount/index.js";
|
|
10
|
+
export * from "./fs/overlay/index.js";
|
|
11
|
+
export * from "./node/index.js";
|
|
12
|
+
export { createFileSystem, readConfigRecord, validateFileSystemConfig } from "./config.js";
|
|
13
|
+
export type { FileSystemConfig, FileSystemAdapterDescriptor, FileSystemAdapterRegistry } from "./config.js";
|
|
14
|
+
export { createNodeFileSystemAdapterRegistry } from "./config.node.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type * as FsPromises from "node:fs/promises";
|
|
2
|
+
import type { FileSystem, FsOptions } from "../contracts/filesystem.js";
|
|
3
|
+
export type NodeFsImplementation = Pick<typeof FsPromises, "access" | "appendFile" | "chmod" | "copyFile" | "cp" | "link" | "lstat" | "mkdir" | "mkdtemp" | "readFile" | "readdir" | "readlink" | "realpath" | "rename" | "rm" | "rmdir" | "stat" | "symlink" | "truncate" | "utimes" | "writeFile">;
|
|
4
|
+
export interface NodeFsBridgeOptions {
|
|
5
|
+
readonly cwd?: string;
|
|
6
|
+
readonly signal?: AbortSignal;
|
|
7
|
+
}
|
|
8
|
+
export interface NodeFsBridgeFileSystem extends FileSystem {
|
|
9
|
+
rmdir?(path: string, options?: FsOptions): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare function createNodeFsBridge(fs: FileSystem, options?: NodeFsBridgeOptions): NodeFsImplementation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FsOptions } from "../contracts/filesystem.js";
|
|
2
|
+
export type PlatformErrno = number | undefined;
|
|
3
|
+
export type PlatformComparisonCallback<Callback> = Callback & never;
|
|
4
|
+
export declare const platform: Readonly<{
|
|
5
|
+
errno(_code: string): PlatformErrno;
|
|
6
|
+
callbackAuthorities: false;
|
|
7
|
+
randomUUID(): string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const comparisonContext: Readonly<{
|
|
10
|
+
active(options: FsOptions): boolean;
|
|
11
|
+
run<Result>(options: FsOptions, action: (nested: FsOptions) => Promise<Result>): Promise<Result>;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import type { FsOptions } from "../contracts/filesystem.js";
|
|
3
|
+
export type PlatformErrno = number;
|
|
4
|
+
export type PlatformComparisonCallback<Callback> = Callback;
|
|
5
|
+
export declare const platform: Readonly<{
|
|
6
|
+
errno(code: string): PlatformErrno;
|
|
7
|
+
callbackAuthorities: true;
|
|
8
|
+
randomUUID: typeof randomUUID;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const comparisonContext: Readonly<{
|
|
11
|
+
active(_options: FsOptions): boolean;
|
|
12
|
+
run<Result>(options: FsOptions, action: (nested: FsOptions) => Promise<Result>): Promise<Result>;
|
|
13
|
+
}>;
|