@dexto/core 1.6.0 → 1.6.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.
Files changed (79) hide show
  1. package/dist/agent/DextoAgent.cjs +25 -5
  2. package/dist/agent/DextoAgent.d.ts +12 -1
  3. package/dist/agent/DextoAgent.d.ts.map +1 -1
  4. package/dist/agent/DextoAgent.js +25 -5
  5. package/dist/agent/schemas.d.ts +18 -18
  6. package/dist/approval/manager.cjs +87 -27
  7. package/dist/approval/manager.d.ts +10 -1
  8. package/dist/approval/manager.d.ts.map +1 -1
  9. package/dist/approval/manager.js +87 -27
  10. package/dist/approval/schemas.cjs +22 -8
  11. package/dist/approval/schemas.d.ts +276 -102
  12. package/dist/approval/schemas.d.ts.map +1 -1
  13. package/dist/approval/schemas.js +22 -8
  14. package/dist/context/manager.cjs +2 -2
  15. package/dist/context/manager.d.ts +2 -1
  16. package/dist/context/manager.d.ts.map +1 -1
  17. package/dist/context/manager.js +2 -2
  18. package/dist/context/types.d.ts +3 -2
  19. package/dist/context/types.d.ts.map +1 -1
  20. package/dist/events/index.d.ts +17 -12
  21. package/dist/events/index.d.ts.map +1 -1
  22. package/dist/hooks/index.d.ts +1 -1
  23. package/dist/hooks/index.d.ts.map +1 -1
  24. package/dist/hooks/types.d.ts +1 -22
  25. package/dist/hooks/types.d.ts.map +1 -1
  26. package/dist/llm/executor/stream-processor.cjs +3 -3
  27. package/dist/llm/executor/stream-processor.d.ts +3 -2
  28. package/dist/llm/executor/stream-processor.d.ts.map +1 -1
  29. package/dist/llm/executor/stream-processor.js +3 -3
  30. package/dist/llm/executor/turn-executor.cjs +3 -3
  31. package/dist/llm/executor/turn-executor.d.ts +1 -1
  32. package/dist/llm/executor/turn-executor.d.ts.map +1 -1
  33. package/dist/llm/executor/turn-executor.js +3 -3
  34. package/dist/llm/providers/local/schemas.d.ts +2 -2
  35. package/dist/llm/schemas.d.ts +4 -4
  36. package/dist/llm/services/vercel.cjs +1 -1
  37. package/dist/llm/services/vercel.js +1 -1
  38. package/dist/logger/default-logger-factory.d.ts +12 -12
  39. package/dist/logger/v2/dexto-logger.cjs +35 -0
  40. package/dist/logger/v2/dexto-logger.d.ts +19 -0
  41. package/dist/logger/v2/dexto-logger.d.ts.map +1 -1
  42. package/dist/logger/v2/dexto-logger.js +35 -0
  43. package/dist/logger/v2/schemas.d.ts +6 -6
  44. package/dist/logger/v2/test-utils.cjs +2 -0
  45. package/dist/logger/v2/test-utils.d.ts.map +1 -1
  46. package/dist/logger/v2/test-utils.js +2 -0
  47. package/dist/logger/v2/types.d.ts +14 -1
  48. package/dist/logger/v2/types.d.ts.map +1 -1
  49. package/dist/mcp/schemas.d.ts +15 -15
  50. package/dist/memory/schemas.d.ts +4 -4
  51. package/dist/prompts/schemas.d.ts +7 -7
  52. package/dist/systemPrompt/in-built-prompts.cjs +5 -5
  53. package/dist/systemPrompt/in-built-prompts.d.ts +1 -1
  54. package/dist/systemPrompt/in-built-prompts.d.ts.map +1 -1
  55. package/dist/systemPrompt/in-built-prompts.js +5 -5
  56. package/dist/systemPrompt/schemas.d.ts +5 -5
  57. package/dist/systemPrompt/types.d.ts +11 -0
  58. package/dist/systemPrompt/types.d.ts.map +1 -1
  59. package/dist/tools/display-types.d.ts +10 -0
  60. package/dist/tools/display-types.d.ts.map +1 -1
  61. package/dist/tools/index.cjs +3 -1
  62. package/dist/tools/index.d.ts +1 -0
  63. package/dist/tools/index.d.ts.map +1 -1
  64. package/dist/tools/index.js +1 -0
  65. package/dist/tools/presentation.cjs +49 -0
  66. package/dist/tools/presentation.d.ts +11 -0
  67. package/dist/tools/presentation.d.ts.map +1 -0
  68. package/dist/tools/presentation.js +24 -0
  69. package/dist/tools/tool-manager.cjs +322 -155
  70. package/dist/tools/tool-manager.d.ts +23 -25
  71. package/dist/tools/tool-manager.d.ts.map +1 -1
  72. package/dist/tools/tool-manager.js +322 -155
  73. package/dist/tools/types.d.ts +134 -55
  74. package/dist/tools/types.d.ts.map +1 -1
  75. package/dist/utils/path.cjs +10 -1
  76. package/dist/utils/path.d.ts +5 -2
  77. package/dist/utils/path.d.ts.map +1 -1
  78. package/dist/utils/path.js +10 -1
  79. package/package.json +2 -2
