@soederpop/luca 0.1.2 → 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 +1 -5
- 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/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 +87 -6
- 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 +1246 -798
- package/src/introspection/generated.node.ts +892 -798
- 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 +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/conversation.test.ts +220 -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 @@
|
|
|
1
|
+
{"version":3,"file":"socket.d.ts","sourceRoot":"","sources":["../../src/servers/socket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,eAAe,IAAI,UAAU,EAAE,MAAM,IAAI,CAAA;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAE7D,OAAO,QAAQ,WAAW,CAAC;IACzB,UAAU,gBAAgB;QACxB,SAAS,EAAE,OAAO,eAAe,CAAA;KAClC;CACF;AAED,eAAO,MAAM,yBAAyB;;;;;;iBAEpC,CAAA;AACF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E,eAAO,MAAM,wBAAwB;;;;iBAGC,CAAA;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,qBAAa,eAAe,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EAAE,CAAC,SAAS,mBAAmB,GAAG,mBAAmB,CAAE,SAAQ,MAAM,CAAC,CAAC,EAAC,CAAC,CAAC;IACtI,OAAgB,QAAQ,EAAG,mBAAmB,CAAS;IACvD,OAAgB,WAAW;;;;;sBAAoB;IAC/C,OAAgB,aAAa;;;;;;sBAA4B;IACzD,OAAgB,YAAY;;;;sBAA2B;IAIvD,IAAI,CAAC,EAAE,UAAU,CAAA;IAEjB,IAAI,GAAG,IAAI,UAAU,CAQpB;IAED,WAAW,EAAG,GAAG,CAAC,GAAG,CAAC,CAAY;IAClC,QAAQ,mCAAoC;IAEtC,SAAS,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAQtC,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAKhD;;;;;;;;;;;;;;;;;;OAkBG;IACG,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,OAAO,SAAQ,GAAG,OAAO,CAAC,CAAC,CAAC;IAclF,8GAA8G;IAC9G,YAAY,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO;IAiBnC,+DAA+D;IAC/D,iBAAiB,CAAC,MAAM,EAAE,MAAM;IAQhC;;;;;;OAMG;IACY,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAmD5C,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAwCpC,yGAAyG;IACzG,IAAa,IAAI,IAAI,MAAM,CAE1B;CACJ;AAED,eAAe,eAAe,CAAA"}
|
package/dist/state.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type StateChangeType = 'add' | 'update' | 'delete';
|
|
2
|
+
export type StateChangeCallback<K extends keyof any, V> = (changeType: StateChangeType, key: K, value?: V) => void;
|
|
3
|
+
export type SetStateValue<T extends object> = Partial<T> | ((current: T, state: State<T>) => Partial<T>);
|
|
4
|
+
export declare class State<T extends object = any> {
|
|
5
|
+
private state;
|
|
6
|
+
private observers;
|
|
7
|
+
private _version;
|
|
8
|
+
constructor(options?: {
|
|
9
|
+
initialState: Partial<T>;
|
|
10
|
+
});
|
|
11
|
+
get version(): number;
|
|
12
|
+
observe(callback: StateChangeCallback<keyof T, T[keyof T]>): () => void;
|
|
13
|
+
keys(): string[];
|
|
14
|
+
get<K extends keyof T>(key: K): T[K] | undefined;
|
|
15
|
+
set<K extends keyof T>(key: K, value: T[K]): this;
|
|
16
|
+
delete<K extends keyof T>(key: K): this;
|
|
17
|
+
has<K extends keyof T>(key: K): boolean;
|
|
18
|
+
get current(): T;
|
|
19
|
+
clear(): void;
|
|
20
|
+
entries(): [keyof T, T[keyof T]][];
|
|
21
|
+
values(): T[keyof T][];
|
|
22
|
+
setState(value: SetStateValue<T>): void;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAC1D,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,MAAM,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,eAAe,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;AACnH,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAEzG,qBAAa,KAAK,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG;IACrC,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,SAAS,CAA6C;IAC9D,OAAO,CAAC,QAAQ,CAAI;gBAER,OAAO,CAAC,EAAE;QAAE,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA;KAAC;IAWjD,IAAI,OAAO,WAEV;IAED,OAAO,CAAC,QAAQ,EAAE,mBAAmB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI;IAWvE,IAAI,IAAK,MAAM,EAAE;IAIjB,GAAG,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS;IAIhD,GAAG,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;IAYjD,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI;IAWvC,GAAG,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO;IAIvC,IAAI,OAAO,IAAI,CAAC,CAEf;IAED,KAAK,IAAI,IAAI;IASb,OAAO,IAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;IAInC,MAAM,IAAK,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE;IAIvB,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI;CAS1C"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import Websocket from 'isomorphic-ws';
|
|
2
|
+
import { WebSocketClient, type WebSocketClientState, type WebSocketClientOptions } from '../../clients/websocket';
|
|
3
|
+
/**
|
|
4
|
+
* Web-specific WebSocket client implementation using isomorphic-ws.
|
|
5
|
+
* Extends the base WebSocketClient with platform-specific transport and
|
|
6
|
+
* an envelope format that wraps sent data with a unique ID. Inherits
|
|
7
|
+
* ask/reply semantics from the base WebSocketClient — protocol messages
|
|
8
|
+
* (those with `requestId` or `replyTo`) bypass the envelope wrapper to
|
|
9
|
+
* maintain compatibility with the Luca WebSocket server's ask/reply flow.
|
|
10
|
+
*/
|
|
11
|
+
export declare class SocketClient<T extends WebSocketClientState = WebSocketClientState, K extends WebSocketClientOptions = WebSocketClientOptions> extends WebSocketClient<T, K> {
|
|
12
|
+
ws: Websocket | WebSocket;
|
|
13
|
+
static shortcut: "clients.websocket";
|
|
14
|
+
static eventsSchema: import("zod").ZodObject<{
|
|
15
|
+
stateChange: import("zod").ZodTuple<[import("zod").ZodAny], null>;
|
|
16
|
+
failure: import("zod").ZodTuple<[import("zod").ZodAny], null>;
|
|
17
|
+
message: import("zod").ZodTuple<[import("zod").ZodAny], null>;
|
|
18
|
+
open: import("zod").ZodTuple<[], null>;
|
|
19
|
+
close: import("zod").ZodTuple<[import("zod").ZodOptional<import("zod").ZodNumber>, import("zod").ZodOptional<import("zod").ZodString>], null>;
|
|
20
|
+
error: import("zod").ZodTuple<[import("zod").ZodAny], null>;
|
|
21
|
+
reconnecting: import("zod").ZodTuple<[import("zod").ZodNumber], null>;
|
|
22
|
+
}, import("zod/v4/core").$strip>;
|
|
23
|
+
/**
|
|
24
|
+
* Send data over the WebSocket with an ID envelope.
|
|
25
|
+
* Wraps the payload in { id, data } before JSON serialization.
|
|
26
|
+
* Messages with a `requestId` or `replyTo` are sent as-is to
|
|
27
|
+
* preserve the ask/reply protocol.
|
|
28
|
+
*/
|
|
29
|
+
send(data: any): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Establish a WebSocket connection using isomorphic-ws.
|
|
32
|
+
* Bridges raw WebSocket events to the Helper event bus and tracks connection state.
|
|
33
|
+
*/
|
|
34
|
+
connect(): Promise<this>;
|
|
35
|
+
}
|
|
36
|
+
export default SocketClient;
|
|
37
|
+
//# sourceMappingURL=socket.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"socket.d.ts","sourceRoot":"","sources":["../../../src/web/clients/socket.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,eAAe,CAAA;AAErC,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,KAAK,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAGjH;;;;;;;GAOG;AACH,qBAAa,YAAY,CAAC,CAAC,SAAS,oBAAoB,GAAG,oBAAoB,EAAE,CAAC,SAAS,sBAAsB,GAAG,sBAAsB,CAAE,SAAQ,eAAe,CAAC,CAAC,EAAC,CAAC,CAAC;IAE9J,EAAE,EAAE,SAAS,GAAG,SAAS,CAAA;IAEjC,OAAgB,QAAQ,EAAG,mBAAmB,CAAS;IACvD,OAAgB,YAAY;;;;;;;;qCAA8B;IAI1D;;;;;OAKG;IACY,IAAI,CAAC,IAAI,EAAE,GAAG;IAoB7B;;;OAGG;IACY,OAAO;CA4CvB;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export * from '../container.js';
|
|
2
|
+
import { Container } from '../container.js';
|
|
3
|
+
import { Client } from '../client.js';
|
|
4
|
+
import { RestClient } from '../clients/rest.js';
|
|
5
|
+
import { SocketClient } from './clients/socket.js';
|
|
6
|
+
import type { AvailableFeatures } from '../feature.js';
|
|
7
|
+
import type { ContainerState } from '../container.js';
|
|
8
|
+
import type { ClientsInterface } from '../client.js';
|
|
9
|
+
import type { AssetLoader } from './features/asset-loader.js';
|
|
10
|
+
import type { VoiceRecognition } from './features/voice-recognition.js';
|
|
11
|
+
import type { Speech } from './features/speech.js';
|
|
12
|
+
import type { Network } from './features/network.js';
|
|
13
|
+
import type { WebVault } from './features/vault.js';
|
|
14
|
+
import type { VM } from './features/vm.js';
|
|
15
|
+
import type { Esbuild } from './features/esbuild.js';
|
|
16
|
+
import type { Helpers } from './features/helpers.js';
|
|
17
|
+
import type { ContainerLink } from './features/container-link.js';
|
|
18
|
+
export { Client, RestClient, SocketClient };
|
|
19
|
+
export interface WebFeatures extends AvailableFeatures {
|
|
20
|
+
assetLoader: typeof AssetLoader;
|
|
21
|
+
voice: typeof VoiceRecognition;
|
|
22
|
+
speech: typeof Speech;
|
|
23
|
+
vault: typeof WebVault;
|
|
24
|
+
vm: typeof VM;
|
|
25
|
+
esbuild: typeof Esbuild;
|
|
26
|
+
helpers: typeof Helpers;
|
|
27
|
+
containerLink: typeof ContainerLink;
|
|
28
|
+
}
|
|
29
|
+
export interface WebContainer extends ClientsInterface {
|
|
30
|
+
assetLoader?: AssetLoader;
|
|
31
|
+
voice?: VoiceRecognition;
|
|
32
|
+
speech?: Speech;
|
|
33
|
+
network?: Network;
|
|
34
|
+
vault?: WebVault;
|
|
35
|
+
helpers?: Helpers;
|
|
36
|
+
containerLink?: ContainerLink;
|
|
37
|
+
}
|
|
38
|
+
export interface WebContainerState extends ContainerState {
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Browser-specific container that extends the base Container with web client support
|
|
42
|
+
* and browser-specific features like speech, voice recognition, and asset loading.
|
|
43
|
+
*/
|
|
44
|
+
export declare class WebContainer<Features extends WebFeatures = WebFeatures, K extends WebContainerState = WebContainerState> extends Container<Features, K> {
|
|
45
|
+
/** Returns the base Client class for creating custom clients. */
|
|
46
|
+
get Client(): typeof Client;
|
|
47
|
+
/** Returns the SocketClient class for WebSocket connections. */
|
|
48
|
+
get SocketClient(): typeof SocketClient;
|
|
49
|
+
/** Returns the RestClient class for HTTP REST API connections. */
|
|
50
|
+
get RestClient(): typeof RestClient;
|
|
51
|
+
useHelpers: any[];
|
|
52
|
+
constructor(options?: any);
|
|
53
|
+
}
|
|
54
|
+
export declare const helperCache: Map<any, any>;
|
|
55
|
+
//# sourceMappingURL=container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/web/container.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,iBAAiB,CAAA;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AACvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAIjE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,CAAA;AAE3C,MAAM,WAAW,WAAY,SAAQ,iBAAiB;IACpD,WAAW,EAAE,OAAO,WAAW,CAAA;IAC/B,KAAK,EAAE,OAAO,gBAAgB,CAAA;IAC9B,MAAM,EAAE,OAAO,MAAM,CAAA;IACrB,KAAK,EAAE,OAAO,QAAQ,CAAA;IACtB,EAAE,EAAE,OAAO,EAAE,CAAC;IACd,OAAO,EAAE,OAAO,OAAO,CAAA;IACvB,OAAO,EAAE,OAAO,OAAO,CAAA;IACvB,aAAa,EAAE,OAAO,aAAa,CAAA;CACpC;AAED,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,KAAK,CAAC,EAAE,gBAAgB,CAAA;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,QAAQ,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B;AAED,MAAM,WAAW,iBAAkB,SAAQ,cAAc;CAAI;AAE7D;;;GAGG;AACH,qBAAa,YAAY,CAAC,QAAQ,SAAS,WAAW,GAAG,WAAW,EAAE,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,CAAE,SAAQ,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;IACnJ,iEAAiE;IACjE,IAAI,MAAM,kBAET;IAED,gEAAgE;IAChE,IAAI,YAAY,wBAEf;IAED,kEAAkE;IAClE,IAAI,UAAU,sBAEb;IAED,UAAU,EAAE,GAAG,EAAE,CAA2B;gBAEhC,OAAO,GAAE,GAAQ;CAK9B;AAED,eAAO,MAAM,WAAW,eAAY,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Container } from '../container';
|
|
2
|
+
import { type ClientsInterface } from '../client.js';
|
|
3
|
+
export declare function attach<K extends Container & ClientsInterface>(container: K, options?: any): Container & ClientsInterface;
|
|
4
|
+
//# sourceMappingURL=extension.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../src/web/extension.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C,OAAO,EAAU,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAY5D,wBAAgB,MAAM,CAAC,CAAC,SAAS,SAAS,GAAG,gBAAgB,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,GAAG,GAAI,SAAS,GAAG,gBAAgB,CAezH"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { WebContainer } from './container.js';
|
|
2
|
+
import { type FeatureOptions, type FeatureState, type AvailableFeatures, features, Feature as UniversalFeature } from '../feature.js';
|
|
3
|
+
export { features };
|
|
4
|
+
export type { AvailableFeatures, FeatureState, FeatureOptions };
|
|
5
|
+
export declare class Feature<T extends FeatureState = FeatureState, K extends FeatureOptions = FeatureOptions> extends UniversalFeature<T, K> {
|
|
6
|
+
get container(): WebContainer;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=feature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../../src/web/feature.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAAE,QAAQ,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAErI,OAAO,EAAE,QAAQ,EAAE,CAAA;AAEnB,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,cAAc,EAAE,CAAA;AAE/D,qBAAa,OAAO,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EAAE,CAAC,SAAS,cAAc,GAAG,cAAc,CAAE,SAAQ,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC;IACjI,IAAa,SAAS,IAAK,YAAY,CAEtC;CACJ"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Feature } from "../feature.js";
|
|
2
|
+
/**
|
|
3
|
+
* Injects scripts and stylesheets into the page at runtime.
|
|
4
|
+
*
|
|
5
|
+
* Provides helpers for loading external libraries from unpkg.com,
|
|
6
|
+
* injecting arbitrary script/link tags, and managing load state.
|
|
7
|
+
* Used by other web features (e.g. Esbuild) to pull in dependencies on demand.
|
|
8
|
+
*
|
|
9
|
+
* @extends Feature
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const loader = container.feature('assetLoader')
|
|
14
|
+
* await loader.loadScript('https://unpkg.com/lodash')
|
|
15
|
+
* await AssetLoader.loadStylesheet('https://unpkg.com/normalize.css')
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare class AssetLoader extends Feature {
|
|
19
|
+
static stateSchema: import("zod").ZodObject<{
|
|
20
|
+
enabled: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
21
|
+
}, import("zod/v4/core").$loose>;
|
|
22
|
+
static optionsSchema: import("zod").ZodObject<{
|
|
23
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
24
|
+
_cacheKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
25
|
+
cached: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
26
|
+
enable: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
27
|
+
}, import("zod/v4/core").$strip>;
|
|
28
|
+
static shortcut: "features.assetLoader";
|
|
29
|
+
static loadStylesheet(href: string): Promise<unknown>;
|
|
30
|
+
removeStylesheet(href: string): void;
|
|
31
|
+
loadScript(url: string): Promise<void>;
|
|
32
|
+
unpkg(packageName: string, globalName: string): Promise<any>;
|
|
33
|
+
}
|
|
34
|
+
export default AssetLoader;
|
|
35
|
+
//# sourceMappingURL=asset-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asset-loader.d.ts","sourceRoot":"","sources":["../../../src/web/features/asset-loader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,WAAY,SAAQ,OAAO;IACtC,OAAgB,WAAW;;qCAAqB;IAChD,OAAgB,aAAa;;;;;qCAAuB;IACpD,OAAgB,QAAQ,EAAG,sBAAsB,CAAS;IAI1D,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM;IAYlC,gBAAgB,CAAC,IAAI,EAAC,MAAM;IAQtB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBtC,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;CAKnE;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Feature } from '../feature.js';
|
|
3
|
+
export declare const MessageTypes: {
|
|
4
|
+
readonly register: "register";
|
|
5
|
+
readonly registered: "registered";
|
|
6
|
+
readonly eval: "eval";
|
|
7
|
+
readonly evalResult: "evalResult";
|
|
8
|
+
readonly event: "event";
|
|
9
|
+
readonly ping: "ping";
|
|
10
|
+
readonly pong: "pong";
|
|
11
|
+
readonly disconnect: "disconnect";
|
|
12
|
+
readonly error: "error";
|
|
13
|
+
};
|
|
14
|
+
export type MessageType = typeof MessageTypes[keyof typeof MessageTypes];
|
|
15
|
+
export interface LinkMessage<T = any> {
|
|
16
|
+
type: MessageType;
|
|
17
|
+
id: string;
|
|
18
|
+
timestamp: number;
|
|
19
|
+
token?: string;
|
|
20
|
+
data?: T;
|
|
21
|
+
}
|
|
22
|
+
export interface RegisterData {
|
|
23
|
+
uuid: string;
|
|
24
|
+
url?: string;
|
|
25
|
+
capabilities?: string[];
|
|
26
|
+
meta?: Record<string, any>;
|
|
27
|
+
}
|
|
28
|
+
export interface RegisteredData {
|
|
29
|
+
token: string;
|
|
30
|
+
hostId: string;
|
|
31
|
+
}
|
|
32
|
+
export interface EvalData {
|
|
33
|
+
code: string;
|
|
34
|
+
context?: Record<string, any>;
|
|
35
|
+
requestId: string;
|
|
36
|
+
timeout?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface EvalResultData {
|
|
39
|
+
requestId: string;
|
|
40
|
+
result?: any;
|
|
41
|
+
error?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface EventData {
|
|
44
|
+
eventName: string;
|
|
45
|
+
data?: any;
|
|
46
|
+
}
|
|
47
|
+
export declare const ContainerLinkStateSchema: z.ZodObject<{
|
|
48
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
49
|
+
connected: z.ZodDefault<z.ZodBoolean>;
|
|
50
|
+
token: z.ZodOptional<z.ZodString>;
|
|
51
|
+
hostId: z.ZodOptional<z.ZodString>;
|
|
52
|
+
reconnectAttempts: z.ZodDefault<z.ZodNumber>;
|
|
53
|
+
}, z.core.$loose>;
|
|
54
|
+
export type ContainerLinkState = z.infer<typeof ContainerLinkStateSchema>;
|
|
55
|
+
export declare const ContainerLinkOptionsSchema: z.ZodObject<{
|
|
56
|
+
name: z.ZodOptional<z.ZodString>;
|
|
57
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
58
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
59
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
hostUrl: z.ZodOptional<z.ZodString>;
|
|
61
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
62
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
63
|
+
reconnect: z.ZodDefault<z.ZodBoolean>;
|
|
64
|
+
reconnectInterval: z.ZodDefault<z.ZodNumber>;
|
|
65
|
+
maxReconnectAttempts: z.ZodDefault<z.ZodNumber>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
export type ContainerLinkOptions = z.infer<typeof ContainerLinkOptionsSchema>;
|
|
68
|
+
export declare const ContainerLinkEventsSchema: z.ZodObject<{
|
|
69
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
70
|
+
enabled: z.ZodTuple<[], null>;
|
|
71
|
+
connected: z.ZodTuple<[z.ZodString], null>;
|
|
72
|
+
disconnected: z.ZodTuple<[z.ZodOptional<z.ZodString>], null>;
|
|
73
|
+
evalRequest: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
74
|
+
reconnecting: z.ZodTuple<[z.ZodNumber], null>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
/**
|
|
77
|
+
* ContainerLink (Web-side) — WebSocket client that connects to a node host.
|
|
78
|
+
*
|
|
79
|
+
* Connects to a ContainerLink host over WebSocket. The host can evaluate code
|
|
80
|
+
* in this container, and the web side can emit structured events to the host.
|
|
81
|
+
* The web side can NEVER eval code in the host — trust is strictly one-way.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```typescript
|
|
85
|
+
* const link = container.feature('containerLink', {
|
|
86
|
+
* enable: true,
|
|
87
|
+
* hostUrl: 'ws://localhost:8089',
|
|
88
|
+
* })
|
|
89
|
+
* await link.connect()
|
|
90
|
+
*
|
|
91
|
+
* // Send events to the host
|
|
92
|
+
* link.emitToHost('click', { x: 100, y: 200 })
|
|
93
|
+
*
|
|
94
|
+
* // Listen for eval requests before they execute
|
|
95
|
+
* link.on('evalRequest', (code, requestId) => {
|
|
96
|
+
* console.log('Host is evaluating:', code)
|
|
97
|
+
* })
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
export declare class ContainerLink extends Feature<ContainerLinkState, ContainerLinkOptions> {
|
|
101
|
+
static shortcut: "features.containerLink";
|
|
102
|
+
static stateSchema: z.ZodObject<{
|
|
103
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
104
|
+
connected: z.ZodDefault<z.ZodBoolean>;
|
|
105
|
+
token: z.ZodOptional<z.ZodString>;
|
|
106
|
+
hostId: z.ZodOptional<z.ZodString>;
|
|
107
|
+
reconnectAttempts: z.ZodDefault<z.ZodNumber>;
|
|
108
|
+
}, z.core.$loose>;
|
|
109
|
+
static optionsSchema: z.ZodObject<{
|
|
110
|
+
name: z.ZodOptional<z.ZodString>;
|
|
111
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
112
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
113
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
114
|
+
hostUrl: z.ZodOptional<z.ZodString>;
|
|
115
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
116
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
117
|
+
reconnect: z.ZodDefault<z.ZodBoolean>;
|
|
118
|
+
reconnectInterval: z.ZodDefault<z.ZodNumber>;
|
|
119
|
+
maxReconnectAttempts: z.ZodDefault<z.ZodNumber>;
|
|
120
|
+
}, z.core.$strip>;
|
|
121
|
+
static eventsSchema: z.ZodObject<{
|
|
122
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
123
|
+
enabled: z.ZodTuple<[], null>;
|
|
124
|
+
connected: z.ZodTuple<[z.ZodString], null>;
|
|
125
|
+
disconnected: z.ZodTuple<[z.ZodOptional<z.ZodString>], null>;
|
|
126
|
+
evalRequest: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
127
|
+
reconnecting: z.ZodTuple<[z.ZodNumber], null>;
|
|
128
|
+
}, z.core.$strip>;
|
|
129
|
+
private _ws?;
|
|
130
|
+
private _reconnectTimer?;
|
|
131
|
+
get initialState(): ContainerLinkState;
|
|
132
|
+
/** Whether currently connected to the host. */
|
|
133
|
+
get isConnected(): boolean;
|
|
134
|
+
/** The auth token received from the host. */
|
|
135
|
+
get token(): string | undefined;
|
|
136
|
+
/** The host container's UUID. */
|
|
137
|
+
get hostId(): string | undefined;
|
|
138
|
+
/**
|
|
139
|
+
* Connect to the host WebSocket server and perform registration.
|
|
140
|
+
*
|
|
141
|
+
* @param hostUrl - Override the configured host URL
|
|
142
|
+
* @returns Promise that resolves when registered
|
|
143
|
+
*/
|
|
144
|
+
connect(hostUrl?: string): Promise<this>;
|
|
145
|
+
/**
|
|
146
|
+
* Disconnect from the host.
|
|
147
|
+
*
|
|
148
|
+
* @param reason - Optional reason string
|
|
149
|
+
*/
|
|
150
|
+
disconnect(reason?: string): void;
|
|
151
|
+
/**
|
|
152
|
+
* Send a structured event to the host container.
|
|
153
|
+
*
|
|
154
|
+
* @param eventName - Name of the event
|
|
155
|
+
* @param data - Optional event data
|
|
156
|
+
*/
|
|
157
|
+
emitToHost(eventName: string, data?: any): void;
|
|
158
|
+
private handleMessage;
|
|
159
|
+
private handleEval;
|
|
160
|
+
private respondToPing;
|
|
161
|
+
private maybeReconnect;
|
|
162
|
+
/** Create a link protocol message with a unique ID. */
|
|
163
|
+
private createMessage;
|
|
164
|
+
private clearReconnectTimer;
|
|
165
|
+
}
|
|
166
|
+
export default ContainerLink;
|
|
167
|
+
//# sourceMappingURL=container-link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-link.d.ts","sourceRoot":"","sources":["../../../src/web/features/container-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAIvC,eAAO,MAAM,YAAY;;;;;;;;;;CAUf,CAAA;AAEV,MAAM,MAAM,WAAW,GAAG,OAAO,YAAY,CAAC,MAAM,OAAO,YAAY,CAAC,CAAA;AAIxE,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,GAAG;IAClC,IAAI,EAAE,WAAW,CAAA;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,CAAC,CAAA;CACT;AAID,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC3B;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AAID,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,GAAG,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAID,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,GAAG,CAAA;CACX;AAID,eAAO,MAAM,wBAAwB;;;;;;iBAKnC,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEzE,eAAO,MAAM,0BAA0B;;;;;;;;;;;iBAOrC,CAAA;AACF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAE7E,eAAO,MAAM,yBAAyB;;;;;;;iBAKpC,CAAA;AAIF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,aAAc,SAAQ,OAAO,CAAC,kBAAkB,EAAE,oBAAoB,CAAC;IAClF,OAAgB,QAAQ,EAAG,wBAAwB,CAAS;IAC5D,OAAgB,WAAW;;;;;;sBAA2B;IACtD,OAAgB,aAAa;;;;;;;;;;;sBAA6B;IAC1D,OAAgB,YAAY;;;;;;;sBAA4B;IAIxD,OAAO,CAAC,GAAG,CAAC,CAAW;IACvB,OAAO,CAAC,eAAe,CAAC,CAA+B;IAEvD,IAAa,YAAY,IAAI,kBAAkB,CAM9C;IAED,+CAA+C;IAC/C,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,6CAA6C;IAC7C,IAAI,KAAK,IAAI,MAAM,GAAG,SAAS,CAE9B;IAED,iCAAiC;IACjC,IAAI,MAAM,IAAI,MAAM,GAAG,SAAS,CAE/B;IAED;;;;;OAKG;IACG,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkF9C;;;;OAIG;IACH,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAkBjC;;;;;OAKG;IACH,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAe/C,OAAO,CAAC,aAAa;YAuBP,UAAU;IA0BxB,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,cAAc;IAsBtB,uDAAuD;IACvD,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,mBAAmB;CAM5B;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Feature, type FeatureState } from "../feature.js";
|
|
3
|
+
import type * as esbuild from 'esbuild-wasm';
|
|
4
|
+
export declare const EsbuildWebOptionsSchema: z.ZodObject<{
|
|
5
|
+
name: z.ZodOptional<z.ZodString>;
|
|
6
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
7
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
transformOptions: z.ZodOptional<z.ZodAny>;
|
|
10
|
+
tsconfig: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export type EsbuildWebOptions = z.infer<typeof EsbuildWebOptionsSchema>;
|
|
13
|
+
/**
|
|
14
|
+
* Browser-side TypeScript/ESM compilation feature using esbuild-wasm.
|
|
15
|
+
*
|
|
16
|
+
* Loads esbuild's WebAssembly build via the AssetLoader, then provides
|
|
17
|
+
* `compile()` and `transform()` methods that work entirely in the browser.
|
|
18
|
+
* Useful for live playgrounds, in-browser REPLs, and client-side bundling.
|
|
19
|
+
*
|
|
20
|
+
* @extends Feature
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const esbuild = container.feature('esbuild')
|
|
25
|
+
* await esbuild.start()
|
|
26
|
+
* const result = await esbuild.compile('const x: number = 1')
|
|
27
|
+
* console.log(result.code)
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare class Esbuild extends Feature<FeatureState, EsbuildWebOptions> {
|
|
31
|
+
static stateSchema: z.ZodObject<{
|
|
32
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
33
|
+
}, z.core.$loose>;
|
|
34
|
+
static optionsSchema: z.ZodObject<{
|
|
35
|
+
name: z.ZodOptional<z.ZodString>;
|
|
36
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
37
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
39
|
+
transformOptions: z.ZodOptional<z.ZodAny>;
|
|
40
|
+
tsconfig: z.ZodOptional<z.ZodString>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
static shortcut: "features.esbuild";
|
|
43
|
+
/** Returns the assetLoader feature for loading external libraries from unpkg. */
|
|
44
|
+
get assetLoader(): import("./asset-loader.js").AssetLoader;
|
|
45
|
+
compiler: typeof esbuild;
|
|
46
|
+
compile(code: string, options?: esbuild.TransformOptions): Promise<any>;
|
|
47
|
+
clearCache(): this;
|
|
48
|
+
start(): Promise<this>;
|
|
49
|
+
}
|
|
50
|
+
export default Esbuild;
|
|
51
|
+
//# sourceMappingURL=esbuild.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"esbuild.d.ts","sourceRoot":"","sources":["../../../src/web/features/esbuild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,KAAK,KAAK,OAAO,MAAM,cAAc,CAAC;AAE7C,eAAO,MAAM,uBAAuB;;;;;;;iBAGlC,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAEvE;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,OAAQ,SAAQ,OAAO,CAAC,YAAY,EAAE,iBAAiB,CAAC;IACnE,OAAgB,WAAW;;sBAAqB;IAChD,OAAgB,aAAa;;;;;;;sBAA0B;IACvD,OAAgB,QAAQ,EAAG,kBAAkB,CAAS;IAItD,iFAAiF;IACjF,IAAI,WAAW,4CAEd;IAED,QAAQ,EAAG,OAAO,OAAO,CAAA;IAEnB,OAAO,CAAC,IAAI,EAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,gBAAgB;IAyB7D,UAAU;IAKJ,KAAK;CAeZ;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Feature } from '../feature.js';
|
|
3
|
+
export declare const HelpersStateSchema: z.ZodObject<{
|
|
4
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
5
|
+
discovered: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
6
|
+
registered: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
7
|
+
manifestLoaded: z.ZodDefault<z.ZodBoolean>;
|
|
8
|
+
}, z.core.$loose>;
|
|
9
|
+
export type HelpersState = z.infer<typeof HelpersStateSchema>;
|
|
10
|
+
export declare const HelpersOptionsSchema: z.ZodObject<{
|
|
11
|
+
name: z.ZodOptional<z.ZodString>;
|
|
12
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
13
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
manifestURL: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export type HelpersOptions = z.infer<typeof HelpersOptionsSchema>;
|
|
18
|
+
export declare const HelpersEventsSchema: z.ZodObject<{
|
|
19
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
20
|
+
enabled: z.ZodTuple<[], null>;
|
|
21
|
+
discovered: z.ZodTuple<[z.ZodString, z.ZodArray<z.ZodString>], null>;
|
|
22
|
+
registered: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
23
|
+
manifestLoaded: z.ZodTuple<[z.ZodAny], null>;
|
|
24
|
+
manifestError: z.ZodTuple<[z.ZodAny], null>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
type RegistryType = 'features' | 'clients';
|
|
27
|
+
/**
|
|
28
|
+
* The Helpers feature discovers and loads project-level helpers from a JSON manifest
|
|
29
|
+
* served over HTTP. Scripts are injected via AssetLoader and self-register into
|
|
30
|
+
* the container's registries.
|
|
31
|
+
*
|
|
32
|
+
* This is the web equivalent of the node Helpers feature, which scans the filesystem.
|
|
33
|
+
* Instead of filesystem scanning, this feature fetches a manifest from a well-known URL
|
|
34
|
+
* and uses AssetLoader.loadScript() to inject each helper's script tag.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* const helpers = container.feature('helpers', { enable: true })
|
|
39
|
+
*
|
|
40
|
+
* // Discover all helper types from the manifest
|
|
41
|
+
* await helpers.discoverAll()
|
|
42
|
+
*
|
|
43
|
+
* // Discover a specific type
|
|
44
|
+
* await helpers.discover('features')
|
|
45
|
+
*
|
|
46
|
+
* // Unified view of all available helpers
|
|
47
|
+
* console.log(helpers.available)
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare class Helpers extends Feature<HelpersState, HelpersOptions> {
|
|
51
|
+
static shortcut: "features.helpers";
|
|
52
|
+
static description: string;
|
|
53
|
+
static stateSchema: z.ZodObject<{
|
|
54
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
55
|
+
discovered: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
56
|
+
registered: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
57
|
+
manifestLoaded: z.ZodDefault<z.ZodBoolean>;
|
|
58
|
+
}, z.core.$loose>;
|
|
59
|
+
static optionsSchema: z.ZodObject<{
|
|
60
|
+
name: z.ZodOptional<z.ZodString>;
|
|
61
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
62
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
64
|
+
manifestURL: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
static eventsSchema: z.ZodObject<{
|
|
67
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
68
|
+
enabled: z.ZodTuple<[], null>;
|
|
69
|
+
discovered: z.ZodTuple<[z.ZodString, z.ZodArray<z.ZodString>], null>;
|
|
70
|
+
registered: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
71
|
+
manifestLoaded: z.ZodTuple<[z.ZodAny], null>;
|
|
72
|
+
manifestError: z.ZodTuple<[z.ZodAny], null>;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
private _manifest;
|
|
75
|
+
private get registryMap();
|
|
76
|
+
/** The URL to fetch the helpers manifest from. */
|
|
77
|
+
get manifestURL(): string;
|
|
78
|
+
/**
|
|
79
|
+
* Set a new manifest URL. Invalidates any cached manifest.
|
|
80
|
+
*
|
|
81
|
+
* @param url - The new URL to fetch the manifest from
|
|
82
|
+
*/
|
|
83
|
+
setManifestURL(url: string): void;
|
|
84
|
+
/**
|
|
85
|
+
* Returns a unified view of all available helpers across all registries.
|
|
86
|
+
* Each key is a registry type, each value is the list of helper names in that registry.
|
|
87
|
+
*/
|
|
88
|
+
get available(): Record<string, string[]>;
|
|
89
|
+
/**
|
|
90
|
+
* Fetch and cache the manifest JSON. Returns cached version on subsequent calls
|
|
91
|
+
* unless invalidated by setManifestURL().
|
|
92
|
+
*/
|
|
93
|
+
private fetchManifest;
|
|
94
|
+
/**
|
|
95
|
+
* Get the AssetLoader instance from the container.
|
|
96
|
+
*/
|
|
97
|
+
private get assetLoader();
|
|
98
|
+
/**
|
|
99
|
+
* Discover and register helpers of the given type from the manifest.
|
|
100
|
+
*
|
|
101
|
+
* Fetches the manifest, then for each entry of the requested type,
|
|
102
|
+
* loads the script via AssetLoader and checks what got newly registered.
|
|
103
|
+
*
|
|
104
|
+
* @param type - Which type of helpers to discover ('features' or 'clients')
|
|
105
|
+
* @returns Names of helpers that were discovered and registered
|
|
106
|
+
*/
|
|
107
|
+
discover(type: RegistryType): Promise<string[]>;
|
|
108
|
+
/**
|
|
109
|
+
* Discover all helper types from the manifest.
|
|
110
|
+
*
|
|
111
|
+
* @returns Map of registry type to discovered helper names
|
|
112
|
+
*/
|
|
113
|
+
discoverAll(): Promise<Record<string, string[]>>;
|
|
114
|
+
/**
|
|
115
|
+
* Convenience method to discover only features.
|
|
116
|
+
*/
|
|
117
|
+
discoverFeatures(): Promise<string[]>;
|
|
118
|
+
/**
|
|
119
|
+
* Convenience method to discover only clients.
|
|
120
|
+
*/
|
|
121
|
+
discoverClients(): Promise<string[]>;
|
|
122
|
+
/**
|
|
123
|
+
* Look up a helper class by type and name.
|
|
124
|
+
*
|
|
125
|
+
* @param type - The registry type
|
|
126
|
+
* @param name - The helper name within that registry
|
|
127
|
+
* @returns The helper constructor
|
|
128
|
+
*/
|
|
129
|
+
lookup(type: RegistryType, name: string): any;
|
|
130
|
+
/**
|
|
131
|
+
* Get the introspection description for a specific helper.
|
|
132
|
+
*
|
|
133
|
+
* @param type - The registry type
|
|
134
|
+
* @param name - The helper name
|
|
135
|
+
* @returns Markdown description of the helper's interface
|
|
136
|
+
*/
|
|
137
|
+
describe(type: RegistryType, name: string): string;
|
|
138
|
+
}
|
|
139
|
+
export default Helpers;
|
|
140
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/web/features/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAKvC,eAAO,MAAM,kBAAkB;;;;;iBAI7B,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE7D,eAAO,MAAM,oBAAoB;;;;;;iBAE/B,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE,eAAO,MAAM,mBAAmB;;;;;;;iBAe9B,CAAA;AAEF,KAAK,YAAY,GAAG,UAAU,GAAG,SAAS,CAAA;AAa1C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,OAAQ,SAAQ,OAAO,CAAC,YAAY,EAAE,cAAc,CAAC;IAChE,OAAgB,QAAQ,EAAG,kBAAkB,CAAS;IACtD,OAAgB,WAAW,SAA4F;IACvH,OAAgB,WAAW;;;;;sBAAqB;IAChD,OAAgB,aAAa;;;;;;sBAAuB;IACpD,OAAgB,YAAY;;;;;;;sBAAsB;IAIlD,OAAO,CAAC,SAAS,CAAwB;IAEzC,OAAO,KAAK,WAAW,GAKtB;IAED,kDAAkD;IAClD,IAAI,WAAW,IAAI,MAAM,CAExB;IAED;;;;OAIG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM;IAM1B;;;OAGG;IACH,IAAI,SAAS,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAMxC;IAED;;;OAGG;YACW,aAAa;IAyB3B;;OAEG;IACH,OAAO,KAAK,WAAW,GAEtB;IAED;;;;;;;;OAQG;IACG,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAiDrD;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAUtD;;OAEG;IACG,gBAAgB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAI3C;;OAEG;IACG,eAAe,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAI1C;;;;;;OAMG;IACH,MAAM,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,GAAG;IAK7C;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;CAInD;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Feature } from "../feature.js";
|
|
3
|
+
import type { ContainerContext } from "../container.js";
|
|
4
|
+
export declare const NetworkStateSchema: z.ZodObject<{
|
|
5
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
6
|
+
offline: z.ZodBoolean;
|
|
7
|
+
}, z.core.$loose>;
|
|
8
|
+
export declare const NetworkOptionsSchema: z.ZodObject<{
|
|
9
|
+
name: z.ZodOptional<z.ZodString>;
|
|
10
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
11
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare const NetworkEventsSchema: z.ZodObject<{
|
|
15
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
16
|
+
enabled: z.ZodTuple<[], null>;
|
|
17
|
+
online: z.ZodTuple<[], null>;
|
|
18
|
+
offline: z.ZodTuple<[], null>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export type NetworkState = z.infer<typeof NetworkStateSchema>;
|
|
21
|
+
export type NetworkOptions = z.infer<typeof NetworkOptionsSchema>;
|
|
22
|
+
/**
|
|
23
|
+
* Tracks browser online/offline connectivity state.
|
|
24
|
+
*
|
|
25
|
+
* Listens for the browser's `online` and `offline` events and keeps the
|
|
26
|
+
* feature state in sync. Other features can observe the `offline` state
|
|
27
|
+
* value or listen for change events to react to connectivity changes.
|
|
28
|
+
*
|
|
29
|
+
* @extends Feature
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* const network = container.feature('network')
|
|
34
|
+
* console.log(network.state.get('offline')) // false when online
|
|
35
|
+
*
|
|
36
|
+
* network.on('stateChanged', ({ offline }) => {
|
|
37
|
+
* console.log(offline ? 'Went offline' : 'Back online')
|
|
38
|
+
* })
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare class Network<T extends NetworkState = NetworkState, K extends NetworkOptions = NetworkOptions> extends Feature<T, K> {
|
|
42
|
+
static stateSchema: z.ZodObject<{
|
|
43
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
44
|
+
offline: z.ZodBoolean;
|
|
45
|
+
}, z.core.$loose>;
|
|
46
|
+
static optionsSchema: z.ZodObject<{
|
|
47
|
+
name: z.ZodOptional<z.ZodString>;
|
|
48
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
49
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
static eventsSchema: z.ZodObject<{
|
|
53
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
54
|
+
enabled: z.ZodTuple<[], null>;
|
|
55
|
+
online: z.ZodTuple<[], null>;
|
|
56
|
+
offline: z.ZodTuple<[], null>;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
static shortcut: "features.network";
|
|
59
|
+
constructor(options: K, context: ContainerContext);
|
|
60
|
+
/** Whether the browser is currently offline. */
|
|
61
|
+
get isOffline(): boolean;
|
|
62
|
+
/** Whether the browser is currently online. */
|
|
63
|
+
get isOnline(): boolean;
|
|
64
|
+
private handleConnectionChange;
|
|
65
|
+
start(): this;
|
|
66
|
+
disable(): this;
|
|
67
|
+
}
|
|
68
|
+
export default Network;
|
|
69
|
+
//# sourceMappingURL=network.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../../src/web/features/network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,eAAO,MAAM,kBAAkB;;;iBAE7B,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;;;iBAAkC,CAAA;AAEnE,eAAO,MAAM,mBAAmB;;;;;iBAGH,CAAA;AAE7B,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAC7D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,OAAO,CAClB,CAAC,SAAS,YAAY,GAAG,YAAY,EACrC,CAAC,SAAS,cAAc,GAAG,cAAc,CACzC,SAAQ,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IACrB,OAAgB,WAAW;;;sBAAqB;IAChD,OAAgB,aAAa;;;;;sBAAuB;IACpD,OAAgB,YAAY;;;;;sBAAsB;IAClD,OAAgB,QAAQ,EAAG,kBAAkB,CAAS;gBAI1C,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,gBAAgB;IAKjD,gDAAgD;IAChD,IAAI,SAAS,YAEZ;IAED,+CAA+C;IAC/C,IAAI,QAAQ,YAEX;IAED,OAAO,CAAC,sBAAsB,CAI5B;IAEF,KAAK;IAML,OAAO;CAKR;AAED,eAAe,OAAO,CAAA"}
|