@growthub/cli 0.9.17 → 0.10.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 (50) hide show
  1. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/api/workspace/reference-options/route.js +62 -0
  2. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/api/workspace/refresh-sources/route.js +13 -2
  3. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/api/workspace/resolver-templates/route.js +23 -0
  4. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/api/workspace/sandbox-run/route.js +35 -5
  5. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/api/workspace/test-source/route.js +15 -1
  6. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/DataModelShell.jsx +2048 -0
  7. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/DataTable.jsx +1 -0
  8. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/FieldEditor.jsx +1 -0
  9. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/FieldManager.jsx +9 -0
  10. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/ObjectSidebar.jsx +41 -0
  11. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/RecordDrawer.jsx +1 -0
  12. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/ReferencePicker.jsx +244 -0
  13. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/SandboxRunPanel.jsx +21 -0
  14. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/SourceTestPanel.jsx +15 -0
  15. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/StatusPill.jsx +13 -0
  16. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/ToggleField.jsx +41 -0
  17. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/components/dm-shared.jsx +99 -0
  18. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/data-model/page.jsx +2 -1528
  19. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/app/globals.css +66 -5
  20. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/docs/connector-template-authoring.md +8 -0
  21. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/docs/data-model-reference-fields.md +15 -0
  22. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/docs/mcp-chrome-tool-connectors.md +12 -0
  23. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/docs/resolver-template-library.md +17 -0
  24. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/integrations/source-resolver-registry.js +13 -0
  25. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/integrations/templates/README.md +12 -0
  26. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/integrations/templates/chrome-bridge.js +22 -0
  27. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/integrations/templates/custom-http.js +23 -0
  28. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/integrations/templates/generic-commerce.js +22 -0
  29. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/integrations/templates/generic-crm.js +23 -0
  30. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/integrations/templates/generic-project-management.js +22 -0
  31. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/integrations/templates/generic-spreadsheet.js +22 -0
  32. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/integrations/templates/mcp-tool.js +22 -0
  33. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/integrations/templates/template-registry.js +50 -0
  34. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/integrations/templates/webhook.js +22 -0
  35. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/references/collect-reference-options.js +133 -0
  36. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/references/reference-resolver-registry.js +17 -0
  37. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/references/resolver-loader.js +6 -0
  38. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/references/resolvers/README.md +8 -0
  39. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/references/resolvers/local-data-model.js +11 -0
  40. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/references/resolvers/source-records.js +34 -0
  41. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/sandboxes/adapters/README.md +5 -3
  42. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/sandboxes/default-local-intelligence.js +203 -0
  43. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/adapters/sandboxes/index.js +1 -0
  44. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/data-model/field-contracts.js +81 -0
  45. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/data-model/reference-option-schema.js +59 -0
  46. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/data-model/reference-options.js +29 -0
  47. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/workspace-data-model.js +527 -23
  48. package/assets/worker-kits/growthub-custom-workspace-starter-v1/apps/workspace/lib/workspace-schema.js +131 -1
  49. package/dist/index.js +3043 -1340
  50. package/package.json +1 -1
@@ -132,7 +132,13 @@ const WIDGET_SCHEMA_CONTRACTS = {
132
132
  },
133
133
  FieldSettingsConfig: {
134
134
  hidden: "string[] of column names hidden from preview",
135
- order: "string[] of column names defining custom order"
135
+ order: "string[] of column names defining custom order",
136
+ sort: "SortClause[] optional",
137
+ filter: "FilterConfig optional",
138
+ types: "record<string,string> optional — client field-type hints",
139
+ views: "saved view snapshots optional",
140
+ activeViewId: "string optional",
141
+ favorite: "boolean optional"
136
142
  },
