dexto 1.5.8 → 1.6.0

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.
Files changed (127) hide show
  1. package/README.md +3 -3
  2. package/dist/agents/agent-template.yml +2 -2
  3. package/dist/agents/coding-agent/README.md +10 -10
  4. package/dist/agents/coding-agent/coding-agent.yml +81 -82
  5. package/dist/agents/default-agent.yml +32 -47
  6. package/dist/agents/explore-agent/explore-agent.yml +3 -6
  7. package/dist/agents/image-editor-agent/image-editor-agent.yml +1 -1
  8. package/dist/agents/nano-banana-agent/nano-banana-agent.yml +1 -1
  9. package/dist/agents/podcast-agent/podcast-agent.yml +1 -1
  10. package/dist/agents/product-name-researcher/product-name-researcher.yml +1 -1
  11. package/dist/agents/sora-video-agent/sora-video-agent.yml +4 -6
  12. package/dist/agents/triage-demo/triage-agent.yml +1 -1
  13. package/dist/analytics/events.d.ts +1 -1
  14. package/dist/analytics/events.d.ts.map +1 -1
  15. package/dist/api/mcp/tool-aggregation-handler.d.ts +2 -2
  16. package/dist/api/server-hono.d.ts +2 -2
  17. package/dist/api/server-hono.d.ts.map +1 -1
  18. package/dist/api/server-hono.js +37 -60
  19. package/dist/cli/approval/cli-approval-handler.d.ts +10 -3
  20. package/dist/cli/approval/cli-approval-handler.d.ts.map +1 -1
  21. package/dist/cli/approval/cli-approval-handler.js +1 -1
  22. package/dist/cli/commands/create-app.d.ts +1 -11
  23. package/dist/cli/commands/create-app.d.ts.map +1 -1
  24. package/dist/cli/commands/create-app.js +21 -545
  25. package/dist/cli/commands/create-image.d.ts.map +1 -1
  26. package/dist/cli/commands/create-image.js +54 -53
  27. package/dist/cli/commands/image.d.ts +52 -0
  28. package/dist/cli/commands/image.d.ts.map +1 -0
  29. package/dist/cli/commands/image.js +118 -0
  30. package/dist/cli/commands/index.d.ts +2 -1
  31. package/dist/cli/commands/index.d.ts.map +1 -1
  32. package/dist/cli/commands/index.js +3 -1
  33. package/dist/cli/commands/init-app.d.ts +4 -8
  34. package/dist/cli/commands/init-app.d.ts.map +1 -1
  35. package/dist/cli/commands/init-app.js +37 -161
  36. package/dist/cli/commands/interactive-commands/command-parser.d.ts +2 -0
  37. package/dist/cli/commands/interactive-commands/command-parser.d.ts.map +1 -1
  38. package/dist/cli/commands/interactive-commands/commands.d.ts +1 -1
  39. package/dist/cli/commands/interactive-commands/commands.d.ts.map +1 -1
  40. package/dist/cli/commands/interactive-commands/commands.js +2 -2
  41. package/dist/cli/commands/interactive-commands/general-commands.js +2 -2
  42. package/dist/cli/commands/interactive-commands/prompt-commands.d.ts.map +1 -1
  43. package/dist/cli/commands/interactive-commands/prompt-commands.js +2 -7
  44. package/dist/cli/commands/interactive-commands/session/index.d.ts +2 -1
  45. package/dist/cli/commands/interactive-commands/session/index.d.ts.map +1 -1
  46. package/dist/cli/commands/interactive-commands/session/index.js +2 -1
  47. package/dist/cli/commands/interactive-commands/session/session-commands.d.ts +2 -2
  48. package/dist/cli/commands/interactive-commands/session/session-commands.js +2 -2
  49. package/dist/cli/commands/interactive-commands/system/system-commands.d.ts.map +1 -1
  50. package/dist/cli/commands/interactive-commands/system/system-commands.js +7 -29
  51. package/dist/cli/commands/plugin.d.ts +4 -4
  52. package/dist/cli/commands/sync-agents.d.ts +2 -12
  53. package/dist/cli/commands/sync-agents.d.ts.map +1 -1
  54. package/dist/cli/commands/sync-agents.js +2 -50
  55. package/dist/cli/ink-cli/InkCLIRefactored.d.ts +7 -1
  56. package/dist/cli/ink-cli/InkCLIRefactored.d.ts.map +1 -1
  57. package/dist/cli/ink-cli/InkCLIRefactored.js +6 -6
  58. package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts +2 -2
  59. package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts.map +1 -1
  60. package/dist/cli/ink-cli/components/ApprovalPrompt.js +15 -14
  61. package/dist/cli/ink-cli/components/BackgroundTasksPanel.js +1 -1
  62. package/dist/cli/ink-cli/components/Footer.d.ts.map +1 -1
  63. package/dist/cli/ink-cli/components/Footer.js +1 -2
  64. package/dist/cli/ink-cli/components/StatusBar.d.ts.map +1 -1
  65. package/dist/cli/ink-cli/components/StatusBar.js +10 -6
  66. package/dist/cli/ink-cli/components/TodoPanel.js +1 -1
  67. package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.js +1 -1
  68. package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts +3 -1
  69. package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts.map +1 -1
  70. package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.js +2 -2
  71. package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts +3 -1
  72. package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts.map +1 -1
  73. package/dist/cli/ink-cli/components/modes/StaticCLI.js +2 -2
  74. package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts +1 -1
  75. package/dist/cli/ink-cli/components/overlays/ToolBrowser.js +8 -8
  76. package/dist/cli/ink-cli/constants/tips.js +1 -1
  77. package/dist/cli/ink-cli/containers/InputContainer.d.ts +4 -0
  78. package/dist/cli/ink-cli/containers/InputContainer.d.ts.map +1 -1
  79. package/dist/cli/ink-cli/containers/InputContainer.js +28 -6
  80. package/dist/cli/ink-cli/containers/OverlayContainer.d.ts +2 -0
  81. package/dist/cli/ink-cli/containers/OverlayContainer.d.ts.map +1 -1
  82. package/dist/cli/ink-cli/containers/OverlayContainer.js +81 -36
  83. package/dist/cli/ink-cli/hooks/useAgentEvents.d.ts.map +1 -1
  84. package/dist/cli/ink-cli/hooks/useAgentEvents.js +15 -16
  85. package/dist/cli/ink-cli/hooks/useTokenCounter.d.ts.map +1 -1
  86. package/dist/cli/ink-cli/hooks/useTokenCounter.js +7 -4
  87. package/dist/cli/ink-cli/services/CommandService.d.ts +1 -1
  88. package/dist/cli/ink-cli/services/CommandService.d.ts.map +1 -1
  89. package/dist/cli/ink-cli/services/CommandService.js +2 -2
  90. package/dist/cli/ink-cli/services/processStream.d.ts +2 -2
  91. package/dist/cli/ink-cli/services/processStream.d.ts.map +1 -1
  92. package/dist/cli/ink-cli/services/processStream.js +12 -13
  93. package/dist/cli/ink-cli/state/types.d.ts +2 -2
  94. package/dist/cli/ink-cli/state/types.d.ts.map +1 -1
  95. package/dist/cli/ink-cli/utils/messageFormatting.d.ts +9 -3
  96. package/dist/cli/ink-cli/utils/messageFormatting.d.ts.map +1 -1
  97. package/dist/cli/ink-cli/utils/messageFormatting.js +42 -155
  98. package/dist/cli/ink-cli/utils/toolUtils.d.ts.map +1 -1
  99. package/dist/cli/ink-cli/utils/toolUtils.js +2 -9
  100. package/dist/cli/utils/config-validation.d.ts +11 -11
  101. package/dist/cli/utils/config-validation.d.ts.map +1 -1
  102. package/dist/cli/utils/config-validation.js +56 -290
  103. package/dist/cli/utils/image-store.d.ts +16 -0
  104. package/dist/cli/utils/image-store.d.ts.map +1 -0
  105. package/dist/cli/utils/image-store.js +289 -0
  106. package/dist/cli/utils/scaffolding-utils.d.ts +5 -0
  107. package/dist/cli/utils/scaffolding-utils.d.ts.map +1 -1
  108. package/dist/cli/utils/scaffolding-utils.js +46 -4
  109. package/dist/cli/utils/template-engine.d.ts +28 -16
  110. package/dist/cli/utils/template-engine.d.ts.map +1 -1
  111. package/dist/cli/utils/template-engine.js +339 -479
  112. package/dist/config/cli-overrides.d.ts +4 -3
  113. package/dist/config/cli-overrides.d.ts.map +1 -1
  114. package/dist/config/cli-overrides.js +7 -9
  115. package/dist/index-main.d.ts +2 -0
  116. package/dist/index-main.d.ts.map +1 -0
  117. package/dist/index-main.js +1554 -0
  118. package/dist/index.js +2 -1589
  119. package/dist/utils/session-logger-factory.d.ts +3 -0
  120. package/dist/utils/session-logger-factory.d.ts.map +1 -0
  121. package/dist/utils/session-logger-factory.js +19 -0
  122. package/dist/webui/assets/{index-Cz2z7NQ8.js → index-DwtueA8l.js} +231 -231
  123. package/dist/webui/index.html +1 -1
  124. package/package.json +10 -7
  125. package/dist/cli/cli-subscriber.d.ts +0 -45
  126. package/dist/cli/cli-subscriber.d.ts.map +0 -1
  127. package/dist/cli/cli-subscriber.js +0 -204
