@laburen/delta-cli 0.0.0-stage → 0.2.0-canary.11
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/LICENSE +21 -0
- package/README.md +33 -2
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +20 -0
- package/dist/bin.js.map +1 -0
- package/dist/commands/agent-checks.d.ts +5 -0
- package/dist/commands/agent-checks.js +69 -0
- package/dist/commands/agent-checks.js.map +1 -0
- package/dist/commands/agent-run/body.d.ts +22 -0
- package/dist/commands/agent-run/body.js +88 -0
- package/dist/commands/agent-run/body.js.map +1 -0
- package/dist/commands/agent-run/render.d.ts +50 -0
- package/dist/commands/agent-run/render.js +281 -0
- package/dist/commands/agent-run/render.js.map +1 -0
- package/dist/commands/agent-run.d.ts +10 -0
- package/dist/commands/agent-run.js +305 -0
- package/dist/commands/agent-run.js.map +1 -0
- package/dist/commands/agent-tools/add.d.ts +5 -0
- package/dist/commands/agent-tools/add.js +101 -0
- package/dist/commands/agent-tools/add.js.map +1 -0
- package/dist/commands/agent-tools/remove.d.ts +5 -0
- package/dist/commands/agent-tools/remove.js +126 -0
- package/dist/commands/agent-tools/remove.js.map +1 -0
- package/dist/commands/agent-tools/shared.d.ts +283 -0
- package/dist/commands/agent-tools/shared.js +107 -0
- package/dist/commands/agent-tools/shared.js.map +1 -0
- package/dist/commands/agent-tools.d.ts +5 -0
- package/dist/commands/agent-tools.js +11 -0
- package/dist/commands/agent-tools.js.map +1 -0
- package/dist/commands/auth.d.ts +14 -0
- package/dist/commands/auth.js +171 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/completion.d.ts +4 -0
- package/dist/commands/completion.js +50 -0
- package/dist/commands/completion.js.map +1 -0
- package/dist/commands/config-sources.d.ts +22 -0
- package/dist/commands/config-sources.js +46 -0
- package/dist/commands/config-sources.js.map +1 -0
- package/dist/commands/config-wizard.d.ts +9 -0
- package/dist/commands/config-wizard.js +332 -0
- package/dist/commands/config-wizard.js.map +1 -0
- package/dist/commands/orgs.d.ts +11 -0
- package/dist/commands/orgs.js +193 -0
- package/dist/commands/orgs.js.map +1 -0
- package/dist/commands/skill-dir.d.ts +18 -0
- package/dist/commands/skill-dir.js +101 -0
- package/dist/commands/skill-dir.js.map +1 -0
- package/dist/commands/token-notice.d.ts +4 -0
- package/dist/commands/token-notice.js +13 -0
- package/dist/commands/token-notice.js.map +1 -0
- package/dist/commands/whoami.d.ts +8 -0
- package/dist/commands/whoami.js +38 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/commands/wizards.d.ts +4 -0
- package/dist/commands/wizards.js +210 -0
- package/dist/commands/wizards.js.map +1 -0
- package/dist/completion/bash.d.ts +3 -0
- package/dist/completion/bash.js +60 -0
- package/dist/completion/bash.js.map +1 -0
- package/dist/completion/files.d.ts +35 -0
- package/dist/completion/files.js +178 -0
- package/dist/completion/files.js.map +1 -0
- package/dist/completion/powershell.d.ts +9 -0
- package/dist/completion/powershell.js +83 -0
- package/dist/completion/powershell.js.map +1 -0
- package/dist/completion/tree.d.ts +25 -0
- package/dist/completion/tree.js +53 -0
- package/dist/completion/tree.js.map +1 -0
- package/dist/completion/zsh.d.ts +3 -0
- package/dist/completion/zsh.js +76 -0
- package/dist/completion/zsh.js.map +1 -0
- package/dist/config/auth.d.ts +26 -0
- package/dist/config/auth.js +223 -0
- package/dist/config/auth.js.map +1 -0
- package/dist/config/link.d.ts +16 -0
- package/dist/config/link.js +93 -0
- package/dist/config/link.js.map +1 -0
- package/dist/config/paths.d.ts +3 -0
- package/dist/config/paths.js +20 -0
- package/dist/config/paths.js.map +1 -0
- package/dist/config/settings.d.ts +8 -0
- package/dist/config/settings.js +24 -0
- package/dist/config/settings.js.map +1 -0
- package/dist/confirm.d.ts +35 -0
- package/dist/confirm.js +51 -0
- package/dist/confirm.js.map +1 -0
- package/dist/context.d.ts +29 -0
- package/dist/context.js +16 -0
- package/dist/context.js.map +1 -0
- package/dist/errors.d.ts +56 -0
- package/dist/errors.js +452 -0
- package/dist/errors.js.map +1 -0
- package/dist/generated/commands.d.ts +49 -0
- package/dist/generated/commands.js +52 -0
- package/dist/generated/commands.js.map +1 -0
- package/dist/generated/schemas.d.ts +5 -0
- package/dist/generated/schemas.js +20 -0
- package/dist/generated/schemas.js.map +1 -0
- package/dist/invocation.d.ts +66 -0
- package/dist/invocation.js +343 -0
- package/dist/invocation.js.map +1 -0
- package/dist/mode.d.ts +17 -0
- package/dist/mode.js +22 -0
- package/dist/mode.js.map +1 -0
- package/dist/operations/call.d.ts +6 -0
- package/dist/operations/call.js +17 -0
- package/dist/operations/call.js.map +1 -0
- package/dist/operations/extensions.d.ts +46 -0
- package/dist/operations/extensions.js +29 -0
- package/dist/operations/extensions.js.map +1 -0
- package/dist/operations/json-input.d.ts +7 -0
- package/dist/operations/json-input.js +50 -0
- package/dist/operations/json-input.js.map +1 -0
- package/dist/operations/params.d.ts +17 -0
- package/dist/operations/params.js +106 -0
- package/dist/operations/params.js.map +1 -0
- package/dist/operations/register.d.ts +10 -0
- package/dist/operations/register.js +102 -0
- package/dist/operations/register.js.map +1 -0
- package/dist/operations/run-operation.d.ts +8 -0
- package/dist/operations/run-operation.js +148 -0
- package/dist/operations/run-operation.js.map +1 -0
- package/dist/operations/schema-flag.d.ts +8 -0
- package/dist/operations/schema-flag.js +12 -0
- package/dist/operations/schema-flag.js.map +1 -0
- package/dist/operations/skeleton.d.ts +16 -0
- package/dist/operations/skeleton.js +116 -0
- package/dist/operations/skeleton.js.map +1 -0
- package/dist/operations/tables.d.ts +7 -0
- package/dist/operations/tables.js +132 -0
- package/dist/operations/tables.js.map +1 -0
- package/dist/operations.d.ts +5 -0
- package/dist/operations.js +7 -0
- package/dist/operations.js.map +1 -0
- package/dist/output.d.ts +33 -0
- package/dist/output.js +452 -0
- package/dist/output.js.map +1 -0
- package/dist/pickers.d.ts +51 -0
- package/dist/pickers.js +283 -0
- package/dist/pickers.js.map +1 -0
- package/dist/program.d.ts +31 -0
- package/dist/program.js +260 -0
- package/dist/program.js.map +1 -0
- package/dist/prompter.d.ts +54 -0
- package/dist/prompter.js +129 -0
- package/dist/prompter.js.map +1 -0
- package/dist/session.d.ts +45 -0
- package/dist/session.js +178 -0
- package/dist/session.js.map +1 -0
- package/dist/stdout-policy.d.ts +4 -0
- package/dist/stdout-policy.js +11 -0
- package/dist/stdout-policy.js.map +1 -0
- package/dist/update-check.d.ts +4 -0
- package/dist/update-check.js +60 -0
- package/dist/update-check.js.map +1 -0
- package/docs/SKILL.md +187 -0
- package/docs/references/auth-and-organizations.md +72 -0
- package/docs/references/commands.md +247 -0
- package/docs/references/output-and-errors.md +105 -0
- package/package.json +39 -5
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { detectShell, generateScript, installCompletion, isShell, SHELLS, shellNameFromEnv, } from "../completion/files.js";
|
|
2
|
+
import { CliError } from "../errors.js";
|
|
3
|
+
import { notice } from "../output.js";
|
|
4
|
+
import { readVersion, runStandalone } from "../program.js";
|
|
5
|
+
const SUPPORTED = SHELLS.join(", ");
|
|
6
|
+
/** Registra `completion`: imprime el script de Tab para zsh o bash, o con `--install` lo guarda y lo engancha al rc. */
|
|
7
|
+
export function registerCompletionCommand(program, ctx) {
|
|
8
|
+
program
|
|
9
|
+
.command("completion [shell]")
|
|
10
|
+
.description("Print the shell completion script (zsh, bash, powershell) or install it with --install")
|
|
11
|
+
.option("--install", "save the script and add one line to your shell startup file")
|
|
12
|
+
.option("--shell <shell>", "shell to install for (zsh, bash, powershell); default: detected from $SHELL")
|
|
13
|
+
.action(async (shellArg, opts, self) => {
|
|
14
|
+
const flags = self.optsWithGlobals();
|
|
15
|
+
await runStandalone(ctx, flags, async (mode) => {
|
|
16
|
+
const version = readVersion();
|
|
17
|
+
if (!opts.install) {
|
|
18
|
+
const shell = shellArg ?? opts.shell ?? detectShell(ctx) ?? shellNameFromEnv(ctx);
|
|
19
|
+
if (!shell || !isShell(shell)) {
|
|
20
|
+
throw new CliError("invalid_shell", shell
|
|
21
|
+
? `Unsupported shell "${shell}". Supported: ${SUPPORTED}.`
|
|
22
|
+
: `Could not detect your shell from $SHELL. Pass one: ${SUPPORTED}.`, 2, [{ command: "laburen completion zsh", when: "to print the script for zsh" }]);
|
|
23
|
+
}
|
|
24
|
+
ctx.stdout.write(generateScript(program, shell, version));
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const shell = opts.shell ?? shellArg ?? detectShell(ctx) ?? shellNameFromEnv(ctx);
|
|
28
|
+
if (!shell || !isShell(shell)) {
|
|
29
|
+
throw new CliError("invalid_shell", `${shell ? `Unsupported shell "${shell}"` : "Could not detect your shell from $SHELL"}. Supported: ${SUPPORTED}.`, 2, [
|
|
30
|
+
{
|
|
31
|
+
command: "laburen completion --install --shell zsh",
|
|
32
|
+
when: "to choose the shell yourself",
|
|
33
|
+
},
|
|
34
|
+
]);
|
|
35
|
+
}
|
|
36
|
+
const result = await installCompletion(ctx, program, shell, version, flags.globalConfig);
|
|
37
|
+
notice(ctx, mode, `Saved the ${shell} completion script to ${result.scriptFile}.`);
|
|
38
|
+
for (const rc of result.rcFiles) {
|
|
39
|
+
notice(ctx, mode, rc.updated
|
|
40
|
+
? `Added one line to ${rc.file} to load it.`
|
|
41
|
+
: `${rc.file} already loads it; nothing to add.`);
|
|
42
|
+
}
|
|
43
|
+
if (result.profileGuessed) {
|
|
44
|
+
notice(ctx, mode, "Could not ask PowerShell for its profile path, so the default one was used. To check where yours is, run `$PROFILE` in PowerShell; if it differs, add the line there.");
|
|
45
|
+
}
|
|
46
|
+
notice(ctx, mode, "Open a new terminal to use Tab completion.");
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=completion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.js","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AACA,OAAO,EACN,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,OAAO,EACP,M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4C,CAAC,CAAC;QACjE,CAAC,CAAC,CAAC;IACJ,CAAC,CACD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Resources } from "@laburen/delta-sdk/platform";
|
|
2
|
+
import type { PromptOption } from "../prompter.js";
|
|
3
|
+
/** Un modelo de `GET /models` con lo que el asistente necesita: su etiqueta y los niveles de razonamiento (null si no razona). */
|
|
4
|
+
export interface ModelItem {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
reasoning: {
|
|
8
|
+
levels: string[];
|
|
9
|
+
default: string | null;
|
|
10
|
+
} | null;
|
|
11
|
+
}
|
|
12
|
+
/** De dónde salen los valores reales del config: los ids de la organización y los modelos que se pueden usar (E11). */
|
|
13
|
+
export interface ConfigSources {
|
|
14
|
+
models(): Promise<ModelItem[]>;
|
|
15
|
+
skills(): Promise<PromptOption[]>;
|
|
16
|
+
mcpConnections(): Promise<PromptOption[]>;
|
|
17
|
+
knowledgeProjects(): Promise<PromptOption[]>;
|
|
18
|
+
}
|
|
19
|
+
/** Trae todas las páginas del `list` de `listId` y las devuelve como opciones de una pregunta. */
|
|
20
|
+
export declare function listAllOptions(platform: Resources, listId: string): Promise<PromptOption[]>;
|
|
21
|
+
/** Las fuentes del asistente sobre la puerta: cada una trae todas sus páginas. */
|
|
22
|
+
export declare function platformConfigSources(platform: Resources): ConfigSources;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { OPERATION_COMMANDS } from "../generated/commands.js";
|
|
2
|
+
import { callOperation } from "../operations.js";
|
|
3
|
+
import { escapeControl } from "../output.js";
|
|
4
|
+
import { choicesOf, PICK_PAGE } from "../pickers.js";
|
|
5
|
+
/** Trae todas las páginas de la operación `listId`: para elegir varios hay que ver todos. */
|
|
6
|
+
async function fetchAll(platform, listId) {
|
|
7
|
+
const listOp = OPERATION_COMMANDS.find((op) => op.id === listId);
|
|
8
|
+
if (!listOp)
|
|
9
|
+
throw new Error(`Operation not generated: ${listId}`);
|
|
10
|
+
const all = (await callOperation(platform, listOp, [], { limit: PICK_PAGE }, true));
|
|
11
|
+
return { listOp, items: all.data };
|
|
12
|
+
}
|
|
13
|
+
/** Trae todas las páginas del `list` de `listId` y las devuelve como opciones de una pregunta. */
|
|
14
|
+
export async function listAllOptions(platform, listId) {
|
|
15
|
+
const { listOp, items } = await fetchAll(platform, listId);
|
|
16
|
+
return choicesOf(items, listOp).map(({ value, label, hint }) => ({ value, label, hint }));
|
|
17
|
+
}
|
|
18
|
+
/** Los niveles y el default de un modelo, o null si no razona; ignora lo que no tiene la forma del contrato. */
|
|
19
|
+
function reasoningOf(raw) {
|
|
20
|
+
if (!raw || typeof raw !== "object")
|
|
21
|
+
return null;
|
|
22
|
+
const { levels, default: def } = raw;
|
|
23
|
+
if (!Array.isArray(levels))
|
|
24
|
+
return null;
|
|
25
|
+
return {
|
|
26
|
+
levels: levels.filter((l) => typeof l === "string"),
|
|
27
|
+
default: typeof def === "string" ? def : null,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/** Las fuentes del asistente sobre la puerta: cada una trae todas sus páginas. */
|
|
31
|
+
export function platformConfigSources(platform) {
|
|
32
|
+
return {
|
|
33
|
+
models: async () => {
|
|
34
|
+
const { items } = await fetchAll(platform, "models.list");
|
|
35
|
+
return items.map((item) => ({
|
|
36
|
+
id: String(item.id),
|
|
37
|
+
label: escapeControl(String(item.display_name ?? item.id)),
|
|
38
|
+
reasoning: reasoningOf(item.reasoning),
|
|
39
|
+
}));
|
|
40
|
+
},
|
|
41
|
+
skills: () => listAllOptions(platform, "skills.list"),
|
|
42
|
+
mcpConnections: () => listAllOptions(platform, "mcp.connections.list"),
|
|
43
|
+
knowledgeProjects: () => listAllOptions(platform, "knowledge.projects.list"),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=config-sources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-sources.js","sourceRoot":"","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js";
|
|
2
|
+
import type { ConfigSources } from "./config-sources.js";
|
|
3
|
+
/**
|
|
4
|
+
* Pregunta el config de un agente recorriendo su JSON Schema (E11): primero los obligatorios, después qué opcionales
|
|
5
|
+
* tocar, entrando en lo anidado con las mismas reglas. Lo que no se toca no se manda: los defaults los pone el dominio.
|
|
6
|
+
*/
|
|
7
|
+
export declare function askConfig(schema: unknown, sources: ConfigSources, prompter: Prompter,
|
|
8
|
+
/** Avisos para la persona (stderr); sin esto el asistente no avisa nada. */
|
|
9
|
+
notify?: (message: string) => void): Promise<Record<string, unknown>>;
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import { CliError } from "../errors.js";
|
|
2
|
+
/** Valor de la opción `(skip)` de un enum opcional: no es un valor posible del contrato. */
|
|
3
|
+
const SKIP = "\u0000skip";
|
|
4
|
+
/** Valor de la opción que termina la lista de ítems de un array de variantes. */
|
|
5
|
+
const DONE = "\u0000done";
|
|
6
|
+
function isObject(node) {
|
|
7
|
+
return Boolean(node) && typeof node === "object" && !Array.isArray(node);
|
|
8
|
+
}
|
|
9
|
+
function propsOf(schema) {
|
|
10
|
+
return (isObject(schema.properties) ? schema.properties : {});
|
|
11
|
+
}
|
|
12
|
+
function variantsOf(schema) {
|
|
13
|
+
const list = schema.anyOf ?? schema.oneOf;
|
|
14
|
+
return Array.isArray(list) ? list.filter(isObject) : undefined;
|
|
15
|
+
}
|
|
16
|
+
function show(value) {
|
|
17
|
+
return typeof value === "string" ? value : JSON.stringify(value);
|
|
18
|
+
}
|
|
19
|
+
/** La descripción del campo y, si tiene, su default: es lo que se ve al elegir qué tocar. */
|
|
20
|
+
function hintOf(schema) {
|
|
21
|
+
const parts = [typeof schema.description === "string" ? schema.description : undefined];
|
|
22
|
+
if (schema.default !== undefined)
|
|
23
|
+
parts.push(`(default: ${show(schema.default)})`);
|
|
24
|
+
const hint = parts.filter(Boolean).join(" ");
|
|
25
|
+
return hint === "" ? undefined : hint;
|
|
26
|
+
}
|
|
27
|
+
/** La propiedad `const` que distingue a todas las variantes (`type` en las tools, `mode` en `tool_calls`). */
|
|
28
|
+
function discriminatorOf(variants) {
|
|
29
|
+
const [first, ...rest] = variants;
|
|
30
|
+
if (!first)
|
|
31
|
+
return undefined;
|
|
32
|
+
return Object.keys(propsOf(first)).find((key) => [first, ...rest].every((v) => {
|
|
33
|
+
const prop = propsOf(v)[key];
|
|
34
|
+
return prop !== undefined && "const" in prop;
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
function requiredText(value) {
|
|
38
|
+
return value.trim() === "" ? "This field is required." : undefined;
|
|
39
|
+
}
|
|
40
|
+
/** Valida un número contra `integer`, `minimum` y `maximum` del schema. */
|
|
41
|
+
function numberValidator(schema) {
|
|
42
|
+
return (value) => {
|
|
43
|
+
const n = Number(value);
|
|
44
|
+
if (value.trim() === "" || Number.isNaN(n))
|
|
45
|
+
return "Enter a number.";
|
|
46
|
+
if (schema.type === "integer" && !Number.isInteger(n))
|
|
47
|
+
return "Enter a whole number.";
|
|
48
|
+
if (typeof schema.minimum === "number" && n < schema.minimum) {
|
|
49
|
+
return `Must be at least ${schema.minimum}.`;
|
|
50
|
+
}
|
|
51
|
+
if (typeof schema.maximum === "number" && n > schema.maximum) {
|
|
52
|
+
return `Must be at most ${schema.maximum}.`;
|
|
53
|
+
}
|
|
54
|
+
return undefined;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/** Lo que escribió la persona en un campo sin tipo en el schema: un JSON si lo es, y si no el texto tal cual. */
|
|
58
|
+
function parseLoose(raw) {
|
|
59
|
+
try {
|
|
60
|
+
return JSON.parse(raw);
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return raw;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/** Valor del discriminador de la tool que escribe el razonamiento: es el nombre de tipo de la API. */
|
|
67
|
+
const THINKING_TOOL_TYPE = "thinking";
|
|
68
|
+
/** Si el path es un ítem de `tools` (`tools[0]`). */
|
|
69
|
+
function isToolItem(path) {
|
|
70
|
+
return /^tools\[\d+\]$/.test(path);
|
|
71
|
+
}
|
|
72
|
+
/** Un `{}` o `[]` que la persona no llenó: no se manda. */
|
|
73
|
+
function isEmptyContainer(value) {
|
|
74
|
+
if (Array.isArray(value))
|
|
75
|
+
return value.length === 0;
|
|
76
|
+
return isObject(value) && Object.keys(value).length === 0;
|
|
77
|
+
}
|
|
78
|
+
/** Si el objeto que se recorre es un ítem de `tools` de tipo `http` (`tools[0]`). */
|
|
79
|
+
function isHttpTool(path, fixed) {
|
|
80
|
+
return isToolItem(path) && fixed.type === "http";
|
|
81
|
+
}
|
|
82
|
+
class Asker {
|
|
83
|
+
sources;
|
|
84
|
+
prompter;
|
|
85
|
+
notify;
|
|
86
|
+
models;
|
|
87
|
+
/** El razonamiento del modelo elegido y el effort que se eligió (si se eligió), para decidir si se ofrece `thinking`. */
|
|
88
|
+
chosenModel;
|
|
89
|
+
constructor(sources, prompter, notify) {
|
|
90
|
+
this.sources = sources;
|
|
91
|
+
this.prompter = prompter;
|
|
92
|
+
this.notify = notify;
|
|
93
|
+
}
|
|
94
|
+
/** Recorre un objeto: primero los obligatorios, después deja elegir qué opcionales tocar, y entra en cada uno. */
|
|
95
|
+
async object(schema, path, fixed = {}) {
|
|
96
|
+
const result = { ...fixed };
|
|
97
|
+
let props = propsOf(schema);
|
|
98
|
+
const required = new Set(Array.isArray(schema.required) ? schema.required : []);
|
|
99
|
+
if (path === "model")
|
|
100
|
+
props = await this.modelProps(props, result);
|
|
101
|
+
if (isHttpTool(path, result))
|
|
102
|
+
props = this.withoutHeaders(props, path);
|
|
103
|
+
// El `id` de una tool lo asigna el servidor: no se pregunta.
|
|
104
|
+
if (isToolItem(path))
|
|
105
|
+
props = Object.fromEntries(Object.entries(props).filter(([n]) => n !== "id"));
|
|
106
|
+
for (const [name, child] of Object.entries(props)) {
|
|
107
|
+
if (!required.has(name))
|
|
108
|
+
continue;
|
|
109
|
+
if ("const" in child)
|
|
110
|
+
result[name] = child.const;
|
|
111
|
+
else
|
|
112
|
+
await this.field(result, name, child, path, true);
|
|
113
|
+
}
|
|
114
|
+
const optional = await this.offerable(
|
|
115
|
+
// `$schema` es una pista para el editor: el asistente no la ofrece.
|
|
116
|
+
Object.entries(props).filter(([name, child]) => name !== "$schema" && !required.has(name) && !("const" in child)), path);
|
|
117
|
+
if (optional.length === 0)
|
|
118
|
+
return this.remember(path, result);
|
|
119
|
+
const chosen = await this.prompter.multiselect({
|
|
120
|
+
message: path
|
|
121
|
+
? `Which optional fields of ${path} do you want to set?`
|
|
122
|
+
: "Which optional fields do you want to set?",
|
|
123
|
+
options: optional.map(([name, child]) => ({
|
|
124
|
+
value: name,
|
|
125
|
+
label: name,
|
|
126
|
+
hint: hintOf(child),
|
|
127
|
+
})),
|
|
128
|
+
});
|
|
129
|
+
for (const [name, child] of optional) {
|
|
130
|
+
if (chosen.includes(name))
|
|
131
|
+
await this.field(result, name, child, path, false);
|
|
132
|
+
}
|
|
133
|
+
return this.remember(path, result);
|
|
134
|
+
}
|
|
135
|
+
/** Anota el effort elegido en `model` para saber después si `thinking` es compatible. */
|
|
136
|
+
remember(path, result) {
|
|
137
|
+
if (path === "model" && this.chosenModel)
|
|
138
|
+
this.chosenModel.effort = result.reasoning_effort;
|
|
139
|
+
return result;
|
|
140
|
+
}
|
|
141
|
+
/** `thinking` es solo para modelos que no razonan: con razonamiento, solo si el effort efectivo es `off`. */
|
|
142
|
+
thinkingAllowed() {
|
|
143
|
+
const model = this.chosenModel;
|
|
144
|
+
if (!model?.reasoning)
|
|
145
|
+
return true;
|
|
146
|
+
return (model.effort ?? model.reasoning.default) === "off";
|
|
147
|
+
}
|
|
148
|
+
/** Los headers de una tool http suelen llevar secretos: no se preguntan (ni se dejan en el historial del terminal) y se avisa cómo ponerlos. */
|
|
149
|
+
withoutHeaders(props, path) {
|
|
150
|
+
const { headers: _headers, ...rest } = props;
|
|
151
|
+
this.notify(`Headers of ${path} are not asked because they are secrets; set them with laburen agents tools add --tool @tool.json.`);
|
|
152
|
+
return rest;
|
|
153
|
+
}
|
|
154
|
+
/** `knowledge.project_ids` sin proyectos en la organización no se ofrece: no hay nada que elegir (C30). */
|
|
155
|
+
async offerable(fields, path) {
|
|
156
|
+
if (path !== "knowledge")
|
|
157
|
+
return fields;
|
|
158
|
+
const projects = await this.sources.knowledgeProjects();
|
|
159
|
+
return projects.length === 0 ? fields.filter(([name]) => name !== "project_ids") : fields;
|
|
160
|
+
}
|
|
161
|
+
/** `model.id` se elige de `GET /models`; el effort sale de los niveles del modelo elegido y, si no razona, no existe. */
|
|
162
|
+
async modelProps(props, result) {
|
|
163
|
+
this.models ??= await this.sources.models();
|
|
164
|
+
if (this.models.length === 0) {
|
|
165
|
+
throw new CliError("no_results", "There are no models available to choose from.", 1);
|
|
166
|
+
}
|
|
167
|
+
const picked = await this.prompter.select({
|
|
168
|
+
message: "Model",
|
|
169
|
+
options: this.models.map((m) => ({ value: m.id, label: m.label, hint: m.id })),
|
|
170
|
+
});
|
|
171
|
+
result.id = picked;
|
|
172
|
+
const reasoning = this.models.find((m) => m.id === picked)?.reasoning ?? null;
|
|
173
|
+
this.chosenModel = { reasoning };
|
|
174
|
+
const { id: _id, reasoning_effort: effort, ...rest } = props;
|
|
175
|
+
if (!reasoning || !effort)
|
|
176
|
+
return rest;
|
|
177
|
+
const hint = reasoning.default
|
|
178
|
+
? `${effort.description ?? ""} (default: ${reasoning.default})`
|
|
179
|
+
: "";
|
|
180
|
+
return {
|
|
181
|
+
...rest,
|
|
182
|
+
reasoning_effort: {
|
|
183
|
+
...effort,
|
|
184
|
+
enum: reasoning.levels,
|
|
185
|
+
...(hint !== "" && { description: hint.trim() }),
|
|
186
|
+
},
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
/** Pregunta un campo según su schema y deja la respuesta en `target[name]`. */
|
|
190
|
+
async field(target, name, schema, parent, isRequired) {
|
|
191
|
+
const path = parent ? `${parent}.${name}` : name;
|
|
192
|
+
const value = await this.value(schema, path, name, isRequired);
|
|
193
|
+
// Un opcional que quedó vacío ({} o []) no se manda; uno obligatorio sí, porque el contrato lo pide.
|
|
194
|
+
if (value === undefined || (!isRequired && isEmptyContainer(value)))
|
|
195
|
+
return;
|
|
196
|
+
target[name] = value;
|
|
197
|
+
}
|
|
198
|
+
async value(schema, path, label, isRequired) {
|
|
199
|
+
if (path === "knowledge.project_ids")
|
|
200
|
+
return this.projects(label);
|
|
201
|
+
const variants = variantsOf(schema);
|
|
202
|
+
if (variants)
|
|
203
|
+
return this.variant(variants, path, label, schema.default);
|
|
204
|
+
if (Array.isArray(schema.enum))
|
|
205
|
+
return this.enumValue(schema, label, isRequired);
|
|
206
|
+
switch (schema.type) {
|
|
207
|
+
case "object":
|
|
208
|
+
return this.object(schema, path);
|
|
209
|
+
case "array":
|
|
210
|
+
return this.array(schema, path);
|
|
211
|
+
case "boolean":
|
|
212
|
+
return this.prompter.confirm({
|
|
213
|
+
message: label,
|
|
214
|
+
initialValue: typeof schema.default === "boolean" ? schema.default : false,
|
|
215
|
+
});
|
|
216
|
+
case "integer":
|
|
217
|
+
case "number":
|
|
218
|
+
return Number(await this.prompter.text({
|
|
219
|
+
message: label,
|
|
220
|
+
initialValue: schema.default === undefined ? undefined : String(schema.default),
|
|
221
|
+
validate: numberValidator(schema),
|
|
222
|
+
}));
|
|
223
|
+
case "string": {
|
|
224
|
+
const text = await this.prompter.text({
|
|
225
|
+
message: label,
|
|
226
|
+
initialValue: typeof schema.default === "string" ? schema.default : undefined,
|
|
227
|
+
validate: isRequired ? requiredText : undefined,
|
|
228
|
+
});
|
|
229
|
+
// Un opcional que se deja en blanco no se manda: un "" podría no ser un valor válido ni el default.
|
|
230
|
+
return !isRequired && text.trim() === "" ? undefined : text;
|
|
231
|
+
}
|
|
232
|
+
default:
|
|
233
|
+
return parseLoose(await this.prompter.text({ message: `${label} (JSON or text)` }));
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
async enumValue(schema, label, isRequired) {
|
|
237
|
+
const values = schema.enum.map(String);
|
|
238
|
+
const options = values.map((v) => ({ value: v, label: v }));
|
|
239
|
+
const def = schema.default === undefined ? undefined : String(schema.default);
|
|
240
|
+
const picked = await this.prompter.select({
|
|
241
|
+
message: label,
|
|
242
|
+
options: isRequired ? options : [{ value: SKIP, label: "(skip)" }, ...options],
|
|
243
|
+
initialValue: def ?? (isRequired ? undefined : SKIP),
|
|
244
|
+
});
|
|
245
|
+
return picked === SKIP ? undefined : picked;
|
|
246
|
+
}
|
|
247
|
+
async projects(label) {
|
|
248
|
+
return this.prompter.multiselect({
|
|
249
|
+
message: label,
|
|
250
|
+
options: await this.sources.knowledgeProjects(),
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
/** Una unión por discriminador: pregunta el tipo y entra en esa variante con el discriminador ya puesto. */
|
|
254
|
+
async variant(variants, path, label, _default) {
|
|
255
|
+
const key = discriminatorOf(variants);
|
|
256
|
+
if (!key)
|
|
257
|
+
return parseLoose(await this.prompter.text({ message: `${label} (JSON)` }));
|
|
258
|
+
const picked = await this.prompter.select({
|
|
259
|
+
message: `Type of ${label}`,
|
|
260
|
+
options: variants.map((v) => ({
|
|
261
|
+
value: String(propsOf(v)[key]?.const),
|
|
262
|
+
label: String(propsOf(v)[key]?.const),
|
|
263
|
+
hint: typeof v.description === "string" ? v.description : undefined,
|
|
264
|
+
})),
|
|
265
|
+
});
|
|
266
|
+
const chosen = variants.find((v) => String(propsOf(v)[key]?.const) === picked);
|
|
267
|
+
return this.object(chosen, path, { [key]: picked });
|
|
268
|
+
}
|
|
269
|
+
/** Un array: de strings va en una línea separada por comas; de objetos se agregan ítems uno por uno. */
|
|
270
|
+
async array(schema, path) {
|
|
271
|
+
const items = isObject(schema.items) ? schema.items : {};
|
|
272
|
+
if (items.type === "string") {
|
|
273
|
+
const raw = await this.prompter.text({ message: `${path} (comma-separated)` });
|
|
274
|
+
return raw
|
|
275
|
+
.split(",")
|
|
276
|
+
.map((s) => s.trim())
|
|
277
|
+
.filter((s) => s !== "");
|
|
278
|
+
}
|
|
279
|
+
const variants = variantsOf(items);
|
|
280
|
+
const list = [];
|
|
281
|
+
const used = new Set();
|
|
282
|
+
for (;;) {
|
|
283
|
+
const at = `${path}[${list.length}]`;
|
|
284
|
+
if (variants) {
|
|
285
|
+
const key = discriminatorOf(variants);
|
|
286
|
+
// Una variante `x-single` ya agregada no se vuelve a ofrecer; `thinking` tampoco si el modelo razona.
|
|
287
|
+
const offered = variants.filter((v) => {
|
|
288
|
+
const type = String(key ? propsOf(v)[key]?.const : "");
|
|
289
|
+
if (v["x-single"] === true && used.has(type))
|
|
290
|
+
return false;
|
|
291
|
+
return !(path === "tools" && type === THINKING_TOOL_TYPE && !this.thinkingAllowed());
|
|
292
|
+
});
|
|
293
|
+
const options = offered.map((v) => ({
|
|
294
|
+
value: String(key ? propsOf(v)[key]?.const : ""),
|
|
295
|
+
label: String(key ? propsOf(v)[key]?.const : ""),
|
|
296
|
+
hint: typeof v.description === "string" ? v.description : undefined,
|
|
297
|
+
}));
|
|
298
|
+
const picked = await this.prompter.select({
|
|
299
|
+
message: `Add an item to ${path}`,
|
|
300
|
+
options: [...options, { value: DONE, label: "(done)" }],
|
|
301
|
+
initialValue: list.length > 0 ? DONE : undefined,
|
|
302
|
+
});
|
|
303
|
+
if (picked === DONE || !key)
|
|
304
|
+
return list;
|
|
305
|
+
const chosen = variants.find((v) => String(propsOf(v)[key]?.const) === picked);
|
|
306
|
+
used.add(picked);
|
|
307
|
+
list.push(await this.object(chosen, at, { [key]: picked }));
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
const more = await this.prompter.confirm({
|
|
311
|
+
message: list.length === 0 ? `Add an item to ${path}?` : `Add another item to ${path}?`,
|
|
312
|
+
initialValue: list.length === 0,
|
|
313
|
+
});
|
|
314
|
+
if (!more)
|
|
315
|
+
return list;
|
|
316
|
+
list.push(items.type === "object"
|
|
317
|
+
? await this.object(items, at)
|
|
318
|
+
: await this.value(items, at, at, true));
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Pregunta el config de un agente recorriendo su JSON Schema (E11): primero los obligatorios, después qué opcionales
|
|
325
|
+
* tocar, entrando en lo anidado con las mismas reglas. Lo que no se toca no se manda: los defaults los pone el dominio.
|
|
326
|
+
*/
|
|
327
|
+
export async function askConfig(schema, sources, prompter,
|
|
328
|
+
/** Avisos para la persona (stderr); sin esto el asistente no avisa nada. */
|
|
329
|
+
notify = () => { }) {
|
|
330
|
+
return new Asker(sources, prompter, notify).object(isObject(schema) ? schema : {}, "");
|
|
331
|
+
}
|
|
332
|
+
//# sourceMappingURL=config-wizard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-wizard.js","sourceRoot":"","sources":["../../src/commands/config-wizard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAMxC,4FAA4F;AAC5F,MAAM,IAAI,GAAG,YAAY,CAAC;AAC1B,iFAAiF;AACjF,MAAM,IAAI,GAAG,YAAY,CAAC;AAE1B,SAAS,QAAQ,CAAC,IAAa;IAC9B,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC1E,CAAC;AAED,SAAS,OAAO,CAAC,MAAc;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAA2B,CAAC;AACzF,CAAC;AAED,SAAS,UAAU,CAAC,MAAc;IACjC,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC;IAC1C,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,IAAI,CAAC,MAAM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tB,QAAkB;AAClB,4EAA4E;AAC5E,SAAoC,GAAG,EAAE,GAAE,CAAC;IAE5C,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AACxF,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { CliContext } from "../context.js";
|
|
3
|
+
import { type Prompter } from "../prompter.js";
|
|
4
|
+
/** Piezas reemplazables en tests: el `fetch` de la puerta (las preguntas entran solo por `main`/`buildProgram`). */
|
|
5
|
+
export interface OrgDeps {
|
|
6
|
+
fetch?: typeof fetch;
|
|
7
|
+
}
|
|
8
|
+
/** Registra `orgs list`, `orgs switch [id]`, `link` y `unlink`. */
|
|
9
|
+
export declare function registerOrgCommands(program: Command, ctx: CliContext, deps: OrgDeps & {
|
|
10
|
+
prompter: Prompter;
|
|
11
|
+
}): void;
|