137
143
  SortClause: {
138
144
  fieldId: "non-empty string (column name)",
@@ -491,6 +497,45 @@ function validateFieldSettings(fieldSettings, path, errors) {
491
497
  }
492
498
  if (fieldSettings.hidden !== undefined) validateStringArray(fieldSettings.hidden, `${path}.hidden`, errors);
493
499
  if (fieldSettings.order !== undefined) validateStringArray(fieldSettings.order, `${path}.order`, errors);
500
+ validateSortClauses(fieldSettings.sort, `${path}.sort`, errors);
501
+ validateFilterClauses(fieldSettings.filter, `${path}.filter`, errors);
502
+ if (fieldSettings.types !== undefined) {
503
+ if (!isPlainObject(fieldSettings.types)) {
504
+ errors.push(`${path}.types must be a plain object`);
505
+ } else {
506
+ Object.entries(fieldSettings.types).forEach(([key, value]) => {
507
+ if (typeof key !== "string" || !key.trim()) errors.push(`${path}.types keys must be non-empty strings`);
508
+ if (typeof value !== "string" || !value.trim()) errors.push(`${path}.types.${key} must be a non-empty string`);
509
+ });
510
+ }
511
+ }
512
+ if (fieldSettings.activeViewId !== undefined && typeof fieldSettings.activeViewId !== "string") {
513
+ errors.push(`${path}.activeViewId must be a string`);
514
+ }
515
+ if (fieldSettings.favorite !== undefined && typeof fieldSettings.favorite !== "boolean") {
516
+ errors.push(`${path}.favorite must be a boolean`);
517
+ }
518
+ if (fieldSettings.views !== undefined) {
519
+ if (!Array.isArray(fieldSettings.views)) {
520
+ errors.push(`${path}.views must be an array`);
521
+ } else {
522
+ fieldSettings.views.forEach((view, index) => {
523
+ const prefix = `${path}.views[${index}]`;
524
+ if (!isPlainObject(view)) {
525
+ errors.push(`${prefix} must be a plain object`);
526
+ return;
527
+ }
528
+ if (typeof view.id !== "string" || !view.id.trim()) errors.push(`${prefix}.id must be a non-empty string`);
529
+ if (typeof view.name !== "string" || !view.name.trim()) errors.push(`${prefix}.name must be a non-empty string`);
530
+ if (view.favorite !== undefined && typeof view.favorite !== "boolean") errors.push(`${prefix}.favorite must be a boolean`);
531
+ if (view.locked !== undefined && typeof view.locked !== "boolean") errors.push(`${prefix}.locked must be a boolean`);
532
+ if (view.hidden !== undefined) validateStringArray(view.hidden, `${prefix}.hidden`, errors);
533
+ if (view.order !== undefined) validateStringArray(view.order, `${prefix}.order`, errors);
534
+ validateSortClauses(view.sort, `${prefix}.sort`, errors);
535
+ validateFilterClauses(view.filter, `${prefix}.filter`, errors);
536
+ });
537
+ }
538
+ }
494
539
  }
495
540
 
496
541
  function validateSortClauses(sort, path, errors) {
@@ -820,6 +865,65 @@ function validateCanvasConfig(canvas, errors) {
820
865
  }
821
866
  }
822
867
 
