dexto 1.5.6 → 1.5.7
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/README.md +13 -0
- package/dist/agents/coding-agent/coding-agent.yml +15 -0
- package/dist/agents/coding-agent/skills/code-review.md +46 -0
- package/dist/agents/explore-agent/explore-agent.yml +2 -0
- package/dist/analytics/events.d.ts +1 -1
- package/dist/analytics/events.d.ts.map +1 -1
- package/dist/api/server-hono.d.ts.map +1 -1
- package/dist/api/server-hono.js +55 -10
- package/dist/cli/assets/dexto-logo.svg +31 -0
- package/dist/cli/auth/api-client.d.ts +49 -0
- package/dist/cli/auth/api-client.d.ts.map +1 -0
- package/dist/cli/auth/api-client.js +127 -0
- package/dist/cli/auth/constants.d.ts +23 -0
- package/dist/cli/auth/constants.d.ts.map +1 -0
- package/dist/cli/auth/constants.js +24 -0
- package/dist/cli/auth/index.d.ts +5 -0
- package/dist/cli/auth/index.d.ts.map +1 -0
- package/dist/cli/auth/index.js +6 -0
- package/dist/cli/auth/oauth.d.ts +26 -0
- package/dist/cli/auth/oauth.d.ts.map +1 -0
- package/dist/cli/auth/oauth.js +327 -0
- package/dist/cli/auth/service.d.ts +20 -0
- package/dist/cli/auth/service.d.ts.map +1 -0
- package/dist/cli/auth/service.js +147 -0
- package/dist/cli/commands/auth/index.d.ts +4 -0
- package/dist/cli/commands/auth/index.d.ts.map +1 -0
- package/dist/cli/commands/auth/index.js +4 -0
- package/dist/cli/commands/auth/login.d.ts +9 -0
- package/dist/cli/commands/auth/login.d.ts.map +1 -0
- package/dist/cli/commands/auth/login.js +255 -0
- package/dist/cli/commands/auth/logout.d.ts +5 -0
- package/dist/cli/commands/auth/logout.d.ts.map +1 -0
- package/dist/cli/commands/auth/logout.js +51 -0
- package/dist/cli/commands/auth/status.d.ts +2 -0
- package/dist/cli/commands/auth/status.d.ts.map +1 -0
- package/dist/cli/commands/auth/status.js +22 -0
- package/dist/cli/commands/billing/index.d.ts +2 -0
- package/dist/cli/commands/billing/index.d.ts.map +1 -0
- package/dist/cli/commands/billing/index.js +2 -0
- package/dist/cli/commands/billing/status.d.ts +6 -0
- package/dist/cli/commands/billing/status.d.ts.map +1 -0
- package/dist/cli/commands/billing/status.js +60 -0
- package/dist/cli/commands/index.d.ts +3 -0
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +8 -0
- package/dist/cli/commands/interactive-commands/auth/index.d.ts +12 -0
- package/dist/cli/commands/interactive-commands/auth/index.d.ts.map +1 -0
- package/dist/cli/commands/interactive-commands/auth/index.js +20 -0
- package/dist/cli/commands/interactive-commands/command-parser.d.ts +5 -0
- package/dist/cli/commands/interactive-commands/command-parser.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/command-parser.js +6 -0
- package/dist/cli/commands/interactive-commands/commands.d.ts +1 -0
- package/dist/cli/commands/interactive-commands/commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/commands.js +8 -0
- package/dist/cli/commands/interactive-commands/mcp/index.d.ts +2 -2
- package/dist/cli/commands/interactive-commands/mcp/index.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/mcp/index.js +4 -7
- package/dist/cli/commands/interactive-commands/model/index.d.ts +2 -2
- package/dist/cli/commands/interactive-commands/model/index.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/model/index.js +4 -7
- package/dist/cli/commands/interactive-commands/plugin/index.d.ts +13 -0
- package/dist/cli/commands/interactive-commands/plugin/index.d.ts.map +1 -0
- package/dist/cli/commands/interactive-commands/plugin/index.js +18 -0
- package/dist/cli/commands/interactive-commands/prompt-commands.d.ts +3 -1
- package/dist/cli/commands/interactive-commands/prompt-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/prompt-commands.js +72 -36
- package/dist/cli/commands/plugin.d.ts +161 -0
- package/dist/cli/commands/plugin.d.ts.map +1 -0
- package/dist/cli/commands/plugin.js +376 -0
- package/dist/cli/commands/setup.d.ts +9 -9
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +228 -19
- package/dist/cli/ink-cli/InkCLIRefactored.d.ts.map +1 -1
- package/dist/cli/ink-cli/InkCLIRefactored.js +2 -1
- package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts +1 -1
- package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/ApprovalPrompt.js +80 -12
- package/dist/cli/ink-cli/components/Footer.d.ts +2 -1
- package/dist/cli/ink-cli/components/Footer.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/Footer.js +6 -2
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.js +15 -7
- package/dist/cli/ink-cli/components/StatusBar.d.ts +5 -1
- package/dist/cli/ink-cli/components/StatusBar.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/StatusBar.js +2 -2
- package/dist/cli/ink-cli/components/chat/MessageItem.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/chat/MessageItem.js +14 -1
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.js +4 -1
- package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/modes/StaticCLI.js +4 -1
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts +1 -0
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.js +30 -19
- package/dist/cli/ink-cli/components/overlays/MarketplaceAddPrompt.d.ts +20 -0
- package/dist/cli/ink-cli/components/overlays/MarketplaceAddPrompt.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/MarketplaceAddPrompt.js +81 -0
- package/dist/cli/ink-cli/components/overlays/MarketplaceBrowser.d.ts +31 -0
- package/dist/cli/ink-cli/components/overlays/MarketplaceBrowser.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/MarketplaceBrowser.js +297 -0
- package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.js +7 -1
- package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts +1 -1
- package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/McpServerActions.js +9 -0
- package/dist/cli/ink-cli/components/overlays/McpServerList.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/McpServerList.js +9 -2
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.js +15 -2
- package/dist/cli/ink-cli/components/overlays/PluginActions.d.ts +27 -0
- package/dist/cli/ink-cli/components/overlays/PluginActions.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/PluginActions.js +66 -0
- package/dist/cli/ink-cli/components/overlays/PluginList.d.ts +21 -0
- package/dist/cli/ink-cli/components/overlays/PluginList.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/PluginList.js +70 -0
- package/dist/cli/ink-cli/components/overlays/PluginManager.d.ts +21 -0
- package/dist/cli/ink-cli/components/overlays/PluginManager.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/PluginManager.js +63 -0
- package/dist/cli/ink-cli/components/overlays/PromptList.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/PromptList.js +4 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.d.ts +2 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.js +61 -2
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts +4 -2
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.js +4 -4
- package/dist/cli/ink-cli/containers/InputContainer.d.ts.map +1 -1
- package/dist/cli/ink-cli/containers/InputContainer.js +30 -3
- package/dist/cli/ink-cli/containers/OverlayContainer.d.ts.map +1 -1
- package/dist/cli/ink-cli/containers/OverlayContainer.js +256 -11
- package/dist/cli/ink-cli/hooks/index.d.ts +1 -0
- package/dist/cli/ink-cli/hooks/index.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/index.js +1 -0
- package/dist/cli/ink-cli/hooks/useCLIState.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/useCLIState.js +2 -0
- package/dist/cli/ink-cli/hooks/useGitBranch.d.ts +13 -0
- package/dist/cli/ink-cli/hooks/useGitBranch.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useGitBranch.js +35 -0
- package/dist/cli/ink-cli/hooks/useInputOrchestrator.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/useInputOrchestrator.js +47 -8
- package/dist/cli/ink-cli/services/processStream.d.ts.map +1 -1
- package/dist/cli/ink-cli/services/processStream.js +42 -10
- package/dist/cli/ink-cli/state/initialState.d.ts.map +1 -1
- package/dist/cli/ink-cli/state/initialState.js +2 -0
- package/dist/cli/ink-cli/state/types.d.ts +3 -1
- package/dist/cli/ink-cli/state/types.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/commandOverlays.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/commandOverlays.js +1 -0
- package/dist/cli/ink-cli/utils/messageFormatting.d.ts +14 -1
- package/dist/cli/ink-cli/utils/messageFormatting.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/messageFormatting.js +66 -6
- package/dist/cli/ink-cli/utils/toolUtils.d.ts +11 -0
- package/dist/cli/ink-cli/utils/toolUtils.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/toolUtils.js +17 -0
- package/dist/cli/mcp/index.d.ts +8 -0
- package/dist/cli/mcp/index.d.ts.map +1 -0
- package/dist/cli/mcp/index.js +7 -0
- package/dist/cli/mcp/oauth-factory.d.ts +6 -0
- package/dist/cli/mcp/oauth-factory.d.ts.map +1 -0
- package/dist/cli/mcp/oauth-factory.js +25 -0
- package/dist/cli/mcp/oauth-provider.d.ts +10 -0
- package/dist/cli/mcp/oauth-provider.d.ts.map +1 -0
- package/dist/cli/mcp/oauth-provider.js +77 -0
- package/dist/cli/mcp/oauth-redirect.d.ts +3 -0
- package/dist/cli/mcp/oauth-redirect.d.ts.map +1 -0
- package/dist/cli/mcp/oauth-redirect.js +4 -0
- package/dist/cli/mcp/oauth-server.d.ts +2 -0
- package/dist/cli/mcp/oauth-server.d.ts.map +1 -0
- package/dist/cli/mcp/oauth-server.js +70 -0
- package/dist/cli/mcp/oauth-store.d.ts +10 -0
- package/dist/cli/mcp/oauth-store.d.ts.map +1 -0
- package/dist/cli/mcp/oauth-store.js +27 -0
- package/dist/cli/mcp/oauth-ui.d.ts +2 -0
- package/dist/cli/mcp/oauth-ui.d.ts.map +1 -0
- package/dist/cli/mcp/oauth-ui.js +12 -0
- package/dist/cli/mcp/oauth-utils.d.ts +2 -0
- package/dist/cli/mcp/oauth-utils.d.ts.map +1 -0
- package/dist/cli/mcp/oauth-utils.js +17 -0
- package/dist/cli/utils/api-key-verification.d.ts.map +1 -1
- package/dist/cli/utils/api-key-verification.js +36 -0
- package/dist/cli/utils/config-validation.d.ts +3 -1
- package/dist/cli/utils/config-validation.d.ts.map +1 -1
- package/dist/cli/utils/config-validation.js +42 -19
- package/dist/cli/utils/dexto-auth-check.d.ts +53 -0
- package/dist/cli/utils/dexto-auth-check.d.ts.map +1 -0
- package/dist/cli/utils/dexto-auth-check.js +104 -0
- package/dist/cli/utils/dexto-setup.d.ts +8 -0
- package/dist/cli/utils/dexto-setup.d.ts.map +1 -0
- package/dist/cli/utils/dexto-setup.js +17 -0
- package/dist/cli/utils/options.d.ts.map +1 -1
- package/dist/cli/utils/options.js +5 -1
- package/dist/cli/utils/provider-setup.d.ts +4 -0
- package/dist/cli/utils/provider-setup.d.ts.map +1 -1
- package/dist/cli/utils/provider-setup.js +20 -0
- package/dist/config/cli-overrides.d.ts +17 -8
- package/dist/config/cli-overrides.d.ts.map +1 -1
- package/dist/config/cli-overrides.js +36 -22
- package/dist/config/effective-llm.d.ts +123 -0
- package/dist/config/effective-llm.d.ts.map +1 -0
- package/dist/config/effective-llm.js +171 -0
- package/dist/index.js +395 -99
- package/dist/webui/assets/index-C9JXwpvo.css +1 -0
- package/dist/webui/assets/{index-DVQWNLpT.js → index-Dl3mj53P.js} +217 -217
- package/dist/webui/index.html +2 -2
- package/package.json +9 -8
- package/dist/webui/assets/index-BglIVTSG.css +0 -1
package/README.md
CHANGED
|
@@ -15,6 +15,19 @@
|
|
|
15
15
|
<a href="https://deepwiki.com/truffle-ai/dexto"><img src="https://deepwiki.com/badge.svg"></a>
|
|
16
16
|
</p>
|
|
17
17
|
|
|
18
|
+
<!-- Keep these links. Translations will automatically update with the README. -->
|
|
19
|
+
<p align="center">
|
|
20
|
+
<a href="https://zdoc.app/de/truffle-ai/dexto">Deutsch</a> |
|
|
21
|
+
<a href="https://zdoc.app/en/truffle-ai/dexto">English</a> |
|
|
22
|
+
<a href="https://zdoc.app/es/truffle-ai/dexto">Español</a> |
|
|
23
|
+
<a href="https://zdoc.app/fr/truffle-ai/dexto">français</a> |
|
|
24
|
+
<a href="https://zdoc.app/ja/truffle-ai/dexto">日本語</a> |
|
|
25
|
+
<a href="https://zdoc.app/ko/truffle-ai/dexto">한국어</a> |
|
|
26
|
+
<a href="https://zdoc.app/pt/truffle-ai/dexto">Português</a> |
|
|
27
|
+
<a href="https://zdoc.app/ru/truffle-ai/dexto">Русский</a> |
|
|
28
|
+
<a href="https://zdoc.app/zh/truffle-ai/dexto">中文</a>
|
|
29
|
+
</p>
|
|
30
|
+
|
|
18
31
|
<p align="center"><b>An open agent harness for AI applications—ships with a powerful coding agent.</b></p>
|
|
19
32
|
|
|
20
33
|
<div align="center">
|
|
@@ -64,6 +64,12 @@ systemPrompt:
|
|
|
64
64
|
3. Mark it as completed when done, and move to the next task
|
|
65
65
|
4. Keep only ONE task in_progress at a time
|
|
66
66
|
|
|
67
|
+
## Bash Tool Guidelines
|
|
68
|
+
When using bash_exec:
|
|
69
|
+
- Your environment is already configured with the correct working directory.
|
|
70
|
+
- NEVER prefix commands to run in current working directory with cd <working_directory> && <remaining_command>.
|
|
71
|
+
- Only use cd <directory> as command prefix if the command needs to run outside the working directory.
|
|
72
|
+
|
|
67
73
|
## Guidelines
|
|
68
74
|
- Always read relevant code before making changes to understand context
|
|
69
75
|
- Use glob_files to find files and grep_content to search within files
|
|
@@ -118,6 +124,7 @@ toolConfirmation:
|
|
|
118
124
|
- custom--bash_output # Check background process output
|
|
119
125
|
- custom--kill_process # Kill processes without approval (only processes started by agent)
|
|
120
126
|
- custom--todo_write # Todo updates don't need approval
|
|
127
|
+
- custom--plan_read # Read plan without approval
|
|
121
128
|
|
|
122
129
|
# Tools that are always denied (dangerous operations)
|
|
123
130
|
# Uncomment to restrict certain operations
|
|
@@ -140,6 +147,7 @@ elicitation:
|
|
|
140
147
|
# Internal tools - core tools that are always available
|
|
141
148
|
internalTools:
|
|
142
149
|
- ask_user # Ask questions and collect input
|
|
150
|
+
- invoke_skill # Invoke skills/prompts during execution
|
|
143
151
|
|
|
144
152
|
# Custom tools - filesystem and process tools from image-local
|
|
145
153
|
customTools:
|
|
@@ -151,6 +159,8 @@ customTools:
|
|
|
151
159
|
- type: process-tools
|
|
152
160
|
securityLevel: moderate
|
|
153
161
|
- type: todo-tools
|
|
162
|
+
- type: plan-tools
|
|
163
|
+
basePath: "${{dexto.project_dir}}/plans"
|
|
154
164
|
- type: agent-spawner
|
|
155
165
|
maxConcurrentAgents: 5
|
|
156
166
|
defaultTimeout: 300000
|
|
@@ -229,6 +239,11 @@ internalResources:
|
|
|
229
239
|
|
|
230
240
|
# Prompts - coding-focused examples shown as clickable buttons in WebUI
|
|
231
241
|
prompts:
|
|
242
|
+
# Skills - can be invoked by the LLM via invoke_skill tool
|
|
243
|
+
- type: file
|
|
244
|
+
file: "${{dexto.agent_dir}}/skills/code-review.md"
|
|
245
|
+
# user-invocable: true (default) - appears as /code-review slash command
|
|
246
|
+
# disable-model-invocation: false (default) - LLM can invoke via invoke_skill
|
|
232
247
|
- type: inline
|
|
233
248
|
id: analyze-codebase
|
|
234
249
|
title: "🔍 Analyze Codebase"
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Code Review
|
|
3
|
+
description: Perform a thorough code review on the specified files or changes
|
|
4
|
+
arguments:
|
|
5
|
+
- name: focus
|
|
6
|
+
description: Optional focus area (security, performance, style, all)
|
|
7
|
+
required: false
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Code Review Skill
|
|
11
|
+
|
|
12
|
+
You are now performing a code review. Follow these guidelines:
|
|
13
|
+
|
|
14
|
+
## Review Checklist
|
|
15
|
+
|
|
16
|
+
1. **Correctness**: Does the code do what it's supposed to do?
|
|
17
|
+
2. **Security**: Are there any security vulnerabilities (injection, XSS, etc.)?
|
|
18
|
+
3. **Performance**: Are there any obvious performance issues?
|
|
19
|
+
4. **Readability**: Is the code easy to understand?
|
|
20
|
+
5. **Maintainability**: Will this code be easy to maintain?
|
|
21
|
+
6. **Error Handling**: Are errors handled appropriately?
|
|
22
|
+
7. **Tests**: Are there adequate tests for the changes?
|
|
23
|
+
|
|
24
|
+
## Output Format
|
|
25
|
+
|
|
26
|
+
Structure your review as:
|
|
27
|
+
|
|
28
|
+
### Summary
|
|
29
|
+
Brief overview of what the code does and overall assessment.
|
|
30
|
+
|
|
31
|
+
### Issues Found
|
|
32
|
+
List any problems, categorized by severity:
|
|
33
|
+
- **Critical**: Must fix before merge
|
|
34
|
+
- **Major**: Should fix, but not blocking
|
|
35
|
+
- **Minor**: Nice to have improvements
|
|
36
|
+
- **Nitpick**: Style/preference suggestions
|
|
37
|
+
|
|
38
|
+
### Positive Highlights
|
|
39
|
+
Note any particularly good patterns or practices.
|
|
40
|
+
|
|
41
|
+
### Recommendations
|
|
42
|
+
Actionable suggestions for improvement.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
Begin the code review now. If no specific files were mentioned, ask the user what they'd like reviewed.
|
|
@@ -57,6 +57,8 @@ systemPrompt:
|
|
|
57
57
|
4. **Notes** - Any caveats or areas that need further exploration
|
|
58
58
|
|
|
59
59
|
# LLM configuration - Haiku for speed and cost efficiency
|
|
60
|
+
# When spawned as a sub-agent, this config may be overridden by parent's LLM
|
|
61
|
+
# if the API key is not available (with a warning to use 'dexto login')
|
|
60
62
|
llm:
|
|
61
63
|
provider: anthropic
|
|
62
64
|
model: claude-haiku-4-5-20251001
|
|
@@ -55,7 +55,7 @@ export interface SetupEvent {
|
|
|
55
55
|
model: string;
|
|
56
56
|
hadApiKeyBefore?: boolean;
|
|
57
57
|
setupMode: 'interactive' | 'non-interactive';
|
|
58
|
-
setupVariant?: 'quick-start' | 'custom';
|
|
58
|
+
setupVariant?: 'quick-start' | 'custom' | 'dexto';
|
|
59
59
|
defaultMode?: string;
|
|
60
60
|
hasBaseURL?: boolean;
|
|
61
61
|
apiKeySkipped?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/analytics/events.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEhE,MAAM,WAAW,gBAAgB;IAC7B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC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EAAE,UAAU,CAAC;IACxB,mBAAmB,EAAE,iBAAiB,CAAC;IACvC,aAAa,EAAE,qBAAqB,CAAC;IACrC,qBAAqB,EAAE,mBAAmB,CAAC;IAC3C,eAAe,EAAE,uBAAuB,CAAC;IACzC,YAAY,EAAE,kBAAkB,CAAC;IACjC,UAAU,EAAE,gBAAgB,CAAC;CAChC;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,sBAAsB,CAAC;AAE9D,MAAM,MAAM,qBAAqB,CAAC,IAAI,SAAS,kBAAkB,IAAI,sBAAsB,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-hono.d.ts","sourceRoot":"","sources":["../../src/api/server-hono.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAuC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"server-hono.d.ts","sourceRoot":"","sources":["../../src/api/server-hono.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAuC,MAAM,aAAa,CAAC;AAW9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAC/E,OAAO,EACH,cAAc,EACd,gBAAgB,EAShB,KAAK,kBAAkB,EAC1B,MAAM,eAAe,CAAC;AA+HvB,MAAM,MAAM,wBAAwB,GAAG;IACnC,GAAG,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IACvC,MAAM,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC;IACtD,iBAAiB,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC1F,SAAS,EAAE,SAAS,CAAC;IACrB,YAAY,CAAC,EAA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dist/api/server-hono.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import os from 'node:os';
|
|
2
2
|
import { DextoAgent, createAgentCard, logger, AgentError } from '@dexto/core';
|
|
3
|
-
import { loadAgentConfig, enrichAgentConfig, deriveDisplayName, getAgentRegistry, AgentFactory, } from '@dexto/agent-management';
|
|
3
|
+
import { loadAgentConfig, enrichAgentConfig, deriveDisplayName, getAgentRegistry, AgentFactory, globalPreferencesExist, loadGlobalPreferences, } from '@dexto/agent-management';
|
|
4
|
+
import { applyUserPreferences } from '../config/cli-overrides.js';
|
|
4
5
|
import { createDextoApp, createNodeServer, createMcpTransport as createServerMcpTransport, createMcpHttpHandlers, initializeMcpServer as initializeServerMcpServer, createManualApprovalHandler, WebhookEventSubscriber, A2ASseEventSubscriber, ApprovalCoordinator, } from '@dexto/server';
|
|
5
6
|
import { registerGracefulShutdown } from '../utils/graceful-shutdown.js';
|
|
6
7
|
const DEFAULT_AGENT_VERSION = '1.0.0';
|
|
@@ -8,12 +9,19 @@ const DEFAULT_AGENT_VERSION = '1.0.0';
|
|
|
8
9
|
* Load image dynamically based on config and environment
|
|
9
10
|
* Priority: Config image field > Environment variable > Default
|
|
10
11
|
* Images are optional, but default to image-local for convenience
|
|
12
|
+
*
|
|
13
|
+
* @returns Image metadata including bundled plugins, or null if image has no metadata export
|
|
11
14
|
*/
|
|
12
15
|
async function loadImageForConfig(config) {
|
|
13
16
|
const imageName = config.image || process.env.DEXTO_IMAGE || '@dexto/image-local';
|
|
14
17
|
try {
|
|
15
|
-
await import(imageName);
|
|
18
|
+
const imageModule = await import(imageName);
|
|
16
19
|
logger.debug(`Loaded image: ${imageName}`);
|
|
20
|
+
// Extract metadata if available (built images export imageMetadata)
|
|
21
|
+
if (imageModule.imageMetadata) {
|
|
22
|
+
return imageModule.imageMetadata;
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
17
25
|
}
|
|
18
26
|
catch (err) {
|
|
19
27
|
const errorMsg = `Failed to load image '${imageName}': ${err instanceof Error ? err.message : String(err)}`;
|
|
@@ -35,19 +43,41 @@ async function listAgents() {
|
|
|
35
43
|
* Create an agent from an agent ID
|
|
36
44
|
* Replacement for old Dexto.createAgent()
|
|
37
45
|
* Uses registry.resolveAgent() which auto-installs if needed
|
|
46
|
+
*
|
|
47
|
+
* Applies user preferences (preferences.yml) to ALL agents, not just the default.
|
|
48
|
+
* See feature-plans/auto-update.md section 8.11 - Three-Layer LLM Resolution.
|
|
38
49
|
*/
|
|
39
50
|
async function createAgentFromId(agentId) {
|
|
40
51
|
try {
|
|
41
52
|
// Use registry to resolve agent path (auto-installs if not present)
|
|
42
53
|
const registry = getAgentRegistry();
|
|
43
54
|
const agentPath = await registry.resolveAgent(agentId, true);
|
|
44
|
-
// Load
|
|
45
|
-
|
|
55
|
+
// Load agent config
|
|
56
|
+
let config = await loadAgentConfig(agentPath);
|
|
57
|
+
// Apply user's LLM preferences to ALL agents
|
|
58
|
+
// Three-Layer Resolution: local.llm ?? preferences.llm ?? bundled.llm
|
|
59
|
+
if (globalPreferencesExist()) {
|
|
60
|
+
try {
|
|
61
|
+
const preferences = await loadGlobalPreferences();
|
|
62
|
+
if (preferences?.llm?.provider && preferences?.llm?.model) {
|
|
63
|
+
config = applyUserPreferences(config, preferences);
|
|
64
|
+
logger.debug(`Applied user preferences to ${agentId}`, {
|
|
65
|
+
provider: preferences.llm.provider,
|
|
66
|
+
model: preferences.llm.model,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
logger.debug('Could not load preferences, using bundled config');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// Load image to get bundled plugins
|
|
75
|
+
const imageMetadata = await loadImageForConfig(config);
|
|
76
|
+
// Enrich config with per-agent paths and bundled plugins
|
|
46
77
|
const enrichedConfig = enrichAgentConfig(config, agentPath, {
|
|
47
78
|
logLevel: 'info', // Server uses info-level logging for visibility
|
|
79
|
+
bundledPlugins: imageMetadata?.bundledPlugins || [],
|
|
48
80
|
});
|
|
49
|
-
// Load image dynamically based on config
|
|
50
|
-
await loadImageForConfig(enrichedConfig);
|
|
51
81
|
// Create agent instance
|
|
52
82
|
logger.info(`Creating agent: ${agentId} from ${agentPath}`);
|
|
53
83
|
return new DextoAgent(enrichedConfig, agentPath);
|
|
@@ -219,13 +249,28 @@ export async function initializeHonoApi(agent, agentCardOverride, listenPort, ag
|
|
|
219
249
|
const { Telemetry } = await import('@dexto/core');
|
|
220
250
|
await Telemetry.shutdownGlobal();
|
|
221
251
|
// 2. Load agent configuration from file path
|
|
222
|
-
|
|
223
|
-
//
|
|
252
|
+
let config = await loadAgentConfig(filePath);
|
|
253
|
+
// 2.5. Apply user's LLM preferences to ALL agents
|
|
254
|
+
// Three-Layer Resolution: local.llm ?? preferences.llm ?? bundled.llm
|
|
255
|
+
if (globalPreferencesExist()) {
|
|
256
|
+
try {
|
|
257
|
+
const preferences = await loadGlobalPreferences();
|
|
258
|
+
if (preferences?.llm?.provider && preferences?.llm?.model) {
|
|
259
|
+
config = applyUserPreferences(config, preferences);
|
|
260
|
+
logger.debug(`Applied user preferences to agent from ${filePath} (provider=${preferences.llm.provider}, model=${preferences.llm.model})`);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
catch {
|
|
264
|
+
logger.debug('Could not load preferences, using bundled config');
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
// 3. Load image first to get bundled plugins
|
|
268
|
+
const imageMetadata = await loadImageForConfig(config);
|
|
269
|
+
// 3.5. Enrich config with per-agent paths and bundled plugins from image
|
|
224
270
|
const enrichedConfig = enrichAgentConfig(config, filePath, {
|
|
225
271
|
logLevel: 'info', // Server uses info-level logging for visibility
|
|
272
|
+
bundledPlugins: imageMetadata?.bundledPlugins || [],
|
|
226
273
|
});
|
|
227
|
-
// 3.5. Load image dynamically based on config
|
|
228
|
-
await loadImageForConfig(enrichedConfig);
|
|
229
274
|
// 4. Create new agent instance directly (will initialize fresh telemetry in createAgentServices)
|
|
230
275
|
newAgent = new DextoAgent(enrichedConfig, filePath);
|
|
231
276
|
// 5. Use enriched agentId (derived from config or filename during enrichment)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<svg viewBox="1820 2290 5180 1020" style="max-height: 500px" xmlns="http://www.w3.org/2000/svg" width="5180" height="1020">
|
|
2
|
+
<g style="transform: none;" fill="rgb(255,255,255)">
|
|
3
|
+
<g style="transform: none;">
|
|
4
|
+
<!-- dexto_2 logo icon scaled and positioned (20% larger) -->
|
|
5
|
+
<g transform="translate(2350, 2750) scale(1.176)">
|
|
6
|
+
<path d="M 464.0,883.5 L 455.0,882.5 L 448.0,879.5 L 441.0,876.5 L 434.5,873.0 L 439.5,868.0 L 445.5,864.0 L 452.0,860.5 L 458.0,856.5 L 463.5,852.0 L 469.5,848.0 L 475.0,843.5 L 480.5,839.0 L 486.5,835.0 L 492.0,830.5 L 497.0,825.5 L 502.0,820.5 L 507.5,816.0 L 512.5,811.0 L 517.5,806.0 L 523.0,801.5 L 528.0,796.5 L 533.0,791.5 L 537.5,786.0 L 542.0,780.5 L 547.0,775.5 L 552.0,770.5 L 556.5,765.0 L 562.0,760.5 L 567.0,755.5 L 572.0,750.5 L 576.0,744.5 L 580.0,738.5 L 584.0,732.5 L 588.5,727.0 L 593.0,721.5 L 597.0,715.5 L 601.0,709.5 L 605.0,703.5 L 609.5,698.0 L 613.0,691.5 L 616.5,685.0 L 620.5,679.0 L 624.5,673.0 L 628.5,667.0 L 631.5,660.0 L 634.5,653.0 L 638.5,647.0 L 642.0,640.5 L 645.0,633.5 L 648.5,627.0 L 651.5,620.0 L 654.5,613.0 L 657.5,606.0 L 661.0,599.5 L 664.5,593.0 L 667.5,586.0 L 670.5,579.0 L 673.5,572.0 L 676.0,564.5 L 678.5,557.0 L 681.0,549.5 L 683.5,542.0 L 686.5,535.0 L 689.0,527.5 L 691.5,520.0 L 693.5,512.0 L 695.5,504.0 L 698.0,496.5 L 700.5,489.0 L 702.5,481.0 L 704.5,473.0 L 705.5,464.0 L 707.5,456.0 L 709.0,447.5 L 710.5,439.0 L 711.5,430.0 L 713.5,422.0 L 714.5,413.0 L 715.5,404.0 L 716.5,395.0 L 716.5,385.0 L 717.5,376.0 L 717.5,366.0 L 717.5,356.0 L 717.5,346.0 L 717.5,336.0 L 716.5,327.0 L 715.5,318.0 L 714.0,309.5 L 712.5,301.0 L 711.5,292.0 L 709.5,284.0 L 707.5,276.0 L 705.5,268.0 L 702.5,261.0 L 700.0,253.5 L 697.5,246.0 L 694.0,239.5 L 691.0,232.5 L 687.5,226.0 L 683.5,220.0 L 679.5,214.0 L 675.5,208.0 L 671.5,202.0 L 666.5,197.0 L 661.5,192.0 L 656.5,187.0 L 651.0,182.5 L 646.0,177.5 L 640.0,173.5 L 633.5,170.0 L 627.0,166.5 L 621.0,162.5 L 614.0,159.5 L 607.0,156.5 L 598.5,155.0 L 590.0,153.5 L 582.0,151.5 L 573.0,150.5 L 563.0,150.5 L 553.0,150.5 L 544.0,151.5 L 535.0,152.5 L 526.0,153.5 L 518.0,155.5 L 510.0,157.5 L 502.5,160.0 L 495.0,162.5 L 487.0,164.5 L 480.0,167.5 L 473.0,170.5 L 466.0,173.5 L 463.5,172.0 L 470.0,168.5 L 476.0,164.5 L 482.5,161.0 L 489.0,157.5 L 495.5,154.0 L 502.0,150.5 L 509.0,147.5 L 516.0,144.5 L 523.5,142.0 L 531.0,139.5 L 538.5,137.0 L 547.0,135.5 L 555.0,133.5 L 564.0,132.5 L 572.0,130.5 L 582.0,130.5 L 591.5,130.0 L 600.0,130.5 L 610.0,130.5 L 619.0,131.5 L 627.5,133.0 L 636.0,134.5 L 644.0,136.5 L 652.0,138.5 L 659.5,141.0 L 666.5,144.0 L 673.5,147.0 L 680.0,150.5 L 687.0,153.5 L 693.0,157.5 L 699.5,161.0 L 705.5,165.0 L 711.5,169.0 L 717.5,173.0 L 723.0,177.5 L 728.5,182.0 L 734.0,186.5 L 739.0,191.5 L 743.5,197.0 L 745.5,205.0 L 748.5,212.0 L 751.5,219.0 L 753.5,227.0 L 756.5,234.0 L 758.5,242.0 L 761.0,249.5 L 763.0,257.5 L 764.5,266.0 L 766.0,274.5 L 766.5,284.0 L 767.5,293.0 L 768.5,302.0 L 769.0,311.5 L 769.5,321.0 L 769.5,331.0 L 769.5,341.0 L 768.5,350.0 L 768.5,360.0 L 767.5,369.0 L 766.5,378.0 L 765.5,387.0 L 764.5,396.0 L 762.5,404.0 L 761.5,413.0 L 760.5,422.0 L 758.5,430.0 L 756.5,438.0 L 755.5,447.0 L 753.5,455.0 L 751.5,463.0 L 749.5,471.0 L 747.5,479.0 L 745.5,487.0 L 743.5,495.0 L 741.0,502.5 L 738.5,510.0 L 736.0,517.5 L 733.5,525.0 L 731.5,533.0 L 728.5,540.0 L 726.0,547.5 L 723.5,555.0 L 720.5,562.0 L 718.0,569.5 L 716.0,577.5 L 713.0,584.5 L 710.0,591.5 L 706.5,598.0 L 703.5,605.0 L 700.0,611.5 L 696.5,618.0 L 693.5,625.0 L 690.0,631.5 L 686.5,638.0 L 683.5,645.0 L 679.5,651.0 L 676.0,657.5 L 671.5,663.0 L 667.5,669.0 L 664.5,676.0 L 661.0,682.5 L 657.5,689.0 L 653.5,695.0 L 649.0,700.5 L 645.0,706.5 L 641.0,712.5 L 637.0,718.5 L 633.0,724.5 L 629.0,730.5 L 624.5,736.0 L 620.5,742.0 L 616.0,747.5 L 611.0,752.5 L 606.0,757.5 L 601.5,763.0 L 597.5,769.0 L 593.5,775.0 L 588.5,780.0 L 583.5,785.0 L 579.0,790.5 L 574.0,795.5 L 569.0,800.5 L 564.0,805.5 L 559.0,810.5 L 554.0,815.5 L 549.0,820.5 L 544.0,825.5 L 538.5,830.0 L 533.0,834.5 L 528.0,839.5 L 522.0,843.5 L 516.0,847.5 L 510.5,852.0 L 504.5,856.0 L 498.5,860.0 L 493.0,864.5 L 487.5,869.0 L 481.0,872.5 L 475.0,876.5 L 469.0,880.5 Z" stroke="none" fill="rgb(78,201,176)" fill-rule="nonzero" transform="translate(-512, -512)"/>
|
|
7
|
+
<path d="M 397.0,858.5 L 388.0,857.5 L 381.5,854.0 L 375.0,850.5 L 372.0,846.5 L 378.0,842.5 L 384.0,838.5 L 391.0,835.5 L 397.0,831.5 L 403.0,827.5 L 409.0,823.5 L 415.0,819.5 L 420.5,815.0 L 425.5,810.0 L 430.5,805.0 L 436.0,800.5 L 441.0,795.5 L 446.5,791.0 L 452.0,786.5 L 457.5,782.0 L 462.5,777.0 L 467.0,771.5 L 471.5,766.0 L 476.0,760.5 L 481.0,755.5 L 485.5,750.0 L 491.0,745.5 L 495.5,740.0 L 500.0,734.5 L 504.0,728.5 L 508.5,723.0 L 512.5,717.0 L 517.5,712.0 L 521.5,706.0 L 525.0,699.5 L 529.0,693.5 L 533.0,687.5 L 537.0,681.5 L 540.5,675.0 L 543.5,668.0 L 546.5,661.0 L 550.5,655.0 L 554.5,649.0 L 558.5,643.0 L 562.0,636.5 L 565.0,629.5 L 568.0,622.5 L 571.0,615.5 L 574.0,608.5 L 577.5,602.0 L 581.0,595.5 L 583.5,588.0 L 586.5,581.0 L 588.5,573.0 L 591.5,566.0 L 593.5,558.0 L 595.5,550.0 L 598.0,542.5 L 600.5,535.0 L 602.5,527.0 L 604.5,519.0 L 607.0,511.5 L 608.5,503.0 L 610.5,495.0 L 612.0,486.5 L 613.5,478.0 L 615.0,469.5 L 616.0,460.5 L 616.5,451.0 L 618.5,443.0 L 619.0,433.5 L 619.5,424.0 L 619.5,414.0 L 619.5,404.0 L 619.5,394.0 L 618.5,385.0 L 617.5,376.0 L 616.5,367.0 L 615.5,358.0 L 613.5,350.0 L 611.5,342.0 L 609.5,334.0 L 607.5,326.0 L 604.5,319.0 L 602.0,311.5 L 599.0,304.5 L 595.5,298.0 L 593.0,290.5 L 589.5,284.0 L 586.0,277.5 L 582.0,271.5 L 577.5,266.0 L 573.0,260.5 L 568.5,255.0 L 564.0,249.5 L 558.0,245.5 L 552.5,241.0 L 546.5,237.0 L 541.5,232.0 L 535.5,228.0 L 529.0,224.5 L 521.5,222.0 L 514.0,219.5 L 506.0,217.5 L 498.0,215.5 L 489.0,214.5 L 480.0,213.5 L 470.0,213.5 L 461.0,212.5 L 452.0,213.5 L 443.0,214.5 L 434.0,215.5 L 425.0,216.5 L 415.0,216.5 L 407.0,218.5 L 402.5,224.0 L 397.5,229.0 L 392.5,234.0 L 387.5,239.0 L 383.0,244.5 L 379.0,250.5 L 374.5,256.0 L 369.5,261.0 L 365.0,266.5 L 360.5,272.0 L 356.0,277.5 L 351.5,283.0 L 347.0,288.5 L 342.5,294.0 L 338.5,300.0 L 334.5,306.0 L 330.0,311.5 L 325.5,317.0 L 321.5,323.0 L 317.5,329.0 L 313.5,335.0 L 310.0,341.5 L 306.0,347.5 L 301.5,353.0 L 298.5,360.0 L 294.5,366.0 L 291.0,372.5 L 287.0,378.5 L 283.5,385.0 L 279.5,391.0 L 275.5,397.0 L 272.5,404.0 L 269.5,411.0 L 266.5,418.0 L 263.5,425.0 L 260.0,431.5 L 257.0,438.5 L 253.5,445.0 L 250.5,452.0 L 247.5,459.0 L 244.5,466.0 L 242.0,473.5 L 239.5,481.0 L 236.5,488.0 L 233.5,495.0 L 231.5,503.0 L 228.5,510.0 L 225.5,517.0 L 223.0,524.5 L 221.0,532.5 L 218.5,540.0 L 216.5,548.0 L 214.5,556.0 L 212.5,564.0 L 210.5,572.0 L 208.5,580.0 L 206.5,588.0 L 204.5,596.0 L 203.0,604.5 L 201.5,613.0 L 199.5,621.0 L 198.5,630.0 L 193.0,634.5 L 183.0,634.5 L 173.5,634.0 L 173.0,625.5 L 174.5,617.0 L 176.5,609.0 L 178.0,600.5 L 179.5,592.0 L 181.5,584.0 L 183.5,576.0 L 185.5,568.0 L 187.5,560.0 L 188.5,551.0 L 190.5,543.0 L 193.0,535.5 L 195.5,528.0 L 197.5,520.0 L 200.5,513.0 L 203.5,506.0 L 205.5,498.0 L 208.5,491.0 L 211.5,484.0 L 214.5,477.0 L 217.5,470.0 L 220.0,462.5 L 223.0,455.5 L 226.5,449.0 L 229.5,442.0 L 232.5,435.0 L 236.5,429.0 L 239.5,422.0 L 243.0,415.5 L 246.5,409.0 L 249.5,402.0 L 253.5,396.0 L 257.0,389.5 L 260.5,383.0 L 264.5,377.0 L 268.5,371.0 L 271.5,364.0 L 275.5,358.0 L 279.5,352.0 L 284.0,346.5 L 288.5,341.0 L 292.5,335.0 L 296.5,329.0 L 300.5,323.0 L 304.5,317.0 L 309.0,311.5 L 314.0,306.5 L 318.5,301.0 L 323.5,296.0 L 328.0,290.5 L 332.5,285.0 L 337.0,279.5 L 341.5,274.0 L 346.5,269.0 L 351.0,263.5 L 356.0,258.5 L 361.0,253.5 L 366.0,248.5 L 371.0,243.5 L 376.5,239.0 L 382.0,234.5 L 387.5,230.0 L 393.0,225.5 L 398.5,221.0 L 404.0,216.5 L 409.5,212.0 L 415.0,207.5 L 421.0,203.5 L 429.0,201.5 L 436.5,199.0 L 444.5,197.0 L 452.0,194.5 L 460.0,192.5 L 468.0,190.5 L 476.0,188.5 L 484.0,186.5 L 493.0,185.5 L 502.0,184.5 L 512.0,184.5 L 522.0,184.5 L 532.0,184.5 L 541.0,185.5 L 549.0,187.5 L 557.0,189.5 L 564.0,192.5 L 571.0,195.5 L 578.5,198.0 L 585.0,201.5 L 591.5,205.0 L 597.0,209.5 L 602.0,214.5 L 607.5,219.0 L 612.5,224.0 L 617.0,229.5 L 621.5,235.0 L 625.5,241.0 L 630.0,246.5 L 634.5,252.0 L 637.5,259.0 L 641.0,265.5 L 644.5,272.0 L 647.5,279.0 L 650.0,286.5 L 652.5,294.0 L 654.5,302.0 L 656.5,310.0 L 658.5,318.0 L 660.5,326.0 L 661.5,335.0 L 663.0,343.5 L 663.5,353.0 L 664.5,362.0 L 664.5,372.0 L 664.5,382.0 L 664.5,392.0 L 664.5,402.0 L 663.5,411.0 L 662.5,420.0 L 661.5,429.0 L 660.5,438.0 L 659.5,447.0 L 658.5,456.0 L 657.5,465.0 L 655.5,473.0 L 654.5,482.0 L 652.5,490.0 L 650.5,498.0 L 648.5,506.0 L 647.0,514.5 L 644.5,522.0 L 642.5,530.0 L 640.0,537.5 L 637.5,545.0 L 635.5,553.0 L 633.5,561.0 L 630.5,568.0 L 627.5,575.0 L 625.5,583.0 L 622.5,590.0 L 619.5,597.0 L 616.5,604.0 L 613.0,610.5 L 610.0,617.5 L 606.5,624.0 L 603.5,631.0 L 600.0,637.5 L 596.5,644.0 L 593.5,651.0 L 590.0,657.5 L 586.5,664.0 L 583.5,671.0 L 579.0,676.5 L 575.5,683.0 L 571.5,689.0 L 567.5,695.0 L 562.5,700.0 L 558.5,706.0 L 555.0,712.5 L 550.5,718.0 L 546.0,723.5 L 541.5,729.0 L 537.0,734.5 L 533.5,741.0 L 529.0,746.5 L 524.0,751.5 L 519.0,756.5 L 514.0,761.5 L 509.0,766.5 L 504.5,772.0 L 500.0,777.5 L 495.0,782.5 L 490.0,787.5 L 485.0,792.5 L 480.0,797.5 L 475.0,802.5 L 470.0,807.5 L 464.5,812.0 L 459.0,816.5 L 453.5,821.0 L 448.0,825.5 L 442.0,829.5 L 436.0,833.5 L 430.0,837.5 L 424.0,841.5 L 418.0,845.5 L 412.0,849.5 L 406.0,853.5 L 399.5,857.0 Z" stroke="none" fill="rgb(78,201,176)" fill-rule="nonzero" transform="translate(-512, -512)"/>
|
|
8
|
+
<path d="M 442.0,753.5 L 443.5,746.0 L 447.0,739.5 L 450.0,732.5 L 453.5,726.0 L 456.0,718.5 L 458.5,711.0 L 460.5,703.0 L 462.5,695.0 L 464.5,687.0 L 466.5,679.0 L 468.5,671.0 L 471.5,664.0 L 475.0,657.5 L 478.5,651.0 L 482.0,644.5 L 485.5,638.0 L 489.0,631.5 L 492.0,624.5 L 495.0,617.5 L 498.0,610.5 L 501.0,603.5 L 503.5,596.0 L 506.5,589.0 L 509.0,581.5 L 511.5,574.0 L 514.0,566.5 L 516.5,559.0 L 518.5,551.0 L 520.5,543.0 L 522.5,535.0 L 524.0,526.5 L 525.5,518.0 L 527.0,509.5 L 528.5,501.0 L 529.5,492.0 L 530.5,483.0 L 530.5,473.0 L 531.5,464.0 L 531.5,454.0 L 531.5,444.0 L 531.5,434.0 L 530.5,425.0 L 529.5,416.0 L 529.0,406.5 L 527.5,398.0 L 525.5,390.0 L 523.0,382.5 L 521.0,374.5 L 518.5,367.0 L 516.0,359.5 L 513.0,352.5 L 509.5,346.0 L 506.5,339.0 L 503.0,332.5 L 499.0,326.5 L 494.5,321.0 L 491.0,314.5 L 486.0,309.5 L 480.5,305.0 L 475.0,300.5 L 470.0,295.5 L 465.0,290.5 L 459.0,286.5 L 452.5,283.0 L 445.5,280.0 L 438.5,277.0 L 431.5,274.0 L 424.0,271.5 L 416.0,269.5 L 408.0,267.5 L 398.0,267.5 L 389.0,266.5 L 386.0,260.5 L 389.0,253.5 L 393.5,248.0 L 399.0,243.5 L 408.0,242.5 L 417.0,241.5 L 427.0,241.5 L 436.0,242.5 L 446.0,242.5 L 454.5,244.0 L 463.0,245.5 L 471.0,247.5 L 478.0,250.5 L 485.5,253.0 L 492.0,256.5 L 498.0,260.5 L 504.5,264.0 L 510.5,268.0 L 516.0,272.5 L 521.0,277.5 L 525.5,283.0 L 530.0,288.5 L 534.5,294.0 L 538.5,300.0 L 542.0,306.5 L 545.5,313.0 L 549.0,319.5 L 552.0,326.5 L 555.5,333.0 L 558.5,340.0 L 560.5,348.0 L 563.0,355.5 L 565.5,363.0 L 567.5,371.0 L 569.5,379.0 L 571.0,387.5 L 572.5,396.0 L 573.5,405.0 L 573.5,415.0 L 573.5,425.0 L 573.5,435.0 L 573.5,445.0 L 572.5,454.0 L 571.5,463.0 L 570.5,472.0 L 569.5,481.0 L 568.5,490.0 L 566.5,498.0 L 564.5,506.0 L 563.0,514.5 L 561.5,523.0 L 559.5,531.0 L 557.5,539.0 L 555.5,547.0 L 553.5,555.0 L 550.5,562.0 L 548.5,570.0 L 545.5,577.0 L 543.5,585.0 L 540.5,592.0 L 538.5,600.0 L 535.5,607.0 L 532.5,614.0 L 529.0,620.5 L 526.0,627.5 L 522.5,634.0 L 519.5,641.0 L 516.0,647.5 L 512.5,654.0 L 509.0,660.5 L 505.5,667.0 L 502.5,674.0 L 498.5,680.0 L 494.5,686.0 L 490.5,692.0 L 486.0,697.5 L 481.5,703.0 L 477.5,709.0 L 473.5,715.0 L 469.0,720.5 L 465.0,726.5 L 460.5,732.0 L 456.5,738.0 L 452.0,743.5 L 447.0,748.5 L 442.0,753.5 Z" stroke="none" fill="rgb(78,201,176)" fill-rule="nonzero" transform="translate(-512, -512)"/>
|
|
9
|
+
<path d="M 143.0,634.5 L 133.0,634.5 L 125.0,632.5 L 125.5,624.0 L 127.5,616.0 L 129.0,607.5 L 130.5,599.0 L 132.5,591.0 L 134.0,582.5 L 135.5,574.0 L 137.5,566.0 L 139.5,558.0 L 141.5,550.0 L 143.5,542.0 L 145.5,534.0 L 148.0,526.5 L 150.5,519.0 L 153.5,512.0 L 156.5,505.0 L 159.5,498.0 L 162.0,490.5 L 165.0,483.5 L 167.5,476.0 L 170.5,469.0 L 174.0,462.5 L 177.5,456.0 L 181.0,449.5 L 184.0,442.5 L 187.5,436.0 L 191.0,429.5 L 195.0,423.5 L 198.5,417.0 L 201.5,410.0 L 205.0,403.5 L 209.0,397.5 L 213.5,392.0 L 217.5,386.0 L 221.5,380.0 L 226.0,374.5 L 230.5,369.0 L 234.5,363.0 L 238.5,357.0 L 243.0,351.5 L 247.5,346.0 L 252.0,340.5 L 256.5,335.0 L 261.5,330.0 L 266.5,325.0 L 271.5,320.0 L 276.5,315.0 L 281.0,309.5 L 285.5,304.0 L 291.0,299.5 L 296.0,294.5 L 301.5,290.0 L 306.5,285.0 L 312.0,280.5 L 318.0,276.5 L 323.5,272.0 L 329.0,267.5 L 334.5,263.0 L 333.0,266.5 L 328.0,271.5 L 323.0,276.5 L 318.0,281.5 L 313.5,287.0 L 308.5,292.0 L 304.0,297.5 L 299.0,302.5 L 294.5,308.0 L 290.0,313.5 L 285.5,319.0 L 280.5,324.0 L 276.0,329.5 L 272.0,335.5 L 268.0,341.5 L 263.5,347.0 L 259.0,352.5 L 254.5,358.0 L 250.5,364.0 L 246.5,370.0 L 242.5,376.0 L 239.0,382.5 L 235.5,389.0 L 231.0,394.5 L 227.0,400.5 L 223.5,407.0 L 220.0,413.5 L 217.0,420.5 L 213.5,427.0 L 210.0,433.5 L 206.5,440.0 L 203.5,447.0 L 200.0,453.5 L 196.5,460.0 L 193.5,467.0 L 190.5,474.0 L 187.5,481.0 L 184.5,488.0 L 181.5,495.0 L 178.5,502.0 L 175.5,509.0 L 173.5,517.0 L 171.0,524.5 L 168.5,532.0 L 166.0,539.5 L 163.5,547.0 L 161.5,555.0 L 159.5,563.0 L 157.5,571.0 L 156.0,579.5 L 154.0,587.5 L 152.5,596.0 L 150.5,604.0 L 148.5,612.0 L 147.5,621.0 L 146.5,630.0 Z" stroke="none" fill="rgb(78,201,176)" fill-rule="nonzero" transform="translate(-512, -512)"/>
|
|
10
|
+
<path d="M 242.0,634.5 L 232.0,634.5 L 231.5,627.0 L 232.5,618.0 L 234.5,610.0 L 236.5,602.0 L 238.5,594.0 L 239.5,585.0 L 241.5,577.0 L 243.5,569.0 L 245.5,561.0 L 247.5,553.0 L 249.5,545.0 L 251.5,537.0 L 253.5,529.0 L 256.0,521.5 L 258.5,514.0 L 261.5,507.0 L 263.5,499.0 L 266.5,492.0 L 269.5,485.0 L 272.5,478.0 L 274.5,470.0 L 277.5,463.0 L 280.5,456.0 L 282.5,448.0 L 285.5,441.0 L 288.5,434.0 L 291.5,427.0 L 295.0,420.5 L 298.0,413.5 L 301.5,407.0 L 305.0,400.5 L 308.5,394.0 L 311.5,387.0 L 314.5,380.0 L 318.5,374.0 L 321.5,367.0 L 325.0,360.5 L 328.5,354.0 L 332.5,348.0 L 336.5,342.0 L 340.0,335.5 L 344.0,329.5 L 347.5,323.0 L 351.5,317.0 L 355.0,310.5 L 359.0,304.5 L 363.5,299.0 L 367.5,293.0 L 375.0,292.5 L 383.5,294.0 L 391.5,296.0 L 399.0,298.5 L 406.0,301.5 L 412.5,305.0 L 419.0,308.5 L 425.0,312.5 L 430.5,317.0 L 435.5,322.0 L 440.5,327.0 L 445.0,332.5 L 450.0,337.5 L 454.0,343.5 L 458.5,349.0 L 462.0,355.5 L 465.5,362.0 L 468.5,369.0 L 471.5,376.0 L 475.0,382.5 L 477.5,390.0 L 479.5,398.0 L 481.5,406.0 L 483.5,414.0 L 485.5,422.0 L 486.5,431.0 L 487.5,440.0 L 488.5,449.0 L 488.5,459.0 L 488.5,469.0 L 488.5,479.0 L 488.5,489.0 L 487.5,498.0 L 486.5,507.0 L 485.5,516.0 L 483.5,524.0 L 482.0,532.5 L 480.0,540.5 L 478.5,549.0 L 476.5,557.0 L 474.5,565.0 L 472.5,573.0 L 469.5,577.0 L 468.5,568.0 L 467.5,559.0 L 465.5,551.0 L 463.5,543.0 L 461.0,535.5 L 458.5,528.0 L 455.5,521.0 L 453.5,513.0 L 451.5,505.0 L 451.5,495.0 L 451.5,485.0 L 450.5,476.0 L 450.5,466.0 L 449.5,457.0 L 449.5,447.0 L 448.5,438.0 L 446.5,430.0 L 444.5,422.0 L 442.5,414.0 L 439.5,407.0 L 436.5,400.0 L 434.5,392.0 L 431.0,385.5 L 427.5,379.0 L 424.0,372.5 L 420.0,366.5 L 415.5,361.0 L 411.0,355.5 L 406.5,350.0 L 401.5,345.0 L 396.5,340.0 L 391.0,335.5 L 384.0,332.5 L 377.5,329.0 L 371.0,325.5 L 364.0,322.5 L 356.5,320.0 L 351.5,324.0 L 348.5,331.0 L 345.0,337.5 L 341.5,344.0 L 345.0,350.5 L 351.0,354.5 L 357.0,358.5 L 362.5,363.0 L 367.5,368.0 L 372.0,373.5 L 376.5,379.0 L 381.0,384.5 L 384.5,391.0 L 388.5,397.0 L 392.0,403.5 L 395.0,410.5 L 396.5,416.0 L 391.5,411.0 L 386.5,406.0 L 381.5,401.0 L 376.0,396.5 L 370.5,392.0 L 365.0,387.5 L 359.0,383.5 L 353.0,379.5 L 346.5,376.0 L 340.5,372.0 L 332.5,371.0 L 329.5,378.0 L 327.5,386.0 L 325.5,394.0 L 323.5,402.0 L 321.5,410.0 L 319.5,418.0 L 317.5,426.0 L 315.5,434.0 L 313.5,442.0 L 311.0,449.5 L 308.5,457.0 L 306.5,465.0 L 303.5,472.0 L 301.5,480.0 L 298.5,487.0 L 296.0,494.5 L 293.5,502.0 L 290.5,509.0 L 288.5,517.0 L 285.5,524.0 L 283.5,532.0 L 281.0,539.5 L 278.5,547.0 L 276.5,555.0 L 274.5,563.0 L 272.5,571.0 L 270.5,579.0 L 268.5,587.0 L 267.5,596.0 L 265.5,604.0 L 263.5,612.0 L 262.5,621.0 L 261.5,630.0 L 255.0,633.5 L 245.0,633.5 Z" stroke="none" fill="rgb(78,201,176)" fill-rule="nonzero" transform="translate(-512, -512)"/>
|
|
11
|
+
<path d="M 533.0,910.5 L 525.0,908.5 L 518.0,905.5 L 511.0,902.5 L 504.0,899.5 L 503.0,895.5 L 509.0,891.5 L 515.0,887.5 L 521.0,883.5 L 527.0,879.5 L 533.0,875.5 L 538.5,871.0 L 544.5,867.0 L 550.5,863.0 L 556.5,859.0 L 561.5,854.0 L 567.0,849.5 L 572.0,844.5 L 577.0,839.5 L 582.5,835.0 L 588.0,830.5 L 593.0,825.5 L 598.0,820.5 L 603.0,815.5 L 608.0,810.5 L 613.0,805.5 L 617.5,800.0 L 622.5,795.0 L 627.5,790.0 L 632.5,785.0 L 637.0,779.5 L 642.0,774.5 L 647.0,769.5 L 651.5,764.0 L 655.5,758.0 L 659.0,751.5 L 663.5,746.0 L 668.0,740.5 L 672.5,735.0 L 676.5,729.0 L 680.5,723.0 L 684.5,717.0 L 688.5,711.0 L 692.5,705.0 L 696.5,699.0 L 700.5,693.0 L 704.0,686.5 L 708.0,680.5 L 712.0,674.5 L 716.0,668.5 L 719.5,662.0 L 723.0,655.5 L 726.5,649.0 L 729.5,642.0 L 733.5,636.0 L 736.5,629.0 L 739.5,622.0 L 743.5,616.0 L 746.5,609.0 L 750.5,603.0 L 753.5,596.0 L 757.0,589.5 L 760.5,583.0 L 763.5,576.0 L 766.5,569.0 L 769.5,562.0 L 772.5,555.0 L 774.5,547.0 L 777.5,540.0 L 781.0,533.5 L 783.5,526.0 L 786.0,518.5 L 788.5,511.0 L 790.5,503.0 L 793.0,495.5 L 795.5,488.0 L 797.5,480.0 L 800.5,473.0 L 802.5,465.0 L 804.5,457.0 L 807.0,449.5 L 808.5,441.0 L 810.5,433.0 L 812.5,425.0 L 814.5,417.0 L 815.5,408.0 L 817.5,400.0 L 818.5,391.0 L 820.0,382.5 L 821.5,374.0 L 822.5,365.0 L 823.5,356.0 L 824.5,347.0 L 825.5,338.0 L 826.5,329.0 L 826.5,319.0 L 828.0,310.5 L 832.0,314.5 L 835.5,321.0 L 838.5,328.0 L 842.0,334.5 L 845.5,341.0 L 848.5,348.0 L 851.0,355.5 L 853.5,363.0 L 856.5,370.0 L 859.5,377.0 L 862.5,384.0 L 864.5,392.0 L 866.5,400.0 L 866.5,410.0 L 865.5,419.0 L 863.5,427.0 L 862.0,435.5 L 859.5,443.0 L 857.0,450.5 L 854.5,458.0 L 852.5,466.0 L 850.0,473.5 L 847.5,481.0 L 845.5,489.0 L 842.5,496.0 L 840.5,504.0 L 837.5,511.0 L 835.0,518.5 L 832.5,526.0 L 829.0,532.5 L 826.5,540.0 L 823.0,546.5 L 819.5,553.0 L 816.5,560.0 L 814.0,567.5 L 811.0,574.5 L 808.0,581.5 L 805.0,588.5 L 802.0,595.5 L 798.5,602.0 L 795.0,608.5 L 791.5,615.0 L 788.5,622.0 L 785.0,628.5 L 781.5,635.0 L 778.0,641.5 L 773.5,647.0 L 769.5,653.0 L 766.0,659.5 L 762.5,666.0 L 758.5,672.0 L 755.0,678.5 L 750.5,684.0 L 746.5,690.0 L 743.5,697.0 L 739.5,703.0 L 735.5,709.0 L 732.0,715.5 L 728.0,721.5 L 723.5,727.0 L 718.5,732.0 L 715.0,738.5 L 711.0,744.5 L 706.5,750.0 L 701.5,755.0 L 697.0,760.5 L 692.5,766.0 L 688.5,772.0 L 684.5,778.0 L 680.0,783.5 L 675.5,789.0 L 670.5,794.0 L 666.0,799.5 L 661.0,804.5 L 656.0,809.5 L 651.0,814.5 L 646.5,820.0 L 641.5,825.0 L 636.5,830.0 L 631.5,835.0 L 626.5,840.0 L 621.5,845.0 L 616.5,850.0 L 611.0,854.5 L 606.0,859.5 L 600.5,864.0 L 595.0,868.5 L 589.5,873.0 L 583.5,877.0 L 577.5,881.0 L 572.0,885.5 L 566.0,889.5 L 560.5,894.0 L 554.5,898.0 L 548.5,902.0 L 542.0,905.5 L 536.0,909.5 Z" stroke="none" fill="rgb(78,201,176)" fill-rule="nonzero" transform="translate(-512, -512)"/>
|
|
12
|
+
<path d="M 98.0,634.5 L 88.0,634.5 L 82.5,630.0 L 83.5,621.0 L 85.5,613.0 L 87.5,605.0 L 88.5,596.0 L 90.5,588.0 L 92.5,580.0 L 94.5,572.0 L 96.5,564.0 L 98.5,556.0 L 100.5,548.0 L 102.5,540.0 L 105.5,533.0 L 108.5,526.0 L 111.5,519.0 L 114.5,512.0 L 117.0,504.5 L 119.5,497.0 L 123.0,490.5 L 126.0,483.5 L 129.5,477.0 L 132.5,470.0 L 135.5,463.0 L 139.5,457.0 L 142.5,450.0 L 147.0,444.5 L 151.0,438.5 L 154.5,432.0 L 158.5,426.0 L 162.5,420.0 L 166.0,413.5 L 169.5,407.0 L 173.5,401.0 L 177.5,395.0 L 182.0,389.5 L 187.0,384.5 L 191.5,379.0 L 196.0,373.5 L 201.0,368.5 L 206.0,363.5 L 211.0,358.5 L 216.0,353.5 L 221.0,348.5 L 226.0,343.5 L 231.5,339.0 L 236.5,334.0 L 242.0,329.5 L 247.5,325.0 L 253.0,320.5 L 250.5,325.0 L 246.0,330.5 L 241.0,335.5 L 236.5,341.0 L 232.0,346.5 L 227.5,352.0 L 223.0,357.5 L 218.5,363.0 L 214.0,368.5 L 210.0,374.5 L 205.5,380.0 L 201.0,385.5 L 196.5,391.0 L 192.5,397.0 L 188.0,402.5 L 184.0,408.5 L 180.5,415.0 L 177.0,421.5 L 173.5,428.0 L 169.5,434.0 L 166.0,440.5 L 162.5,447.0 L 158.5,453.0 L 154.5,459.0 L 151.0,465.5 L 147.5,472.0 L 144.5,479.0 L 141.5,486.0 L 139.5,494.0 L 136.5,501.0 L 133.5,508.0 L 130.0,514.5 L 127.5,522.0 L 125.0,529.5 L 122.5,537.0 L 120.5,545.0 L 117.5,552.0 L 115.5,560.0 L 113.5,568.0 L 111.5,576.0 L 109.5,584.0 L 107.5,592.0 L 106.0,600.5 L 104.5,609.0 L 102.5,617.0 L 101.5,626.0 L 99.0,633.5 Z" stroke="none" fill="rgb(78,201,176)" fill-rule="nonzero" transform="translate(-512, -512)"/>
|
|
13
|
+
<path d="M 616.0,939.5 L 607.0,938.5 L 599.0,936.5 L 592.0,933.5 L 585.0,930.5 L 578.0,927.5 L 580.5,923.0 L 586.5,919.0 L 592.5,915.0 L 598.5,911.0 L 604.0,906.5 L 610.0,902.5 L 616.0,898.5 L 622.0,894.5 L 627.5,890.0 L 633.0,885.5 L 638.0,880.5 L 643.5,876.0 L 648.5,871.0 L 653.5,866.0 L 658.5,861.0 L 663.5,856.0 L 669.0,851.5 L 674.0,846.5 L 680.0,842.5 L 684.5,837.0 L 689.5,832.0 L 694.0,826.5 L 698.5,821.0 L 703.5,816.0 L 708.0,810.5 L 712.5,805.0 L 717.5,800.0 L 722.5,795.0 L 727.5,790.0 L 732.0,784.5 L 736.5,779.0 L 740.5,773.0 L 744.5,767.0 L 749.0,761.5 L 754.0,756.5 L 759.0,751.5 L 763.5,746.0 L 767.5,740.0 L 771.5,734.0 L 775.5,728.0 L 779.5,722.0 L 783.0,715.5 L 787.0,709.5 L 791.0,703.5 L 794.5,697.0 L 798.5,691.0 L 802.0,684.5 L 805.5,678.0 L 810.0,672.5 L 814.5,667.0 L 818.5,661.0 L 821.5,654.0 L 825.0,647.5 L 828.5,641.0 L 831.5,634.0 L 835.5,628.0 L 838.5,621.0 L 842.5,615.0 L 846.0,608.5 L 849.5,602.0 L 853.5,596.0 L 856.5,589.0 L 860.5,583.0 L 863.5,576.0 L 866.5,569.0 L 869.0,561.5 L 872.0,554.5 L 875.5,548.0 L 878.5,541.0 L 882.0,534.5 L 885.5,528.0 L 888.5,521.0 L 892.5,520.0 L 892.5,530.0 L 893.5,539.0 L 893.5,549.0 L 894.5,558.0 L 895.5,567.0 L 896.5,576.0 L 896.5,586.0 L 896.5,596.0 L 896.5,606.0 L 894.5,614.0 L 891.5,621.0 L 888.0,627.5 L 884.5,634.0 L 881.0,640.5 L 877.0,646.5 L 873.5,653.0 L 870.0,659.5 L 866.0,665.5 L 862.5,672.0 L 858.5,678.0 L 855.0,684.5 L 851.0,690.5 L 846.5,696.0 L 842.5,702.0 L 838.5,708.0 L 834.5,714.0 L 830.5,720.0 L 826.5,726.0 L 822.5,732.0 L 818.5,738.0 L 814.5,744.0 L 809.5,749.0 L 805.0,754.5 L 801.0,760.5 L 797.0,766.5 L 792.5,772.0 L 788.0,777.5 L 783.0,782.5 L 778.5,788.0 L 774.5,794.0 L 770.5,800.0 L 766.0,805.5 L 761.0,810.5 L 756.5,816.0 L 751.5,821.0 L 746.5,826.0 L 741.5,831.0 L 736.5,836.0 L 731.5,841.0 L 726.5,846.0 L 721.5,851.0 L 716.5,856.0 L 712.0,861.5 L 707.0,866.5 L 702.0,871.5 L 697.0,876.5 L 691.5,881.0 L 686.0,885.5 L 681.0,890.5 L 676.0,895.5 L 670.5,900.0 L 665.0,904.5 L 659.0,908.5 L 653.5,913.0 L 647.5,917.0 L 642.0,921.5 L 636.5,926.0 L 630.5,930.0 L 625.0,934.5 L 618.5,938.0 Z" stroke="none" fill="rgb(78,201,176)" fill-rule="nonzero" transform="translate(-512, -512)"/>
|
|
14
|
+
<path d="M 703.0,971.5 L 694.0,970.5 L 687.0,967.5 L 679.0,965.5 L 672.0,962.5 L 665.0,959.5 L 663.0,952.5 L 669.0,948.5 L 675.0,944.5 L 681.0,940.5 L 686.5,936.0 L 692.0,931.5 L 698.0,927.5 L 703.5,923.0 L 709.0,918.5 L 715.0,914.5 L 720.5,910.0 L 726.0,905.5 L 731.5,901.0 L 736.5,896.0 L 742.0,891.5 L 747.0,886.5 L 752.0,881.5 L 757.0,876.5 L 762.0,871.5 L 767.0,866.5 L 772.0,861.5 L 777.0,856.5 L 782.0,851.5 L 787.0,846.5 L 791.5,841.0 L 796.5,836.0 L 800.5,830.0 L 805.0,824.5 L 809.5,819.0 L 814.0,813.5 L 818.5,808.0 L 823.5,803.0 L 828.0,797.5 L 833.0,792.5 L 837.5,787.0 L 842.0,781.5 L 846.0,775.5 L 850.0,769.5 L 854.5,764.0 L 859.0,758.5 L 863.0,752.5 L 867.0,746.5 L 871.5,741.0 L 875.5,735.0 L 880.0,729.5 L 884.0,723.5 L 888.5,721.0 L 886.5,729.0 L 884.5,737.0 L 882.5,745.0 L 880.5,753.0 L 878.5,761.0 L 876.5,769.0 L 874.5,777.0 L 872.5,785.0 L 870.5,793.0 L 868.0,800.5 L 866.0,808.5 L 864.0,816.5 L 861.5,824.0 L 857.5,830.0 L 852.5,835.0 L 848.0,840.5 L 843.5,846.0 L 839.0,851.5 L 834.5,857.0 L 830.0,862.5 L 825.0,867.5 L 820.5,873.0 L 815.5,878.0 L 810.5,883.0 L 805.5,888.0 L 800.5,893.0 L 795.0,897.5 L 790.0,902.5 L 784.5,907.0 L 779.0,911.5 L 774.0,916.5 L 768.5,921.0 L 763.0,925.5 L 758.0,930.5 L 752.5,935.0 L 747.0,939.5 L 741.5,944.0 L 736.0,948.5 L 730.0,952.5 L 724.5,957.0 L 718.5,961.0 L 713.0,965.5 L 707.0,969.5 Z" stroke="none" fill="rgb(78,201,176)" fill-rule="nonzero" transform="translate(-512, -512)"/>
|
|
15
|
+
</g>
|
|
16
|
+
<!-- DEXTO text with white X (matching other letters) -->
|
|
17
|
+
<path d="M3308 3142 l-78 -3 0 -54 0 -55 113 0 c123 0 175 -16 230 -68 106 -100 85 -301 -38 -377 -45 -28 -56 -30 -174 -35 l-126 -5 0 -55 0 -55 95 -1 c164 -1 270 36 354 126 91 97 112 246 52 377 -68 149 -203 214 -428 205z"/>
|
|
18
|
+
<!-- X now white like other letters -->
|
|
19
|
+
<path d="M4758 3142 l-57 -3 125 -174 c68 -95 124 -176 124 -179 0 -3 -54 -81 -120 -173 l-120 -168 66 -3 c36 -2 71 2 78 7 7 6 48 63 91 126 43 63 80 115 81 115 2 0 42 -56 90 -125 l87 -125 68 0 69 0 -57 83 c-32 45 -141 202 -243 349 -122 176 -192 267 -205 270 -11 2 -46 2 -77 0z"/>
|
|
20
|
+
<path d="M5724 3141 c-2 -2 -4 -109 -4 -238 l0 -233 65 0 65 0 0 234 0 234 -61 4 c-33 1 -63 1 -65 -1z"/>
|
|
21
|
+
<path d="M4000 3085 l0 -55 260 0 260 0 0 55 0 55 -260 0 -260 0 0 -55z"/>
|
|
22
|
+
<!-- Small part of X also white -->
|
|
23
|
+
<path d="M5165 3083 c-22 -32 -48 -71 -59 -89 l-19 -32 36 -46 35 -47 73 103 c40 57 84 118 97 136 l24 32 -73 0 -74 -1 -40 -56z"/>
|
|
24
|
+
<path d="M6413 3119 c-66 -25 -147 -98 -178 -159 -13 -26 -29 -75 -34 -108 -9 -54 -8 -76 4 -148 6 -36 54 -123 92 -165 39 -43 106 -82 161 -94 l32 -7 0 55 c0 54 0 54 -41 72 -51 24 -106 87 -120 139 -18 65 -6 167 25 220 27 47 75 89 114 101 19 6 22 13 22 61 0 62 -1 62 -77 33z"/>
|
|
25
|
+
<path d="M6600 3086 c0 -50 2 -55 28 -64 42 -14 100 -69 124 -116 27 -52 29 -162 4 -221 -19 -44 -73 -105 -93 -105 -7 0 -13 -4 -13 -9 0 -5 -11 -12 -25 -15 -23 -6 -25 -11 -25 -62 l0 -56 33 7 c84 19 188 99 227 174 25 51 43 146 37 200 -17 137 -85 236 -202 292 -88 42 -95 40 -95 -25z"/>
|
|
26
|
+
<path d="M4000 2785 l0 -55 235 0 235 0 0 55 0 55 -235 0 -235 0 0 -55z"/>
|
|
27
|
+
<path d="M4000 2495 l0 -55 265 0 265 0 0 55 0 55 -265 0 -265 0 0 -55z"/>
|
|
28
|
+
<path d="M5500 2495 l0 -55 285 0 285 0 0 55 0 55 -285 0 -285 0 0 -55z"/>
|
|
29
|
+
</g>
|
|
30
|
+
</g>
|
|
31
|
+
</svg>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface UsageSummaryResponse {
|
|
2
|
+
credits_usd: number;
|
|
3
|
+
mtd_usage: {
|
|
4
|
+
total_cost_usd: number;
|
|
5
|
+
total_requests: number;
|
|
6
|
+
by_model: Record<string, {
|
|
7
|
+
requests: number;
|
|
8
|
+
cost_usd: number;
|
|
9
|
+
tokens: number;
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
12
|
+
recent: Array<{
|
|
13
|
+
timestamp: string;
|
|
14
|
+
model: string;
|
|
15
|
+
cost_usd: number;
|
|
16
|
+
input_tokens: number;
|
|
17
|
+
output_tokens: number;
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Dexto API client for key management
|
|
22
|
+
*/
|
|
23
|
+
export declare class DextoApiClient {
|
|
24
|
+
private readonly baseUrl;
|
|
25
|
+
private readonly timeoutMs;
|
|
26
|
+
constructor(baseUrl?: string);
|
|
27
|
+
/**
|
|
28
|
+
* Validate if a Dexto API key is valid
|
|
29
|
+
*/
|
|
30
|
+
validateDextoApiKey(apiKey: string): Promise<boolean>;
|
|
31
|
+
/**
|
|
32
|
+
* Provision Dexto API key (get existing or create new with given name)
|
|
33
|
+
* @param regenerate - If true, delete existing key and create new one
|
|
34
|
+
*/
|
|
35
|
+
provisionDextoApiKey(authToken: string, name?: string, regenerate?: boolean): Promise<{
|
|
36
|
+
dextoApiKey: string;
|
|
37
|
+
keyId: string;
|
|
38
|
+
isNewKey: boolean;
|
|
39
|
+
}>;
|
|
40
|
+
/**
|
|
41
|
+
* Get usage summary (balance + MTD usage + recent history)
|
|
42
|
+
*/
|
|
43
|
+
getUsageSummary(apiKey: string): Promise<UsageSummaryResponse>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Get default Dexto API client
|
|
47
|
+
*/
|
|
48
|
+
export declare function getDextoApiClient(): DextoApiClient;
|
|
49
|
+
//# sourceMappingURL=api-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../../../src/cli/auth/api-client.ts"],"names":[],"mappings":"AAqBA,MAAM,WAAW,oBAAoB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE;QACP,cAAc,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,MAAM,CAAC;QACvB,QAAQ,EAAE,MAAM,CACZ,MAAM,EACN;YACI,QAAQ,EAAE,MAAM,CAAC;YACjB,QAAQ,EAAE,MAAM,CAAC;YACjB,MAAM,EAAE,MAAM,CAAC;SAClB,CACJ,CAAC;KACL,CAAC;IACF,MAAM,EAAE,KAAK,CAAC;QACV,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;QACrB,aAAa,EAAE,MAAM,CAAC;KACzB,CAAC,CAAC;CACN;AAED;;GAEG;AACH,qBAAa,cAAc;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAU;gBAExB,OAAO,GAAE,MAAsB;IAI3C;;OAEG;IACG,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAwB3D;;;OAGG;IACG,oBAAoB,CACtB,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE,MAAwB,EAC9B,UAAU,GAAE,OAAe,GAC5B,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC;IA0DrE;;OAEG;IACG,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAwBvE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,CAElD"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// packages/cli/src/cli/auth/api-client.ts
|
|
2
|
+
// Dexto API client for key management and usage
|
|
3
|
+
// TODO: Migrate to typed client for type safety and better DX
|
|
4
|
+
// Options:
|
|
5
|
+
// 1. Migrate dexto-web APIs to Hono and use @hono/client (like packages/server)
|
|
6
|
+
// 2. Use openapi-fetch with generated types from OpenAPI spec
|
|
7
|
+
// 3. Use tRPC if we want full-stack type safety
|
|
8
|
+
// Currently using plain fetch() with manual type definitions.
|
|
9
|
+
import { logger } from '@dexto/core';
|
|
10
|
+
import { DEXTO_API_URL } from './constants.js';
|
|
11
|
+
/**
|
|
12
|
+
* Dexto API client for key management
|
|
13
|
+
*/
|
|
14
|
+
export class DextoApiClient {
|
|
15
|
+
baseUrl;
|
|
16
|
+
timeoutMs = 10_000; // 10 second timeout for API calls
|
|
17
|
+
constructor(baseUrl = DEXTO_API_URL) {
|
|
18
|
+
this.baseUrl = baseUrl;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Validate if a Dexto API key is valid
|
|
22
|
+
*/
|
|
23
|
+
async validateDextoApiKey(apiKey) {
|
|
24
|
+
try {
|
|
25
|
+
logger.debug('Validating DEXTO_API_KEY');
|
|
26
|
+
const response = await fetch(`${this.baseUrl}/keys/validate`, {
|
|
27
|
+
method: 'GET',
|
|
28
|
+
headers: {
|
|
29
|
+
Authorization: `Bearer ${apiKey}`,
|
|
30
|
+
},
|
|
31
|
+
signal: AbortSignal.timeout(this.timeoutMs),
|
|
32
|
+
});
|
|
33
|
+
if (!response.ok) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
const result = await response.json();
|
|
37
|
+
return result.valid;
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
logger.error(`Error validating Dexto API key: ${error}`);
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Provision Dexto API key (get existing or create new with given name)
|
|
46
|
+
* @param regenerate - If true, delete existing key and create new one
|
|
47
|
+
*/
|
|
48
|
+
async provisionDextoApiKey(authToken, name = 'Dexto CLI Key', regenerate = false) {
|
|
49
|
+
try {
|
|
50
|
+
logger.debug(`Provisioning DEXTO_API_KEY with name: ${name}, regenerate: ${regenerate}`);
|
|
51
|
+
const response = await fetch(`${this.baseUrl}/keys/provision`, {
|
|
52
|
+
method: 'POST',
|
|
53
|
+
headers: {
|
|
54
|
+
Authorization: `Bearer ${authToken}`,
|
|
55
|
+
'Content-Type': 'application/json',
|
|
56
|
+
},
|
|
57
|
+
body: JSON.stringify({ name, regenerate }),
|
|
58
|
+
signal: AbortSignal.timeout(this.timeoutMs),
|
|
59
|
+
});
|
|
60
|
+
if (!response.ok) {
|
|
61
|
+
const errorText = await response.text();
|
|
62
|
+
throw new Error(`API request failed: ${response.status} ${errorText}`);
|
|
63
|
+
}
|
|
64
|
+
const result = await response.json();
|
|
65
|
+
if (!result.success) {
|
|
66
|
+
throw new Error(result.error || 'Failed to provision Dexto API key');
|
|
67
|
+
}
|
|
68
|
+
if (!result.keyId) {
|
|
69
|
+
throw new Error('Invalid response from API');
|
|
70
|
+
}
|
|
71
|
+
// If isNewKey is false, the key already exists (we don't get the key value back)
|
|
72
|
+
// This is expected - the key was already provisioned
|
|
73
|
+
if (!result.isNewKey && !result.dextoApiKey) {
|
|
74
|
+
logger.debug(`DEXTO_API_KEY already exists: ${result.keyId}`);
|
|
75
|
+
return {
|
|
76
|
+
dextoApiKey: '', // Empty - key already exists, not returned for security
|
|
77
|
+
keyId: result.keyId,
|
|
78
|
+
isNewKey: false,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
if (!result.dextoApiKey) {
|
|
82
|
+
throw new Error('Invalid response from API - missing key');
|
|
83
|
+
}
|
|
84
|
+
logger.debug(`Successfully provisioned DEXTO_API_KEY: ${result.keyId}`);
|
|
85
|
+
return {
|
|
86
|
+
dextoApiKey: result.dextoApiKey,
|
|
87
|
+
keyId: result.keyId,
|
|
88
|
+
isNewKey: result.isNewKey ?? true,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
logger.error(`Error provisioning Dexto API key: ${error}`);
|
|
93
|
+
throw error;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Get usage summary (balance + MTD usage + recent history)
|
|
98
|
+
*/
|
|
99
|
+
async getUsageSummary(apiKey) {
|
|
100
|
+
try {
|
|
101
|
+
logger.debug('Fetching usage summary');
|
|
102
|
+
const response = await fetch(`${this.baseUrl}/me/usage`, {
|
|
103
|
+
method: 'GET',
|
|
104
|
+
headers: {
|
|
105
|
+
Authorization: `Bearer ${apiKey}`,
|
|
106
|
+
},
|
|
107
|
+
signal: AbortSignal.timeout(this.timeoutMs),
|
|
108
|
+
});
|
|
109
|
+
if (!response.ok) {
|
|
110
|
+
const errorText = await response.text();
|
|
111
|
+
throw new Error(`API request failed: ${response.status} ${errorText}`);
|
|
112
|
+
}
|
|
113
|
+
const result = await response.json();
|
|
114
|
+
return result;
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
logger.error(`Error fetching usage summary: ${error}`);
|
|
118
|
+
throw error;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Get default Dexto API client
|
|
124
|
+
*/
|
|
125
|
+
export function getDextoApiClient() {
|
|
126
|
+
return new DextoApiClient();
|
|
127
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dexto's Supabase configuration for CLI authentication.
|
|
3
|
+
*
|
|
4
|
+
* SECURITY NOTE:
|
|
5
|
+
* The Supabase anon key is safe to hardcode in distributed code because:
|
|
6
|
+
* 1. It's designed for client-side use (web browsers, mobile apps, CLIs)
|
|
7
|
+
* 2. It only grants anonymous access - real security is enforced by Row Level Security (RLS)
|
|
8
|
+
* 3. This is standard practice (Vercel CLI, Supabase CLI, Firebase CLI all do the same)
|
|
9
|
+
*
|
|
10
|
+
* The service role key (which has admin access) is NEVER in this codebase.
|
|
11
|
+
*
|
|
12
|
+
* Environment variable overrides (for local development):
|
|
13
|
+
* - SUPABASE_URL: Override Supabase URL (e.g., http://localhost:54321)
|
|
14
|
+
* - SUPABASE_ANON_KEY: Override anon key (from `supabase start` output)
|
|
15
|
+
* - DEXTO_API_URL: Override Dexto API URL (e.g., http://localhost:3001)
|
|
16
|
+
*/
|
|
17
|
+
export declare const SUPABASE_URL: string;
|
|
18
|
+
export declare const SUPABASE_ANON_KEY: string;
|
|
19
|
+
/**
|
|
20
|
+
* Dexto API URL for key provisioning
|
|
21
|
+
*/
|
|
22
|
+
export declare const DEXTO_API_URL: string;
|
|
23
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/cli/auth/constants.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,YAAY,QAAyE,CAAC;AACnG,eAAO,MAAM,iBAAiB,QAEwL,CAAC;AAEvN;;GAEG;AACH,eAAO,MAAM,aAAa,QAAsD,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// packages/cli/src/cli/auth/constants.ts
|
|
2
|
+
/**
|
|
3
|
+
* Dexto's Supabase configuration for CLI authentication.
|
|
4
|
+
*
|
|
5
|
+
* SECURITY NOTE:
|
|
6
|
+
* The Supabase anon key is safe to hardcode in distributed code because:
|
|
7
|
+
* 1. It's designed for client-side use (web browsers, mobile apps, CLIs)
|
|
8
|
+
* 2. It only grants anonymous access - real security is enforced by Row Level Security (RLS)
|
|
9
|
+
* 3. This is standard practice (Vercel CLI, Supabase CLI, Firebase CLI all do the same)
|
|
10
|
+
*
|
|
11
|
+
* The service role key (which has admin access) is NEVER in this codebase.
|
|
12
|
+
*
|
|
13
|
+
* Environment variable overrides (for local development):
|
|
14
|
+
* - SUPABASE_URL: Override Supabase URL (e.g., http://localhost:54321)
|
|
15
|
+
* - SUPABASE_ANON_KEY: Override anon key (from `supabase start` output)
|
|
16
|
+
* - DEXTO_API_URL: Override Dexto API URL (e.g., http://localhost:3001)
|
|
17
|
+
*/
|
|
18
|
+
export const SUPABASE_URL = process.env.SUPABASE_URL || 'https://gdfbxznhnnsamvsrtwjq.supabase.co';
|
|
19
|
+
export const SUPABASE_ANON_KEY = process.env.SUPABASE_ANON_KEY ||
|
|
20
|
+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImdkZmJ4em5obm5zYW12c3J0d2pxIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjQwNjkzNjksImV4cCI6MjA3OTY0NTM2OX0.j2NWOJDOy8gTT84XeomalkGSPpLdPvTCBnQMrTgdlI4';
|
|
21
|
+
/**
|
|
22
|
+
* Dexto API URL for key provisioning
|
|
23
|
+
*/
|
|
24
|
+
export const DEXTO_API_URL = process.env.DEXTO_API_URL || 'https://api.dexto.ai';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { type AuthConfig, storeAuth, loadAuth, removeAuth, isAuthenticated, getAuthToken, getDextoApiKey, getAuthFilePath, } from './service.js';
|
|
2
|
+
export { type OAuthResult, performOAuthLogin, DEFAULT_OAUTH_CONFIG } from './oauth.js';
|
|
3
|
+
export { type UsageSummaryResponse, DextoApiClient, getDextoApiClient } from './api-client.js';
|
|
4
|
+
export { SUPABASE_URL, SUPABASE_ANON_KEY, DEXTO_API_URL } from './constants.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/auth/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,KAAK,UAAU,EACf,SAAS,EACT,QAAQ,EACR,UAAU,EACV,eAAe,EACf,YAAY,EACZ,cAAc,EACd,eAAe,GAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,KAAK,WAAW,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvF,OAAO,EAAE,KAAK,oBAAoB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAE/F,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// packages/cli/src/cli/auth/index.ts
|
|
2
|
+
// Public exports for auth module
|
|
3
|
+
export { storeAuth, loadAuth, removeAuth, isAuthenticated, getAuthToken, getDextoApiKey, getAuthFilePath, } from './service.js';
|
|
4
|
+
export { performOAuthLogin, DEFAULT_OAUTH_CONFIG } from './oauth.js';
|
|
5
|
+
export { DextoApiClient, getDextoApiClient } from './api-client.js';
|
|
6
|
+
export { SUPABASE_URL, SUPABASE_ANON_KEY, DEXTO_API_URL } from './constants.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
interface OAuthConfig {
|
|
2
|
+
authUrl: string;
|
|
3
|
+
clientId: string;
|
|
4
|
+
provider?: string;
|
|
5
|
+
scopes?: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface OAuthResult {
|
|
8
|
+
accessToken: string;
|
|
9
|
+
refreshToken?: string | undefined;
|
|
10
|
+
expiresIn?: number | undefined;
|
|
11
|
+
user?: {
|
|
12
|
+
id: string;
|
|
13
|
+
email: string;
|
|
14
|
+
name?: string | undefined;
|
|
15
|
+
} | undefined;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Perform OAuth login flow with Supabase
|
|
19
|
+
*/
|
|
20
|
+
export declare function performOAuthLogin(config: OAuthConfig): Promise<OAuthResult>;
|
|
21
|
+
/**
|
|
22
|
+
* Default Supabase OAuth configuration for Dexto CLI
|
|
23
|
+
*/
|
|
24
|
+
export declare const DEFAULT_OAUTH_CONFIG: OAuthConfig;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=oauth.d.ts.map
|