@soederpop/luca 0.1.2 → 0.2.1
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/.github/workflows/release.yaml +167 -0
- package/CLAUDE.md +2 -0
- package/README.md +3 -0
- package/assistants/codingAssistant/ABOUT.md +3 -0
- package/assistants/codingAssistant/CORE.md +22 -17
- package/assistants/codingAssistant/hooks.ts +17 -4
- package/assistants/codingAssistant/tools.ts +1 -106
- package/assistants/inkbot/ABOUT.md +5 -0
- package/assistants/inkbot/CORE.md +71 -0
- package/assistants/inkbot/hooks.ts +14 -0
- package/assistants/inkbot/tools.ts +47 -0
- package/bun.lock +20 -4
- package/commands/inkbot.ts +353 -0
- package/commands/release.ts +75 -181
- 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/docs/ideas/assistant-factory-pattern.md +142 -0
- package/package.json +74 -21
- package/src/agi/container.server.ts +10 -0
- package/src/agi/feature.ts +13 -0
- package/src/agi/features/agent-memory.ts +694 -0
- package/src/agi/features/assistant.ts +37 -26
- package/src/agi/features/assistants-manager.ts +95 -5
- package/src/agi/features/autonomous-assistant.ts +1 -5
- package/src/agi/features/browser-use.ts +32 -2
- package/src/agi/features/claude-code.ts +165 -1
- package/src/agi/features/coding-tools.ts +175 -0
- 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 +35 -28
- 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 +111 -13
- 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/clients/voicebox/index.ts +300 -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 +3012 -1356
- package/src/introspection/generated.node.ts +179 -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 +57 -30
- 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 +51 -18
- 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 +2 -2
- package/src/node/features/ui.ts +1 -1
- package/src/node/features/vm.ts +3 -3
- 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 +14 -5
- package/test/conversation.test.ts +220 -0
- package/test-integration/memory.test.ts +204 -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
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-compatible object hashing. Produces a deterministic string signature
|
|
3
|
+
* for any JavaScript value, suitable for use as a cache key or identity check.
|
|
4
|
+
*
|
|
5
|
+
* Replaces the `object-hash` npm package which has Node.js-specific dependencies.
|
|
6
|
+
*/
|
|
7
|
+
export default function hashObject(value: any): string;
|
|
8
|
+
//# sourceMappingURL=hash-object.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash-object.d.ts","sourceRoot":"","sources":["../src/hash-object.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAwFH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAGrD"}
|
package/dist/helper.d.ts
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { Bus, type EventMap } from "./bus.js";
|
|
2
|
+
import { type SetStateValue, State } from "./state.js";
|
|
3
|
+
import type { ContainerContext } from './container.js';
|
|
4
|
+
import { type HelperIntrospection, type IntrospectionSection } from "./introspection/index.js";
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { HelperStateSchema, HelperOptionsSchema } from './schemas/base.js';
|
|
7
|
+
export type HelperState = z.infer<typeof HelperStateSchema>;
|
|
8
|
+
export type HelperOptions = z.infer<typeof HelperOptionsSchema>;
|
|
9
|
+
/**
|
|
10
|
+
* Helpers are used to represent types of modules.
|
|
11
|
+
*
|
|
12
|
+
* You don't create instances of helpers directly, the container creates instances through
|
|
13
|
+
* factory functions that use the subclasses of Helper as a template. The container
|
|
14
|
+
* provides dependency injection and injects a context object into the Helper constructor.
|
|
15
|
+
*
|
|
16
|
+
* A Helper is something that can be introspected at runtime to learn about the interface.
|
|
17
|
+
*
|
|
18
|
+
* A helper has state.
|
|
19
|
+
*
|
|
20
|
+
* A helper is an event bus.
|
|
21
|
+
*
|
|
22
|
+
* A helper is connected to the container and can access the container's state, events, shared context, or
|
|
23
|
+
* other helpers and features in the container's registry.
|
|
24
|
+
*/
|
|
25
|
+
export declare abstract class Helper<T extends HelperState = HelperState, K extends HelperOptions = any, E extends EventMap = EventMap> {
|
|
26
|
+
static shortcut: string;
|
|
27
|
+
static description: string;
|
|
28
|
+
static envVars: string[];
|
|
29
|
+
static stateSchema: z.ZodType;
|
|
30
|
+
static optionsSchema: z.ZodType;
|
|
31
|
+
static eventsSchema: z.ZodType;
|
|
32
|
+
static tools: Record<string, {
|
|
33
|
+
schema: z.ZodType;
|
|
34
|
+
handler?: Function;
|
|
35
|
+
}>;
|
|
36
|
+
protected readonly _context: ContainerContext;
|
|
37
|
+
protected readonly _events: Bus<E>;
|
|
38
|
+
protected readonly _options: K;
|
|
39
|
+
protected readonly _instanceTools: Record<string, {
|
|
40
|
+
schema: z.ZodType;
|
|
41
|
+
handler?: Function;
|
|
42
|
+
}>;
|
|
43
|
+
readonly state: State<T>;
|
|
44
|
+
readonly uuid: string;
|
|
45
|
+
get initialState(): T;
|
|
46
|
+
static introspect(section?: IntrospectionSection): HelperIntrospection | undefined;
|
|
47
|
+
static introspectAsText(sectionOrDepth?: IntrospectionSection | number, startHeadingDepth?: number): string;
|
|
48
|
+
/**
|
|
49
|
+
* Returns the introspection data formatted as a TypeScript interface declaration.
|
|
50
|
+
* Useful for AI agents that reason better with structured type information,
|
|
51
|
+
* or for generating `.d.ts` files that accurately describe a helper's public API.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* console.log(container.feature('fs').introspectAsType())
|
|
56
|
+
* // interface FS {
|
|
57
|
+
* // readonly cwd: string;
|
|
58
|
+
* // readFile(path: string): Promise<string>;
|
|
59
|
+
* // ...
|
|
60
|
+
* // }
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
static introspectAsType(section?: IntrospectionSection): string;
|
|
64
|
+
/**
|
|
65
|
+
* All Helpers can be introspect()ed and, assuming the introspection data has been loaded into the registry,
|
|
66
|
+
* will report information about the Helper that can only get extracted by reading the code, e.g. the type interfaces
|
|
67
|
+
* for the helper's options, state, and the events it emits, as well as the documentation from the helpers code for
|
|
68
|
+
* each of the methods and properties.
|
|
69
|
+
*
|
|
70
|
+
* Pass a section name to get only that section: `'methods'`, `'getters'`, `'events'`, `'state'`, `'options'`, `'envVars'`
|
|
71
|
+
*/
|
|
72
|
+
introspect(section?: IntrospectionSection): HelperIntrospection | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Returns the introspection data formatted as a markdown string.
|
|
75
|
+
*
|
|
76
|
+
* The first argument can be a section name (`'methods'`, `'getters'`, etc.) to render only
|
|
77
|
+
* that section, or a number for the starting heading depth (backward compatible).
|
|
78
|
+
*/
|
|
79
|
+
introspectAsText(sectionOrDepth?: IntrospectionSection | number, startHeadingDepth?: number): string;
|
|
80
|
+
/**
|
|
81
|
+
* Returns the introspection data formatted as a TypeScript interface declaration.
|
|
82
|
+
* Useful for AI agents that reason better with structured type information,
|
|
83
|
+
* or for generating `.d.ts` files that accurately describe a helper's public API.
|
|
84
|
+
*/
|
|
85
|
+
introspectAsType(section?: IntrospectionSection): string;
|
|
86
|
+
constructor(options: K, context: ContainerContext);
|
|
87
|
+
/**
|
|
88
|
+
* Returns the names of the methods for this helper.
|
|
89
|
+
*/
|
|
90
|
+
get $methods(): string[];
|
|
91
|
+
/**
|
|
92
|
+
* Returns the names of the getters for this helper.
|
|
93
|
+
*/
|
|
94
|
+
get $getters(): string[];
|
|
95
|
+
/**
|
|
96
|
+
* The static shortcut identifier for this helper type, e.g. "features.assistant".
|
|
97
|
+
*/
|
|
98
|
+
get shortcut(): string;
|
|
99
|
+
/**
|
|
100
|
+
* Every helper has a cache key which is computed at the time it is created through the container.
|
|
101
|
+
*
|
|
102
|
+
* This ensures only a single instance of the helper exists for the requested options.
|
|
103
|
+
*/
|
|
104
|
+
get cacheKey(): string | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* This method will get called in the constructor and can be used instead of overriding the constructor
|
|
107
|
+
* in your helper subclases.
|
|
108
|
+
*/
|
|
109
|
+
afterInitialize(): void;
|
|
110
|
+
setState(newState: SetStateValue<T>): this;
|
|
111
|
+
/**
|
|
112
|
+
* Convenience method for putting properties on the helper that aren't enumerable,
|
|
113
|
+
* which is a convenience for the REPL mainly.
|
|
114
|
+
*/
|
|
115
|
+
hide(...propNames: string[]): this;
|
|
116
|
+
/**
|
|
117
|
+
* python / lodash style get method, which will get a value from the container using dot notation
|
|
118
|
+
* and will return a default value if the value is not found.
|
|
119
|
+
*/
|
|
120
|
+
tryGet<K extends (string | string[]), T extends object = any>(key: K, defaultValue?: T): any;
|
|
121
|
+
/**
|
|
122
|
+
* Register a tool on this instance at runtime. Instance tools take precedence
|
|
123
|
+
* over class-level static tools in toTools().
|
|
124
|
+
*/
|
|
125
|
+
tool(name: string, options: {
|
|
126
|
+
schema: z.ZodType;
|
|
127
|
+
handler?: Function;
|
|
128
|
+
}): this;
|
|
129
|
+
/**
|
|
130
|
+
* Called when another helper (e.g. an assistant) consumes this helper's
|
|
131
|
+
* tools via `use()`. Override this to detect the consumer type and react —
|
|
132
|
+
* for example, adding system prompt extensions to an assistant.
|
|
133
|
+
*
|
|
134
|
+
* Use `consumer.shortcut` to identify the consumer type:
|
|
135
|
+
* ```typescript
|
|
136
|
+
* override setupToolsConsumer(consumer: Helper) {
|
|
137
|
+
* if (consumer.shortcut === 'features.assistant') {
|
|
138
|
+
* (consumer as any).addSystemPromptExtension('myFeature', 'usage hints here')
|
|
139
|
+
* }
|
|
140
|
+
* }
|
|
141
|
+
* ```
|
|
142
|
+
*
|
|
143
|
+
* The default implementation is a no-op.
|
|
144
|
+
*
|
|
145
|
+
* @param consumer - The helper instance that is consuming this helper's tools
|
|
146
|
+
*/
|
|
147
|
+
setupToolsConsumer(consumer: Helper): void;
|
|
148
|
+
/**
|
|
149
|
+
* Collect all tools from the inheritance chain and instance, returning
|
|
150
|
+
* { schemas, handlers } with matching keys. Walks the prototype chain
|
|
151
|
+
* so subclass tools override parent tools. Instance tools win over all.
|
|
152
|
+
*
|
|
153
|
+
* If a tool has no explicit handler but this instance has a method with
|
|
154
|
+
* the same name, a handler is auto-generated that delegates to that method.
|
|
155
|
+
*/
|
|
156
|
+
toTools(options?: {
|
|
157
|
+
only?: string[];
|
|
158
|
+
except?: string[];
|
|
159
|
+
}): {
|
|
160
|
+
schemas: Record<string, z.ZodType>;
|
|
161
|
+
handlers: Record<string, Function>;
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* The options passed to the helper when it was created.
|
|
165
|
+
*/
|
|
166
|
+
get options(): K;
|
|
167
|
+
/**
|
|
168
|
+
* The context object that was passed to the helper when it was created, this is decided by the container
|
|
169
|
+
* and not something you would manipulate.
|
|
170
|
+
*/
|
|
171
|
+
get context(): ContainerContext<any>;
|
|
172
|
+
/**
|
|
173
|
+
* The container that the helper is connected to.
|
|
174
|
+
*/
|
|
175
|
+
get container(): import("./container.js").Container<any, any>;
|
|
176
|
+
emit<Ev extends string & keyof E>(event: Ev, ...args: E[Ev]): this;
|
|
177
|
+
on(event: '*', listener: (event: string, ...args: any[]) => void): this;
|
|
178
|
+
on<Ev extends string & keyof E>(event: Ev, listener: (...args: E[Ev]) => void): this;
|
|
179
|
+
off(event: '*', listener?: (event: string, ...args: any[]) => void): this;
|
|
180
|
+
off<Ev extends string & keyof E>(event: Ev, listener?: (...args: E[Ev]) => void): this;
|
|
181
|
+
once<Ev extends string & keyof E>(event: Ev, listener: (...args: E[Ev]) => void): this;
|
|
182
|
+
waitFor<Ev extends string & keyof E>(event: Ev): Promise<E[Ev]>;
|
|
183
|
+
}
|
|
184
|
+
export { presentIntrospectionJSONAsMarkdown as presentIntrospectionAsMarkdown };
|
|
185
|
+
export { presentIntrospectionAsTypeScript, renderTypeScriptParams, normalizeTypeString, isGenericObjectType };
|
|
186
|
+
declare function presentIntrospectionJSONAsMarkdown(introspection: HelperIntrospection, startHeadingDepth?: number, section?: IntrospectionSection): string;
|
|
187
|
+
/**
|
|
188
|
+
* Renders introspection data as a TypeScript interface declaration.
|
|
189
|
+
* Produces a valid interface string that describes the helper's public API —
|
|
190
|
+
* getters, methods, state shape, options shape, and event listener signatures.
|
|
191
|
+
*/
|
|
192
|
+
declare function presentIntrospectionAsTypeScript(introspection: HelperIntrospection, section?: IntrospectionSection): string;
|
|
193
|
+
/** Build a TypeScript parameter list string from method introspection */
|
|
194
|
+
declare function renderTypeScriptParams(method: {
|
|
195
|
+
parameters: Record<string, {
|
|
196
|
+
type: string;
|
|
197
|
+
description?: string;
|
|
198
|
+
properties?: Record<string, {
|
|
199
|
+
type: string;
|
|
200
|
+
description?: string;
|
|
201
|
+
}>;
|
|
202
|
+
}>;
|
|
203
|
+
required: string[];
|
|
204
|
+
}): string;
|
|
205
|
+
/** Returns true if the type string looks like a generic object type that sub-properties would refine */
|
|
206
|
+
declare function isGenericObjectType(type: string): boolean;
|
|
207
|
+
/** Clean up type strings from introspection data for use in interface declarations */
|
|
208
|
+
declare function normalizeTypeString(type: string): string;
|
|
209
|
+
//# sourceMappingURL=helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAGtD,OAAO,EAAc,KAAK,mBAAmB,EAAE,KAAK,oBAAoB,EAA6B,MAAM,0BAA0B,CAAC;AACtI,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAsB,MAAM,mBAAmB,CAAA;AAE9F,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAC3D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE/D;;;;;;;;;;;;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