@inkeep/agents-cli 0.0.0-dev-20251219092754 → 0.0.0-dev-20251220003011

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 (2) hide show
  1. package/dist/index.js +26 -3
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -2569,6 +2569,27 @@ const resourceIdSchema = z$3.string().min(MIN_ID_LENGTH).max(MAX_ID_LENGTH).desc
2569
2569
  example: "resource_789"
2570
2570
  });
2571
2571
  resourceIdSchema.meta({ description: "Resource identifier" });
2572
+ /**
2573
+ * Creates a resource ID schema with custom description.
2574
+ * Inherits all validation from resourceIdSchema (min, max, regex pattern).
2575
+ * Use this to extend resourceIdSchema with entity-specific documentation.
2576
+ *
2577
+ * @example
2578
+ * // For Agent.defaultSubAgentId
2579
+ * createResourceIdSchema('ID of the default sub-agent. Workflow: ...', { example: 'my-subagent' })
2580
+ *
2581
+ * // For Tool.credentialReferenceId
2582
+ * createResourceIdSchema('Reference to credential for authentication', { example: 'cred-123' })
2583
+ */
2584
+ function createResourceIdSchema(description, options) {
2585
+ const example = options?.example ?? "resource_789";
2586
+ const modified = z$3.string().min(MIN_ID_LENGTH).max(MAX_ID_LENGTH).describe(description).regex(URL_SAFE_ID_PATTERN, { message: "ID must contain only letters, numbers, hyphens, underscores, and dots" }).openapi({
2587
+ description,
2588
+ example
2589
+ });
2590
+ modified.meta({ description });
2591
+ return modified;
2592
+ }
2572
2593
  const FIELD_MODIFIERS = {
2573
2594
  id: (schema) => {
2574
2595
  const modified = schema.min(MIN_ID_LENGTH).max(MAX_ID_LENGTH).describe("Resource identifier").regex(URL_SAFE_ID_PATTERN, { message: "ID must contain only letters, numbers, hyphens, underscores, and dots" }).openapi({
@@ -2818,9 +2839,11 @@ const ExternalSubAgentRelationInsertSchema = createInsertSchema(subAgentRelation
2818
2839
  });
2819
2840
  const ExternalSubAgentRelationApiInsertSchema = createApiInsertSchema(ExternalSubAgentRelationInsertSchema);
2820
2841
  const AgentSelectSchema = createSelectSchema(agents);
2821
- const AgentInsertSchema = createInsertSchema(agents).extend({
2822
- id: resourceIdSchema,
2823
- name: z$3.string().trim().nonempty()
2842
+ const DEFAULT_SUB_AGENT_ID_DESCRIPTION = "ID of the default sub-agent that handles initial user messages. Required at runtime but nullable on creation to avoid circular FK dependency. Workflow: 1) POST Agent (without defaultSubAgentId), 2) POST SubAgent, 3) PATCH Agent with defaultSubAgentId.";
2843
+ const AgentInsertSchema = createInsertSchema(agents, {
2844
+ id: () => resourceIdSchema,
2845
+ name: () => z$3.string().trim().nonempty().describe("Agent name").openapi({ description: "Agent name" }),
2846
+ defaultSubAgentId: () => createResourceIdSchema(DEFAULT_SUB_AGENT_ID_DESCRIPTION, { example: "my-default-subagent" }).nullable().optional()
2824
2847
  });
2825
2848
  const AgentUpdateSchema = AgentInsertSchema.partial();
2826
2849
  const AgentApiSelectSchema = createApiSchema(AgentSelectSchema).openapi("Agent");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-cli",
3
- "version": "0.0.0-dev-20251219092754",
3
+ "version": "0.0.0-dev-20251220003011",
4
4
  "description": "Inkeep CLI tool",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -55,8 +55,8 @@
55
55
  "tsx": "^4.20.5",
56
56
  "open": "^10.2.0",
57
57
  "yaml": "^2.7.0",
58
- "@inkeep/agents-core": "^0.0.0-dev-20251219092754",
59
- "@inkeep/agents-sdk": "^0.0.0-dev-20251219092754"
58
+ "@inkeep/agents-core": "^0.0.0-dev-20251220003011",
59
+ "@inkeep/agents-sdk": "^0.0.0-dev-20251220003011"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@types/degit": "^2.8.6",
@@ -69,7 +69,7 @@
69
69
  "vitest": "^3.2.4"
70
70
  },
71
71
  "peerDependencies": {
72
- "@inkeep/agents-manage-ui": "0.0.0-dev-20251219092754",
72
+ "@inkeep/agents-manage-ui": "0.0.0-dev-20251220003011",
73
73
  "zod": "^4.1.11"
74
74
  },
75
75
  "publishConfig": {