poe-code 3.0.206 → 3.0.208
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/dist/index.js +73 -36
- package/dist/index.js.map +2 -2
- package/dist/providers/poe-agent.js.map +2 -2
- package/dist/sdk/spawn.js +17 -9
- package/dist/sdk/spawn.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -36894,6 +36894,7 @@ function spawn8(service, promptOrOptions, maybeOptions) {
|
|
|
36894
36894
|
})();
|
|
36895
36895
|
const result = (async () => {
|
|
36896
36896
|
let workspace;
|
|
36897
|
+
let integrations = null;
|
|
36897
36898
|
try {
|
|
36898
36899
|
workspace = await resolveSpawnWorkspace(options.cwd, {
|
|
36899
36900
|
baseDir: process.cwd(),
|
|
@@ -36911,12 +36912,16 @@ function spawn8(service, promptOrOptions, maybeOptions) {
|
|
|
36911
36912
|
if (!process.env.POE_API_KEY || process.env.POE_API_KEY.trim().length === 0) {
|
|
36912
36913
|
process.env.POE_API_KEY = resolvedApiKey;
|
|
36913
36914
|
}
|
|
36914
|
-
|
|
36915
|
-
|
|
36916
|
-
|
|
36917
|
-
|
|
36918
|
-
|
|
36919
|
-
|
|
36915
|
+
const container = createSdkContainer({ cwd });
|
|
36916
|
+
integrations = await loadIntegrations(await resolveMergedDocument(container));
|
|
36917
|
+
const middlewares = [
|
|
36918
|
+
sessionCapture,
|
|
36919
|
+
usageCapture,
|
|
36920
|
+
spawnLog,
|
|
36921
|
+
...integrations?.spawnMiddleware ? [integrations.spawnMiddleware] : [],
|
|
36922
|
+
...options.middlewares ?? []
|
|
36923
|
+
];
|
|
36924
|
+
const resolveModel3 = async () => options.model ?? await resolveConfiguredModel(container, service);
|
|
36920
36925
|
const runtimeOverrides = pickRuntimeOverrides(options);
|
|
36921
36926
|
const hasRuntimeOverrides = Object.keys(runtimeOverrides).length > 0;
|
|
36922
36927
|
if (options.interactive) {
|
|
@@ -36970,10 +36975,7 @@ function spawn8(service, promptOrOptions, maybeOptions) {
|
|
|
36970
36975
|
cwd: options.cwd,
|
|
36971
36976
|
startedAt: /* @__PURE__ */ new Date()
|
|
36972
36977
|
};
|
|
36973
|
-
await applyMiddlewares(
|
|
36974
|
-
[sessionCapture, usageCapture, spawnLog, ...options.middlewares ?? []],
|
|
36975
|
-
middlewareContext
|
|
36976
|
-
);
|
|
36978
|
+
await applyMiddlewares(middlewares, middlewareContext);
|
|
36977
36979
|
resolveEventsOnce(middlewareContext.eventStream ?? emptyEvents);
|
|
36978
36980
|
const final = await done;
|
|
36979
36981
|
const threadId = middlewareContext.threadId ?? final.threadId;
|
|
@@ -37023,10 +37025,7 @@ function spawn8(service, promptOrOptions, maybeOptions) {
|
|
|
37023
37025
|
cwd,
|
|
37024
37026
|
startedAt: /* @__PURE__ */ new Date()
|
|
37025
37027
|
};
|
|
37026
|
-
await applyMiddlewares(
|
|
37027
|
-
[sessionCapture, usageCapture, spawnLog, ...options.middlewares ?? []],
|
|
37028
|
-
middlewareContext
|
|
37029
|
-
);
|
|
37028
|
+
await applyMiddlewares(middlewares, middlewareContext);
|
|
37030
37029
|
resolveEventsOnce(middlewareContext.eventStream ?? emptyEvents);
|
|
37031
37030
|
const final = await done;
|
|
37032
37031
|
const threadId = middlewareContext.threadId ?? final.threadId;
|
|
@@ -37063,7 +37062,7 @@ function spawn8(service, promptOrOptions, maybeOptions) {
|
|
|
37063
37062
|
}
|
|
37064
37063
|
resolveEventsOnce(emptyEvents);
|
|
37065
37064
|
const model = await resolveModel3();
|
|
37066
|
-
return spawnCore(
|
|
37065
|
+
return spawnCore(container, service, {
|
|
37067
37066
|
prompt: options.prompt,
|
|
37068
37067
|
cwd,
|
|
37069
37068
|
model,
|
|
@@ -37077,6 +37076,7 @@ function spawn8(service, promptOrOptions, maybeOptions) {
|
|
|
37077
37076
|
resolveEventsOnce(emptyEvents);
|
|
37078
37077
|
throw error2;
|
|
37079
37078
|
} finally {
|
|
37079
|
+
await integrations?.shutdown();
|
|
37080
37080
|
await workspace?.cleanup?.();
|
|
37081
37081
|
}
|
|
37082
37082
|
})();
|
|
@@ -37112,6 +37112,8 @@ var init_spawn4 = __esm({
|
|
|
37112
37112
|
await init_container();
|
|
37113
37113
|
init_autonomous2();
|
|
37114
37114
|
init_src12();
|
|
37115
|
+
init_src18();
|
|
37116
|
+
init_shared();
|
|
37115
37117
|
init_resolve_spawn_workspace();
|
|
37116
37118
|
spawn8.pretty = async function pretty(service, promptOrOptions, maybeOptions) {
|
|
37117
37119
|
const { events, result } = spawn8(service, promptOrOptions, maybeOptions);
|
|
@@ -51836,6 +51838,7 @@ function collectFields(schema2, casing, globalLongOptionFlags, path108 = [], inh
|
|
|
51836
51838
|
hasDefault: childSchema.default !== void 0,
|
|
51837
51839
|
defaultValue: childSchema.default,
|
|
51838
51840
|
requiredWhenActive,
|
|
51841
|
+
global: childSchema.global === true ? true : void 0,
|
|
51839
51842
|
variantId: variantContext?.id,
|
|
51840
51843
|
variantBranchId: variantContext?.branchId
|
|
51841
51844
|
});
|
|
@@ -52387,7 +52390,7 @@ function formatCommandDynamicParameterTokens(field, casing) {
|
|
|
52387
52390
|
function formatCommandParameterTokens(command, casing, globalLongOptionFlags) {
|
|
52388
52391
|
const collected = collectFields(command.params, casing, globalLongOptionFlags);
|
|
52389
52392
|
const fields = assignPositionals(collected.fields, command.positional);
|
|
52390
|
-
return fields.map(
|
|
52393
|
+
return fields.filter((field) => field.global !== true).map(
|
|
52391
52394
|
(field) => wrapOptionalCommandParameterToken(
|
|
52392
52395
|
formatHelpFieldFlags(field, globalLongOptionFlags),
|
|
52393
52396
|
field.positionalIndex === void 0 && (field.optional || field.hasDefault)
|
|
@@ -52424,6 +52427,10 @@ function formatGlobalOptionRows(ctx) {
|
|
|
52424
52427
|
{
|
|
52425
52428
|
flags: "--output <format>",
|
|
52426
52429
|
description: "Output format: rich, md, json."
|
|
52430
|
+
},
|
|
52431
|
+
{
|
|
52432
|
+
flags: "--debug",
|
|
52433
|
+
description: "Print stack traces for unexpected errors."
|
|
52427
52434
|
}
|
|
52428
52435
|
);
|
|
52429
52436
|
if (ctx.showVersion) {
|
|
@@ -52434,6 +52441,33 @@ function formatGlobalOptionRows(ctx) {
|
|
|
52434
52441
|
}
|
|
52435
52442
|
return rows;
|
|
52436
52443
|
}
|
|
52444
|
+
function collectSchemaGlobalFieldRows(group, scope, casing, globalLongOptionFlags) {
|
|
52445
|
+
const seen = /* @__PURE__ */ new Map();
|
|
52446
|
+
const visit = (node) => {
|
|
52447
|
+
if (node.kind === "command") {
|
|
52448
|
+
const collected = collectFields(node.params, casing, globalLongOptionFlags);
|
|
52449
|
+
for (const field of collected.fields) {
|
|
52450
|
+
if (field.global !== true) {
|
|
52451
|
+
continue;
|
|
52452
|
+
}
|
|
52453
|
+
const dedupeKey = `${field.optionFlag}|${field.shortFlag ?? ""}`;
|
|
52454
|
+
if (seen.has(dedupeKey)) {
|
|
52455
|
+
continue;
|
|
52456
|
+
}
|
|
52457
|
+
seen.set(dedupeKey, {
|
|
52458
|
+
flags: formatHelpFieldFlags(field, globalLongOptionFlags),
|
|
52459
|
+
description: formatHelpFieldDescription(field)
|
|
52460
|
+
});
|
|
52461
|
+
}
|
|
52462
|
+
return;
|
|
52463
|
+
}
|
|
52464
|
+
for (const child of getVisibleChildren(node, scope)) {
|
|
52465
|
+
visit(child);
|
|
52466
|
+
}
|
|
52467
|
+
};
|
|
52468
|
+
visit(group);
|
|
52469
|
+
return [...seen.values()];
|
|
52470
|
+
}
|
|
52437
52471
|
function renderHelpSections(sections) {
|
|
52438
52472
|
return sections.filter((section) => section.length > 0).join("\n\n");
|
|
52439
52473
|
}
|
|
@@ -52450,7 +52484,7 @@ function buildUsageLine(breadcrumb, rootUsageName, suffix) {
|
|
|
52450
52484
|
const tokens = [rootUsageName, subPath, suffix].filter((segment) => segment.length > 0);
|
|
52451
52485
|
return tokens.join(" ");
|
|
52452
52486
|
}
|
|
52453
|
-
function renderGroupHelp(group, breadcrumb, scope, casing, globalOptions, rootUsageName) {
|
|
52487
|
+
function renderGroupHelp(group, breadcrumb, scope, casing, globalOptions, rootUsageName, isRoot) {
|
|
52454
52488
|
const sections = [];
|
|
52455
52489
|
const globalLongOptionFlags = getGlobalLongOptionFlags(globalOptions.presetsEnabled);
|
|
52456
52490
|
const commandRows = formatCommandRows(group, scope, casing, globalLongOptionFlags);
|
|
@@ -52458,14 +52492,20 @@ function renderGroupHelp(group, breadcrumb, scope, casing, globalOptions, rootUs
|
|
|
52458
52492
|
sections.push(`${text.sectionHeader("Commands")}
|
|
52459
52493
|
${formatHelpCommandList(commandRows)}`);
|
|
52460
52494
|
}
|
|
52461
|
-
|
|
52462
|
-
|
|
52463
|
-
|
|
52464
|
-
|
|
52495
|
+
if (isRoot) {
|
|
52496
|
+
const globalRows = [
|
|
52497
|
+
...formatGlobalOptionRows(globalOptions),
|
|
52498
|
+
...collectSchemaGlobalFieldRows(group, scope, casing, globalLongOptionFlags)
|
|
52499
|
+
];
|
|
52500
|
+
sections.push(
|
|
52501
|
+
`${text.sectionHeader("Global options")}
|
|
52502
|
+
${formatHelpOptionList(globalRows)}`
|
|
52503
|
+
);
|
|
52504
|
+
}
|
|
52465
52505
|
return renderHelpDocument({
|
|
52466
52506
|
breadcrumb,
|
|
52467
52507
|
rootUsageName,
|
|
52468
|
-
usageLine: buildUsageLine(breadcrumb, rootUsageName, "[command] [
|
|
52508
|
+
usageLine: buildUsageLine(breadcrumb, rootUsageName, "[command] [OPTIONS]"),
|
|
52469
52509
|
description: group.description,
|
|
52470
52510
|
requiresAuth: group.requires?.auth === true,
|
|
52471
52511
|
sections
|
|
@@ -52476,7 +52516,7 @@ function renderLeafHelp(command, breadcrumb, casing, globalOptions, rootUsageNam
|
|
|
52476
52516
|
const globalLongOptionFlags = getGlobalLongOptionFlags(globalOptions.presetsEnabled);
|
|
52477
52517
|
const collected = collectFields(command.params, casing, globalLongOptionFlags);
|
|
52478
52518
|
const fields = assignPositionals(collected.fields, command.positional);
|
|
52479
|
-
const optionRows = fields.map((field) => ({
|
|
52519
|
+
const optionRows = fields.filter((field) => field.global !== true).map((field) => ({
|
|
52480
52520
|
flags: formatHelpFieldFlags(field, globalLongOptionFlags),
|
|
52481
52521
|
description: formatHelpFieldDescription(field)
|
|
52482
52522
|
})).concat(collected.dynamicFields.flatMap((field) => formatDynamicHelpFields(field, casing)));
|
|
@@ -52484,10 +52524,6 @@ function renderLeafHelp(command, breadcrumb, casing, globalOptions, rootUsageNam
|
|
|
52484
52524
|
sections.push(`${text.sectionHeader("Options")}
|
|
52485
52525
|
${formatHelpOptionList(optionRows)}`);
|
|
52486
52526
|
}
|
|
52487
|
-
sections.push(
|
|
52488
|
-
`${text.sectionHeader("Options")}
|
|
52489
|
-
${formatHelpOptionList(formatGlobalOptionRows(globalOptions))}`
|
|
52490
|
-
);
|
|
52491
52527
|
const secretRows = formatSecretRows(command.secrets);
|
|
52492
52528
|
if (secretRows.length > 0) {
|
|
52493
52529
|
sections.push(
|
|
@@ -52496,7 +52532,7 @@ ${formatHelpOptionList(secretRows)}`
|
|
|
52496
52532
|
);
|
|
52497
52533
|
}
|
|
52498
52534
|
const positionalFields = fields.filter((f) => f.positionalIndex !== void 0);
|
|
52499
|
-
const usageSuffix = positionalFields.length > 0 ? `[
|
|
52535
|
+
const usageSuffix = positionalFields.length > 0 ? `[OPTIONS] ${positionalFields.map(formatPositionalToken).join(" ")}` : "[OPTIONS]";
|
|
52500
52536
|
return renderHelpDocument({
|
|
52501
52537
|
breadcrumb,
|
|
52502
52538
|
rootUsageName,
|
|
@@ -52543,7 +52579,8 @@ async function renderGeneratedHelp(root, argv, options) {
|
|
|
52543
52579
|
showVersion: options.version !== void 0,
|
|
52544
52580
|
presetsEnabled: options.presets === true
|
|
52545
52581
|
},
|
|
52546
|
-
rootUsageName
|
|
52582
|
+
rootUsageName,
|
|
52583
|
+
target.node === root
|
|
52547
52584
|
) : renderLeafHelp(
|
|
52548
52585
|
target.node,
|
|
52549
52586
|
target.breadcrumb,
|
|
@@ -52643,7 +52680,7 @@ function addGlobalOptions(command, presetsEnabled) {
|
|
|
52643
52680
|
throw new InvalidArgumentError(
|
|
52644
52681
|
'Invalid value for "--output". Expected one of: rich, md, markdown, json.'
|
|
52645
52682
|
);
|
|
52646
|
-
}).option("--
|
|
52683
|
+
}).option("--debug", "Print stack traces for unexpected errors.");
|
|
52647
52684
|
}
|
|
52648
52685
|
function setNestedValue(target, path108, value) {
|
|
52649
52686
|
let cursor = target;
|
|
@@ -53754,7 +53791,7 @@ async function executeCommand(state, services, requirementOptions, runtimeOption
|
|
|
53754
53791
|
}
|
|
53755
53792
|
});
|
|
53756
53793
|
}
|
|
53757
|
-
function handleRunError(error2,
|
|
53794
|
+
function handleRunError(error2, debug) {
|
|
53758
53795
|
const logger2 = createLogger();
|
|
53759
53796
|
if (error2 instanceof UserError) {
|
|
53760
53797
|
logger2.error(error2.message);
|
|
@@ -53769,8 +53806,8 @@ function handleRunError(error2, verbose) {
|
|
|
53769
53806
|
return;
|
|
53770
53807
|
}
|
|
53771
53808
|
const message2 = error2 instanceof Error ? error2.message : String(error2);
|
|
53772
|
-
logger2.error(
|
|
53773
|
-
if (
|
|
53809
|
+
logger2.error(debug ? message2 : `${message2} Use --debug for a stack trace.`);
|
|
53810
|
+
if (debug && error2 instanceof Error && error2.stack) {
|
|
53774
53811
|
process.stderr.write(`${error2.stack}
|
|
53775
53812
|
`);
|
|
53776
53813
|
}
|
|
@@ -53835,7 +53872,7 @@ async function runCLI(roots, options = {}) {
|
|
|
53835
53872
|
}
|
|
53836
53873
|
handleRunError(
|
|
53837
53874
|
error2,
|
|
53838
|
-
lastActionCommand ? Boolean(getResolvedFlags(lastActionCommand).
|
|
53875
|
+
lastActionCommand ? Boolean(getResolvedFlags(lastActionCommand).debug) : process.argv.includes("--debug")
|
|
53839
53876
|
);
|
|
53840
53877
|
}
|
|
53841
53878
|
}
|
|
@@ -53854,7 +53891,7 @@ var init_cli = __esm({
|
|
|
53854
53891
|
RESERVED_SERVICE_NAMES2 = /* @__PURE__ */ new Set(["params", "secrets", "fetch", "fs", "env", "progress"]);
|
|
53855
53892
|
NULL_OPTION_VALUE = /* @__PURE__ */ Symbol("toolcraft.cli.null");
|
|
53856
53893
|
HELP_FLAGS = /* @__PURE__ */ new Set(["--help", "-h"]);
|
|
53857
|
-
ALWAYS_GLOBAL_LONG_OPTION_FLAGS = ["--yes", "--output", "--
|
|
53894
|
+
ALWAYS_GLOBAL_LONG_OPTION_FLAGS = ["--yes", "--output", "--debug"];
|
|
53858
53895
|
DESIGN_SYSTEM_OUTPUT_BY_MODE = {
|
|
53859
53896
|
rich: "terminal",
|
|
53860
53897
|
md: "markdown",
|
|
@@ -81032,7 +81069,7 @@ var init_package2 = __esm({
|
|
|
81032
81069
|
"package.json"() {
|
|
81033
81070
|
package_default2 = {
|
|
81034
81071
|
name: "poe-code",
|
|
81035
|
-
version: "3.0.
|
|
81072
|
+
version: "3.0.208",
|
|
81036
81073
|
description: "CLI tool to configure Poe API for developer workflows.",
|
|
81037
81074
|
type: "module",
|
|
81038
81075
|
main: "./dist/index.js",
|