dexto 1.7.2 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -7
- package/dist/agents/coding-agent/coding-agent.yml +0 -5
- package/dist/agents/default-agent.yml +0 -6
- package/dist/cli/auth/api-client.d.ts +9 -7
- package/dist/cli/auth/api-client.d.ts.map +1 -1
- package/dist/cli/auth/api-client.js +42 -64
- package/dist/cli/auth/device.d.ts +2 -2
- package/dist/cli/auth/device.d.ts.map +1 -1
- package/dist/cli/auth/device.js +3 -12
- package/dist/cli/auth/index.d.ts +2 -1
- package/dist/cli/auth/index.d.ts.map +1 -1
- package/dist/cli/auth/index.js +1 -1
- package/dist/cli/auth/login-persistence.d.ts +2 -0
- package/dist/cli/auth/login-persistence.d.ts.map +1 -1
- package/dist/cli/auth/login-persistence.js +12 -0
- package/dist/cli/auth/types.d.ts +4 -5
- package/dist/cli/auth/types.d.ts.map +1 -1
- package/dist/cli/cloud-chat.d.ts.map +1 -1
- package/dist/cli/cloud-chat.js +65 -24
- package/dist/cli/commands/auth/login.d.ts +4 -1
- package/dist/cli/commands/auth/login.d.ts.map +1 -1
- package/dist/cli/commands/auth/login.js +7 -8
- package/dist/cli/commands/auth/register.d.ts.map +1 -1
- package/dist/cli/commands/auth/register.js +2 -0
- package/dist/cli/commands/create-image.d.ts.map +1 -1
- package/dist/cli/commands/create-image.js +1 -13
- package/dist/cli/commands/init-app.d.ts +1 -1
- package/dist/cli/commands/init-app.d.ts.map +1 -1
- package/dist/cli/commands/init-app.js +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +19 -27
- package/dist/cli/commands/run/headless.d.ts.map +1 -1
- package/dist/cli/commands/run/headless.js +75 -65
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +2 -1
- package/dist/cli/modes/cli.js +2 -2
- package/dist/cli/utils/api-key-setup.d.ts +1 -1
- package/dist/cli/utils/api-key-setup.d.ts.map +1 -1
- package/dist/cli/utils/api-key-verification.d.ts +1 -1
- package/dist/cli/utils/api-key-verification.d.ts.map +1 -1
- package/dist/cli/utils/config-validation.d.ts.map +1 -1
- package/dist/cli/utils/config-validation.js +3 -1
- package/dist/cli/utils/options.js +1 -1
- package/dist/cli/utils/project-utils.d.ts +1 -1
- package/dist/cli/utils/project-utils.d.ts.map +1 -1
- package/dist/cli/utils/project-utils.js +2 -1
- package/dist/cli/utils/provider-setup.d.ts +1 -1
- package/dist/cli/utils/provider-setup.d.ts.map +1 -1
- package/dist/cli/utils/provider-setup.js +1 -1
- package/dist/cli/utils/scaffolding-utils.d.ts.map +1 -1
- package/dist/cli/utils/scaffolding-utils.js +1 -9
- package/dist/cli/utils/template-engine.d.ts +0 -12
- package/dist/cli/utils/template-engine.d.ts.map +1 -1
- package/dist/cli/utils/template-engine.js +5 -116
- package/dist/config/cli-overrides.d.ts +2 -1
- package/dist/config/cli-overrides.d.ts.map +1 -1
- package/dist/config/cli-overrides.js +2 -1
- package/dist/config/effective-llm.d.ts +1 -1
- package/dist/config/effective-llm.d.ts.map +1 -1
- package/dist/index-main.js +12 -7
- package/dist/webui/assets/{index-UG5Fuw_8.js → index-CiIdc81a.js} +178 -178
- package/dist/webui/index.html +1 -1
- package/package.json +13 -12
|
@@ -6,6 +6,7 @@ export function registerAuthCommand({ program }) {
|
|
|
6
6
|
.description('Login to Dexto')
|
|
7
7
|
.option('--api-key <key>', 'Use Dexto API key instead of device-code login')
|
|
8
8
|
.option('--token <token>', 'Use an existing Supabase access token')
|
|
9
|
+
.option('--platform-url <url>', 'Use a custom Dexto platform URL for device-code login')
|
|
9
10
|
.option('--no-interactive', 'Disable interactive prompts')
|
|
10
11
|
.action(withAnalytics('auth login', async (options) => {
|
|
11
12
|
try {
|
|
@@ -59,6 +60,7 @@ export function registerAuthCommand({ program }) {
|
|
|
59
60
|
.description('Login to Dexto (alias for `dexto auth login`)')
|
|
60
61
|
.option('--api-key <key>', 'Use Dexto API key instead of device-code login')
|
|
61
62
|
.option('--token <token>', 'Use an existing Supabase access token')
|
|
63
|
+
.option('--platform-url <url>', 'Use a custom Dexto platform URL for device-code login')
|
|
62
64
|
.option('--no-interactive', 'Disable interactive prompts')
|
|
63
65
|
.action(withAnalytics('login', async (options) => {
|
|
64
66
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-image.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/create-image.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-image.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/create-image.ts"],"names":[],"mappings":"AA0BA;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA0OhE"}
|
|
@@ -3,7 +3,7 @@ import * as p from '@clack/prompts';
|
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import { selectOrExit, textOrExit } from '../utils/prompt-helpers.js';
|
|
5
5
|
import { promptForProjectName, createProjectDirectory, setupGitRepo, createGitignore, initPackageJson, createTsconfigForImage, getDextoVersionRange, installDependencies, pinDextoPackageIfUnversioned, ensureDirectory, } from '../utils/scaffolding-utils.js';
|
|
6
|
-
import { generateDextoImageFile, generateImageReadme, generateExampleTool, generateExampleHook, generateExampleCompaction,
|
|
6
|
+
import { generateDextoImageFile, generateImageReadme, generateExampleTool, generateExampleHook, generateExampleCompaction, } from '../utils/template-engine.js';
|
|
7
7
|
import fs from 'fs-extra';
|
|
8
8
|
import { getExecutionContext } from '@dexto/agent-management';
|
|
9
9
|
/**
|
|
@@ -91,15 +91,6 @@ export async function createImage(name) {
|
|
|
91
91
|
await ensureDirectory('compaction/example-compaction');
|
|
92
92
|
const exampleCompactionCode = generateExampleCompaction('example-compaction');
|
|
93
93
|
await fs.writeFile('compaction/example-compaction/index.ts', exampleCompactionCode);
|
|
94
|
-
await ensureDirectory('storage/cache/example-cache');
|
|
95
|
-
const exampleCacheCode = generateExampleCacheFactory('example-cache');
|
|
96
|
-
await fs.writeFile('storage/cache/example-cache/index.ts', exampleCacheCode);
|
|
97
|
-
await ensureDirectory('storage/database/example-database');
|
|
98
|
-
const exampleDatabaseCode = generateExampleDatabaseFactory('example-database');
|
|
99
|
-
await fs.writeFile('storage/database/example-database/index.ts', exampleDatabaseCode);
|
|
100
|
-
await ensureDirectory('storage/blob/example-blob');
|
|
101
|
-
const exampleBlobCode = generateExampleBlobStoreFactory('example-blob');
|
|
102
|
-
await fs.writeFile('storage/blob/example-blob/index.ts', exampleBlobCode);
|
|
103
94
|
spinner.message('Generating configuration files...');
|
|
104
95
|
// Create dexto.image.ts
|
|
105
96
|
const dextoImageContent = generateDextoImageFile({
|
|
@@ -171,9 +162,6 @@ export async function createImage(name) {
|
|
|
171
162
|
console.log(` ${chalk.gray('$')} pnpm run build`);
|
|
172
163
|
console.log(`\n${chalk.gray('Add your custom providers to the convention-based folders:')}`);
|
|
173
164
|
console.log(` ${chalk.gray('tools/')} - Tool factories`);
|
|
174
|
-
console.log(` ${chalk.gray('storage/blob/')} - Blob storage factories`);
|
|
175
|
-
console.log(` ${chalk.gray('storage/database/')} - Database factories`);
|
|
176
|
-
console.log(` ${chalk.gray('storage/cache/')} - Cache factories`);
|
|
177
165
|
console.log(` ${chalk.gray('compaction/')} - Compaction factories`);
|
|
178
166
|
console.log(` ${chalk.gray('hooks/')} - Hook factories`);
|
|
179
167
|
console.log(`\n${chalk.gray('Install into the Dexto CLI:')}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-app.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init-app.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,WAAW,EAA8B,MAAM,
|
|
1
|
+
{"version":3,"file":"init-app.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init-app.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,WAAW,EAA8B,MAAM,YAAY,CAAC;AAe1E;;;GAGG;AACH,wBAAsB,0BAA0B,IAAI,OAAO,CAAC;IACxD,WAAW,EAAE,WAAW,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,OAAO,CAAC;CAC9B,CAAC,CA2ED;AAED;;;;;;GAMG;AACH,wBAAsB,SAAS,CAC3B,SAAS,EAAE,MAAM,EACjB,iBAAiB,UAAO,EACxB,WAAW,CAAC,EAAE,WAAW,EACzB,SAAS,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CA6Ff;AAED,mFAAmF;AACnF,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,iBAQpD;AACD;;;;GAIG;AACH,wBAAsB,sBAAsB,CACxC,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAA;CAAE,CAAC,CAWxD;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CACxC,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,WAAW,GAAG,SAAS,CAAA;CAAE,GAAG,SAAS,GAChE,OAAO,CAAC,MAAM,CAAC,CAgBjB"}
|
|
@@ -5,7 +5,7 @@ import fsExtra from 'fs-extra';
|
|
|
5
5
|
import path from 'node:path';
|
|
6
6
|
import { getPackageManager, getPackageManagerInstallCommand } from '../utils/package-mgmt.js';
|
|
7
7
|
import { executeWithTimeout } from '../utils/execute.js';
|
|
8
|
-
import { getDefaultModelForProvider } from '@dexto/
|
|
8
|
+
import { getDefaultModelForProvider } from '@dexto/llm';
|
|
9
9
|
import { saveProviderApiKey } from '@dexto/agent-management';
|
|
10
10
|
import { getProviderDisplayName, isValidApiKeyFormat, PROVIDER_OPTIONS, } from '../utils/provider-setup.js';
|
|
11
11
|
import { generateIndexFor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B,aAAa,GAAE,MAAsB,GACtC,OAAO,CAAC,2BAA2B,CAAC,CAqCtC;AAED,wBAAsB,mCAAmC,CACrD,eAAe,EAAE,MAAM,EACvB,aAAa,GAAE,MAAsB,GACtC,OAAO,CAAC,2BAA2B,CAAC,CAmDtC;AA8GD,wBAAsB,sBAAsB,CACxC,aAAa,GAAE,MAAsB,GACtC,OAAO,CAAC,qBAAqB,CAAC,CA8ChC;AA4ED,wBAAsB,iBAAiB,CAAC,aAAa,GAAE,MAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsB5F;AAED,wBAAsB,sBAAsB,CACxC,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,OAAO,GAAE,uBAA4B,EACrC,aAAa,GAAE,MAAsB,GACtC,OAAO,CAAC,IAAI,CAAC,CAuDf;AAED,wBAAsB,sBAAsB,CACxC,OAAO,EAAE,MAAM,EACf,aAAa,GAAE,MAAsB,GACtC,OAAO,CAAC,IAAI,CAAC,CAaf;AAED,wBAAsB,wBAAwB,CAC1C,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,aAAa,GAAE,MAAsB,GACtC,OAAO,CAAC,IAAI,CAAC,CAaf;AAED,wBAAsB,uBAAuB,CACzC,aAAa,GAAE,MAAsB,GACtC,OAAO,CAAC,IAAI,CAAC,CAIf;AAED,wBAAgB,mBAAmB,CAAC,EAAE,OAAO,EAAE,EAAE,0BAA0B,GAAG,IAAI,CAmGjF"}
|
|
@@ -359,7 +359,7 @@ async function generateAgentSystemPromptFromDescription(displayName, roleDescrip
|
|
|
359
359
|
blob: { type: 'in-memory' },
|
|
360
360
|
},
|
|
361
361
|
permissions: {
|
|
362
|
-
mode: 'auto-
|
|
362
|
+
mode: 'auto-approve',
|
|
363
363
|
allowedToolsStorage: 'memory',
|
|
364
364
|
},
|
|
365
365
|
elicitation: {
|
|
@@ -843,13 +843,13 @@ Describe what this skill helps the agent accomplish.
|
|
|
843
843
|
1. Review the relevant context and only open bundled files that are actually needed.
|
|
844
844
|
2. Use \`references/\` for background knowledge, schemas, or examples.
|
|
845
845
|
3. Use \`scripts/\` for deterministic helper code and \`handlers/\` for reusable workflow logic.
|
|
846
|
-
4. Use \`mcps/\` for
|
|
846
|
+
4. Use \`mcps/\` only for inert MCP-related reference/config files; runtime MCP servers must be configured separately.
|
|
847
847
|
5. Return a concise result with any important follow-up actions.
|
|
848
848
|
|
|
849
849
|
## Bundled Resources
|
|
850
850
|
- \`handlers/\`: Reusable workflow helpers or code snippets this skill can point to
|
|
851
851
|
- \`scripts/\`: Executable helpers for deterministic or repetitive tasks
|
|
852
|
-
- \`mcps/\`: MCP
|
|
852
|
+
- \`mcps/\`: Inert MCP-related reference/config files bundled with this skill
|
|
853
853
|
- \`references/\`: Docs, schemas, examples, or domain notes to load on demand
|
|
854
854
|
|
|
855
855
|
## Output Format
|
|
@@ -862,8 +862,6 @@ function buildCreateSkillStarterTemplate() {
|
|
|
862
862
|
return `---
|
|
863
863
|
name: "${STARTER_SKILL_ID}"
|
|
864
864
|
description: "Create or update Dexto skill bundles with SKILL.md, handlers, scripts, mcps, and references."
|
|
865
|
-
toolkits: ["creator-tools"]
|
|
866
|
-
allowed-tools: ["skill_create", "skill_update", "skill_refresh", "skill_search", "skill_list", "tool_catalog"]
|
|
867
865
|
---
|
|
868
866
|
|
|
869
867
|
# Create Skill
|
|
@@ -879,21 +877,18 @@ Create or update standalone Dexto skill bundles. Treat \`skills/<id>/\` as the c
|
|
|
879
877
|
- \`references/\` for larger docs, copied external material, schemas, examples, or policies
|
|
880
878
|
- \`scripts/\` for deterministic helpers
|
|
881
879
|
- \`handlers/\` for reusable workflow logic or structured helper code
|
|
882
|
-
- \`mcps/\` for MCP
|
|
883
|
-
- When a skill needs a real bundled MCP server, prefer the SDK-based stdio pattern in \`references/mcp-server-pattern.md\`
|
|
880
|
+
- \`mcps/\` for inert MCP-related reference/config files
|
|
884
881
|
6. Prefer extending existing skills or references over duplicating content.
|
|
885
882
|
7. If you edit \`SKILL.md\` or bundled files with non-creator tools, run \`skill_refresh\` before relying on the skill in the current session.
|
|
886
|
-
8. Creating \`mcps/*.json\` only creates bundled
|
|
883
|
+
8. Creating \`mcps/*.json\` only creates inert bundled files. Configure runtime MCP servers through normal MCP configuration paths.
|
|
887
884
|
|
|
888
885
|
## Authoring Rules
|
|
889
886
|
- Default to workspace scope.
|
|
890
|
-
- Default to no extra toolkits and no \`allowed-tools\` unless the skill needs them.
|
|
891
887
|
- Keep most actionable instructions in \`SKILL.md\` so the agent can act without opening extra files.
|
|
892
888
|
- Use \`references/\` sparingly for larger copied docs, external references, schemas, examples, or policies.
|
|
893
889
|
- Keep references one level deep from \`SKILL.md\` and link them explicitly.
|
|
894
890
|
- Reuse language and conventions from nearby skills when possible.
|
|
895
|
-
- If you
|
|
896
|
-
- For real bundled MCPs, prefer the official \`@modelcontextprotocol/sdk\` server APIs with \`StdioServerTransport\`. Avoid hand-rolled Content-Length framing unless the user explicitly asks for low-level protocol code.
|
|
891
|
+
- If you update bundled resources outside creator tools, run \`skill_refresh\` so the current session reloads the latest skill content before invoking it.
|
|
897
892
|
|
|
898
893
|
## SKILL.md Structure
|
|
899
894
|
- \`# <Title>\`
|
|
@@ -905,7 +900,6 @@ Create or update standalone Dexto skill bundles. Treat \`skills/<id>/\` as the c
|
|
|
905
900
|
|
|
906
901
|
## Resource Guide
|
|
907
902
|
Read \`references/skill-anatomy.md\` when you need the bundle layout or packaging checklist.
|
|
908
|
-
Read \`references/mcp-server-pattern.md\` when the skill needs a bundled MCP server implementation.
|
|
909
903
|
`;
|
|
910
904
|
}
|
|
911
905
|
function buildCreateSkillStarterReference() {
|
|
@@ -925,7 +919,7 @@ skills/<skill-id>/
|
|
|
925
919
|
- \`SKILL.md\`: The trigger, workflow, and navigation entrypoint.
|
|
926
920
|
- \`handlers/\`: Reusable helper code or structured workflow fragments the skill can reference.
|
|
927
921
|
- \`scripts/\`: Deterministic helpers the agent can run instead of rewriting logic.
|
|
928
|
-
- \`mcps/\`:
|
|
922
|
+
- \`mcps/\`: Inert MCP-related reference/config files. These files are not loaded as runtime MCP configuration by skills.
|
|
929
923
|
- \`references/\`: Supporting material the agent should open only when needed, especially larger copied docs, schemas, external references, or long examples.
|
|
930
924
|
|
|
931
925
|
## Creation Checklist
|
|
@@ -933,32 +927,31 @@ skills/<skill-id>/
|
|
|
933
927
|
2. Pick a kebab-case id and concise description.
|
|
934
928
|
3. Keep actionable workflow in \`SKILL.md\`; move only larger reference material into \`references/\`.
|
|
935
929
|
4. Add scripts or handlers only when they remove repeated work or improve reliability.
|
|
936
|
-
5. Add
|
|
930
|
+
5. Add files under \`mcps/\` only when they are useful as inert bundled references.
|
|
937
931
|
6. Reference bundled files from \`SKILL.md\` using relative paths.
|
|
938
932
|
|
|
939
933
|
## MCP Notes
|
|
940
|
-
-
|
|
941
|
-
-
|
|
942
|
-
-
|
|
943
|
-
-
|
|
944
|
-
- Run \`skill_refresh\` after editing bundled files so the running session reloads the latest skill content and MCP metadata.
|
|
934
|
+
- Files under \`mcps/\` are bundled content only.
|
|
935
|
+
- Skills do not register or connect MCP servers from \`mcps/\`.
|
|
936
|
+
- Configure runtime MCP servers through normal agent MCP configuration paths.
|
|
937
|
+
- Run \`skill_refresh\` after editing bundled files so the running session reloads the latest skill content.
|
|
945
938
|
`;
|
|
946
939
|
}
|
|
947
940
|
function buildCreateSkillMcpReference() {
|
|
948
941
|
return `# MCP Server Pattern
|
|
949
942
|
|
|
950
|
-
Use this pattern when
|
|
943
|
+
Use this pattern only as reference material when authoring MCP servers. Skills do not register or connect MCP servers from bundled files.
|
|
951
944
|
|
|
952
945
|
## Preferred Approach
|
|
953
946
|
- Use the official \`@modelcontextprotocol/sdk\` server APIs.
|
|
954
947
|
- Use \`StdioServerTransport\` for bundled local servers.
|
|
955
|
-
- Keep
|
|
948
|
+
- Keep any example MCP config in \`mcps/*.json\` simple and skill-relative.
|
|
956
949
|
- Prefer \`.mjs\` for bundled MCP server scripts to avoid CommonJS/ESM ambiguity.
|
|
957
950
|
|
|
958
951
|
## Avoid
|
|
959
952
|
- Do not hand-roll MCP framing with manual \`Content-Length\` parsing unless the user explicitly asks for low-level protocol code.
|
|
960
953
|
- Do not claim the MCP works just because the script exists or passes \`node --check\`.
|
|
961
|
-
- Do not
|
|
954
|
+
- Do not imply \`mcps/*.json\` activates an MCP server.
|
|
962
955
|
|
|
963
956
|
## Minimal Server Template
|
|
964
957
|
\`\`\`js
|
|
@@ -1037,13 +1030,12 @@ await server.connect(transport);
|
|
|
1037
1030
|
\`\`\`
|
|
1038
1031
|
|
|
1039
1032
|
## Verification Sequence
|
|
1040
|
-
1. Create or update \`SKILL.md\`, \`scripts/\`, and \`mcps
|
|
1033
|
+
1. Create or update \`SKILL.md\`, \`scripts/\`, and any inert \`mcps/\` reference files.
|
|
1041
1034
|
2. Run \`skill_refresh\` after non-creator file edits.
|
|
1042
|
-
3. Invoke the skill in the current session.
|
|
1043
|
-
4.
|
|
1044
|
-
5. Call the MCP tool once with a simple input and confirm the result.
|
|
1035
|
+
3. Invoke the skill in the current session and confirm the updated instructions load.
|
|
1036
|
+
4. Configure and verify runtime MCP servers separately through normal MCP configuration paths.
|
|
1045
1037
|
|
|
1046
|
-
If
|
|
1038
|
+
If the skill instructions do not refresh, the skill is not done yet.
|
|
1047
1039
|
`;
|
|
1048
1040
|
}
|
|
1049
1041
|
function buildSkillExtraFiles(skillId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headless.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/run/headless.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,KAAK,UAAU,EAIlB,MAAM,aAAa,CAAC;AAWrB,MAAM,MAAM,iBAAiB,GAAG;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,KAAK,CAAC;CACtB,CAAC;AA0IF,wBAAsB,qBAAqB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,O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C,CAuH5B;AAED,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAM1F;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAM/D;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAExD"}
|
|
@@ -169,79 +169,89 @@ export async function executeHeadlessRun(agent, sessionId, prompt) {
|
|
|
169
169
|
let finalMessage;
|
|
170
170
|
let totalTokens;
|
|
171
171
|
let fatalError;
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
case 'tool:running': {
|
|
186
|
-
const runningCall = toolCallState.get(event.toolCallId);
|
|
187
|
-
if (runningCall) {
|
|
188
|
-
runningCall.startedAt = Date.now();
|
|
172
|
+
try {
|
|
173
|
+
for await (const event of await agent.stream(prompt, sessionId)) {
|
|
174
|
+
switch (event.name) {
|
|
175
|
+
case 'llm:tool-call': {
|
|
176
|
+
const callKey = event.callId ?? `anonymous-${++anonymousToolCallCounter}`;
|
|
177
|
+
const call = {
|
|
178
|
+
toolName: event.toolName,
|
|
179
|
+
args: event.args,
|
|
180
|
+
startedAt: Date.now(),
|
|
181
|
+
};
|
|
182
|
+
toolCallState.set(callKey, call);
|
|
183
|
+
writeHeadlessTaggedLine('TOOL', formatToolInvocationForHeadless(call.toolName, call.args));
|
|
184
|
+
break;
|
|
189
185
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
let matchedCall = matchedCallKey ? toolCallState.get(matchedCallKey) : undefined;
|
|
195
|
-
if (!matchedCall) {
|
|
196
|
-
const reverseEntries = Array.from(toolCallState.entries()).reverse();
|
|
197
|
-
const fallback = reverseEntries.find(([, call]) => call.toolName === event.toolName);
|
|
198
|
-
if (fallback) {
|
|
199
|
-
matchedCallKey = fallback[0];
|
|
200
|
-
matchedCall = fallback[1];
|
|
186
|
+
case 'tool:running': {
|
|
187
|
+
const runningCall = toolCallState.get(event.toolCallId);
|
|
188
|
+
if (runningCall) {
|
|
189
|
+
runningCall.startedAt = Date.now();
|
|
201
190
|
}
|
|
191
|
+
break;
|
|
202
192
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
193
|
+
case 'llm:tool-result': {
|
|
194
|
+
let matchedCallKey = event.callId;
|
|
195
|
+
let matchedCall = matchedCallKey
|
|
196
|
+
? toolCallState.get(matchedCallKey)
|
|
197
|
+
: undefined;
|
|
198
|
+
if (!matchedCall) {
|
|
199
|
+
const reverseEntries = Array.from(toolCallState.entries()).reverse();
|
|
200
|
+
const fallback = reverseEntries.find(([, call]) => call.toolName === event.toolName);
|
|
201
|
+
if (fallback) {
|
|
202
|
+
matchedCallKey = fallback[0];
|
|
203
|
+
matchedCall = fallback[1];
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
const toolName = matchedCall?.toolName ?? event.toolName;
|
|
207
|
+
const args = matchedCall?.args ?? {};
|
|
208
|
+
const invocation = formatToolInvocationForHeadless(toolName, args);
|
|
209
|
+
const durationText = matchedCall
|
|
210
|
+
? ` in ${formatHeadlessDuration(Date.now() - matchedCall.startedAt)}`
|
|
211
|
+
: '';
|
|
212
|
+
const statusTag = event.success ? 'TOOL:OK' : 'TOOL:ERR';
|
|
213
|
+
writeHeadlessTaggedLine(statusTag, `${invocation}${durationText}`);
|
|
214
|
+
const output = extractToolOutputForHeadless(event);
|
|
215
|
+
if (output && output.trim().length > 0) {
|
|
216
|
+
writeHeadlessTaggedBlock('TOOL:OUT', truncateOutputForHeadless(output));
|
|
217
|
+
}
|
|
218
|
+
if (matchedCallKey) {
|
|
219
|
+
toolCallState.delete(matchedCallKey);
|
|
220
|
+
}
|
|
221
|
+
break;
|
|
214
222
|
}
|
|
215
|
-
|
|
216
|
-
|
|
223
|
+
case 'llm:response': {
|
|
224
|
+
finalMessage = event.content;
|
|
225
|
+
totalTokens = getTotalTokensFromResponse(event);
|
|
226
|
+
break;
|
|
217
227
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
finalMessage = event.content;
|
|
222
|
-
totalTokens = getTotalTokensFromResponse(event);
|
|
223
|
-
break;
|
|
224
|
-
}
|
|
225
|
-
case 'llm:unsupported-input': {
|
|
226
|
-
writeHeadlessTaggedLine('WARNING', event.errors.join('; '));
|
|
227
|
-
break;
|
|
228
|
-
}
|
|
229
|
-
case 'llm:error': {
|
|
230
|
-
if (!event.recoverable) {
|
|
231
|
-
fatalError = event.error;
|
|
232
|
-
writeHeadlessTaggedLine('ERROR', event.error.message);
|
|
228
|
+
case 'llm:unsupported-input': {
|
|
229
|
+
writeHeadlessTaggedLine('WARNING', event.errors.join('; '));
|
|
230
|
+
break;
|
|
233
231
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
232
|
+
case 'llm:error': {
|
|
233
|
+
if (!event.recoverable) {
|
|
234
|
+
fatalError = event.error;
|
|
235
|
+
writeHeadlessTaggedLine('ERROR', event.error.message);
|
|
236
|
+
}
|
|
237
|
+
break;
|
|
240
238
|
}
|
|
241
|
-
|
|
239
|
+
case 'run:complete': {
|
|
240
|
+
if (event.finishReason === 'error' && event.error) {
|
|
241
|
+
fatalError = event.error;
|
|
242
|
+
writeHeadlessTaggedLine('ERROR', event.error.message);
|
|
243
|
+
}
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
default:
|
|
247
|
+
break;
|
|
242
248
|
}
|
|
243
|
-
|
|
244
|
-
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
catch (error) {
|
|
252
|
+
if (fatalError === undefined) {
|
|
253
|
+
fatalError = error instanceof Error ? error : new Error(String(error));
|
|
254
|
+
writeHeadlessTaggedLine('ERROR', fatalError.message);
|
|
245
255
|
}
|
|
246
256
|
}
|
|
247
257
|
const result = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/setup.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/setup.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmExB,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA8ClB,CAAC;AAEP,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAClE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAsKtE;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAsC9F"}
|
|
@@ -4,7 +4,8 @@ import path from 'node:path';
|
|
|
4
4
|
import chalk from 'chalk';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import open from 'open';
|
|
7
|
-
import { acceptsAnyModel,
|
|
7
|
+
import { acceptsAnyModel, getDefaultModelForProvider, getReasoningProfile, getSupportedModels, isValidProviderModel, LLM_PROVIDERS, LLM_REGISTRY, requiresApiKey, supportsCustomModels, } from '@dexto/llm';
|
|
8
|
+
import { CodexAppServerClient, createCodexBaseURL, getCodexAuthModeLabel, getCodexProviderDisplayName, getCuratedModelsForProvider, isCodexBaseURL, logger, parseCodexBaseURL, resolveApiKeyForProvider, } from '@dexto/core';
|
|
8
9
|
import { createInitialPreferences, saveGlobalPreferences, loadGlobalPreferences, getGlobalPreferencesPath, updateGlobalPreferences, setActiveModel, isDextoAuthEnabled, loadCustomModels, saveCustomModel, deleteCustomModel, globalPreferencesExist, getDextoGlobalPath, } from '@dexto/agent-management';
|
|
9
10
|
import { interactiveApiKeySetup, hasApiKeyConfigured } from '../utils/api-key-setup.js';
|
|
10
11
|
import { selectProvider, getProviderDisplayName, getProviderEnvVar, providerRequiresBaseURL, getDefaultModel, } from '../utils/provider-setup.js';
|
package/dist/cli/modes/cli.js
CHANGED
|
@@ -166,7 +166,7 @@ export async function runCliMode(context) {
|
|
|
166
166
|
console.info = noOp;
|
|
167
167
|
let inkError = undefined;
|
|
168
168
|
try {
|
|
169
|
-
const [{ startInkCliRefactored, setTuiRuntimeServices }, { registerGracefulShutdown }, { applyLayeredEnvironmentLoading }, { getProviderDisplayName, isValidApiKeyFormat, getProviderInstructions }, { performDeviceCodeLogin,
|
|
169
|
+
const [{ startInkCliRefactored, setTuiRuntimeServices }, { registerGracefulShutdown }, { applyLayeredEnvironmentLoading }, { getProviderDisplayName, isValidApiKeyFormat, getProviderInstructions }, { performDeviceCodeLogin, persistDeviceApiKeyLoginResult, ensureDextoApiKeyForAuthToken, loadAuth, storeAuth, removeAuth, removeDextoApiKeyFromEnv, buildDextoBillingUrl, openDextoBillingPage, }, { isUsingDextoCredits }, { canUseDextoProvider }, { capture },] = await Promise.all([
|
|
170
170
|
import('@dexto/tui'),
|
|
171
171
|
import('../../utils/graceful-shutdown.js'),
|
|
172
172
|
import('../../utils/env.js'),
|
|
@@ -186,7 +186,7 @@ export async function runCliMode(context) {
|
|
|
186
186
|
isValidApiKeyFormat,
|
|
187
187
|
getProviderInstructions,
|
|
188
188
|
performDeviceCodeLogin,
|
|
189
|
-
|
|
189
|
+
persistDeviceApiKeyLoginResult,
|
|
190
190
|
ensureDextoApiKeyForAuthToken,
|
|
191
191
|
loadAuth,
|
|
192
192
|
storeAuth,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-key-setup.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/api-key-setup.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"api-key-setup.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/api-key-setup.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAc9C,MAAM,WAAW,iBAAiB;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CACxC,QAAQ,EAAE,WAAW,EACrB,OAAO,GAAE;IACL,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CACb,GACP,OAAO,CAAC,iBAAiB,CAAC,CAmK5B;AA8GD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,WAAW,GAAG,OAAO,CAGlE;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CACxC,QAAQ,EAAE,WAAW,EACrB,KAAK,EAAE,MAAM,GACd,OAAO,CAAC,wBAAwB,CAAC,CAkEnC;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,MAAM,EAAE,SAAS,GAAG,aAAa,GAAG,QAAQ,CAAC;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;GASG;AACH,wBAAsB,2BAA2B,CAC7C,aAAa,EAAE,WAAW,EAC1B,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,WAAW,EACzB,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,uBAAuB,CAAC,CAiGlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-key-verification.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/api-key-verification.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"api-key-verification.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/api-key-verification.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAG9C,MAAM,WAAW,kBAAkB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,wBAAsB,YAAY,CAC9B,QAAQ,EAAE,WAAW,EACrB,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,kBAAkB,CAAC,CA0C7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-validation.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/config-validation.ts"],"names":[],"mappings":"AAGA,OAAO,EAEH,KAAK,WAAW,EAChB,KAAK,oBAAoB,EAC5B,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"config-validation.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/config-validation.ts"],"names":[],"mappings":"AAGA,OAAO,EAEH,KAAK,WAAW,EAChB,KAAK,oBAAoB,EAC5B,MAAM,qBAAqB,CAAC;AAU7B,MAAM,WAAW,gBAAgB;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;CAClD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,mBAAmB,CACrC,MAAM,EAAE,WAAW,EACnB,WAAW,GAAE,OAAe,EAC5B,OAAO,CAAC,EAAE,iBAAiB,GAC5B,OAAO,CAAC,gBAAgB,CAAC,CAsC3B;AAuMD;;GAEG"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import * as p from '@clack/prompts';
|
|
3
3
|
import { AgentConfigSchema, } from '@dexto/agent-config';
|
|
4
|
-
import { getPrimaryApiKeyEnvVar,
|
|
4
|
+
import { getPrimaryApiKeyEnvVar, resolveApiKeyForProvider } from '@dexto/agent-management';
|
|
5
|
+
import { requiresApiKey, requiresBaseURL } from '@dexto/llm';
|
|
6
|
+
import { logger } from '@dexto/core';
|
|
5
7
|
import { getGlobalPreferencesPath } from '@dexto/agent-management';
|
|
6
8
|
import { getBundledSyncTargetForAgentPath, handleSyncAgentsCommand, } from '../commands/agents/sync.js';
|
|
7
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-utils.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/project-utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,WAAW,
|
|
1
|
+
{"version":3,"file":"project-utils.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/project-utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,WAAW,EAA8B,MAAM,YAAY,CAAC;AAG1E;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACvC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,WAAW,GACzB,OAAO,CAAC,IAAI,CAAC,CAUf"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// packages/cli/src/cli/utils/project-utils.ts
|
|
2
2
|
import fs from 'node:fs/promises';
|
|
3
3
|
import { parseDocument } from 'yaml';
|
|
4
|
-
import { getDefaultModelForProvider
|
|
4
|
+
import { getDefaultModelForProvider } from '@dexto/llm';
|
|
5
|
+
import { getPrimaryApiKeyEnvVar } from '@dexto/core';
|
|
5
6
|
/**
|
|
6
7
|
* Updates the LLM provider information in a dexto config file
|
|
7
8
|
* Used for project creation/initialization (modifies agent yml files)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-setup.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/provider-setup.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,KAAK,WAAW,EAInB,MAAM,
|
|
1
|
+
{"version":3,"file":"provider-setup.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/provider-setup.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,KAAK,WAAW,EAInB,MAAM,YAAY,CAAC;AAGpB;;GAEG;AACH,KAAK,gBAAgB,GAAG,aAAa,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,YAAY,CAAC;AAErF;;GAEG;AACH,UAAU,cAAc;IACpB,KAAK,EAAE,WAAW,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,iB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,GAAG,MAAM,CAY7D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,WAAW,GAAG,MAAM,CAE/D"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import * as p from '@clack/prompts';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import open from 'open';
|
|
5
|
-
import { LLM_PROVIDERS, LLM_REGISTRY, getDefaultModelForProvider, } from '@dexto/
|
|
5
|
+
import { LLM_PROVIDERS, LLM_REGISTRY, getDefaultModelForProvider, } from '@dexto/llm';
|
|
6
6
|
import { getPrimaryApiKeyEnvVar } from '@dexto/agent-management';
|
|
7
7
|
/**
|
|
8
8
|
* Provider configuration registry
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffolding-utils.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/scaffolding-utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AA8CpC,wBAAgB,kBAAkB,IAAI,MAAM,CAM3C;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAOrE;AAED,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAYvE;AAED,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAK5F;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMpE;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACtC,WAAW,GAAE,MAA2B,EACxC,aAAa,GAAE,MAAiD,GACjE,OAAO,CAAC,MAAM,CAAC,CAmBjB;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CACxC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,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AE,MAAM,EACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,OAAO,CAAC,IAAI,CAAC,CAMf;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpE"}
|
|
@@ -235,15 +235,7 @@ export async function createTsconfigForImage(projectPath) {
|
|
|
235
235
|
allowSyntheticDefaultImports: true,
|
|
236
236
|
types: ['node'],
|
|
237
237
|
},
|
|
238
|
-
include: [
|
|
239
|
-
'dexto.image.ts',
|
|
240
|
-
'tools/**/*',
|
|
241
|
-
'storage/blob/**/*',
|
|
242
|
-
'storage/database/**/*',
|
|
243
|
-
'storage/cache/**/*',
|
|
244
|
-
'compaction/**/*',
|
|
245
|
-
'hooks/**/*',
|
|
246
|
-
],
|
|
238
|
+
include: ['dexto.image.ts', 'tools/**/*', 'compaction/**/*', 'hooks/**/*'],
|
|
247
239
|
exclude: ['node_modules', 'dist'],
|
|
248
240
|
};
|
|
249
241
|
await fs.writeJSON(path.join(projectPath, 'tsconfig.json'), tsconfig, { spaces: 2 });
|
|
@@ -57,18 +57,6 @@ export declare function generateExampleHook(hookName: string): string;
|
|
|
57
57
|
* Generates an example custom compaction factory
|
|
58
58
|
*/
|
|
59
59
|
export declare function generateExampleCompaction(compactionType: string): string;
|
|
60
|
-
/**
|
|
61
|
-
* Generates an example in-memory cache factory
|
|
62
|
-
*/
|
|
63
|
-
export declare function generateExampleCacheFactory(cacheType: string): string;
|
|
64
|
-
/**
|
|
65
|
-
* Generates an example in-memory database factory
|
|
66
|
-
*/
|
|
67
|
-
export declare function generateExampleDatabaseFactory(databaseType: string): string;
|
|
68
|
-
/**
|
|
69
|
-
* Generates an example in-memory blob store factory
|
|
70
|
-
*/
|
|
71
|
-
export declare function generateExampleBlobStoreFactory(blobType: string): string;
|
|
72
60
|
/**
|
|
73
61
|
* Generates README for an app project
|
|
74
62
|
*/
|