@soederpop/luca 0.1.1 → 0.1.3
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/CLAUDE.md +2 -0
- package/assistants/codingAssistant/hooks.ts +3 -0
- package/assistants/inkbot/CORE.md +69 -0
- package/assistants/inkbot/hooks.ts +14 -0
- package/assistants/inkbot/tools.ts +47 -0
- package/commands/inkbot.ts +353 -0
- package/dist/agi/container.server.d.ts +63 -0
- package/dist/agi/container.server.d.ts.map +1 -0
- package/dist/agi/endpoints/ask.d.ts +20 -0
- package/dist/agi/endpoints/ask.d.ts.map +1 -0
- package/dist/agi/endpoints/conversations/[id].d.ts +27 -0
- package/dist/agi/endpoints/conversations/[id].d.ts.map +1 -0
- package/dist/agi/endpoints/conversations.d.ts +18 -0
- package/dist/agi/endpoints/conversations.d.ts.map +1 -0
- package/dist/agi/endpoints/experts.d.ts +8 -0
- package/dist/agi/endpoints/experts.d.ts.map +1 -0
- package/dist/agi/feature.d.ts +9 -0
- package/dist/agi/feature.d.ts.map +1 -0
- package/dist/agi/features/assistant.d.ts +509 -0
- package/dist/agi/features/assistant.d.ts.map +1 -0
- package/dist/agi/features/assistants-manager.d.ts +236 -0
- package/dist/agi/features/assistants-manager.d.ts.map +1 -0
- package/dist/agi/features/autonomous-assistant.d.ts +281 -0
- package/dist/agi/features/autonomous-assistant.d.ts.map +1 -0
- package/dist/agi/features/browser-use.d.ts +479 -0
- package/dist/agi/features/browser-use.d.ts.map +1 -0
- package/dist/agi/features/claude-code.d.ts +824 -0
- package/dist/agi/features/claude-code.d.ts.map +1 -0
- package/dist/agi/features/conversation-history.d.ts +245 -0
- package/dist/agi/features/conversation-history.d.ts.map +1 -0
- package/dist/agi/features/conversation.d.ts +464 -0
- package/dist/agi/features/conversation.d.ts.map +1 -0
- package/dist/agi/features/docs-reader.d.ts +72 -0
- package/dist/agi/features/docs-reader.d.ts.map +1 -0
- package/dist/agi/features/file-tools.d.ts +110 -0
- package/dist/agi/features/file-tools.d.ts.map +1 -0
- package/dist/agi/features/luca-coder.d.ts +323 -0
- package/dist/agi/features/luca-coder.d.ts.map +1 -0
- package/dist/agi/features/openai-codex.d.ts +381 -0
- package/dist/agi/features/openai-codex.d.ts.map +1 -0
- package/dist/agi/features/openapi.d.ts +200 -0
- package/dist/agi/features/openapi.d.ts.map +1 -0
- package/dist/agi/features/skills-library.d.ts +167 -0
- package/dist/agi/features/skills-library.d.ts.map +1 -0
- package/dist/agi/index.d.ts +5 -0
- package/dist/agi/index.d.ts.map +1 -0
- package/dist/agi/lib/interceptor-chain.d.ts +44 -0
- package/dist/agi/lib/interceptor-chain.d.ts.map +1 -0
- package/dist/agi/lib/token-counter.d.ts +13 -0
- package/dist/agi/lib/token-counter.d.ts.map +1 -0
- package/dist/bootstrap/generated.d.ts +5 -0
- package/dist/bootstrap/generated.d.ts.map +1 -0
- package/dist/browser.d.ts +12 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/bus.d.ts +29 -0
- package/dist/bus.d.ts.map +1 -0
- package/dist/cli/build-info.d.ts +4 -0
- package/dist/cli/build-info.d.ts.map +1 -0
- package/dist/cli/cli.d.ts +3 -0
- package/dist/cli/cli.d.ts.map +1 -0
- package/dist/client.d.ts +60 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/clients/civitai/index.d.ts +472 -0
- package/dist/clients/civitai/index.d.ts.map +1 -0
- package/dist/clients/client-template.d.ts +30 -0
- package/dist/clients/client-template.d.ts.map +1 -0
- package/dist/clients/comfyui/index.d.ts +281 -0
- package/dist/clients/comfyui/index.d.ts.map +1 -0
- package/dist/clients/elevenlabs/index.d.ts +197 -0
- package/dist/clients/elevenlabs/index.d.ts.map +1 -0
- package/dist/clients/graph.d.ts +64 -0
- package/dist/clients/graph.d.ts.map +1 -0
- package/dist/clients/openai/index.d.ts +247 -0
- package/dist/clients/openai/index.d.ts.map +1 -0
- package/dist/clients/rest.d.ts +92 -0
- package/dist/clients/rest.d.ts.map +1 -0
- package/dist/clients/supabase/index.d.ts +176 -0
- package/dist/clients/supabase/index.d.ts.map +1 -0
- package/dist/clients/websocket.d.ts +127 -0
- package/dist/clients/websocket.d.ts.map +1 -0
- package/dist/command.d.ts +163 -0
- package/dist/command.d.ts.map +1 -0
- package/dist/commands/bootstrap.d.ts +20 -0
- package/dist/commands/bootstrap.d.ts.map +1 -0
- package/dist/commands/chat.d.ts +37 -0
- package/dist/commands/chat.d.ts.map +1 -0
- package/dist/commands/code.d.ts +28 -0
- package/dist/commands/code.d.ts.map +1 -0
- package/dist/commands/console.d.ts +22 -0
- package/dist/commands/console.d.ts.map +1 -0
- package/dist/commands/describe.d.ts +50 -0
- package/dist/commands/describe.d.ts.map +1 -0
- package/dist/commands/eval.d.ts +23 -0
- package/dist/commands/eval.d.ts.map +1 -0
- package/dist/commands/help.d.ts +25 -0
- package/dist/commands/help.d.ts.map +1 -0
- package/dist/commands/index.d.ts +18 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/introspect.d.ts +24 -0
- package/dist/commands/introspect.d.ts.map +1 -0
- package/dist/commands/mcp.d.ts +35 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/prompt.d.ts +38 -0
- package/dist/commands/prompt.d.ts.map +1 -0
- package/dist/commands/run.d.ts +24 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/sandbox-mcp.d.ts +34 -0
- package/dist/commands/sandbox-mcp.d.ts.map +1 -0
- package/dist/commands/save-api-docs.d.ts +21 -0
- package/dist/commands/save-api-docs.d.ts.map +1 -0
- package/dist/commands/scaffold.d.ts +24 -0
- package/dist/commands/scaffold.d.ts.map +1 -0
- package/dist/commands/select.d.ts +22 -0
- package/dist/commands/select.d.ts.map +1 -0
- package/dist/commands/serve.d.ts +29 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/container-describer.d.ts +144 -0
- package/dist/container-describer.d.ts.map +1 -0
- package/dist/container.d.ts +451 -0
- package/dist/container.d.ts.map +1 -0
- package/dist/endpoint.d.ts +113 -0
- package/dist/endpoint.d.ts.map +1 -0
- package/dist/feature.d.ts +47 -0
- package/dist/feature.d.ts.map +1 -0
- package/dist/graft.d.ts +29 -0
- package/dist/graft.d.ts.map +1 -0
- package/dist/hash-object.d.ts +8 -0
- package/dist/hash-object.d.ts.map +1 -0
- package/dist/helper.d.ts +209 -0
- package/dist/helper.d.ts.map +1 -0
- package/dist/introspection/generated.node.d.ts +44623 -0
- package/dist/introspection/generated.node.d.ts.map +1 -0
- package/dist/introspection/generated.web.d.ts +1412 -0
- package/dist/introspection/generated.web.d.ts.map +1 -0
- package/dist/introspection/index.d.ts +156 -0
- package/dist/introspection/index.d.ts.map +1 -0
- package/dist/introspection/scan.d.ts +147 -0
- package/dist/introspection/scan.d.ts.map +1 -0
- package/dist/node/container.d.ts +256 -0
- package/dist/node/container.d.ts.map +1 -0
- package/dist/node/feature.d.ts +9 -0
- package/dist/node/feature.d.ts.map +1 -0
- package/dist/node/features/container-link.d.ts +213 -0
- package/dist/node/features/container-link.d.ts.map +1 -0
- package/dist/node/features/content-db.d.ts +354 -0
- package/dist/node/features/content-db.d.ts.map +1 -0
- package/dist/node/features/disk-cache.d.ts +236 -0
- package/dist/node/features/disk-cache.d.ts.map +1 -0
- package/dist/node/features/dns.d.ts +511 -0
- package/dist/node/features/dns.d.ts.map +1 -0
- package/dist/node/features/docker.d.ts +485 -0
- package/dist/node/features/docker.d.ts.map +1 -0
- package/dist/node/features/downloader.d.ts +73 -0
- package/dist/node/features/downloader.d.ts.map +1 -0
- package/dist/node/features/figlet-fonts.d.ts +4 -0
- package/dist/node/features/figlet-fonts.d.ts.map +1 -0
- package/dist/node/features/file-manager.d.ts +177 -0
- package/dist/node/features/file-manager.d.ts.map +1 -0
- package/dist/node/features/fs.d.ts +635 -0
- package/dist/node/features/fs.d.ts.map +1 -0
- package/dist/node/features/git.d.ts +329 -0
- package/dist/node/features/git.d.ts.map +1 -0
- package/dist/node/features/google-auth.d.ts +200 -0
- package/dist/node/features/google-auth.d.ts.map +1 -0
- package/dist/node/features/google-calendar.d.ts +194 -0
- package/dist/node/features/google-calendar.d.ts.map +1 -0
- package/dist/node/features/google-docs.d.ts +138 -0
- package/dist/node/features/google-docs.d.ts.map +1 -0
- package/dist/node/features/google-drive.d.ts +202 -0
- package/dist/node/features/google-drive.d.ts.map +1 -0
- package/dist/node/features/google-mail.d.ts +221 -0
- package/dist/node/features/google-mail.d.ts.map +1 -0
- package/dist/node/features/google-sheets.d.ts +157 -0
- package/dist/node/features/google-sheets.d.ts.map +1 -0
- package/dist/node/features/grep.d.ts +207 -0
- package/dist/node/features/grep.d.ts.map +1 -0
- package/dist/node/features/helpers.d.ts +236 -0
- package/dist/node/features/helpers.d.ts.map +1 -0
- package/dist/node/features/ink.d.ts +332 -0
- package/dist/node/features/ink.d.ts.map +1 -0
- package/dist/node/features/ipc-socket.d.ts +298 -0
- package/dist/node/features/ipc-socket.d.ts.map +1 -0
- package/dist/node/features/json-tree.d.ts +140 -0
- package/dist/node/features/json-tree.d.ts.map +1 -0
- package/dist/node/features/networking.d.ts +373 -0
- package/dist/node/features/networking.d.ts.map +1 -0
- package/dist/node/features/nlp.d.ts +125 -0
- package/dist/node/features/nlp.d.ts.map +1 -0
- package/dist/node/features/opener.d.ts +93 -0
- package/dist/node/features/opener.d.ts.map +1 -0
- package/dist/node/features/os.d.ts +168 -0
- package/dist/node/features/os.d.ts.map +1 -0
- package/dist/node/features/package-finder.d.ts +419 -0
- package/dist/node/features/package-finder.d.ts.map +1 -0
- package/dist/node/features/postgres.d.ts +173 -0
- package/dist/node/features/postgres.d.ts.map +1 -0
- package/dist/node/features/proc.d.ts +285 -0
- package/dist/node/features/proc.d.ts.map +1 -0
- package/dist/node/features/process-manager.d.ts +427 -0
- package/dist/node/features/process-manager.d.ts.map +1 -0
- package/dist/node/features/python.d.ts +477 -0
- package/dist/node/features/python.d.ts.map +1 -0
- package/dist/node/features/redis.d.ts +247 -0
- package/dist/node/features/redis.d.ts.map +1 -0
- package/dist/node/features/repl.d.ts +84 -0
- package/dist/node/features/repl.d.ts.map +1 -0
- package/dist/node/features/runpod.d.ts +527 -0
- package/dist/node/features/runpod.d.ts.map +1 -0
- package/dist/node/features/secure-shell.d.ts +145 -0
- package/dist/node/features/secure-shell.d.ts.map +1 -0
- package/dist/node/features/semantic-search.d.ts +207 -0
- package/dist/node/features/semantic-search.d.ts.map +1 -0
- package/dist/node/features/sqlite.d.ts +180 -0
- package/dist/node/features/sqlite.d.ts.map +1 -0
- package/dist/node/features/telegram.d.ts +173 -0
- package/dist/node/features/telegram.d.ts.map +1 -0
- package/dist/node/features/transpiler.d.ts +51 -0
- package/dist/node/features/transpiler.d.ts.map +1 -0
- package/dist/node/features/tts.d.ts +108 -0
- package/dist/node/features/tts.d.ts.map +1 -0
- package/dist/node/features/ui.d.ts +562 -0
- package/dist/node/features/ui.d.ts.map +1 -0
- package/dist/node/features/vault.d.ts +90 -0
- package/dist/node/features/vault.d.ts.map +1 -0
- package/dist/node/features/vm.d.ts +285 -0
- package/dist/node/features/vm.d.ts.map +1 -0
- package/dist/node/features/yaml-tree.d.ts +118 -0
- package/dist/node/features/yaml-tree.d.ts.map +1 -0
- package/dist/node/features/yaml.d.ts +127 -0
- package/dist/node/features/yaml.d.ts.map +1 -0
- package/dist/node.d.ts +67 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/python/generated.d.ts +2 -0
- package/dist/python/generated.d.ts.map +1 -0
- package/dist/react/index.d.ts +36 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/registry.d.ts +97 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/scaffolds/generated.d.ts +13 -0
- package/dist/scaffolds/generated.d.ts.map +1 -0
- package/dist/scaffolds/template.d.ts +11 -0
- package/dist/scaffolds/template.d.ts.map +1 -0
- package/dist/schemas/base.d.ts +254 -0
- package/dist/schemas/base.d.ts.map +1 -0
- package/dist/selector.d.ts +130 -0
- package/dist/selector.d.ts.map +1 -0
- package/dist/server.d.ts +89 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/servers/express.d.ts +104 -0
- package/dist/servers/express.d.ts.map +1 -0
- package/dist/servers/mcp.d.ts +201 -0
- package/dist/servers/mcp.d.ts.map +1 -0
- package/dist/servers/socket.d.ts +121 -0
- package/dist/servers/socket.d.ts.map +1 -0
- package/dist/state.d.ts +24 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/web/clients/socket.d.ts +37 -0
- package/dist/web/clients/socket.d.ts.map +1 -0
- package/dist/web/container.d.ts +55 -0
- package/dist/web/container.d.ts.map +1 -0
- package/dist/web/extension.d.ts +4 -0
- package/dist/web/extension.d.ts.map +1 -0
- package/dist/web/feature.d.ts +8 -0
- package/dist/web/feature.d.ts.map +1 -0
- package/dist/web/features/asset-loader.d.ts +35 -0
- package/dist/web/features/asset-loader.d.ts.map +1 -0
- package/dist/web/features/container-link.d.ts +167 -0
- package/dist/web/features/container-link.d.ts.map +1 -0
- package/dist/web/features/esbuild.d.ts +51 -0
- package/dist/web/features/esbuild.d.ts.map +1 -0
- package/dist/web/features/helpers.d.ts +140 -0
- package/dist/web/features/helpers.d.ts.map +1 -0
- package/dist/web/features/network.d.ts +69 -0
- package/dist/web/features/network.d.ts.map +1 -0
- package/dist/web/features/speech.d.ts +71 -0
- package/dist/web/features/speech.d.ts.map +1 -0
- package/dist/web/features/vault.d.ts +62 -0
- package/dist/web/features/vault.d.ts.map +1 -0
- package/dist/web/features/vm.d.ts +48 -0
- package/dist/web/features/vm.d.ts.map +1 -0
- package/dist/web/features/voice-recognition.d.ts +96 -0
- package/dist/web/features/voice-recognition.d.ts.map +1 -0
- package/dist/web/shims/isomorphic-vm.d.ts +22 -0
- package/dist/web/shims/isomorphic-vm.d.ts.map +1 -0
- package/docs/apis/features/agi/assistant.md +1 -0
- package/docs/apis/features/agi/assistants-manager.md +62 -2
- package/docs/apis/features/agi/auto-assistant.md +11 -109
- package/docs/apis/features/agi/claude-code.md +138 -0
- package/docs/apis/features/agi/conversation.md +60 -31
- package/docs/apis/features/agi/luca-coder.md +407 -0
- package/docs/apis/features/agi/openapi.md +2 -2
- package/docs/apis/features/agi/skills-library.md +12 -0
- package/docs/apis/features/node/python.md +81 -11
- package/docs/apis/features/node/transpiler.md +74 -0
- package/docs/apis/features/web/esbuild.md +0 -6
- package/docs/apis/servers/mcp.md +2 -2
- package/docs/examples/entity.md +124 -0
- package/package.json +73 -21
- package/scripts/test-assistant-hooks.ts +13 -0
- package/src/agi/feature.ts +13 -0
- package/src/agi/features/assistant.ts +36 -25
- package/src/agi/features/assistants-manager.ts +70 -5
- package/src/agi/features/autonomous-assistant.ts +1 -5
- package/src/agi/features/browser-use.ts +2 -2
- package/src/agi/features/claude-code.ts +165 -1
- package/src/agi/features/conversation-history.ts +2 -6
- package/src/agi/features/conversation.ts +95 -3
- package/src/agi/features/docs-reader.ts +2 -1
- package/src/agi/features/file-tools.ts +2 -2
- package/src/agi/features/luca-coder.ts +1 -5
- package/src/agi/features/openai-codex.ts +1 -1
- package/src/agi/features/openapi.ts +3 -3
- package/src/agi/features/skills-library.ts +90 -2
- package/src/agi/lib/interceptor-chain.ts +10 -0
- package/src/agi/lib/token-counter.ts +1 -1
- package/src/bootstrap/generated.ts +126 -1
- package/src/bus.ts +27 -5
- package/src/cli/build-info.ts +2 -2
- package/src/client.ts +2 -2
- package/src/clients/elevenlabs/index.ts +5 -0
- package/src/commands/bootstrap.ts +2 -1
- package/src/commands/chat.ts +1 -0
- package/src/commands/code.ts +4 -2
- package/src/commands/prompt.ts +34 -34
- package/src/commands/sandbox-mcp.ts +69 -163
- package/src/commands/save-api-docs.ts +10 -8
- package/src/commands/select.ts +8 -3
- package/src/container-describer.ts +70 -84
- package/src/container.ts +93 -3
- package/src/endpoint.ts +1 -1
- package/src/entity.ts +173 -0
- package/src/feature.ts +3 -3
- package/src/helper.ts +8 -4
- package/src/introspection/generated.agi.ts +1403 -929
- package/src/introspection/generated.node.ts +127 -33
- package/src/introspection/generated.web.ts +95 -3
- package/src/introspection/scan.ts +1 -1
- package/src/node/container.ts +1 -1
- package/src/node/features/content-db.ts +3 -3
- package/src/node/features/file-manager.ts +10 -9
- package/src/node/features/git.ts +5 -5
- package/src/node/features/helpers.ts +1 -1
- package/src/node/features/json-tree.ts +1 -1
- package/src/node/features/os.ts +3 -3
- package/src/node/features/package-finder.ts +1 -1
- package/src/node/features/process-manager.ts +1 -1
- package/src/node/features/python.ts +3 -3
- package/src/node/features/redis.ts +1 -1
- package/src/node/features/repl.ts +2 -2
- package/src/node/features/transpiler.ts +34 -9
- package/src/node/features/ui.ts +1 -1
- package/src/node/features/vm.ts +6 -5
- package/src/node/features/yaml-tree.ts +1 -1
- package/src/node.ts +1 -0
- package/src/python/generated.ts +1 -1
- package/src/scaffolds/generated.ts +1 -1
- package/src/selector.ts +74 -4
- package/src/server.ts +2 -2
- package/src/servers/mcp.ts +6 -6
- package/src/web/features/helpers.ts +1 -1
- package/src/web/features/network.ts +1 -0
- package/test/assistant.test.ts +72 -0
- package/test/conversation.test.ts +220 -0
- package/test/vm-loadmodule.test.ts +213 -0
- package/tsconfig.build.json +12 -0
- package/tsconfig.json +1 -1
- package/scripts/examples/telegram-ink-ui.ts +0 -302
- package/scripts/examples/using-openai-codex.ts +0 -23
- package/scripts/examples/vm-loading-esm-modules.ts +0 -16
package/dist/node.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { NodeContainer, Feature } from './node/container';
|
|
2
|
+
import './introspection/generated.node';
|
|
3
|
+
export * from './node/container';
|
|
4
|
+
declare const servers: import("./server").ServersRegistry, features: import("@soederpop/luca/feature").FeaturesRegistry, clients: import("@soederpop/luca/client").ClientsRegistry;
|
|
5
|
+
declare const _default: NodeContainer;
|
|
6
|
+
export default _default;
|
|
7
|
+
/**
|
|
8
|
+
* Returns the singleton container instance.
|
|
9
|
+
* LLMs love to hallucinate this function — so we provide it, but warn.
|
|
10
|
+
* If you need a separate container, use `container.subcontainer()`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createContainer(): NodeContainer<import("./node").NodeFeatures, {
|
|
13
|
+
started: boolean;
|
|
14
|
+
enabledFeatures: string[];
|
|
15
|
+
registries: string[];
|
|
16
|
+
factories: string[];
|
|
17
|
+
}>;
|
|
18
|
+
export declare const ui: import("./node").UI<{
|
|
19
|
+
[x: string]: unknown;
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
fonts?: string[] | undefined;
|
|
22
|
+
colorPalette?: string[] | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const fs: import("./node").FS;
|
|
25
|
+
export declare const vm: import("./node/features/vm").VM<{
|
|
26
|
+
[x: string]: unknown;
|
|
27
|
+
enabled: boolean;
|
|
28
|
+
}, {
|
|
29
|
+
context: any;
|
|
30
|
+
name?: string | undefined;
|
|
31
|
+
_cacheKey?: string | undefined;
|
|
32
|
+
cached?: boolean | undefined;
|
|
33
|
+
enable?: boolean | undefined;
|
|
34
|
+
}>;
|
|
35
|
+
export declare const proc: import("./node").ChildProcess;
|
|
36
|
+
export { servers, features, clients };
|
|
37
|
+
export { Feature };
|
|
38
|
+
export { Container } from './container';
|
|
39
|
+
export { Helper } from './helper';
|
|
40
|
+
export { Bus } from './bus';
|
|
41
|
+
export { State } from './state';
|
|
42
|
+
export { Registry } from './registry';
|
|
43
|
+
export { Client, ClientsRegistry } from './client';
|
|
44
|
+
export { RestClient } from './clients/rest';
|
|
45
|
+
export { GraphClient } from './clients/graph';
|
|
46
|
+
export { WebSocketClient } from './clients/websocket';
|
|
47
|
+
export { Command, CommandsRegistry, commands } from './command';
|
|
48
|
+
export { Endpoint, EndpointsRegistry, endpoints } from './endpoint';
|
|
49
|
+
export { Selector, SelectorsRegistry, selectors } from './selector';
|
|
50
|
+
export { Server, ServersRegistry } from './server';
|
|
51
|
+
export { FeaturesRegistry } from './feature';
|
|
52
|
+
export { ExpressServer } from './servers/express';
|
|
53
|
+
export { WebsocketServer } from './servers/socket';
|
|
54
|
+
export type { ContainerContext, ContainerArgv, Plugin, Extension } from './container';
|
|
55
|
+
export type { AvailableClients } from './client';
|
|
56
|
+
export type { AvailableCommands, CommandHandler } from './command';
|
|
57
|
+
export type { AvailableEndpoints, EndpointContext } from './endpoint';
|
|
58
|
+
export type { AvailableSelectors, SelectorsInterface, SelectorRunResult, SimpleSelector } from './selector';
|
|
59
|
+
export type { AvailableFeatures, FeatureOptions, FeatureState } from './feature';
|
|
60
|
+
export type { NodeContainer, NodeFeatures } from './node/container';
|
|
61
|
+
export type { AvailableServers, StartOptions, ServersInterface } from './server';
|
|
62
|
+
export type { HelperState, HelperOptions } from './helper';
|
|
63
|
+
export type { EventMap } from './bus';
|
|
64
|
+
export type { SetStateValue, StateChangeType } from './state';
|
|
65
|
+
export { z } from 'zod';
|
|
66
|
+
export * from './schemas/base';
|
|
67
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,gCAAgC,CAAA;AAEvC,cAAc,kBAAkB,CAAA;AAIhC,QAAA,MAAQ,OAAO,sCAAE,QAAQ,sDAAE,OAAO,kDAAc,CAAA;wBAEpB,aAAa;AAAzC,wBAAyC;AAEzC;;;;GAIG;AACH,wBAAgB,eAAe;;;;;GAO9B;AAGD,eAAO,MAAM,EAAE;;;;;EAA0B,CAAA;AACzC,eAAO,MAAM,EAAE,qBAA0B,CAAA;AACzC,eAAO,MAAM,EAAE;;;;;;;;;EAA0B,CAAA;AACzC,eAAO,MAAM,IAAI,+BAA4B,CAAA;AAG7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAA;AAGrC,OAAO,EAAE,OAAO,EAAE,CAAA;AAClB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE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AAE,MAAM,WAAW,CAAA;AAChF,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACnE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAChF,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC1D,YAAY,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACrC,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAG7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,cAAc,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const bridgeScript = "#!/usr/bin/env python3\n\"\"\"Luca Python Bridge - persistent interactive Python session.\n\nCommunicates via JSON lines over stdin/stdout. Each request is a single\nJSON object per line on stdin; each response is a single JSON object per\nline on stdout. User print() output is captured per-execution via\nio.StringIO so it never corrupts the protocol.\n\nPython 3.8+ compatible (stdlib only).\n\"\"\"\nimport sys\nimport json\nimport io\nimport traceback\nimport os\n\n# Persistent namespace shared across all exec/eval calls\n_namespace = {\"__builtins__\": __builtins__}\n\n\ndef setup_sys_path(project_dir):\n \"\"\"Insert project_dir and common sub-paths into sys.path.\"\"\"\n paths_to_add = [project_dir]\n\n # src/ layout (PEP 621 / setuptools)\n src_dir = os.path.join(project_dir, \"src\")\n if os.path.isdir(src_dir):\n paths_to_add.append(src_dir)\n\n # lib/ layout (less common but exists)\n lib_dir = os.path.join(project_dir, \"lib\")\n if os.path.isdir(lib_dir):\n paths_to_add.append(lib_dir)\n\n for p in reversed(paths_to_add):\n if p not in sys.path:\n sys.path.insert(0, p)\n\n\ndef _safe_serialize(value):\n \"\"\"Attempt JSON serialization; fall back to repr().\"\"\"\n try:\n json.dumps(value, default=str)\n return value\n except (TypeError, ValueError, OverflowError):\n return repr(value)\n\n\ndef handle_exec(req):\n \"\"\"Execute code in the persistent namespace.\"\"\"\n code = req.get(\"code\", \"\")\n variables = req.get(\"variables\", {})\n _namespace.update(variables)\n\n old_stdout = sys.stdout\n captured = io.StringIO()\n sys.stdout = captured\n try:\n exec(code, _namespace)\n sys.stdout = old_stdout\n return {\"ok\": True, \"stdout\": captured.getvalue(), \"result\": None}\n except Exception as e:\n sys.stdout = old_stdout\n return {\n \"ok\": False,\n \"error\": str(e),\n \"traceback\": traceback.format_exc(),\n \"stdout\": captured.getvalue(),\n }\n\n\ndef handle_eval(req):\n \"\"\"Evaluate an expression and return its value.\"\"\"\n expression = req.get(\"expression\", \"\")\n\n old_stdout = sys.stdout\n captured = io.StringIO()\n sys.stdout = captured\n try:\n result = eval(expression, _namespace)\n sys.stdout = old_stdout\n return {\n \"ok\": True,\n \"result\": _safe_serialize(result),\n \"stdout\": captured.getvalue(),\n }\n except Exception as e:\n sys.stdout = old_stdout\n return {\n \"ok\": False,\n \"error\": str(e),\n \"traceback\": traceback.format_exc(),\n \"stdout\": captured.getvalue(),\n }\n\n\ndef handle_import(req):\n \"\"\"Import a module into the namespace.\"\"\"\n module_name = req.get(\"module\", \"\")\n alias = req.get(\"alias\", module_name.split(\".\")[-1])\n try:\n mod = __import__(\n module_name,\n fromlist=[module_name.split(\".\")[-1]] if \".\" in module_name else [],\n )\n _namespace[alias] = mod\n return {\"ok\": True, \"result\": \"Imported {} as {}\".format(module_name, alias)}\n except Exception as e:\n return {\n \"ok\": False,\n \"error\": str(e),\n \"traceback\": traceback.format_exc(),\n }\n\n\ndef handle_call(req):\n \"\"\"Call a function by dotted path in the namespace.\"\"\"\n func_path = req.get(\"function\", \"\")\n args = req.get(\"args\", [])\n kwargs = req.get(\"kwargs\", {})\n\n old_stdout = sys.stdout\n captured = io.StringIO()\n sys.stdout = captured\n try:\n parts = func_path.split(\".\")\n obj = _namespace[parts[0]]\n for part in parts[1:]:\n obj = getattr(obj, part)\n result = obj(*args, **kwargs)\n sys.stdout = old_stdout\n return {\n \"ok\": True,\n \"result\": _safe_serialize(result),\n \"stdout\": captured.getvalue(),\n }\n except Exception as e:\n sys.stdout = old_stdout\n return {\n \"ok\": False,\n \"error\": str(e),\n \"traceback\": traceback.format_exc(),\n \"stdout\": captured.getvalue(),\n }\n\n\ndef handle_get_locals(req):\n \"\"\"Return all non-dunder keys from the namespace.\"\"\"\n safe = {}\n for k, v in _namespace.items():\n if k.startswith(\"__\"):\n continue\n safe[k] = _safe_serialize(v)\n return {\"ok\": True, \"result\": safe}\n\n\ndef handle_reset(req):\n \"\"\"Clear the namespace.\"\"\"\n _namespace.clear()\n _namespace[\"__builtins__\"] = __builtins__\n return {\"ok\": True, \"result\": \"Session reset\"}\n\n\nHANDLERS = {\n \"exec\": handle_exec,\n \"eval\": handle_eval,\n \"import\": handle_import,\n \"call\": handle_call,\n \"get_locals\": handle_get_locals,\n \"reset\": handle_reset,\n}\n\n\ndef main():\n # First line from stdin is the init handshake with project_dir\n init_line = sys.stdin.readline().strip()\n if init_line:\n try:\n init = json.loads(init_line)\n if \"project_dir\" in init:\n setup_sys_path(init[\"project_dir\"])\n except json.JSONDecodeError:\n pass\n\n # Signal ready\n sys.stdout.write(json.dumps({\"ok\": True, \"type\": \"ready\"}) + \"\\n\")\n sys.stdout.flush()\n\n # Main loop: read JSON commands, execute, respond\n for line in sys.stdin:\n line = line.strip()\n if not line:\n continue\n\n try:\n req = json.loads(line)\n except json.JSONDecodeError as e:\n resp = {\"ok\": False, \"error\": \"Invalid JSON: {}\".format(e)}\n sys.stdout.write(json.dumps(resp) + \"\\n\")\n sys.stdout.flush()\n continue\n\n req_id = req.get(\"id\")\n req_type = req.get(\"type\", \"exec\")\n handler = HANDLERS.get(req_type)\n\n if not handler:\n resp = {\"ok\": False, \"error\": \"Unknown request type: {}\".format(req_type)}\n else:\n resp = handler(req)\n\n if req_id:\n resp[\"id\"] = req_id\n\n sys.stdout.write(json.dumps(resp, default=str) + \"\\n\")\n sys.stdout.flush()\n\n\nif __name__ == \"__main__\":\n main()\n";
|
|
2
|
+
//# sourceMappingURL=generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated.d.ts","sourceRoot":"","sources":["../../src/python/generated.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,02MA4NxB,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { Container, AvailableFeatures } from '../container';
|
|
3
|
+
import type { Helper } from '../helper';
|
|
4
|
+
import type { StateChangeType } from '../state';
|
|
5
|
+
declare const ContainerContext: import("react").Context<Container<AvailableFeatures, any> | null>;
|
|
6
|
+
declare function ContainerProvider({ container, children }: {
|
|
7
|
+
container: Container;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}): import("react").FunctionComponentElement<import("react").ProviderProps<Container<AvailableFeatures, any> | null>>;
|
|
10
|
+
declare function useContainer<T extends Container = Container>(): T;
|
|
11
|
+
type HasState = {
|
|
12
|
+
state: {
|
|
13
|
+
current: any;
|
|
14
|
+
version: number;
|
|
15
|
+
observe: (cb: (changeType: StateChangeType, key: any, value?: any) => void) => () => void;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
declare function useContainerState<T extends object = any>(target?: HasState): T;
|
|
19
|
+
declare function useStateValue<V = any>(target: HasState, key: string): V | undefined;
|
|
20
|
+
declare function useStateVersion(target?: HasState): number;
|
|
21
|
+
type HasEvents = {
|
|
22
|
+
on: (event: string, listener: (...args: any[]) => void) => any;
|
|
23
|
+
off: (event: string, listener?: (...args: any[]) => void) => any;
|
|
24
|
+
};
|
|
25
|
+
declare function useEvent(target: HasEvents, event: string, handler: (...args: any[]) => void): void;
|
|
26
|
+
declare function useWaitFor<T = any>(target: HasEvents & {
|
|
27
|
+
waitFor: (event: string) => Promise<any>;
|
|
28
|
+
}, event: string): {
|
|
29
|
+
data: T | undefined;
|
|
30
|
+
pending: boolean;
|
|
31
|
+
error: Error | undefined;
|
|
32
|
+
};
|
|
33
|
+
declare function useFeature<K extends keyof AvailableFeatures>(name: K, options?: ConstructorParameters<AvailableFeatures[K]>[0]): InstanceType<AvailableFeatures[K]>;
|
|
34
|
+
declare function useHelperState<T extends object = any>(helper: Helper): [T, (value: any) => void];
|
|
35
|
+
export { ContainerContext, ContainerProvider, useContainer, useContainerState, useStateValue, useStateVersion, useEvent, useWaitFor, useFeature, useHelperState, };
|
|
36
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAI/C,QAAA,MAAM,gBAAgB,mEAAwC,CAAA;AAE9D,iBAAS,iBAAiB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,qHAEhG;AAED,iBAAS,YAAY,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,KAAK,CAAC,CAM1D;AAID,KAAK,QAAQ,GAAG;IAAE,KAAK,EAAE;QAAE,OAAO,EAAE,GAAG,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,UAAU,EAAE,eAAe,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,KAAK,MAAM,IAAI,CAAA;KAAE,CAAA;CAAE,CAAA;AAEvJ,iBAAS,iBAAiB,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG,EAAE,MAAM,CAAC,EAAE,QAAQ,G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S,MAAM,GAAG,GAAG,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC,CAiBzF;AAID,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,QAAQ,EACR,UAAU,EACV,UAAU,EACV,cAAc,GACf,CAAA"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { Helper } from './helper.js';
|
|
2
|
+
import type { ContainerContext } from './container.js';
|
|
3
|
+
import type { HelperIntrospection } from './introspection/index.js';
|
|
4
|
+
export type { HelperIntrospection };
|
|
5
|
+
declare abstract class Registry<T extends Helper> {
|
|
6
|
+
scope: string;
|
|
7
|
+
baseClass?: new (options: any, context: ContainerContext) => T;
|
|
8
|
+
private readonly members;
|
|
9
|
+
private readonly _events;
|
|
10
|
+
constructor();
|
|
11
|
+
/**
|
|
12
|
+
* Lists the keys of all available helpers in this registry.
|
|
13
|
+
*/
|
|
14
|
+
get available(): string[];
|
|
15
|
+
/**
|
|
16
|
+
* Register a new helper in this registry.
|
|
17
|
+
*
|
|
18
|
+
* @param id - The id of the helper to register.
|
|
19
|
+
* @param constructor - The constructor for the helper.
|
|
20
|
+
* @returns The constructor for the helper.
|
|
21
|
+
*/
|
|
22
|
+
register(id: string, constructor: new (options: any, context: ContainerContext) => T): new (options: any, context: ContainerContext) => T;
|
|
23
|
+
/**
|
|
24
|
+
* Remove a helper from this registry.
|
|
25
|
+
*
|
|
26
|
+
* @param id - The id of the helper to unregister.
|
|
27
|
+
* @returns True if the helper was removed, false if it wasn't registered.
|
|
28
|
+
*/
|
|
29
|
+
unregister(id: string): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Check if a helper is registered in this registry.
|
|
32
|
+
*
|
|
33
|
+
* @param id - The id of the helper to check.
|
|
34
|
+
* @returns True if the helper is registered, false otherwise.
|
|
35
|
+
*/
|
|
36
|
+
has(id: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Lookup a helper by id.
|
|
39
|
+
*
|
|
40
|
+
* @param id - The id of the helper to lookup.
|
|
41
|
+
* @returns The constructor for the helper.
|
|
42
|
+
*/
|
|
43
|
+
lookup(id: string): new (options: any, context: ContainerContext) => T;
|
|
44
|
+
/**
|
|
45
|
+
* View data about the interface for a particular Helper. Will tell you about the options
|
|
46
|
+
* to create one, the state it maintains, the methods and properties it has, and the events it emits.
|
|
47
|
+
*/
|
|
48
|
+
introspect(id: string): HelperIntrospection | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Learn about the interface for a particular Helper. Will tell you about the options
|
|
51
|
+
* to create one, the state it maintains, the methods and properties it has, and the events it emits.
|
|
52
|
+
*
|
|
53
|
+
* Will return information as a markdown string.
|
|
54
|
+
*/
|
|
55
|
+
describe(id: string): string;
|
|
56
|
+
/**
|
|
57
|
+
* Returns a condensed overview of all available helpers in this registry.
|
|
58
|
+
* Shows each helper's name and description, without the full introspection details.
|
|
59
|
+
*
|
|
60
|
+
* Use `describe(id)` to get the full details for a specific helper.
|
|
61
|
+
*/
|
|
62
|
+
describeAll(): string;
|
|
63
|
+
/**
|
|
64
|
+
* Emit an event on the registry's event bus.
|
|
65
|
+
*
|
|
66
|
+
* @param event - The event to emit.
|
|
67
|
+
* @param args - The arguments to pass to the event listener.
|
|
68
|
+
* @returns The registry instance.
|
|
69
|
+
*/
|
|
70
|
+
emit(event: string, ...args: any[]): this;
|
|
71
|
+
/**
|
|
72
|
+
* Subscribe to an event on the registry's event bus.
|
|
73
|
+
*
|
|
74
|
+
* @param event - The event to subscribe to.
|
|
75
|
+
* @param listener - The listener to call when the event is emitted.
|
|
76
|
+
* @returns The registry instance.
|
|
77
|
+
*/
|
|
78
|
+
on(event: string, listener: (...args: any[]) => void): this;
|
|
79
|
+
/**
|
|
80
|
+
* Unsubscribe a listener from an event on the registry's event bus.
|
|
81
|
+
*
|
|
82
|
+
* @param event - The event to unsubscribe from.
|
|
83
|
+
* @param listener - The listener to unsubscribe.
|
|
84
|
+
* @returns The registry instance.
|
|
85
|
+
*/
|
|
86
|
+
off(event: string, listener: (...args: any[]) => void): this;
|
|
87
|
+
/**
|
|
88
|
+
* Subscribe to an event on the registry's event bus, but only fire once.
|
|
89
|
+
*
|
|
90
|
+
* @param event - The event to subscribe to.
|
|
91
|
+
* @param listener - The listener to call when the event is emitted.
|
|
92
|
+
* @returns The registry instance.
|
|
93
|
+
*/
|
|
94
|
+
once(event: string, listener: (...args: any[]) => void): this;
|
|
95
|
+
}
|
|
96
|
+
export { Registry };
|
|
97
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAKvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,YAAY,EAAE,mBAAmB,EAAE,CAAA;AAEnC,uBAAe,QAAQ,CAAC,CAAC,SAAS,MAAM;IACtC,KAAK,EAAE,MAAM,CAAgB;IAE7B,SAAS,CAAC,EAAE,KAAK,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,gBAAgB,KAAK,CAAC,CAAA;IAE9D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmE;IAE3F,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAO;;IAiC/B;;MAEE;IACF,IAAI,SAAS,IAAK,MAAM,EAAE,CAEzB;IAED;;;;;;MAME;IACF,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,gBAAgB,KAAK,CAAC,iBAApC,GAAG,WAAW,gBAAgB,KAAK,CAAC;IAOpF;;;;;MAKE;IACF,UAAU,CAAC,EAAE,EAAE,MAAM,GAAI,OAAO;IAKhC;;;;;MAKE;IACF,GAAG,CAAC,EAAE,EAAE,MAAM,GAAI,OAAO;IAIzB;;;;;MAKE;IACF,MAAM,CAAC,EAAE,EAAE,MAAM,GAAI,KAAK,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,gBAAgB,KAAK,CAAC;IAuBvE;;;MAGE;IACF,UAAU,CAAC,EAAE,EAAE,MAAM,GAAI,mBAAmB,GAAG,SAAS;IAIxD;;;;;MAKE;IACF,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAI,MAAM;IAM7B;;;;;MAKE;IACF,WAAW,IAAK,MAAM;IAatB;;;;;;MAME;IACF,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE;IAKlC;;;;;;MAME;IACF,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI;IAKpD;;;;;;MAME;IACF,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI;IAKrD;;;;;;MAME;IACF,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI;CAIvD;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ScaffoldSection {
|
|
2
|
+
heading: string;
|
|
3
|
+
code: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ScaffoldData {
|
|
6
|
+
sections: ScaffoldSection[];
|
|
7
|
+
full: string;
|
|
8
|
+
tutorial: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const scaffolds: Record<string, ScaffoldData>;
|
|
11
|
+
export declare const assistantFiles: Record<string, string>;
|
|
12
|
+
export declare const mcpReadme = "# Luca Development Guide\n\nYou are working in a **luca project**. The luca container provides all capabilities your code needs. Do not install npm packages or import Node.js builtins directly.\n\n## The Contract\n\nEvery capability goes through the container. If you need something that doesn't exist, build it as a feature, client, or server. If it wraps a third-party library, the helper IS the interface \u2014 consumer code never imports the library directly.\n\n## Import Rule\n\nAll consumer code imports from `@soederpop/luca` only:\n\n```ts\nimport { Feature, features, z, FeatureStateSchema, FeatureOptionsSchema } from '@soederpop/luca'\nimport { Client, clients, RestClient, ClientStateSchema } from '@soederpop/luca/client'\nimport { Server, servers, ServerStateSchema } from '@soederpop/luca'\nimport { commands, CommandOptionsSchema } from '@soederpop/luca'\n```\n\nNever import from `fs`, `path`, `crypto`, or other Node builtins. Never import third-party packages in consumer code. If a container feature wraps the functionality, use it.\n\n## Zod v4\n\nThis project uses **Zod v4** \u2014 import `z` from `@soederpop/luca`, never from `'zod'` directly. All option, state, and event schemas use Zod v4 syntax. Key patterns:\n\n```ts\n// Extending base schemas (options, state, events)\nexport const MyStateSchema = FeatureStateSchema.extend({\n count: z.number().default(0).describe('Number of items'),\n label: z.string().optional().describe('Display label'),\n})\n\n// Events use z.tuple() for listener arguments\nexport const MyEventsSchema = FeatureEventsSchema.extend({\n itemAdded: z.tuple([z.string().describe('key'), z.number().describe('index')]),\n})\n\n// Type inference\nexport type MyState = z.infer<typeof MyStateSchema>\n```\n\nZod v4 differences from v3 that matter:\n- `z.string().check(...)` replaces some v3 refinement patterns\n- `.toJSONSchema()` is built-in on any schema \u2014 no external library needed\n- Error customization uses `z.string({ error: \"message\" })` not `.refine()` for simple cases\n- `z.interface()` exists for recursive/lazy object types\n- Do NOT use `z.nativeEnum()` \u2014 use `z.enum()` instead\n\n## Dependencies\n\nIf the project has `node_modules` and a package manager, helper implementations can import third-party libraries internally. If not (e.g. running via the `luca` binary's VM), all code must import only from `@soederpop/luca`.\n\n## Discovering Capabilities\n\nThe container has registries for features, clients, servers, commands, and endpoints. **Do not guess** what is available \u2014 use your MCP tools to discover it:\n\n1. **`find_capability`** \u2014 Overview of all features, clients, and servers with descriptions. Start here.\n2. **`list_registry`** \u2014 List all names in a specific registry (features, clients, servers, commands, endpoints).\n3. **`describe_helper`** \u2014 Full API docs for a specific helper (methods, options, state, events). Call this before writing code that uses a helper.\n4. **`eval`** \u2014 Once you know what you need, prototype calls in the live sandbox before writing them into files.\n\n## Mini Examples\n\n### Feature with composition\n\nFeatures access other features via `this.container.feature(...)`:\n\n```ts\nimport { z } from 'zod'\nimport { FeatureStateSchema, FeatureOptionsSchema, FeatureEventsSchema } from '@soederpop/luca'\nimport { Feature, features } from '@soederpop/luca'\nimport type { ContainerContext } from '@soederpop/luca'\n\nexport const ConfigStateSchema = FeatureStateSchema.extend({\n loaded: z.boolean().default(false).describe('Whether config has been loaded'),\n})\n\nexport const ConfigOptionsSchema = FeatureOptionsSchema.extend({\n filePath: z.string().default('config.json').describe('Path to config file'),\n})\n\nexport const ConfigEventsSchema = FeatureEventsSchema.extend({\n configLoaded: z.tuple([z.record(z.unknown()).describe('parsed config')]),\n})\n\nexport class Config extends Feature<z.infer<typeof ConfigStateSchema>, z.infer<typeof ConfigOptionsSchema>> {\n static override shortcut = 'features.config' as const\n static override stateSchema = ConfigStateSchema\n static override optionsSchema = ConfigOptionsSchema\n static override eventsSchema = ConfigEventsSchema\n static override description = 'Loads and manages project configuration'\n\n /** Load and parse the config file */\n async load() {\n const fs = this.container.feature('fs')\n const raw = await fs.readFile(this.options.filePath)\n const data = JSON.parse(raw)\n this.state.set('loaded', true)\n this.emit('configLoaded', data)\n return data\n }\n}\n\ndeclare module '@soederpop/luca' {\n interface AvailableFeatures { config: typeof Config }\n}\nexport default features.register('config', Config)\n```\n\n### Client with composition\n\nClients access features and other clients via `this.container`:\n\n```ts\nimport { z } from 'zod'\nimport { Client, clients, ClientStateSchema, ClientOptionsSchema, ClientEventsSchema } from '@soederpop/luca'\nimport type { ContainerContext } from '@soederpop/luca'\n\nexport const GithubOptionsSchema = ClientOptionsSchema.extend({\n token: z.string().describe('GitHub personal access token'),\n owner: z.string().describe('Repository owner'),\n repo: z.string().describe('Repository name'),\n})\n\nexport const GithubEventsSchema = ClientEventsSchema.extend({\n issuesFetched: z.tuple([z.number().describe('count')]),\n})\n\nexport class GithubClient extends Client<z.infer<typeof ClientStateSchema>, z.infer<typeof GithubOptionsSchema>> {\n static override shortcut = 'clients.github' as const\n static override optionsSchema = GithubOptionsSchema\n static override eventsSchema = GithubEventsSchema\n static override description = 'GitHub API client using container REST client'\n\n /** Fetch open issues */\n async issues() {\n const rest = this.container.client('rest')\n const res = await rest.get(`https://api.github.com/repos/${this.options.owner}/${this.options.repo}/issues`, {\n headers: { Authorization: `token ${this.options.token}` },\n })\n this.emit('issuesFetched', res.data.length)\n return res.data\n }\n}\n\ndeclare module '@soederpop/luca' {\n interface AvailableClients { github: typeof GithubClient }\n}\nexport default clients.register('github', GithubClient)\n```\n\n## Workflow\n\n1. **`find_capability`** \u2014 Search what already exists before writing anything\n2. **`describe_helper`** \u2014 Read the full API docs for the helper you need\n3. **`eval`** \u2014 Prototype and test container API calls in the sandbox\n4. **`scaffold`** \u2014 Generate correct boilerplate when building something new\n5. **Write the file** \u2014 Using the patterns from the scaffold\n\n## Portability\n\nCode that only imports from `@soederpop/luca` can be copied between any luca project. That's the goal. Features, clients, servers, and commands written this way are portable building blocks.\n";
|
|
13
|
+
//# sourceMappingURL=generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated.d.ts","sourceRoot":"","sources":["../../src/scaffolds/generated.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,eAAe,EAAE,CAAA;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CA4jDlD,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAmCjD,CAAA;AAED,eAAO,MAAM,SAAS,gzNAkKrB,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Convert a string to PascalCase */
|
|
2
|
+
export declare function toPascalCase(str: string): string;
|
|
3
|
+
/** Convert a string to camelCase */
|
|
4
|
+
export declare function toCamelCase(str: string): string;
|
|
5
|
+
/** Convert a string to kebab-case */
|
|
6
|
+
export declare function toKebabCase(str: string): string;
|
|
7
|
+
/** Apply mustache-style template variables to scaffold code */
|
|
8
|
+
export declare function applyTemplate(template: string, vars: Record<string, string>): string;
|
|
9
|
+
/** Generate scaffolded code for a given helper type */
|
|
10
|
+
export declare function generateScaffold(type: string, name: string, description?: string): string | null;
|
|
11
|
+
//# sourceMappingURL=template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/scaffolds/template.ts"],"names":[],"mappings":"AAEA,qCAAqC;AACrC,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAIhD;AAED,oCAAoC;AACpC,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAG/C;AAED,qCAAqC;AACrC,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAK/C;AAED,+DAA+D;AAC/D,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAMpF;AAED,uDAAuD;AACvD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAYhG"}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const HelperStateSchema: z.ZodObject<{}, z.core.$loose>;
|
|
3
|
+
export declare const HelperOptionsSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodOptional<z.ZodString>;
|
|
5
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export type InferState<T extends z.ZodType> = z.infer<T>;
|
|
8
|
+
export type InferOptions<T extends z.ZodType> = z.infer<T>;
|
|
9
|
+
/**
|
|
10
|
+
* Infer an EventMap from an events schema where each key is an event name
|
|
11
|
+
* and each value is a z.tuple() describing the listener arguments.
|
|
12
|
+
*
|
|
13
|
+
* e.g. z.object({ ready: z.tuple([]), message: z.tuple([z.string()]) })
|
|
14
|
+
* => { ready: [], message: [string] }
|
|
15
|
+
*/
|
|
16
|
+
export type InferEvents<T extends z.ZodType> = z.infer<T> extends infer E ? {
|
|
17
|
+
[K in keyof E]: E[K] extends any[] ? E[K] : any[];
|
|
18
|
+
} : Record<string, any[]>;
|
|
19
|
+
export declare const createHelperSchemas: <StateSchema extends z.ZodType, OptionsSchema extends z.ZodType>(stateSchema: StateSchema, optionsSchema: OptionsSchema) => {
|
|
20
|
+
state: StateSchema;
|
|
21
|
+
options: OptionsSchema;
|
|
22
|
+
types: {
|
|
23
|
+
State: InferState<StateSchema>;
|
|
24
|
+
Options: InferOptions<OptionsSchema>;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export declare const ContainerStateSchema: z.ZodObject<{
|
|
28
|
+
started: z.ZodDefault<z.ZodBoolean>;
|
|
29
|
+
enabledFeatures: z.ZodArray<z.ZodString>;
|
|
30
|
+
registries: z.ZodArray<z.ZodString>;
|
|
31
|
+
factories: z.ZodArray<z.ZodString>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
export declare const FeatureStateSchema: z.ZodObject<{
|
|
34
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
35
|
+
}, z.core.$loose>;
|
|
36
|
+
export declare const FeatureOptionsSchema: z.ZodObject<{
|
|
37
|
+
name: z.ZodOptional<z.ZodString>;
|
|
38
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
39
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
export declare const ClientStateSchema: z.ZodObject<{
|
|
43
|
+
connected: z.ZodDefault<z.ZodBoolean>;
|
|
44
|
+
}, z.core.$loose>;
|
|
45
|
+
export declare const ClientOptionsSchema: z.ZodObject<{
|
|
46
|
+
name: z.ZodOptional<z.ZodString>;
|
|
47
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
48
|
+
baseURL: z.ZodOptional<z.ZodString>;
|
|
49
|
+
json: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export declare const ServerStateSchema: z.ZodObject<{
|
|
52
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
listening: z.ZodDefault<z.ZodBoolean>;
|
|
54
|
+
configured: z.ZodDefault<z.ZodBoolean>;
|
|
55
|
+
stopped: z.ZodDefault<z.ZodBoolean>;
|
|
56
|
+
}, z.core.$loose>;
|
|
57
|
+
export declare const ServerOptionsSchema: z.ZodObject<{
|
|
58
|
+
name: z.ZodOptional<z.ZodString>;
|
|
59
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
60
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
host: z.ZodOptional<z.ZodString>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
export declare const HelperEventsSchema: z.ZodObject<{
|
|
64
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
export declare const FeatureEventsSchema: z.ZodObject<{
|
|
67
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
68
|
+
enabled: z.ZodTuple<[], null>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
export declare const ClientEventsSchema: z.ZodObject<{
|
|
71
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
72
|
+
failure: z.ZodTuple<[z.ZodAny], null>;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
export declare const WebSocketClientStateSchema: z.ZodObject<{
|
|
75
|
+
connected: z.ZodDefault<z.ZodBoolean>;
|
|
76
|
+
connectionError: z.ZodOptional<z.ZodAny>;
|
|
77
|
+
reconnectAttempts: z.ZodDefault<z.ZodNumber>;
|
|
78
|
+
}, z.core.$loose>;
|
|
79
|
+
export declare const WebSocketClientOptionsSchema: z.ZodObject<{
|
|
80
|
+
name: z.ZodOptional<z.ZodString>;
|
|
81
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
82
|
+
baseURL: z.ZodOptional<z.ZodString>;
|
|
83
|
+
json: z.ZodOptional<z.ZodBoolean>;
|
|
84
|
+
reconnect: z.ZodOptional<z.ZodBoolean>;
|
|
85
|
+
reconnectInterval: z.ZodOptional<z.ZodNumber>;
|
|
86
|
+
maxReconnectAttempts: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
export declare const WebSocketClientEventsSchema: z.ZodObject<{
|
|
89
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
90
|
+
failure: z.ZodTuple<[z.ZodAny], null>;
|
|
91
|
+
message: z.ZodTuple<[z.ZodAny], null>;
|
|
92
|
+
open: z.ZodTuple<[], null>;
|
|
93
|
+
close: z.ZodTuple<[z.ZodOptional<z.ZodNumber>, z.ZodOptional<z.ZodString>], null>;
|
|
94
|
+
error: z.ZodTuple<[z.ZodAny], null>;
|
|
95
|
+
reconnecting: z.ZodTuple<[z.ZodNumber], null>;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
export declare const GraphClientOptionsSchema: z.ZodObject<{
|
|
98
|
+
name: z.ZodOptional<z.ZodString>;
|
|
99
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
100
|
+
baseURL: z.ZodOptional<z.ZodString>;
|
|
101
|
+
json: z.ZodOptional<z.ZodBoolean>;
|
|
102
|
+
endpoint: z.ZodOptional<z.ZodString>;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
export declare const GraphClientEventsSchema: z.ZodObject<{
|
|
105
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
106
|
+
failure: z.ZodTuple<[z.ZodAny], null>;
|
|
107
|
+
graphqlError: z.ZodTuple<[z.ZodArray<z.ZodAny>], null>;
|
|
108
|
+
}, z.core.$strip>;
|
|
109
|
+
export declare const ServerEventsSchema: z.ZodObject<{
|
|
110
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
111
|
+
}, z.core.$strip>;
|
|
112
|
+
export declare const MCPServerOptionsSchema: z.ZodObject<{
|
|
113
|
+
name: z.ZodOptional<z.ZodString>;
|
|
114
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
115
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
116
|
+
host: z.ZodOptional<z.ZodString>;
|
|
117
|
+
transport: z.ZodOptional<z.ZodEnum<{
|
|
118
|
+
stdio: "stdio";
|
|
119
|
+
http: "http";
|
|
120
|
+
}>>;
|
|
121
|
+
serverName: z.ZodOptional<z.ZodString>;
|
|
122
|
+
serverVersion: z.ZodOptional<z.ZodString>;
|
|
123
|
+
mcpCompat: z.ZodOptional<z.ZodEnum<{
|
|
124
|
+
standard: "standard";
|
|
125
|
+
codex: "codex";
|
|
126
|
+
}>>;
|
|
127
|
+
stdioCompat: z.ZodOptional<z.ZodEnum<{
|
|
128
|
+
standard: "standard";
|
|
129
|
+
codex: "codex";
|
|
130
|
+
auto: "auto";
|
|
131
|
+
}>>;
|
|
132
|
+
}, z.core.$strip>;
|
|
133
|
+
export declare const MCPServerStateSchema: z.ZodObject<{
|
|
134
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
listening: z.ZodDefault<z.ZodBoolean>;
|
|
136
|
+
configured: z.ZodDefault<z.ZodBoolean>;
|
|
137
|
+
stopped: z.ZodDefault<z.ZodBoolean>;
|
|
138
|
+
transport: z.ZodOptional<z.ZodString>;
|
|
139
|
+
toolCount: z.ZodDefault<z.ZodNumber>;
|
|
140
|
+
resourceCount: z.ZodDefault<z.ZodNumber>;
|
|
141
|
+
promptCount: z.ZodDefault<z.ZodNumber>;
|
|
142
|
+
}, z.core.$loose>;
|
|
143
|
+
export declare const MCPServerEventsSchema: z.ZodObject<{
|
|
144
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
145
|
+
toolRegistered: z.ZodTuple<[z.ZodString], null>;
|
|
146
|
+
resourceRegistered: z.ZodTuple<[z.ZodString], null>;
|
|
147
|
+
promptRegistered: z.ZodTuple<[z.ZodString], null>;
|
|
148
|
+
toolCalled: z.ZodTuple<[z.ZodString, z.ZodAny], null>;
|
|
149
|
+
}, z.core.$strip>;
|
|
150
|
+
export declare const CommandStateSchema: z.ZodObject<{
|
|
151
|
+
running: z.ZodDefault<z.ZodBoolean>;
|
|
152
|
+
exitCode: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
}, z.core.$loose>;
|
|
154
|
+
export declare const CommandOptionsSchema: z.ZodObject<{
|
|
155
|
+
name: z.ZodOptional<z.ZodString>;
|
|
156
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
157
|
+
_: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
158
|
+
dispatchSource: z.ZodDefault<z.ZodEnum<{
|
|
159
|
+
cli: "cli";
|
|
160
|
+
headless: "headless";
|
|
161
|
+
mcp: "mcp";
|
|
162
|
+
rpc: "rpc";
|
|
163
|
+
}>>;
|
|
164
|
+
}, z.core.$strip>;
|
|
165
|
+
export type DispatchSource = 'cli' | 'headless' | 'mcp' | 'rpc';
|
|
166
|
+
export interface CommandRunResult {
|
|
167
|
+
exitCode: number;
|
|
168
|
+
stdout: string;
|
|
169
|
+
stderr: string;
|
|
170
|
+
}
|
|
171
|
+
export declare const CommandEventsSchema: z.ZodObject<{
|
|
172
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
173
|
+
started: z.ZodTuple<[], null>;
|
|
174
|
+
completed: z.ZodTuple<[z.ZodNumber], null>;
|
|
175
|
+
failed: z.ZodTuple<[z.ZodAny], null>;
|
|
176
|
+
}, z.core.$strip>;
|
|
177
|
+
export declare const SelectorStateSchema: z.ZodObject<{
|
|
178
|
+
running: z.ZodDefault<z.ZodBoolean>;
|
|
179
|
+
lastRanAt: z.ZodOptional<z.ZodNumber>;
|
|
180
|
+
}, z.core.$loose>;
|
|
181
|
+
export declare const SelectorOptionsSchema: z.ZodObject<{
|
|
182
|
+
name: z.ZodOptional<z.ZodString>;
|
|
183
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
184
|
+
dispatchSource: z.ZodDefault<z.ZodEnum<{
|
|
185
|
+
cli: "cli";
|
|
186
|
+
headless: "headless";
|
|
187
|
+
mcp: "mcp";
|
|
188
|
+
rpc: "rpc";
|
|
189
|
+
}>>;
|
|
190
|
+
}, z.core.$strip>;
|
|
191
|
+
export interface SelectorRunResult<T = any> {
|
|
192
|
+
data: T;
|
|
193
|
+
cached: boolean;
|
|
194
|
+
cacheKey: string;
|
|
195
|
+
}
|
|
196
|
+
export declare const SelectorEventsSchema: z.ZodObject<{
|
|
197
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
198
|
+
started: z.ZodTuple<[], null>;
|
|
199
|
+
completed: z.ZodTuple<[z.ZodAny], null>;
|
|
200
|
+
failed: z.ZodTuple<[z.ZodAny], null>;
|
|
201
|
+
}, z.core.$strip>;
|
|
202
|
+
export declare const EndpointStateSchema: z.ZodObject<{
|
|
203
|
+
mounted: z.ZodDefault<z.ZodBoolean>;
|
|
204
|
+
path: z.ZodDefault<z.ZodString>;
|
|
205
|
+
methods: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
206
|
+
requestCount: z.ZodDefault<z.ZodNumber>;
|
|
207
|
+
}, z.core.$loose>;
|
|
208
|
+
export declare const EndpointOptionsSchema: z.ZodObject<{
|
|
209
|
+
name: z.ZodOptional<z.ZodString>;
|
|
210
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
211
|
+
path: z.ZodString;
|
|
212
|
+
filePath: z.ZodOptional<z.ZodString>;
|
|
213
|
+
}, z.core.$strip>;
|
|
214
|
+
export declare const EndpointEventsSchema: z.ZodObject<{
|
|
215
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
216
|
+
loaded: z.ZodTuple<[z.ZodAny], null>;
|
|
217
|
+
mounted: z.ZodTuple<[z.ZodString], null>;
|
|
218
|
+
request: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodAny], null>;
|
|
219
|
+
error: z.ZodTuple<[z.ZodAny], null>;
|
|
220
|
+
}, z.core.$strip>;
|
|
221
|
+
/**
|
|
222
|
+
* Converts a ZodObject into an introspection-friendly record.
|
|
223
|
+
* Uses Zod v4's native toJSONSchema() and transforms properties
|
|
224
|
+
* into { fieldName: { type, description } } for the introspection system.
|
|
225
|
+
*/
|
|
226
|
+
export declare function describeZodShape(schema: z.ZodType): Record<string, {
|
|
227
|
+
type: string;
|
|
228
|
+
description: string;
|
|
229
|
+
}>;
|
|
230
|
+
/**
|
|
231
|
+
* Converts an events ZodObject schema into introspection-friendly EventIntrospection records.
|
|
232
|
+
*
|
|
233
|
+
* Each top-level key is an event name, and its value should be a z.tuple() describing
|
|
234
|
+
* the positional arguments passed to listeners.
|
|
235
|
+
*
|
|
236
|
+
* Merges with existing build-time event data (e.g. descriptions from AST scanning)
|
|
237
|
+
* while adding argument type information from the Zod schema.
|
|
238
|
+
*/
|
|
239
|
+
export declare function describeEventsSchema(schema: z.ZodType, existing?: Record<string, {
|
|
240
|
+
name: string;
|
|
241
|
+
description: string;
|
|
242
|
+
arguments: Record<string, {
|
|
243
|
+
type: string;
|
|
244
|
+
description: string;
|
|
245
|
+
}>;
|
|
246
|
+
}>): Record<string, {
|
|
247
|
+
name: string;
|
|
248
|
+
description: string;
|
|
249
|
+
arguments: Record<string, {
|
|
250
|
+
type: string;
|
|
251
|
+
description: string;
|
|
252
|
+
}>;
|
|
253
|
+
}>;
|
|
254
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/schemas/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,iBAAiB,gCAA2D,CAAA;AAEzF,eAAO,MAAM,mBAAmB;;;iBAGW,CAAA;AAG3C,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACxD,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AAE1D;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,GACrE;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE;CAAE,GACrD,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAA;AAGzB,eAAO,MAAM,mBAAmB,GAC9B,WAAW,SAAS,CAAC,CAAC,OAAO,EAC7B,aAAa,SAAS,CAAC,CAAC,OAAO,EAE/B,aAAa,WAAW,EACxB,eAAe,aAAa;;;WAIf;QACX,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,CAAA;QAC9B,OAAO,EAAE,YAAY,CAAC,aAAa,CAAC,C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