@vertesia/common 1.5.0-dev.20260717.131047Z → 1.5.0-dev.20260725.083715Z

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 (123) hide show
  1. package/lib/apps.d.ts +184 -48
  2. package/lib/apps.d.ts.map +1 -1
  3. package/lib/apps.js +21 -9
  4. package/lib/apps.js.map +1 -1
  5. package/lib/audit-trail.d.ts +61 -1
  6. package/lib/audit-trail.d.ts.map +1 -1
  7. package/lib/audit-trail.js +15 -0
  8. package/lib/audit-trail.js.map +1 -1
  9. package/lib/environment.d.ts +2 -0
  10. package/lib/environment.d.ts.map +1 -1
  11. package/lib/environment.js.map +1 -1
  12. package/lib/index.d.ts +7 -0
  13. package/lib/index.d.ts.map +1 -1
  14. package/lib/index.js +7 -0
  15. package/lib/index.js.map +1 -1
  16. package/lib/interaction.d.ts +77 -1
  17. package/lib/interaction.d.ts.map +1 -1
  18. package/lib/interaction.js +48 -0
  19. package/lib/interaction.js.map +1 -1
  20. package/lib/platform-event.d.ts +37 -3
  21. package/lib/platform-event.d.ts.map +1 -1
  22. package/lib/platform-event.js.map +1 -1
  23. package/lib/project.d.ts +119 -20
  24. package/lib/project.d.ts.map +1 -1
  25. package/lib/project.js +65 -0
  26. package/lib/project.js.map +1 -1
  27. package/lib/query.d.ts +6 -0
  28. package/lib/query.d.ts.map +1 -1
  29. package/lib/refs.d.ts +1 -0
  30. package/lib/refs.d.ts.map +1 -1
  31. package/lib/schema-for-extraction.d.ts +21 -0
  32. package/lib/schema-for-extraction.d.ts.map +1 -0
  33. package/lib/schema-for-extraction.js +205 -0
  34. package/lib/schema-for-extraction.js.map +1 -0
  35. package/lib/store/agent-run.d.ts +23 -1
  36. package/lib/store/agent-run.d.ts.map +1 -1
  37. package/lib/store/conversation-state.d.ts +3 -1
  38. package/lib/store/conversation-state.d.ts.map +1 -1
  39. package/lib/store/conversation-state.js.map +1 -1
  40. package/lib/store/doc-analyzer.d.ts +10 -67
  41. package/lib/store/doc-analyzer.d.ts.map +1 -1
  42. package/lib/store/dsl-workflow.d.ts +1 -0
  43. package/lib/store/dsl-workflow.d.ts.map +1 -1
  44. package/lib/store/dsl-workflow.js.map +1 -1
  45. package/lib/store/grounded-extraction.d.ts +146 -0
  46. package/lib/store/grounded-extraction.d.ts.map +1 -0
  47. package/lib/store/grounded-extraction.js +8 -0
  48. package/lib/store/grounded-extraction.js.map +1 -0
  49. package/lib/store/index.d.ts +1 -0
  50. package/lib/store/index.d.ts.map +1 -1
  51. package/lib/store/index.js +1 -0
  52. package/lib/store/index.js.map +1 -1
  53. package/lib/store/store.d.ts +314 -1
  54. package/lib/store/store.d.ts.map +1 -1
  55. package/lib/store/store.js +451 -0
  56. package/lib/store/store.js.map +1 -1
  57. package/lib/store/workflow.d.ts +8 -1
  58. package/lib/store/workflow.d.ts.map +1 -1
  59. package/lib/store/workflow.js +5 -0
  60. package/lib/store/workflow.js.map +1 -1
  61. package/lib/user.d.ts +14 -0
  62. package/lib/user.d.ts.map +1 -1
  63. package/lib/user.js +31 -0
  64. package/lib/user.js.map +1 -1
  65. package/lib/vertesia-common.js +2 -2
  66. package/lib/vertesia-common.js.map +1 -1
  67. package/lib/view-configuration-validation.d.ts +15 -0
  68. package/lib/view-configuration-validation.d.ts.map +1 -0
  69. package/lib/view-configuration-validation.js +63 -0
  70. package/lib/view-configuration-validation.js.map +1 -0
  71. package/lib/view-query-validation.d.ts +13 -0
  72. package/lib/view-query-validation.d.ts.map +1 -0
  73. package/lib/view-query-validation.js +266 -0
  74. package/lib/view-query-validation.js.map +1 -0
  75. package/lib/view-validation-helpers.d.ts +15 -0
  76. package/lib/view-validation-helpers.d.ts.map +1 -0
  77. package/lib/view-validation-helpers.js +25 -0
  78. package/lib/view-validation-helpers.js.map +1 -0
  79. package/lib/views-schema.d.ts +1992 -0
  80. package/lib/views-schema.d.ts.map +1 -0
  81. package/lib/views-schema.js +674 -0
  82. package/lib/views-schema.js.map +1 -0
  83. package/lib/views-validation.d.ts +21 -0
  84. package/lib/views-validation.d.ts.map +1 -0
  85. package/lib/views-validation.js +164 -0
  86. package/lib/views-validation.js.map +1 -0
  87. package/lib/views.d.ts +381 -0
  88. package/lib/views.d.ts.map +1 -0
  89. package/lib/views.js +41 -0
  90. package/lib/views.js.map +1 -0
  91. package/package.json +5 -5
  92. package/src/agent-resources.test.ts +100 -0
  93. package/src/apps.test.ts +9 -1
  94. package/src/apps.ts +220 -73
  95. package/src/audit-trail.ts +83 -0
  96. package/src/environment.ts +2 -0
  97. package/src/index.ts +12 -0
  98. package/src/interaction.ts +135 -1
  99. package/src/platform-event.ts +39 -2
  100. package/src/project.test.ts +44 -0
  101. package/src/project.ts +205 -22
  102. package/src/query.ts +6 -0
  103. package/src/refs.ts +1 -0
  104. package/src/schema-for-extraction.test.ts +191 -0
  105. package/src/schema-for-extraction.ts +231 -0
  106. package/src/store/agent-run.ts +29 -0
  107. package/src/store/content-type-editing.test.ts +17 -0
  108. package/src/store/conversation-state.ts +4 -1
  109. package/src/store/doc-analyzer.ts +10 -76
  110. package/src/store/dsl-workflow.ts +1 -0
  111. package/src/store/grounded-extraction.ts +154 -0
  112. package/src/store/index.ts +1 -0
  113. package/src/store/store.ts +800 -1
  114. package/src/store/workflow.ts +12 -0
  115. package/src/user.ts +46 -0
  116. package/src/view-configuration-validation.ts +74 -0
  117. package/src/view-query-validation.test.ts +21 -0
  118. package/src/view-query-validation.ts +319 -0
  119. package/src/view-validation-helpers.ts +28 -0
  120. package/src/views-schema.test.ts +364 -0
  121. package/src/views-schema.ts +689 -0
  122. package/src/views-validation.ts +234 -0
  123. package/src/views.ts +484 -0
