@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,323 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Feature } from '../feature.js';
|
|
3
|
+
import type { Assistant } from './assistant.js';
|
|
4
|
+
declare module '@soederpop/luca/feature' {
|
|
5
|
+
interface AvailableFeatures {
|
|
6
|
+
lucaCoder: typeof LucaCoder;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/** Permission level for a tool. 'allow' runs immediately, 'ask' blocks for user approval, 'deny' rejects. */
|
|
10
|
+
export type PermissionLevel = 'allow' | 'ask' | 'deny';
|
|
11
|
+
/** A pending approval awaiting user decision. */
|
|
12
|
+
export interface PendingApproval {
|
|
13
|
+
id: string;
|
|
14
|
+
toolName: string;
|
|
15
|
+
args: Record<string, any>;
|
|
16
|
+
timestamp: number;
|
|
17
|
+
resolve: (decision: 'approve' | 'deny') => void;
|
|
18
|
+
}
|
|
19
|
+
/** Tool bundle spec — either a feature name string, or an object with filtering. */
|
|
20
|
+
export type ToolBundleSpec = string | {
|
|
21
|
+
feature: string;
|
|
22
|
+
only?: string[];
|
|
23
|
+
except?: string[];
|
|
24
|
+
};
|
|
25
|
+
export declare const LucaCoderEventsSchema: z.ZodObject<{
|
|
26
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
27
|
+
enabled: z.ZodTuple<[], null>;
|
|
28
|
+
started: z.ZodTuple<[], null>;
|
|
29
|
+
permissionRequest: z.ZodTuple<[z.ZodObject<{
|
|
30
|
+
id: z.ZodString;
|
|
31
|
+
toolName: z.ZodString;
|
|
32
|
+
args: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
33
|
+
}, z.core.$strip>], null>;
|
|
34
|
+
permissionGranted: z.ZodTuple<[z.ZodString], null>;
|
|
35
|
+
permissionDenied: z.ZodTuple<[z.ZodString], null>;
|
|
36
|
+
toolBlocked: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
37
|
+
chunk: z.ZodTuple<[z.ZodString], null>;
|
|
38
|
+
response: z.ZodTuple<[z.ZodString], null>;
|
|
39
|
+
toolCall: z.ZodTuple<[z.ZodString, z.ZodAny], null>;
|
|
40
|
+
toolResult: z.ZodTuple<[z.ZodString, z.ZodAny], null>;
|
|
41
|
+
toolError: z.ZodTuple<[z.ZodString, z.ZodAny], null>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
export declare const LucaCoderStateSchema: z.ZodObject<{
|
|
44
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
45
|
+
started: z.ZodBoolean;
|
|
46
|
+
permissions: z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
47
|
+
allow: "allow";
|
|
48
|
+
ask: "ask";
|
|
49
|
+
deny: "deny";
|
|
50
|
+
}>>;
|
|
51
|
+
defaultPermission: z.ZodEnum<{
|
|
52
|
+
allow: "allow";
|
|
53
|
+
ask: "ask";
|
|
54
|
+
deny: "deny";
|
|
55
|
+
}>;
|
|
56
|
+
pendingApprovals: z.ZodArray<z.ZodObject<{
|
|
57
|
+
id: z.ZodString;
|
|
58
|
+
toolName: z.ZodString;
|
|
59
|
+
args: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
60
|
+
timestamp: z.ZodNumber;
|
|
61
|
+
}, z.core.$strip>>;
|
|
62
|
+
approvalHistory: z.ZodArray<z.ZodObject<{
|
|
63
|
+
id: z.ZodString;
|
|
64
|
+
toolName: z.ZodString;
|
|
65
|
+
decision: z.ZodEnum<{
|
|
66
|
+
deny: "deny";
|
|
67
|
+
approve: "approve";
|
|
68
|
+
}>;
|
|
69
|
+
timestamp: z.ZodNumber;
|
|
70
|
+
}, z.core.$strip>>;
|
|
71
|
+
loadedSkills: z.ZodArray<z.ZodString>;
|
|
72
|
+
}, z.core.$loose>;
|
|
73
|
+
export declare const LucaCoderOptionsSchema: z.ZodObject<{
|
|
74
|
+
name: z.ZodOptional<z.ZodString>;
|
|
75
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
76
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
78
|
+
tools: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
79
|
+
feature: z.ZodString;
|
|
80
|
+
only: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
81
|
+
except: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
82
|
+
}, z.core.$strip>]>>>;
|
|
83
|
+
permissions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
84
|
+
allow: "allow";
|
|
85
|
+
ask: "ask";
|
|
86
|
+
deny: "deny";
|
|
87
|
+
}>>>;
|
|
88
|
+
defaultPermission: z.ZodDefault<z.ZodEnum<{
|
|
89
|
+
allow: "allow";
|
|
90
|
+
ask: "ask";
|
|
91
|
+
deny: "deny";
|
|
92
|
+
}>>;
|
|
93
|
+
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
94
|
+
model: z.ZodOptional<z.ZodString>;
|
|
95
|
+
maxTokens: z.ZodDefault<z.ZodNumber>;
|
|
96
|
+
local: z.ZodDefault<z.ZodBoolean>;
|
|
97
|
+
historyMode: z.ZodOptional<z.ZodEnum<{
|
|
98
|
+
session: "session";
|
|
99
|
+
lifecycle: "lifecycle";
|
|
100
|
+
daily: "daily";
|
|
101
|
+
persistent: "persistent";
|
|
102
|
+
}>>;
|
|
103
|
+
folder: z.ZodOptional<z.ZodString>;
|
|
104
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
105
|
+
autoLoadLucaSkill: z.ZodDefault<z.ZodBoolean>;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
export type LucaCoderState = z.infer<typeof LucaCoderStateSchema>;
|
|
108
|
+
export type LucaCoderOptions = z.infer<typeof LucaCoderOptionsSchema>;
|
|
109
|
+
/**
|
|
110
|
+
* A coding assistant that owns a lower-level Assistant instance and
|
|
111
|
+
* gates all tool calls through a permission system.
|
|
112
|
+
*
|
|
113
|
+
* Comes with built-in Bash tool (via proc.execAndCapture) and auto-loads
|
|
114
|
+
* the luca-framework skill when found in .claude/skills paths.
|
|
115
|
+
*
|
|
116
|
+
* Tools are stacked from feature bundles (fileTools, etc.)
|
|
117
|
+
* and each tool can be set to 'allow' (runs immediately), 'ask' (blocks
|
|
118
|
+
* until user approves/denies), or 'deny' (always rejected).
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* const coder = container.feature('lucaCoder', {
|
|
123
|
+
* tools: ['fileTools'],
|
|
124
|
+
* permissions: {
|
|
125
|
+
* readFile: 'allow',
|
|
126
|
+
* searchFiles: 'allow',
|
|
127
|
+
* writeFile: 'ask',
|
|
128
|
+
* bash: 'ask',
|
|
129
|
+
* },
|
|
130
|
+
* defaultPermission: 'ask',
|
|
131
|
+
* systemPrompt: 'You are a coding assistant.',
|
|
132
|
+
* })
|
|
133
|
+
*
|
|
134
|
+
* coder.on('permissionRequest', ({ id, toolName, args }) => {
|
|
135
|
+
* console.log(`Tool "${toolName}" wants to run with`, args)
|
|
136
|
+
* coder.approve(id) // or coder.deny(id)
|
|
137
|
+
* })
|
|
138
|
+
*
|
|
139
|
+
* await coder.ask('Refactor the auth module to use async/await')
|
|
140
|
+
* ```
|
|
141
|
+
*
|
|
142
|
+
* @extends Feature
|
|
143
|
+
*/
|
|
144
|
+
export declare class LucaCoder extends Feature<LucaCoderState, LucaCoderOptions> {
|
|
145
|
+
static shortcut: "features.lucaCoder";
|
|
146
|
+
static stateSchema: z.ZodObject<{
|
|
147
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
148
|
+
started: z.ZodBoolean;
|
|
149
|
+
permissions: z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
150
|
+
allow: "allow";
|
|
151
|
+
ask: "ask";
|
|
152
|
+
deny: "deny";
|
|
153
|
+
}>>;
|
|
154
|
+
defaultPermission: z.ZodEnum<{
|
|
155
|
+
allow: "allow";
|
|
156
|
+
ask: "ask";
|
|
157
|
+
deny: "deny";
|
|
158
|
+
}>;
|
|
159
|
+
pendingApprovals: z.ZodArray<z.ZodObject<{
|
|
160
|
+
id: z.ZodString;
|
|
161
|
+
toolName: z.ZodString;
|
|
162
|
+
args: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
163
|
+
timestamp: z.ZodNumber;
|
|
164
|
+
}, z.core.$strip>>;
|
|
165
|
+
approvalHistory: z.ZodArray<z.ZodObject<{
|
|
166
|
+
id: z.ZodString;
|
|
167
|
+
toolName: z.ZodString;
|
|
168
|
+
decision: z.ZodEnum<{
|
|
169
|
+
deny: "deny";
|
|
170
|
+
approve: "approve";
|
|
171
|
+
}>;
|
|
172
|
+
timestamp: z.ZodNumber;
|
|
173
|
+
}, z.core.$strip>>;
|
|
174
|
+
loadedSkills: z.ZodArray<z.ZodString>;
|
|
175
|
+
}, z.core.$loose>;
|
|
176
|
+
static optionsSchema: z.ZodObject<{
|
|
177
|
+
name: z.ZodOptional<z.ZodString>;
|
|
178
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
179
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
180
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
181
|
+
tools: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
182
|
+
feature: z.ZodString;
|
|
183
|
+
only: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
184
|
+
except: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
185
|
+
}, z.core.$strip>]>>>;
|
|
186
|
+
permissions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
187
|
+
allow: "allow";
|
|
188
|
+
ask: "ask";
|
|
189
|
+
deny: "deny";
|
|
190
|
+
}>>>;
|
|
191
|
+
defaultPermission: z.ZodDefault<z.ZodEnum<{
|
|
192
|
+
allow: "allow";
|
|
193
|
+
ask: "ask";
|
|
194
|
+
deny: "deny";
|
|
195
|
+
}>>;
|
|
196
|
+
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
197
|
+
model: z.ZodOptional<z.ZodString>;
|
|
198
|
+
maxTokens: z.ZodDefault<z.ZodNumber>;
|
|
199
|
+
local: z.ZodDefault<z.ZodBoolean>;
|
|
200
|
+
historyMode: z.ZodOptional<z.ZodEnum<{
|
|
201
|
+
session: "session";
|
|
202
|
+
lifecycle: "lifecycle";
|
|
203
|
+
daily: "daily";
|
|
204
|
+
persistent: "persistent";
|
|
205
|
+
}>>;
|
|
206
|
+
folder: z.ZodOptional<z.ZodString>;
|
|
207
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
208
|
+
autoLoadLucaSkill: z.ZodDefault<z.ZodBoolean>;
|
|
209
|
+
}, z.core.$strip>;
|
|
210
|
+
static eventsSchema: z.ZodObject<{
|
|
211
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
212
|
+
enabled: z.ZodTuple<[], null>;
|
|
213
|
+
started: z.ZodTuple<[], null>;
|
|
214
|
+
permissionRequest: z.ZodTuple<[z.ZodObject<{
|
|
215
|
+
id: z.ZodString;
|
|
216
|
+
toolName: z.ZodString;
|
|
217
|
+
args: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
218
|
+
}, z.core.$strip>], null>;
|
|
219
|
+
permissionGranted: z.ZodTuple<[z.ZodString], null>;
|
|
220
|
+
permissionDenied: z.ZodTuple<[z.ZodString], null>;
|
|
221
|
+
toolBlocked: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
222
|
+
chunk: z.ZodTuple<[z.ZodString], null>;
|
|
223
|
+
response: z.ZodTuple<[z.ZodString], null>;
|
|
224
|
+
toolCall: z.ZodTuple<[z.ZodString, z.ZodAny], null>;
|
|
225
|
+
toolResult: z.ZodTuple<[z.ZodString, z.ZodAny], null>;
|
|
226
|
+
toolError: z.ZodTuple<[z.ZodString, z.ZodAny], null>;
|
|
227
|
+
}, z.core.$strip>;
|
|
228
|
+
/**
|
|
229
|
+
* Default system prompt that establishes baseline coding assistant identity
|
|
230
|
+
* and luca framework knowledge. Project-specific CLAUDE.md and loaded skills
|
|
231
|
+
* are appended below this — the skill will reinforce and expand on these
|
|
232
|
+
* fundamentals without conflicting.
|
|
233
|
+
*/
|
|
234
|
+
static defaultSystemPrompt: string;
|
|
235
|
+
/** The inner assistant instance. Created during start(). */
|
|
236
|
+
private _assistant;
|
|
237
|
+
/** Map of pending approval promises keyed by ID. */
|
|
238
|
+
private _pendingResolvers;
|
|
239
|
+
get initialState(): LucaCoderState;
|
|
240
|
+
/** The inner assistant. Throws if not started. */
|
|
241
|
+
get assistant(): Assistant;
|
|
242
|
+
/** Current permission map from state. */
|
|
243
|
+
get permissions(): Record<string, PermissionLevel>;
|
|
244
|
+
/** Current pending approvals. */
|
|
245
|
+
get pendingApprovals(): PendingApproval[];
|
|
246
|
+
/** Whether the assistant is started and ready. */
|
|
247
|
+
get isStarted(): boolean;
|
|
248
|
+
/** The tools registered on the inner assistant. */
|
|
249
|
+
get tools(): Record<string, any>;
|
|
250
|
+
/** The conversation on the inner assistant (if started). */
|
|
251
|
+
get conversation(): import("./conversation.js").Conversation | undefined;
|
|
252
|
+
/** Messages from the inner assistant's conversation. */
|
|
253
|
+
get messages(): import("openai/resources/index.mjs").ChatCompletionMessageParam[];
|
|
254
|
+
/** Get the effective permission level for a tool. */
|
|
255
|
+
getPermission(toolName: string): PermissionLevel;
|
|
256
|
+
/** Set permission level for one or more tools. */
|
|
257
|
+
setPermission(toolName: string | string[], level: PermissionLevel): this;
|
|
258
|
+
/** Set the default permission level for unconfigured tools. */
|
|
259
|
+
setDefaultPermission(level: PermissionLevel): this;
|
|
260
|
+
/** Allow a tool (or tools) to run without approval. */
|
|
261
|
+
permitTool(...toolNames: string[]): this;
|
|
262
|
+
/** Require approval before a tool (or tools) can run. */
|
|
263
|
+
gateTool(...toolNames: string[]): this;
|
|
264
|
+
/** Block a tool (or tools) from ever running. */
|
|
265
|
+
blockTool(...toolNames: string[]): this;
|
|
266
|
+
/** Approve a pending tool call by ID. The tool will execute. */
|
|
267
|
+
approve(id: string): this;
|
|
268
|
+
/** Deny a pending tool call by ID. The tool call will be skipped. */
|
|
269
|
+
deny(id: string): this;
|
|
270
|
+
/** Approve all pending tool calls. */
|
|
271
|
+
approveAll(): this;
|
|
272
|
+
/** Deny all pending tool calls. */
|
|
273
|
+
denyAll(): this;
|
|
274
|
+
/**
|
|
275
|
+
* Execute a shell command string and return its output.
|
|
276
|
+
* Uses proc.execAndCapture under the hood — runs `sh -c <command>`.
|
|
277
|
+
*/
|
|
278
|
+
bash({ command, cwd, timeout }: {
|
|
279
|
+
command: string;
|
|
280
|
+
cwd?: string;
|
|
281
|
+
timeout?: number;
|
|
282
|
+
}): Promise<{
|
|
283
|
+
exitCode: number;
|
|
284
|
+
stdout: string;
|
|
285
|
+
stderr: string;
|
|
286
|
+
success: boolean;
|
|
287
|
+
}>;
|
|
288
|
+
/**
|
|
289
|
+
* Read project instruction files (CLAUDE.md, AGENTS.md, LUCA.md) from the
|
|
290
|
+
* project root if they exist, and return their combined content.
|
|
291
|
+
*/
|
|
292
|
+
private _loadProjectInstructions;
|
|
293
|
+
/**
|
|
294
|
+
* Detect and load skills into the system prompt context.
|
|
295
|
+
* Auto-loads luca-framework if found and autoLoadLucaSkill is true.
|
|
296
|
+
*/
|
|
297
|
+
private _loadSkillsIntoContext;
|
|
298
|
+
/**
|
|
299
|
+
* Initialize the inner assistant, register the bash tool, stack tool bundles,
|
|
300
|
+
* auto-load skills, and wire up the permission interceptor.
|
|
301
|
+
*/
|
|
302
|
+
start(): Promise<this>;
|
|
303
|
+
/**
|
|
304
|
+
* Ask the coder a question. Auto-starts if needed.
|
|
305
|
+
* Tool calls will be gated by the permission system.
|
|
306
|
+
*/
|
|
307
|
+
ask(question: string, options?: Record<string, any>): Promise<string>;
|
|
308
|
+
/**
|
|
309
|
+
* Add a tool bundle after initialization. Useful for dynamically
|
|
310
|
+
* extending the assistant's capabilities.
|
|
311
|
+
*/
|
|
312
|
+
use(spec: ToolBundleSpec): this;
|
|
313
|
+
/** Resolve a tool bundle spec and register its tools on the inner assistant. */
|
|
314
|
+
private _stackToolBundle;
|
|
315
|
+
/** Create a pending approval, emit the event, and return a promise that resolves with the decision. */
|
|
316
|
+
private _requestApproval;
|
|
317
|
+
/** Remove a pending approval from state. */
|
|
318
|
+
private _removePending;
|
|
319
|
+
/** Record a decision in the approval history. */
|
|
320
|
+
private _recordDecision;
|
|
321
|
+
}
|
|
322
|
+
export default LucaCoder;
|
|
323
|
+
//# sourceMappingURL=luca-coder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"luca-coder.d.ts","sourceRoot":"","sources":["../../../src/agi/features/luca-coder.ts"],"names":[],"mappings":"AAAA,OAAO,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