@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,194 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Feature } from '../feature.js';
|
|
3
|
+
import type { GoogleAuth } from './google-auth.js';
|
|
4
|
+
export type CalendarInfo = {
|
|
5
|
+
id: string;
|
|
6
|
+
summary: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
timeZone: string;
|
|
9
|
+
primary?: boolean;
|
|
10
|
+
backgroundColor?: string;
|
|
11
|
+
accessRole: string;
|
|
12
|
+
};
|
|
13
|
+
export type CalendarEvent = {
|
|
14
|
+
id: string;
|
|
15
|
+
summary: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
location?: string;
|
|
18
|
+
start: {
|
|
19
|
+
dateTime?: string;
|
|
20
|
+
date?: string;
|
|
21
|
+
timeZone?: string;
|
|
22
|
+
};
|
|
23
|
+
end: {
|
|
24
|
+
dateTime?: string;
|
|
25
|
+
date?: string;
|
|
26
|
+
timeZone?: string;
|
|
27
|
+
};
|
|
28
|
+
status: string;
|
|
29
|
+
htmlLink: string;
|
|
30
|
+
creator?: {
|
|
31
|
+
email?: string;
|
|
32
|
+
displayName?: string;
|
|
33
|
+
};
|
|
34
|
+
organizer?: {
|
|
35
|
+
email?: string;
|
|
36
|
+
displayName?: string;
|
|
37
|
+
};
|
|
38
|
+
attendees?: Array<{
|
|
39
|
+
email?: string;
|
|
40
|
+
displayName?: string;
|
|
41
|
+
responseStatus?: string;
|
|
42
|
+
}>;
|
|
43
|
+
recurrence?: string[];
|
|
44
|
+
};
|
|
45
|
+
export type CalendarEventList = {
|
|
46
|
+
events: CalendarEvent[];
|
|
47
|
+
nextPageToken?: string;
|
|
48
|
+
timeZone?: string;
|
|
49
|
+
};
|
|
50
|
+
export type ListEventsOptions = {
|
|
51
|
+
calendarId?: string;
|
|
52
|
+
timeMin?: string;
|
|
53
|
+
timeMax?: string;
|
|
54
|
+
maxResults?: number;
|
|
55
|
+
query?: string;
|
|
56
|
+
orderBy?: 'startTime' | 'updated';
|
|
57
|
+
pageToken?: string;
|
|
58
|
+
singleEvents?: boolean;
|
|
59
|
+
};
|
|
60
|
+
export declare const GoogleCalendarStateSchema: z.ZodObject<{
|
|
61
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
62
|
+
lastCalendarId: z.ZodOptional<z.ZodString>;
|
|
63
|
+
lastEventCount: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
lastError: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, z.core.$loose>;
|
|
66
|
+
export type GoogleCalendarState = z.infer<typeof GoogleCalendarStateSchema>;
|
|
67
|
+
export declare const GoogleCalendarOptionsSchema: 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
|
+
auth: z.ZodOptional<z.ZodAny>;
|
|
73
|
+
defaultCalendarId: z.ZodOptional<z.ZodString>;
|
|
74
|
+
timeZone: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
export type GoogleCalendarOptions = z.infer<typeof GoogleCalendarOptionsSchema>;
|
|
77
|
+
export declare const GoogleCalendarEventsSchema: z.ZodObject<{
|
|
78
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
79
|
+
enabled: z.ZodTuple<[], null>;
|
|
80
|
+
eventsFetched: z.ZodTuple<[z.ZodNumber], null>;
|
|
81
|
+
error: z.ZodTuple<[z.ZodAny], null>;
|
|
82
|
+
}, z.core.$strip>;
|
|
83
|
+
/**
|
|
84
|
+
* Google Calendar feature for listing calendars and reading events.
|
|
85
|
+
*
|
|
86
|
+
* Depends on the googleAuth feature for authentication. Creates a Calendar v3 API
|
|
87
|
+
* client lazily. Provides convenience methods for today's events and upcoming days.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* const calendar = container.feature('googleCalendar')
|
|
92
|
+
*
|
|
93
|
+
* // List all calendars
|
|
94
|
+
* const calendars = await calendar.listCalendars()
|
|
95
|
+
*
|
|
96
|
+
* // Get today's events
|
|
97
|
+
* const today = await calendar.getToday()
|
|
98
|
+
*
|
|
99
|
+
* // Get next 7 days of events
|
|
100
|
+
* const upcoming = await calendar.getUpcoming(7)
|
|
101
|
+
*
|
|
102
|
+
* // Search events
|
|
103
|
+
* const meetings = await calendar.searchEvents('standup')
|
|
104
|
+
*
|
|
105
|
+
* // List events in a time range
|
|
106
|
+
* const events = await calendar.listEvents({
|
|
107
|
+
* timeMin: '2026-03-01T00:00:00Z',
|
|
108
|
+
* timeMax: '2026-03-31T23:59:59Z',
|
|
109
|
+
* })
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
export declare class GoogleCalendar extends Feature<GoogleCalendarState, GoogleCalendarOptions> {
|
|
113
|
+
static shortcut: "features.googleCalendar";
|
|
114
|
+
static stateSchema: z.ZodObject<{
|
|
115
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
116
|
+
lastCalendarId: z.ZodOptional<z.ZodString>;
|
|
117
|
+
lastEventCount: z.ZodOptional<z.ZodNumber>;
|
|
118
|
+
lastError: z.ZodOptional<z.ZodString>;
|
|
119
|
+
}, z.core.$loose>;
|
|
120
|
+
static optionsSchema: z.ZodObject<{
|
|
121
|
+
name: z.ZodOptional<z.ZodString>;
|
|
122
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
123
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
124
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
125
|
+
auth: z.ZodOptional<z.ZodAny>;
|
|
126
|
+
defaultCalendarId: z.ZodOptional<z.ZodString>;
|
|
127
|
+
timeZone: z.ZodOptional<z.ZodString>;
|
|
128
|
+
}, z.core.$strip>;
|
|
129
|
+
static eventsSchema: z.ZodObject<{
|
|
130
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
131
|
+
enabled: z.ZodTuple<[], null>;
|
|
132
|
+
eventsFetched: z.ZodTuple<[z.ZodNumber], null>;
|
|
133
|
+
error: z.ZodTuple<[z.ZodAny], null>;
|
|
134
|
+
}, z.core.$strip>;
|
|
135
|
+
private _calendar?;
|
|
136
|
+
get initialState(): GoogleCalendarState;
|
|
137
|
+
/** Access the google-auth feature lazily. */
|
|
138
|
+
get auth(): GoogleAuth;
|
|
139
|
+
/** Default calendar ID from options or 'primary'. */
|
|
140
|
+
get defaultCalendarId(): string;
|
|
141
|
+
/** Get or create the Calendar v3 API client. */
|
|
142
|
+
private getCalendar;
|
|
143
|
+
/**
|
|
144
|
+
* List all calendars accessible to the authenticated user.
|
|
145
|
+
*
|
|
146
|
+
* @returns Array of calendar info objects
|
|
147
|
+
*/
|
|
148
|
+
listCalendars(): Promise<CalendarInfo[]>;
|
|
149
|
+
/**
|
|
150
|
+
* List events from a calendar within a time range.
|
|
151
|
+
*
|
|
152
|
+
* @param options - Filtering options including timeMin, timeMax, query, maxResults
|
|
153
|
+
* @returns Events array with optional nextPageToken and timeZone
|
|
154
|
+
*/
|
|
155
|
+
listEvents(options?: ListEventsOptions): Promise<CalendarEventList>;
|
|
156
|
+
/**
|
|
157
|
+
* Get today's events from a calendar.
|
|
158
|
+
*
|
|
159
|
+
* @param calendarId - Calendar ID (defaults to options.defaultCalendarId or 'primary')
|
|
160
|
+
* @returns Array of today's calendar events
|
|
161
|
+
*/
|
|
162
|
+
getToday(calendarId?: string): Promise<CalendarEvent[]>;
|
|
163
|
+
/**
|
|
164
|
+
* Get upcoming events for the next N days.
|
|
165
|
+
*
|
|
166
|
+
* @param days - Number of days to look ahead (default: 7)
|
|
167
|
+
* @param calendarId - Calendar ID
|
|
168
|
+
* @returns Array of upcoming calendar events
|
|
169
|
+
*/
|
|
170
|
+
getUpcoming(days?: number, calendarId?: string): Promise<CalendarEvent[]>;
|
|
171
|
+
/**
|
|
172
|
+
* Get a single event by ID.
|
|
173
|
+
*
|
|
174
|
+
* @param eventId - The event ID
|
|
175
|
+
* @param calendarId - Calendar ID
|
|
176
|
+
* @returns The calendar event
|
|
177
|
+
*/
|
|
178
|
+
getEvent(eventId: string, calendarId?: string): Promise<CalendarEvent>;
|
|
179
|
+
/**
|
|
180
|
+
* Search events by text query across event summaries, descriptions, and locations.
|
|
181
|
+
*
|
|
182
|
+
* @param query - Freetext search term
|
|
183
|
+
* @param options - Additional listing options (timeMin, timeMax, calendarId, etc.)
|
|
184
|
+
* @returns Array of matching calendar events
|
|
185
|
+
*/
|
|
186
|
+
searchEvents(query: string, options?: ListEventsOptions): Promise<CalendarEvent[]>;
|
|
187
|
+
}
|
|
188
|
+
declare module '../../feature' {
|
|
189
|
+
interface AvailableFeatures {
|
|
190
|
+
googleCalendar: typeof GoogleCalendar;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
export default GoogleCalendar;
|
|
194
|
+
//# sourceMappingURL=google-calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-calendar.d.ts","sourceRoot":"","sources":["../../../src/node/features/google-calendar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE;QAAE,Q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EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAa5E;;;;;;OAMG;IACG,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;CAI7F;AA+BD,OAAO,QAAQ,eAAe,CAAC;IAC7B,UAAU,iBAAiB;QACzB,cAAc,EAAE,OAAO,cAAc,CAAA;KACtC;CACF;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Feature } from '../feature.js';
|
|
3
|
+
import { type docs_v1 } from 'googleapis';
|
|
4
|
+
import type { GoogleAuth } from './google-auth.js';
|
|
5
|
+
import type { GoogleDrive, DriveFile } from './google-drive.js';
|
|
6
|
+
export declare const GoogleDocsStateSchema: z.ZodObject<{
|
|
7
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
8
|
+
lastDocId: z.ZodOptional<z.ZodString>;
|
|
9
|
+
lastDocTitle: z.ZodOptional<z.ZodString>;
|
|
10
|
+
lastError: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$loose>;
|
|
12
|
+
export type GoogleDocsState = z.infer<typeof GoogleDocsStateSchema>;
|
|
13
|
+
export declare const GoogleDocsOptionsSchema: z.ZodObject<{
|
|
14
|
+
name: z.ZodOptional<z.ZodString>;
|
|
15
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
16
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
+
auth: z.ZodOptional<z.ZodAny>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export type GoogleDocsOptions = z.infer<typeof GoogleDocsOptionsSchema>;
|
|
21
|
+
export declare const GoogleDocsEventsSchema: z.ZodObject<{
|
|
22
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
23
|
+
enabled: z.ZodTuple<[], null>;
|
|
24
|
+
documentFetched: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
25
|
+
error: z.ZodTuple<[z.ZodAny], null>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
/**
|
|
28
|
+
* Google Docs feature for reading documents and converting them to Markdown.
|
|
29
|
+
*
|
|
30
|
+
* Depends on googleAuth for authentication and optionally googleDrive for listing docs.
|
|
31
|
+
* The markdown converter handles headings, text formatting, links, lists, tables, and images.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* const docs = container.feature('googleDocs')
|
|
36
|
+
*
|
|
37
|
+
* // Get a doc as markdown
|
|
38
|
+
* const markdown = await docs.getAsMarkdown('1abc_document_id')
|
|
39
|
+
*
|
|
40
|
+
* // Save to file
|
|
41
|
+
* await docs.saveAsMarkdown('1abc_document_id', './output/doc.md')
|
|
42
|
+
*
|
|
43
|
+
* // List all Google Docs in Drive
|
|
44
|
+
* const allDocs = await docs.listDocs()
|
|
45
|
+
*
|
|
46
|
+
* // Get raw document structure
|
|
47
|
+
* const rawDoc = await docs.getDocument('1abc_document_id')
|
|
48
|
+
*
|
|
49
|
+
* // Plain text extraction
|
|
50
|
+
* const text = await docs.getAsText('1abc_document_id')
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare class GoogleDocs extends Feature<GoogleDocsState, GoogleDocsOptions> {
|
|
54
|
+
static shortcut: "features.googleDocs";
|
|
55
|
+
static stateSchema: z.ZodObject<{
|
|
56
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
57
|
+
lastDocId: z.ZodOptional<z.ZodString>;
|
|
58
|
+
lastDocTitle: z.ZodOptional<z.ZodString>;
|
|
59
|
+
lastError: z.ZodOptional<z.ZodString>;
|
|
60
|
+
}, z.core.$loose>;
|
|
61
|
+
static optionsSchema: z.ZodObject<{
|
|
62
|
+
name: z.ZodOptional<z.ZodString>;
|
|
63
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
64
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
65
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
66
|
+
auth: z.ZodOptional<z.ZodAny>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
static eventsSchema: z.ZodObject<{
|
|
69
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
70
|
+
enabled: z.ZodTuple<[], null>;
|
|
71
|
+
documentFetched: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
72
|
+
error: z.ZodTuple<[z.ZodAny], null>;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
private _docs?;
|
|
75
|
+
get initialState(): GoogleDocsState;
|
|
76
|
+
/** Access the google-auth feature lazily. */
|
|
77
|
+
get auth(): GoogleAuth;
|
|
78
|
+
/** Access the google-drive feature lazily. */
|
|
79
|
+
get drive(): GoogleDrive;
|
|
80
|
+
/** Get or create the Docs v1 API client. */
|
|
81
|
+
private getDocs;
|
|
82
|
+
/**
|
|
83
|
+
* Get the raw document structure from the Docs API.
|
|
84
|
+
*
|
|
85
|
+
* @param documentId - The Google Docs document ID
|
|
86
|
+
* @returns Full document JSON including body, lists, inlineObjects, etc.
|
|
87
|
+
*/
|
|
88
|
+
getDocument(documentId: string): Promise<docs_v1.Schema$Document>;
|
|
89
|
+
/**
|
|
90
|
+
* Read a Google Doc and convert it to Markdown.
|
|
91
|
+
*
|
|
92
|
+
* Handles headings, bold/italic/strikethrough, links, code fonts, ordered/unordered
|
|
93
|
+
* lists with nesting, tables, images, and section breaks.
|
|
94
|
+
*
|
|
95
|
+
* @param documentId - The Google Docs document ID
|
|
96
|
+
* @returns Markdown string representation of the document
|
|
97
|
+
*/
|
|
98
|
+
getAsMarkdown(documentId: string): Promise<string>;
|
|
99
|
+
/**
|
|
100
|
+
* Read a Google Doc as plain text (strips all formatting).
|
|
101
|
+
*
|
|
102
|
+
* @param documentId - The Google Docs document ID
|
|
103
|
+
*/
|
|
104
|
+
getAsText(documentId: string): Promise<string>;
|
|
105
|
+
/**
|
|
106
|
+
* Download a Google Doc as Markdown and save to a local file.
|
|
107
|
+
*
|
|
108
|
+
* @param documentId - The Google Docs document ID
|
|
109
|
+
* @param localPath - Local file path (resolved relative to container cwd)
|
|
110
|
+
* @returns Absolute path of the saved file
|
|
111
|
+
*/
|
|
112
|
+
saveAsMarkdown(documentId: string, localPath: string): Promise<string>;
|
|
113
|
+
/**
|
|
114
|
+
* List Google Docs in Drive (filters by Docs MIME type).
|
|
115
|
+
*
|
|
116
|
+
* @param query - Optional additional Drive search query
|
|
117
|
+
* @param options - Pagination options
|
|
118
|
+
* @returns Array of Google Docs as DriveFile objects
|
|
119
|
+
*/
|
|
120
|
+
listDocs(query?: string, options?: {
|
|
121
|
+
pageSize?: number;
|
|
122
|
+
pageToken?: string;
|
|
123
|
+
}): Promise<DriveFile[]>;
|
|
124
|
+
/**
|
|
125
|
+
* Search for Google Docs by name or content.
|
|
126
|
+
*
|
|
127
|
+
* @param term - Search term
|
|
128
|
+
* @returns Array of matching Google Docs as DriveFile objects
|
|
129
|
+
*/
|
|
130
|
+
searchDocs(term: string): Promise<DriveFile[]>;
|
|
131
|
+
}
|
|
132
|
+
declare module '../../feature' {
|
|
133
|
+
interface AvailableFeatures {
|
|
134
|
+
googleDocs: typeof GoogleDocs;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
export default GoogleDocs;
|
|
138
|
+
//# sourceMappingURL=google-docs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-docs.d.ts","sourceRoot":"","sources":["../../../src/node/features/google-docs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAU,KAAK,OAAO,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAk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Q,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAOzG;;;;;OAKG;IACG,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;CAMrD;AAkOD,OAAO,QAAQ,eAAe,CAAC;IAC7B,UAAU,iBAAiB;QACzB,UAAU,EAAE,OAAO,UAAU,CAAA;KAC9B;CACF;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Feature } from '../feature.js';
|
|
3
|
+
import type { GoogleAuth } from './google-auth.js';
|
|
4
|
+
export type DriveFile = {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
mimeType: string;
|
|
8
|
+
size?: string;
|
|
9
|
+
createdTime?: string;
|
|
10
|
+
modifiedTime?: string;
|
|
11
|
+
parents?: string[];
|
|
12
|
+
webViewLink?: string;
|
|
13
|
+
iconLink?: string;
|
|
14
|
+
owners?: Array<{
|
|
15
|
+
displayName?: string | null;
|
|
16
|
+
emailAddress?: string | null;
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
19
|
+
export type DriveFileList = {
|
|
20
|
+
files: DriveFile[];
|
|
21
|
+
nextPageToken?: string;
|
|
22
|
+
};
|
|
23
|
+
export type DriveBrowseResult = {
|
|
24
|
+
folder: DriveFile;
|
|
25
|
+
files: DriveFile[];
|
|
26
|
+
folders: DriveFile[];
|
|
27
|
+
nextPageToken?: string;
|
|
28
|
+
};
|
|
29
|
+
export type ListFilesOptions = {
|
|
30
|
+
pageSize?: number;
|
|
31
|
+
pageToken?: string;
|
|
32
|
+
orderBy?: string;
|
|
33
|
+
fields?: string;
|
|
34
|
+
corpora?: 'user' | 'drive' | 'allDrives';
|
|
35
|
+
};
|
|
36
|
+
export type SearchOptions = ListFilesOptions & {
|
|
37
|
+
mimeType?: string;
|
|
38
|
+
inFolder?: string;
|
|
39
|
+
};
|
|
40
|
+
export type SharedDrive = {
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
colorRgb?: string;
|
|
44
|
+
};
|
|
45
|
+
export declare const GoogleDriveStateSchema: z.ZodObject<{
|
|
46
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
47
|
+
lastQuery: z.ZodOptional<z.ZodString>;
|
|
48
|
+
lastResultCount: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
lastError: z.ZodOptional<z.ZodString>;
|
|
50
|
+
}, z.core.$loose>;
|
|
51
|
+
export type GoogleDriveState = z.infer<typeof GoogleDriveStateSchema>;
|
|
52
|
+
export declare const GoogleDriveOptionsSchema: z.ZodObject<{
|
|
53
|
+
name: z.ZodOptional<z.ZodString>;
|
|
54
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
55
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
56
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
57
|
+
auth: z.ZodOptional<z.ZodAny>;
|
|
58
|
+
defaultCorpora: z.ZodOptional<z.ZodEnum<{
|
|
59
|
+
user: "user";
|
|
60
|
+
drive: "drive";
|
|
61
|
+
allDrives: "allDrives";
|
|
62
|
+
}>>;
|
|
63
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
export type GoogleDriveOptions = z.infer<typeof GoogleDriveOptionsSchema>;
|
|
66
|
+
export declare const GoogleDriveEventsSchema: z.ZodObject<{
|
|
67
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
68
|
+
enabled: z.ZodTuple<[], null>;
|
|
69
|
+
filesFetched: z.ZodTuple<[z.ZodNumber], null>;
|
|
70
|
+
fileDownloaded: z.ZodTuple<[z.ZodString], null>;
|
|
71
|
+
error: z.ZodTuple<[z.ZodAny], null>;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
/**
|
|
74
|
+
* Google Drive feature for listing, searching, browsing, and downloading files.
|
|
75
|
+
*
|
|
76
|
+
* Depends on the googleAuth feature for authentication. Creates a Drive v3 API
|
|
77
|
+
* client lazily and passes the auth client from googleAuth.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```typescript
|
|
81
|
+
* const drive = container.feature('googleDrive')
|
|
82
|
+
*
|
|
83
|
+
* // List recent files
|
|
84
|
+
* const { files } = await drive.listFiles()
|
|
85
|
+
*
|
|
86
|
+
* // Search for documents
|
|
87
|
+
* const { files: docs } = await drive.search('quarterly report', { mimeType: 'application/pdf' })
|
|
88
|
+
*
|
|
89
|
+
* // Browse a folder
|
|
90
|
+
* const contents = await drive.browse('folder-id-here')
|
|
91
|
+
*
|
|
92
|
+
* // Download a file to disk
|
|
93
|
+
* await drive.downloadTo('file-id', './downloads/report.pdf')
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
export declare class GoogleDrive extends Feature<GoogleDriveState, GoogleDriveOptions> {
|
|
97
|
+
static shortcut: "features.googleDrive";
|
|
98
|
+
static stateSchema: z.ZodObject<{
|
|
99
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
100
|
+
lastQuery: z.ZodOptional<z.ZodString>;
|
|
101
|
+
lastResultCount: z.ZodOptional<z.ZodNumber>;
|
|
102
|
+
lastError: z.ZodOptional<z.ZodString>;
|
|
103
|
+
}, z.core.$loose>;
|
|
104
|
+
static optionsSchema: z.ZodObject<{
|
|
105
|
+
name: z.ZodOptional<z.ZodString>;
|
|
106
|
+
_cacheKey: z.ZodOptional<z.ZodString>;
|
|
107
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
108
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
auth: z.ZodOptional<z.ZodAny>;
|
|
110
|
+
defaultCorpora: z.ZodOptional<z.ZodEnum<{
|
|
111
|
+
user: "user";
|
|
112
|
+
drive: "drive";
|
|
113
|
+
allDrives: "allDrives";
|
|
114
|
+
}>>;
|
|
115
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
static eventsSchema: z.ZodObject<{
|
|
118
|
+
stateChange: z.ZodTuple<[z.ZodAny], null>;
|
|
119
|
+
enabled: z.ZodTuple<[], null>;
|
|
120
|
+
filesFetched: z.ZodTuple<[z.ZodNumber], null>;
|
|
121
|
+
fileDownloaded: z.ZodTuple<[z.ZodString], null>;
|
|
122
|
+
error: z.ZodTuple<[z.ZodAny], null>;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
private _drive?;
|
|
125
|
+
get initialState(): GoogleDriveState;
|
|
126
|
+
/** Access the google-auth feature lazily. */
|
|
127
|
+
get auth(): GoogleAuth;
|
|
128
|
+
/** Get or create the Drive v3 API client. */
|
|
129
|
+
private getDrive;
|
|
130
|
+
/**
|
|
131
|
+
* List files in the user's Drive with an optional query filter.
|
|
132
|
+
*
|
|
133
|
+
* @param query - Drive search query (e.g. "name contains 'report'", "mimeType='application/pdf'")
|
|
134
|
+
* @param options - Pagination and filtering options
|
|
135
|
+
* @returns Files array and optional nextPageToken
|
|
136
|
+
*/
|
|
137
|
+
listFiles(query?: string, options?: ListFilesOptions): Promise<DriveFileList>;
|
|
138
|
+
/**
|
|
139
|
+
* List files within a specific folder.
|
|
140
|
+
*
|
|
141
|
+
* @param folderId - The Drive folder ID
|
|
142
|
+
* @param options - Pagination and filtering options
|
|
143
|
+
*/
|
|
144
|
+
listFolder(folderId: string, options?: ListFilesOptions): Promise<DriveFileList>;
|
|
145
|
+
/**
|
|
146
|
+
* Browse a folder's contents, separating files from subfolders.
|
|
147
|
+
*
|
|
148
|
+
* @param folderId - Folder ID to browse (defaults to 'root')
|
|
149
|
+
* @returns Folder metadata, child files, and child folders
|
|
150
|
+
*/
|
|
151
|
+
browse(folderId?: string): Promise<DriveBrowseResult>;
|
|
152
|
+
/**
|
|
153
|
+
* Search files by name, content, or MIME type.
|
|
154
|
+
*
|
|
155
|
+
* @param term - Search term to look for in file names and content
|
|
156
|
+
* @param options - Additional search options like mimeType filter or folder restriction
|
|
157
|
+
*/
|
|
158
|
+
search(term: string, options?: SearchOptions): Promise<DriveFileList>;
|
|
159
|
+
/**
|
|
160
|
+
* Get file metadata by file ID.
|
|
161
|
+
*
|
|
162
|
+
* @param fileId - The Drive file ID
|
|
163
|
+
* @param fields - Specific fields to request (defaults to common fields)
|
|
164
|
+
*/
|
|
165
|
+
getFile(fileId: string, fields?: string): Promise<DriveFile>;
|
|
166
|
+
/**
|
|
167
|
+
* Download a file's content as a Buffer.
|
|
168
|
+
* Uses alt=media for binary download of non-Google files.
|
|
169
|
+
*
|
|
170
|
+
* @param fileId - The Drive file ID
|
|
171
|
+
*/
|
|
172
|
+
download(fileId: string): Promise<Buffer>;
|
|
173
|
+
/**
|
|
174
|
+
* Download a file and save it to a local path.
|
|
175
|
+
*
|
|
176
|
+
* @param fileId - The Drive file ID
|
|
177
|
+
* @param localPath - Local file path (resolved relative to container cwd)
|
|
178
|
+
* @returns Absolute path of the saved file
|
|
179
|
+
*/
|
|
180
|
+
downloadTo(fileId: string, localPath: string): Promise<string>;
|
|
181
|
+
/**
|
|
182
|
+
* Export a Google Workspace file (Docs, Sheets, Slides) to a given MIME type.
|
|
183
|
+
* Uses the Files.export endpoint.
|
|
184
|
+
*
|
|
185
|
+
* @param fileId - The Drive file ID of a Google Workspace document
|
|
186
|
+
* @param mimeType - Target MIME type (e.g. 'text/plain', 'application/pdf', 'text/csv')
|
|
187
|
+
*/
|
|
188
|
+
exportFile(fileId: string, mimeType: string): Promise<Buffer>;
|
|
189
|
+
/**
|
|
190
|
+
* List all shared drives the user has access to.
|
|
191
|
+
*
|
|
192
|
+
* @returns Array of shared drive objects
|
|
193
|
+
*/
|
|
194
|
+
listDrives(): Promise<SharedDrive[]>;
|
|
195
|
+
}
|
|
196
|
+
declare module '../../feature' {
|
|
197
|
+
interface AvailableFeatures {
|
|
198
|
+
googleDrive: typeof GoogleDrive;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
export default GoogleDrive;
|
|
202
|
+
//# sourceMappingURL=google-drive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-drive.d.ts","sourceRoot":"","sources":["../../../src/node/features/google-drive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CAAA;CAC9E,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,SAAS,EAAE,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,SAAS,CAAA;IACjB,KAAK,EAAE,SAAS,EAAE,CAAA;IAClB,OAAO,EAAE,SAAS,EAAE,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAA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