package/lib/views.js ADDED
@@ -0,0 +1,41 @@
1
+ export const VIEW_EXPERIENCE_SCHEMA_VERSION = 1;
2
+ /** Build the generic reusable client route for a persisted or app-contributed View. */
3
+ export function viewExperienceRoute(id) {
4
+ return `/view/${encodeURIComponent(id)}`;
5
+ }
6
+ export const VIEW_SEARCH_FIELD_TYPES = ['text', 'keyword', 'number', 'date', 'boolean'];
7
+ export const VIEW_RESULT_FIELD_FORMATS = [
8
+ 'text',
9
+ 'date',
10
+ 'number',
11
+ 'badge',
12
+ 'user',
13
+ 'content_type',
14
+ 'location',
15
+ ];
16
+ /**
17
+ * Project a persisted or extended View value back to its reusable configuration
18
+ * fields. Callers that require a persisted configuration must validate the
19
+ * result at their API or persistence boundary because legacy records may not
20
+ * satisfy newer persisted-only requirements.
21
+ */
22
+ export function getViewExperienceConfiguration(value) {
23
+ return {
24
+ name: value.name,
25
+ ...(value.description === undefined ? {} : { description: value.description }),
26
+ ...(value.enabled === undefined ? {} : { enabled: value.enabled }),
27
+ ...(value.layout === undefined ? {} : { layout: value.layout }),
28
+ ...(value.scope === undefined ? {} : { scope: value.scope }),
29
+ ...(value.navigation === undefined ? {} : { navigation: value.navigation }),
30
+ ...(value.search === undefined ? {} : { search: value.search }),
31
+ ...(value.results === undefined ? {} : { results: value.results }),
32
+ };
33
+ }
34
+ /** Project a type-valid persisted View while preserving its required documentation field. */
35
+ export function getPersistedViewExperienceConfiguration(value) {
36
+ return {
37
+ ...getViewExperienceConfiguration(value),
38
+ description: value.description,
39
+ };
40
+ }
41
+ //# sourceMappingURL=views.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"views.js","sourceRoot":"","sources":["../src/views.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAU,CAAC;AAIzD,uFAAuF;AACvF,MAAM,UAAU,mBAAmB,CAAC,EAAU;IAC1C,OAAO,SAAS,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC;AAC7C,CAAC;AAkGD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC;AAqDjG,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACrC,MAAM;IACN,MAAM;IACN,QAAQ;IACR,OAAO;IACP,MAAM;IACN,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AC;QACxC,WAAW,EAAE,KAAK,CAAC,WAAW;KACjC,CAAC;AACN,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertesia/common",
3
- "version": "1.5.0-dev.20260717.131047Z",
3
+ "version": "1.5.0-dev.20260725.083715Z",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -17,14 +17,14 @@
17
17
  }
