@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,28 @@
|
|
|
1
|
+
import { type FromUrlOptions } from "./remote.js";
|
|
2
|
+
export interface TextResourceContents {
|
|
3
|
+
uri: string;
|
|
4
|
+
mimeType: string;
|
|
5
|
+
text: string;
|
|
6
|
+
}
|
|
7
|
+
export interface BlobResourceContents {
|
|
8
|
+
uri: string;
|
|
9
|
+
mimeType: string;
|
|
10
|
+
blob: string;
|
|
11
|
+
}
|
|
12
|
+
export interface EmbeddedResource {
|
|
13
|
+
type: "resource";
|
|
14
|
+
resource: TextResourceContents | BlobResourceContents;
|
|
15
|
+
}
|
|
16
|
+
export declare class File {
|
|
17
|
+
private readonly data;
|
|
18
|
+
private readonly mimeType;
|
|
19
|
+
private readonly isText;
|
|
20
|
+
private readonly name?;
|
|
21
|
+
private readonly charset;
|
|
22
|
+
private constructor();
|
|
23
|
+
static fromUrl(url: string, options?: FromUrlOptions): Promise<File>;
|
|
24
|
+
static fromBytes(data: Uint8Array, mimeType: string): File;
|
|
25
|
+
static fromText(text: string, mimeType?: string): File;
|
|
26
|
+
static fromBase64(base64: string, mimeType: string): File;
|
|
27
|
+
toContentBlock(): EmbeddedResource;
|
|
28
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type FromUrlOptions } from "./remote.js";
|
|
2
|
+
export interface ImageContent {
|
|
3
|
+
type: "image";
|
|
4
|
+
data: string;
|
|
5
|
+
mimeType: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class Image {
|
|
8
|
+
private readonly base64Data;
|
|
9
|
+
private readonly mimeType;
|
|
10
|
+
private constructor();
|
|
11
|
+
static fromUrl(url: string, options?: FromUrlOptions): Promise<Image>;
|
|
12
|
+
static fromBytes(data: Uint8Array, format?: string): Image;
|
|
13
|
+
static fromBase64(base64: string, mimeType: string): Image;
|
|
14
|
+
toContentBlock(): ImageContent;
|
|
15
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { fileTypeFromBuffer, type FileTypeResult } from "./mime.js";
|
|
2
|
+
export { DEFAULT_FROM_URL_MAX_BYTES } from "./remote.js";
|
|
3
|
+
export type { FromUrlOptions } from "./remote.js";
|
|
4
|
+
export { Image, type ImageContent } from "./image.js";
|
|
5
|
+
export { Audio, type AudioContent } from "./audio.js";
|
|
6
|
+
export { File, type EmbeddedResource, type TextResourceContents, type BlobResourceContents, } from "./file.js";
|
|
7
|
+
export { toContentBlocks, type ContentBlock, type TextContent, type ToolReturn, } from "./convert.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { fileTypeFromBuffer, type FileTypeResult } from "./file-type.js";
|
|
2
|
+
export declare function parseContentType(value: string | null): {
|
|
3
|
+
mimeType?: string;
|
|
4
|
+
charset?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function assertBase64(value: string): void;
|
|
7
|
+
export declare function safeRemoteLabel(url: string): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { createServer } from "./server.js";
|
|
2
|
+
export type { CustomMethodHandler, MessageHandler, MessageSession, MessageSessionContext, Server } from "./server.js";
|
|
3
|
+
export { defineSchema } from "./schema.js";
|
|
4
|
+
export type { TypedSchema } from "./schema.js";
|
|
5
|
+
export { Image, Audio, File, toContentBlocks, fileTypeFromBuffer, DEFAULT_FROM_URL_MAX_BYTES, } from "./content/index.js";
|
|
6
|
+
export type { ImageContent, AudioContent, EmbeddedResource, TextResourceContents, BlobResourceContents, ContentBlock, TextContent, FileTypeResult, FromUrlOptions, } from "./content/index.js";
|
|
7
|
+
export type { ToolReturn } from "./content/index.js";
|
|
8
|
+
export type { ServerOptions, ToolHandler, ToolDefinition, Tool, ToolAnnotations, ToolExecution, Icon, ContentAnnotations, ResourceLink, CallToolResult, PromptContentItem, PromptArgument, Prompt, PromptMessage, GetPromptResult, PromptHandler, PromptDefinition, Resource, ResourceTemplate, ResourceContents, ReadResourceResult, ResourceHandler, ResourceDefinition, ResourceTemplateDefinition, HandleResult, ContentItem, JSONSchema, JSONSchemaProperty, Transport, SDKTransport, JSONRPCRequest, JSONRPCResponse, JSONRPCError, JSONRPCMessage, JSONRPCNotification, InitializeResult, } from "./types.js";
|
|
9
|
+
export { JSON_RPC_ERROR_CODES, ToolError } from "./types.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { JSONSchema } from "./types.js";
|
|
2
|
+
type SchemaPropertyType = "string" | "number" | "integer" | "boolean" | "object" | "array";
|
|
3
|
+
interface SchemaPropertyDef {
|
|
4
|
+
type: SchemaPropertyType;
|
|
5
|
+
description?: string;
|
|
6
|
+
optional?: boolean;
|
|
7
|
+
[keyword: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
type SchemaDefinition = Record<string, SchemaPropertyDef>;
|
|
10
|
+
type InferType<T extends SchemaPropertyType> = T extends "string" ? string : T extends "number" | "integer" ? number : T extends "boolean" ? boolean : T extends "object" ? Record<string, unknown> : T extends "array" ? unknown[] : never;
|
|
11
|
+
type InferSchema<T extends SchemaDefinition> = {
|
|
12
|
+
[K in keyof T as T[K]["optional"] extends true ? never : K]: InferType<T[K]["type"]>;
|
|
13
|
+
} & {
|
|
14
|
+
[K in keyof T as T[K]["optional"] extends true ? K : never]?: InferType<T[K]["type"]>;
|
|
15
|
+
};
|
|
16
|
+
export interface TypedSchema<T> extends JSONSchema {
|
|
17
|
+
__type?: T;
|
|
18
|
+
}
|
|
19
|
+
export declare function defineSchema<T extends SchemaDefinition>(definition: T): TypedSchema<InferSchema<T>>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ServerOptions, ToolDefinition, ToolHandler, HandleResult, Prompt, PromptHandler, Resource, ResourceHandler, ResourceTemplate, Transport, SDKTransport, JSONRPCNotification } from "./types.js";
|
|
2
|
+
import type { TypedSchema } from "./schema.js";
|
|
3
|
+
export interface Server {
|
|
4
|
+
tool<TIn, TOut = never>(name: string, description: string, inputSchema: TypedSchema<TIn>, handler: ToolHandler<TIn, TOut>, outputSchema?: TypedSchema<TOut>): Server;
|
|
5
|
+
registerTool<TIn, TOut = never>(definition: Omit<ToolDefinition<TIn, TOut>, "handler">, handler: ToolHandler<TIn, TOut>): Server;
|
|
6
|
+
prompt(definition: Prompt, handler: PromptHandler): Server;
|
|
7
|
+
resource(definition: Resource, handler: ResourceHandler): Server;
|
|
8
|
+
resourceTemplate(definition: ResourceTemplate, handler: ResourceHandler): Server;
|
|
9
|
+
method(name: string, handler: CustomMethodHandler): Server;
|
|
10
|
+
onNotification(listener: (notification: JSONRPCNotification) => void): () => void;
|
|
11
|
+
removeTool(name: string): boolean;
|
|
12
|
+
removePrompt(name: string): boolean;
|
|
13
|
+
removeResource(uri: string): boolean;
|
|
14
|
+
removeResourceTemplate(uriTemplate: string): boolean;
|
|
15
|
+
notifyToolsChanged(): Promise<void>;
|
|
16
|
+
notifyPromptsChanged(): Promise<void>;
|
|
17
|
+
notifyResourcesChanged(): Promise<void>;
|
|
18
|
+
notifyResourceUpdated(uri: string): Promise<void>;
|
|
19
|
+
createMessageSession(listener?: (notification: JSONRPCNotification) => void | Promise<void>): MessageSession;
|
|
20
|
+
handleMessage(method: string, params?: Record<string, unknown>): Promise<HandleResult>;
|
|
21
|
+
listen(): Promise<void>;
|
|
22
|
+
connect(transport: Transport): Promise<void>;
|
|
23
|
+
connectSDK(transport: SDKTransport): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
export interface MessageSessionContext {
|
|
26
|
+
readonly signal: AbortSignal;
|
|
27
|
+
notify(method: string, params?: Record<string, unknown>): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
export type CustomMethodHandler = (params: Record<string, unknown> | undefined, session: MessageSessionContext) => unknown | Promise<unknown>;
|
|
30
|
+
export type MessageHandler = (method: string, params?: Record<string, unknown>) => Promise<HandleResult>;
|
|
31
|
+
export interface MessageSession {
|
|
32
|
+
handleMessage: MessageHandler;
|
|
33
|
+
close(): void;
|
|
34
|
+
}
|
|
35
|
+
export declare function createServer(options: ServerOptions): Server;
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
export interface JSONRPCRequest {
|
|
2
|
+
jsonrpc: "2.0";
|
|
3
|
+
id: string | number | null;
|
|
4
|
+
method: string;
|
|
5
|
+
params?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
export interface JSONRPCResponse {
|
|
8
|
+
jsonrpc: "2.0";
|
|
9
|
+
id: string | number | null;
|
|
10
|
+
result?: unknown;
|
|
11
|
+
error?: JSONRPCError;
|
|
12
|
+
}
|
|
13
|
+
export interface JSONRPCError {
|
|
14
|
+
code: number;
|
|
15
|
+
message: string;
|
|
16
|
+
data?: unknown;
|
|
17
|
+
}
|
|
18
|
+
export declare const JSON_RPC_ERROR_CODES: Readonly<{
|
|
19
|
+
readonly PARSE_ERROR: -32700;
|
|
20
|
+
readonly INVALID_REQUEST: -32600;
|
|
21
|
+
readonly METHOD_NOT_FOUND: -32601;
|
|
22
|
+
readonly INVALID_PARAMS: -32602;
|
|
23
|
+
readonly INTERNAL_ERROR: -32603;
|
|
24
|
+
readonly RESOURCE_NOT_FOUND: -32002;
|
|
25
|
+
}>;
|
|
26
|
+
export declare class ToolError extends Error {
|
|
27
|
+
readonly code: number;
|
|
28
|
+
readonly data?: unknown | undefined;
|
|
29
|
+
constructor(code: number, message: string, data?: unknown | undefined);
|
|
30
|
+
}
|
|
31
|
+
export interface ToolsCapability {
|
|
32
|
+
listChanged?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface PromptsCapability {
|
|
35
|
+
listChanged?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface ResourcesCapability {
|
|
38
|
+
subscribe?: boolean;
|
|
39
|
+
listChanged?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface InitializeResult {
|
|
42
|
+
protocolVersion: string;
|
|
43
|
+
capabilities: {
|
|
44
|
+
tools?: ToolsCapability;
|
|
45
|
+
prompts?: PromptsCapability;
|
|
46
|
+
resources?: ResourcesCapability;
|
|
47
|
+
};
|
|
48
|
+
serverInfo: {
|
|
49
|
+
name: string;
|
|
50
|
+
version: string;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface Tool {
|
|
54
|
+
name: string;
|
|
55
|
+
title?: string;
|
|
56
|
+
description?: string;
|
|
57
|
+
inputSchema: JSONSchema;
|
|
58
|
+
outputSchema?: JSONSchema;
|
|
59
|
+
annotations?: ToolAnnotations;
|
|
60
|
+
execution?: ToolExecution;
|
|
61
|
+
icons?: Icon[];
|
|
62
|
+
_meta?: Record<string, unknown>;
|
|
63
|
+
}
|
|
64
|
+
export interface CallToolResult {
|
|
65
|
+
content: ContentItem[];
|
|
66
|
+
structuredContent?: Record<string, unknown>;
|
|
67
|
+
isError?: boolean;
|
|
68
|
+
}
|
|
69
|
+
export interface ToolAnnotations {
|
|
70
|
+
title?: string;
|
|
71
|
+
readOnlyHint?: boolean;
|
|
72
|
+
destructiveHint?: boolean;
|
|
73
|
+
idempotentHint?: boolean;
|
|
74
|
+
openWorldHint?: boolean;
|
|
75
|
+
}
|
|
76
|
+
export interface ToolExecution {
|
|
77
|
+
taskSupport?: "optional" | "required" | "forbidden";
|
|
78
|
+
}
|
|
79
|
+
export interface Icon {
|
|
80
|
+
src: string;
|
|
81
|
+
mimeType?: string;
|
|
82
|
+
sizes?: string[];
|
|
83
|
+
theme?: "light" | "dark";
|
|
84
|
+
}
|
|
85
|
+
export interface ContentAnnotations {
|
|
86
|
+
audience?: Array<"user" | "assistant">;
|
|
87
|
+
priority?: number;
|
|
88
|
+
lastModified?: string;
|
|
89
|
+
}
|
|
90
|
+
export interface ResourceLink {
|
|
91
|
+
type: "resource_link";
|
|
92
|
+
uri: string;
|
|
93
|
+
name: string;
|
|
94
|
+
title?: string;
|
|
95
|
+
description?: string;
|
|
96
|
+
mimeType?: string;
|
|
97
|
+
size?: number;
|
|
98
|
+
annotations?: ContentAnnotations;
|
|
99
|
+
}
|
|
100
|
+
export interface PromptArgument {
|
|
101
|
+
name: string;
|
|
102
|
+
description?: string;
|
|
103
|
+
required?: boolean;
|
|
104
|
+
}
|
|
105
|
+
export interface Prompt {
|
|
106
|
+
name: string;
|
|
107
|
+
title?: string;
|
|
108
|
+
description?: string;
|
|
109
|
+
arguments?: PromptArgument[];
|
|
110
|
+
icons?: Icon[];
|
|
111
|
+
_meta?: Record<string, unknown>;
|
|
112
|
+
}
|
|
113
|
+
export interface PromptMessage {
|
|
114
|
+
role: "user" | "assistant";
|
|
115
|
+
content: PromptContentItem;
|
|
116
|
+
}
|
|
117
|
+
export interface GetPromptResult {
|
|
118
|
+
description?: string;
|
|
119
|
+
messages: PromptMessage[];
|
|
120
|
+
}
|
|
121
|
+
export type PromptHandler = (args: Record<string, string>) => Promise<GetPromptResult> | GetPromptResult;
|
|
122
|
+
export interface PromptDefinition extends Prompt {
|
|
123
|
+
handler: PromptHandler;
|
|
124
|
+
}
|
|
125
|
+
export interface Resource {
|
|
126
|
+
uri: string;
|
|
127
|
+
name: string;
|
|
128
|
+
title?: string;
|
|
129
|
+
description?: string;
|
|
130
|
+
mimeType?: string;
|
|
131
|
+
size?: number;
|
|
132
|
+
annotations?: ContentAnnotations;
|
|
133
|
+
icons?: Icon[];
|
|
134
|
+
_meta?: Record<string, unknown>;
|
|
135
|
+
}
|
|
136
|
+
export interface ResourceTemplate {
|
|
137
|
+
uriTemplate: string;
|
|
138
|
+
name: string;
|
|
139
|
+
title?: string;
|
|
140
|
+
description?: string;
|
|
141
|
+
mimeType?: string;
|
|
142
|
+
annotations?: ContentAnnotations;
|
|
143
|
+
icons?: Icon[];
|
|
144
|
+
_meta?: Record<string, unknown>;
|
|
145
|
+
}
|
|
146
|
+
export type ResourceContents = {
|
|
147
|
+
uri: string;
|
|
148
|
+
mimeType?: string;
|
|
149
|
+
text: string;
|
|
150
|
+
} | {
|
|
151
|
+
uri: string;
|
|
152
|
+
mimeType?: string;
|
|
153
|
+
blob: string;
|
|
154
|
+
};
|
|
155
|
+
export interface ReadResourceResult {
|
|
156
|
+
contents: ResourceContents[];
|
|
157
|
+
}
|
|
158
|
+
export type ResourceHandler = (uri: string) => Promise<ReadResourceResult> | ReadResourceResult;
|
|
159
|
+
export interface ResourceDefinition extends Resource {
|
|
160
|
+
handler: ResourceHandler;
|
|
161
|
+
}
|
|
162
|
+
export interface ResourceTemplateDefinition extends ResourceTemplate {
|
|
163
|
+
handler: ResourceHandler;
|
|
164
|
+
}
|
|
165
|
+
export interface HandleResult {
|
|
166
|
+
result?: unknown;
|
|
167
|
+
error?: JSONRPCError;
|
|
168
|
+
}
|
|
169
|
+
export type PromptContentItem = {
|
|
170
|
+
type: "text";
|
|
171
|
+
text: string;
|
|
172
|
+
annotations?: ContentAnnotations;
|
|
173
|
+
} | {
|
|
174
|
+
type: "image";
|
|
175
|
+
data: string;
|
|
176
|
+
mimeType: string;
|
|
177
|
+
annotations?: ContentAnnotations;
|
|
178
|
+
} | {
|
|
179
|
+
type: "audio";
|
|
180
|
+
data: string;
|
|
181
|
+
mimeType: string;
|
|
182
|
+
annotations?: ContentAnnotations;
|
|
183
|
+
} | {
|
|
184
|
+
type: "resource";
|
|
185
|
+
annotations?: ContentAnnotations;
|
|
186
|
+
resource: {
|
|
187
|
+
uri: string;
|
|
188
|
+
mimeType?: string;
|
|
189
|
+
text: string;
|
|
190
|
+
} | {
|
|
191
|
+
uri: string;
|
|
192
|
+
mimeType?: string;
|
|
193
|
+
blob: string;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
export type ContentItem = PromptContentItem | ResourceLink;
|
|
197
|
+
export interface JSONSchema {
|
|
198
|
+
type: "object";
|
|
199
|
+
properties?: Record<string, JSONSchemaProperty>;
|
|
200
|
+
required?: string[];
|
|
201
|
+
[keyword: string]: unknown;
|
|
202
|
+
}
|
|
203
|
+
export interface JSONSchemaProperty extends Record<string, unknown> {
|
|
204
|
+
type?: string | string[];
|
|
205
|
+
description?: string;
|
|
206
|
+
[keyword: string]: unknown;
|
|
207
|
+
}
|
|
208
|
+
export interface ServerOptions {
|
|
209
|
+
name: string;
|
|
210
|
+
version: string;
|
|
211
|
+
toolCallTimeoutMs?: number;
|
|
212
|
+
validateToolArguments?: boolean;
|
|
213
|
+
supportNotifications?: boolean;
|
|
214
|
+
supportResourceSubscriptions?: boolean;
|
|
215
|
+
}
|
|
216
|
+
import type { ToolReturn } from "./content/index.js";
|
|
217
|
+
export type ToolHandler<T = Record<string, unknown>, TOut = ToolReturn> = (args: T) => Promise<TOut | CallToolResult> | TOut | CallToolResult;
|
|
218
|
+
export interface ToolDefinition<T = Record<string, unknown>, TOut = ToolReturn> {
|
|
219
|
+
name: string;
|
|
220
|
+
title?: string;
|
|
221
|
+
description?: string;
|
|
222
|
+
inputSchema: JSONSchema;
|
|
223
|
+
outputSchema?: JSONSchema;
|
|
224
|
+
annotations?: ToolAnnotations;
|
|
225
|
+
execution?: ToolExecution;
|
|
226
|
+
icons?: Icon[];
|
|
227
|
+
_meta?: Record<string, unknown>;
|
|
228
|
+
handler: ToolHandler<T, TOut>;
|
|
229
|
+
}
|
|
230
|
+
export interface Transport {
|
|
231
|
+
readable: NodeJS.ReadableStream;
|
|
232
|
+
writable: NodeJS.WritableStream;
|
|
233
|
+
}
|
|
234
|
+
export interface SDKTransport {
|
|
235
|
+
onmessage?: (message: JSONRPCMessage) => void;
|
|
236
|
+
onclose?: () => void;
|
|
237
|
+
onerror?: (error: Error) => void;
|
|
238
|
+
start: () => Promise<void>;
|
|
239
|
+
close: () => Promise<void>;
|
|
240
|
+
send: (message: JSONRPCMessage) => Promise<void>;
|
|
241
|
+
}
|
|
242
|
+
export type JSONRPCMessage = JSONRPCRequest | JSONRPCResponse | JSONRPCNotification;
|
|
243
|
+
export interface JSONRPCNotification {
|
|
244
|
+
jsonrpc: "2.0";
|
|
245
|
+
method: string;
|
|
246
|
+
params?: Record<string, unknown>;
|
|
247
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Status of the agent output being rendered.
|
|
3
|
+
*
|
|
4
|
+
* `streaming` covers partial/in-progress content, which has not reached any outcome yet and so must not
|
|
5
|
+
* claim success. `success`/`error` are terminal outcomes known to the caller.
|
|
6
|
+
*/
|
|
7
|
+
export type AcpOutputState = "streaming" | "success" | "error";
|
|
8
|
+
export declare function renderAgentMessage(text: string, state?: AcpOutputState): void;
|
|
9
|
+
export declare function renderToolStart(kind: string, title: string): void;
|
|
10
|
+
export declare function renderToolComplete(kind: string): void;
|
|
11
|
+
export declare function renderReasoning(text: string): void;
|
|
12
|
+
export declare function renderUsage(tokens: {
|
|
13
|
+
input: number;
|
|
14
|
+
output: number;
|
|
15
|
+
cached?: number;
|
|
16
|
+
costUsd?: number;
|
|
17
|
+
}): void;
|
|
18
|
+
export declare function renderPermissionRejected(title: string): void;
|
|
19
|
+
export declare function renderError(message: string): void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { renderAgentMessage, renderToolStart, renderToolComplete, renderReasoning, renderUsage, renderError, renderPermissionRejected } from "./components.js";
|
|
2
|
+
export type { AcpOutputState } from "./components.js";
|
|
3
|
+
export { getAcpWriter, withAcpWriter } from "./writer.js";
|
|
4
|
+
export type { AcpLineWriter } from "./writer.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type AcpLineWriter = (line: string) => void;
|
|
2
|
+
/**
|
|
3
|
+
* Return the writer active in the current async context, or the default
|
|
4
|
+
* stdout writer if none is bound.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getAcpWriter(): AcpLineWriter;
|
|
7
|
+
/**
|
|
8
|
+
* Run `fn` with `writer` bound as the active ACP line writer. All calls to
|
|
9
|
+
* `renderAgentMessage`, `renderToolStart`, `renderAcpEvent`, etc. made inside
|
|
10
|
+
* `fn` (or async work awaited from `fn`) will go through `writer` instead of
|
|
11
|
+
* writing to `process.stdout`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function withAcpWriter<T>(writer: AcpLineWriter, fn: () => Promise<T>): Promise<T>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface BrowserProcess {
|
|
2
|
+
once(event: "error", listener: (error: Error) => void): this;
|
|
3
|
+
once(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
|
4
|
+
unref(): void;
|
|
5
|
+
}
|
|
6
|
+
type SpawnBrowserProcess = (command: string, args: string[], options: {
|
|
7
|
+
detached: true;
|
|
8
|
+
stdio: "ignore";
|
|
9
|
+
}) => BrowserProcess;
|
|
10
|
+
export interface OpenExternalOptions {
|
|
11
|
+
platform?: NodeJS.Platform;
|
|
12
|
+
spawnProcess?: SpawnBrowserProcess;
|
|
13
|
+
}
|
|
14
|
+
export declare function openExternal(url: string, options?: OpenExternalOptions): Promise<void>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ThemePalette } from "../tokens/colors.js";
|
|
2
|
+
export type CatalogTone = "accent" | "muted" | "success" | "warning" | "error" | "info";
|
|
3
|
+
export interface CatalogMetric {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string | number;
|
|
6
|
+
tone?: CatalogTone;
|
|
7
|
+
}
|
|
8
|
+
export interface CatalogItem {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
detail?: string;
|
|
12
|
+
tone?: CatalogTone;
|
|
13
|
+
}
|
|
14
|
+
export interface CatalogGroup {
|
|
15
|
+
title: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
items: CatalogItem[];
|
|
18
|
+
}
|
|
19
|
+
export interface RenderCatalogOptions {
|
|
20
|
+
theme: ThemePalette;
|
|
21
|
+
title: string;
|
|
22
|
+
subtitle?: string;
|
|
23
|
+
metrics?: CatalogMetric[];
|
|
24
|
+
groups: CatalogGroup[];
|
|
25
|
+
}
|
|
26
|
+
export declare function renderCatalog(options: RenderCatalogOptions): string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface Color {
|
|
2
|
+
(text: string): string;
|
|
3
|
+
reset: Color;
|
|
4
|
+
bold: Color;
|
|
5
|
+
dim: Color;
|
|
6
|
+
italic: Color;
|
|
7
|
+
underline: Color;
|
|
8
|
+
inverse: Color;
|
|
9
|
+
strikethrough: Color;
|
|
10
|
+
black: Color;
|
|
11
|
+
red: Color;
|
|
12
|
+
green: Color;
|
|
13
|
+
yellow: Color;
|
|
14
|
+
blue: Color;
|
|
15
|
+
magenta: Color;
|
|
16
|
+
cyan: Color;
|
|
17
|
+
white: Color;
|
|
18
|
+
gray: Color;
|
|
19
|
+
magentaBright: Color;
|
|
20
|
+
cyanBright: Color;
|
|
21
|
+
bgRed: Color;
|
|
22
|
+
bgGreen: Color;
|
|
23
|
+
bgYellow: Color;
|
|
24
|
+
bgBlue: Color;
|
|
25
|
+
bgMagenta: Color;
|
|
26
|
+
hex: (value: string) => Color;
|
|
27
|
+
rgb: (red: number, green: number, blue: number) => Color;
|
|
28
|
+
bgHex: (value: string) => Color;
|
|
29
|
+
bgRgb: (red: number, green: number, blue: number) => Color;
|
|
30
|
+
}
|
|
31
|
+
export declare const color: Color;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare function formatCommandNotFound(input: {
|
|
2
|
+
unknownCommand: string;
|
|
3
|
+
helpCommand: string;
|
|
4
|
+
suggestions?: readonly string[];
|
|
5
|
+
}): {
|
|
6
|
+
label: string;
|
|
7
|
+
hint: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function formatCommandNotFoundPanel(input: {
|
|
10
|
+
unknownCommand: string;
|
|
11
|
+
helpCommand: string;
|
|
12
|
+
suggestions?: readonly string[];
|
|
13
|
+
title?: string;
|
|
14
|
+
}): {
|
|
15
|
+
title: string;
|
|
16
|
+
label: string;
|
|
17
|
+
footer: string;
|
|
18
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ThemePalette } from "../tokens/colors.js";
|
|
2
|
+
export interface DetailCardRow {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}
|
|
6
|
+
export interface DetailCardSection {
|
|
7
|
+
title?: string;
|
|
8
|
+
rows: DetailCardRow[];
|
|
9
|
+
}
|
|
10
|
+
export interface RenderDetailCardOptions {
|
|
11
|
+
theme: ThemePalette;
|
|
12
|
+
title: string;
|
|
13
|
+
subtitle?: string;
|
|
14
|
+
badges?: string[];
|
|
15
|
+
prose?: Array<{
|
|
16
|
+
title?: string;
|
|
17
|
+
value: string;
|
|
18
|
+
}>;
|
|
19
|
+
sections?: DetailCardSection[];
|
|
20
|
+
width?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function renderDetailCard(options: RenderDetailCardOptions): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type FileChangeKind = "added" | "modified" | "deleted" | "renamed";
|
|
2
|
+
export type FileChangeDisplayMode = "status" | "diff";
|
|
3
|
+
export type FileChangeOutputFormat = "terminal" | "markdown";
|
|
4
|
+
export interface FileChange {
|
|
5
|
+
path: string;
|
|
6
|
+
kind: FileChangeKind;
|
|
7
|
+
oldPath?: string;
|
|
8
|
+
conflict?: boolean;
|
|
9
|
+
oldContent?: string;
|
|
10
|
+
newContent?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface RenderFileChangesOptions {
|
|
13
|
+
mode?: FileChangeDisplayMode;
|
|
14
|
+
format?: FileChangeOutputFormat;
|
|
15
|
+
}
|
|
16
|
+
export declare function renderFileChanges(changes: readonly FileChange[], options?: RenderFileChangesOptions): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CommandInfo, FormatColumnsOptions, OptionInfo } from "./help-formatter.js";
|
|
2
|
+
export declare function stripAnsi(value: string): string;
|
|
3
|
+
export declare function formatColumns(opts: FormatColumnsOptions): string;
|
|
4
|
+
export declare function formatCommandList(commands: CommandInfo[]): string;
|
|
5
|
+
export declare function formatOptionList(options: OptionInfo[]): string;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export type HelpTokenRole = "command" | "argument" | "option" | "literal" | "dim";
|
|
2
|
+
export interface HelpToken {
|
|
3
|
+
text: string;
|
|
4
|
+
role: HelpTokenRole;
|
|
5
|
+
}
|
|
6
|
+
export interface CommandInfo {
|
|
7
|
+
name: string;
|
|
8
|
+
/** Structured tokens for TTY/markdown styling. Plain `name` is used when absent. */
|
|
9
|
+
nameTokens?: HelpToken[];
|
|
10
|
+
description: string;
|
|
11
|
+
/** Nesting depth relative to the help target. Depth 0 is a direct child. */
|
|
12
|
+
depth?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface OptionInfo {
|
|
15
|
+
flags: string;
|
|
16
|
+
/** Structured tokens for TTY/markdown styling. Plain `flags` is used when absent. */
|
|
17
|
+
flagTokens?: HelpToken[];
|
|
18
|
+
description: string;
|
|
19
|
+
}
|
|
20
|
+
export interface FormatColumnsOptions {
|
|
21
|
+
rows: Array<{
|
|
22
|
+
left: string;
|
|
23
|
+
right: string;
|
|
24
|
+
}>;
|
|
25
|
+
totalWidth?: number;
|
|
26
|
+
minLeftWidth?: number;
|
|
27
|
+
maxLeftWidth?: number;
|
|
28
|
+
gap?: number;
|
|
29
|
+
indent?: number;
|
|
30
|
+
}
|
|
31
|
+
export declare function formatColumns(opts: FormatColumnsOptions): string;
|
|
32
|
+
export declare function styleHelpToken(token: HelpToken): string;
|
|
33
|
+
export declare function joinHelpTokens(tokens: HelpToken[]): string;
|
|
34
|
+
export declare function renderHelpTokens(tokens: HelpToken[]): string;
|
|
35
|
+
export declare function formatCommand(name: string, description: string): string;
|
|
36
|
+
export declare function formatUsage(command: string, args?: string): string;
|
|
37
|
+
export declare function formatOption(flags: string, description: string): string;
|
|
38
|
+
export declare function formatCommandList(commands: CommandInfo[]): string;
|
|
39
|
+
export declare function formatOptionList(options: OptionInfo[]): string;
|
|
40
|
+
export declare const helpFormatter: {
|
|
41
|
+
readonly formatColumns: typeof formatColumns;
|
|
42
|
+
readonly formatCommand: typeof formatCommand;
|
|
43
|
+
readonly formatUsage: typeof formatUsage;
|
|
44
|
+
readonly formatOption: typeof formatOption;
|
|
45
|
+
readonly formatCommandList: typeof formatCommandList;
|
|
46
|
+
readonly formatOptionList: typeof formatOptionList;
|
|
47
|
+
readonly styleHelpToken: typeof styleHelpToken;
|
|
48
|
+
readonly joinHelpTokens: typeof joinHelpTokens;
|
|
49
|
+
readonly renderHelpTokens: typeof renderHelpTokens;
|
|
50
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ThemePalette } from "../tokens/colors.js";
|
|
2
|
+
export interface InspectorField {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}
|
|
6
|
+
export interface InspectorSection {
|
|
7
|
+
title?: string;
|
|
8
|
+
fields: InspectorField[];
|
|
9
|
+
}
|
|
10
|
+
export interface RenderInspectorCardOptions {
|
|
11
|
+
theme: ThemePalette;
|
|
12
|
+
title: string;
|
|
13
|
+
subtitle?: string;
|
|
14
|
+
badges?: string[];
|
|
15
|
+
preview?: string;
|
|
16
|
+
previewTitle?: string;
|
|
17
|
+
sections?: InspectorSection[];
|
|
18
|
+
width?: number;
|
|
19
|
+
maxPreviewLines?: number;
|
|
20
|
+
}
|
|
21
|
+
export declare function renderInspectorCard(options: RenderInspectorCardOptions): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface LoggerOutput {
|
|
2
|
+
info(message: string): void;
|
|
3
|
+
success(message: string): void;
|
|
4
|
+
warn(message: string): void;
|
|
5
|
+
error(message: string): void;
|
|
6
|
+
resolved(label: string, value: string): void;
|
|
7
|
+
errorResolved(label: string, value: string): void;
|
|
8
|
+
message(message: string, symbol?: string): void;
|
|
9
|
+
}
|
|
10
|
+
export declare function createLogger(emitter?: (message: string) => void): LoggerOutput;
|
|
11
|
+
export declare const logger: LoggerOutput;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ThemePalette } from "../tokens/colors.js";
|
|
2
|
+
export interface ResourceBrowserItem {
|
|
3
|
+
label: string;
|
|
4
|
+
meta?: string[];
|
|
5
|
+
preview?: string;
|
|
6
|
+
badge?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ResourceBrowserGroup {
|
|
9
|
+
title: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
emptyHint?: string;
|
|
12
|
+
items: ResourceBrowserItem[];
|
|
13
|
+
}
|
|
14
|
+
export interface RenderResourceBrowserOptions {
|
|
15
|
+
theme: ThemePalette;
|
|
16
|
+
title: string;
|
|
17
|
+
subtitle?: string;
|
|
18
|
+
groups: ResourceBrowserGroup[];
|
|
19
|
+
footer?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function renderResourceBrowser(options: RenderResourceBrowserOptions): string;
|