@vertesia/common 1.0.0-dev.20260128.144200 → 1.0.0-dev.20260225.024852Z
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.
- package/lib/cjs/apikey.js +1 -0
- package/lib/cjs/apikey.js.map +1 -1
- package/lib/cjs/apps.js.map +1 -1
- package/lib/cjs/audit-trail.js +3 -0
- package/lib/cjs/audit-trail.js.map +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/integrations.js +2 -0
- package/lib/cjs/integrations.js.map +1 -1
- package/lib/cjs/interaction.js.map +1 -1
- package/lib/cjs/project.js +37 -1
- package/lib/cjs/project.js.map +1 -1
- package/lib/cjs/prompt.js.map +1 -1
- package/lib/cjs/store/dsl-workflow.js.map +1 -1
- package/lib/cjs/store/hive-memory.js +3 -0
- package/lib/cjs/store/hive-memory.js.map +1 -0
- package/lib/cjs/store/index.js +2 -0
- package/lib/cjs/store/index.js.map +1 -1
- package/lib/cjs/store/rendering.js +22 -0
- package/lib/cjs/store/rendering.js.map +1 -0
- package/lib/cjs/store/schedule.js.map +1 -1
- package/lib/cjs/store/store.js +15 -2
- package/lib/cjs/store/store.js.map +1 -1
- package/lib/cjs/store/workflow.js +44 -1
- package/lib/cjs/store/workflow.js.map +1 -1
- package/lib/cjs/user.js.map +1 -1
- package/lib/cjs/utils/schemas.js +26 -2
- package/lib/cjs/utils/schemas.js.map +1 -1
- package/lib/cjs/versions.js +1 -0
- package/lib/cjs/versions.js.map +1 -1
- package/lib/esm/apikey.js +1 -0
- package/lib/esm/apikey.js.map +1 -1
- package/lib/esm/apps.js.map +1 -1
- package/lib/esm/audit-trail.js +2 -0
- package/lib/esm/audit-trail.js.map +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/integrations.js +2 -0
- package/lib/esm/integrations.js.map +1 -1
- package/lib/esm/interaction.js.map +1 -1
- package/lib/esm/project.js +36 -0
- package/lib/esm/project.js.map +1 -1
- package/lib/esm/prompt.js.map +1 -1
- package/lib/esm/store/dsl-workflow.js.map +1 -1
- package/lib/esm/store/hive-memory.js +2 -0
- package/lib/esm/store/hive-memory.js.map +1 -0
- package/lib/esm/store/index.js +2 -0
- package/lib/esm/store/index.js.map +1 -1
- package/lib/esm/store/rendering.js +18 -0
- package/lib/esm/store/rendering.js.map +1 -0
- package/lib/esm/store/schedule.js.map +1 -1
- package/lib/esm/store/store.js +13 -2
- package/lib/esm/store/store.js.map +1 -1
- package/lib/esm/store/workflow.js +39 -1
- package/lib/esm/store/workflow.js.map +1 -1
- package/lib/esm/user.js.map +1 -1
- package/lib/esm/utils/schemas.js +24 -2
- package/lib/esm/utils/schemas.js.map +1 -1
- package/lib/esm/versions.js +1 -0
- package/lib/esm/versions.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/apikey.d.ts +2 -1
- package/lib/types/apikey.d.ts.map +1 -1
- package/lib/types/apps.d.ts +220 -1
- package/lib/types/apps.d.ts.map +1 -1
- package/lib/types/audit-trail.d.ts +49 -0
- package/lib/types/audit-trail.d.ts.map +1 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/integrations.d.ts +8 -0
- package/lib/types/integrations.d.ts.map +1 -1
- package/lib/types/interaction.d.ts +10 -11
- package/lib/types/interaction.d.ts.map +1 -1
- package/lib/types/project.d.ts +256 -1
- package/lib/types/project.d.ts.map +1 -1
- package/lib/types/prompt.d.ts +3 -4
- package/lib/types/prompt.d.ts.map +1 -1
- package/lib/types/skill.d.ts.map +1 -1
- package/lib/types/store/conversation-state.d.ts +7 -0
- package/lib/types/store/conversation-state.d.ts.map +1 -1
- package/lib/types/store/doc-analyzer.d.ts +1 -1
- package/lib/types/store/doc-analyzer.d.ts.map +1 -1
- package/lib/types/store/dsl-workflow.d.ts +28 -0
- package/lib/types/store/dsl-workflow.d.ts.map +1 -1
- package/lib/types/store/hive-memory.d.ts +116 -0
- package/lib/types/store/hive-memory.d.ts.map +1 -0
- package/lib/types/store/index.d.ts +2 -0
- package/lib/types/store/index.d.ts.map +1 -1
- package/lib/types/store/rendering.d.ts +193 -0
- package/lib/types/store/rendering.d.ts.map +1 -0
- package/lib/types/store/schedule.d.ts +2 -0
- package/lib/types/store/schedule.d.ts.map +1 -1
- package/lib/types/store/store.d.ts +31 -2
- package/lib/types/store/store.d.ts.map +1 -1
- package/lib/types/store/workflow.d.ts +145 -7
- package/lib/types/store/workflow.d.ts.map +1 -1
- package/lib/types/user.d.ts +9 -0
- package/lib/types/user.d.ts.map +1 -1
- package/lib/types/utils/schemas.d.ts +13 -4
- package/lib/types/utils/schemas.d.ts.map +1 -1
- package/lib/types/versions.d.ts +2 -1
- package/lib/types/versions.d.ts.map +1 -1
- package/lib/vertesia-common.js +1 -1
- package/lib/vertesia-common.js.map +1 -1
- package/package.json +2 -4
- package/src/apikey.ts +1 -0
- package/src/apps.ts +249 -1
- package/src/audit-trail.ts +61 -0
- package/src/index.ts +1 -0
- package/src/integrations.ts +10 -0
- package/src/interaction.ts +11 -12
- package/src/project.ts +309 -1
- package/src/prompt.ts +3 -4
- package/src/skill.ts +1 -0
- package/src/store/conversation-state.ts +9 -0
- package/src/store/doc-analyzer.ts +1 -1
- package/src/store/dsl-workflow.ts +26 -0
- package/src/store/hive-memory.ts +167 -0
- package/src/store/index.ts +2 -0
- package/src/store/rendering.ts +233 -0
- package/src/store/schedule.ts +3 -0
- package/src/store/store.ts +40 -4
- package/src/store/workflow.ts +191 -7
- package/src/user.ts +11 -0
- package/src/utils/schemas.ts +33 -11
- package/src/versions.ts +1 -0
package/src/utils/schemas.ts
CHANGED
|
@@ -1,9 +1,28 @@
|
|
|
1
|
-
import type { JSONSchema } from "@llumiverse/common";
|
|
1
|
+
import type { JSONSchema, ToolDefinition } from "@llumiverse/common";
|
|
2
2
|
import { PromptRole } from "@llumiverse/common";
|
|
3
|
-
import type { JSONSchema4 } from "json-schema";
|
|
4
3
|
import { InCodePrompt, InteractionRefWithSchema, PopulatedInteraction } from "../interaction.js";
|
|
5
4
|
import { ExecutablePromptSegmentDef, PromptSegmentDefType } from "../prompt.js";
|
|
6
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Sanitize a tool definition to only include fields expected by LLM APIs.
|
|
8
|
+
* Removes extra fields like 'category', 'default', 'related_tools' that are
|
|
9
|
+
* used internally but should not be sent to the LLM.
|
|
10
|
+
*/
|
|
11
|
+
export function sanitizeToolDefinition(tool: ToolDefinition): ToolDefinition {
|
|
12
|
+
return {
|
|
13
|
+
name: tool.name,
|
|
14
|
+
description: tool.description,
|
|
15
|
+
input_schema: tool.input_schema,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Sanitize an array of tool definitions.
|
|
21
|
+
*/
|
|
22
|
+
export function sanitizeToolDefinitions(tools: ToolDefinition[] | undefined): ToolDefinition[] | undefined {
|
|
23
|
+
if (!tools) return tools;
|
|
24
|
+
return tools.map(sanitizeToolDefinition);
|
|
25
|
+
}
|
|
7
26
|
|
|
8
27
|
// Remove custom properties from the JSON before sending further down execution pipeline
|
|
9
28
|
export function removeExtraProperties<T>(schema: T): T {
|
|
@@ -28,7 +47,7 @@ export function removeExtraProperties<T>(schema: T): T {
|
|
|
28
47
|
}
|
|
29
48
|
|
|
30
49
|
export function mergeJSONSchemas(schemas: JSONSchema[]) {
|
|
31
|
-
const props: Record<string,
|
|
50
|
+
const props: Record<string, JSONSchema> = {};
|
|
32
51
|
let required: string[] = [];
|
|
33
52
|
for (const schema of schemas) {
|
|
34
53
|
if (schema.properties) {
|
|
@@ -40,13 +59,13 @@ export function mergeJSONSchemas(schemas: JSONSchema[]) {
|
|
|
40
59
|
Object.assign(props, schema.properties);
|
|
41
60
|
}
|
|
42
61
|
}
|
|
43
|
-
const schema = Object.keys(props).length > 0 ? { properties: props, required, type: 'object' }
|
|
62
|
+
const schema: JSONSchema | null = Object.keys(props).length > 0 ? { properties: props, required, type: 'object' } : null;
|
|
44
63
|
return schema;
|
|
45
64
|
}
|
|
46
65
|
|
|
47
66
|
export function _mergePromptsSchema(prompts: ExecutablePromptSegmentDef[]) {
|
|
48
|
-
const props: Record<string,
|
|
49
|
-
let required = new Set<
|
|
67
|
+
const props: Record<string, JSONSchema> = {};
|
|
68
|
+
let required = new Set<string>();
|
|
50
69
|
for (const prompt of prompts) {
|
|
51
70
|
if (prompt.template?.inputSchema?.properties) {
|
|
52
71
|
const schema = prompt.template?.inputSchema;
|
|
@@ -76,10 +95,12 @@ export function _mergePromptsSchema(prompts: ExecutablePromptSegmentDef[]) {
|
|
|
76
95
|
required.add('chat');
|
|
77
96
|
}
|
|
78
97
|
}
|
|
79
|
-
|
|
98
|
+
|
|
99
|
+
const schema: JSONSchema | null = Object.keys(props).length > 0 ? {
|
|
80
100
|
properties: props,
|
|
81
101
|
required: Array.from(required)
|
|
82
|
-
}
|
|
102
|
+
} : null;
|
|
103
|
+
return schema;
|
|
83
104
|
}
|
|
84
105
|
|
|
85
106
|
export function mergePromptsSchema(interaction: InteractionRefWithSchema | PopulatedInteraction) {
|
|
@@ -89,7 +110,7 @@ export function mergePromptsSchema(interaction: InteractionRefWithSchema | Popul
|
|
|
89
110
|
|
|
90
111
|
export function mergeInCodePromptSchemas(prompts: InCodePrompt[]) {
|
|
91
112
|
const props: Record<string, JSONSchema> = {};
|
|
92
|
-
let required = new Set<
|
|
113
|
+
let required = new Set<string>();
|
|
93
114
|
for (const prompt of prompts) {
|
|
94
115
|
if (prompt.schema?.properties) {
|
|
95
116
|
const schema = prompt.schema;
|
|
@@ -101,8 +122,9 @@ export function mergeInCodePromptSchemas(prompts: InCodePrompt[]) {
|
|
|
101
122
|
Object.assign(props, schema.properties);
|
|
102
123
|
}
|
|
103
124
|
}
|
|
104
|
-
|
|
125
|
+
const schema: JSONSchema | null = Object.keys(props).length > 0 ? {
|
|
105
126
|
properties: props,
|
|
106
127
|
required: Array.from(required)
|
|
107
|
-
}
|
|
128
|
+
} : null;
|
|
129
|
+
return schema;
|
|
108
130
|
}
|
package/src/versions.ts
CHANGED