@dexto/agent-config 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 (51) hide show
  1. package/LICENSE +44 -0
  2. package/README.md +46 -0
  3. package/dist/image/types.cjs +16 -0
  4. package/dist/image/types.d.ts +123 -0
  5. package/dist/image/types.d.ts.map +1 -0
  6. package/dist/image/types.js +0 -0
  7. package/dist/index.cjs +63 -0
  8. package/dist/index.d.ts +15 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +34 -0
  11. package/dist/resolver/apply-image-defaults.cjs +102 -0
  12. package/dist/resolver/apply-image-defaults.d.ts +13 -0
  13. package/dist/resolver/apply-image-defaults.d.ts.map +1 -0
  14. package/dist/resolver/apply-image-defaults.js +78 -0
  15. package/dist/resolver/load-image.cjs +139 -0
  16. package/dist/resolver/load-image.d.ts +13 -0
  17. package/dist/resolver/load-image.d.ts.map +1 -0
  18. package/dist/resolver/load-image.js +114 -0
  19. package/dist/resolver/resolve-services-from-config.cjs +146 -0
  20. package/dist/resolver/resolve-services-from-config.d.ts +5 -0
  21. package/dist/resolver/resolve-services-from-config.d.ts.map +1 -0
  22. package/dist/resolver/resolve-services-from-config.js +122 -0
  23. package/dist/resolver/to-dexto-agent-options.cjs +51 -0
  24. package/dist/resolver/to-dexto-agent-options.d.ts +10 -0
  25. package/dist/resolver/to-dexto-agent-options.d.ts.map +1 -0
  26. package/dist/resolver/to-dexto-agent-options.js +27 -0
  27. package/dist/resolver/types.cjs +16 -0
  28. package/dist/resolver/types.d.ts +19 -0
  29. package/dist/resolver/types.d.ts.map +1 -0
  30. package/dist/resolver/types.js +0 -0
  31. package/dist/resolver/utils.cjs +35 -0
  32. package/dist/resolver/utils.d.ts +4 -0
  33. package/dist/resolver/utils.d.ts.map +1 -0
  34. package/dist/resolver/utils.js +10 -0
  35. package/dist/schemas/agent-config.cjs +117 -0
  36. package/dist/schemas/agent-config.d.ts +4910 -0
  37. package/dist/schemas/agent-config.d.ts.map +1 -0
  38. package/dist/schemas/agent-config.js +104 -0
  39. package/dist/schemas/compaction.cjs +64 -0
  40. package/dist/schemas/compaction.d.ts +77 -0
  41. package/dist/schemas/compaction.d.ts.map +1 -0
  42. package/dist/schemas/compaction.js +37 -0
  43. package/dist/schemas/hooks.cjs +37 -0
  44. package/dist/schemas/hooks.d.ts +36 -0
  45. package/dist/schemas/hooks.d.ts.map +1 -0
  46. package/dist/schemas/hooks.js +12 -0
  47. package/dist/utils/clean-null-values.cjs +52 -0
  48. package/dist/utils/clean-null-values.d.ts +8 -0
  49. package/dist/utils/clean-null-values.d.ts.map +1 -0
  50. package/dist/utils/clean-null-values.js +28 -0
  51. package/package.json +42 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/resolver/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,WAAW,gBAAgB;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE;QAAE,IAAI,EAAE,SAAS,CAAC;QAAC,QAAQ,EAAE,QAAQ,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAE,CAAC;IAC/D,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,UAAU,EAAE,kBAAkB,GAAG,IAAI,CAAC;CACzC"}