@@ -8,8 +8,8 @@ export declare const ContributorConfigSchema: z.ZodDiscriminatedUnion<"type", [z
8
8
  content: z.ZodString;
9
9
  }, "strict", z.ZodTypeAny, {
10
10
  type: "static";
11
- content: string;
12
11
  enabled: boolean;
12
+ content: string;
13
13
  id: string;
14
14
  priority: number;
15
15
  }, {
@@ -102,8 +102,8 @@ export declare const SystemPromptContributorsSchema: z.ZodObject<{
102
102
  content: z.ZodString;
103
103
  }, "strict", z.ZodTypeAny, {
104
104
  type: "static";
105
- content: string;
106
105
  enabled: boolean;
106
+ content: string;
107
107
  id: string;
108
108
  priority: number;
109
109
  }, {
@@ -187,8 +187,8 @@ export declare const SystemPromptContributorsSchema: z.ZodObject<{
187
187
  }, "strict", z.ZodTypeAny, {
188
188
  contributors: ({
189
189
  type: "static";
190
- content: string;
191
190
  enabled: boolean;
191
+ content: string;
192
192
  id: string;
193
193
  priority: number;
194
194
  } | {
@@ -257,8 +257,8 @@ export declare const SystemPromptConfigSchema: z.ZodBranded<z.ZodUnion<[z.ZodEff
257
257
  content: z.ZodString;
258
258
  }, "strict", z.ZodTypeAny, {
259
259
  type: "static";
260
- content: string;
261
260
  enabled: boolean;
261
+ content: string;
262
262
  id: string;
263
263
  priority: number;
264
264
  }, {
@@ -342,8 +342,8 @@ export declare const SystemPromptConfigSchema: z.ZodBranded<z.ZodUnion<[z.ZodEff
342
342
  }, "strict", z.ZodTypeAny, {
343
343
  contributors: ({
344
344
  type: "static";
345
- content: string;
346
345
  enabled: boolean;
346
+ content: string;
347
347
  id: string;
348
348
  priority: number;
349
349
  } | {
@@ -1,7 +1,18 @@
1
1
  import { MCPManager } from '../mcp/manager.js';
2
+ import type { WorkspaceContext } from '../workspace/types.js';
3
+ export type EnvironmentContext = {
4
+ cwd?: string;
5
+ platform?: string;
6
+ shell?: string;
7
+ isGitRepo?: boolean;
8
+ };
2
9
  export interface DynamicContributorContext {
3
10
  mcpManager: MCPManager;
11
+ workspace?: WorkspaceContext | null;
12
+ environment?: EnvironmentContext;
4
13
  }
14
+ export type DynamicContributorContextOverrides = Partial<DynamicContributorContext>;
15
+ export type DynamicContributorContextFactory = () => DynamicContributorContextOverrides | Promise<DynamicContributorContextOverrides>;
5
16
  export interface SystemPromptContributor {
6
17
  id: string;
7
18
  priority: number;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/systemPrompt/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C,MAAM,WAAW,yBAAyB;IACtC,UAAU,EAAE,UAAU,CAAC;CAC1B;AAGD,MAAM,WAAW,uBAAuB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACnE"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/systemPrompt/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,MAAM,MAAM,kBAAkB,GAAG;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAGF,MAAM,WAAW,yBAAyB;IACtC,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACpC,WAAW,CAAC,EAAE,kBAAkB,CAAC;CACpC;AAED,MAAM,MAAM,kCAAkC,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AACpF,MAAM,MAAM,gCAAgC,GAAG,MACzC,kCAAkC,GAClC,OAAO,CAAC,kCAAkC,CAAC,CAAC;AAGlD,MAAM,WAAW,uBAAuB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACnE"}
@@ -19,6 +19,8 @@ export type ToolDisplayData = DiffDisplayData | ShellDisplayData | SearchDisplay
19
19
  */
20
20
  export interface DiffDisplayData {
21
21
  type: 'diff';
22
+ /** Optional UI title for this display (e.g., "Update file") */
23
+ title?: string;
22
24
  /** Unified diff string (output of `diff` package's createPatch) */
23
25
  unified: string;
24
26
  /** Path to the file that was modified */
@@ -38,6 +40,8 @@ export interface DiffDisplayData {
38
40
  */
39
41
  export interface ShellDisplayData {
40
42
  type: 'shell';
43
+ /** Optional UI title for this display (e.g., "Bash") */
44
+ title?: string;
41
45
  /** The command that was executed */
42
46
  command: string;
43
47
  /** Exit code from the command (0 = success) */
@@ -57,6 +61,8 @@ export interface ShellDisplayData {
57
61
  */
58
62
  export interface SearchDisplayData {
59
63
  type: 'search';
64
+ /** Optional UI title for this display */
65
+ title?: string;
60
66
  /** The search pattern used */
61
67
  pattern: string;
62
68
  /** Array of match results */
@@ -85,6 +91,8 @@ export interface SearchMatch {
85
91
  */
86
92
  export interface FileDisplayData {
87
93
  type: 'file';
94
+ /** Optional UI title for this display (e.g., "Create file") */
95
+ title?: string;
88
96
  /** Path to the file */
89
97
  path: string;
90
98
  /** Type of operation performed */
@@ -104,6 +112,8 @@ export interface FileDisplayData {
104
112
  */
105
113
  export interface GenericDisplayData {
106
114
  type: 'generic';
115
+ /** Optional UI title for this display */
116
+ title?: string;
107
117
  }
108
118
  /**
109
119
  * Type guard for DiffDisplayData.
@@ -1 +1 @@
1
- {"version":3,"file":"display-types.d.ts","sourceRo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AC,CAAC,EAAE,eAAe,GAAG,CAAC,IAAI,kBAAkB,CAE5E;AASD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,eAAe,CASnE"}
@@ -29,6 +29,7 @@ __reExport(tools_exports, require("./types.js"), module.exports);
29
29
  var import_define_tool = require("./define-tool.js");
30
30
  __reExport(tools_exports, require("./display-types.js"), module.exports);
31
31
  __reExport(tools_exports, require("./schemas.js"), module.exports);
32
+ __reExport(tools_exports, require("./presentation.js"), module.exports);
32
33
  var import_errors = require("./errors.js");
33
34
  var import_error_codes = require("./error-codes.js");
34
35
  var import_tool_manager = require("./tool-manager.js");
@@ -40,5 +41,6 @@ var import_tool_manager = require("./tool-manager.js");
40
41
  defineTool,
41
42
  ...require("./types.js"),
42
43
  ...require("./display-types.js"),
43
- ...require("./schemas.js")
44
+ ...require("./schemas.js"),
45
+ ...require("./presentation.js")
44
46
  });
@@ -8,6 +8,7 @@ export * from './types.js';
8
8
  export { defineTool } from './define-tool.js';
9
9
  export * from './display-types.js';
10
10
  export * from './schemas.js';
11
+ export * from './presentation.js';
11
12
  export { ToolError } from './errors.js';
12
13
  export { ToolErrorCode } from './error-codes.js';
13
14
  export { ToolManager, type ToolExecutionContextFactory } from './tool-manager.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,YAAY,CAAC;AAG3B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,cAAc,oBAAoB,CAAC;AAGnC,cAAc,cAAc,CAAC;AAG7B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,WAAW,EAAE,KAAK,2BAA2B,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,YAAY,CAAC;AAG3B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,cAAc,oBAAoB,CAAC;AAGnC,cAAc,cAAc,CAAC;AAG7B,cAAc,mBAAmB,CAAC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,WAAW,EAAE,KAAK,2BAA2B,EAAE,MAAM,mBAAmB,CAAC"}
@@ -3,6 +3,7 @@ export * from "./types.js";
3
3
  import { defineTool } from "./define-tool.js";
4
4
  export * from "./display-types.js";
5
5
  export * from "./schemas.js";
6
+ export * from "./presentation.js";
6
7
  import { ToolError } from "./errors.js";
7
8
  import { ToolErrorCode } from "./error-codes.js";
8
9
  import { ToolManager } from "./tool-manager.js";
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var presentation_exports = {};
20
+ __export(presentation_exports, {
21
+ createLocalToolCallHeader: () => createLocalToolCallHeader,
22
+ createLocalToolCallSnapshot: () => createLocalToolCallSnapshot,
23
+ truncateForHeader: () => truncateForHeader
24
+ });
25
+ module.exports = __toCommonJS(presentation_exports);
26
+ function createLocalToolCallHeader(options) {
27
+ return {
28
+ title: options.title,
29
+ ...options.argsText ? { argsText: options.argsText } : {}
30
+ };
31
+ }
32
+ function createLocalToolCallSnapshot(options) {
33
+ return {
34
+ version: 1,
35
+ source: { type: "local" },
36
+ header: createLocalToolCallHeader(options)
37
+ };
38
+ }
39
+ function truncateForHeader(value, maxLen) {
40
+ if (value.length <= maxLen) return value;
41
+ if (maxLen <= 3) return value.slice(0, maxLen);
42
+ return value.slice(0, maxLen - 3) + "...";
43
+ }
44
+ // Annotate the CommonJS export names for ESM import in node:
45
+ 0 && (module.exports = {
46
+ createLocalToolCallHeader,
47
+ createLocalToolCallSnapshot,
48
+ truncateForHeader
49
+ });
@@ -0,0 +1,11 @@
1
+ import type { ToolPresentationSnapshotV1 } from './types.js';
2
+ export declare function createLocalToolCallHeader(options: {
3
+ title: string;
4
+ argsText?: string;
5
+ }): NonNullable<ToolPresentationSnapshotV1['header']>;
6
+ export declare function createLocalToolCallSnapshot(options: {
7
+ title: string;
8
+ argsText?: string;
9
+ }): ToolPresentationSnapshotV1;
10
+ export declare function truncateForHeader(value: string, maxLen: number): string;
11
+ //# sourceMappingURL=presentation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation.d.ts","sourceRoot":"","sources":["../../src/tools/presentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAE7D,wBAAgB,yBAAyB,CAAC,OAAO,EAAE;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,WAAW,CAAC,0BAA0B,CAAC,QAAQ,CAAC,CAAC,CAKpD;AAED,wBAAgB,2BAA2B,CAAC,OAAO,EAAE;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,0BAA0B,CAM7B;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAIvE"}
@@ -0,0 +1,24 @@
1
+ import "../chunk-PTJYTZNU.js";
2
+ function createLocalToolCallHeader(options) {
3
+ return {
4
+ title: options.title,
5
+ ...options.argsText ? { argsText: options.argsText } : {}
6
+ };
7
+ }
8
+ function createLocalToolCallSnapshot(options) {
9
+ return {
10
+ version: 1,
11
+ source: { type: "local" },
12
+ header: createLocalToolCallHeader(options)
13
+ };
14
+ }
15
+ function truncateForHeader(value, maxLen) {
16
+ if (value.length <= maxLen) return value;
17
+ if (maxLen <= 3) return value.slice(0, maxLen);
18
+ return value.slice(0, maxLen - 3) + "...";
19
+ }
20
+ export {
21
+ createLocalToolCallHeader,
22
+ createLocalToolCallSnapshot,
23
+ truncateForHeader
24
+ };