@proteos/sdk 0.61.0 → 0.75.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 (40) hide show
  1. package/dist/{chunk-OOOTPEJK.js → chunk-3VQQEJV6.js} +71 -11
  2. package/dist/chunk-3VQQEJV6.js.map +1 -0
  3. package/dist/{chunk-25PD6TYH.cjs → chunk-C4CH6CEY.cjs} +75 -10
  4. package/dist/chunk-C4CH6CEY.cjs.map +1 -0
  5. package/dist/index.cjs +379 -130
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +813 -81
  8. package/dist/index.d.ts +813 -81
  9. package/dist/index.js +250 -13
  10. package/dist/index.js.map +1 -1
  11. package/dist/meta/index.cjs +109 -89
  12. package/dist/meta/index.d.cts +1 -1
  13. package/dist/meta/index.d.ts +1 -1
  14. package/dist/meta/index.js +1 -1
  15. package/dist/{types-DQmqR_G8.d.cts → types-Dp-AB2QZ.d.cts} +561 -48
  16. package/dist/{types-DQmqR_G8.d.ts → types-Dp-AB2QZ.d.ts} +561 -48
  17. package/package.json +3 -3
  18. package/src/agent/session-types.ts +8 -1
  19. package/src/agent/sessions.ts +6 -4
  20. package/src/agent/types.ts +9 -0
  21. package/src/auth/platform-entities.ts +6 -0
  22. package/src/client.ts +28 -4
  23. package/src/conversation/index.ts +327 -15
  24. package/src/conversation/types.ts +594 -5
  25. package/src/data/entity-indexes.ts +54 -0
  26. package/src/data/index.ts +12 -0
  27. package/src/data/types.ts +66 -0
  28. package/src/errors.ts +5 -0
  29. package/src/index.ts +57 -0
  30. package/src/meta/components.ts +23 -3
  31. package/src/meta/index.ts +8 -0
  32. package/src/meta/layout/common-props.ts +9 -0
  33. package/src/meta/layout/elements.ts +57 -0
  34. package/src/meta/layout/index.ts +5 -0
  35. package/src/meta/layout/page-layout.ts +15 -3
  36. package/src/meta/types.ts +206 -21
  37. package/src/scheduling/types.ts +5 -1
  38. package/src/workflow/types.ts +10 -2
  39. package/dist/chunk-25PD6TYH.cjs.map +0 -1
  40. package/dist/chunk-OOOTPEJK.js.map +0 -1
