@vertesia/common 0.79.2 → 0.79.4

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 (64) hide show
  1. package/lib/cjs/access-control.js +3 -2
  2. package/lib/cjs/access-control.js.map +1 -1
  3. package/lib/cjs/apikey.js +0 -1
  4. package/lib/cjs/apikey.js.map +1 -1
  5. package/lib/cjs/index.js +0 -1
  6. package/lib/cjs/index.js.map +1 -1
  7. package/lib/cjs/interaction.js +2 -12
  8. package/lib/cjs/interaction.js.map +1 -1
  9. package/lib/cjs/project.js.map +1 -1
  10. package/lib/cjs/prompt.js +1 -0
  11. package/lib/cjs/prompt.js.map +1 -1
  12. package/lib/cjs/store/store.js.map +1 -1
  13. package/lib/cjs/store/workflow.js.map +1 -1
  14. package/lib/cjs/utils/schemas.js +31 -27
  15. package/lib/cjs/utils/schemas.js.map +1 -1
  16. package/lib/esm/access-control.js +3 -2
  17. package/lib/esm/access-control.js.map +1 -1
  18. package/lib/esm/apikey.js +0 -1
  19. package/lib/esm/apikey.js.map +1 -1
  20. package/lib/esm/index.js +0 -1
  21. package/lib/esm/index.js.map +1 -1
  22. package/lib/esm/interaction.js +1 -11
  23. package/lib/esm/interaction.js.map +1 -1
  24. package/lib/esm/project.js.map +1 -1
  25. package/lib/esm/prompt.js +1 -0
  26. package/lib/esm/prompt.js.map +1 -1
  27. package/lib/esm/store/store.js.map +1 -1
  28. package/lib/esm/store/workflow.js.map +1 -1
  29. package/lib/esm/utils/schemas.js +30 -26
  30. package/lib/esm/utils/schemas.js.map +1 -1
  31. package/lib/tsconfig.tsbuildinfo +1 -1
  32. package/lib/types/access-control.d.ts +3 -2
  33. package/lib/types/access-control.d.ts.map +1 -1
  34. package/lib/types/apikey.d.ts +2 -6
  35. package/lib/types/apikey.d.ts.map +1 -1
  36. package/lib/types/apps.d.ts +0 -7
  37. package/lib/types/apps.d.ts.map +1 -1
  38. package/lib/types/index.d.ts +0 -1
  39. package/lib/types/index.d.ts.map +1 -1
  40. package/lib/types/interaction.d.ts +29 -254
  41. package/lib/types/interaction.d.ts.map +1 -1
  42. package/lib/types/project.d.ts +0 -1
  43. package/lib/types/project.d.ts.map +1 -1
  44. package/lib/types/prompt.d.ts +8 -15
  45. package/lib/types/prompt.d.ts.map +1 -1
  46. package/lib/types/store/collections.d.ts +0 -12
  47. package/lib/types/store/collections.d.ts.map +1 -1
  48. package/lib/types/store/store.d.ts +0 -16
  49. package/lib/types/store/store.d.ts.map +1 -1
  50. package/lib/types/store/workflow.d.ts +8 -40
  51. package/lib/types/store/workflow.d.ts.map +1 -1
  52. package/lib/types/utils/schemas.d.ts +4 -4
  53. package/lib/types/utils/schemas.d.ts.map +1 -1
  54. package/lib/vertesia-common.js +1 -1
  55. package/lib/vertesia-common.js.map +1 -1
  56. package/package.json +2 -2
  57. package/src/interaction.ts +14 -2
  58. package/src/utils/schemas.ts +22 -0
  59. package/lib/cjs/sts-token-types.js +0 -32
  60. package/lib/cjs/sts-token-types.js.map +0 -1
  61. package/lib/esm/sts-token-types.js +0 -24
  62. package/lib/esm/sts-token-types.js.map +0 -1
  63. package/lib/types/sts-token-types.d.ts +0 -72
  64. package/lib/types/sts-token-types.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertesia/common",
3
- "version": "0.79.2",
3
+ "version": "0.79.4",
4
4
  "type": "module",
5
5
  "types": "./lib/types/index.d.ts",