@@ -1,9 +1,9 @@
1
1
  import path from 'path';
2
2
  import * as p from '@clack/prompts';
3
3
  import chalk from 'chalk';
4
- import { selectOrExit, textOrExit, confirmOrExit } from '../utils/prompt-helpers.js';
5
- import { promptForProjectName, createProjectDirectory, setupGitRepo, createGitignore, initPackageJson, createTsconfigForImage, installDependencies, ensureDirectory, } from '../utils/scaffolding-utils.js';
6
- import { generateDextoImageFile, generateImageReadme, generateExampleTool, } from '../utils/template-engine.js';
4
+ import { selectOrExit, textOrExit } from '../utils/prompt-helpers.js';
5
+ import { promptForProjectName, createProjectDirectory, setupGitRepo, createGitignore, initPackageJson, createTsconfigForImage, getDextoVersionRange, installDependencies, pinDextoPackageIfUnversioned, ensureDirectory, } from '../utils/scaffolding-utils.js';
6
+ import { generateDextoImageFile, generateImageReadme, generateExampleTool, generateExampleHook, generateExampleCompaction, generateExampleCacheFactory, generateExampleDatabaseFactory, generateExampleBlobStoreFactory, } from '../utils/template-engine.js';
7
7
  import fs from 'fs-extra';