@@ -183,6 +183,12 @@ var AppServiceImpl = class {
183
183
 
184
184
  // src/meta/components.ts
185
185
  var COMPONENTS_BASE_PATH = "/meta/v1/components";
186
+ function bundleVersionOf(bundleChecksum) {
187
+ if (!bundleChecksum) return void 0;
188
+ const separator = bundleChecksum.indexOf(":");
189
+ const hex = separator === -1 ? bundleChecksum : bundleChecksum.slice(separator + 1);
190
+ return /^[0-9a-f]{16,}$/i.test(hex) ? hex.toLowerCase() : void 0;
191
+ }
186
192
  var ComponentServiceImpl = class {
187
193
  constructor(client) {
188
194
  this.client = client;
@@ -209,8 +215,16 @@ var ComponentServiceImpl = class {
209
215
  async delete(id) {
210
216
  await this.client.request("DELETE", `${COMPONENTS_BASE_PATH}/${id}`);
211
217
  }
212
- bundleUrl(slug) {
213
- return `${COMPONENTS_BASE_PATH}/${slug}/bundle`;
218
+ /**
219
+ * Path of the component's compiled bundle. With the component's
220
+ * `bundle_checksum` the URL is content-addressed (`?v=<hex>`), which the
221
+ * server answers with an immutable cache policy; without it the bundle
222
+ * revalidates on every load.
223
+ */
224
+ bundleUrl(slug, bundleChecksum) {
225
+ const version = bundleVersionOf(bundleChecksum);
226
+ const base = `${COMPONENTS_BASE_PATH}/${slug}/bundle`;
227
+ return version ? `${base}?v=${encodeURIComponent(version)}` : base;
214
228
  }
215
229
  };
216
230
 
@@ -1120,6 +1134,7 @@ var SizingPropsSchema = zod.z.object({
1120
1134
  width: SizeValueSchema.optional(),
1121
1135
  height: SizeValueSchema.optional(),
1122
1136
  min_height: LengthValueSchema.optional(),
1137
+ max_height: LengthValueSchema.optional(),
1123
1138
  grow: zod.z.number().optional(),
1124
1139
  shrink: zod.z.number().optional(),
1125
1140
  align: AlignSchema.optional()
@@ -1137,6 +1152,7 @@ var commonPropsShape = {
1137
1152
  width: SizeValueSchema.optional(),
1138
1153
  height: SizeValueSchema.optional(),
1139
1154
  min_height: LengthValueSchema.optional(),
1155
+ max_height: LengthValueSchema.optional(),
1140
1156
  grow: zod.z.number().optional(),
1141
1157
  shrink: zod.z.number().optional(),
1142
1158
  align: AlignSchema.optional(),
@@ -1163,7 +1179,8 @@ var LayoutElementType = {
1163
1179
  List: "list",
1164
1180
  WorkflowTrigger: "workflow_trigger",
1165
1181
  SchedulingPicker: "scheduling_picker",
1166
- Calendar: "calendar"
1182
+ Calendar: "calendar",
1183
+ Stepper: "stepper"
1167
1184
  };
1168
1185
  var CALENDAR_VIEW_KINDS = ["day", "week", "month", "agenda"];
1169
1186
  var CALENDAR_MAX_OVERLAY_USERS = 8;
@@ -1178,6 +1195,17 @@ var LayoutTabSchema = zod.z.lazy(
1178
1195
  content: LayoutElementSchema
1179
1196
  })
1180
1197
  );
1198
+ var LayoutStepSchema = zod.z.lazy(
1199
+ () => zod.z.object({
1200
+ id: zod.z.string().min(1),
1201
+ value: zod.z.string().min(1),
1202
+ label: zod.z.string().min(1),
1203
+ icon: zod.z.string().optional(),
1204
+ continue_label: zod.z.string().optional(),
1205
+ visible_when: FilterGroupSchema.optional(),
1206
+ content: LayoutElementSchema
1207
+ })
1208
+ );
1181
1209
  var LayoutElementSchema = zod.z.lazy(
1182
1210
  () => zod.z.discriminatedUnion("type", [
1183
1211
  zod.z.object({
@@ -1221,6 +1249,14 @@ var LayoutElementSchema = zod.z.lazy(
1221
1249
  tabs: zod.z.array(LayoutTabSchema),
1222
1250
  default_tab_id: zod.z.string().optional()
1223
1251
  }),
1252
+ zod.z.object({
1253
+ type: zod.z.literal("stepper"),
1254
+ ...commonPropsShape,
1255
+ attribute: zod.z.string().min(1),
1256
+ continue_label: zod.z.string().optional(),
1257
+ back_label: zod.z.string().optional(),
1258
+ steps: zod.z.array(LayoutStepSchema).min(1)
1259
+ }),
1224
1260
  zod.z.object({
1225
1261
  type: zod.z.literal("field"),
1226
1262
  ...commonPropsShape,
@@ -1338,6 +1374,7 @@ var PAGE_BACKGROUND_TOKENS = [
1338
1374
  "danger",
1339
1375
  "info"
1340
1376
  ];
1377
+ var PAGE_HEADERS = ["full", "condensed"];
1341
1378
  var PAGE_BACKGROUND_COLOR_RE = /^(#[0-9a-fA-F]{3,8}|(rgb|rgba|hsl|hsla|oklch|oklab)\([0-9a-zA-Z.,%/ +-]+\))$/;
1342
1379
  function isPageBackground(text) {
1343
1380
  const value = text.trim();
@@ -1348,7 +1385,8 @@ var PageStyleSchema = zod.z.object({
1348
1385
  background: zod.z.string().refine(isPageBackground, "must be a design token or a hex / rgb / hsl / oklch / oklab color").optional(),
1349
1386
  max_width: StyleSizeValueSchema.optional(),
1350
1387
  padding_x: StyleSizeValueSchema.optional(),
1351
- padding_y: StyleSizeValueSchema.optional()
1388
+ padding_y: StyleSizeValueSchema.optional(),
1389
+ header: zod.z.enum(PAGE_HEADERS).optional()
1352
1390
  });
1353
1391
  var PageLayoutSchema = zod.z.object({
1354
1392
  version: zod.z.literal(1),
@@ -1578,6 +1616,10 @@ var PublicAccessOperationSchema = zod.z.enum(["read", "write", "delete"]);
1578
1616
  var EntityContactBindingSchema = zod.z.object({
1579
1617
  duplicate_policy: zod.z.enum(["reject", "flag"])
1580
1618
  });
1619
+ var UniqueConstraintSchema = zod.z.object({
1620
+ name: zod.z.string(),
1621
+ attributes: zod.z.array(zod.z.string())
1622
+ });
1581
1623
  var EntitySchema = AuditFieldsSchema.extend({
1582
1624
  slug: zod.z.string(),
1583
1625
  name: zod.z.string(),
@@ -1592,7 +1634,8 @@ var EntitySchema = AuditFieldsSchema.extend({
1592
1634
  // cleanly — the field is non-optional in the TS surface but tolerant on
1593
1635
  // the wire.
1594
1636
  title_template: zod.z.string().default(""),
1595
- attributes: zod.z.array(AttributeSchema)
1637
+ attributes: zod.z.array(AttributeSchema),
1638
+ unique_constraints: zod.z.array(UniqueConstraintSchema).optional()
1596
1639
  });
1597
1640
  var EntityWithSchemaSchema = EntitySchema.extend({
1598
1641
  schema: zod.z.record(zod.z.unknown())
@@ -1621,19 +1664,30 @@ var ComponentSchema = AuditFieldsSchema.extend({
1621
1664
  module_slug: zod.z.string(),
1622
1665
  bundle_file_id: zod.z.string(),
1623
1666
  source_file_id: zod.z.string(),
1667
+ bundle_checksum: zod.z.string().optional(),
1668
+ reserved_height: zod.z.number().int().nonnegative().optional(),
1624
1669
  // default(false): rows serialized before the flag existed lack the field.
1625
1670
  props_schema: zod.z.record(zod.z.unknown()).nullable(),
1626
1671
  is_public: zod.z.boolean().default(false)
1627
1672
  });
1673
+ var PageActionKindSchema = zod.z.enum(["action", "workflow", "agent", "intent", "link"]);
1628
1674
  var PageActionSchema = zod.z.object({
1629
1675
  label: zod.z.string(),
1630
1676
  icon: zod.z.string(),
1631
- kind: zod.z.enum(["action", "workflow"]).optional(),
1677
+ kind: PageActionKindSchema.optional(),
1632
1678
  action: zod.z.string().optional(),
1633
1679
  workflow: zod.z.string().optional(),
1680
+ agent: zod.z.string().optional(),
1681
+ intent: zod.z.enum(["create_record", "update_record"]).optional(),
1682
+ entity: zod.z.string().optional(),
1683
+ record: zod.z.string().optional(),
1684
+ url: zod.z.string().optional(),
1634
1685
  params: zod.z.record(zod.z.string()).optional(),
1635
1686
  inputs: zod.z.record(zod.z.string()).optional(),
1687
+ prompt: zod.z.string().optional(),
1688
+ context: zod.z.string().optional(),
1636
1689
  skip_confirmation: zod.z.boolean().optional(),
1690
+ visible_when: FilterGroupSchema.optional(),
1637
1691
  extension_key: zod.z.string().optional()
1638
1692
  });
1639
1693
  var SelectionModeSchema = zod.z.enum(["on_demand", "always", "off"]);
@@ -1667,13 +1721,15 @@ var ListViewSchema = AuditFieldsSchema.extend({
1667
1721
  sorting: zod.z.array(SortConfigSchema),
1668
1722
  filters: zod.z.array(FilterGroupSchema)
1669
1723
  });
1670
- var PageTypeSchema = zod.z.enum(["record", "platform", "kiosk", "public"]);
1724
+ var PageTypeSchema = zod.z.enum(["record", "platform", "kiosk", "public", "trigger"]);
1671
1725
  var PageSchema = AuditFieldsSchema.extend({
1672
1726
  slug: zod.z.string(),
1673
1727
  name: zod.z.string(),
1674
1728
  module_slug: zod.z.string(),
1675
1729
  type: PageTypeSchema,
1676
1730
  entity_slug: zod.z.string().optional(),
1731
+ kind: PageActionKindSchema.optional(),
1732
+ reference: zod.z.string().optional(),
1677
1733
  actions: zod.z.array(PageActionSchema),
1678
1734
  layout: PageLayoutSchema
1679
1735
  });
@@ -1775,6 +1831,8 @@ var AppHomeSchema = zod.z.object({
1775
1831
  type: zod.z.enum(["list", "page"]),
1776
1832
  reference: zod.z.string()
1777
1833
  });
1834
+ var RecordPageBindingSchema = zod.z.object({ view: zod.z.string().optional(), create: zod.z.string().optional(), edit: zod.z.string().optional() }).strict();
1835
+ var TriggerPageBindingSchema = zod.z.object({ input: zod.z.string().optional(), running: zod.z.string().optional(), result: zod.z.string().optional() }).strict();
1778
1836
  var AppConfigurationSchema = AuditFieldsSchema.extend({
1779
1837
  slug: zod.z.string(),
1780
1838
  org_id: zod.z.string(),
@@ -1785,7 +1843,9 @@ var AppConfigurationSchema = AuditFieldsSchema.extend({
1785
1843
  menu_slug: zod.z.string().optional(),
1786
1844
  default_agent_key: zod.z.string().optional(),
1787
1845
  agent_keys: zod.z.array(zod.z.string()).optional(),
1788
- record_pages: zod.z.record(zod.z.string()).optional(),
1846
+ record_pages: zod.z.record(RecordPageBindingSchema).optional(),
1847
+ action_pages: zod.z.record(TriggerPageBindingSchema).optional(),
1848
+ workflow_pages: zod.z.record(TriggerPageBindingSchema).optional(),
1789
1849
  searchable_entities: zod.z.array(zod.z.string()).optional()
1790
1850
  });
1791
1851
  var AppSchema = AuditFieldsSchema.extend({
@@ -1936,6 +1996,7 @@ exports.FilterElementSchema = FilterElementSchema;
1936
1996
  exports.FilterGroupSchema = FilterGroupSchema;
1937
1997
  exports.LayoutElementSchema = LayoutElementSchema;
1938
1998
  exports.LayoutElementType = LayoutElementType;
1999
+ exports.LayoutStepSchema = LayoutStepSchema;
1939
2000
  exports.LayoutTabSchema = LayoutTabSchema;
1940
2001
  exports.LengthValueSchema = LengthValueSchema;
1941
2002
  exports.ListExtensionColumnPlacementSchema = ListExtensionColumnPlacementSchema;
@@ -1956,6 +2017,7 @@ exports.PAGE_BACKGROUND_COLOR_RE = PAGE_BACKGROUND_COLOR_RE;
1956
2017
  exports.PAGE_BACKGROUND_TOKENS = PAGE_BACKGROUND_TOKENS;
1957
2018
  exports.PAGE_EXTENSION_ANCHOR_MAIN = PAGE_EXTENSION_ANCHOR_MAIN;
1958
2019
  exports.PAGE_EXTENSION_ANCHOR_SIDE_PANEL = PAGE_EXTENSION_ANCHOR_SIDE_PANEL;
2020
+ exports.PAGE_HEADERS = PAGE_HEADERS;
1959
2021
  exports.PLATFORM_ATTRIBUTE_NAMES = PLATFORM_ATTRIBUTE_NAMES;
1960
2022
  exports.PLATFORM_USER_ID = PLATFORM_USER_ID;
1961
2023
  exports.PageActionSchema = PageActionSchema;
@@ -1968,16 +2030,19 @@ exports.PageSchema = PageSchema;
1968
2030
  exports.PageStyleSchema = PageStyleSchema;
1969
2031
  exports.PrincipalRefSchema = PrincipalRefSchema;
1970
2032
  exports.RECORD_TITLE_FIELD = RECORD_TITLE_FIELD;
2033
+ exports.RecordPageBindingSchema = RecordPageBindingSchema;
1971
2034
  exports.RelationAttributeMetaSchema = RelationAttributeMetaSchema;
1972
2035
  exports.ResponseMetaSchema = ResponseMetaSchema;
1973
2036
  exports.SizeValueSchema = SizeValueSchema;
1974
2037
  exports.SortConfigSchema = SortConfigSchema;
1975
2038
  exports.StyleSizeValueSchema = StyleSizeValueSchema;
2039
+ exports.TriggerPageBindingSchema = TriggerPageBindingSchema;
1976
2040
  exports.UserAttributeMetaSchema = UserAttributeMetaSchema;
1977
2041
  exports.UserRefSchema = UserRefSchema;
1978
2042
  exports.VariableSchema = VariableSchema;
1979
2043
  exports.acceptsCurrentUserDefault = acceptsCurrentUserDefault;
1980
2044
  exports.allCurrencyCodes = allCurrencyCodes;
2045
+ exports.bundleVersionOf = bundleVersionOf;
1981
2046
  exports.createIterator = createIterator;
1982
2047
  exports.createListResultSchema = createListResultSchema;
1983
2048
  exports.currencyLabel = currencyLabel;
@@ -2007,5 +2072,5 @@ exports.parseRelationMeta = parseRelationMeta;
2007
2072
  exports.parseUserMeta = parseUserMeta;
2008
2073
  exports.platformAttributes = platformAttributes;
2009
2074
  exports.titleTemplateVariables = titleTemplateVariables;
2010
- //# sourceMappingURL=chunk-25PD6TYH.cjs.map
2011
- //# sourceMappingURL=chunk-25PD6TYH.cjs.map
2075
+ //# sourceMappingURL=chunk-C4CH6CEY.cjs.map
2076
+ //# sourceMappingURL=chunk-C4CH6CEY.cjs.map