6
6
  "files": [
@@ -27,7 +27,7 @@
27
27
  "dependencies": {
28
28
  "ajv": "^8.16.0",
29
29
  "json-schema": "^0.4.0",
30
- "@llumiverse/common": "0.22.2"
30
+ "@llumiverse/common": "0.22.3"
31
31
  },
32
32
  "ts_dual_module": {
33
33
  "outDir": "lib"
@@ -78,6 +78,9 @@ export interface InteractionEndpoint {
78
78
  visibility?: InteractionVisibility;
79
79
  version: number;
80
80
  tags: string[];
81
+ /**
82
+ * @deprecated This is deprecated. Use CompletionResult.type information instead.
83
+ */
81
84
  output_modality?: Modalities;
82
85
  result_schema?: JSONSchema;
83
86
  params_schema?: JSONSchema;
@@ -185,6 +188,10 @@ export interface Interaction {
185
188
  model: string;
186
189
  model_options?: ModelOptions;
187
190
  prompts: PromptSegmentDef[];
191
+
192
+ /**
193
+ * @deprecated This is deprecated. Use CompletionResult.type information instead.
194
+ */
188
195
  output_modality?: Modalities;
189
196
  environment: string | ExecutionEnvironmentRef;
190
197
  restriction?: RunDataStorageLevel;
@@ -248,7 +255,8 @@ export interface InteractionExecutionPayload {
248
255
  */
249
256
  data?: Record<string, any> | `memory:${string}`;
250
257
  config?: InteractionExecutionConfiguration;
251
- result_schema?: JSONSchema4;
258
+ //Use null to explicitly state no schema, will not fallback to interaction schema
259
+ result_schema?: JSONSchema4 | null;
252
260
  stream?: boolean;
253
261
  do_validate?: boolean;
254
262
  tags?: string | string[]; // tags to be added to the execution run
@@ -463,7 +471,11 @@ export interface ExecutionRun<P = any> {
463
471
  config: InteractionExecutionConfiguration;
464
472
  error?: InteractionExecutionError;
465
473
  source: RunSource;
466
- output_modality: Modalities;
474
+
475
+ /**
476
+ * @deprecated This is deprecated. Use CompletionResult.type information instead.
477
+ */
478
+ output_modality?: Modalities;
467
479
  created_by: string;
468
480
  updated_by: string;
469
481
 
@@ -5,6 +5,28 @@ import { InteractionRefWithSchema, PopulatedInteraction } from "../interaction.j
5
5
  import { PopulatedPromptSegmentDef, PromptSegmentDef, PromptSegmentDefType, PromptTemplateRefWithSchema } from "../prompt.js";
6
6
 
7
7
 
8
+ // Remove custom properties from the JSON before sending further down execution pipeline
9
+ export function removeExtraProperties<T>(schema: T): T {
10
+ if (!schema) return schema;
11
+ if (Array.isArray(schema)) {
12
+ for (const item of schema) {
13
+ removeExtraProperties(item);
14
+ }
15
+ } else if (typeof schema === 'object') {
16
+ const obj = schema as Record<string, any>;
17
+ for (const [key, value] of Object.entries(obj)) {
18
+ if (key === 'editor' && (value === 'textarea' || value === 'document' || value === 'media')) {
19
+ delete obj[key];
20
+ } else if (key === 'format' && (value === 'textarea' || value === 'document' || value === 'media')) {
21
+ delete obj[key];
22
+ } else if (typeof value === 'object') {
23
+ removeExtraProperties(value)
24
+ }
25
+ }
26
+ }
27
+ return schema;
28
+ }
29
+
8
30
  export function mergeJSONSchemas(schemas: JSONSchema[]) {
9
31
  const props: Record<string, JSONSchema4> = {};
10
32
  let required: string[] = [];
@@ -1,32 +0,0 @@
1
- "use strict";
2
- /**
3
- * STS Token Request Types
4
- * These types define the structure for token requests to the Security Token Service
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.isApiKeyRequest = isApiKeyRequest;
8
- exports.isUserRequest = isUserRequest;
9
- exports.isProjectRequest = isProjectRequest;
10
- exports.isEnvironmentRequest = isEnvironmentRequest;
11
- exports.isAgentRequest = isAgentRequest;
12
- exports.isServiceAccountRequest = isServiceAccountRequest;
13
- // Helper type guards for type narrowing
14
- function isApiKeyRequest(req) {
15
- return req.type === 'apikey';
16
- }
17
- function isUserRequest(req) {
18
- return req.type === 'user';
19
- }
20
- function isProjectRequest(req) {
21
- return req.type === 'project';
22
- }
23
- function isEnvironmentRequest(req) {
24
- return req.type === 'environment';
25
- }
26
- function isAgentRequest(req) {
27
- return req.type === 'agent';
28
- }
29
- function isServiceAccountRequest(req) {
30
- return req.type === 'service_account';
31
- }
32
- //# sourceMappingURL=sts-token-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sts-token-types.js","sourceRoot":"","sources":["../../src/sts-token-types.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAgFH,0CAEC;AAED,sCAEC;AAED,4CAEC;AAED,oDAEC;AAED,wCAEC;AAED,0DAEC;AAvBD,wCAAwC;AACxC,SAAgB,eAAe,CAAC,GAAsB;IAClD,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC;AACjC,CAAC;AAED,SAAgB,aAAa,CAAC,GAAsB;IAChD,OAAO,GAAG,CAAC,IAAI,KAAK,MAAM,CAAC;AAC/B,CAAC;AAED,SAAgB,gBAAgB,CAAC,GAAsB;IACnD,OAAO,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC;AAClC,CAAC;AAED,SAAgB,oBAAoB,CAAC,GAAsB;IACvD,OAAO,GAAG,CAAC,IAAI,KAAK,aAAa,CAAC;AACtC,CAAC;AAED,SAAgB,cAAc,CAAC,GAAsB;IACjD,OAAO,GAAG,CAAC,IAAI,KAAK,OAAO,CAAC;AAChC,CAAC;AAED,SAAgB,uBAAuB,CAAC,GAAsB;IAC1D,OAAO,GAAG,CAAC,IAAI,KAAK,iBAAiB,CAAC;AAC1C,CAAC"}
@@ -1,24 +0,0 @@
1
- /**
2
- * STS Token Request Types
3
- * These types define the structure for token requests to the Security Token Service
4
- */
5
- // Helper type guards for type narrowing
6
- export function isApiKeyRequest(req) {
7
- return req.type === 'apikey';
8
- }
9
- export function isUserRequest(req) {
10
- return req.type === 'user';
11
- }
12
- export function isProjectRequest(req) {
13
- return req.type === 'project';
14
- }
15
- export function isEnvironmentRequest(req) {
16
- return req.type === 'environment';
17
- }
18
- export function isAgentRequest(req) {
19
- return req.type === 'agent';
20
- }
21
- export function isServiceAccountRequest(req) {
22
- return req.type === 'service_account';
23
- }
24
- //# sourceMappingURL=sts-token-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sts-token-types.js","sourceRoot":"","sources":["../../src/sts-token-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA+EH,wCAAwC;AACxC,MAAM,UAAU,eAAe,CAAC,GAAsB;IAClD,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,GAAsB;IAChD,OAAO,GAAG,CAAC,IAAI,KAAK,MAAM,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,GAAsB;IACnD,OAAO,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,GAAsB;IACvD,OAAO,GAAG,CAAC,IAAI,KAAK,aAAa,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,GAAsB;IACjD,OAAO,GAAG,CAAC,IAAI,KAAK,OAAO,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,GAAsB;IAC1D,OAAO,GAAG,CAAC,IAAI,KAAK,iBAAiB,CAAC;AAC1C,CAAC"}
@@ -1,72 +0,0 @@
1
- /**
2
- * STS Token Request Types
3
- * These types define the structure for token requests to the Security Token Service
4
- */
5
- export type TokenType = 'apikey' | 'user' | 'project' | 'environment' | 'agent' | 'service_account';
6
- export type SigningAlgorithm = 'ES256' | 'RS256';
7
- interface BaseTokenRequest {
8
- type: TokenType;
9
- audience?: string;
10
- /** Signing algorithm - defaults to ES256. Use RS256 for Azure AD compatibility. */
11
- algorithm?: SigningAlgorithm;
12
- }
13
- export interface ApiKeyTokenRequest extends BaseTokenRequest {
14
- type: 'apikey';
15
- key: string;
16
- }
17
- export interface UserTokenRequest extends BaseTokenRequest {
18
- type: 'user';
19
- user_id?: string;
20
- account_id?: string;
21
- project_id?: string;
22
- expires_at?: number;
23
- on_behalf_of?: string;
24
- }
25
- export interface ProjectTokenRequest extends BaseTokenRequest {
26
- type: 'project';
27
- project_id: string;
28
- account_id: string;
29
- }
30
- export interface EnvironmentTokenRequest extends BaseTokenRequest {
31
- type: 'environment';
32
- environment_id: string;
33
- environment_name: string;
34
- project_id: string;
35
- account_id: string;
36
- }
37
- export interface AgentTokenRequest extends BaseTokenRequest {
38
- type: 'agent';
39
- account_id: string;
40
- project_id: string;
41
- name?: string;
42
- on_behalf_of: string;
43
- }
44
- export interface ServiceAccountTokenRequest extends BaseTokenRequest {
45
- type: 'service_account';
46
- account_id: string;
47
- project_id: string;
48
- roles?: string[];
49
- name?: string;
50
- }
51
- export type IssueTokenRequest = ApiKeyTokenRequest | UserTokenRequest | ProjectTokenRequest | EnvironmentTokenRequest | AgentTokenRequest | ServiceAccountTokenRequest;
52
- export interface RefreshTokenRequest {
53
- token: string;
54
- }
55
- export interface RevokeTokenRequest {
56
- token: string;
57
- }
58
- export declare function isApiKeyRequest(req: IssueTokenRequest): req is ApiKeyTokenRequest;
59
- export declare function isUserRequest(req: IssueTokenRequest): req is UserTokenRequest;
60
- export declare function isProjectRequest(req: IssueTokenRequest): req is ProjectTokenRequest;
61
- export declare function isEnvironmentRequest(req: IssueTokenRequest): req is EnvironmentTokenRequest;
62
- export declare function isAgentRequest(req: IssueTokenRequest): req is AgentTokenRequest;
63
- export declare function isServiceAccountRequest(req: IssueTokenRequest): req is ServiceAccountTokenRequest;
64
- export interface TokenResponse {
65
- token: string;
66
- }
67
- export interface ValidateTokenResponse {
68
- valid: boolean;
69
- payload?: any;
70
- error?: string;
71
- }
72
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"sts-token-types.d.ts","sourceRoot":"","sources":["../../src/sts-token-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,aAAa,GAAG,OAAO,GAAG,iBAAiB,CAAC;AACpG,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,OAAO,CAAC;AAEjD,UAAU,gBAAgB;IACtB,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mFAAmF;IACnF,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAGD,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IACxD,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACf;AAGD,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,M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