8
8
  import { getExecutionContext } from '@dexto/agent-management';
9
9
  /**
@@ -25,10 +25,11 @@ export async function createImage(name) {
25
25
  }, 'Image creation cancelled');
26
26
  // Step 3: Starting point - new base or extend existing
27
27
  const startingPoint = await selectOrExit({
28
- message: 'Starting point:',
28
+ message: 'How do you want to start?',
29
+ initialValue: 'extend',
29
30
  options: [
30
- { value: 'base', label: 'New base image (build from scratch)' },
31
- { value: 'extend', label: 'Extend existing image (add providers to base)' },
31
+ { value: 'extend', label: 'Extend existing image (Recommended)' },
32
+ { value: 'base', label: 'New image (from scratch)' },
32
33
  ],
33
34
  }, 'Image creation cancelled');
34
35
  let baseImage;
@@ -41,8 +42,6 @@ export async function createImage(name) {
41
42
  value: '@dexto/image-local',
42
43
  label: '@dexto/image-local (local development)',
43
44
  },
44
- { value: '@dexto/image-cloud', label: '@dexto/image-cloud (cloud production)' },
45
- { value: '@dexto/image-edge', label: '@dexto/image-edge (edge/serverless)' },
46
45
  { value: 'custom', label: 'Custom npm package...' },
47
46
  ],
48
47
  }, 'Image creation cancelled');
@@ -73,40 +72,34 @@ export async function createImage(name) {
73
72
  { value: 'custom', label: 'Custom' },
74
73
  ],
75
74
  }, 'Image creation cancelled');
76
- // Step 6: Include example providers?
77
- const includeExamples = await confirmOrExit({
78
- message: 'Include example tool provider?',
79
- initialValue: true,
80
- }, 'Image creation cancelled');
81
75
  // Start scaffolding
82
76
  const spinner = p.spinner();
83
77
  let projectPath;
84
78
  try {
85
- // Save original cwd before changing directories (for resolving relative paths)
86
- const originalCwd = process.cwd();
87
79
  // Create project directory
88
80
  projectPath = await createProjectDirectory(projectName, spinner);
89
81
  // Change to project directory
90
82
  process.chdir(projectPath);
91
83
  spinner.start('Setting up project structure...');
92
84
  // Create convention-based folders
93
- await ensureDirectory('tools');
94
- await ensureDirectory('blob-store');
95
- await ensureDirectory('compression');
96
- await ensureDirectory('plugins');
97
- // Create .gitkeep files for empty directories
98
- await fs.writeFile('blob-store/.gitkeep', '');
99
- await fs.writeFile('compression/.gitkeep', '');
100
- await fs.writeFile('plugins/.gitkeep', '');
101
- // Create example tool if requested
102
- if (includeExamples) {
103
- await ensureDirectory('tools/example-tool');
104
- const exampleToolCode = generateExampleTool('example-tool');
105
- await fs.writeFile('tools/example-tool/index.ts', exampleToolCode);
106
- }
107
- else {
108
- await fs.writeFile('tools/.gitkeep', '');
109
- }
85
+ await ensureDirectory('tools/example-tool');
86
+ const exampleToolCode = generateExampleTool('example-tool');
87
+ await fs.writeFile('tools/example-tool/index.ts', exampleToolCode);
88
+ await ensureDirectory('hooks/example-hook');
89
+ const exampleHookCode = generateExampleHook('example-hook');
90
+ await fs.writeFile('hooks/example-hook/index.ts', exampleHookCode);
91
+ await ensureDirectory('compaction/example-compaction');
92
+ const exampleCompactionCode = generateExampleCompaction('example-compaction');
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);
110
103
  spinner.message('Generating configuration files...');
111
104
  // Create dexto.image.ts
112
105
  const dextoImageContent = generateDextoImageFile({
@@ -149,28 +142,23 @@ export async function createImage(name) {
149
142
  // Detect if we're in dexto source - use workspace protocol for local development
150
143
  const executionContext = getExecutionContext();
151
144
  const isDextoSource = executionContext === 'dexto-source';
152
- const coreVersion = isDextoSource ? 'workspace:*' : '^1.3.0';
153
- const bundlerVersion = isDextoSource ? 'workspace:*' : '^1.3.0';
145
+ const versionRange = getDextoVersionRange();
146
+ const dextoDependencyVersion = isDextoSource ? 'workspace:*' : versionRange;
154
147
  // Determine dependencies based on whether extending
155
- const dependencies = [`@dexto/core@${coreVersion}`, 'zod'];
148
+ const dependencies = [
149
+ `@dexto/core@${dextoDependencyVersion}`,
150
+ `@dexto/agent-config@${dextoDependencyVersion}`,
151
+ `@dexto/storage@${dextoDependencyVersion}`,
152
+ 'zod@^3.25.0',
153
+ ];
156
154
  const devDependencies = [
157
155
  'typescript@^5.0.0',
158
156
  '@types/node@^20.0.0',
159
- `@dexto/image-bundler@${bundlerVersion}`,
157
+ `@dexto/image-bundler@${dextoDependencyVersion}`,
160
158
  ];
161
159
  if (baseImage) {
162
- // Resolve base image path if we're in dexto source
163
- let resolvedBaseImage = baseImage;
164
- if (isDextoSource && baseImage.startsWith('@dexto/image-')) {
165
- // In dexto source, resolve official images to local workspace packages
166
- // e.g., @dexto/image-local -> packages/image-local
167
- const imagePkgName = baseImage.replace('@dexto/', '');
168
- const imagePkgPath = path.resolve(originalCwd, 'packages', imagePkgName);
169
- if (await fs.pathExists(imagePkgPath)) {
170
- resolvedBaseImage = imagePkgPath;
171
- }
172
- }
173
- dependencies.push(resolvedBaseImage);
160
+ const baseImageDependency = pinDextoPackageIfUnversioned(baseImage, isDextoSource ? dextoDependencyVersion : versionRange);
161
+ dependencies.push(baseImageDependency);
174
162
  }
175
163
  // Install dependencies (use pnpm in dexto source for workspace protocol support)
176
164
  await installDependencies(projectPath, {
@@ -182,11 +170,24 @@ export async function createImage(name) {
182
170
  console.log(` ${chalk.gray('$')} cd ${projectName}`);
183
171
  console.log(` ${chalk.gray('$')} pnpm run build`);
184
172
  console.log(`\n${chalk.gray('Add your custom providers to the convention-based folders:')}`);
185
- console.log(` ${chalk.gray('tools/')} - Custom tool providers`);
186
- console.log(` ${chalk.gray('blob-store/')} - Blob storage providers`);
187
- console.log(` ${chalk.gray('compression/')} - Compression strategies`);
188
- console.log(` ${chalk.gray('plugins/')} - Plugin providers`);
189
- console.log(`\n${chalk.gray('Learn more:')} https://docs.dexto.ai/docs/guides/images\n`);
173
+ 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
+ console.log(` ${chalk.gray('compaction/')} - Compaction factories`);
178
+ console.log(` ${chalk.gray('hooks/')} - Hook factories`);
179
+ console.log(`\n${chalk.gray('Install into the Dexto CLI:')}`);
180
+ if (isDextoSource) {
181
+ console.log(` ${chalk.gray('$')} dexto image install .`);
182
+ console.log(chalk.dim(` (linked install from local directory; workspace:* deps can't be installed into the global store)`));
183
+ }
184
+ else {
185
+ console.log(` ${chalk.gray('$')} npm pack`);
186
+ console.log(` ${chalk.gray('$')} dexto image install ./<generated-file>.tgz`);
187
+ }
188
+ console.log(`\n${chalk.gray('Use it in an agent YAML:')}`);
189
+ console.log(` ${chalk.gray('image:')} '${projectName}'`);
190
+ console.log(` ${chalk.gray('# or:')} dexto --image ${projectName}\n`);
190
191
  }
191
192
  catch (error) {
192
193
  if (spinner) {
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Image CLI Command Handlers
3
+ *
4
+ * Handles CLI commands for image management:
5
+ * - dexto image install <image>
6
+ * - dexto image list
7
+ * - dexto image use <image@version>
8
+ * - dexto image remove <image>[@version]
9
+ * - dexto image doctor
10
+ */
11
+ import { z } from 'zod';
12
+ declare const ImageInstallCommandSchema: z.ZodObject<{
13
+ image: z.ZodString;
14
+ force: z.ZodDefault<z.ZodBoolean>;
15
+ activate: z.ZodDefault<z.ZodBoolean>;
16
+ }, "strict", z.ZodTypeAny, {
17
+ force: boolean;
18
+ image: string;
19
+ activate: boolean;
20
+ }, {
21
+ image: string;
22
+ force?: boolean | undefined;
23
+ activate?: boolean | undefined;
24
+ }>;
25
+ export type ImageInstallCommandOptions = z.output<typeof ImageInstallCommandSchema>;
26
+ export type ImageInstallCommandOptionsInput = z.input<typeof ImageInstallCommandSchema>;
27
+ /**
28
+ * Install an image into the Dexto-managed image store (~/.dexto/images).
29
+ */
30
+ export declare function handleImageInstallCommand(options: ImageInstallCommandOptionsInput): Promise<void>;
31
+ /**
32
+ * List installed images from the local store.
33
+ */
34
+ export declare function handleImageListCommand(): Promise<void>;
35
+ /**
36
+ * Set active version for an installed image.
37
+ */
38
+ export declare function handleImageUseCommand(options: {
39
+ image: string;
40
+ }): Promise<void>;
41
+ /**
42
+ * Remove an image (all versions) or a specific version from the store.
43
+ */
44
+ export declare function handleImageRemoveCommand(options: {
45
+ image: string;
46
+ }): Promise<void>;
47
+ /**
48
+ * Print diagnostics about the local image store.
49
+ */
50
+ export declare function handleImageDoctorCommand(): Promise<void>;
51
+ export {};
52
+ //# sourceMappingURL=image.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/image.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,QAAA,MAAM,yBAAyB;;;;;;;;;;;;EAMlB,CAAC;AAcd,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AACpF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAExF;;GAEG;AACH,wBAAsB,yBAAyB,CAC3C,OAAO,EAAE,+BAA+B,GACzC,OAAO,CAAC,IAAI,CAAC,CAiBf;AAED;;GAEG;AACH,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAgC5D;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CASrF;AAED;;GAEG;AACH,wBAAsB,wBAAwB,CAAC,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAexF;AAED;;GAEG;AACH,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC,CAa9D"}
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Image CLI Command Handlers
3
+ *
4
+ * Handles CLI commands for image management:
5
+ * - dexto image install <image>
6
+ * - dexto image list
7
+ * - dexto image use <image@version>
8
+ * - dexto image remove <image>[@version]
9
+ * - dexto image doctor
10
+ */
11
+ import chalk from 'chalk';
12
+ import { z } from 'zod';
13
+ import { getDefaultImageStoreDir, getImagePackagesDir, getImageRegistryPath, loadImageRegistry, parseImageSpecifier, removeImageFromStore, setActiveImageVersion, } from '@dexto/agent-management';
14
+ import { installImageToStore } from '../utils/image-store.js';
15
+ const ImageInstallCommandSchema = z
16
+ .object({
17
+ image: z.string().min(1),
18
+ force: z.boolean().default(false),
19
+ activate: z.boolean().default(true),
20
+ })
21
+ .strict();
22
+ const ImageUseCommandSchema = z
23
+ .object({
24
+ image: z.string().min(1),
25
+ })
26
+ .strict();
27
+ const ImageRemoveCommandSchema = z
28
+ .object({
29
+ image: z.string().min(1),
30
+ })
31
+ .strict();
32
+ /**
33
+ * Install an image into the Dexto-managed image store (~/.dexto/images).
34
+ */
35
+ export async function handleImageInstallCommand(options) {
36
+ const validated = ImageInstallCommandSchema.parse(options);
37
+ const result = await installImageToStore(validated.image, {
38
+ force: validated.force,
39
+ activate: validated.activate,
40
+ });
41
+ console.log(chalk.green(`✓ ${result.installMode === 'linked' ? 'Linked' : 'Installed'} ${result.id}@${result.version}`));
42
+ console.log(chalk.dim(` Store: ${getDefaultImageStoreDir()}`));
43
+ if (result.installMode === 'linked') {
44
+ console.log(chalk.dim(` Source: ${result.installDir}`));
45
+ }
46
+ console.log(chalk.dim(` Entry: ${result.entryFile}`));
47
+ }
48
+ /**
49
+ * List installed images from the local store.
50
+ */
51
+ export async function handleImageListCommand() {
52
+ const storeDir = getDefaultImageStoreDir();
53
+ const registry = loadImageRegistry(storeDir);
54
+ const ids = Object.keys(registry.images).sort();
55
+ if (ids.length === 0) {
56
+ console.log(chalk.yellow('No images installed.'));
57
+ console.log('');
58
+ console.log('Install one with:');
59
+ console.log(chalk.cyan(' dexto image install <package-or-path>'));
60
+ return;
61
+ }
62
+ console.log(chalk.bold(`Installed Images (${ids.length}):`));
63
+ console.log('');
64
+ for (const id of ids) {
65
+ const entry = registry.images[id];
66
+ if (!entry)
67
+ continue;
68
+ const active = entry.active;
69
+ const versions = Object.keys(entry.installed).sort();
70
+ const versionLabel = active
71
+ ? `${chalk.green(active)}${versions.length > 1 ? chalk.dim(` (+${versions.length - 1})`) : ''}`
72
+ : chalk.dim('(no active version)');
73
+ console.log(` ${chalk.cyan(id)} ${versionLabel}`);
74
+ }
75
+ console.log('');
76
+ console.log(chalk.dim(`Registry: ${getImageRegistryPath(storeDir)}`));
77
+ console.log(chalk.dim(`Packages: ${getImagePackagesDir(storeDir)}`));
78
+ }
79
+ /**
80
+ * Set active version for an installed image.
81
+ */
82
+ export async function handleImageUseCommand(options) {
83
+ const validated = ImageUseCommandSchema.parse(options);
84
+ const parsed = parseImageSpecifier(validated.image);
85
+ if (!parsed.version) {
86
+ throw new Error(`Expected '<image>@<version>' (got '${validated.image}')`);
87
+ }
88
+ await setActiveImageVersion(parsed.id, parsed.version);
89
+ console.log(chalk.green(`✓ Set active ${parsed.id}@${parsed.version}`));
90
+ }
91
+ /**
92
+ * Remove an image (all versions) or a specific version from the store.
93
+ */
94
+ export async function handleImageRemoveCommand(options) {
95
+ const validated = ImageRemoveCommandSchema.parse(options);
96
+ const parsed = parseImageSpecifier(validated.image);
97
+ await removeImageFromStore(parsed.id, {
98
+ ...(parsed.version ? { version: parsed.version } : {}),
99
+ });
100
+ console.log(chalk.green(parsed.version
101
+ ? `✓ Removed ${parsed.id}@${parsed.version}`
102
+ : `✓ Removed ${parsed.id} (all versions)`));
103
+ }
104
+ /**
105
+ * Print diagnostics about the local image store.
106
+ */
107
+ export async function handleImageDoctorCommand() {
108
+ const storeDir = getDefaultImageStoreDir();
109
+ const registryPath = getImageRegistryPath(storeDir);
110
+ const packagesDir = getImagePackagesDir(storeDir);
111
+ const registry = loadImageRegistry(storeDir);
112
+ const imageCount = Object.keys(registry.images).length;
113
+ console.log(chalk.bold('Image Store:'));
114
+ console.log(chalk.dim(` Store: ${storeDir}`));
115
+ console.log(chalk.dim(` Registry: ${registryPath}`));
116
+ console.log(chalk.dim(` Packages: ${packagesDir}`));
117
+ console.log(chalk.dim(` Images: ${imageCount}`));
118
+ }
@@ -6,7 +6,8 @@ export { handleInstallCommand, type InstallCommandOptions } from './install.js';
6
6
  export { handleUninstallCommand, type UninstallCommandOptions } from './uninstall.js';
