@soederpop/luca 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +2 -0
- package/assistants/codingAssistant/hooks.ts +3 -0
- package/assistants/inkbot/CORE.md +69 -0
- package/assistants/inkbot/hooks.ts +14 -0
- package/assistants/inkbot/tools.ts +47 -0
- package/commands/inkbot.ts +353 -0
- package/dist/agi/container.server.d.ts +63 -0
- package/dist/agi/container.server.d.ts.map +1 -0
- package/dist/agi/endpoints/ask.d.ts +20 -0
- package/dist/agi/endpoints/ask.d.ts.map +1 -0
- package/dist/agi/endpoints/conversations/[id].d.ts +27 -0
- package/dist/agi/endpoints/conversations/[id].d.ts.map +1 -0
- package/dist/agi/endpoints/conversations.d.ts +18 -0
- package/dist/agi/endpoints/conversations.d.ts.map +1 -0
- package/dist/agi/endpoints/experts.d.ts +8 -0
- package/dist/agi/endpoints/experts.d.ts.map +1 -0
- package/dist/agi/feature.d.ts +9 -0
- package/dist/agi/feature.d.ts.map +1 -0
- package/dist/agi/features/assistant.d.ts +509 -0
- package/dist/agi/features/assistant.d.ts.map +1 -0
- package/dist/agi/features/assistants-manager.d.ts +236 -0
- package/dist/agi/features/assistants-manager.d.ts.map +1 -0
- package/dist/agi/features/autonomous-assistant.d.ts +281 -0
- package/dist/agi/features/autonomous-assistant.d.ts.map +1 -0
- package/dist/agi/features/browser-use.d.ts +479 -0
- package/dist/agi/features/browser-use.d.ts.map +1 -0
- package/dist/agi/features/claude-code.d.ts +824 -0
- package/dist/agi/features/claude-code.d.ts.map +1 -0
- package/dist/agi/features/conversation-history.d.ts +245 -0
- package/dist/agi/features/conversation-history.d.ts.map +1 -0
- package/dist/agi/features/conversation.d.ts +464 -0
- package/dist/agi/features/conversation.d.ts.map +1 -0
- package/dist/agi/features/docs-reader.d.ts +72 -0
- package/dist/agi/features/docs-reader.d.ts.map +1 -0
- package/dist/agi/features/file-tools.d.ts +110 -0
- package/dist/agi/features/file-tools.d.ts.map +1 -0
- package/dist/agi/features/luca-coder.d.ts +323 -0
- package/dist/agi/features/luca-coder.d.ts.map +1 -0
- package/dist/agi/features/openai-codex.d.ts +381 -0
- package/dist/agi/features/openai-codex.d.ts.map +1 -0
- package/dist/agi/features/openapi.d.ts +200 -0
- package/dist/agi/features/openapi.d.ts.map +1 -0
- package/dist/agi/features/skills-library.d.ts +167 -0
- package/dist/agi/features/skills-library.d.ts.map +1 -0
- package/dist/agi/index.d.ts +5 -0
- package/dist/agi/index.d.ts.map +1 -0
- package/dist/agi/lib/interceptor-chain.d.ts +44 -0
- package/dist/agi/lib/interceptor-chain.d.ts.map +1 -0
- package/dist/agi/lib/token-counter.d.ts +13 -0
- package/dist/agi/lib/token-counter.d.ts.map +1 -0
- package/dist/bootstrap/generated.d.ts +5 -0
- package/dist/bootstrap/generated.d.ts.map +1 -0
- package/dist/browser.d.ts +12 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/bus.d.ts +29 -0
- package/dist/bus.d.ts.map +1 -0
- package/dist/cli/build-info.d.ts +4 -0
- package/dist/cli/build-info.d.ts.map +1 -0
- package/dist/cli/cli.d.ts +3 -0
- package/dist/cli/cli.d.ts.map +1 -0
- package/dist/client.d.ts +60 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/clients/civitai/index.d.ts +472 -0
- package/dist/clients/civitai/index.d.ts.map +1 -0
- package/dist/clients/client-template.d.ts +30 -0
- package/dist/clients/client-template.d.ts.map +1 -0
- package/dist/clients/comfyui/index.d.ts +281 -0
- package/dist/clients/comfyui/index.d.ts.map +1 -0
- package/dist/clients/elevenlabs/index.d.ts +197 -0
- package/dist/clients/elevenlabs/index.d.ts.map +1 -0
- package/dist/clients/graph.d.ts +64 -0
- package/dist/clients/graph.d.ts.map +1 -0
- package/dist/clients/openai/index.d.ts +247 -0
- package/dist/clients/openai/index.d.ts.map +1 -0
- package/dist/clients/rest.d.ts +92 -0
- package/dist/clients/rest.d.ts.map +1 -0
- package/dist/clients/supabase/index.d.ts +176 -0
- package/dist/clients/supabase/index.d.ts.map +1 -0
- package/dist/clients/websocket.d.ts +127 -0
- package/dist/clients/websocket.d.ts.map +1 -0
- package/dist/command.d.ts +163 -0
- package/dist/command.d.ts.map +1 -0
- package/dist/commands/bootstrap.d.ts +20 -0
- package/dist/commands/bootstrap.d.ts.map +1 -0
- package/dist/commands/chat.d.ts +37 -0
- package/dist/commands/chat.d.ts.map +1 -0
- package/dist/commands/code.d.ts +28 -0
- package/dist/commands/code.d.ts.map +1 -0
- package/dist/commands/console.d.ts +22 -0
- package/dist/commands/console.d.ts.map +1 -0
- package/dist/commands/describe.d.ts +50 -0
- package/dist/commands/describe.d.ts.map +1 -0
- package/dist/commands/eval.d.ts +23 -0
- package/dist/commands/eval.d.ts.map +1 -0
- package/dist/commands/help.d.ts +25 -0
- package/dist/commands/help.d.ts.map +1 -0
- package/dist/commands/index.d.ts +18 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/introspect.d.ts +24 -0
- package/dist/commands/introspect.d.ts.map +1 -0
- package/dist/commands/mcp.d.ts +35 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/prompt.d.ts +38 -0
- package/dist/commands/prompt.d.ts.map +1 -0
- package/dist/commands/run.d.ts +24 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/sandbox-mcp.d.ts +34 -0
- package/dist/commands/sandbox-mcp.d.ts.map +1 -0
- package/dist/commands/save-api-docs.d.ts +21 -0
- package/dist/commands/save-api-docs.d.ts.map +1 -0
- package/dist/commands/scaffold.d.ts +24 -0
- package/dist/commands/scaffold.d.ts.map +1 -0
- package/dist/commands/select.d.ts +22 -0
- package/dist/commands/select.d.ts.map +1 -0
- package/dist/commands/serve.d.ts +29 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/container-describer.d.ts +144 -0
- package/dist/container-describer.d.ts.map +1 -0
- package/dist/container.d.ts +451 -0
- package/dist/container.d.ts.map +1 -0
- package/dist/endpoint.d.ts +113 -0
- package/dist/endpoint.d.ts.map +1 -0
- package/dist/feature.d.ts +47 -0
- package/dist/feature.d.ts.map +1 -0
- package/dist/graft.d.ts +29 -0
- package/dist/graft.d.ts.map +1 -0
- package/dist/hash-object.d.ts +8 -0
- package/dist/hash-object.d.ts.map +1 -0
- package/dist/helper.d.ts +209 -0
- package/dist/helper.d.ts.map +1 -0
- package/dist/introspection/generated.node.d.ts +44623 -0
- package/dist/introspection/generated.node.d.ts.map +1 -0
- package/dist/introspection/generated.web.d.ts +1412 -0
- package/dist/introspection/generated.web.d.ts.map +1 -0
- package/dist/introspection/index.d.ts +156 -0
- package/dist/introspection/index.d.ts.map +1 -0
- package/dist/introspection/scan.d.ts +147 -0
- package/dist/introspection/scan.d.ts.map +1 -0
- package/dist/node/container.d.ts +256 -0
- package/dist/node/container.d.ts.map +1 -0
- package/dist/node/feature.d.ts +9 -0
- package/dist/node/feature.d.ts.map +1 -0
- package/dist/node/features/container-link.d.ts +213 -0
- package/dist/node/features/container-link.d.ts.map +1 -0
- package/dist/node/features/content-db.d.ts +354 -0
- package/dist/node/features/content-db.d.ts.map +1 -0
- package/dist/node/features/disk-cache.d.ts +236 -0
- package/dist/node/features/disk-cache.d.ts.map +1 -0
- package/dist/node/features/dns.d.ts +511 -0
- package/dist/node/features/dns.d.ts.map +1 -0
- package/dist/node/features/docker.d.ts +485 -0
- package/dist/node/features/docker.d.ts.map +1 -0
- package/dist/node/features/downloader.d.ts +73 -0
- package/dist/node/features/downloader.d.ts.map +1 -0
- package/dist/node/features/figlet-fonts.d.ts +4 -0
- package/dist/node/features/figlet-fonts.d.ts.map +1 -0
- package/dist/node/features/file-manager.d.ts +177 -0
- package/dist/node/features/file-manager.d.ts.map +1 -0
- package/dist/node/features/fs.d.ts +635 -0
- package/dist/node/features/fs.d.ts.map +1 -0
- package/dist/node/features/git.d.ts +329 -0
- package/dist/node/features/git.d.ts.map +1 -0
- package/dist/node/features/google-auth.d.ts +200 -0
- package/dist/node/features/google-auth.d.ts.map +1 -0
- package/dist/node/features/google-calendar.d.ts +194 -0
- package/dist/node/features/google-calendar.d.ts.map +1 -0
- package/dist/node/features/google-docs.d.ts +138 -0
- package/dist/node/features/google-docs.d.ts.map +1 -0
- package/dist/node/features/google-drive.d.ts +202 -0
- package/dist/node/features/google-drive.d.ts.map +1 -0
- package/dist/node/features/google-mail.d.ts +221 -0
- package/dist/node/features/google-mail.d.ts.map +1 -0
- package/dist/node/features/google-sheets.d.ts +157 -0
- package/dist/node/features/google-sheets.d.ts.map +1 -0
- package/dist/node/features/grep.d.ts +207 -0
- package/dist/node/features/grep.d.ts.map +1 -0
- package/dist/node/features/helpers.d.ts +236 -0
- package/dist/node/features/helpers.d.ts.map +1 -0
- package/dist/node/features/ink.d.ts +332 -0
- package/dist/node/features/ink.d.ts.map +1 -0
- package/dist/node/features/ipc-socket.d.ts +298 -0
- package/dist/node/features/ipc-socket.d.ts.map +1 -0
- package/dist/node/features/json-tree.d.ts +140 -0
- package/dist/node/features/json-tree.d.ts.map +1 -0
- package/dist/node/features/networking.d.ts +373 -0
- package/dist/node/features/networking.d.ts.map +1 -0
- package/dist/node/features/nlp.d.ts +125 -0
- package/dist/node/features/nlp.d.ts.map +1 -0
- package/dist/node/features/opener.d.ts +93 -0
- package/dist/node/features/opener.d.ts.map +1 -0
- package/dist/node/features/os.d.ts +168 -0
- package/dist/node/features/os.d.ts.map +1 -0
- package/dist/node/features/package-finder.d.ts +419 -0
- package/dist/node/features/package-finder.d.ts.map +1 -0
- package/dist/node/features/postgres.d.ts +173 -0
- package/dist/node/features/postgres.d.ts.map +1 -0
- package/dist/node/features/proc.d.ts +285 -0
- package/dist/node/features/proc.d.ts.map +1 -0
- package/dist/node/features/process-manager.d.ts +427 -0
- package/dist/node/features/process-manager.d.ts.map +1 -0
- package/dist/node/features/python.d.ts +477 -0
- package/dist/node/features/python.d.ts.map +1 -0
- package/dist/node/features/redis.d.ts +247 -0
- package/dist/node/features/redis.d.ts.map +1 -0
- package/dist/node/features/repl.d.ts +84 -0
- package/dist/node/features/repl.d.ts.map +1 -0
- package/dist/node/features/runpod.d.ts +527 -0
- package/dist/node/features/runpod.d.ts.map +1 -0
- package/dist/node/features/secure-shell.d.ts +145 -0
- package/dist/node/features/secure-shell.d.ts.map +1 -0
- package/dist/node/features/semantic-search.d.ts +207 -0
- package/dist/node/features/semantic-search.d.ts.map +1 -0
- package/dist/node/features/sqlite.d.ts +180 -0
- package/dist/node/features/sqlite.d.ts.map +1 -0
- package/dist/node/features/telegram.d.ts +173 -0
- package/dist/node/features/telegram.d.ts.map +1 -0
- package/dist/node/features/transpiler.d.ts +51 -0
- package/dist/node/features/transpiler.d.ts.map +1 -0
- package/dist/node/features/tts.d.ts +108 -0
- package/dist/node/features/tts.d.ts.map +1 -0
- package/dist/node/features/ui.d.ts +562 -0
- package/dist/node/features/ui.d.ts.map +1 -0
- package/dist/node/features/vault.d.ts +90 -0
- package/dist/node/features/vault.d.ts.map +1 -0
- package/dist/node/features/vm.d.ts +285 -0
- package/dist/node/features/vm.d.ts.map +1 -0
- package/dist/node/features/yaml-tree.d.ts +118 -0
- package/dist/node/features/yaml-tree.d.ts.map +1 -0
- package/dist/node/features/yaml.d.ts +127 -0
- package/dist/node/features/yaml.d.ts.map +1 -0
- package/dist/node.d.ts +67 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/python/generated.d.ts +2 -0
- package/dist/python/generated.d.ts.map +1 -0
- package/dist/react/index.d.ts +36 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/registry.d.ts +97 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/scaffolds/generated.d.ts +13 -0
- package/dist/scaffolds/generated.d.ts.map +1 -0
- package/dist/scaffolds/template.d.ts +11 -0
- package/dist/scaffolds/template.d.ts.map +1 -0
- package/dist/schemas/base.d.ts +254 -0
- package/dist/schemas/base.d.ts.map +1 -0
- package/dist/selector.d.ts +130 -0
- package/dist/selector.d.ts.map +1 -0
- package/dist/server.d.ts +89 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/servers/express.d.ts +104 -0
- package/dist/servers/express.d.ts.map +1 -0
- package/dist/servers/mcp.d.ts +201 -0
- package/dist/servers/mcp.d.ts.map +1 -0
- package/dist/servers/socket.d.ts +121 -0
- package/dist/servers/socket.d.ts.map +1 -0
- package/dist/state.d.ts +24 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/web/clients/socket.d.ts +37 -0
- package/dist/web/clients/socket.d.ts.map +1 -0
- package/dist/web/container.d.ts +55 -0
- package/dist/web/container.d.ts.map +1 -0
- package/dist/web/extension.d.ts +4 -0
- package/dist/web/extension.d.ts.map +1 -0
- package/dist/web/feature.d.ts +8 -0
- package/dist/web/feature.d.ts.map +1 -0
- package/dist/web/features/asset-loader.d.ts +35 -0
- package/dist/web/features/asset-loader.d.ts.map +1 -0
- package/dist/web/features/container-link.d.ts +167 -0
- package/dist/web/features/container-link.d.ts.map +1 -0
- package/dist/web/features/esbuild.d.ts +51 -0
- package/dist/web/features/esbuild.d.ts.map +1 -0
- package/dist/web/features/helpers.d.ts +140 -0
- package/dist/web/features/helpers.d.ts.map +1 -0
- package/dist/web/features/network.d.ts +69 -0
- package/dist/web/features/network.d.ts.map +1 -0
- package/dist/web/features/speech.d.ts +71 -0
- package/dist/web/features/speech.d.ts.map +1 -0
- package/dist/web/features/vault.d.ts +62 -0
- package/dist/web/features/vault.d.ts.map +1 -0
- package/dist/web/features/vm.d.ts +48 -0
- package/dist/web/features/vm.d.ts.map +1 -0
- package/dist/web/features/voice-recognition.d.ts +96 -0
- package/dist/web/features/voice-recognition.d.ts.map +1 -0
- package/dist/web/shims/isomorphic-vm.d.ts +22 -0
- package/dist/web/shims/isomorphic-vm.d.ts.map +1 -0
- package/docs/apis/features/agi/assistant.md +1 -0
- package/docs/apis/features/agi/assistants-manager.md +62 -2
- package/docs/apis/features/agi/auto-assistant.md +11 -109
- package/docs/apis/features/agi/claude-code.md +138 -0
- package/docs/apis/features/agi/conversation.md +60 -31
- package/docs/apis/features/agi/luca-coder.md +407 -0
- package/docs/apis/features/agi/openapi.md +2 -2
- package/docs/apis/features/agi/skills-library.md +12 -0
- package/docs/apis/features/node/python.md +81 -11
- package/docs/apis/features/node/transpiler.md +74 -0
- package/docs/apis/features/web/esbuild.md +0 -6
- package/docs/apis/servers/mcp.md +2 -2
- package/docs/examples/entity.md +124 -0
- package/package.json +73 -21
- package/scripts/test-assistant-hooks.ts +13 -0
- package/src/agi/feature.ts +13 -0
- package/src/agi/features/assistant.ts +36 -25
- package/src/agi/features/assistants-manager.ts +70 -5
- package/src/agi/features/autonomous-assistant.ts +1 -5
- package/src/agi/features/browser-use.ts +2 -2
- package/src/agi/features/claude-code.ts +165 -1
- package/src/agi/features/conversation-history.ts +2 -6
- package/src/agi/features/conversation.ts +95 -3
- package/src/agi/features/docs-reader.ts +2 -1
- package/src/agi/features/file-tools.ts +2 -2
- package/src/agi/features/luca-coder.ts +1 -5
- package/src/agi/features/openai-codex.ts +1 -1
- package/src/agi/features/openapi.ts +3 -3
- package/src/agi/features/skills-library.ts +90 -2
- package/src/agi/lib/interceptor-chain.ts +10 -0
- package/src/agi/lib/token-counter.ts +1 -1
- package/src/bootstrap/generated.ts +126 -1
- package/src/bus.ts +27 -5
- package/src/cli/build-info.ts +2 -2
- package/src/client.ts +2 -2
- package/src/clients/elevenlabs/index.ts +5 -0
- package/src/commands/bootstrap.ts +2 -1
- package/src/commands/chat.ts +1 -0
- package/src/commands/code.ts +4 -2
- package/src/commands/prompt.ts +34 -34
- package/src/commands/sandbox-mcp.ts +69 -163
- package/src/commands/save-api-docs.ts +10 -8
- package/src/commands/select.ts +8 -3
- package/src/container-describer.ts +70 -84
- package/src/container.ts +93 -3
- package/src/endpoint.ts +1 -1
- package/src/entity.ts +173 -0
- package/src/feature.ts +3 -3
- package/src/helper.ts +8 -4
- package/src/introspection/generated.agi.ts +1403 -929
- package/src/introspection/generated.node.ts +127 -33
- package/src/introspection/generated.web.ts +95 -3
- package/src/introspection/scan.ts +1 -1
- package/src/node/container.ts +1 -1
- package/src/node/features/content-db.ts +3 -3
- package/src/node/features/file-manager.ts +10 -9
- package/src/node/features/git.ts +5 -5
- package/src/node/features/helpers.ts +1 -1
- package/src/node/features/json-tree.ts +1 -1
- package/src/node/features/os.ts +3 -3
- package/src/node/features/package-finder.ts +1 -1
- package/src/node/features/process-manager.ts +1 -1
- package/src/node/features/python.ts +3 -3
- package/src/node/features/redis.ts +1 -1
- package/src/node/features/repl.ts +2 -2
- package/src/node/features/transpiler.ts +34 -9
- package/src/node/features/ui.ts +1 -1
- package/src/node/features/vm.ts +6 -5
- package/src/node/features/yaml-tree.ts +1 -1
- package/src/node.ts +1 -0
- package/src/python/generated.ts +1 -1
- package/src/scaffolds/generated.ts +1 -1
- package/src/selector.ts +74 -4
- package/src/server.ts +2 -2
- package/src/servers/mcp.ts +6 -6
- package/src/web/features/helpers.ts +1 -1
- package/src/web/features/network.ts +1 -0
- package/test/assistant.test.ts +72 -0
- package/test/conversation.test.ts +220 -0
- package/test/vm-loadmodule.test.ts +213 -0
- package/tsconfig.build.json +12 -0
- package/tsconfig.json +1 -1
- package/scripts/examples/telegram-ink-ui.ts +0 -302
- package/scripts/examples/using-openai-codex.ts +0 -23
- package/scripts/examples/vm-loading-esm-modules.ts +0 -16
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { State } from "../../state.js";
|
|
3
|
+
import { Feature } from "../feature.js";
|
|
4
|
+
import type { FSWatcher } from "chokidar";
|
|
5
|
+
type File = {
|
|
6
|
+
absolutePath: string;
|
|
7
|
+
relativePath: string;
|
|
8
|
+
relativeDirname: string;
|
|
9
|
+
dirname: string;
|
|
10
|
+
name: string;
|
|
11
|
+
extension: string;
|
|
12
|
+
size: number;
|
|
13
|
+
modifiedAt: Date;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
};
|
|
16
|
+
export declare const FileManagerStateSchema: z.ZodObject<{
|
|
17
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
18
|
+
started: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
starting: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
watching: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
failed: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
}, z.core.$loose>;
|
|
23
|
+
export declare const FileManagerOptionsSchema: z.ZodObject<{
|
|
24
|
+
name: z.ZodOptional<z.ZodString>;
|
|
25
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
26
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
+
exclude: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export declare const FileManagerEventsSchema: z.ZodObject<{
|
|
31
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
32
|
+
enabled: z.ZodTuple<[], null>;
|
|
33
|
+
'file:change': z.ZodTuple<[z.ZodObject<{
|
|
34
|
+
type: z.ZodEnum<{
|
|
35
|
+
add: "add";
|
|
36
|
+
delete: "delete";
|
|
37
|
+
change: "change";
|
|
38
|
+
}>;
|
|
39
|
+
path: z.ZodString;
|
|
40
|
+
}, z.core.$strip>], null>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
export type FileManagerState = z.infer<typeof FileManagerStateSchema>;
|
|
43
|
+
export type FileManagerOptions = z.infer<typeof FileManagerOptionsSchema>;
|
|
44
|
+
/**
|
|
45
|
+
* The FileManager feature creates a database like index of all of the files in the project,
|
|
46
|
+
* and provides metadata about these files, and also provides a way to watch for changes to the files.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* const fileManager = container.feature('fileManager')
|
|
51
|
+
* await fileManager.start()
|
|
52
|
+
*
|
|
53
|
+
* const fileIds = fileManager.fileIds
|
|
54
|
+
* const typescriptFiles = fileManager.matchFiles("**ts")
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare class FileManager<T extends FileManagerState = FileManagerState, K extends FileManagerOptions = FileManagerOptions> extends Feature<T, K> {
|
|
58
|
+
static shortcut: "features.fileManager";
|
|
59
|
+
static stateSchema: z.ZodObject<{
|
|
60
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
61
|
+
started: z.ZodOptional<z.ZodBoolean>;
|
|
62
|
+
starting: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
+
watching: z.ZodOptional<z.ZodBoolean>;
|
|
64
|
+
failed: z.ZodOptional<z.ZodBoolean>;
|
|
65
|
+
}, z.core.$loose>;
|
|
66
|
+
static optionsSchema: z.ZodObject<{
|
|
67
|
+
name: z.ZodOptional<z.ZodString>;
|
|
68
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
69
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
70
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
71
|
+
exclude: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
static eventsSchema: z.ZodObject<{
|
|
74
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
75
|
+
enabled: z.ZodTuple<[], null>;
|
|
76
|
+
'file:change': z.ZodTuple<[z.ZodObject<{
|
|
77
|
+
type: z.ZodEnum<{
|
|
78
|
+
add: "add";
|
|
79
|
+
delete: "delete";
|
|
80
|
+
change: "change";
|
|
81
|
+
}>;
|
|
82
|
+
path: z.ZodString;
|
|
83
|
+
}, z.core.$strip>], null>;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
files: State<Record<string, File>>;
|
|
86
|
+
/** Returns an array of all relative file paths indexed by the file manager. */
|
|
87
|
+
get fileIds(): string[];
|
|
88
|
+
/** Returns an array of all file metadata objects indexed by the file manager. */
|
|
89
|
+
get fileObjects(): File[];
|
|
90
|
+
/**
|
|
91
|
+
* Matches the file IDs against the pattern(s) provided
|
|
92
|
+
* @param {string | string[]} patterns - The patterns to match against the file IDs
|
|
93
|
+
* @returns {string[]} The file IDs that match the patterns
|
|
94
|
+
*/
|
|
95
|
+
match(patterns: string | string[]): string[];
|
|
96
|
+
/**
|
|
97
|
+
* Matches the file IDs against the pattern(s) provided and returns the file objects for each.
|
|
98
|
+
*
|
|
99
|
+
* @param {string | string[]} patterns - The patterns to match against the file IDs
|
|
100
|
+
* @returns {File[]} The file objects that match the patterns
|
|
101
|
+
*/
|
|
102
|
+
matchFiles(patterns: string | string[]): (File | undefined)[];
|
|
103
|
+
/**
|
|
104
|
+
* Returns the directory IDs for all of the files in the project.
|
|
105
|
+
*/
|
|
106
|
+
get directoryIds(): string[];
|
|
107
|
+
/** Returns an array of unique file extensions found across all indexed files. */
|
|
108
|
+
get uniqueExtensions(): string[];
|
|
109
|
+
/** Whether the file manager has completed its initial scan. */
|
|
110
|
+
get isStarted(): boolean;
|
|
111
|
+
/** Whether the file manager is currently performing its initial scan. */
|
|
112
|
+
get isStarting(): boolean;
|
|
113
|
+
/** Whether the file watcher is actively monitoring for changes. */
|
|
114
|
+
get isWatching(): boolean;
|
|
115
|
+
/** Returns the list of directories currently being watched. */
|
|
116
|
+
get watchedPaths(): string[];
|
|
117
|
+
/**
|
|
118
|
+
* Starts the file manager and scans the files in the project.
|
|
119
|
+
* @param {object} [options={}] - Options for the file manager
|
|
120
|
+
* @param {string | string[]} [options.exclude] - The patterns to exclude from the scan
|
|
121
|
+
* @returns {Promise<FileManager>} The file manager instance
|
|
122
|
+
*/
|
|
123
|
+
start(options?: {
|
|
124
|
+
exclude?: string | string[];
|
|
125
|
+
}): Promise<this>;
|
|
126
|
+
/**
|
|
127
|
+
* Attempts to load the file index from disk cache.
|
|
128
|
+
* Only uses cache when in a clean git repo (sha hasn't changed, no dirty files).
|
|
129
|
+
* @returns true if cache was loaded successfully, false otherwise
|
|
130
|
+
*/
|
|
131
|
+
/**
|
|
132
|
+
* Reads the current git SHA by reading .git/HEAD directly,
|
|
133
|
+
* avoiding the ~19ms cost of shelling out to `git rev-parse HEAD`.
|
|
134
|
+
*/
|
|
135
|
+
private readGitShaFast;
|
|
136
|
+
private loadFromCache;
|
|
137
|
+
/**
|
|
138
|
+
* Writes the current file index to disk cache, keyed by git sha.
|
|
139
|
+
* Stores directory mtimes alongside file data so the cache can be
|
|
140
|
+
* invalidated when files are added/removed without a new commit.
|
|
141
|
+
*/
|
|
142
|
+
private writeToCache;
|
|
143
|
+
/**
|
|
144
|
+
* Scans the files in the project and updates the file manager state.
|
|
145
|
+
* @param {object} [options={}] - Options for the file manager
|
|
146
|
+
* @param {string | string[]} [options.exclude] - The patterns to exclude from the scan
|
|
147
|
+
* @returns {Promise<FileManager>} The file manager instance
|
|
148
|
+
*/
|
|
149
|
+
scanFiles(options?: {
|
|
150
|
+
exclude?: string | string[];
|
|
151
|
+
}): Promise<this>;
|
|
152
|
+
watcher: FSWatcher | null;
|
|
153
|
+
/** Returns the directories and files currently being watched by chokidar. */
|
|
154
|
+
get watchedFiles(): Record<string, string[]>;
|
|
155
|
+
/**
|
|
156
|
+
* Watches directories for file changes. Can be called multiple times to add
|
|
157
|
+
* more directories to an existing watcher. Tracks all watched paths in state.
|
|
158
|
+
*
|
|
159
|
+
* When called without `paths`, watches the project's `directoryIds` (default behavior).
|
|
160
|
+
* When called with `paths`, watches only those specific directories/globs.
|
|
161
|
+
* Subsequent calls add to the existing watcher — they never replace what's already watched.
|
|
162
|
+
*
|
|
163
|
+
* @param {object} [options={}] - Options for the file manager
|
|
164
|
+
* @param {string | string[]} [options.paths] - Specific directories or globs to watch. Defaults to project directoryIds.
|
|
165
|
+
* @param {string | string[]} [options.exclude] - The patterns to exclude from the watch
|
|
166
|
+
* @returns {Promise<void>}
|
|
167
|
+
*/
|
|
168
|
+
watch(options?: {
|
|
169
|
+
paths?: string | string[];
|
|
170
|
+
exclude?: string | string[];
|
|
171
|
+
}): Promise<void>;
|
|
172
|
+
stopWatching(): Promise<void>;
|
|
173
|
+
updateFile(path: string): Promise<void>;
|
|
174
|
+
removeFile(path: string): Promise<void>;
|
|
175
|
+
}
|
|
176
|
+
export default FileManager;
|
|
177
|
+
//# sourceMappingURL=file-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-manager.d.ts","sourceRoot":"","sources":["../../../src/node/features/file-manager.ts"],"names":[],"mappings":"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"}
|