@vertesia/cli 0.77.0 → 0.78.0-dev-9372725
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/package.json +71 -66
- package/lib/agent/commands.d.ts +0 -11
- package/lib/agent/commands.d.ts.map +0 -1
- package/lib/agent/commands.js +0 -173
- package/lib/agent/commands.js.map +0 -1
- package/lib/agent/connect.d.ts +0 -7
- package/lib/agent/connect.d.ts.map +0 -1
- package/lib/agent/connect.js +0 -68
- package/lib/agent/connect.js.map +0 -1
- package/lib/agent/docker-credential.d.ts +0 -2
- package/lib/agent/docker-credential.d.ts.map +0 -1
- package/lib/agent/docker-credential.js +0 -50
- package/lib/agent/docker-credential.js.map +0 -1
- package/lib/agent/docker.d.ts +0 -10
- package/lib/agent/docker.d.ts.map +0 -1
- package/lib/agent/docker.js +0 -93
- package/lib/agent/docker.js.map +0 -1
- package/lib/agent/index.d.ts +0 -3
- package/lib/agent/index.d.ts.map +0 -1
- package/lib/agent/index.js +0 -89
- package/lib/agent/index.js.map +0 -1
- package/lib/agent/project.d.ts +0 -58
- package/lib/agent/project.d.ts.map +0 -1
- package/lib/agent/project.js +0 -148
- package/lib/agent/project.js.map +0 -1
- package/lib/agent/refresh.d.ts +0 -6
- package/lib/agent/refresh.d.ts.map +0 -1
- package/lib/agent/refresh.js +0 -47
- package/lib/agent/refresh.js.map +0 -1
- package/lib/agent/registry.d.ts +0 -7
- package/lib/agent/registry.d.ts.map +0 -1
- package/lib/agent/registry.js +0 -47
- package/lib/agent/registry.js.map +0 -1
- package/lib/agent/version.d.ts +0 -2
- package/lib/agent/version.d.ts.map +0 -1
- package/lib/agent/version.js +0 -4
- package/lib/agent/version.js.map +0 -1
- package/lib/client.d.ts +0 -4
- package/lib/client.d.ts.map +0 -1
- package/lib/client.js +0 -22
- package/lib/client.js.map +0 -1
- package/lib/codegen/CodeBuilder.d.ts +0 -16
- package/lib/codegen/CodeBuilder.d.ts.map +0 -1
- package/lib/codegen/CodeBuilder.js +0 -115
- package/lib/codegen/CodeBuilder.js.map +0 -1
- package/lib/codegen/InteractionVersion.d.ts +0 -29
- package/lib/codegen/InteractionVersion.d.ts.map +0 -1
- package/lib/codegen/InteractionVersion.js +0 -94
- package/lib/codegen/InteractionVersion.js.map +0 -1
- package/lib/codegen/index.d.ts +0 -3
- package/lib/codegen/index.d.ts.map +0 -1
- package/lib/codegen/index.js +0 -30
- package/lib/codegen/index.js.map +0 -1
- package/lib/codegen/template.d.ts +0 -3
- package/lib/codegen/template.d.ts.map +0 -1
- package/lib/codegen/template.js +0 -28
- package/lib/codegen/template.js.map +0 -1
- package/lib/codegen/utils.d.ts +0 -2
- package/lib/codegen/utils.d.ts.map +0 -1
- package/lib/codegen/utils.js +0 -4
- package/lib/codegen/utils.js.map +0 -1
- package/lib/datagen/index.d.ts +0 -3
- package/lib/datagen/index.d.ts.map +0 -1
- package/lib/datagen/index.js +0 -80
- package/lib/datagen/index.js.map +0 -1
- package/lib/envs/index.d.ts +0 -3
- package/lib/envs/index.d.ts.map +0 -1
- package/lib/envs/index.js +0 -24
- package/lib/envs/index.js.map +0 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -177
- package/lib/index.js.map +0 -1
- package/lib/interactions/index.d.ts +0 -3
- package/lib/interactions/index.d.ts.map +0 -1
- package/lib/interactions/index.js +0 -37
- package/lib/interactions/index.js.map +0 -1
- package/lib/memory/index.d.ts +0 -3
- package/lib/memory/index.d.ts.map +0 -1
- package/lib/memory/index.js +0 -15
- package/lib/memory/index.js.map +0 -1
- package/lib/objects/commands.d.ts +0 -14
- package/lib/objects/commands.d.ts.map +0 -1
- package/lib/objects/commands.js +0 -240
- package/lib/objects/commands.js.map +0 -1
- package/lib/objects/index.d.ts +0 -3
- package/lib/objects/index.d.ts.map +0 -1
- package/lib/objects/index.js +0 -37
- package/lib/objects/index.js.map +0 -1
- package/lib/package.d.ts +0 -8
- package/lib/package.d.ts.map +0 -1
- package/lib/package.js +0 -63
- package/lib/package.js.map +0 -1
- package/lib/profiles/commands.d.ts +0 -20
- package/lib/profiles/commands.d.ts.map +0 -1
- package/lib/profiles/commands.js +0 -191
- package/lib/profiles/commands.js.map +0 -1
- package/lib/profiles/index.d.ts +0 -65
- package/lib/profiles/index.d.ts.map +0 -1
- package/lib/profiles/index.js +0 -324
- package/lib/profiles/index.js.map +0 -1
- package/lib/profiles/server/cors.d.ts +0 -3
- package/lib/profiles/server/cors.d.ts.map +0 -1
- package/lib/profiles/server/cors.js +0 -18
- package/lib/profiles/server/cors.js.map +0 -1
- package/lib/profiles/server/index.d.ts +0 -12
- package/lib/profiles/server/index.d.ts.map +0 -1
- package/lib/profiles/server/index.js +0 -134
- package/lib/profiles/server/index.js.map +0 -1
- package/lib/profiles/server/server.d.ts +0 -4
- package/lib/profiles/server/server.d.ts.map +0 -1
- package/lib/profiles/server/server.js +0 -32
- package/lib/profiles/server/server.js.map +0 -1
- package/lib/projects/index.d.ts +0 -3
- package/lib/projects/index.d.ts.map +0 -1
- package/lib/projects/index.js +0 -17
- package/lib/projects/index.js.map +0 -1
- package/lib/run/executor.d.ts +0 -22
- package/lib/run/executor.d.ts.map +0 -1
- package/lib/run/executor.js +0 -182
- package/lib/run/executor.js.map +0 -1
- package/lib/run/index.d.ts +0 -3
- package/lib/run/index.d.ts.map +0 -1
- package/lib/run/index.js +0 -192
- package/lib/run/index.js.map +0 -1
- package/lib/runs/index.d.ts +0 -3
- package/lib/runs/index.d.ts.map +0 -1
- package/lib/runs/index.js +0 -48
- package/lib/runs/index.js.map +0 -1
- package/lib/utils/console.d.ts +0 -42
- package/lib/utils/console.d.ts.map +0 -1
- package/lib/utils/console.js +0 -256
- package/lib/utils/console.js.map +0 -1
- package/lib/utils/stdio.d.ts +0 -7
- package/lib/utils/stdio.d.ts.map +0 -1
- package/lib/utils/stdio.js +0 -35
- package/lib/utils/stdio.js.map +0 -1
- package/lib/workflows/commands.d.ts +0 -14
- package/lib/workflows/commands.d.ts.map +0 -1
- package/lib/workflows/commands.js +0 -232
- package/lib/workflows/commands.js.map +0 -1
- package/lib/workflows/index.d.ts +0 -3
- package/lib/workflows/index.d.ts.map +0 -1
- package/lib/workflows/index.js +0 -117
- package/lib/workflows/index.js.map +0 -1
- package/lib/workflows/json-loader.d.ts +0 -3
- package/lib/workflows/json-loader.d.ts.map +0 -1
- package/lib/workflows/json-loader.js +0 -16
- package/lib/workflows/json-loader.js.map +0 -1
- package/lib/workflows/streams.d.ts +0 -2
- package/lib/workflows/streams.d.ts.map +0 -1
- package/lib/workflows/streams.js +0 -419
- package/lib/workflows/streams.js.map +0 -1
- package/lib/workflows/ts-loader.d.ts +0 -3
- package/lib/workflows/ts-loader.d.ts.map +0 -1
- package/lib/workflows/ts-loader.js +0 -94
- package/lib/workflows/ts-loader.js.map +0 -1
- package/lib/workflows/validation.d.ts +0 -6
- package/lib/workflows/validation.d.ts.map +0 -1
- package/lib/workflows/validation.js +0 -22
- package/lib/workflows/validation.js.map +0 -1
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { InteractionRefWithSchema } from "@vertesia/common";
|
|
2
|
-
export interface InteractionsExportOptions {
|
|
3
|
-
dir: string;
|
|
4
|
-
project: string;
|
|
5
|
-
exportVersion?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface InteractionTemplateVars extends Record<string, string> {
|
|
8
|
-
id: string;
|
|
9
|
-
doc: string;
|
|
10
|
-
className: string;
|
|
11
|
-
projectId: string;
|
|
12
|
-
inputType: string;
|
|
13
|
-
outputType: string;
|
|
14
|
-
types: string;
|
|
15
|
-
date: string;
|
|
16
|
-
}
|
|
17
|
-
export declare function processInteractionTemplate(vars: InteractionTemplateVars): string;
|
|
18
|
-
export declare class InteractionVersion {
|
|
19
|
-
interaction: InteractionRefWithSchema;
|
|
20
|
-
isDraft: boolean;
|
|
21
|
-
className: string;
|
|
22
|
-
constructor(interaction: InteractionRefWithSchema);
|
|
23
|
-
get isLatest(): boolean;
|
|
24
|
-
get versionName(): string;
|
|
25
|
-
get fileName(): string;
|
|
26
|
-
build(dir: string, opts: InteractionsExportOptions): Promise<string>;
|
|
27
|
-
genCode(opts: InteractionsExportOptions): Promise<string>;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=InteractionVersion.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionVersion.d.ts","sourceRoot":"","sources":["../../src/codegen/InteractionVersion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAyC,MAAM,kBAAkB,CAAC;AAOnG,MAAM,WAAW,yBAAyB;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,uBAAwB,SAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IACnE,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,uBAAuB,UAEvE;AAED,qBAAa,kBAAkB;IAKR,WAAW,EAAE,wBAAwB;IAHxD,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;gBAEC,WAAW,EAAE,wBAAwB;IAKxD,IAAI,QAAQ,YAIX;IAED,IAAI,WAAW,WAEd;IACD,IAAI,QAAQ,WAEX;IAEK,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB;IAMlD,OAAO,CAAC,IAAI,EAAE,yBAAyB;CA8ChD"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { InteractionStatus, mergePromptsSchema } from "@vertesia/common";
|
|
2
|
-
import { compile as compileSchema } from 'json-schema-to-typescript';
|
|
3
|
-
import { join } from 'path';
|
|
4
|
-
import { writeFile } from "../utils/stdio.js";
|
|
5
|
-
import { processTemplate } from "./template.js";
|
|
6
|
-
import { textToPascalCase } from "./utils.js";
|
|
7
|
-
export function processInteractionTemplate(vars) {
|
|
8
|
-
return processTemplate('interaction', { ...vars, date: new Date().toISOString() });
|
|
9
|
-
}
|
|
10
|
-
export class InteractionVersion {
|
|
11
|
-
constructor(interaction) {
|
|
12
|
-
Object.defineProperty(this, "interaction", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
configurable: true,
|
|
15
|
-
writable: true,
|
|
16
|
-
value: interaction
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(this, "isDraft", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
configurable: true,
|
|
21
|
-
writable: true,
|
|
22
|
-
value: void 0
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(this, "className", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
configurable: true,
|
|
27
|
-
writable: true,
|
|
28
|
-
value: void 0
|
|
29
|
-
});
|
|
30
|
-
this.isDraft = interaction.status === InteractionStatus.draft;
|
|
31
|
-
this.className = textToPascalCase(interaction.name || '__Unknown');
|
|
32
|
-
}
|
|
33
|
-
get isLatest() {
|
|
34
|
-
//TODO we no more support the latest version
|
|
35
|
-
return false;
|
|
36
|
-
//return this.interaction.latest;
|
|
37
|
-
}
|
|
38
|
-
get versionName() {
|
|
39
|
-
return this.isDraft ? 'draft' : `v${this.interaction.version}`;
|
|
40
|
-
}
|
|
41
|
-
get fileName() {
|
|
42
|
-
return `${this.versionName}.ts`;
|
|
43
|
-
}
|
|
44
|
-
async build(dir, opts) {
|
|
45
|
-
const file = join(dir, this.fileName);
|
|
46
|
-
writeFile(file, await this.genCode(opts));
|
|
47
|
-
return file;
|
|
48
|
-
}
|
|
49
|
-
async genCode(opts) {
|
|
50
|
-
const interaction = this.interaction;
|
|
51
|
-
const className = this.className;
|
|
52
|
-
const inputSchema = mergePromptsSchema(interaction);
|
|
53
|
-
const outputSchema = interaction.result_schema;
|
|
54
|
-
const out = [];
|
|
55
|
-
const types = [];
|
|
56
|
-
let inputTypeName = "any";
|
|
57
|
-
let outputTypeName = "any";
|
|
58
|
-
if (inputSchema) {
|
|
59
|
-
inputTypeName = className + 'Props';
|
|
60
|
-
const schemaType = await compileSchema(inputSchema, inputTypeName, {
|
|
61
|
-
bannerComment: '',
|
|
62
|
-
style: {
|
|
63
|
-
tabWidth: 4,
|
|
64
|
-
},
|
|
65
|
-
additionalProperties: false
|
|
66
|
-
});
|
|
67
|
-
types.push(`/**\n * ${interaction.name} input type\n */`, schemaType);
|
|
68
|
-
}
|
|
69
|
-
if (outputSchema) {
|
|
70
|
-
outputTypeName = className + 'Result';
|
|
71
|
-
const schemaType = await compileSchema(outputSchema, outputTypeName, {
|
|
72
|
-
bannerComment: '',
|
|
73
|
-
style: {
|
|
74
|
-
tabWidth: 4,
|
|
75
|
-
},
|
|
76
|
-
additionalProperties: false
|
|
77
|
-
});
|
|
78
|
-
types.push(`/**\n * ${interaction.name} result type\n */`, schemaType);
|
|
79
|
-
}
|
|
80
|
-
const vars = {
|
|
81
|
-
className: className,
|
|
82
|
-
id: interaction.id,
|
|
83
|
-
projectId: opts.project,
|
|
84
|
-
inputType: inputTypeName,
|
|
85
|
-
outputType: outputTypeName,
|
|
86
|
-
doc: interaction.description ? `${interaction.name}\n${interaction.description}` : interaction.name,
|
|
87
|
-
date: new Date().toISOString(),
|
|
88
|
-
types: types.join('\n')
|
|
89
|
-
};
|
|
90
|
-
out.push(processInteractionTemplate(vars));
|
|
91
|
-
return out.join('\n');
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
//# sourceMappingURL=InteractionVersion.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionVersion.js","sourceRoot":"","sources":["../../src/codegen/In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CAAC,CAAC;QAC3E,CAAC;QACD,MAAM,IAAI,GAA4B;YAClC,SAAS,EAAE,SAAS;YACpB,EAAE,EAAE,WAAW,CAAC,EAAE;YAClB,SAAS,EAAE,IAAI,CAAC,OAAO;YACvB,SAAS,EAAE,aAAa;YACxB,UAAU,EAAE,cAAc;YAC1B,GAAG,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,IAAI,KAAK,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI;YACnG,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YAC9B,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;SAC1B,CAAC;QACF,GAAG,CAAC,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAC,CAAC;QAE3C,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CACJ"}
|
package/lib/codegen/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/codegen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAA8B,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,iBA2B1H"}
|
package/lib/codegen/index.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { getClient } from "../client.js";
|
|
2
|
-
import { CodeBuilder } from "./CodeBuilder.js";
|
|
3
|
-
export default async function runExport(program, interactionName, options) {
|
|
4
|
-
const client = getClient(program);
|
|
5
|
-
const project = await client.getProject();
|
|
6
|
-
if (!project) {
|
|
7
|
-
console.error('No project id specified');
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
const tags = options.tags ? options.tags.split(/\s*,\s*/) : undefined;
|
|
11
|
-
const versions = options.versions ? options.versions.split(/\s*,\s*/) : ["draft"];
|
|
12
|
-
const payload = {
|
|
13
|
-
name: interactionName,
|
|
14
|
-
tags: tags,
|
|
15
|
-
versions: options.all ? [] : versions,
|
|
16
|
-
};
|
|
17
|
-
try {
|
|
18
|
-
const interactions = await client.interactions.export(payload);
|
|
19
|
-
new CodeBuilder().build(interactions, {
|
|
20
|
-
dir: options.dir,
|
|
21
|
-
project: project.id,
|
|
22
|
-
exportVersion: options.export || undefined,
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
catch (error) {
|
|
26
|
-
console.error('Failed to export interactions:', error.message || error);
|
|
27
|
-
process.exit(1);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=index.js.map
|
package/lib/codegen/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/codegen/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,SAAS,CAAC,OAAgB,EAAE,eAAmC,EAAE,OAA4B;IACvH,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IAClC,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;IAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;QACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACtE,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAElF,MAAM,OAAO,GAAG;QACZ,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;KACxC,CAAA;IACD,IAAI,CAAC;QACD,MAAM,YAAY,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC/D,IAAI,WAAW,EAAE,CAAC,KAAK,CAAC,YAAY,EAAE;YAClC,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,OAAO,EAAE,OAAO,CAAC,EAAE;YACnB,aAAa,EAAE,OAAO,CAAC,MAAM,IAAI,SAAS;SAC7C,CAAC,CAAC;IACP,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QAClB,OAAO,CAAC,KAAK,CAAC,gCAAgC,EAAE,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,CAAC;QACxE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/codegen/template.ts"],"names":[],"mappings":"AAOA,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,UAS7E;AAWD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,UAGzE"}
|
package/lib/codegen/template.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from 'fs';
|
|
2
|
-
import { packageDir } from '../package.js';
|
|
3
|
-
const EXPR_RX = /\{\{\s*[a-zA-Z_][a-zA-Z_0-9]*\s*\}\}/g;
|
|
4
|
-
const TEMPLATES = {};
|
|
5
|
-
export function expandVariables(template, vars) {
|
|
6
|
-
return template.replace(EXPR_RX, (match) => {
|
|
7
|
-
const key = match.substring(2, match.length - 2).trim();
|
|
8
|
-
if (key in vars) {
|
|
9
|
-
return vars[key] || '';
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
return match;
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
function loadTemplate(name) {
|
|
17
|
-
let content = TEMPLATES[name];
|
|
18
|
-
if (!content) {
|
|
19
|
-
content = readFileSync(`${packageDir}/templates/${name}.tpl`, 'utf8');
|
|
20
|
-
TEMPLATES[name] = content;
|
|
21
|
-
}
|
|
22
|
-
return content;
|
|
23
|
-
}
|
|
24
|
-
export function processTemplate(name, vars) {
|
|
25
|
-
const content = loadTemplate(name);
|
|
26
|
-
return expandVariables(content, vars);
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=template.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/codegen/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,OAAO,GAAG,uCAAuC,CAAA;AAEvD,MAAM,SAAS,GAA2B,EAAE,CAAC;AAE7C,MAAM,UAAU,eAAe,CAAC,QAAgB,EAAE,IAA4B;IAC1E,OAAO,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;QACvC,MAAM,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;QACvD,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;YACd,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;QAC1B,CAAC;aAAM,CAAC;YACJ,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC,CAAC,CAAA;AACN,CAAC;AAED,SAAS,YAAY,CAAC,IAAY;IAC9B,IAAI,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,OAAO,GAAG,YAAY,CAAC,GAAG,UAAU,cAAc,IAAI,MAAM,EAAE,MAAM,CAAC,CAAA;QACrE,SAAS,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;IAC9B,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,IAA4B;IACtE,MAAM,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACnC,OAAO,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC1C,CAAC"}
|
package/lib/codegen/utils.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/codegen/utils.ts"],"names":[],"mappings":"AACA,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,UAE5C"}
|
package/lib/codegen/utils.js
DELETED
package/lib/codegen/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/codegen/utils.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,gBAAgB,CAAC,IAAY;IACzC,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAClG,CAAC"}
|
package/lib/datagen/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/datagen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAapC,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QA8EhG"}
|
package/lib/datagen/index.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { resolve } from "path";
|
|
2
|
-
import { getClient } from "../client.js";
|
|
3
|
-
import { Spinner, restoreCursorOnExit } from "../utils/console.js";
|
|
4
|
-
import { writeJsonFile } from "../utils/stdio.js";
|
|
5
|
-
import { ConfigModes } from "@vertesia/common";
|
|
6
|
-
function convertConfigMode(raw_config_mode) {
|
|
7
|
-
const configStr = typeof raw_config_mode === 'string' ? raw_config_mode.toUpperCase() : "";
|
|
8
|
-
return Object.values(ConfigModes).includes(configStr) ? configStr : undefined;
|
|
9
|
-
}
|
|
10
|
-
export function genTestData(program, interactionId, options) {
|
|
11
|
-
const count = options.count ? parseInt(options.count) : 1;
|
|
12
|
-
const message = options.message || undefined;
|
|
13
|
-
const output = options.output || undefined;
|
|
14
|
-
const spinner = new Spinner('dots');
|
|
15
|
-
spinner.prefix = "Generating data. Please be patient ";
|
|
16
|
-
// Create abort controller for handling interruption
|
|
17
|
-
const abortController = new AbortController();
|
|
18
|
-
const { signal } = abortController;
|
|
19
|
-
// Set up cleanup function
|
|
20
|
-
const cleanup = () => {
|
|
21
|
-
spinner.done(false);
|
|
22
|
-
console.log("\nData generation interrupted");
|
|
23
|
-
process.exit(0);
|
|
24
|
-
};
|
|
25
|
-
// Set up signal handlers
|
|
26
|
-
const handleSignal = () => {
|
|
27
|
-
abortController.abort();
|
|
28
|
-
cleanup();
|
|
29
|
-
};
|
|
30
|
-
process.on('SIGINT', handleSignal);
|
|
31
|
-
process.on('SIGTERM', handleSignal);
|
|
32
|
-
spinner.start();
|
|
33
|
-
//TODO: Support for other modalities, like images
|
|
34
|
-
const model_options = {
|
|
35
|
-
_option_id: "text-fallback",
|
|
36
|
-
temperature: typeof options.temperature === 'string' ? parseFloat(options.temperature) : undefined,
|
|
37
|
-
max_tokens: typeof options.maxTokens === 'string' ? parseInt(options.maxTokens) : undefined,
|
|
38
|
-
top_p: typeof options.topP === 'string' ? parseFloat(options.topP) : undefined,
|
|
39
|
-
top_k: typeof options.topK === 'string' ? parseInt(options.topK) : undefined,
|
|
40
|
-
presence_penalty: typeof options.presencePenalty === 'string' ? parseFloat(options.presencePenalty) : undefined,
|
|
41
|
-
frequency_penalty: typeof options.frequencyPenalty === 'string' ? parseFloat(options.frequencyPenalty) : undefined,
|
|
42
|
-
stop_sequence: options.stopSequence ? options.stopSequence.trim().split(/\s*,\s*/) : undefined,
|
|
43
|
-
};
|
|
44
|
-
getClient(program).interactions.generateTestData(interactionId, {
|
|
45
|
-
count,
|
|
46
|
-
message,
|
|
47
|
-
config: {
|
|
48
|
-
environment: options.env,
|
|
49
|
-
model: options.model || undefined,
|
|
50
|
-
model_options: model_options,
|
|
51
|
-
configMode: convertConfigMode(options.configMode),
|
|
52
|
-
}
|
|
53
|
-
// Pass abort signal if the API supports it
|
|
54
|
-
// signal
|
|
55
|
-
}).then((result) => {
|
|
56
|
-
// Remove signal handlers
|
|
57
|
-
process.off('SIGINT', handleSignal);
|
|
58
|
-
process.off('SIGTERM', handleSignal);
|
|
59
|
-
spinner.done();
|
|
60
|
-
if (output) {
|
|
61
|
-
const file = resolve(output);
|
|
62
|
-
writeJsonFile(file, result);
|
|
63
|
-
console.log('Data saved in: ', output);
|
|
64
|
-
}
|
|
65
|
-
console.log();
|
|
66
|
-
console.log(result);
|
|
67
|
-
}).catch(err => {
|
|
68
|
-
// Remove signal handlers
|
|
69
|
-
process.off('SIGINT', handleSignal);
|
|
70
|
-
process.off('SIGTERM', handleSignal);
|
|
71
|
-
// Don't show error if aborted
|
|
72
|
-
if (signal.aborted) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
spinner.done(false);
|
|
76
|
-
console.log('Failed to generate data:', err.message);
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
restoreCursorOnExit();
|
|
80
|
-
//# sourceMappingURL=index.js.map
|
package/lib/datagen/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/datagen/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,SAAS,iBAAiB,CAAC,eAAoB;IAC3C,MAAM,SAAS,GAAW,OAAO,eAAe,KAAK,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACnG,OAAO,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,SAAwB,CAAC,CAAC,CAAC,CAAC,SAAwB,CAAC,CAAC,CAAC,SAAS,CAAC;AAChH,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,OAAgB,EAAE,aAAqB,EAAE,OAA4B;IAC7F,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1D,MAAM,OAAO,GAAG,OAAO,CAAC,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,CAAC;YAC7B,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;QAC3C,CAAC;QACD,OAAO,CAAC,GAAG,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;QACX,yBAAyB;QACzB,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QACpC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QAErC,8BAA8B;QAC9B,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO;QACX,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpB,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACP,CAAC;AAED,mBAAmB,EAAE,CAAC"}
|
package/lib/envs/index.d.ts
DELETED
package/lib/envs/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/envs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAYzG"}
|
package/lib/envs/index.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { getClient } from "../client.js";
|
|
2
|
-
import colors from "ansi-colors";
|
|
3
|
-
export function listEnvironments(program, envId, options) {
|
|
4
|
-
if (envId) {
|
|
5
|
-
getClient(program).environments.retrieve(envId).then((env) => {
|
|
6
|
-
printEnv(env, options);
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
else {
|
|
10
|
-
getClient(program).environments.list().then((environments) => {
|
|
11
|
-
environments.map(env => {
|
|
12
|
-
console.log(env.name + ` [${env.id}]`);
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
function printEnv(env, _options) {
|
|
18
|
-
console.log(colors.bold(env.name) + " [" + env.id + "]");
|
|
19
|
-
console.log(colors.bold("Provider:"), env.provider);
|
|
20
|
-
console.log(colors.bold("Description:"), env.description || 'n/a');
|
|
21
|
-
console.log(colors.bold("Default Model:"), env.default_model);
|
|
22
|
-
console.log(colors.bold("Enabled Models:"), env.enabled_models && env.enabled_models.length > 0 ? env.enabled_models.map(model => model.name).join(", ") : "n/a");
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
package/lib/envs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/envs/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,MAAM,MAAM,aAAa,CAAC;AAGjC,MAAM,UAAU,gBAAgB,CAAC,OAAgB,EAAE,KAAyB,EAAE,OAA4B;IACtG,IAAI,KAAK,EAAE,CAAC;QACR,SAAS,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;YACzD,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACP,CAAC;SAAM,CAAC;QACJ,SAAS,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE;YACzD,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;gBACnB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;YAC3C,CAAC,CAAC,CAAA;QACN,CAAC,CAAC,CAAA;IACN,CAAC;AACL,CAAC;AAGD,SAAS,QAAQ,CAAC,GAAyB,EAAE,QAA6B;IACtE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,CAAA;IACxD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;IACpD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,GAAG,CAAC,WAAW,IAAI,KAAK,CAAC,CAAC;IACnE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;IAC9D,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,GAAG,CAAC,cAAc,IAAI,GAAG,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AACtK,CAAC"}
|
package/lib/index.d.ts
DELETED
package/lib/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/lib/index.js
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import { setupMemoCommand } from '@vertesia/memory-cli';
|
|
2
|
-
import { Command } from 'commander';
|
|
3
|
-
import { registerAgentCommand } from './agent/index.js';
|
|
4
|
-
import runExport from './codegen/index.js';
|
|
5
|
-
import { genTestData } from './datagen/index.js';
|
|
6
|
-
import { listEnvironments } from './envs/index.js';
|
|
7
|
-
import { listInteractions } from './interactions/index.js';
|
|
8
|
-
import { getPublishMemoryAction } from './memory/index.js';
|
|
9
|
-
import { registerObjectsCommand } from './objects/index.js';
|
|
10
|
-
import { getVersion, upgrade } from './package.js';
|
|
11
|
-
import { createProfile, deleteProfile, listProfiles, showActiveAuthToken, showProfile, tryRefreshToken, updateCurrentProfile, updateProfile, useProfile } from './profiles/commands.js';
|
|
12
|
-
import { getConfigFile } from './profiles/index.js';
|
|
13
|
-
import { listProjects } from './projects/index.js';
|
|
14
|
-
import runInteraction from './run/index.js';
|
|
15
|
-
import { runHistory } from './runs/index.js';
|
|
16
|
-
import { registerWorkflowsCommand } from './workflows/index.js';
|
|
17
|
-
//warnIfNotLatest();
|
|
18
|
-
const program = new Command();
|
|
19
|
-
program.version(getVersion());
|
|
20
|
-
program.command("upgrade")
|
|
21
|
-
.description("Upgrade to the latest version of the CLI")
|
|
22
|
-
.option("-y, --yes", "Skip the confirmation prompt")
|
|
23
|
-
.action((options = {}) => upgrade(options.yes));
|
|
24
|
-
program.command("projects")
|
|
25
|
-
.description("List the projects you have access to")
|
|
26
|
-
.action(() => {
|
|
27
|
-
listProjects(program);
|
|
28
|
-
});
|
|
29
|
-
const authRoot = program.command("auth")
|
|
30
|
-
.description("Manage authentication");
|
|
31
|
-
authRoot.command("token")
|
|
32
|
-
.description("Show the auth token used by the current selected profile.")
|
|
33
|
-
.action(() => {
|
|
34
|
-
showActiveAuthToken();
|
|
35
|
-
});
|
|
36
|
-
authRoot.command("refresh")
|
|
37
|
-
.description("Refresh the auth token used by the current profile. An alias to 'vertesia profiles refresh'.")
|
|
38
|
-
.action(() => {
|
|
39
|
-
updateCurrentProfile();
|
|
40
|
-
});
|
|
41
|
-
program.command("envs [envId]")
|
|
42
|
-
.description("List the environments you have access to")
|
|
43
|
-
.action((envId, options) => {
|
|
44
|
-
listEnvironments(program, envId, options);
|
|
45
|
-
});
|
|
46
|
-
program.command("interactions [interaction]")
|
|
47
|
-
.description("List the interactions available in the current project")
|
|
48
|
-
.action((interactionId, options) => {
|
|
49
|
-
listInteractions(program, interactionId, options);
|
|
50
|
-
});
|
|
51
|
-
program.command("datagen <interaction>")
|
|
52
|
-
.description("Generate test input data, given an interaction ID")
|
|
53
|
-
.option('-e, --env [envId]', 'The environment ID to use to generating the test data')
|
|
54
|
-
.option('-m, --model [model]', 'The model to use to generating the test data. If the selected environment has a default model then this option is optional.')
|
|
55
|
-
.option('-t, --temperature [value]', 'The temperature used to generating the test data.')
|
|
56
|
-
.option('--max-tokens [max-tokens]', 'The maximum number of tokens to generate')
|
|
57
|
-
.option('--top-p [top-p]', 'The top P value to use')
|
|
58
|
-
.option('--top-k [top-k]', 'The top K value to use')
|
|
59
|
-
.option('--presence-penalty [presence-penalty]', 'The presence penalty value to use')
|
|
60
|
-
.option('--frequency-penalty [frequency-penalty]', 'The frequency penalty value to use')
|
|
61
|
-
.option('--stop-sequence [stop-sequence]', 'A comma separated list of sequences to stop the generation')
|
|
62
|
-
.option('--config-mode [config-mode]', 'The configuration mode to use.Possible values are: "run_and_interaction_config", "run_config_only", "interaction_config_only". Optional. If not specified, "run_and_interaction_config" is used.')
|
|
63
|
-
.option('-o, --output [file]', 'A file to save the generated test data. If not specified the data will be printed to stdout.')
|
|
64
|
-
.option('-c, --count [value]', 'The number of data objects to generate', '1')
|
|
65
|
-
.option('--message [value]', 'An optional message')
|
|
66
|
-
.action((interactionId, options) => {
|
|
67
|
-
genTestData(program, interactionId, options);
|
|
68
|
-
});
|
|
69
|
-
program.command("codegen [interactionName]")
|
|
70
|
-
.description("Generate code given an interaction name of for all the interactions in the project if no interaction is specified.")
|
|
71
|
-
.option('--versions [versions]', 'A comma separated list of version selectors to include. A version selector is either a version number or "draft". The default is "draft"', "draft")
|
|
72
|
-
.option('-a, -all', 'When used, all the interaction versions will be exported')
|
|
73
|
-
.option('-d, --dir [file]', 'The output directory if any. Default to "./interactions" if not specified.', './interactions')
|
|
74
|
-
.option('-x, --export <version>', 'The version to export from index.ts. If not specified, the latest version will be exported or if no version is available, the draft version will be exported')
|
|
75
|
-
.action((interactionName, options) => runExport(program, interactionName, options));
|
|
76
|
-
program.command("run <interaction>")
|
|
77
|
-
.description("Run an interaction by full name. The full name is composed by an optional namespace, a required endpoint name and an optional tag or version. Examples: name, namespace:name, namespace:name@version")
|
|
78
|
-
.option('-i, --input [file]', 'The input data if any. If no file path is specified it will read from stdin')
|
|
79
|
-
.option('-o, --output [file]', 'The output file if any. If not specified it will print to stdout')
|
|
80
|
-
.option('-d, --data [json]', 'Inline data as a JSON string. If specified takes precedence over --input')
|
|
81
|
-
.option('-T, --tags [tags]', 'A comma separated list of tags to add to the execution run')
|
|
82
|
-
.option('-t, --temperature [temperature]', 'The temperature to use')
|
|
83
|
-
.option('--max-tokens [max-tokens]', 'The maximum number of tokens to generate')
|
|
84
|
-
.option('--top-p [top-p]', 'The top P value to use')
|
|
85
|
-
.option('--top-k [top-k]', 'The top K value to use')
|
|
86
|
-
.option('--presence-penalty [presence-penalty]', 'The presence penalty value to use')
|
|
87
|
-
.option('--frequency-penalty [frequency-penalty]', 'The frequency penalty value to use')
|
|
88
|
-
.option('--stop-sequence [stop-sequence]', 'A comma separated list of sequences to stop the generation')
|
|
89
|
-
.option('--config-mode [config-mode]', 'The configuration mode to use.Possible values are: "run_and_interaction_config", "run_config_only", "interaction_config_only". Optional. If not specified, "run_and_interaction_config" is used.')
|
|
90
|
-
.option('-m, --model [model]', 'The model to use. Optional.')
|
|
91
|
-
.option('-e, --env [environmentId]', 'The environment Id to use. Optional.')
|
|
92
|
-
.option('-S, --no-stream', 'When used, the output will be printed only when the execution is complete')
|
|
93
|
-
.option('-c, --count [count]', 'The number of times to run the interaction', '1')
|
|
94
|
-
.option('-v, --verbose', 'Only used in no streaming mode. Instead of printing a progress it will print details about each executed run.')
|
|
95
|
-
.option('--jsonl', 'Write output in jsonl. The default is to write the json. Ignored when only one run is executed')
|
|
96
|
-
.option('--data-only', 'Write down only the data returned by the LLM and not the entire execution run. This mode is forced when streaming', false)
|
|
97
|
-
.option('-r, --run-data [level]', 'Override the level of storage for the run data. Possible values are: "standard", "restricted", or "debug". Optional. If not specified, it uses the level defined in Studio.')
|
|
98
|
-
.option('--by-id', 'When used, the interaction is selected by ID instead of by name')
|
|
99
|
-
.action((interaction, options) => runInteraction(program, interaction, options));
|
|
100
|
-
program.command("runs [interactionId]")
|
|
101
|
-
.description('Search the run history for specific execution runs')
|
|
102
|
-
.option('-t, --tags [tags]', 'A comma separated list of tags to filter the run history')
|
|
103
|
-
.option('--status [status]', 'A status to filter on')
|
|
104
|
-
.option('-e, --env [environmentId]', 'Filter by environment')
|
|
105
|
-
.option('-m, --model [model]', 'Filter by model')
|
|
106
|
-
.option('-q, --query [query]', 'A lucene query')
|
|
107
|
-
.option('-l, --limit [limit]', 'The maximum number of runs to return in a page', "100")
|
|
108
|
-
.option('-P, --page [page]', 'The page number to return (starting from 0)', "0")
|
|
109
|
-
.option('-f, --format [format]', 'The output format: json, jsonl or csv.', 'json')
|
|
110
|
-
.option("-o, --output [file]", "The output file if any. If not specified it will print to stdout")
|
|
111
|
-
.option("--before [date]", "Filter runs before the given date. The date must be in ISO format")
|
|
112
|
-
.option("--after [date]", "Filter runs after the given date. The date must be in ISO format")
|
|
113
|
-
.action((interactionId, options) => {
|
|
114
|
-
runHistory(program, interactionId, options);
|
|
115
|
-
});
|
|
116
|
-
const memoCmd = program.command("memo");
|
|
117
|
-
setupMemoCommand(memoCmd, getPublishMemoryAction(program));
|
|
118
|
-
registerAgentCommand(program);
|
|
119
|
-
const profilesRoot = program.command("profiles")
|
|
120
|
-
.description("Manage configuration profiles")
|
|
121
|
-
.action(() => {
|
|
122
|
-
listProfiles();
|
|
123
|
-
});
|
|
124
|
-
profilesRoot.command('show [name]')
|
|
125
|
-
.description("Show the configured profiles or the profile with the given name")
|
|
126
|
-
.action((name) => {
|
|
127
|
-
showProfile(name);
|
|
128
|
-
});
|
|
129
|
-
profilesRoot.command('use [name]')
|
|
130
|
-
.description("Switch to another configuration profile")
|
|
131
|
-
.action((name) => {
|
|
132
|
-
useProfile(name);
|
|
133
|
-
});
|
|
134
|
-
profilesRoot.command('add [name]')
|
|
135
|
-
.alias('create')
|
|
136
|
-
.option("-t, --target <env>", "The target environment for the profile. Possible values are: local, dev, staging, prod or an URL for custom servers.")
|
|
137
|
-
.option("-k, --apikey <key>", "The API key to use for the profile")
|
|
138
|
-
.option("-p, --project <project>", "The project ID to use for the profile")
|
|
139
|
-
.option("-a, --account <account>", "The account ID to use for the profile")
|
|
140
|
-
.description("Create a new configuration profile")
|
|
141
|
-
.action((name, options) => {
|
|
142
|
-
createProfile(name, options || {});
|
|
143
|
-
});
|
|
144
|
-
profilesRoot.command('edit [name]')
|
|
145
|
-
.alias('update')
|
|
146
|
-
.description("Edit an existing configuration profile")
|
|
147
|
-
.action((name) => {
|
|
148
|
-
updateProfile(name);
|
|
149
|
-
});
|
|
150
|
-
profilesRoot.command('refresh')
|
|
151
|
-
.description("Refresh token for the current configuration profile")
|
|
152
|
-
.action(() => {
|
|
153
|
-
updateCurrentProfile();
|
|
154
|
-
});
|
|
155
|
-
profilesRoot.command('delete <name>')
|
|
156
|
-
.description("delete an existing configuration profile")
|
|
157
|
-
.action((name) => {
|
|
158
|
-
deleteProfile(name);
|
|
159
|
-
});
|
|
160
|
-
profilesRoot.command('file')
|
|
161
|
-
.description("print the configuration file path")
|
|
162
|
-
.action(() => {
|
|
163
|
-
console.log(getConfigFile('profiles.json'));
|
|
164
|
-
});
|
|
165
|
-
registerObjectsCommand(program);
|
|
166
|
-
registerWorkflowsCommand(program);
|
|
167
|
-
program.parseAsync(process.argv).catch(err => {
|
|
168
|
-
console.error(err);
|
|
169
|
-
process.exit(1);
|
|
170
|
-
});
|
|
171
|
-
process.on("unhandledRejection", (err) => {
|
|
172
|
-
if (err.status === 401) { // token expired?
|
|
173
|
-
console.error("ERROR", err);
|
|
174
|
-
tryRefreshToken();
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,eAAe,EAAE,oBAAoB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACxL,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,cAAc,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,oBAAoB;AAEpB,MAAM,OAAO,GAAG,IA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C,IAAI,EAAE,EAAE;IACb,aAAa,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC,CAAC,CAAC;AACP,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC;KACvB,WAAW,CAAC,mCAAmC,CAAC;KAChD,MAAM,CAAC,GAAG,EAAE;IACT,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC;AAChD,CAAC,CAAC,CAAC;AAEP,sBAAsB,CAAC,OAAO,CAAC,CAAC;AAChC,wBAAwB,CAAC,OAAO,CAAC,CAAC;AAElC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;IACzC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,GAAQ,EAAE,EAAE;IAC1C,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC,CAAC,iBAAiB;QACvC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC5B,eAAe,EAAE,CAAC;IACtB,CAAC;AACL,CAAC,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interactions/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,iBAkBjH"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { InteractionStatus } from "@vertesia/common";
|
|
2
|
-
import colors from "ansi-colors";
|
|
3
|
-
import { getClient } from "../client.js";
|
|
4
|
-
import { textToPascalCase } from "../codegen/utils.js";
|
|
5
|
-
export function listInteractions(program, interactionId, options) {
|
|
6
|
-
const client = getClient(program);
|
|
7
|
-
if (!interactionId) {
|
|
8
|
-
return client.interactions.list().then((interactions) => {
|
|
9
|
-
interactions.map(interaction => {
|
|
10
|
-
console.log(textToPascalCase(interaction.name) + ` [${interaction.id}]`);
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
return client.interactions.retrieve(interactionId).then((interaction) => {
|
|
15
|
-
if (interaction.status === InteractionStatus.draft) {
|
|
16
|
-
client.interactions.listVersions(interactionId).then((versions) => {
|
|
17
|
-
printInteraction(interaction, versions, options);
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
printInteraction(interaction, [], options);
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
function printInteraction(interaction, versions, _options) {
|
|
26
|
-
console.log(colors.bold(interaction.name) + " [" + interaction.id + "]");
|
|
27
|
-
console.log(colors.bold("Description:"), interaction.description || 'n/a');
|
|
28
|
-
console.log(colors.bold("Class name:"), textToPascalCase(interaction.name));
|
|
29
|
-
console.log(colors.bold("Status:"), interaction.status);
|
|
30
|
-
console.log(colors.bold("Version:"), interaction.version);
|
|
31
|
-
console.log(colors.bold("Tags:"), interaction.tags && interaction.tags.length > 0 ? interaction.tags.join(", ") : "n/a");
|
|
32
|
-
if (interaction.status === InteractionStatus.draft) {
|
|
33
|
-
versions.sort((a, b) => a.version - b.version);
|
|
34
|
-
console.log(colors.bold("Published Versions:"), versions.length > 0 ? versions.map(v => v.version).join(", ") : "n/a");
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=index.js.map
|