7
7
  export { handleListAgentsCommand, type ListAgentsCommandOptions, type ListAgentsCommandOptionsInput, } from './list-agents.js';
8
8
  export { handleWhichCommand, type WhichCommandOptions } from './which.js';
9
- export { handleSyncAgentsCommand, shouldPromptForSync, markSyncDismissed, clearSyncDismissed, type SyncAgentsCommandOptions, } from './sync-agents.js';
9
+ export { handleSyncAgentsCommand, shouldPromptForSync, type SyncAgentsCommandOptions, } from './sync-agents.js';
10
+ export { handleImageInstallCommand, handleImageListCommand, handleImageUseCommand, handleImageRemoveCommand, handleImageDoctorCommand, type ImageInstallCommandOptions, type ImageInstallCommandOptionsInput, } from './image.js';
10
11
  export { handleLoginCommand, handleLogoutCommand, handleStatusCommand } from './auth/index.js';
11
12
  export { handleBillingStatusCommand } from './billing/index.js';
12
13
  export { handlePluginListCommand, handlePluginInstallCommand, handlePluginUninstallCommand, handlePluginValidateCommand, handleMarketplaceAddCommand, handleMarketplaceRemoveCommand, handleMarketplaceUpdateCommand, handleMarketplaceListCommand, handleMarketplacePluginsCommand, handleMarketplaceInstallCommand, type PluginListCommandOptions, type PluginListCommandOptionsInput, type PluginInstallCommandOptions, type PluginInstallCommandOptionsInput, type PluginUninstallCommandOptions, type PluginUninstallCommandOptionsInput, type PluginValidateCommandOptions, type PluginValidateCommandOptionsInput, type MarketplaceAddCommandOptionsInput, type MarketplaceRemoveCommandOptionsInput, type MarketplaceUpdateCommandOptionsInput, type MarketplaceListCommandOptionsInput, type MarketplaceInstallCommandOptionsInput, } from './plugin.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,0BAA0B,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAErF,OAAO,EAAE,kBAAkB,EAAE,KAAK,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACjG,OAAO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zC,KAAK,kCAAkC,EACvC,KAAK,qCAAqC,GAC7C,MAAM,aAAa,CAAC"}
