@inf-monkeys-tech/monkeys 1.1.58 → 1.1.60

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 (76) hide show
  1. package/lib/contracts/agent-data.d.ts +53 -0
  2. package/lib/contracts/agent-data.d.ts.map +1 -1
  3. package/lib/contracts/agent-data.js +46 -1
  4. package/lib/contracts/agent-data.js.map +1 -1
  5. package/lib/contracts/declarative-control-http.d.ts +695 -35
  6. package/lib/contracts/declarative-control-http.d.ts.map +1 -1
  7. package/lib/contracts/declarative-control.d.ts +106 -3
  8. package/lib/contracts/declarative-control.d.ts.map +1 -1
  9. package/lib/contracts/declarative-control.js +48 -3
  10. package/lib/contracts/declarative-control.js.map +1 -1
  11. package/lib/contracts/declarative-publication-job.d.ts +176 -8
  12. package/lib/contracts/declarative-publication-job.d.ts.map +1 -1
  13. package/lib/contracts/index.d.ts +1 -0
  14. package/lib/contracts/index.d.ts.map +1 -1
  15. package/lib/contracts/index.js +1 -0
  16. package/lib/contracts/index.js.map +1 -1
  17. package/lib/contracts/render.d.ts +34 -5
  18. package/lib/contracts/render.d.ts.map +1 -1
  19. package/lib/contracts/render.js +11 -1
  20. package/lib/contracts/render.js.map +1 -1
  21. package/lib/contracts/semantic.d.ts +2 -2
  22. package/lib/contracts/unified-view.d.ts +718 -0
  23. package/lib/contracts/unified-view.d.ts.map +1 -0
  24. package/lib/contracts/unified-view.js +362 -0
  25. package/lib/contracts/unified-view.js.map +1 -0
  26. package/lib/contracts/workflow-definition.d.ts +503 -0
  27. package/lib/contracts/workflow-definition.d.ts.map +1 -1
  28. package/lib/contracts/workflow-definition.js +189 -3
  29. package/lib/contracts/workflow-definition.js.map +1 -1
  30. package/lib/esm/{chunk-WWNBSU45.mjs → chunk-5IWBM5FS.mjs} +4300 -2710
  31. package/lib/esm/chunk-5IWBM5FS.mjs.map +1 -0
  32. package/lib/esm/{chunk-SK5C7NUN.mjs → chunk-L7WP57HT.mjs} +142 -27
  33. package/lib/esm/chunk-L7WP57HT.mjs.map +1 -0
  34. package/lib/esm/{chunk-JLTNBOQY.mjs → chunk-POHBVHPL.mjs} +42 -42
  35. package/lib/esm/chunk-POHBVHPL.mjs.map +1 -0
  36. package/lib/esm/{chunk-SMJPC7BB.mjs → chunk-QM3K7CWF.mjs} +220 -6
  37. package/lib/esm/chunk-QM3K7CWF.mjs.map +1 -0
  38. package/lib/esm/contracts/index.mjs +162 -96
  39. package/lib/esm/index.mjs +242 -160
  40. package/lib/esm/index.mjs.map +1 -1
  41. package/lib/esm/runtime/index.mjs +19 -3
  42. package/lib/esm/schemas/index.mjs +128 -72
  43. package/lib/json-schema/index.json +1 -0
  44. package/lib/json-schema/overlay-node.schema.json +67 -46
  45. package/lib/json-schema/page-runtime-bundle.schema.json +157 -64
  46. package/lib/json-schema/page.schema.json +21 -0
  47. package/lib/json-schema/render-node.schema.json +67 -46
  48. package/lib/json-schema/render-tree.schema.json +67 -46
  49. package/lib/json-schema/view-ontology-record.schema.json +1042 -0
  50. package/lib/json-schema/workflow-definition.schema.json +584 -0
  51. package/lib/runtime/declarative-control-compiler.d.ts.map +1 -1
  52. package/lib/runtime/declarative-control-compiler.js +5 -0
  53. package/lib/runtime/declarative-control-compiler.js.map +1 -1
  54. package/lib/runtime/index.d.ts +1 -0
  55. package/lib/runtime/index.d.ts.map +1 -1
  56. package/lib/runtime/index.js +1 -0
  57. package/lib/runtime/index.js.map +1 -1
  58. package/lib/runtime/runtime-definition-wire.d.ts +88 -4
  59. package/lib/runtime/runtime-definition-wire.d.ts.map +1 -1
  60. package/lib/runtime/unified-view-compiler.d.ts +63 -0
  61. package/lib/runtime/unified-view-compiler.d.ts.map +1 -0
  62. package/lib/runtime/unified-view-compiler.js +225 -0
  63. package/lib/runtime/unified-view-compiler.js.map +1 -0
  64. package/lib/schemas/index.d.ts +347 -9
  65. package/lib/schemas/index.d.ts.map +1 -1
  66. package/lib/schemas/index.js +38 -6
  67. package/lib/schemas/index.js.map +1 -1
  68. package/package.json +2 -2
  69. package/lib/esm/chunk-4D4UQIFA.mjs +0 -1080
  70. package/lib/esm/chunk-4D4UQIFA.mjs.map +0 -1
  71. package/lib/esm/chunk-JLTNBOQY.mjs.map +0 -1
  72. package/lib/esm/chunk-MQOSI237.mjs +0 -78
  73. package/lib/esm/chunk-MQOSI237.mjs.map +0 -1
  74. package/lib/esm/chunk-SK5C7NUN.mjs.map +0 -1
  75. package/lib/esm/chunk-SMJPC7BB.mjs.map +0 -1
  76. package/lib/esm/chunk-WWNBSU45.mjs.map +0 -1