868
+ function validateDataModelRelation(relation, path, errors) {
869
+ if (!isPlainObject(relation)) {
870
+ errors.push(`${path} must be a plain object`);
871
+ return;
872
+ }
873
+ for (const key of ["id", "name", "field", "targetObjectType", "type"]) {
874
+ if (typeof relation[key] !== "string" || !relation[key].trim()) {
875
+ errors.push(`${path}.${key} must be a non-empty string`);
876
+ }
877
+ }
878
+ if (relation.type !== undefined && !["belongs-to", "has-many"].includes(relation.type)) {
879
+ errors.push(`${path}.type must be belongs-to or has-many`);
880
+ }
881
+ for (const opt of ["valueField", "labelField", "secondaryLabelField", "statusField"]) {
882
+ if (relation[opt] !== undefined && relation[opt] !== null && typeof relation[opt] !== "string") {
883
+ errors.push(`${path}.${opt} must be a string when present`);
884
+ }
885
+ }
886
+ if (relation.statusAllowlist !== undefined) {
887
+ if (!Array.isArray(relation.statusAllowlist)) {
888
+ errors.push(`${path}.statusAllowlist must be an array of strings when present`);
889
+ } else {
890
+ relation.statusAllowlist.forEach((entry, i) => {
891
+ if (typeof entry !== "string" || !entry.trim()) {
892
+ errors.push(`${path}.statusAllowlist[${i}] must be a non-empty string`);
893
+ }
894
+ });
895
+ }
896
+ }
897
+ if (relation.searchable !== undefined && typeof relation.searchable !== "boolean") {
898
+ errors.push(`${path}.searchable must be a boolean when present`);
899
+ }
900
+ if (relation.pageSize !== undefined && relation.pageSize !== "") {
901
+ const ps = Number(relation.pageSize);
902
+ if (!Number.isFinite(ps) || ps < 1 || ps > 500) {
903
+ errors.push(`${path}.pageSize must be a number between 1 and 500 when present`);
904
+ }
905
+ }
906
+ if (relation.referenceSource !== undefined) {
907
+ const rs = String(relation.referenceSource).trim();
908
+ if (!["workspace-rows", "source-records"].includes(rs)) {
909
+ errors.push(`${path}.referenceSource must be workspace-rows or source-records when present`);
910
+ }
911
+ }
912
+ if (relation.sidecarSourceId !== undefined && typeof relation.sidecarSourceId !== "string") {
913
+ errors.push(`${path}.sidecarSourceId must be a string when present`);
914
+ }
915
+ if (relation.resolver !== undefined) {
916
+ if (!isPlainObject(relation.resolver)) {
917
+ errors.push(`${path}.resolver must be a plain object when present`);
918
+ } else if (
919
+ relation.resolver.integrationId !== undefined
920
+ && (typeof relation.resolver.integrationId !== "string" || !relation.resolver.integrationId.trim())
921
+ ) {
922
+ errors.push(`${path}.resolver.integrationId must be a non-empty string when present`);
923
+ }
924
+ }
925
+ }
926
+
823
927
  function validateSandboxEnvironmentRow(row, path, errors) {
824
928
  if (!isPlainObject(row)) return;
825
929
  const lifecycleStatus = String(row.lifecycleStatus || "").trim().toLowerCase();
@@ -847,6 +951,18 @@ function validateSandboxEnvironmentRow(row, path, errors) {
847
951
  if (row.agentHost !== undefined && row.agentHost !== "" && !KNOWN_SANDBOX_AGENT_HOSTS.includes(row.agentHost)) {
848
952
  errors.push(`${path}.agentHost must be one of ${KNOWN_SANDBOX_AGENT_HOSTS.join(", ")}`);
849
953
  }
954
+ const INTELLIGENCE_ADAPTER_MODES = ["ollama", "lmstudio", "vllm", "custom-openai-compatible"];
955
+ for (const field of ["localModel", "localEndpoint", "intelligenceAdapterMode"]) {
956
+ if (row[field] !== undefined && row[field] !== null && row[field] !== "" && typeof row[field] !== "string") {
957
+ errors.push(`${path}.${field} must be a string when set`);
958
+ }
959
+ }
960
+ if (row.intelligenceAdapterMode !== undefined && String(row.intelligenceAdapterMode).trim() !== "") {
961
+ const im = String(row.intelligenceAdapterMode).trim().toLowerCase();
962
+ if (!INTELLIGENCE_ADAPTER_MODES.includes(im)) {
963
+ errors.push(`${path}.intelligenceAdapterMode must be one of ${INTELLIGENCE_ADAPTER_MODES.join(", ")}`);
964
+ }
965
+ }
850
966
  if (row.envRefs !== undefined && typeof row.envRefs !== "string" && !Array.isArray(row.envRefs)) {
851
967
  errors.push(`${path}.envRefs must be a comma-separated string or array of env-ref slugs (never values)`);
852
968
  }
@@ -877,6 +993,11 @@ function validateSandboxEnvironmentRow(row, path, errors) {
877
993
  errors.push(`${path}.timeoutMs must be a finite number between 0 and ${SANDBOX_MAX_TIMEOUT_MS}`);
878
994
  }
879
995
  }
996
+ for (const traceField of ["resolverTemplateId", "connectorKind", "executionLane"]) {
997
+ if (row[traceField] !== undefined && typeof row[traceField] !== "string") {
998
+ errors.push(`${path}.${traceField} must be a string when present`);
999
+ }
1000
+ }
880
1001
  }
881
1002
 
882
1003
  function validateDataModelConfig(dataModel, errors) {
@@ -925,6 +1046,15 @@ function validateDataModelConfig(dataModel, errors) {
925
1046
  if (object.binding?.sourceStorage === "workspace-source-records" && typeof object.sourceId !== "string") {
926
1047
  errors.push(`${prefix}.sourceId is required when binding.sourceStorage is "workspace-source-records"`);
927
1048
  }
1049
+ if (object.relations !== undefined) {
1050
+ if (!Array.isArray(object.relations)) {
1051
+ errors.push(`${prefix}.relations must be an array`);
1052
+ } else {
1053
+ object.relations.forEach((rel, relIndex) => {
1054
+ validateDataModelRelation(rel, `${prefix}.relations[${relIndex}]`, errors);
1055
+ });
1056
+ }
1057
+ }
928
1058
  validateFieldSettings(object.fieldSettings, `${prefix}.fieldSettings`, errors);
929
1059
  });
930
1060
  }