@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,236 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import cacache from "cacache";
|
|
3
|
+
import { Feature, type FeatureState } from "../feature.js";
|
|
4
|
+
export declare const DiskCacheOptionsSchema: z.ZodObject<{
|
|
5
|
+
name: z.ZodOptional<z.ZodString>;
|
|
6
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
7
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
encrypt: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
+
secret: z.ZodOptional<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>;
|
|
11
|
+
path: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export type DiskCacheOptions = z.infer<typeof DiskCacheOptionsSchema>;
|
|
14
|
+
/**
|
|
15
|
+
* File-backed key-value cache built on top of the cacache library (the same store
|
|
16
|
+
* that powers npm). Suitable for persisting arbitrary data including very large
|
|
17
|
+
* blobs when necessary, with optional encryption support.
|
|
18
|
+
*
|
|
19
|
+
* @extends Feature
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const diskCache = container.feature('diskCache', { path: '/tmp/cache' })
|
|
23
|
+
* await diskCache.set('greeting', 'Hello World')
|
|
24
|
+
* const value = await diskCache.get('greeting')
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare class DiskCache extends Feature<FeatureState, DiskCacheOptions> {
|
|
28
|
+
static shortcut: "features.diskCache";
|
|
29
|
+
static stateSchema: z.ZodObject<{
|
|
30
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
31
|
+
}, z.core.$loose>;
|
|
32
|
+
static optionsSchema: z.ZodObject<{
|
|
33
|
+
name: z.ZodOptional<z.ZodString>;
|
|
34
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
35
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
36
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
37
|
+
encrypt: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
secret: z.ZodOptional<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>;
|
|
39
|
+
path: z.ZodOptional<z.ZodString>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
/** Returns the underlying cacache instance configured with the cache directory path. */
|
|
42
|
+
get cache(): ReturnType<typeof this.create>;
|
|
43
|
+
/**
|
|
44
|
+
* Retrieve a file from the disk cache and save it to the local disk
|
|
45
|
+
* @param key - The cache key to retrieve
|
|
46
|
+
* @param outputPath - The local path where the file should be saved
|
|
47
|
+
* @param isBase64 - Whether the cached content is base64 encoded
|
|
48
|
+
* @returns Promise that resolves to the file data as Buffer
|
|
49
|
+
* @example
|
|
50
|
+
* ```typescript
|
|
51
|
+
* await diskCache.saveFile('myFile', './output/file.txt')
|
|
52
|
+
* await diskCache.saveFile('encodedImage', './images/photo.jpg', true)
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
saveFile(key: string, outputPath: string, isBase64?: boolean): Promise<Buffer | string>;
|
|
56
|
+
/**
|
|
57
|
+
* Ensure a key exists in the cache, setting it with the provided content if it doesn't exist
|
|
58
|
+
* @param key - The cache key to check/set
|
|
59
|
+
* @param content - The content to set if the key doesn't exist
|
|
60
|
+
* @returns Promise that resolves to the key
|
|
61
|
+
* @example
|
|
62
|
+
* ```typescript
|
|
63
|
+
* await diskCache.ensure('config', JSON.stringify(defaultConfig))
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
ensure(key: string, content: string): Promise<string>;
|
|
67
|
+
/**
|
|
68
|
+
* Copy a cached item from one key to another
|
|
69
|
+
* @param source - The source cache key
|
|
70
|
+
* @param destination - The destination cache key
|
|
71
|
+
* @param overwrite - Whether to overwrite if destination exists (default: false)
|
|
72
|
+
* @returns Promise that resolves to the destination key
|
|
73
|
+
* @throws Error if destination exists and overwrite is false
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* await diskCache.copy('original', 'backup')
|
|
77
|
+
* await diskCache.copy('file1', 'file2', true) // force overwrite
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
copy(source: string, destination: string, overwrite?: boolean): Promise<string>;
|
|
81
|
+
/**
|
|
82
|
+
* Move a cached item from one key to another (copy then delete source)
|
|
83
|
+
* @param source - The source cache key
|
|
84
|
+
* @param destination - The destination cache key
|
|
85
|
+
* @param overwrite - Whether to overwrite if destination exists (default: false)
|
|
86
|
+
* @returns Promise that resolves to the destination key
|
|
87
|
+
* @throws Error if destination exists and overwrite is false
|
|
88
|
+
* @example
|
|
89
|
+
* ```typescript
|
|
90
|
+
* await diskCache.move('temp', 'permanent')
|
|
91
|
+
* await diskCache.move('old_key', 'new_key', true) // force overwrite
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
move(source: string, destination: string, overwrite?: boolean): Promise<string>;
|
|
95
|
+
/**
|
|
96
|
+
* Check if a key exists in the cache
|
|
97
|
+
* @param key - The cache key to check
|
|
98
|
+
* @returns Promise that resolves to true if key exists, false otherwise
|
|
99
|
+
* @example
|
|
100
|
+
* ```typescript
|
|
101
|
+
* if (await diskCache.has('myKey')) {
|
|
102
|
+
* console.log('Key exists!')
|
|
103
|
+
* }
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
has(key: string): Promise<boolean>;
|
|
107
|
+
/**
|
|
108
|
+
* Retrieve a value from the cache
|
|
109
|
+
* @param key - The cache key to retrieve
|
|
110
|
+
* @param json - Whether to parse the value as JSON (default: false)
|
|
111
|
+
* @returns Promise that resolves to the cached value (string or parsed JSON)
|
|
112
|
+
* @example
|
|
113
|
+
* ```typescript
|
|
114
|
+
* const text = await diskCache.get('myText')
|
|
115
|
+
* const data = await diskCache.get('myData', true) // parse as JSON
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
get(key: string, json?: boolean): Promise<any>;
|
|
119
|
+
/**
|
|
120
|
+
* Store a value in the cache
|
|
121
|
+
* @param key - The cache key to store under
|
|
122
|
+
* @param value - The value to store (string, object, or any serializable data)
|
|
123
|
+
* @param meta - Optional metadata to associate with the cached item
|
|
124
|
+
* @returns Promise that resolves when the value is stored
|
|
125
|
+
* @example
|
|
126
|
+
* ```typescript
|
|
127
|
+
* await diskCache.set('myKey', 'Hello World')
|
|
128
|
+
* await diskCache.set('userData', { name: 'John', age: 30 })
|
|
129
|
+
* await diskCache.set('file', content, { size: 1024, type: 'image' })
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
set(key: string, value: any, meta?: any): Promise<any>;
|
|
133
|
+
/**
|
|
134
|
+
* Remove a cached item
|
|
135
|
+
* @param key - The cache key to remove
|
|
136
|
+
* @returns Promise that resolves when the item is removed
|
|
137
|
+
* @example
|
|
138
|
+
* ```typescript
|
|
139
|
+
* await diskCache.rm('obsoleteKey')
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
142
|
+
rm(key: string): Promise<any>;
|
|
143
|
+
/**
|
|
144
|
+
* Clear all cached items
|
|
145
|
+
* @param confirm - Must be set to true to confirm the operation
|
|
146
|
+
* @returns Promise that resolves to this instance for chaining
|
|
147
|
+
* @throws Error if confirm is not true
|
|
148
|
+
* @example
|
|
149
|
+
* ```typescript
|
|
150
|
+
* await diskCache.clearAll(true) // Must explicitly confirm
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
clearAll(confirm?: boolean): Promise<this>;
|
|
154
|
+
/**
|
|
155
|
+
* Get all cache keys
|
|
156
|
+
* @returns Promise that resolves to an array of all cache keys
|
|
157
|
+
* @example
|
|
158
|
+
* ```typescript
|
|
159
|
+
* const allKeys = await diskCache.keys()
|
|
160
|
+
* console.log(`Cache contains ${allKeys.length} items`)
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
163
|
+
keys(): Promise<string[]>;
|
|
164
|
+
/**
|
|
165
|
+
* List all cache keys (alias for keys())
|
|
166
|
+
* @returns Promise that resolves to an array of all cache keys
|
|
167
|
+
* @example
|
|
168
|
+
* ```typescript
|
|
169
|
+
* const keyList = await diskCache.listKeys()
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
listKeys(): Promise<string[]>;
|
|
173
|
+
/**
|
|
174
|
+
* Get encrypted cache operations interface
|
|
175
|
+
* Requires encryption to be enabled and a secret to be provided
|
|
176
|
+
* @returns Object with encrypted get/set operations
|
|
177
|
+
* @throws Error if encryption is not enabled or no secret is provided
|
|
178
|
+
* @example
|
|
179
|
+
* ```typescript
|
|
180
|
+
* // Initialize with encryption
|
|
181
|
+
* const cache = container.feature('diskCache', {
|
|
182
|
+
* encrypt: true,
|
|
183
|
+
* secret: Buffer.from('my-secret-key')
|
|
184
|
+
* })
|
|
185
|
+
*
|
|
186
|
+
* // Use encrypted operations
|
|
187
|
+
* await cache.securely.set('sensitive', 'secret data')
|
|
188
|
+
* const decrypted = await cache.securely.get('sensitive')
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
191
|
+
get securely(): {
|
|
192
|
+
set(name: string, payload: any, meta?: any): Promise<any>;
|
|
193
|
+
get(name: string): Promise<any>;
|
|
194
|
+
};
|
|
195
|
+
_cache: ReturnType<typeof this.create>;
|
|
196
|
+
/**
|
|
197
|
+
* Create a cacache instance with the specified path
|
|
198
|
+
* @param path - Optional cache directory path (defaults to options.path or ~/.cache/luca/disk-cache-{cwdHash})
|
|
199
|
+
* @returns Configured cacache instance with all methods bound to the path
|
|
200
|
+
* @example
|
|
201
|
+
* ```typescript
|
|
202
|
+
* const customCache = diskCache.create('/custom/cache/path')
|
|
203
|
+
* ```
|
|
204
|
+
*/
|
|
205
|
+
create(path?: string): {
|
|
206
|
+
cachePath: string;
|
|
207
|
+
ls: ((...ts: any[]) => any) & {
|
|
208
|
+
stream: (...ts: any[]) => any;
|
|
209
|
+
};
|
|
210
|
+
get: ((...ts: any[]) => any) & {
|
|
211
|
+
stream: (...ts: any[]) => any;
|
|
212
|
+
byDigest: (...ts: any[]) => any;
|
|
213
|
+
copy: (...ts: any[]) => any;
|
|
214
|
+
info: (...ts: any[]) => any;
|
|
215
|
+
hasContent: (...ts: any[]) => any;
|
|
216
|
+
};
|
|
217
|
+
put: ((...ts: any[]) => any) & {
|
|
218
|
+
stream: (...ts: any[]) => any;
|
|
219
|
+
};
|
|
220
|
+
rm: ((...ts: any[]) => any) & {
|
|
221
|
+
all: (...ts: any[]) => any;
|
|
222
|
+
entry: (...ts: any[]) => any;
|
|
223
|
+
content: (...ts: any[]) => any;
|
|
224
|
+
};
|
|
225
|
+
tmp: {
|
|
226
|
+
mkdir: (...ts: any[]) => any;
|
|
227
|
+
withTmp: (...ts: any[]) => any;
|
|
228
|
+
};
|
|
229
|
+
verify: ((...ts: any[]) => any) & {
|
|
230
|
+
lastRun: (...ts: any[]) => any;
|
|
231
|
+
};
|
|
232
|
+
clearMemoized(): Record<string, cacache.CacheObject>;
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
export default DiskCache;
|
|
236
|
+
//# sourceMappingURL=disk-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disk-cache.d.ts","sourceRoot":"","sources":["../../../src/node/features/disk-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAK3D,eAAO,MAAM,sBAAsB;;;;;;;;iBAOjC,CAAA;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAErE;;;;;;;;;;;;GAYG;AACH,qBAAa,SAAU,SAAQ,OAAO,CAAC,YAAY,EAAC,gBAAgB,CAAC;IACnE,OAAgB,QAAQ,EAAG,oBAAoB,CAAS;IACxD,OAAgB,WAAW;;sBAAqB;IAChD,OAAgB,aAAa;;;;;;;;sBAAyB;IAGtD,wFAAwF;IACxF,IAAI,KAAK,IAAI,UAAU,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,CAU1C;IAED;;;;;;;;;;;OAWG;IACG,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,UAAQ,GAAG,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;IAQ3F;;;;;;;;;OASG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAU3D;;;;;;;;;;;;OAYG;IACG,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,GAAE,OAAe,GAAG,OAAO,CAAC,MAAM,CAAC;IAU5F;;;;;;;;;;;;OAYG;IACG,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,GAAE,OAAe,GAAG,OAAO,CAAC,MAAM,CAAC;IAW5F;;;;;;;;;;OAUG;IACG,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIxC;;;;;;;;;;OAUG;IACG,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,UAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAgBlD;;;;;;;;;;;;OAYG;IACG,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAgB5D;;;;;;;;OAQG;IACG,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAInC;;;;;;;;;OASG;IACG,QAAQ,CAAC,OAAO,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ9C;;;;;;;;OAQG;IACG,IAAI,IAAK,OAAO,CAAC,MAAM,EAAE,CAAC;IAIhC;;;;;;;OAOG;IACG,QAAQ,IAAK,OAAO,CAAC,MAAM,EAAE,CAAC;IAIpC;;;;;;;;;;;;;;;;;OAiBG;IACH,IAAI,QAAQ,IAAI;QAAE,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAAC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;KAAE,CA2C7G;IAED,MAAM,EAAG,UAAU,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAA;IAEvC;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CrB;AAED,eAAe,SAAS,CAAC"}
|