@@ -4,7 +4,7 @@ import {
4
4
  PAGE_STREAM_MAX_FRAME_BYTES,
5
5
  PageStreamDescriptorSchema,
6
6
  PageStreamEventSchema
7
- } from "./chunk-MQOSI237.mjs";
7
+ } from "./chunk-L7WP57HT.mjs";
8
8
  import {
9
9
  AccessPolicySchema,
10
10
  ActionProgramDefinitionSchema,
@@ -87,6 +87,8 @@ import {
87
87
  TenantProductConfigSchema,
88
88
  TenantRuntimeConfigSchema,
89
89
  TenantScopeSchema,
90
+ VIEW_ONTOLOGY_ID,
91
+ ViewOntologyRecordSchema,
90
92
  ViewProviderDescriptorSchema,
91
93
  ViewSpecSchema,
92
94
  WorkbenchReleaseSchema,
@@ -117,7 +119,7 @@ import {
117
119
  require_validation,
118
120
  require_validation_error,
119
121
  resolveThemeTokens
120
- } from "./chunk-WWNBSU45.mjs";
122
+ } from "./chunk-5IWBM5FS.mjs";
121
123
  import {
122
124
  __commonJS,
123
125
  __toESM
@@ -2772,6 +2774,7 @@ var resolvePage = (input) => {
2772
2774
  activation: node.activation ?? defaultActivation,
2773
2775
  lifecycle: node.lifecycle ?? defaultRenderLifecycle,
2774
2776
  layout: node.layout ?? { mode: "contents" },
2777
+ ...node.dynamicLayout ? { dynamicLayout: node.dynamicLayout } : {},
2775
2778
  ...node.style ? { style: node.style } : {},
2776
2779
  responsive: node.responsive ?? [],
2777
2780
  state: node.state ?? "idle",
@@ -2811,6 +2814,7 @@ var resolvePage = (input) => {
2811
2814
  ...node.access ? { accessPolicy: node.access } : {},
2812
2815
  ...node.activeWhen ? { activationWhen: node.activeWhen } : {},
2813
2816
  ...node.loadingWhen ? { loadingWhen: node.loadingWhen } : {},
2817
+ ...node.dynamicLayout ? { dynamicLayout: node.dynamicLayout } : {},
2814
2818
  allowedSideEffects: [...registration.allowedSideEffects]
2815
2819
  });
2816
2820
  for (const [index, binding] of (node.data ?? []).entries()) {
@@ -3417,7 +3421,8 @@ var compilePageRuntimeBundleInternal = (input, legacy) => {
3417
3421
  }
3418
3422
  return {
3419
3423
  shellRevisionRef: page.shellRevisionRef,
3420
- header: shellChrome.header
3424
+ header: shellChrome.header,
3425
+ ...shellChrome.workspaceModes ? { workspaceModes: shellChrome.workspaceModes } : {}
3421
3426
  };
3422
3427
  })();
3423
3428
  if (page.renderTree.nodes.length > input.limits.maxRenderNodes)
@@ -7758,6 +7763,207 @@ function nativePageMountPlan(page, catalogRevision) {
7758
7763
  return { routeClaims: [claim], mounts: page.composition.mounts };
7759
7764
  }
7760
7765
 
7766
+ // src/runtime/unified-view-compiler.ts
7767
+ var VIEW_LORO_KEYED_COLLECTIONS = [
7768
+ { path: "ui.bentos", keyField: "bentoId" }
7769
+ ];
7770
+ function computeCanonicalViewHash(input) {
7771
+ return canonicalContentHash({
7772
+ boundOntologyId: input.boundOntologyId.trim(),
7773
+ data: input.data,
7774
+ ui: input.ui
7775
+ });
7776
+ }
7777
+ function buildDeterministicViewId(input) {
7778
+ return `view-${computeCanonicalViewHash(input).slice(0, 24)}`;
7779
+ }
7780
+ function createSingleBentoViewRecord(params) {
7781
+ const boundOntologyId = params.ontologyId.trim();
7782
+ const bentoType = params.bentoType ?? "card";
7783
+ const data = {
7784
+ statements: {
7785
+ primary: {
7786
+ kind: "select",
7787
+ from: {
7788
+ source: "ontology",
7789
+ ontologyId: boundOntologyId,
7790
+ ...params.includeSharedSlices ? { includeSharedSlices: true } : {}
7791
+ },
7792
+ ...params.select ? { select: params.select } : {},
7793
+ ...params.where ? { where: params.where } : {},
7794
+ ...params.orderBy?.length ? { orderBy: params.orderBy } : {},
7795
+ ...params.limit ? { limit: params.limit } : {}
7796
+ }
7797
+ }
7798
+ };
7799
+ const ui = {
7800
+ columns: 12,
7801
+ rowHeight: 72,
7802
+ bentos: [
7803
+ {
7804
+ bentoId: "primary",
7805
+ bentoType,
7806
+ x: 0,
7807
+ y: 0,
7808
+ w: 12,
7809
+ h: 10,
7810
+ statementId: "primary",
7811
+ ...params.name ? { title: params.name } : {},
7812
+ ...params.bentoProps ? { props: params.bentoProps } : {}
7813
+ }
7814
+ ]
7815
+ };
7816
+ const viewId = params.viewId?.trim() || buildDeterministicViewId({ boundOntologyId, data, ui });
7817
+ return ViewOntologyRecordSchema.parse({
7818
+ contract: "ViewOntologyRecord",
7819
+ schemaVersion: 1,
7820
+ viewId,
7821
+ boundOntologyId,
7822
+ ...params.name ? { name: params.name } : {},
7823
+ ...params.description ? { description: params.description } : {},
7824
+ ...params.parentViewId ? { parentViewId: params.parentViewId } : {},
7825
+ data,
7826
+ ui
7827
+ });
7828
+ }
7829
+ function createSelectionShareViewRecord(params) {
7830
+ const uniqueIds = Array.from(
7831
+ new Set(params.assetIds.map((id) => id.trim()).filter(Boolean))
7832
+ ).sort();
7833
+ if (uniqueIds.length === 0) {
7834
+ throw new Error("Selection share View requires at least one assetId.");
7835
+ }
7836
+ const where = uniqueIds.length === 1 ? { op: "field", field: "id", cmp: "eq", value: uniqueIds[0] } : { op: "field", field: "id", cmp: "in", value: uniqueIds };
7837
+ const resolvedBentoType = params.bentoType ?? (uniqueIds.length === 1 ? "record-detail" : "card");
7838
+ return createSingleBentoViewRecord({
7839
+ viewId: params.viewId,
7840
+ ontologyId: params.ontologyId,
7841
+ name: params.name,
7842
+ where,
7843
+ select: params.select,
7844
+ bentoType: resolvedBentoType
7845
+ });
7846
+ }
7847
+ function createWorkflowViewRecord(params) {
7848
+ const workflowId = params.workflowId.trim();
7849
+ const pageType = params.pageType ?? "preview";
7850
+ const boundOntologyId = params.boundOntologyId?.trim() || VIEW_ONTOLOGY_ID;
7851
+ if (pageType === "preview") {
7852
+ const data2 = {
7853
+ statements: {
7854
+ execute_workflow: {
7855
+ kind: "call",
7856
+ workflowId,
7857
+ pageType: "preview",
7858
+ ...params.outputStrategy ? { outputStrategy: params.outputStrategy } : {}
7859
+ },
7860
+ workflow_outputs: {
7861
+ kind: "select",
7862
+ from: {
7863
+ source: "workflow-outputs",
7864
+ ontologyId: boundOntologyId,
7865
+ workflowId
7866
+ },
7867
+ orderBy: [{ field: "created_timestamp", kind: "builtin", direction: "desc" }]
7868
+ }
7869
+ }
7870
+ };
7871
+ const ui2 = {
7872
+ columns: 12,
7873
+ rowHeight: 72,
7874
+ bentos: [
7875
+ {
7876
+ bentoId: "form",
7877
+ bentoType: "workflow-form",
7878
+ x: 0,
7879
+ y: 0,
7880
+ w: 4,
7881
+ h: 10,
7882
+ actionStatementIds: ["execute_workflow"]
7883
+ },
7884
+ {
7885
+ bentoId: "results",
7886
+ bentoType: "workflow-waterfall",
7887
+ x: 4,
7888
+ y: 0,
7889
+ w: 8,
7890
+ h: 10,
7891
+ statementId: "workflow_outputs"
7892
+ }
7893
+ ]
7894
+ };
7895
+ const viewId2 = params.viewId?.trim() || buildDeterministicViewId({ boundOntologyId, data: data2, ui: ui2 });
7896
+ return ViewOntologyRecordSchema.parse({
7897
+ contract: "ViewOntologyRecord",
7898
+ schemaVersion: 1,
7899
+ viewId: viewId2,
7900
+ boundOntologyId,
7901
+ ...params.name ? { name: params.name } : {},
7902
+ data: data2,
7903
+ ui: ui2
7904
+ });
7905
+ }
7906
+ const bentoTypeByPageType = {
7907
+ process: "workflow-canvas",
7908
+ log: "workflow-log",
7909
+ chat: "workflow-chat",
7910
+ api: "markdown"
7911
+ };
7912
+ const data = {
7913
+ statements: {
7914
+ workflow_binding: {
7915
+ kind: "call",
7916
+ workflowId,
7917
+ pageType
7918
+ }
7919
+ }
7920
+ };
7921
+ const ui = {
7922
+ columns: 12,
7923
+ rowHeight: 72,
7924
+ bentos: [
7925
+ {
7926
+ bentoId: "main",
7927
+ bentoType: bentoTypeByPageType[pageType],
7928
+ x: 0,
7929
+ y: 0,
7930
+ w: 12,
7931
+ h: 10,
7932
+ actionStatementIds: ["workflow_binding"]
7933
+ }
7934
+ ]
7935
+ };
7936
+ const viewId = params.viewId?.trim() || buildDeterministicViewId({ boundOntologyId, data, ui });
7937
+ return ViewOntologyRecordSchema.parse({
7938
+ contract: "ViewOntologyRecord",
7939
+ schemaVersion: 1,
7940
+ viewId,
7941
+ boundOntologyId,
7942
+ ...params.name ? { name: params.name } : {},
7943
+ data,
7944
+ ui
7945
+ });
7946
+ }
7947
+ function resolveViewHostShell(context) {
7948
+ if (context.surface === "route") return "app-shell";
7949
+ if (context.surface === "share") return context.linkPolicy?.shell ?? "share-shell";
7950
+ return "none";
7951
+ }
7952
+ var CAPABILITY_ORDER = [
7953
+ "read",
7954
+ "execute",
7955
+ "write_data",
7956
+ "edit_view"
7957
+ ];
7958
+ function attenuateViewCapabilities(parentCapabilities, requestedCapabilities) {
7959
+ const allowed = new Set(parentCapabilities);
7960
+ if (!allowed.has("read")) return [];
7961
+ const attenuated = CAPABILITY_ORDER.filter(
7962
+ (cap) => cap === "read" || allowed.has(cap) && requestedCapabilities.includes(cap)
7963
+ );
7964
+ return attenuated;
7965
+ }
7966
+
7761
7967
  export {
7762
7968
  extractOpenApiCapabilityManifests,
7763
7969
  createCapabilityRegistrySource,
@@ -7900,6 +8106,14 @@ export {
7900
8106
  resolvePageRootParameters,
7901
8107
  buildPageMountHref,
7902
8108
  pageMountParentHref,
7903
- nativePageMountPlan
7904
- };
7905
- //# sourceMappingURL=chunk-SMJPC7BB.mjs.map
8109
+ nativePageMountPlan,
8110
+ VIEW_LORO_KEYED_COLLECTIONS,
8111
+ computeCanonicalViewHash,
8112
+ buildDeterministicViewId,
8113
+ createSingleBentoViewRecord,
8114
+ createSelectionShareViewRecord,
8115
+ createWorkflowViewRecord,
8116
+ resolveViewHostShell,
8117
+ attenuateViewCapabilities
8118
+ };
8119
+ //# sourceMappingURL=chunk-QM3K7CWF.mjs.map