@stndrds/schema 1.0.0-alpha.96 → 1.0.0-alpha.97

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/dist/{attributes-Btn-GLvC.d.ts → attributes-C-bhC0k5.d.ts} +5 -6
  2. package/dist/{attributes-CeDp1IMp.d.mts → attributes-DB76JqXm.d.mts} +5 -6
  3. package/dist/{index-telccAkt.d.ts → index-Bt-0XNSh.d.ts} +5 -143
  4. package/dist/{index-CvXnHxD2.d.mts → index-C9tOwUbK.d.mts} +5 -143
  5. package/dist/index.d.mts +147 -676
  6. package/dist/index.d.ts +147 -676
  7. package/dist/index.js +4 -281
  8. package/dist/index.mjs +5 -273
  9. package/dist/{types-B5Zhhoev.d.ts → types-B7nS2D1A.d.ts} +1 -1
  10. package/dist/{types-C6naks1H.d.mts → types-CjXbGsy8.d.mts} +1 -1
  11. package/dist/validation/all.d.mts +3 -3
  12. package/dist/validation/all.d.ts +3 -3
  13. package/dist/validation/complex/currency.d.mts +2 -2
  14. package/dist/validation/complex/currency.d.ts +2 -2
  15. package/dist/validation/complex/file.d.mts +2 -2
  16. package/dist/validation/complex/file.d.ts +2 -2
  17. package/dist/validation/complex/location.d.mts +2 -2
  18. package/dist/validation/complex/location.d.ts +2 -2
  19. package/dist/validation/complex/phone.d.mts +2 -2
  20. package/dist/validation/complex/phone.d.ts +2 -2
  21. package/dist/validation/complex/relation.d.mts +2 -2
  22. package/dist/validation/complex/relation.d.ts +2 -2
  23. package/dist/validation/complex/richtext.d.mts +2 -2
  24. package/dist/validation/complex/richtext.d.ts +2 -2
  25. package/dist/validation/complex/select.d.mts +2 -2
  26. package/dist/validation/complex/select.d.ts +2 -2
  27. package/dist/validation/complex/user.d.mts +2 -2
  28. package/dist/validation/complex/user.d.ts +2 -2
  29. package/dist/validation/computed/formula.d.mts +2 -2
  30. package/dist/validation/computed/formula.d.ts +2 -2
  31. package/dist/validation/computed/rollup.d.mts +2 -2
  32. package/dist/validation/computed/rollup.d.ts +2 -2
  33. package/dist/validation/config/index.d.mts +1 -1
  34. package/dist/validation/config/index.d.ts +1 -1
  35. package/dist/validation/core/index.d.mts +3 -3
  36. package/dist/validation/core/index.d.ts +3 -3
  37. package/dist/validation/object/index.d.mts +3 -3
  38. package/dist/validation/object/index.d.ts +3 -3
  39. package/dist/validation/primitives/checkbox.d.mts +2 -2
  40. package/dist/validation/primitives/checkbox.d.ts +2 -2
  41. package/dist/validation/primitives/date.d.mts +2 -2
  42. package/dist/validation/primitives/date.d.ts +2 -2
  43. package/dist/validation/primitives/number.d.mts +2 -2
  44. package/dist/validation/primitives/number.d.ts +2 -2
  45. package/dist/validation/primitives/rating.d.mts +2 -2
  46. package/dist/validation/primitives/rating.d.ts +2 -2
  47. package/dist/validation/primitives/text.d.mts +2 -2
  48. package/dist/validation/primitives/text.d.ts +2 -2
  49. package/dist/validation/validators.d.mts +3 -3
  50. package/dist/validation/validators.d.ts +3 -3
  51. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -519,90 +519,10 @@ function isFormNode(node) {
519
519
  function isConditionNode(node) {
520
520
  return node.type === "condition";
521
521
  }
522
- function isAssignNode(node) {
523
- return node.type === "assign";
524
- }
525
- function isAINode(node) {
526
- return node.type === "ai";
527
- }
528
522
  function isEndNode(node) {
529
523
  return node.type === "end";
530
524
  }
531
525
 
532
- // src/types/workflows/node-types/ai.node-type.ts
533
- var aiNodeType = {
534
- type: "ai",
535
- isLinear: true,
536
- structural: false,
537
- getOutputs(node) {
538
- return node.next ? [node.next] : [];
539
- },
540
- setNext(node, targetId) {
541
- return { ...node, next: targetId };
542
- },
543
- getSlotIds(node) {
544
- const slotIds = /* @__PURE__ */ new Set();
545
- for (const id of node.inputSlotIds ?? []) slotIds.add(id);
546
- for (const id of node.targetSlotIds ?? []) slotIds.add(id);
547
- return [...slotIds];
548
- },
549
- validate(node) {
550
- const errors = [];
551
- if (!node.label) errors.push("AINode must have a label");
552
- if (!node.mode) errors.push("AINode must have a mode (sync or async)");
553
- if (!node.next) errors.push("AINode must have a 'next' target");
554
- const hasAgentSource = !!node.definitionId || !!node.systemPrompt;
555
- if (!hasAgentSource) {
556
- errors.push("AINode must have either a definitionId or a systemPrompt");
557
- }
558
- return errors;
559
- }
560
- };
561
-
562
- // src/types/workflows/node-types/assign.node-type.ts
563
- var assignNodeType = {
564
- type: "assign",
565
- isLinear: true,
566
- structural: false,
567
- getOutputs(node) {
568
- return node.next ? [node.next] : [];
569
- },
570
- setNext(node, targetId) {
571
- return { ...node, next: targetId };
572
- },
573
- getSlotIds(node) {
574
- const slotIds = /* @__PURE__ */ new Set();
575
- if (node.targetSlotId) {
576
- slotIds.add(node.targetSlotId);
577
- }
578
- for (const assignment of node.assignments ?? []) {
579
- const src = assignment.source;
580
- if (src.type === "slot-ref") {
581
- slotIds.add(src.slotId);
582
- } else if (src.type === "expression") {
583
- const matches = src.template.matchAll(/\{\{\s*([\w]+)\.\w+/g);
584
- for (const match of matches) {
585
- slotIds.add(match[1]);
586
- }
587
- }
588
- }
589
- return [...slotIds];
590
- },
591
- validate(node) {
592
- const errors = [];
593
- if (!node.targetSlotId) {
594
- errors.push("AssignNode must have a target slot");
595
- }
596
- if (!node.assignments?.length) {
597
- errors.push("AssignNode must have at least one assignment");
598
- }
599
- if (!node.next) {
600
- errors.push("AssignNode must have a 'next' target");
601
- }
602
- return errors;
603
- }
604
- };
605
-
606
526
  // src/types/workflows/node-types/condition.node-type.ts
607
527
  var conditionNodeType = {
608
528
  type: "condition",
@@ -718,8 +638,6 @@ function registerBuiltInNodeTypes() {
718
638
  nodeTypeRegistry.register(startNodeType);
719
639
  nodeTypeRegistry.register(formNodeType);
720
640
  nodeTypeRegistry.register(conditionNodeType);
721
- nodeTypeRegistry.register(assignNodeType);
722
- nodeTypeRegistry.register(aiNodeType);
723
641
  nodeTypeRegistry.register(endNodeType);
724
642
  }
725
643
  registerBuiltInNodeTypes();
@@ -917,15 +835,13 @@ function isInvitationOrGrantEvent(event) {
917
835
  var ZONE_ORDER = ["collect", "actions"];
918
836
  var ZONE_CONFIG = {
919
837
  collect: { allowedNodeTypes: ["form", "condition"] },
920
- actions: { allowedNodeTypes: ["condition", "assign", "ai"] }
838
+ actions: { allowedNodeTypes: ["condition"] }
921
839
  };
922
840
  var TERMINAL_NODE_TYPES = /* @__PURE__ */ new Set(["start", "end"]);
923
841
  var NODE_TYPE_ZONE = {
924
842
  form: "collect",
925
- condition: "collect",
843
+ condition: "collect"
926
844
  // default — overridden by assignNodeZones logic
927
- assign: "actions",
928
- ai: "actions"
929
845
  };
930
846
  function assignNodeZones(orderedNodes) {
931
847
  const result = /* @__PURE__ */ new Map();
@@ -1083,45 +999,6 @@ var ConditionNodeSchema = z3.z.object({
1083
999
  onTrue: z3.z.string().nullish(),
1084
1000
  onFalse: z3.z.string().nullish()
1085
1001
  });
1086
- var AssignmentSourceSchema = z3.z.discriminatedUnion("type", [
1087
- z3.z.object({ type: z3.z.literal("expression"), template: z3.z.string().min(1) }),
1088
- z3.z.object({
1089
- type: z3.z.literal("slot-ref"),
1090
- slotId: z3.z.string().min(1),
1091
- properties: z3.z.record(z3.z.string(), z3.z.unknown()).optional()
1092
- }),
1093
- z3.z.object({ type: z3.z.literal("static"), value: z3.z.unknown() })
1094
- ]);
1095
- var AssignmentMappingSchema = z3.z.object({
1096
- targetAttribute: z3.z.string().min(1),
1097
- source: AssignmentSourceSchema
1098
- });
1099
- var AssignNodeSchema = z3.z.object({
1100
- type: z3.z.literal("assign"),
1101
- id: z3.z.string().min(1),
1102
- label: z3.z.string().min(1),
1103
- description: z3.z.string().nullish(),
1104
- targetSlotId: z3.z.string().min(1, "Target slot is required"),
1105
- assignments: z3.z.array(AssignmentMappingSchema).min(1),
1106
- next: z3.z.string().nullish()
1107
- });
1108
- var AINodeSchema = z3.z.object({
1109
- type: z3.z.literal("ai"),
1110
- id: z3.z.string().min(1),
1111
- label: z3.z.string().min(1),
1112
- description: z3.z.string().nullish(),
1113
- mode: z3.z.enum(["sync", "async"]),
1114
- definitionId: z3.z.string().optional(),
1115
- systemPrompt: z3.z.string().optional(),
1116
- model: z3.z.string().optional(),
1117
- tools: z3.z.array(z3.z.string()).optional(),
1118
- maxIterations: z3.z.number().positive().optional(),
1119
- instructions: z3.z.string().optional(),
1120
- inputSlotIds: z3.z.array(z3.z.string()).optional(),
1121
- targetSlotIds: z3.z.array(z3.z.string()).optional(),
1122
- timeoutMs: z3.z.number().positive().optional(),
1123
- next: z3.z.string().nullish()
1124
- });
1125
1002
  var EndNodeSchema = z3.z.object({
1126
1003
  type: z3.z.literal("end"),
1127
1004
  id: z3.z.string().min(1),
@@ -1132,8 +1009,6 @@ var WorkflowNodeSchema = z3.z.discriminatedUnion("type", [
1132
1009
  StartNodeSchema,
1133
1010
  FormNodeSchema,
1134
1011
  ConditionNodeSchema,
1135
- AssignNodeSchema,
1136
- AINodeSchema,
1137
1012
  EndNodeSchema
1138
1013
  ]);
1139
1014
  var SlotModeSchema = z3.z.enum(["create", "select", "optional"]);
@@ -1682,7 +1557,6 @@ var SchemaErrorCode = {
1682
1557
  FILE_NOT_FOUND: "SCHEMA_FILE_NOT_FOUND",
1683
1558
  ROLE_NOT_FOUND: "SCHEMA_ROLE_NOT_FOUND",
1684
1559
  MEMORY_NOT_FOUND: "SCHEMA_MEMORY_NOT_FOUND",
1685
- CONVERSATION_NOT_FOUND: "SCHEMA_CONVERSATION_NOT_FOUND",
1686
1560
  // Validation
1687
1561
  VALIDATION_FAILED: "SCHEMA_VALIDATION_FAILED",
1688
1562
  INVALID_ATTRIBUTE_NAME: "SCHEMA_INVALID_ATTRIBUTE_NAME",
@@ -1964,12 +1838,6 @@ var MemoryNotFoundError = class extends NotFoundError {
1964
1838
  this.name = "MemoryNotFoundError";
1965
1839
  }
1966
1840
  };
1967
- var ConversationNotFoundError = class extends NotFoundError {
1968
- constructor(conversationId) {
1969
- super("Conversation", conversationId, SchemaErrorCode.CONVERSATION_NOT_FOUND);
1970
- this.name = "ConversationNotFoundError";
1971
- }
1972
- };
1973
1841
 
1974
1842
  // src/standard-schema.ts
1975
1843
  var STANDARD_SCHEMA_VENDOR = "@stndrds/schema";
@@ -2970,8 +2838,7 @@ var DocumentAttributeBuilder = class extends BaseAttributeBuilder {
2970
2838
  return this;
2971
2839
  }
2972
2840
  /**
2973
- * Automatically trigger processing on upload.
2974
- * Processing is defined by the template's autoProcessing config.
2841
+ * Automatically trigger agent-compatible processing on upload.
2975
2842
  */
2976
2843
  autoProcess() {
2977
2844
  this.attr.autoProcess = true;
@@ -4497,6 +4364,7 @@ function group(id, label) {
4497
4364
  function relationGroup(id, label, attribute) {
4498
4365
  return new RelationGroupBuilder(id, label, attribute);
4499
4366
  }
4367
+ registerBuiltInNodeTypes();
4500
4368
  var WorkflowFormRowBuilder = class {
4501
4369
  /** @internal */
4502
4370
  constructor(formBuilder, rowId, order) {
@@ -4820,132 +4688,6 @@ var WorkflowConditionBuilder = class {
4820
4688
  };
4821
4689
  }
4822
4690
  };
4823
- var WorkflowAssignBuilder = class {
4824
- /** @internal */
4825
- constructor(workflowBuilder, nodeId, label, targetSlotId) {
4826
- this.assignments = [];
4827
- this.workflowBuilder = workflowBuilder;
4828
- this.nodeId = nodeId;
4829
- this.label = label;
4830
- this.targetSlotId = targetSlotId;
4831
- }
4832
- /**
4833
- * Set an attribute using an expression template.
4834
- * Uses mustache syntax: `{{ slotId.attribute }}`.
4835
- */
4836
- expression(targetAttribute, template) {
4837
- this.assignments.push({
4838
- targetAttribute,
4839
- source: { type: "expression", template }
4840
- });
4841
- return this;
4842
- }
4843
- /**
4844
- * Link a relation attribute to a slot's record.
4845
- * Optionally include qualified relation properties.
4846
- */
4847
- slotRef(targetAttribute, slotId, properties) {
4848
- this.assignments.push({
4849
- targetAttribute,
4850
- source: { type: "slot-ref", slotId, properties }
4851
- });
4852
- return this;
4853
- }
4854
- /**
4855
- * Set a static value on an attribute
4856
- */
4857
- setValue(targetAttribute, value) {
4858
- this.assignments.push({
4859
- targetAttribute,
4860
- source: { type: "static", value }
4861
- });
4862
- return this;
4863
- }
4864
- /**
4865
- * Set the description for this assign node
4866
- */
4867
- describe(description) {
4868
- this.nodeDescription = description;
4869
- return this;
4870
- }
4871
- /**
4872
- * Set the next node and complete the assign definition
4873
- */
4874
- next(nodeId) {
4875
- if (this.assignments.length === 0) {
4876
- throw new Error(
4877
- `[WorkflowBuilder] Assign "${this.nodeId}" must have at least one assignment. Use .expression(), .slotRef() or .setValue() first.`
4878
- );
4879
- }
4880
- return this.workflowBuilder._addNode({
4881
- type: "assign",
4882
- id: this.nodeId,
4883
- label: this.label,
4884
- description: this.nodeDescription,
4885
- targetSlotId: this.targetSlotId,
4886
- assignments: this.assignments,
4887
- next: nodeId
4888
- });
4889
- }
4890
- };
4891
- var WorkflowAIBuilder = class {
4892
- /** @internal */
4893
- constructor(workflowBuilder, nodeId, label) {
4894
- this.agentConfig = null;
4895
- this.workflowBuilder = workflowBuilder;
4896
- this.nodeId = nodeId;
4897
- this.label = label;
4898
- }
4899
- describe(description) {
4900
- this.nodeDescription = description;
4901
- return this;
4902
- }
4903
- timeout(ms) {
4904
- this.nodeTimeoutMs = ms;
4905
- return this;
4906
- }
4907
- /**
4908
- * Configure the agent for this node.
4909
- *
4910
- * @param definitionIdOrConfig - Either an existing agent definition ID (string),
4911
- * or an inline agent config object.
4912
- * @param options - Additional options merged on top (only used when first arg is a string)
4913
- */
4914
- agent(definitionIdOrConfig, options) {
4915
- if (typeof definitionIdOrConfig === "string") {
4916
- this.agentConfig = {
4917
- // Default to async when referencing a definition by ID
4918
- mode: options?.mode ?? "async",
4919
- definitionId: definitionIdOrConfig,
4920
- instructions: options?.instructions,
4921
- inputSlotIds: options?.inputSlotIds,
4922
- targetSlotIds: options?.targetSlotIds
4923
- };
4924
- } else {
4925
- this.agentConfig = definitionIdOrConfig;
4926
- }
4927
- return this;
4928
- }
4929
- /**
4930
- * Set the next node and complete the AI node definition
4931
- */
4932
- next(nodeId) {
4933
- if (!this.agentConfig) {
4934
- throw new Error(
4935
- `[WorkflowBuilder] AI node "${this.nodeId}" must have an agent config. Call .agent() first.`
4936
- );
4937
- }
4938
- return this.workflowBuilder._addNode({
4939
- type: "ai",
4940
- id: this.nodeId,
4941
- label: this.label,
4942
- description: this.nodeDescription,
4943
- timeoutMs: this.nodeTimeoutMs,
4944
- next: nodeId,
4945
- ...this.agentConfig
4946
- });
4947
- }
4948
- };
4949
4691
  var WorkflowEndBuilder = class {
4950
4692
  /** @internal */
4951
4693
  constructor(workflowBuilder, nodeId) {
@@ -5111,16 +4853,6 @@ var WorkflowBuilder = class {
5111
4853
  condition(id, label) {
5112
4854
  return new WorkflowConditionBuilder(this, id, label);
5113
4855
  }
5114
- /**
5115
- * Define an assign node (set values on a target slot)
5116
- */
5117
- assign(id, label, targetSlotId) {
5118
- return new WorkflowAssignBuilder(this, id, label, targetSlotId);
5119
- }
5120
- /** Define an AI agent node (sync or async, inline or referenced from a definition) */
5121
- ai(id, label) {
5122
- return new WorkflowAIBuilder(this, id, label);
5123
- }
5124
4856
  /**
5125
4857
  * Define an end node
5126
4858
  */
@@ -6848,15 +6580,11 @@ Object.defineProperty(exports, "formatZodErrors", {
6848
6580
  enumerable: true,
6849
6581
  get: function () { return chunkBEN6TE7Y_js.formatZodErrors; }
6850
6582
  });
6851
- exports.AINodeSchema = AINodeSchema;
6852
6583
  exports.ALL_ACTIONS = ALL_ACTIONS;
6853
6584
  exports.ALL_PIPES = ALL_PIPES;
6854
6585
  exports.ALL_SYSTEM_RESOURCES = ALL_SYSTEM_RESOURCES;
6855
6586
  exports.AccessDeniedError = AccessDeniedError;
6856
6587
  exports.ActivityTabConfig = ActivityTabConfig;
6857
- exports.AssignNodeSchema = AssignNodeSchema;
6858
- exports.AssignmentMappingSchema = AssignmentMappingSchema;
6859
- exports.AssignmentSourceSchema = AssignmentSourceSchema;
6860
6588
  exports.AttributeInUseError = AttributeInUseError;
6861
6589
  exports.AttributeNotFoundError = AttributeNotFoundError;
6862
6590
  exports.AuthMethodSchema = AuthMethodSchema;
@@ -6866,7 +6594,6 @@ exports.ConditionGroupSchema = ConditionGroupSchema;
6866
6594
  exports.ConditionNodeSchema = ConditionNodeSchema;
6867
6595
  exports.ConditionOperatorSchema = ConditionOperatorSchema;
6868
6596
  exports.ConditionRuleSchema = ConditionRuleSchema;
6869
- exports.ConversationNotFoundError = ConversationNotFoundError;
6870
6597
  exports.CreateShareInputSchema = CreateShareInputSchema;
6871
6598
  exports.CustomTabConfig = CustomTabConfig;
6872
6599
  exports.DEFAULT_LABEL_FALLBACK = DEFAULT_LABEL_FALLBACK;
@@ -6943,8 +6670,6 @@ exports.UserProfileNotFoundError = UserProfileNotFoundError;
6943
6670
  exports.ValidationError = ValidationError;
6944
6671
  exports.ViewBuilder = ViewBuilder;
6945
6672
  exports.ViewportSchema = ViewportSchema;
6946
- exports.WorkflowAIBuilder = WorkflowAIBuilder;
6947
- exports.WorkflowAssignBuilder = WorkflowAssignBuilder;
6948
6673
  exports.WorkflowBuilder = WorkflowBuilder;
6949
6674
  exports.WorkflowConditionBuilder = WorkflowConditionBuilder;
6950
6675
  exports.WorkflowConfigSchema = WorkflowConfigSchema;
@@ -7005,11 +6730,9 @@ exports.hasOptions = hasOptions;
7005
6730
  exports.hasProperties = hasProperties;
7006
6731
  exports.inValues = inValues;
7007
6732
  exports.inferInverseCardinality = inferInverseCardinality;
7008
- exports.isAINode = isAINode;
7009
6733
  exports.isAccessDeniedError = isAccessDeniedError;
7010
6734
  exports.isActivityTab = isActivityTab;
7011
6735
  exports.isAdvancedFormNode = isAdvancedFormNode;
7012
- exports.isAssignNode = isAssignNode;
7013
6736
  exports.isAttributeSortable = isAttributeSortable;
7014
6737
  exports.isBehaviorProperty = isBehaviorProperty;
7015
6738
  exports.isBilateralRelation = isBilateralRelation;