@@ -8,7 +8,9 @@ export { handleInstallCommand } from './install.js';
8
8
  export { handleUninstallCommand } from './uninstall.js';
9
9
  export { handleListAgentsCommand, } from './list-agents.js';
10
10
  export { handleWhichCommand } from './which.js';
11
- export { handleSyncAgentsCommand, shouldPromptForSync, markSyncDismissed, clearSyncDismissed, } from './sync-agents.js';
11
+ export { handleSyncAgentsCommand, shouldPromptForSync, } from './sync-agents.js';
12
+ // Image commands
13
+ export { handleImageInstallCommand, handleImageListCommand, handleImageUseCommand, handleImageRemoveCommand, handleImageDoctorCommand, } from './image.js';
12
14
  // Auth commands
13
15
  export { handleLoginCommand, handleLogoutCommand, handleStatusCommand } from './auth/index.js';
14
16
  // Billing commands
@@ -20,7 +20,7 @@ export declare function initDexto(directory: string, createExampleFile?: boolean
20
20
  /** Adds notes for users to get started with their new initialized Dexto project */
21
21
  export declare function postInitDexto(directory: string): Promise<void>;
22
22
  /**
23
- * Creates the dexto directories (dexto, dexto/agents) in the given directory.
23
+ * Creates the dexto directory in the given directory.
24
24
  * @param directory - The directory to create the dexto directories in
25
25
  * @returns The path to the created dexto directory
26
26
  */
@@ -30,16 +30,12 @@ export declare function createDextoDirectories(directory: string): Promise<{
30
30
  } | {
31
31
  ok: false;
32
32
  }>;
33
- /**
34
- * Creates a dexto config file in the given directory. Pulls the config file from the installed Dexto package.
35
- * @param directory - The directory to create the config file in
36
- * @returns The path to the created config file
37
- */
38
- export declare function createDextoConfigFile(directory: string): Promise<string>;
39
33
  /**
40
34
  * Creates an example file in the given directory showing how to use Dexto in code. This file has example code to get you started.
41
35
  * @param directory - The directory to create the example index file in
42
36
  * @returns The path to the created example index file
43
37
  */
44
- export declare function createDextoExampleFile(directory: string): Promise<string>;
38
+ export declare function createDextoExampleFile(directory: string, options?: {
39
+ llmProvider?: LLMProvider | undefined;
40
+ } | undefined): Promise<string>;
45
41
  //# sourceMappingURL=init-app.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"init-app.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init-app.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,WAAW,EAAU,MAAM,aAAa,CAAC;AAWvD;;;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,CAyGf;AAED,mFAAmF;AACnF,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,iBASpD;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,CAaxD;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAmC9E;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAgG/E"}
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,aAAa,CAAC;AAe3E;;;GAGG;AACH,wBAAsB,0BAA0B,IAAI,OAAO,CAAC;IACxD,WAAW,EAAE,WAAW,CAAC;IACzB,SAAS,EAA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