File without changes
@@ -0,0 +1,35 @@
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 utils_exports = {};
20
+ __export(utils_exports, {
21
+ isPlainObject: () => isPlainObject,
22
+ isSchemaLike: () => isSchemaLike
23
+ });
24
+ module.exports = __toCommonJS(utils_exports);
25
+ function isPlainObject(value) {
26
+ return typeof value === "object" && value !== null && !Array.isArray(value);
27
+ }
28
+ function isSchemaLike(value) {
29
+ return isPlainObject(value) && typeof value.parse === "function";
30
+ }
31
+ // Annotate the CommonJS export names for ESM import in node:
32
+ 0 && (module.exports = {
33
+ isPlainObject,
34
+ isSchemaLike
35
+ });
@@ -0,0 +1,4 @@
1
+ export type PlainObject = Record<string, unknown>;
2
+ export declare function isPlainObject(value: unknown): value is PlainObject;
3
+ export declare function isSchemaLike(value: unknown): boolean;
4
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/resolver/utils.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAElD,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEpD"}
@@ -0,0 +1,10 @@
1
+ function isPlainObject(value) {
2
+ return typeof value === "object" && value !== null && !Array.isArray(value);
3
+ }
4
+ function isSchemaLike(value) {
5
+ return isPlainObject(value) && typeof value.parse === "function";
6
+ }
7
+ export {
8
+ isPlainObject,
9
+ isSchemaLike
10
+ };
@@ -0,0 +1,117 @@
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 agent_config_exports = {};
20
+ __export(agent_config_exports, {
21
+ AgentConfigSchema: () => AgentConfigSchema,
22
+ ToolFactoryEntrySchema: () => ToolFactoryEntrySchema,
23
+ createAgentConfigSchema: () => createAgentConfigSchema
24
+ });
25
+ module.exports = __toCommonJS(agent_config_exports);
26
+ var import_core = require("@dexto/core");
27
+ var import_schemas = require("@dexto/storage/schemas");
28
+ var import_zod = require("zod");
29
+ var import_hooks = require("./hooks.js");
30
+ var import_compaction = require("./compaction.js");
31
+ const ToolFactoryEntrySchema = import_zod.z.object({
32
+ type: import_zod.z.string().describe("Tool factory type identifier"),
33
+ enabled: import_zod.z.boolean().optional().describe("If false, skip this tool factory entry entirely")
34
+ }).passthrough().describe(
35
+ "Tool factory configuration. Additional fields are type-specific and validated by the resolver."
36
+ );
37
+ function createAgentConfigSchema() {
38
+ return import_zod.z.object({
39
+ // ========================================
40
+ // REQUIRED FIELDS (user must provide or schema validation fails)
41
+ // ========================================
42
+ systemPrompt: import_core.SystemPromptConfigSchema.describe(
43
+ "System prompt: string shorthand or structured config"
44
+ ),
45
+ llm: import_core.LLMConfigSchema.describe("Core LLM configuration for the agent"),
46
+ // ========================================
47
+ // OPTIONAL FEATURES (undefined if not provided)
48
+ // ========================================
49
+ agentCard: import_core.AgentCardSchema.describe("Configuration for the agent card").optional(),
50
+ greeting: import_zod.z.string().max(500).describe("Default greeting text to show when a chat starts (for UI consumption)").optional(),
51
+ telemetry: import_core.OtelConfigurationSchema.describe(
52
+ "OpenTelemetry configuration for distributed tracing and observability"
53
+ ).optional(),
54
+ memories: import_core.MemoriesConfigSchema.describe(
55
+ "Memory configuration for system prompt inclusion (optional feature)"
56
+ ).optional(),
57
+ agentFile: import_zod.z.object({
58
+ discoverInCwd: import_zod.z.boolean().default(true).describe(
59
+ "Whether to discover AGENTS.md/CLAUDE.md/GEMINI.md in the current working directory and include it in the system prompt"
60
+ )
61
+ }).strict().default({}).describe("Agent instruction file discovery configuration"),
62
+ image: import_zod.z.string().describe(
63
+ 'Image package that provides required providers (e.g., "@dexto/image-local"). Optional - platform can load images via CLI flag, environment variable, or static imports.'
64
+ ).optional(),
65
+ // ========================================
66
+ // FIELDS WITH DEFAULTS (always present after parsing)
67
+ // ========================================
68
+ agentId: import_zod.z.string().describe(
69
+ "Unique identifier for this agent instance - CLI enrichment derives from agentCard.name or filename"
70
+ ).default("coding-agent"),
71
+ mcpServers: import_core.ServersConfigSchema.describe(
72
+ "Configurations for MCP (Model Context Protocol) servers used by the agent"
73
+ ).default({}),
74
+ tools: import_zod.z.array(ToolFactoryEntrySchema).optional().describe(
75
+ "Unified tool factory configuration. Omit to use image defaults; provide to fully override."
76
+ ),
77
+ logger: import_core.LoggerConfigSchema.describe(
78
+ "Logger configuration with multi-transport support (file, console, remote) - CLI enrichment adds per-agent file transport"
79
+ ).default({
80
+ level: "error",
81
+ transports: [{ type: "console", colorize: true }]
82
+ }),
83
+ storage: import_schemas.StorageSchema.describe(
84
+ "Storage configuration for cache, database, and blob storage - defaults to in-memory, CLI enrichment provides filesystem paths"
85
+ ).default({
86
+ cache: { type: "in-memory" },
87
+ database: { type: "in-memory" },
88
+ blob: { type: "in-memory" }
89
+ }),
90
+ sessions: import_core.SessionConfigSchema.describe("Session management configuration").default({}),
91
+ permissions: import_core.PermissionsConfigSchema.describe(
92
+ "Tool permissions and approval configuration"
93
+ ).default({}),
94
+ elicitation: import_core.ElicitationConfigSchema.default({}).describe(
95
+ "Elicitation configuration for user input requests (ask_user tool and MCP server elicitations). Independent from permissions mode."
96
+ ),
97
+ resources: import_core.ResourcesConfigSchema.describe(
98
+ "Agent-managed resource configuration"
99
+ ).default([]),
100
+ prompts: import_core.PromptsSchema.describe(
101
+ "Agent prompts configuration - sample prompts which can be defined inline or referenced from file"
102
+ ).default([]),
103
+ hooks: import_hooks.HooksConfigSchema.describe(
104
+ "Hook configuration. Omit to use image defaults; provide to fully override."
105
+ ).optional(),
106
+ compaction: import_compaction.CompactionConfigSchema.describe("Context compaction configuration").default(
107
+ import_compaction.DEFAULT_COMPACTION_CONFIG
108
+ )
109
+ }).strict().describe("Main configuration for an agent, including its LLM and server connections").brand();
110
+ }
111
+ const AgentConfigSchema = createAgentConfigSchema();
112
+ // Annotate the CommonJS export names for ESM import in node:
113
+ 0 && (module.exports = {
114
+ AgentConfigSchema,
115
+ ToolFactoryEntrySchema,
116
+ createAgentConfigSchema
117
+ });