@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,373 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Feature } from '../feature.js';
|
|
3
|
+
export declare const LocalNetworkSchema: z.ZodObject<{
|
|
4
|
+
interface: z.ZodString;
|
|
5
|
+
address: z.ZodString;
|
|
6
|
+
netmask: z.ZodString;
|
|
7
|
+
cidr: z.ZodString;
|
|
8
|
+
mac: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type LocalNetwork = z.infer<typeof LocalNetworkSchema>;
|
|
11
|
+
export declare const ArpEntrySchema: z.ZodObject<{
|
|
12
|
+
ip: z.ZodString;
|
|
13
|
+
mac: z.ZodOptional<z.ZodString>;
|
|
14
|
+
interface: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export type ArpEntry = z.infer<typeof ArpEntrySchema>;
|
|
17
|
+
export declare const DiscoverHostSchema: z.ZodObject<{
|
|
18
|
+
ip: z.ZodString;
|
|
19
|
+
mac: z.ZodOptional<z.ZodString>;
|
|
20
|
+
reachable: z.ZodBoolean;
|
|
21
|
+
method: z.ZodEnum<{
|
|
22
|
+
arp: "arp";
|
|
23
|
+
tcp: "tcp";
|
|
24
|
+
}>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export type DiscoverHost = z.infer<typeof DiscoverHostSchema>;
|
|
27
|
+
export declare const PortScanResultSchema: z.ZodObject<{
|
|
28
|
+
port: z.ZodNumber;
|
|
29
|
+
status: z.ZodEnum<{
|
|
30
|
+
open: "open";
|
|
31
|
+
closed: "closed";
|
|
32
|
+
filtered: "filtered";
|
|
33
|
+
}>;
|
|
34
|
+
service: z.ZodOptional<z.ZodString>;
|
|
35
|
+
banner: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export type PortScanResult = z.infer<typeof PortScanResultSchema>;
|
|
38
|
+
export declare const LocalNetworkScanHostSchema: z.ZodObject<{
|
|
39
|
+
ip: z.ZodString;
|
|
40
|
+
mac: z.ZodOptional<z.ZodString>;
|
|
41
|
+
hostname: z.ZodOptional<z.ZodString>;
|
|
42
|
+
openPorts: z.ZodArray<z.ZodObject<{
|
|
43
|
+
port: z.ZodNumber;
|
|
44
|
+
status: z.ZodEnum<{
|
|
45
|
+
open: "open";
|
|
46
|
+
closed: "closed";
|
|
47
|
+
filtered: "filtered";
|
|
48
|
+
}>;
|
|
49
|
+
service: z.ZodOptional<z.ZodString>;
|
|
50
|
+
banner: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, z.core.$strip>>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
export type LocalNetworkScanHost = z.infer<typeof LocalNetworkScanHostSchema>;
|
|
54
|
+
export declare const NetworkSnapshotSchema: z.ZodObject<{
|
|
55
|
+
cidr: z.ZodString;
|
|
56
|
+
hosts: z.ZodArray<z.ZodObject<{
|
|
57
|
+
ip: z.ZodString;
|
|
58
|
+
mac: z.ZodOptional<z.ZodString>;
|
|
59
|
+
hostname: z.ZodOptional<z.ZodString>;
|
|
60
|
+
openPorts: z.ZodArray<z.ZodObject<{
|
|
61
|
+
port: z.ZodNumber;
|
|
62
|
+
status: z.ZodEnum<{
|
|
63
|
+
open: "open";
|
|
64
|
+
closed: "closed";
|
|
65
|
+
filtered: "filtered";
|
|
66
|
+
}>;
|
|
67
|
+
service: z.ZodOptional<z.ZodString>;
|
|
68
|
+
banner: z.ZodOptional<z.ZodString>;
|
|
69
|
+
}, z.core.$strip>>;
|
|
70
|
+
}, z.core.$strip>>;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
export type NetworkSnapshot = z.infer<typeof NetworkSnapshotSchema>;
|
|
73
|
+
export declare const NetworkingEventsSchema: z.ZodObject<{
|
|
74
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
75
|
+
enabled: z.ZodTuple<[], null>;
|
|
76
|
+
'host:discovered': z.ZodTuple<[z.ZodObject<{
|
|
77
|
+
ip: z.ZodString;
|
|
78
|
+
mac: z.ZodOptional<z.ZodString>;
|
|
79
|
+
reachable: z.ZodBoolean;
|
|
80
|
+
method: z.ZodEnum<{
|
|
81
|
+
arp: "arp";
|
|
82
|
+
tcp: "tcp";
|
|
83
|
+
}>;
|
|
84
|
+
}, z.core.$strip>], null>;
|
|
85
|
+
'port:open': z.ZodTuple<[z.ZodObject<{
|
|
86
|
+
host: z.ZodString;
|
|
87
|
+
port: z.ZodNumber;
|
|
88
|
+
service: z.ZodOptional<z.ZodString>;
|
|
89
|
+
banner: z.ZodOptional<z.ZodString>;
|
|
90
|
+
}, z.core.$strip>], null>;
|
|
91
|
+
'scan:start': z.ZodTuple<[z.ZodObject<{
|
|
92
|
+
target: z.ZodString;
|
|
93
|
+
type: z.ZodString;
|
|
94
|
+
}, z.core.$strip>], null>;
|
|
95
|
+
'scan:complete': z.ZodTuple<[z.ZodObject<{
|
|
96
|
+
target: z.ZodString;
|
|
97
|
+
type: z.ZodString;
|
|
98
|
+
duration: z.ZodNumber;
|
|
99
|
+
hostsFound: z.ZodNumber;
|
|
100
|
+
portsFound: z.ZodNumber;
|
|
101
|
+
}, z.core.$strip>], null>;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
export declare const NetworkingStateSchema: z.ZodObject<{
|
|
104
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
105
|
+
lastScan: z.ZodOptional<z.ZodObject<{
|
|
106
|
+
timestamp: z.ZodNumber;
|
|
107
|
+
target: z.ZodString;
|
|
108
|
+
type: z.ZodString;
|
|
109
|
+
networks: z.ZodArray<z.ZodObject<{
|
|
110
|
+
cidr: z.ZodString;
|
|
111
|
+
hosts: z.ZodArray<z.ZodObject<{
|
|
112
|
+
ip: z.ZodString;
|
|
113
|
+
mac: z.ZodOptional<z.ZodString>;
|
|
114
|
+
hostname: z.ZodOptional<z.ZodString>;
|
|
115
|
+
openPorts: z.ZodArray<z.ZodObject<{
|
|
116
|
+
port: z.ZodNumber;
|
|
117
|
+
status: z.ZodEnum<{
|
|
118
|
+
open: "open";
|
|
119
|
+
closed: "closed";
|
|
120
|
+
filtered: "filtered";
|
|
121
|
+
}>;
|
|
122
|
+
service: z.ZodOptional<z.ZodString>;
|
|
123
|
+
banner: z.ZodOptional<z.ZodString>;
|
|
124
|
+
}, z.core.$strip>>;
|
|
125
|
+
}, z.core.$strip>>;
|
|
126
|
+
}, z.core.$strip>>;
|
|
127
|
+
}, z.core.$strip>>;
|
|
128
|
+
}, z.core.$loose>;
|
|
129
|
+
export type NetworkingState = z.infer<typeof NetworkingStateSchema>;
|
|
130
|
+
export declare const NetworkingOptionsSchema: z.ZodObject<{
|
|
131
|
+
name: z.ZodOptional<z.ZodString>;
|
|
132
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
133
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
134
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
135
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
136
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
137
|
+
}, z.core.$strip>;
|
|
138
|
+
export type NetworkingOptions = z.infer<typeof NetworkingOptionsSchema>;
|
|
139
|
+
type ScanPortsOptions = {
|
|
140
|
+
ports?: string | number[];
|
|
141
|
+
timeout?: number;
|
|
142
|
+
concurrency?: number;
|
|
143
|
+
banner?: boolean;
|
|
144
|
+
includeClosed?: boolean;
|
|
145
|
+
};
|
|
146
|
+
type DiscoverHostsOptions = {
|
|
147
|
+
timeout?: number;
|
|
148
|
+
concurrency?: number;
|
|
149
|
+
ports?: number[];
|
|
150
|
+
};
|
|
151
|
+
type ReachableHostOptions = {
|
|
152
|
+
timeout?: number;
|
|
153
|
+
ports?: number[];
|
|
154
|
+
};
|
|
155
|
+
type ScanLocalNetworksOptions = {
|
|
156
|
+
ports?: string | number[];
|
|
157
|
+
timeout?: number;
|
|
158
|
+
concurrency?: number;
|
|
159
|
+
hostConcurrency?: number;
|
|
160
|
+
banner?: boolean;
|
|
161
|
+
};
|
|
162
|
+
type NmapPort = {
|
|
163
|
+
port: number;
|
|
164
|
+
state: string;
|
|
165
|
+
protocol: string;
|
|
166
|
+
service?: string;
|
|
167
|
+
};
|
|
168
|
+
type NmapHost = {
|
|
169
|
+
ip: string;
|
|
170
|
+
hostname?: string;
|
|
171
|
+
status?: string;
|
|
172
|
+
mac?: string;
|
|
173
|
+
ports: NmapPort[];
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* The Networking feature provides utilities for network-related operations.
|
|
177
|
+
*
|
|
178
|
+
* This feature includes utilities for port detection and availability checking,
|
|
179
|
+
* which are commonly needed when setting up servers or network services.
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* ```typescript
|
|
183
|
+
* const networking = container.feature('networking')
|
|
184
|
+
*
|
|
185
|
+
* // Find an available port starting from 3000
|
|
186
|
+
* const port = await networking.findOpenPort(3000)
|
|
187
|
+
* console.log(`Available port: ${port}`)
|
|
188
|
+
*
|
|
189
|
+
* // Check if a specific port is available
|
|
190
|
+
* const isAvailable = await networking.isPortOpen(8080)
|
|
191
|
+
* if (isAvailable) {
|
|
192
|
+
* console.log('Port 8080 is available')
|
|
193
|
+
* }
|
|
194
|
+
* ```
|
|
195
|
+
*
|
|
196
|
+
* @extends Feature
|
|
197
|
+
*/
|
|
198
|
+
export declare class Networking extends Feature<NetworkingState, NetworkingOptions> {
|
|
199
|
+
static shortcut: "features.networking";
|
|
200
|
+
static stateSchema: z.ZodObject<{
|
|
201
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
202
|
+
lastScan: z.ZodOptional<z.ZodObject<{
|
|
203
|
+
timestamp: z.ZodNumber;
|
|
204
|
+
target: z.ZodString;
|
|
205
|
+
type: z.ZodString;
|
|
206
|
+
networks: z.ZodArray<z.ZodObject<{
|
|
207
|
+
cidr: z.ZodString;
|
|
208
|
+
hosts: z.ZodArray<z.ZodObject<{
|
|
209
|
+
ip: z.ZodString;
|
|
210
|
+
mac: z.ZodOptional<z.ZodString>;
|
|
211
|
+
hostname: z.ZodOptional<z.ZodString>;
|
|
212
|
+
openPorts: z.ZodArray<z.ZodObject<{
|
|
213
|
+
port: z.ZodNumber;
|
|
214
|
+
status: z.ZodEnum<{
|
|
215
|
+
open: "open";
|
|
216
|
+
closed: "closed";
|
|
217
|
+
filtered: "filtered";
|
|
218
|
+
}>;
|
|
219
|
+
service: z.ZodOptional<z.ZodString>;
|
|
220
|
+
banner: z.ZodOptional<z.ZodString>;
|
|
221
|
+
}, z.core.$strip>>;
|
|
222
|
+
}, z.core.$strip>>;
|
|
223
|
+
}, z.core.$strip>>;
|
|
224
|
+
}, z.core.$strip>>;
|
|
225
|
+
}, z.core.$loose>;
|
|
226
|
+
static optionsSchema: z.ZodObject<{
|
|
227
|
+
name: z.ZodOptional<z.ZodString>;
|
|
228
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
229
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
230
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
231
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
232
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
233
|
+
}, z.core.$strip>;
|
|
234
|
+
static eventsSchema: z.ZodObject<{
|
|
235
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
236
|
+
enabled: z.ZodTuple<[], null>;
|
|
237
|
+
'host:discovered': z.ZodTuple<[z.ZodObject<{
|
|
238
|
+
ip: z.ZodString;
|
|
239
|
+
mac: z.ZodOptional<z.ZodString>;
|
|
240
|
+
reachable: z.ZodBoolean;
|
|
241
|
+
method: z.ZodEnum<{
|
|
242
|
+
arp: "arp";
|
|
243
|
+
tcp: "tcp";
|
|
244
|
+
}>;
|
|
245
|
+
}, z.core.$strip>], null>;
|
|
246
|
+
'port:open': z.ZodTuple<[z.ZodObject<{
|
|
247
|
+
host: z.ZodString;
|
|
248
|
+
port: z.ZodNumber;
|
|
249
|
+
service: z.ZodOptional<z.ZodString>;
|
|
250
|
+
banner: z.ZodOptional<z.ZodString>;
|
|
251
|
+
}, z.core.$strip>], null>;
|
|
252
|
+
'scan:start': z.ZodTuple<[z.ZodObject<{
|
|
253
|
+
target: z.ZodString;
|
|
254
|
+
type: z.ZodString;
|
|
255
|
+
}, z.core.$strip>], null>;
|
|
256
|
+
'scan:complete': z.ZodTuple<[z.ZodObject<{
|
|
257
|
+
target: z.ZodString;
|
|
258
|
+
type: z.ZodString;
|
|
259
|
+
duration: z.ZodNumber;
|
|
260
|
+
hostsFound: z.ZodNumber;
|
|
261
|
+
portsFound: z.ZodNumber;
|
|
262
|
+
}, z.core.$strip>], null>;
|
|
263
|
+
}, z.core.$strip>;
|
|
264
|
+
get initialState(): NetworkingState;
|
|
265
|
+
private _binCache;
|
|
266
|
+
/** Resolve a binary path via `which`, caching the result. */
|
|
267
|
+
private resolveBin;
|
|
268
|
+
get proc(): ReturnType<typeof this.container.feature<'proc'>>;
|
|
269
|
+
get os(): ReturnType<typeof this.container.feature<'os'>>;
|
|
270
|
+
/**
|
|
271
|
+
* Finds the next available port starting from the specified port number.
|
|
272
|
+
*
|
|
273
|
+
* This method will search for the first available port starting from the given
|
|
274
|
+
* port number. If the specified port is available, it returns that port.
|
|
275
|
+
* Otherwise, it returns the next available port.
|
|
276
|
+
*
|
|
277
|
+
* @param {number} [startAt=0] - The port number to start searching from (0 means system will choose)
|
|
278
|
+
* @returns {Promise<number>} Promise that resolves to an available port number
|
|
279
|
+
*
|
|
280
|
+
* @example
|
|
281
|
+
* ```typescript
|
|
282
|
+
* // Find any available port
|
|
283
|
+
* const anyPort = await networking.findOpenPort()
|
|
284
|
+
*
|
|
285
|
+
* // Find an available port starting from 3000
|
|
286
|
+
* const port = await networking.findOpenPort(3000)
|
|
287
|
+
* console.log(`Server can use port: ${port}`)
|
|
288
|
+
* ```
|
|
289
|
+
*/
|
|
290
|
+
findOpenPort(startAt?: number): Promise<number>;
|
|
291
|
+
/**
|
|
292
|
+
* Checks if a specific port is available for use.
|
|
293
|
+
*
|
|
294
|
+
* This method attempts to detect if the specified port is available.
|
|
295
|
+
* It returns true if the port is available, false if it's already in use.
|
|
296
|
+
*
|
|
297
|
+
* @param {number} [checkPort=0] - The port number to check for availability
|
|
298
|
+
* @returns {Promise<boolean>} Promise that resolves to true if the port is available, false otherwise
|
|
299
|
+
*
|
|
300
|
+
* @example
|
|
301
|
+
* ```typescript
|
|
302
|
+
* // Check if port 8080 is available
|
|
303
|
+
* const isAvailable = await networking.isPortOpen(8080)
|
|
304
|
+
* if (isAvailable) {
|
|
305
|
+
* console.log('Port 8080 is free to use')
|
|
306
|
+
* } else {
|
|
307
|
+
* console.log('Port 8080 is already in use')
|
|
308
|
+
* }
|
|
309
|
+
* ```
|
|
310
|
+
*/
|
|
311
|
+
isPortOpen(checkPort?: number): Promise<boolean | 0>;
|
|
312
|
+
/**
|
|
313
|
+
* Returns local external IPv4 interfaces and their CIDR ranges.
|
|
314
|
+
*/
|
|
315
|
+
getLocalNetworks(): LocalNetwork[];
|
|
316
|
+
/**
|
|
317
|
+
* Expands a CIDR block to host IP addresses.
|
|
318
|
+
* For /31 and /32, all addresses are returned. For all others, network/broadcast are excluded.
|
|
319
|
+
*/
|
|
320
|
+
expandCidr(cidr: string): string[];
|
|
321
|
+
/**
|
|
322
|
+
* Reads and parses the system ARP cache.
|
|
323
|
+
*/
|
|
324
|
+
getArpTable(): Promise<ArpEntry[]>;
|
|
325
|
+
/**
|
|
326
|
+
* Performs a lightweight TCP reachability probe.
|
|
327
|
+
*/
|
|
328
|
+
isHostReachable(host: string, options?: ReachableHostOptions): Promise<boolean>;
|
|
329
|
+
/**
|
|
330
|
+
* Discovers hosts in a CIDR range by combining ARP cache and TCP probes.
|
|
331
|
+
*/
|
|
332
|
+
discoverHosts(cidr: string, options?: DiscoverHostsOptions): Promise<DiscoverHost[]>;
|
|
333
|
+
/**
|
|
334
|
+
* TCP connect scan for a host. By default only returns open ports.
|
|
335
|
+
*/
|
|
336
|
+
scanPorts(host: string, options?: ScanPortsOptions): Promise<PortScanResult[]>;
|
|
337
|
+
/**
|
|
338
|
+
* Convenience method: discover and port-scan hosts across all local networks.
|
|
339
|
+
*/
|
|
340
|
+
scanLocalNetworks(options?: ScanLocalNetworksOptions): Promise<LocalNetworkScanHost[]>;
|
|
341
|
+
/**
|
|
342
|
+
* Optional nmap wrapper for users that already have nmap installed.
|
|
343
|
+
*/
|
|
344
|
+
get nmap(): {
|
|
345
|
+
isAvailable: () => Promise<boolean>;
|
|
346
|
+
scan: (target: string, args?: string[]) => Promise<{
|
|
347
|
+
hosts: NmapHost[];
|
|
348
|
+
raw: string;
|
|
349
|
+
}>;
|
|
350
|
+
quickScan: (cidr: string) => Promise<{
|
|
351
|
+
hosts: NmapHost[];
|
|
352
|
+
raw: string;
|
|
353
|
+
}>;
|
|
354
|
+
fullScan: (target: string) => Promise<{
|
|
355
|
+
hosts: NmapHost[];
|
|
356
|
+
raw: string;
|
|
357
|
+
}>;
|
|
358
|
+
};
|
|
359
|
+
private isNmapAvailable;
|
|
360
|
+
private runNmapScan;
|
|
361
|
+
private parseNmapGrepable;
|
|
362
|
+
private parseArpOutput;
|
|
363
|
+
private normalizeMac;
|
|
364
|
+
private parsePortsOption;
|
|
365
|
+
private probeTcpPort;
|
|
366
|
+
private computeCidr;
|
|
367
|
+
private ipToInt;
|
|
368
|
+
private intToIp;
|
|
369
|
+
private countMaskBits;
|
|
370
|
+
private mapWithConcurrency;
|
|
371
|
+
}
|
|
372
|
+
export default Networking;
|
|
373
|
+
//# sourceMappingURL=networking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"networking.d.ts","sourceRoot":"","sources":["../../../src/node/features/networking.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAwEvC,eAAO,MAAM,kBAAkB;;;;;;iBAM7B,CAAA;AACF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE7D,eAAO,MA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AE,MAAM,CAAA;SAAE,CAAC,CAAC;QAAC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;YAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;YAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAO/R;YAEa,eAAe;YAKf,WAAW;IAiCzB,OAAO,CAAC,iBAAiB;IA6DzB,OAAO,CAAC,cAAc;IAqCtB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,gBAAgB;YAoCV,YAAY;IA2E1B,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,OAAO;IAaf,OAAO,CAAC,OAAO;IAUf,OAAO,CAAC,aAAa;YAUP,kBAAkB;CAwBjC;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Feature } from '../feature.js';
|
|
3
|
+
export declare const NLPStateSchema: z.ZodObject<{
|
|
4
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
5
|
+
parseCalls: z.ZodDefault<z.ZodNumber>;
|
|
6
|
+
analyzeCalls: z.ZodDefault<z.ZodNumber>;
|
|
7
|
+
}, z.core.$loose>;
|
|
8
|
+
export declare const NLPOptionsSchema: 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 ParsedCommandSchema: z.ZodObject<{
|
|
15
|
+
intent: z.ZodNullable<z.ZodString>;
|
|
16
|
+
target: z.ZodNullable<z.ZodString>;
|
|
17
|
+
subject: z.ZodNullable<z.ZodString>;
|
|
18
|
+
modifiers: z.ZodArray<z.ZodString>;
|
|
19
|
+
raw: z.ZodString;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export declare const AnalysisSchema: z.ZodObject<{
|
|
22
|
+
tokens: z.ZodArray<z.ZodObject<{
|
|
23
|
+
value: z.ZodString;
|
|
24
|
+
pos: z.ZodString;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
entities: z.ZodArray<z.ZodObject<{
|
|
27
|
+
value: z.ZodString;
|
|
28
|
+
type: z.ZodString;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
raw: z.ZodString;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export type ParsedCommand = z.infer<typeof ParsedCommandSchema>;
|
|
33
|
+
export type Analysis = z.infer<typeof AnalysisSchema>;
|
|
34
|
+
/**
|
|
35
|
+
* The NLP feature provides natural language processing utilities for parsing
|
|
36
|
+
* utterances into structured data. Combines two complementary libraries:
|
|
37
|
+
*
|
|
38
|
+
* - **compromise**: Verb normalization (toInfinitive), POS pattern matching
|
|
39
|
+
* - **wink-nlp**: High-accuracy POS tagging (~95%), named entity recognition
|
|
40
|
+
*
|
|
41
|
+
* Three methods at increasing levels of detail:
|
|
42
|
+
* - `parse()` — compromise-powered quick structure + verb normalization
|
|
43
|
+
* - `analyze()` — wink-powered high-accuracy POS + entity extraction
|
|
44
|
+
* - `understand()` — combined parse + analyze merged
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* const nlp = container.feature('nlp', { enable: true })
|
|
49
|
+
*
|
|
50
|
+
* nlp.parse("draw a diagram of the auth flow")
|
|
51
|
+
* // { intent: "draw", target: "diagram", subject: "auth flow", modifiers: [], raw: "..." }
|
|
52
|
+
*
|
|
53
|
+
* nlp.analyze("meet john at 3pm about the deployment")
|
|
54
|
+
* // { tokens: [{value:"meet",pos:"VERB"}, ...], entities: [{value:"john",type:"PERSON"}, ...] }
|
|
55
|
+
*
|
|
56
|
+
* nlp.understand("draw a diagram of the auth flow")
|
|
57
|
+
* // { intent, target, subject, modifiers, tokens, entities, raw }
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare class NLP extends Feature<z.infer<typeof NLPStateSchema>, z.infer<typeof NLPOptionsSchema>> {
|
|
61
|
+
static shortcut: "features.nlp";
|
|
62
|
+
static stateSchema: z.ZodObject<{
|
|
63
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
64
|
+
parseCalls: z.ZodDefault<z.ZodNumber>;
|
|
65
|
+
analyzeCalls: z.ZodDefault<z.ZodNumber>;
|
|
66
|
+
}, z.core.$loose>;
|
|
67
|
+
static optionsSchema: z.ZodObject<{
|
|
68
|
+
name: z.ZodOptional<z.ZodString>;
|
|
69
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
70
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
71
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
private _wink?;
|
|
74
|
+
/** Lazily initializes the wink-nlp instance on first use. */
|
|
75
|
+
private get wink();
|
|
76
|
+
/**
|
|
77
|
+
* Parse an utterance into structured command data using compromise.
|
|
78
|
+
* Extracts intent (normalized verb), target noun, prepositional subject, and modifiers.
|
|
79
|
+
*
|
|
80
|
+
* @param text - The raw utterance to parse
|
|
81
|
+
* @returns Parsed command structure with intent, target, subject, modifiers
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```typescript
|
|
85
|
+
* nlp.parse("open the terminal")
|
|
86
|
+
* // { intent: "open", target: "terminal", subject: null, modifiers: [], raw: "open the terminal" }
|
|
87
|
+
*
|
|
88
|
+
* nlp.parse("draw a diagram of the auth flow")
|
|
89
|
+
* // { intent: "draw", target: "diagram", subject: "auth flow", modifiers: [], raw: "..." }
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
parse(text: string): ParsedCommand;
|
|
93
|
+
/**
|
|
94
|
+
* Analyze text with high-accuracy POS tagging and named entity recognition using wink-nlp.
|
|
95
|
+
*
|
|
96
|
+
* @param text - The text to analyze
|
|
97
|
+
* @returns Token-level POS tags (Universal POS tagset) and named entities
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```typescript
|
|
101
|
+
* nlp.analyze("meet john at 3pm about the deployment")
|
|
102
|
+
* // { tokens: [{value:"meet",pos:"VERB"}, {value:"john",pos:"PROPN"}, ...],
|
|
103
|
+
* // entities: [{value:"john",type:"PERSON"}, {value:"3pm",type:"TIME"}],
|
|
104
|
+
* // raw: "meet john at 3pm about the deployment" }
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
analyze(text: string): Analysis;
|
|
108
|
+
/**
|
|
109
|
+
* Full understanding: combines compromise parsing with wink-nlp analysis.
|
|
110
|
+
* Returns intent, target, subject, modifiers (from parse) plus tokens and entities (from analyze).
|
|
111
|
+
*
|
|
112
|
+
* @param text - The text to understand
|
|
113
|
+
* @returns Combined parse + analyze result
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```typescript
|
|
117
|
+
* nlp.understand("draw a diagram of the auth flow")
|
|
118
|
+
* // { intent: "draw", target: "diagram", subject: "auth flow", modifiers: [],
|
|
119
|
+
* // tokens: [{value:"draw",pos:"VERB"}, ...], entities: [...], raw: "..." }
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
understand(text: string): ParsedCommand & Analysis;
|
|
123
|
+
}
|
|
124
|
+
export default NLP;
|
|
125
|
+
//# sourceMappingURL=nlp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nlp.d.ts","sourceRoot":"","sources":["../../../src/node/features/nlp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAMvC,eAAO,MAAM,cAAc;;;;iBAGzB,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;iBAAkC,CAAA;AAE/D,eAAO,MAAM,mBAAmB;;;;;;iBAM9B,CAAA;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;iBAUzB,CAAA;AAEF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAC/D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,GAAI,SAAQ,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;IAChG,OAAgB,QAAQ,EAAG,cAAc,CAAS;IAClD,OAAgB,WAAW;;;;sBAAiB;IAC5C,OAAgB,aAAa;;;;;sBAAmB;IAGhD,OAAO,CAAC,KAAK,CAAC,CAA4B;IAE1C,6DAA6D;IAC7D,OAAO,KAAK,IAAI,GAKf;IAED;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa;IAgDlC;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ;IA2B/B;;;;;;;;;;;;;OAaG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,QAAQ;CAWnD;AAED,eAAe,GAAG,CAAA"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Feature } from "../feature.js";
|
|
2
|
+
/**
|
|
3
|
+
* The Opener feature opens files, URLs, desktop applications, and code editors.
|
|
4
|
+
*
|
|
5
|
+
* HTTP/HTTPS URLs are opened in Google Chrome. Desktop apps can be launched by name.
|
|
6
|
+
* VS Code and Cursor can be opened to a specific path. All other paths are opened
|
|
7
|
+
* with the platform's default handler (e.g. Preview for images, Finder for folders).
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const opener = container.feature('opener')
|
|
12
|
+
*
|
|
13
|
+
* // Open a URL in Chrome
|
|
14
|
+
* await opener.open('https://www.google.com')
|
|
15
|
+
*
|
|
16
|
+
* // Open a file with the default application
|
|
17
|
+
* await opener.open('/path/to/image.png')
|
|
18
|
+
*
|
|
19
|
+
* // Open a desktop application
|
|
20
|
+
* await opener.app('Slack')
|
|
21
|
+
*
|
|
22
|
+
* // Open VS Code at a project path
|
|
23
|
+
* await opener.code('/Users/jon/projects/my-app')
|
|
24
|
+
*
|
|
25
|
+
* // Open Cursor at a project path
|
|
26
|
+
* await opener.cursor('/Users/jon/projects/my-app')
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @extends Feature
|
|
30
|
+
*/
|
|
31
|
+
export declare class Opener extends Feature {
|
|
32
|
+
static shortcut: "features.opener";
|
|
33
|
+
static description: string;
|
|
34
|
+
static stateSchema: import("zod").ZodObject<{
|
|
35
|
+
enabled: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
36
|
+
}, import("zod/v4/core").$loose>;
|
|
37
|
+
static optionsSchema: import("zod").ZodObject<{
|
|
38
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
39
|
+
_cacheKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
40
|
+
cached: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
41
|
+
enable: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
42
|
+
}, import("zod/v4/core").$strip>;
|
|
43
|
+
private _binCache;
|
|
44
|
+
/** Resolve a binary path via `which`, caching the result. */
|
|
45
|
+
private resolveBin;
|
|
46
|
+
/**
|
|
47
|
+
* Opens a path or URL with the appropriate application.
|
|
48
|
+
*
|
|
49
|
+
* HTTP and HTTPS URLs are opened in Google Chrome.
|
|
50
|
+
* Everything else is opened with the system default handler via `open` (macOS).
|
|
51
|
+
*
|
|
52
|
+
* @param {string} target - A URL or file path to open
|
|
53
|
+
* @returns {Promise<void>}
|
|
54
|
+
*/
|
|
55
|
+
open(target: string): Promise<void>;
|
|
56
|
+
private openInChrome;
|
|
57
|
+
/**
|
|
58
|
+
* Opens a desktop application by name.
|
|
59
|
+
*
|
|
60
|
+
* On macOS, uses `open -a` to launch the app. On Windows, uses `start`.
|
|
61
|
+
* On Linux, attempts to run the lowercase app name as a command.
|
|
62
|
+
*
|
|
63
|
+
* @param {string} name - The application name (e.g. "Slack", "Finder", "Safari")
|
|
64
|
+
* @returns {Promise<void>}
|
|
65
|
+
*/
|
|
66
|
+
app(name: string): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Opens VS Code at the specified path.
|
|
69
|
+
*
|
|
70
|
+
* Uses the `code` CLI command. Falls back to `open -a "Visual Studio Code"` on macOS.
|
|
71
|
+
*
|
|
72
|
+
* @param {string} [path="."] - The file or folder path to open
|
|
73
|
+
* @returns {Promise<void>}
|
|
74
|
+
*/
|
|
75
|
+
code(path?: string): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Opens Cursor at the specified path.
|
|
78
|
+
*
|
|
79
|
+
* Uses the `cursor` CLI command. Falls back to `open -a "Cursor"` on macOS.
|
|
80
|
+
*
|
|
81
|
+
* @param {string} [path="."] - The file or folder path to open
|
|
82
|
+
* @returns {Promise<void>}
|
|
83
|
+
*/
|
|
84
|
+
cursor(path?: string): Promise<void>;
|
|
85
|
+
private openDefault;
|
|
86
|
+
}
|
|
87
|
+
declare module '../../feature' {
|
|
88
|
+
interface AvailableFeatures {
|
|
89
|
+
opener: typeof Opener;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
export default Opener;
|
|
93
|
+
//# sourceMappingURL=opener.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opener.d.ts","sourceRoot":"","sources":["../../../src/node/features/opener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,MAAO,SAAQ,OAAO;IACjC,OAAgB,QAAQ,EAAG,iBAAiB,CAAS;IACrD,OAAgB,WAAW,SAAsD;IACjF,OAAgB,WAAW;;qCAAqB;IAChD,OAAgB,aAAa;;;;;qCAAuB;IAGpD,OAAO,CAAC,SAAS,CAA6B;IAE9C,6DAA6D;IAC7D,OAAO,CAAC,UAAU;IAUlB;;;;;;;;OAQG;IACG,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAY3B,YAAY;IAqB1B;;;;;;;;OAQG;IACG,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAatC;;;;;;;OAOG;IACG,IAAI,CAAC,IAAI,GAAE,MAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAc7C;;;;;;;OAOG;IACG,MAAM,CAAC,IAAI,GAAE,MAAY,GAAG,OAAO,CAAC,IAAI,CAAC;YAcjC,WAAW;CAW1B;AAED,OAAO,QAAQ,eAAe,CAAC;IAC7B,UAAU,iBAAiB;QACzB,MAAM,EAAE,OAAO,MAAM,CAAA;KACtB;CACF;AAED,eAAe,MAAM,CAAA"}
|