18
18
  },
19
19
  "devDependencies": {
20
- "rolldown": "1.1.4",
20
+ "rolldown": "1.2.0",
21
21
  "typescript": "^6.0.3",
22
- "vitest": "^4.1.9",
22
+ "vitest": "^4.1.10",
23
23
  "@vertesia/tsconfig": "0.1.0"
24
24
  },
25
25
  "dependencies": {
26
26
  "ajv": "^8.20.0",
27
- "@llumiverse/common": "1.5.0-dev.20260713.114357Z"
27
+ "@llumiverse/common": "1.5.0-dev.20260725.065646Z"
28
28
  },
29
29
  "repository": {
30
30
  "type": "git",
@@ -39,7 +39,7 @@
39
39
  "ai",
40
40
  "typescript"
41
41
  ],
42
- "gitHead": "8aaad228827b2927db8e6aa75b27bfac90fec36f",
42
+ "gitHead": "57bcc2f27dd17b3387f27c18e89329c4c37f98ac",
43
43
  "scripts": {
44
44
  "lint": "biome lint src",
45
45
  "test": "vitest run",
@@ -0,0 +1,100 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { type AgentResourceReference, getResourcesFromToolResult, normalizeAgentResources } from './interaction.js';
3
+ import { AgentMessageType, getResourcesFromMessage } from './store/workflow.js';
4
+
5
+ const validRef: AgentResourceReference = {
6
+ type: 'document',
7
+ id: 'doc-1',
8
+ label: 'My Document',
9
+ action: 'created',
10
+ };
11
+
12
+ describe('normalizeAgentResources', () => {
13
+ it('returns an empty array for non-array input', () => {
14
+ expect(normalizeAgentResources(undefined)).toEqual([]);
15
+ expect(normalizeAgentResources(null)).toEqual([]);
16
+ expect(normalizeAgentResources('nope')).toEqual([]);
17
+ expect(normalizeAgentResources({})).toEqual([]);
18
+ });
19
+
20
+ it('keeps a well-formed reference', () => {
21
+ expect(normalizeAgentResources([validRef])).toEqual([validRef]);
22
+ });
23
+
24
+ it('preserves revision_id when present and non-empty', () => {
25
+ const ref = { ...validRef, revision_id: 'rev-9' };
26
+ expect(normalizeAgentResources([ref])).toEqual([ref]);
27
+ });
28
+
29
+ it('drops an empty revision_id rather than keeping it', () => {
30
+ const result = normalizeAgentResources([{ ...validRef, revision_id: '' }]);
31
+ expect(result[0]).not.toHaveProperty('revision_id');
32
+ });
33
+
34
+ it('falls back to the id when the label is missing or empty', () => {
35
+ const result = normalizeAgentResources([{ type: 'collection', id: 'col-1', action: 'updated' }]);
36
+ expect(result).toEqual([{ type: 'collection', id: 'col-1', label: 'col-1', action: 'updated' }]);
37
+ });
38
+
39
+ it('drops entries with an unknown type or action', () => {
40
+ const result = normalizeAgentResources([
41
+ { type: 'artifact', id: 'a', label: 'a', action: 'created' },
42
+ { type: 'document', id: 'd', label: 'd', action: 'viewed' },
43
+ { type: 'document', id: '', label: 'd', action: 'created' },
44
+ validRef,
45
+ ]);
46
+ expect(result).toEqual([validRef]);
47
+ });
48
+
49
+ it('accepts every supported resource type', () => {
50
+ const types = [
51
+ 'document',
52
+ 'collection',
53
+ 'content_type',
54
+ 'interaction',
55
+ 'prompt',
56
+ 'agent',
57
+ 'workflow',
58
+ 'process',
59
+ 'process_run',
60
+ 'interaction_run',
61
+ 'view',
62
+ ] as const;
63
+ const input = types.map((type, i) => ({ type, id: `id-${i}`, label: `L${i}`, action: 'created' }));
64
+ expect(normalizeAgentResources(input)).toHaveLength(types.length);
65
+ });
66
+ });
67
+
68
+ describe('getResourcesFromToolResult', () => {
69
+ it('reads resources from result meta', () => {
70
+ expect(getResourcesFromToolResult({ meta: { resources: [validRef] } })).toEqual([validRef]);
71
+ });
72
+
73
+ it('returns an empty array when meta or resources are absent', () => {
74
+ expect(getResourcesFromToolResult({})).toEqual([]);
75
+ expect(getResourcesFromToolResult({ meta: {} })).toEqual([]);
76
+ });
77
+ });
78
+
79
+ describe('getResourcesFromMessage', () => {
80
+ it('reads resources from message details', () => {
81
+ const msg = {
82
+ timestamp: 0,
83
+ workflow_run_id: 'run-1',
84
+ type: AgentMessageType.THOUGHT,
85
+ message: '',
86
+ details: { event_class: 'activity', resources: [validRef] },
87
+ };
88
+ expect(getResourcesFromMessage(msg)).toEqual([validRef]);
89
+ });
90
+
91
+ it('returns an empty array when details or resources are absent', () => {
92
+ const msg = {
93
+ timestamp: 0,
94
+ workflow_run_id: 'run-1',
95
+ type: AgentMessageType.COMPLETE,
96
+ message: '',
97
+ };
98
+ expect(getResourcesFromMessage(msg)).toEqual([]);
99
+ });
100
+ });
package/src/apps.test.ts CHANGED
@@ -1,5 +1,13 @@
1
1
  import { describe, expect, it } from 'vitest';
2
- import { effectiveAppAccessControl } from './apps.js';
2
+ import { APP_ARTIFACT_TYPES, APP_CAPABILITIES, APP_PACKAGE_SCOPES, effectiveAppAccessControl } from './apps.js';
3
+
4
+ describe('app capability contracts', () => {
5
+ it('keeps views in manifest, package, and build-artifact contracts', () => {
6
+ expect(APP_CAPABILITIES).toContain('views');
7
+ expect(APP_PACKAGE_SCOPES).toContain('views');
8
+ expect(APP_ARTIFACT_TYPES).toContain('view');
9
+ });
10
+ });
3
11
 
4
12
  describe('effectiveAppAccessControl', () => {
5
13
  it("returns 'all' when neither installation nor manifest set the field", () => {