@soederpop/luca 0.0.2
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 +71 -0
- package/README.md +78 -0
- package/bun.lock +2928 -0
- package/bunfig.toml +3 -0
- package/commands/audit-docs.ts +740 -0
- package/commands/build-scaffolds.ts +154 -0
- package/commands/generate-api-docs.ts +114 -0
- package/commands/update-introspection.ts +67 -0
- package/docs/CLI.md +335 -0
- package/docs/README.md +88 -0
- package/docs/TABLE-OF-CONTENTS.md +157 -0
- package/docs/apis/clients/elevenlabs.md +84 -0
- package/docs/apis/clients/graph.md +56 -0
- package/docs/apis/clients/openai.md +69 -0
- package/docs/apis/clients/rest.md +41 -0
- package/docs/apis/clients/websocket.md +107 -0
- package/docs/apis/features/agi/assistant.md +471 -0
- package/docs/apis/features/agi/assistants-manager.md +154 -0
- package/docs/apis/features/agi/claude-code.md +602 -0
- package/docs/apis/features/agi/conversation-history.md +352 -0
- package/docs/apis/features/agi/conversation.md +333 -0
- package/docs/apis/features/agi/docs-reader.md +121 -0
- package/docs/apis/features/agi/openai-codex.md +318 -0
- package/docs/apis/features/agi/openapi.md +138 -0
- package/docs/apis/features/agi/semantic-search.md +387 -0
- package/docs/apis/features/agi/skills-library.md +216 -0
- package/docs/apis/features/node/container-link.md +133 -0
- package/docs/apis/features/node/content-db.md +313 -0
- package/docs/apis/features/node/disk-cache.md +379 -0
- package/docs/apis/features/node/dns.md +651 -0
- package/docs/apis/features/node/docker.md +705 -0
- package/docs/apis/features/node/downloader.md +81 -0
- package/docs/apis/features/node/esbuild.md +59 -0
- package/docs/apis/features/node/file-manager.md +182 -0
- package/docs/apis/features/node/fs.md +581 -0
- package/docs/apis/features/node/git.md +330 -0
- package/docs/apis/features/node/google-auth.md +174 -0
- package/docs/apis/features/node/google-calendar.md +187 -0
- package/docs/apis/features/node/google-docs.md +151 -0
- package/docs/apis/features/node/google-drive.md +225 -0
- package/docs/apis/features/node/google-sheets.md +179 -0
- package/docs/apis/features/node/grep.md +290 -0
- package/docs/apis/features/node/helpers.md +135 -0
- package/docs/apis/features/node/ink.md +334 -0
- package/docs/apis/features/node/ipc-socket.md +260 -0
- package/docs/apis/features/node/json-tree.md +86 -0
- package/docs/apis/features/node/launcher-app-command-listener.md +145 -0
- package/docs/apis/features/node/networking.md +281 -0
- package/docs/apis/features/node/nlp.md +133 -0
- package/docs/apis/features/node/opener.md +97 -0
- package/docs/apis/features/node/os.md +118 -0
- package/docs/apis/features/node/package-finder.md +402 -0
- package/docs/apis/features/node/postgres.md +212 -0
- package/docs/apis/features/node/proc.md +430 -0
- package/docs/apis/features/node/process-manager.md +210 -0
- package/docs/apis/features/node/python.md +278 -0
- package/docs/apis/features/node/repl.md +88 -0
- package/docs/apis/features/node/runpod.md +673 -0
- package/docs/apis/features/node/secure-shell.md +169 -0
- package/docs/apis/features/node/semantic-search.md +401 -0
- package/docs/apis/features/node/sqlite.md +211 -0
- package/docs/apis/features/node/telegram.md +254 -0
- package/docs/apis/features/node/tts.md +118 -0
- package/docs/apis/features/node/ui.md +703 -0
- package/docs/apis/features/node/vault.md +64 -0
- package/docs/apis/features/node/vm.md +84 -0
- package/docs/apis/features/node/window-manager.md +337 -0
- package/docs/apis/features/node/yaml-tree.md +85 -0
- package/docs/apis/features/node/yaml.md +176 -0
- package/docs/apis/features/web/asset-loader.md +47 -0
- package/docs/apis/features/web/container-link.md +133 -0
- package/docs/apis/features/web/esbuild.md +59 -0
- package/docs/apis/features/web/helpers.md +135 -0
- package/docs/apis/features/web/network.md +30 -0
- package/docs/apis/features/web/speech.md +55 -0
- package/docs/apis/features/web/vault.md +64 -0
- package/docs/apis/features/web/vm.md +84 -0
- package/docs/apis/features/web/voice.md +67 -0
- package/docs/apis/servers/express.md +127 -0
- package/docs/apis/servers/mcp.md +213 -0
- package/docs/apis/servers/websocket.md +99 -0
- package/docs/documentation-audit.md +134 -0
- package/docs/examples/content-db.md +77 -0
- package/docs/examples/disk-cache.md +83 -0
- package/docs/examples/docker.md +101 -0
- package/docs/examples/downloader.md +70 -0
- package/docs/examples/esbuild.md +80 -0
- package/docs/examples/file-manager.md +82 -0
- package/docs/examples/fs.md +83 -0
- package/docs/examples/git.md +85 -0
- package/docs/examples/google-auth.md +88 -0
- package/docs/examples/google-calendar.md +94 -0
- package/docs/examples/google-docs.md +82 -0
- package/docs/examples/google-drive.md +96 -0
- package/docs/examples/google-sheets.md +95 -0
- package/docs/examples/grep.md +85 -0
- package/docs/examples/ink-blocks.md +75 -0
- package/docs/examples/ink-renderer.md +41 -0
- package/docs/examples/ink.md +103 -0
- package/docs/examples/ipc-socket.md +103 -0
- package/docs/examples/json-tree.md +91 -0
- package/docs/examples/launcher-app-command-listener.md +120 -0
- package/docs/examples/networking.md +58 -0
- package/docs/examples/nlp.md +91 -0
- package/docs/examples/opener.md +78 -0
- package/docs/examples/os.md +72 -0
- package/docs/examples/package-finder.md +89 -0
- package/docs/examples/port-exposer.md +89 -0
- package/docs/examples/postgres.md +91 -0
- package/docs/examples/proc.md +81 -0
- package/docs/examples/process-manager.md +79 -0
- package/docs/examples/python.md +91 -0
- package/docs/examples/repl.md +93 -0
- package/docs/examples/runpod.md +119 -0
- package/docs/examples/secure-shell.md +92 -0
- package/docs/examples/sqlite.md +86 -0
- package/docs/examples/telegram.md +77 -0
- package/docs/examples/tts.md +86 -0
- package/docs/examples/ui.md +80 -0
- package/docs/examples/vault.md +70 -0
- package/docs/examples/vm.md +86 -0
- package/docs/examples/window-manager.md +125 -0
- package/docs/examples/yaml-tree.md +93 -0
- package/docs/examples/yaml.md +104 -0
- package/docs/ideas/class-registration-refactor-possibilities.md +197 -0
- package/docs/ideas/container-use-api.md +9 -0
- package/docs/ideas/easy-auth-for-express-servers-and-luca-serve.md +0 -0
- package/docs/ideas/feature-stacks.md +22 -0
- package/docs/ideas/luca-cli-self-sufficiency-demo.md +23 -0
- package/docs/ideas/mcp-design.md +9 -0
- package/docs/ideas/web-container-debugging-feature.md +13 -0
- package/docs/introspection-audit.md +49 -0
- package/docs/introspection.md +154 -0
- package/docs/mcp/readme.md +162 -0
- package/docs/models.ts +38 -0
- package/docs/philosophy.md +85 -0
- package/docs/principles.md +7 -0
- package/docs/prompts/audit-codebase-for-failures-to-use-the-container.md +34 -0
- package/docs/prompts/mcp-test-easy-command.md +27 -0
- package/docs/reports/assistant-bugs.md +38 -0
- package/docs/reports/attach-pattern-usage.md +18 -0
- package/docs/reports/code-audit-results.md +391 -0
- package/docs/reports/introspection-audit-tasks.md +378 -0
- package/docs/reports/luca-mcp-improvements.md +128 -0
- package/docs/scaffolds/client.md +140 -0
- package/docs/scaffolds/command.md +106 -0
- package/docs/scaffolds/endpoint.md +176 -0
- package/docs/scaffolds/feature.md +148 -0
- package/docs/scaffolds/server.md +187 -0
- package/docs/tasks/web-container-helper-discovery.md +71 -0
- package/docs/todos.md +1 -0
- package/docs/tutorials/01-getting-started.md +106 -0
- package/docs/tutorials/02-container.md +210 -0
- package/docs/tutorials/03-scripts.md +194 -0
- package/docs/tutorials/04-features-overview.md +196 -0
- package/docs/tutorials/05-state-and-events.md +171 -0
- package/docs/tutorials/06-servers.md +157 -0
- package/docs/tutorials/07-endpoints.md +198 -0
- package/docs/tutorials/08-commands.md +171 -0
- package/docs/tutorials/09-clients.md +162 -0
- package/docs/tutorials/10-creating-features.md +198 -0
- package/docs/tutorials/11-contentbase.md +191 -0
- package/docs/tutorials/12-assistants.md +215 -0
- package/docs/tutorials/13-introspection.md +147 -0
- package/docs/tutorials/14-type-system.md +174 -0
- package/docs/tutorials/15-project-patterns.md +222 -0
- package/docs/tutorials/16-google-features.md +534 -0
- package/docs/tutorials/17-tui-blocks.md +530 -0
- package/docs/tutorials/18-semantic-search.md +334 -0
- package/index.ts +1 -0
- package/luca.console.ts +9 -0
- package/main.py +6 -0
- package/package.json +154 -0
- package/pyproject.toml +7 -0
- package/scripts/animations/chrome-glitch.ts +55 -0
- package/scripts/animations/index.ts +16 -0
- package/scripts/animations/neon-pulse.ts +64 -0
- package/scripts/animations/types.ts +6 -0
- package/scripts/build-web.ts +28 -0
- package/scripts/examples/ask-luca-expert.ts +42 -0
- package/scripts/examples/assistant-questions.ts +12 -0
- package/scripts/examples/excalidraw-expert.ts +75 -0
- package/scripts/examples/expert-chat.ts +0 -0
- package/scripts/examples/file-manager.ts +14 -0
- package/scripts/examples/ideas.ts +12 -0
- package/scripts/examples/interactive-chat.ts +20 -0
- package/scripts/examples/openai-tool-calls.ts +113 -0
- package/scripts/examples/opening-a-web-browser.ts +5 -0
- package/scripts/examples/telegram-bot.ts +79 -0
- package/scripts/examples/telegram-ink-ui.ts +302 -0
- package/scripts/examples/using-assistant-with-mcp.ts +560 -0
- package/scripts/examples/using-claude-code.ts +10 -0
- package/scripts/examples/using-contentdb.ts +35 -0
- package/scripts/examples/using-conversations.ts +35 -0
- package/scripts/examples/using-disk-cache.ts +10 -0
- package/scripts/examples/using-docker-shell.ts +75 -0
- package/scripts/examples/using-elevenlabs.ts +25 -0
- package/scripts/examples/using-google-calendar.ts +57 -0
- package/scripts/examples/using-google-docs.ts +74 -0
- package/scripts/examples/using-google-drive.ts +74 -0
- package/scripts/examples/using-google-sheets.ts +89 -0
- package/scripts/examples/using-nlp.ts +55 -0
- package/scripts/examples/using-ollama.ts +10 -0
- package/scripts/examples/using-openai-codex.ts +23 -0
- package/scripts/examples/using-postgres.ts +55 -0
- package/scripts/examples/using-runpod.ts +32 -0
- package/scripts/examples/using-tts.ts +40 -0
- package/scripts/examples/vm-loading-esm-modules.ts +16 -0
- package/scripts/scaffold.ts +391 -0
- package/scripts/scratch.ts +15 -0
- package/scripts/test-command-listener.ts +123 -0
- package/scripts/test-window-manager-lifecycle.ts +86 -0
- package/scripts/test-window-manager.ts +43 -0
- package/scripts/update-introspection-data.ts +58 -0
- package/src/agi/README.md +14 -0
- package/src/agi/container.server.ts +114 -0
- package/src/agi/endpoints/ask.ts +60 -0
- package/src/agi/endpoints/conversations/[id].ts +45 -0
- package/src/agi/endpoints/conversations.ts +31 -0
- package/src/agi/endpoints/experts.ts +37 -0
- package/src/agi/features/assistant.ts +767 -0
- package/src/agi/features/assistants-manager.ts +260 -0
- package/src/agi/features/claude-code.ts +1111 -0
- package/src/agi/features/conversation-history.ts +497 -0
- package/src/agi/features/conversation.ts +799 -0
- package/src/agi/features/openai-codex.ts +631 -0
- package/src/agi/features/openapi.ts +438 -0
- package/src/agi/features/skills-library.ts +425 -0
- package/src/agi/index.ts +6 -0
- package/src/agi/lib/token-counter.ts +122 -0
- package/src/browser.ts +25 -0
- package/src/bus.ts +100 -0
- package/src/cli/cli.ts +70 -0
- package/src/client.ts +461 -0
- package/src/clients/civitai/index.ts +541 -0
- package/src/clients/client-template.ts +41 -0
- package/src/clients/comfyui/index.ts +597 -0
- package/src/clients/elevenlabs/index.ts +291 -0
- package/src/clients/openai/index.ts +451 -0
- package/src/clients/supabase/index.ts +366 -0
- package/src/command.ts +164 -0
- package/src/commands/chat.ts +182 -0
- package/src/commands/console.ts +192 -0
- package/src/commands/describe.ts +433 -0
- package/src/commands/eval.ts +116 -0
- package/src/commands/help.ts +214 -0
- package/src/commands/index.ts +14 -0
- package/src/commands/mcp.ts +64 -0
- package/src/commands/prompt.ts +807 -0
- package/src/commands/run.ts +257 -0
- package/src/commands/sandbox-mcp.ts +439 -0
- package/src/commands/scaffold.ts +79 -0
- package/src/commands/serve.ts +172 -0
- package/src/container.ts +781 -0
- package/src/endpoint.ts +340 -0
- package/src/feature.ts +75 -0
- package/src/hash-object.ts +97 -0
- package/src/helper.ts +543 -0
- package/src/introspection/generated.agi.ts +23388 -0
- package/src/introspection/generated.node.ts +18899 -0
- package/src/introspection/generated.web.ts +2021 -0
- package/src/introspection/index.ts +256 -0
- package/src/introspection/scan.ts +912 -0
- package/src/node/container.ts +354 -0
- package/src/node/feature.ts +13 -0
- package/src/node/features/container-link.ts +558 -0
- package/src/node/features/content-db.ts +475 -0
- package/src/node/features/disk-cache.ts +382 -0
- package/src/node/features/dns.ts +655 -0
- package/src/node/features/docker.ts +912 -0
- package/src/node/features/downloader.ts +92 -0
- package/src/node/features/esbuild.ts +68 -0
- package/src/node/features/file-manager.ts +357 -0
- package/src/node/features/fs.ts +534 -0
- package/src/node/features/git.ts +492 -0
- package/src/node/features/google-auth.ts +502 -0
- package/src/node/features/google-calendar.ts +300 -0
- package/src/node/features/google-docs.ts +404 -0
- package/src/node/features/google-drive.ts +339 -0
- package/src/node/features/google-sheets.ts +279 -0
- package/src/node/features/grep.ts +406 -0
- package/src/node/features/helpers.ts +374 -0
- package/src/node/features/ink.ts +490 -0
- package/src/node/features/ipc-socket.ts +459 -0
- package/src/node/features/json-tree.ts +188 -0
- package/src/node/features/launcher-app-command-listener.ts +388 -0
- package/src/node/features/networking.ts +925 -0
- package/src/node/features/nlp.ts +211 -0
- package/src/node/features/opener.ts +166 -0
- package/src/node/features/os.ts +157 -0
- package/src/node/features/package-finder.ts +539 -0
- package/src/node/features/port-exposer.ts +342 -0
- package/src/node/features/postgres.ts +273 -0
- package/src/node/features/proc.ts +502 -0
- package/src/node/features/process-manager.ts +542 -0
- package/src/node/features/python.ts +444 -0
- package/src/node/features/repl.ts +194 -0
- package/src/node/features/runpod.ts +802 -0
- package/src/node/features/secure-shell.ts +248 -0
- package/src/node/features/semantic-search.ts +924 -0
- package/src/node/features/sqlite.ts +289 -0
- package/src/node/features/telegram.ts +342 -0
- package/src/node/features/tts.ts +184 -0
- package/src/node/features/ui.ts +857 -0
- package/src/node/features/vault.ts +164 -0
- package/src/node/features/vm.ts +312 -0
- package/src/node/features/window-manager.ts +804 -0
- package/src/node/features/yaml-tree.ts +149 -0
- package/src/node/features/yaml.ts +132 -0
- package/src/node.ts +70 -0
- package/src/react/index.ts +175 -0
- package/src/registry.ts +199 -0
- package/src/scaffolds/generated.ts +1613 -0
- package/src/scaffolds/template.ts +37 -0
- package/src/schemas/base.ts +255 -0
- package/src/server.ts +135 -0
- package/src/servers/express.ts +209 -0
- package/src/servers/mcp.ts +805 -0
- package/src/servers/socket.ts +120 -0
- package/src/state.ts +101 -0
- package/src/web/clients/socket.ts +82 -0
- package/src/web/container.ts +74 -0
- package/src/web/extension.ts +30 -0
- package/src/web/feature.ts +12 -0
- package/src/web/features/asset-loader.ts +64 -0
- package/src/web/features/container-link.ts +385 -0
- package/src/web/features/esbuild.ts +79 -0
- package/src/web/features/helpers.ts +267 -0
- package/src/web/features/network.ts +61 -0
- package/src/web/features/speech.ts +87 -0
- package/src/web/features/vault.ts +189 -0
- package/src/web/features/vm.ts +78 -0
- package/src/web/features/voice-recognition.ts +129 -0
- package/src/web/shims/isomorphic-vm.ts +149 -0
- package/test/bus.test.ts +134 -0
- package/test/clients-servers.test.ts +216 -0
- package/test/container-link.test.ts +274 -0
- package/test/features.test.ts +160 -0
- package/test/integration.test.ts +787 -0
- package/test/node-container.test.ts +121 -0
- package/test/rate-limit.test.ts +272 -0
- package/test/semantic-search.test.ts +550 -0
- package/test/state.test.ts +121 -0
- package/test-integration/assistant.test.ts +138 -0
- package/test-integration/assistants-manager.test.ts +123 -0
- package/test-integration/claude-code.test.ts +98 -0
- package/test-integration/conversation-history.test.ts +205 -0
- package/test-integration/conversation.test.ts +137 -0
- package/test-integration/elevenlabs.test.ts +55 -0
- package/test-integration/google-services.test.ts +80 -0
- package/test-integration/helpers.ts +89 -0
- package/test-integration/openai-codex.test.ts +93 -0
- package/test-integration/runpod.test.ts +58 -0
- package/test-integration/server-endpoints.test.ts +97 -0
- package/test-integration/skills-library.test.ts +157 -0
- package/test-integration/telegram.test.ts +46 -0
- package/tsconfig.json +58 -0
- package/uv.lock +8 -0
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
# Git (features.git)
|
|
2
|
+
|
|
3
|
+
The Git feature provides utilities for interacting with Git repositories. This feature allows you to check repository status, list files, get branch information, and access Git metadata for projects within a Git repository.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
container.feature('git')
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Methods
|
|
12
|
+
|
|
13
|
+
### lsFiles
|
|
14
|
+
|
|
15
|
+
Lists files in the Git repository using git ls-files command. This method provides a flexible interface to the git ls-files command, allowing you to filter files by various criteria such as cached, deleted, modified, untracked, and ignored files.
|
|
16
|
+
|
|
17
|
+
**Parameters:**
|
|
18
|
+
|
|
19
|
+
| Name | Type | Required | Description |
|
|
20
|
+
|------|------|----------|-------------|
|
|
21
|
+
| `options` | `LsFilesOptions` | | Options to control which files are listed |
|
|
22
|
+
|
|
23
|
+
`LsFilesOptions` properties:
|
|
24
|
+
|
|
25
|
+
| Property | Type | Description |
|
|
26
|
+
|----------|------|-------------|
|
|
27
|
+
| `cached` | `boolean` | Show cached/staged files |
|
|
28
|
+
| `deleted` | `boolean` | Show deleted files |
|
|
29
|
+
| `modified` | `boolean` | Show modified files |
|
|
30
|
+
| `others` | `boolean` | Show untracked files |
|
|
31
|
+
| `ignored` | `boolean` | Show ignored files |
|
|
32
|
+
| `status` | `boolean` | Show file status information |
|
|
33
|
+
| `includeIgnored` | `boolean` | Include ignored files when showing others |
|
|
34
|
+
| `exclude` | `string | string[]` | Patterns to exclude from results |
|
|
35
|
+
| `baseDir` | `string` | Base directory to list files from |
|
|
36
|
+
|
|
37
|
+
**Returns:** `void`
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
// Get all tracked files
|
|
41
|
+
const allFiles = await git.lsFiles()
|
|
42
|
+
|
|
43
|
+
// Get only modified files
|
|
44
|
+
const modified = await git.lsFiles({ modified: true })
|
|
45
|
+
|
|
46
|
+
// Get untracked files excluding certain patterns
|
|
47
|
+
const untracked = await git.lsFiles({
|
|
48
|
+
others: true,
|
|
49
|
+
exclude: ['*.log', 'node_modules']
|
|
50
|
+
})
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
### getLatestChanges
|
|
56
|
+
|
|
57
|
+
Gets the latest commits from the repository. Returns an array of commit objects containing the title (first line of commit message), full message body, and author name for each commit.
|
|
58
|
+
|
|
59
|
+
**Parameters:**
|
|
60
|
+
|
|
61
|
+
| Name | Type | Required | Description |
|
|
62
|
+
|------|------|----------|-------------|
|
|
63
|
+
| `numberOfChanges` | `number` | | The number of recent commits to return |
|
|
64
|
+
|
|
65
|
+
**Returns:** `void`
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
const changes = await git.getLatestChanges(5)
|
|
69
|
+
for (const commit of changes) {
|
|
70
|
+
console.log(`${commit.author}: ${commit.title}`)
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
### fileLog
|
|
77
|
+
|
|
78
|
+
Gets a lightweight commit log for one or more files. Returns the SHA and message for each commit that touched the given files, without the per-commit overhead of resolving which specific files matched. For richer per-file matching, see {@link getChangeHistoryForFiles}.
|
|
79
|
+
|
|
80
|
+
**Parameters:**
|
|
81
|
+
|
|
82
|
+
| Name | Type | Required | Description |
|
|
83
|
+
|------|------|----------|-------------|
|
|
84
|
+
| `files` | `string[]` | ✓ | File paths (absolute or relative to container.cwd) |
|
|
85
|
+
|
|
86
|
+
**Returns:** `void`
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
const log = git.fileLog('package.json')
|
|
90
|
+
const log = git.fileLog('src/index.ts', 'src/helper.ts')
|
|
91
|
+
for (const entry of log) {
|
|
92
|
+
console.log(`${entry.sha.slice(0, 8)} ${entry.message}`)
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
### diff
|
|
99
|
+
|
|
100
|
+
Gets the diff for a file between two refs. By default compares from the current HEAD to the given ref. You can supply both `compareTo` and `compareFrom` to diff between any two commits, branches, or tags.
|
|
101
|
+
|
|
102
|
+
**Parameters:**
|
|
103
|
+
|
|
104
|
+
| Name | Type | Required | Description |
|
|
105
|
+
|------|------|----------|-------------|
|
|
106
|
+
| `file` | `string` | ✓ | File path (absolute or relative to container.cwd) |
|
|
107
|
+
| `compareTo` | `string` | ✓ | The target ref (commit SHA, branch, tag) to compare to |
|
|
108
|
+
| `compareFrom` | `string` | | The base ref to compare from (defaults to current HEAD) |
|
|
109
|
+
|
|
110
|
+
**Returns:** `void`
|
|
111
|
+
|
|
112
|
+
```ts
|
|
113
|
+
// Diff package.json between HEAD and a specific commit
|
|
114
|
+
const d = git.diff('package.json', 'abc1234')
|
|
115
|
+
|
|
116
|
+
// Diff between two branches
|
|
117
|
+
const d = git.diff('src/index.ts', 'feature-branch', 'main')
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
### displayDiff
|
|
123
|
+
|
|
124
|
+
Pretty prints a unified diff string to the terminal using colors. Parses the diff output and applies color coding: - File headers (`diff --git`, `---`, `+++`) are rendered bold - Hunk headers (`@@ ... @@`) are rendered in cyan - Added lines (`+`) are rendered in green - Removed lines (`-`) are rendered in red - Context lines are rendered dim Can be called with a raw diff string, or with the same arguments as {@link diff} to fetch and display in one step.
|
|
125
|
+
|
|
126
|
+
**Parameters:**
|
|
127
|
+
|
|
128
|
+
| Name | Type | Required | Description |
|
|
129
|
+
|------|------|----------|-------------|
|
|
130
|
+
| `diffOrFile` | `string` | ✓ | A raw diff string, or a file path to pass to {@link diff} |
|
|
131
|
+
| `compareTo` | `string` | | When diffOrFile is a file path, the target ref to compare to |
|
|
132
|
+
| `compareFrom` | `string` | | When diffOrFile is a file path, the base ref to compare from |
|
|
133
|
+
|
|
134
|
+
**Returns:** `string`
|
|
135
|
+
|
|
136
|
+
```ts
|
|
137
|
+
// Display a pre-fetched diff
|
|
138
|
+
const raw = git.diff('src/index.ts', 'main')
|
|
139
|
+
git.displayDiff(raw)
|
|
140
|
+
|
|
141
|
+
// Fetch and display in one call
|
|
142
|
+
git.displayDiff('src/index.ts', 'abc1234')
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
### getChangeHistoryForFiles
|
|
148
|
+
|
|
149
|
+
Gets the commit history for a set of files or glob patterns. Accepts absolute paths, relative paths (resolved from container.cwd), or glob patterns. Returns commits that touched any of the matched files, with each entry noting which of your queried files were in that commit.
|
|
150
|
+
|
|
151
|
+
**Parameters:**
|
|
152
|
+
|
|
153
|
+
| Name | Type | Required | Description |
|
|
154
|
+
|------|------|----------|-------------|
|
|
155
|
+
| `paths` | `string[]` | ✓ | File paths or glob patterns to get history for |
|
|
156
|
+
|
|
157
|
+
**Returns:** `void`
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
const history = git.getChangeHistoryForFiles('src/container.ts', 'src/helper.ts')
|
|
161
|
+
const history = git.getChangeHistoryForFiles('src/node/features/*.ts')
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
## Getters
|
|
167
|
+
|
|
168
|
+
| Property | Type | Description |
|
|
169
|
+
|----------|------|-------------|
|
|
170
|
+
| `branch` | `any` | Gets the current Git branch name. |
|
|
171
|
+
| `sha` | `any` | Gets the current Git commit SHA hash. |
|
|
172
|
+
| `isRepo` | `any` | Checks if the current directory is within a Git repository. |
|
|
173
|
+
| `isRepoRoot` | `any` | Checks if the current working directory is the root of the Git repository. |
|
|
174
|
+
| `repoRoot` | `any` | Gets the absolute path to the Git repository root directory. This method caches the repository root path for performance. It searches upward from the current directory to find the .git directory. |
|
|
175
|
+
|
|
176
|
+
## State (Zod v4 schema)
|
|
177
|
+
|
|
178
|
+
| Property | Type | Description |
|
|
179
|
+
|----------|------|-------------|
|
|
180
|
+
| `enabled` | `boolean` | Whether this feature is currently enabled |
|
|
181
|
+
| `repoRoot` | `string` | Absolute path to the Git repository root directory |
|
|
182
|
+
|
|
183
|
+
## Examples
|
|
184
|
+
|
|
185
|
+
**features.git**
|
|
186
|
+
|
|
187
|
+
```ts
|
|
188
|
+
const git = container.feature('git')
|
|
189
|
+
|
|
190
|
+
if (git.isRepo) {
|
|
191
|
+
console.log(`Current branch: ${git.branch}`)
|
|
192
|
+
console.log(`Repository root: ${git.repoRoot}`)
|
|
193
|
+
|
|
194
|
+
const allFiles = await git.lsFiles()
|
|
195
|
+
const modifiedFiles = await git.lsFiles({ modified: true })
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
**lsFiles**
|
|
202
|
+
|
|
203
|
+
```ts
|
|
204
|
+
// Get all tracked files
|
|
205
|
+
const allFiles = await git.lsFiles()
|
|
206
|
+
|
|
207
|
+
// Get only modified files
|
|
208
|
+
const modified = await git.lsFiles({ modified: true })
|
|
209
|
+
|
|
210
|
+
// Get untracked files excluding certain patterns
|
|
211
|
+
const untracked = await git.lsFiles({
|
|
212
|
+
others: true,
|
|
213
|
+
exclude: ['*.log', 'node_modules']
|
|
214
|
+
})
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
**getLatestChanges**
|
|
220
|
+
|
|
221
|
+
```ts
|
|
222
|
+
const changes = await git.getLatestChanges(5)
|
|
223
|
+
for (const commit of changes) {
|
|
224
|
+
console.log(`${commit.author}: ${commit.title}`)
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
**fileLog**
|
|
231
|
+
|
|
232
|
+
```ts
|
|
233
|
+
const log = git.fileLog('package.json')
|
|
234
|
+
const log = git.fileLog('src/index.ts', 'src/helper.ts')
|
|
235
|
+
for (const entry of log) {
|
|
236
|
+
console.log(`${entry.sha.slice(0, 8)} ${entry.message}`)
|
|
237
|
+
}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
**diff**
|
|
243
|
+
|
|
244
|
+
```ts
|
|
245
|
+
// Diff package.json between HEAD and a specific commit
|
|
246
|
+
const d = git.diff('package.json', 'abc1234')
|
|
247
|
+
|
|
248
|
+
// Diff between two branches
|
|
249
|
+
const d = git.diff('src/index.ts', 'feature-branch', 'main')
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
**displayDiff**
|
|
255
|
+
|
|
256
|
+
```ts
|
|
257
|
+
// Display a pre-fetched diff
|
|
258
|
+
const raw = git.diff('src/index.ts', 'main')
|
|
259
|
+
git.displayDiff(raw)
|
|
260
|
+
|
|
261
|
+
// Fetch and display in one call
|
|
262
|
+
git.displayDiff('src/index.ts', 'abc1234')
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
**getChangeHistoryForFiles**
|
|
268
|
+
|
|
269
|
+
```ts
|
|
270
|
+
const history = git.getChangeHistoryForFiles('src/container.ts', 'src/helper.ts')
|
|
271
|
+
const history = git.getChangeHistoryForFiles('src/node/features/*.ts')
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
**branch**
|
|
277
|
+
|
|
278
|
+
```ts
|
|
279
|
+
const currentBranch = git.branch
|
|
280
|
+
if (currentBranch) {
|
|
281
|
+
console.log(`Currently on branch: ${currentBranch}`)
|
|
282
|
+
}
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
**sha**
|
|
288
|
+
|
|
289
|
+
```ts
|
|
290
|
+
const commitSha = git.sha
|
|
291
|
+
if (commitSha) {
|
|
292
|
+
console.log(`Current commit: ${commitSha}`)
|
|
293
|
+
}
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
**isRepo**
|
|
299
|
+
|
|
300
|
+
```ts
|
|
301
|
+
if (git.isRepo) {
|
|
302
|
+
console.log('This is a Git repository!')
|
|
303
|
+
} else {
|
|
304
|
+
console.log('Not in a Git repository')
|
|
305
|
+
}
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
**isRepoRoot**
|
|
311
|
+
|
|
312
|
+
```ts
|
|
313
|
+
if (git.isRepoRoot) {
|
|
314
|
+
console.log('At the repository root')
|
|
315
|
+
} else {
|
|
316
|
+
console.log('In a subdirectory of the repository')
|
|
317
|
+
}
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
**repoRoot**
|
|
323
|
+
|
|
324
|
+
```ts
|
|
325
|
+
const repoRoot = git.repoRoot
|
|
326
|
+
if (repoRoot) {
|
|
327
|
+
console.log(`Repository root: ${repoRoot}`)
|
|
328
|
+
}
|
|
329
|
+
```
|
|
330
|
+
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# GoogleAuth (features.googleAuth)
|
|
2
|
+
|
|
3
|
+
Google authentication feature supporting OAuth2 browser flow and service account auth. Handles the complete OAuth2 lifecycle: authorization URL generation, local callback server, token exchange, refresh token storage (via diskCache), and automatic token refresh. Also supports non-interactive service account authentication via JSON key files. Other Google features (drive, sheets, calendar, docs) depend on this feature and access it lazily via `container.feature('googleAuth')`.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
container.feature('googleAuth', {
|
|
9
|
+
// Authentication mode. Auto-detected if serviceAccountKeyPath is set
|
|
10
|
+
mode,
|
|
11
|
+
// OAuth2 client ID (falls back to GOOGLE_CLIENT_ID env var)
|
|
12
|
+
clientId,
|
|
13
|
+
// OAuth2 client secret (falls back to GOOGLE_CLIENT_SECRET env var)
|
|
14
|
+
clientSecret,
|
|
15
|
+
// Path to service account JSON key file (falls back to GOOGLE_SERVICE_ACCOUNT_KEY env var)
|
|
16
|
+
serviceAccountKeyPath,
|
|
17
|
+
// Service account key as a parsed JSON object (alternative to file path)
|
|
18
|
+
serviceAccountKey,
|
|
19
|
+
// OAuth2 scopes to request
|
|
20
|
+
scopes,
|
|
21
|
+
// Port for OAuth2 callback server (falls back to GOOGLE_OAUTH_REDIRECT_PORT env var, then 3000)
|
|
22
|
+
redirectPort,
|
|
23
|
+
// DiskCache key for storing OAuth2 refresh token
|
|
24
|
+
tokenCacheKey,
|
|
25
|
+
})
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Options (Zod v4 schema)
|
|
29
|
+
|
|
30
|
+
| Property | Type | Description |
|
|
31
|
+
|----------|------|-------------|
|
|
32
|
+
| `mode` | `string` | Authentication mode. Auto-detected if serviceAccountKeyPath is set |
|
|
33
|
+
| `clientId` | `string` | OAuth2 client ID (falls back to GOOGLE_CLIENT_ID env var) |
|
|
34
|
+
| `clientSecret` | `string` | OAuth2 client secret (falls back to GOOGLE_CLIENT_SECRET env var) |
|
|
35
|
+
| `serviceAccountKeyPath` | `string` | Path to service account JSON key file (falls back to GOOGLE_SERVICE_ACCOUNT_KEY env var) |
|
|
36
|
+
| `serviceAccountKey` | `object` | Service account key as a parsed JSON object (alternative to file path) |
|
|
37
|
+
| `scopes` | `array` | OAuth2 scopes to request |
|
|
38
|
+
| `redirectPort` | `number` | Port for OAuth2 callback server (falls back to GOOGLE_OAUTH_REDIRECT_PORT env var, then 3000) |
|
|
39
|
+
| `tokenCacheKey` | `string` | DiskCache key for storing OAuth2 refresh token |
|
|
40
|
+
|
|
41
|
+
## Methods
|
|
42
|
+
|
|
43
|
+
### getOAuth2Client
|
|
44
|
+
|
|
45
|
+
Get the OAuth2Client instance, creating it lazily. After authentication, this client has valid credentials set.
|
|
46
|
+
|
|
47
|
+
**Returns:** `OAuth2Client`
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
### getAuthClient
|
|
52
|
+
|
|
53
|
+
Get the authenticated auth client for passing to googleapis service constructors. Handles token refresh automatically for OAuth2. For service accounts, returns the JWT auth client.
|
|
54
|
+
|
|
55
|
+
**Returns:** `Promise<OAuth2Client | ReturnType<typeof google.auth.fromJSON>>`
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### authorize
|
|
60
|
+
|
|
61
|
+
Start the OAuth2 authorization flow. 1. Spins up a temporary Express callback server on a free port 2. Generates the Google authorization URL 3. Opens the browser to the consent page 4. Waits for the callback with the authorization code 5. Exchanges the code for access + refresh tokens 6. Stores the refresh token in diskCache 7. Shuts down the callback server
|
|
62
|
+
|
|
63
|
+
**Parameters:**
|
|
64
|
+
|
|
65
|
+
| Name | Type | Required | Description |
|
|
66
|
+
|------|------|----------|-------------|
|
|
67
|
+
| `scopes` | `string[]` | | OAuth2 scopes to request (defaults to options.scopes or defaultScopes) |
|
|
68
|
+
|
|
69
|
+
**Returns:** `Promise<this>`
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
### authenticateServiceAccount
|
|
74
|
+
|
|
75
|
+
Authenticate using a service account JSON key file. Reads the key from options.serviceAccountKeyPath, options.serviceAccountKey, or the GOOGLE_SERVICE_ACCOUNT_KEY env var.
|
|
76
|
+
|
|
77
|
+
**Returns:** `Promise<this>`
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
### tryRestoreTokens
|
|
82
|
+
|
|
83
|
+
Attempt to restore authentication from a cached refresh token. Called automatically by getAuthClient() if not yet authenticated.
|
|
84
|
+
|
|
85
|
+
**Returns:** `Promise<boolean>`
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### revoke
|
|
90
|
+
|
|
91
|
+
Revoke the current credentials and clear cached tokens.
|
|
92
|
+
|
|
93
|
+
**Returns:** `Promise<this>`
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
## Getters
|
|
98
|
+
|
|
99
|
+
| Property | Type | Description |
|
|
100
|
+
|----------|------|-------------|
|
|
101
|
+
| `clientId` | `string` | OAuth2 client ID from options or GOOGLE_CLIENT_ID env var. |
|
|
102
|
+
| `clientSecret` | `string` | OAuth2 client secret from options or GOOGLE_CLIENT_SECRET env var. |
|
|
103
|
+
| `authMode` | `'oauth2' | 'service-account'` | Resolved authentication mode based on options. |
|
|
104
|
+
| `isAuthenticated` | `boolean` | Whether valid credentials are currently available. |
|
|
105
|
+
| `defaultScopes` | `string[]` | Default scopes covering Drive, Sheets, Calendar, and Docs read access. |
|
|
106
|
+
| `redirectPort` | `number` | Resolved redirect port from options, GOOGLE_OAUTH_REDIRECT_PORT env var, or default 3000. |
|
|
107
|
+
| `tokenCacheKey` | `string` | DiskCache key used for storing the refresh token. |
|
|
108
|
+
|
|
109
|
+
## Events (Zod v4 schema)
|
|
110
|
+
|
|
111
|
+
### tokenRefreshed
|
|
112
|
+
|
|
113
|
+
Event emitted by GoogleAuth
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
### error
|
|
118
|
+
|
|
119
|
+
Event emitted by GoogleAuth
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
### authorizationRequired
|
|
124
|
+
|
|
125
|
+
Event emitted by GoogleAuth
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
### authenticated
|
|
130
|
+
|
|
131
|
+
Event emitted by GoogleAuth
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
## State (Zod v4 schema)
|
|
136
|
+
|
|
137
|
+
| Property | Type | Description |
|
|
138
|
+
|----------|------|-------------|
|
|
139
|
+
| `enabled` | `boolean` | Whether this feature is currently enabled |
|
|
140
|
+
| `authMode` | `string` | Current authentication mode |
|
|
141
|
+
| `isAuthenticated` | `boolean` | Whether valid credentials are currently available |
|
|
142
|
+
| `email` | `string` | Authenticated user or service account email |
|
|
143
|
+
| `scopes` | `array` | OAuth2 scopes that have been authorized |
|
|
144
|
+
| `tokenExpiry` | `string` | ISO timestamp when the current access token expires |
|
|
145
|
+
| `lastError` | `string` | Last authentication error message |
|
|
146
|
+
|
|
147
|
+
## Environment Variables
|
|
148
|
+
|
|
149
|
+
- `GOOGLE_CLIENT_ID`
|
|
150
|
+
- `GOOGLE_CLIENT_SECRET`
|
|
151
|
+
- `GOOGLE_SERVICE_ACCOUNT_KEY`
|
|
152
|
+
- `GOOGLE_OAUTH_REDIRECT_PORT`
|
|
153
|
+
|
|
154
|
+
## Examples
|
|
155
|
+
|
|
156
|
+
**features.googleAuth**
|
|
157
|
+
|
|
158
|
+
```ts
|
|
159
|
+
// OAuth2 flow — opens browser for consent
|
|
160
|
+
const auth = container.feature('googleAuth', {
|
|
161
|
+
clientId: 'your-client-id.apps.googleusercontent.com',
|
|
162
|
+
clientSecret: 'your-secret',
|
|
163
|
+
scopes: ['https://www.googleapis.com/auth/drive.readonly'],
|
|
164
|
+
})
|
|
165
|
+
await auth.authorize()
|
|
166
|
+
|
|
167
|
+
// Service account flow — no browser needed
|
|
168
|
+
const auth = container.feature('googleAuth', {
|
|
169
|
+
serviceAccountKeyPath: '/path/to/key.json',
|
|
170
|
+
scopes: ['https://www.googleapis.com/auth/spreadsheets.readonly'],
|
|
171
|
+
})
|
|
172
|
+
await auth.authenticateServiceAccount()
|
|
173
|
+
```
|
|
174
|
+
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# GoogleCalendar (features.googleCalendar)
|
|
2
|
+
|
|
3
|
+
Google Calendar feature for listing calendars and reading events. Depends on the googleAuth feature for authentication. Creates a Calendar v3 API client lazily. Provides convenience methods for today's events and upcoming days.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
container.feature('googleCalendar', {
|
|
9
|
+
// Default calendar ID (default: "primary")
|
|
10
|
+
defaultCalendarId,
|
|
11
|
+
// Default timezone for event queries (e.g. "America/Chicago")
|
|
12
|
+
timeZone,
|
|
13
|
+
})
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Options (Zod v4 schema)
|
|
17
|
+
|
|
18
|
+
| Property | Type | Description |
|
|
19
|
+
|----------|------|-------------|
|
|
20
|
+
| `defaultCalendarId` | `string` | Default calendar ID (default: "primary") |
|
|
21
|
+
| `timeZone` | `string` | Default timezone for event queries (e.g. "America/Chicago") |
|
|
22
|
+
|
|
23
|
+
## Methods
|
|
24
|
+
|
|
25
|
+
### listCalendars
|
|
26
|
+
|
|
27
|
+
List all calendars accessible to the authenticated user.
|
|
28
|
+
|
|
29
|
+
**Returns:** `Promise<CalendarInfo[]>`
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### listEvents
|
|
34
|
+
|
|
35
|
+
List events from a calendar within a time range.
|
|
36
|
+
|
|
37
|
+
**Parameters:**
|
|
38
|
+
|
|
39
|
+
| Name | Type | Required | Description |
|
|
40
|
+
|------|------|----------|-------------|
|
|
41
|
+
| `options` | `ListEventsOptions` | | Filtering options including timeMin, timeMax, query, maxResults |
|
|
42
|
+
|
|
43
|
+
`ListEventsOptions` properties:
|
|
44
|
+
|
|
45
|
+
| Property | Type | Description |
|
|
46
|
+
|----------|------|-------------|
|
|
47
|
+
| `calendarId` | `string` | |
|
|
48
|
+
| `timeMin` | `string` | |
|
|
49
|
+
| `timeMax` | `string` | |
|
|
50
|
+
| `maxResults` | `number` | |
|
|
51
|
+
| `query` | `string` | |
|
|
52
|
+
| `orderBy` | `'startTime' | 'updated'` | |
|
|
53
|
+
| `pageToken` | `string` | |
|
|
54
|
+
| `singleEvents` | `boolean` | |
|
|
55
|
+
|
|
56
|
+
**Returns:** `Promise<CalendarEventList>`
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### getToday
|
|
61
|
+
|
|
62
|
+
Get today's events from a calendar.
|
|
63
|
+
|
|
64
|
+
**Parameters:**
|
|
65
|
+
|
|
66
|
+
| Name | Type | Required | Description |
|
|
67
|
+
|------|------|----------|-------------|
|
|
68
|
+
| `calendarId` | `string` | | Calendar ID (defaults to options.defaultCalendarId or 'primary') |
|
|
69
|
+
|
|
70
|
+
**Returns:** `Promise<CalendarEvent[]>`
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
### getUpcoming
|
|
75
|
+
|
|
76
|
+
Get upcoming events for the next N days.
|
|
77
|
+
|
|
78
|
+
**Parameters:**
|
|
79
|
+
|
|
80
|
+
| Name | Type | Required | Description |
|
|
81
|
+
|------|------|----------|-------------|
|
|
82
|
+
| `days` | `number` | | Number of days to look ahead (default: 7) |
|
|
83
|
+
| `calendarId` | `string` | | Calendar ID |
|
|
84
|
+
|
|
85
|
+
**Returns:** `Promise<CalendarEvent[]>`
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### getEvent
|
|
90
|
+
|
|
91
|
+
Get a single event by ID.
|
|
92
|
+
|
|
93
|
+
**Parameters:**
|
|
94
|
+
|
|
95
|
+
| Name | Type | Required | Description |
|
|
96
|
+
|------|------|----------|-------------|
|
|
97
|
+
| `eventId` | `string` | ✓ | The event ID |
|
|
98
|
+
| `calendarId` | `string` | | Calendar ID |
|
|
99
|
+
|
|
100
|
+
**Returns:** `Promise<CalendarEvent>`
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
### searchEvents
|
|
105
|
+
|
|
106
|
+
Search events by text query across event summaries, descriptions, and locations.
|
|
107
|
+
|
|
108
|
+
**Parameters:**
|
|
109
|
+
|
|
110
|
+
| Name | Type | Required | Description |
|
|
111
|
+
|------|------|----------|-------------|
|
|
112
|
+
| `query` | `string` | ✓ | Freetext search term |
|
|
113
|
+
| `options` | `ListEventsOptions` | | Additional listing options (timeMin, timeMax, calendarId, etc.) |
|
|
114
|
+
|
|
115
|
+
`ListEventsOptions` properties:
|
|
116
|
+
|
|
117
|
+
| Property | Type | Description |
|
|
118
|
+
|----------|------|-------------|
|
|
119
|
+
| `calendarId` | `string` | |
|
|
120
|
+
| `timeMin` | `string` | |
|
|
121
|
+
| `timeMax` | `string` | |
|
|
122
|
+
| `maxResults` | `number` | |
|
|
123
|
+
| `query` | `string` | |
|
|
124
|
+
| `orderBy` | `'startTime' | 'updated'` | |
|
|
125
|
+
| `pageToken` | `string` | |
|
|
126
|
+
| `singleEvents` | `boolean` | |
|
|
127
|
+
|
|
128
|
+
**Returns:** `Promise<CalendarEvent[]>`
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
## Getters
|
|
133
|
+
|
|
134
|
+
| Property | Type | Description |
|
|
135
|
+
|----------|------|-------------|
|
|
136
|
+
| `auth` | `GoogleAuth` | Access the google-auth feature lazily. |
|
|
137
|
+
| `defaultCalendarId` | `string` | Default calendar ID from options or 'primary'. |
|
|
138
|
+
|
|
139
|
+
## Events (Zod v4 schema)
|
|
140
|
+
|
|
141
|
+
### error
|
|
142
|
+
|
|
143
|
+
Event emitted by GoogleCalendar
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
### eventsFetched
|
|
148
|
+
|
|
149
|
+
Event emitted by GoogleCalendar
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
## State (Zod v4 schema)
|
|
154
|
+
|
|
155
|
+
| Property | Type | Description |
|
|
156
|
+
|----------|------|-------------|
|
|
157
|
+
| `enabled` | `boolean` | Whether this feature is currently enabled |
|
|
158
|
+
| `lastCalendarId` | `string` | Last calendar ID queried |
|
|
159
|
+
| `lastEventCount` | `number` | Number of events returned in last query |
|
|
160
|
+
| `lastError` | `string` | Last Calendar API error message |
|
|
161
|
+
|
|
162
|
+
## Examples
|
|
163
|
+
|
|
164
|
+
**features.googleCalendar**
|
|
165
|
+
|
|
166
|
+
```ts
|
|
167
|
+
const calendar = container.feature('googleCalendar')
|
|
168
|
+
|
|
169
|
+
// List all calendars
|
|
170
|
+
const calendars = await calendar.listCalendars()
|
|
171
|
+
|
|
172
|
+
// Get today's events
|
|
173
|
+
const today = await calendar.getToday()
|
|
174
|
+
|
|
175
|
+
// Get next 7 days of events
|
|
176
|
+
const upcoming = await calendar.getUpcoming(7)
|
|
177
|
+
|
|
178
|
+
// Search events
|
|
179
|
+
const meetings = await calendar.searchEvents('standup')
|
|
180
|
+
|
|
181
|
+
// List events in a time range
|
|
182
|
+
const events = await calendar.listEvents({
|
|
183
|
+
timeMin: '2026-03-01T00:00:00Z',
|
|
184
|
+
timeMax: '2026-03-31T23:59:59Z',
|
|
185
|
+
})
|
|
186
|
+
```
|
|
187
|
+
|