poe-code 3.0.169 → 3.0.171
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/bin/poe-goose.js +23 -0
- package/dist/cli/commands/configure-payload.js +10 -0
- package/dist/cli/commands/configure-payload.js.map +1 -1
- package/dist/cli/commands/experiment.js +1 -1
- package/dist/cli/commands/experiment.js.map +1 -1
- package/dist/cli/commands/pipeline.js +1 -1
- package/dist/cli/commands/pipeline.js.map +1 -1
- package/dist/cli/commands/spawn.js +4 -0
- package/dist/cli/commands/spawn.js.map +1 -1
- package/dist/cli/constants.d.ts +2 -0
- package/dist/cli/constants.js +2 -0
- package/dist/cli/constants.js.map +1 -1
- package/dist/cli/service-registry.d.ts +9 -0
- package/dist/cli/service-registry.js.map +1 -1
- package/dist/index.js +434 -91
- package/dist/index.js.map +4 -4
- package/dist/providers/claude-code.js +197 -27
- package/dist/providers/claude-code.js.map +4 -4
- package/dist/providers/codex.js +203 -33
- package/dist/providers/codex.js.map +4 -4
- package/dist/providers/create-provider.d.ts +1 -0
- package/dist/providers/create-provider.js +6 -5
- package/dist/providers/create-provider.js.map +1 -1
- package/dist/providers/goose.d.ts +16 -0
- package/dist/providers/goose.js +2514 -0
- package/dist/providers/goose.js.map +7 -0
- package/dist/providers/kimi.js +196 -26
- package/dist/providers/kimi.js.map +4 -4
- package/dist/providers/opencode.js +196 -26
- package/dist/providers/opencode.js.map +4 -4
- package/dist/providers/poe-agent.js +96 -43
- package/dist/providers/poe-agent.js.map +4 -4
- package/dist/utils/command-checks.js +4 -2
- package/dist/utils/command-checks.js.map +1 -1
- package/package.json +2 -2
- /package/dist/templates/pipeline/{steps.yaml.hbs → steps.yaml.mustache} +0 -0
|
@@ -301,17 +301,12 @@ var init_jsonrpc_message_layer = __esm({
|
|
|
301
301
|
requestHandlers = /* @__PURE__ */ new Map();
|
|
302
302
|
notificationHandlers = /* @__PURE__ */ new Map();
|
|
303
303
|
pending = /* @__PURE__ */ new Map();
|
|
304
|
-
defaultTimeoutMs;
|
|
305
304
|
nextRequestId;
|
|
306
305
|
disposed = false;
|
|
307
306
|
constructor(options) {
|
|
308
307
|
this.input = options.input;
|
|
309
308
|
this.output = options.output;
|
|
310
|
-
this.defaultTimeoutMs = options.requestTimeoutMs ?? 3e4;
|
|
311
309
|
this.nextRequestId = options.firstRequestId ?? 1;
|
|
312
|
-
if (!Number.isFinite(this.defaultTimeoutMs) || this.defaultTimeoutMs < 0) {
|
|
313
|
-
throw new Error("requestTimeoutMs must be a non-negative finite number");
|
|
314
|
-
}
|
|
315
310
|
if (!Number.isFinite(this.nextRequestId)) {
|
|
316
311
|
throw new Error("firstRequestId must be a finite number");
|
|
317
312
|
}
|
|
@@ -344,10 +339,6 @@ var init_jsonrpc_message_layer = __esm({
|
|
|
344
339
|
if (this.pending.has(id)) {
|
|
345
340
|
throw new Error(`A request with id ${JSON.stringify(id)} is already pending`);
|
|
346
341
|
}
|
|
347
|
-
const timeoutMs = options.timeoutMs ?? this.defaultTimeoutMs;
|
|
348
|
-
if (!Number.isFinite(timeoutMs) || timeoutMs < 0) {
|
|
349
|
-
throw new Error("timeoutMs must be a non-negative finite number");
|
|
350
|
-
}
|
|
351
342
|
const request = {
|
|
352
343
|
jsonrpc: "2.0",
|
|
353
344
|
id,
|
|
@@ -357,22 +348,14 @@ var init_jsonrpc_message_layer = __esm({
|
|
|
357
348
|
request.params = params;
|
|
358
349
|
}
|
|
359
350
|
return new Promise((resolve, reject) => {
|
|
360
|
-
const timeout = setTimeout(() => {
|
|
361
|
-
this.pending.delete(id);
|
|
362
|
-
reject(
|
|
363
|
-
new Error(`JSON-RPC request "${method}" timed out after ${timeoutMs}ms`)
|
|
364
|
-
);
|
|
365
|
-
}, timeoutMs);
|
|
366
351
|
this.pending.set(id, {
|
|
367
352
|
method,
|
|
368
353
|
resolve,
|
|
369
|
-
reject
|
|
370
|
-
timeout
|
|
354
|
+
reject
|
|
371
355
|
});
|
|
372
356
|
try {
|
|
373
357
|
this.sendMessage(request);
|
|
374
358
|
} catch (error) {
|
|
375
|
-
clearTimeout(timeout);
|
|
376
359
|
this.pending.delete(id);
|
|
377
360
|
reject(error);
|
|
378
361
|
}
|
|
@@ -426,9 +409,6 @@ var init_jsonrpc_message_layer = __esm({
|
|
|
426
409
|
return;
|
|
427
410
|
}
|
|
428
411
|
this.pending.delete(message.id);
|
|
429
|
-
if (pending.timeout !== null) {
|
|
430
|
-
clearTimeout(pending.timeout);
|
|
431
|
-
}
|
|
432
412
|
if ("error" in message) {
|
|
433
413
|
pending.reject(toResponseError(message.error));
|
|
434
414
|
return;
|
|
@@ -469,9 +449,6 @@ var init_jsonrpc_message_layer = __esm({
|
|
|
469
449
|
}
|
|
470
450
|
rejectAllPending(error) {
|
|
471
451
|
for (const pending of this.pending.values()) {
|
|
472
|
-
if (pending.timeout !== null) {
|
|
473
|
-
clearTimeout(pending.timeout);
|
|
474
|
-
}
|
|
475
452
|
pending.reject(error);
|
|
476
453
|
}
|
|
477
454
|
this.pending.clear();
|
|
@@ -509,7 +486,6 @@ var init_acp_transport = __esm({
|
|
|
509
486
|
args = [],
|
|
510
487
|
cwd,
|
|
511
488
|
env,
|
|
512
|
-
requestTimeoutMs,
|
|
513
489
|
firstRequestId,
|
|
514
490
|
spawn: spawn3 = spawnChildProcess
|
|
515
491
|
} = options;
|
|
@@ -533,7 +509,6 @@ var init_acp_transport = __esm({
|
|
|
533
509
|
this.layer = new JsonRpcMessageLayer({
|
|
534
510
|
input: this.child.stdout,
|
|
535
511
|
output: this.child.stdin,
|
|
536
|
-
requestTimeoutMs,
|
|
537
512
|
firstRequestId
|
|
538
513
|
});
|
|
539
514
|
this.child.once("error", (error) => {
|
|
@@ -757,7 +732,6 @@ var init_acp_client = __esm({
|
|
|
757
732
|
args: options.args,
|
|
758
733
|
cwd: options.cwd,
|
|
759
734
|
env: options.env,
|
|
760
|
-
requestTimeoutMs: options.requestTimeoutMs,
|
|
761
735
|
firstRequestId: options.firstRequestId,
|
|
762
736
|
spawn: options.spawn
|
|
763
737
|
});
|
|
@@ -1390,30 +1364,30 @@ var init_src = __esm({
|
|
|
1390
1364
|
}
|
|
1391
1365
|
});
|
|
1392
1366
|
|
|
1393
|
-
// src/templates/py-poe-spawn/env.
|
|
1367
|
+
// src/templates/py-poe-spawn/env.mustache
|
|
1394
1368
|
var require_env = __commonJS({
|
|
1395
|
-
"src/templates/py-poe-spawn/env.
|
|
1369
|
+
"src/templates/py-poe-spawn/env.mustache"(exports, module) {
|
|
1396
1370
|
module.exports = "POE_API_KEY={{apiKey}}\nPOE_BASE_URL=https://api.poe.com/v1\nMODEL={{model}}\n";
|
|
1397
1371
|
}
|
|
1398
1372
|
});
|
|
1399
1373
|
|
|
1400
|
-
// src/templates/py-poe-spawn/main.py.
|
|
1374
|
+
// src/templates/py-poe-spawn/main.py.mustache
|
|
1401
1375
|
var require_main_py = __commonJS({
|
|
1402
|
-
"src/templates/py-poe-spawn/main.py.
|
|
1376
|
+
"src/templates/py-poe-spawn/main.py.mustache"(exports, module) {
|
|
1403
1377
|
module.exports = 'import os\nfrom openai import OpenAI\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nclient = OpenAI(\n api_key=os.getenv("POE_API_KEY"),\n base_url=os.getenv("POE_BASE_URL")\n)\n\nresponse = client.chat.completions.create(\n model=os.getenv("MODEL", "{{model}}"),\n messages=[{"role": "user", "content": "Tell me a joke"}]\n)\n\nprint(response.choices[0].message.content)\n';
|
|
1404
1378
|
}
|
|
1405
1379
|
});
|
|
1406
1380
|
|
|
1407
|
-
// src/templates/py-poe-spawn/requirements.txt.
|
|
1381
|
+
// src/templates/py-poe-spawn/requirements.txt.mustache
|
|
1408
1382
|
var require_requirements_txt = __commonJS({
|
|
1409
|
-
"src/templates/py-poe-spawn/requirements.txt.
|
|
1383
|
+
"src/templates/py-poe-spawn/requirements.txt.mustache"(exports, module) {
|
|
1410
1384
|
module.exports = "openai>=1.0.0\npython-dotenv>=1.0.0\n";
|
|
1411
1385
|
}
|
|
1412
1386
|
});
|
|
1413
1387
|
|
|
1414
|
-
// src/templates/codex/config.toml.
|
|
1388
|
+
// src/templates/codex/config.toml.mustache
|
|
1415
1389
|
var require_config_toml = __commonJS({
|
|
1416
|
-
"src/templates/codex/config.toml.
|
|
1390
|
+
"src/templates/codex/config.toml.mustache"(exports, module) {
|
|
1417
1391
|
module.exports = 'model_provider = "poe"\n\n[profiles."{{{profileName}}}"]\nmodel = "{{{model}}}"\nmodel_provider = "poe"\nmodel_reasoning_effort = "{{reasoningEffort}}"\nmodel_verbosity = "medium"\n\n[model_providers.poe]\nname = "poe"\nbase_url = "{{{baseUrl}}}"\nwire_api = "responses"\nexperimental_bearer_token = "{{apiKey}}"\nrequires_openai_auth = false\nsupports_websockets = false\n';
|
|
1418
1392
|
}
|
|
1419
1393
|
});
|
|
@@ -5698,14 +5672,92 @@ var tomlFormat = {
|
|
|
5698
5672
|
prune: prune2
|
|
5699
5673
|
};
|
|
5700
5674
|
|
|
5675
|
+
// packages/config-mutations/src/formats/yaml.ts
|
|
5676
|
+
import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
|
|
5677
|
+
function isConfigObject3(value) {
|
|
5678
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5679
|
+
}
|
|
5680
|
+
function parse4(content) {
|
|
5681
|
+
if (!content || content.trim() === "") {
|
|
5682
|
+
return {};
|
|
5683
|
+
}
|
|
5684
|
+
const parsed = parseYaml(content);
|
|
5685
|
+
if (parsed === null || parsed === void 0) {
|
|
5686
|
+
return {};
|
|
5687
|
+
}
|
|
5688
|
+
if (!isConfigObject3(parsed)) {
|
|
5689
|
+
throw new Error("Expected YAML object.");
|
|
5690
|
+
}
|
|
5691
|
+
return parsed;
|
|
5692
|
+
}
|
|
5693
|
+
function serialize3(obj) {
|
|
5694
|
+
const serialized = stringifyYaml(obj);
|
|
5695
|
+
return serialized.endsWith("\n") ? serialized : `${serialized}
|
|
5696
|
+
`;
|
|
5697
|
+
}
|
|
5698
|
+
function merge3(base, patch) {
|
|
5699
|
+
const result = { ...base };
|
|
5700
|
+
for (const [key, value] of Object.entries(patch)) {
|
|
5701
|
+
if (value === void 0) {
|
|
5702
|
+
continue;
|
|
5703
|
+
}
|
|
5704
|
+
const existing = result[key];
|
|
5705
|
+
if (isConfigObject3(existing) && isConfigObject3(value)) {
|
|
5706
|
+
result[key] = merge3(existing, value);
|
|
5707
|
+
continue;
|
|
5708
|
+
}
|
|
5709
|
+
result[key] = value;
|
|
5710
|
+
}
|
|
5711
|
+
return result;
|
|
5712
|
+
}
|
|
5713
|
+
function prune3(obj, shape) {
|
|
5714
|
+
let changed = false;
|
|
5715
|
+
const result = { ...obj };
|
|
5716
|
+
for (const [key, pattern] of Object.entries(shape)) {
|
|
5717
|
+
if (!(key in result)) {
|
|
5718
|
+
continue;
|
|
5719
|
+
}
|
|
5720
|
+
const current = result[key];
|
|
5721
|
+
if (isConfigObject3(pattern) && Object.keys(pattern).length === 0) {
|
|
5722
|
+
delete result[key];
|
|
5723
|
+
changed = true;
|
|
5724
|
+
continue;
|
|
5725
|
+
}
|
|
5726
|
+
if (isConfigObject3(pattern) && isConfigObject3(current)) {
|
|
5727
|
+
const { changed: childChanged, result: childResult } = prune3(current, pattern);
|
|
5728
|
+
if (childChanged) {
|
|
5729
|
+
changed = true;
|
|
5730
|
+
}
|
|
5731
|
+
if (Object.keys(childResult).length === 0) {
|
|
5732
|
+
delete result[key];
|
|
5733
|
+
} else {
|
|
5734
|
+
result[key] = childResult;
|
|
5735
|
+
}
|
|
5736
|
+
continue;
|
|
5737
|
+
}
|
|
5738
|
+
delete result[key];
|
|
5739
|
+
changed = true;
|
|
5740
|
+
}
|
|
5741
|
+
return { changed, result };
|
|
5742
|
+
}
|
|
5743
|
+
var yamlFormat = {
|
|
5744
|
+
parse: parse4,
|
|
5745
|
+
serialize: serialize3,
|
|
5746
|
+
merge: merge3,
|
|
5747
|
+
prune: prune3
|
|
5748
|
+
};
|
|
5749
|
+
|
|
5701
5750
|
// packages/config-mutations/src/formats/index.ts
|
|
5702
5751
|
var formatRegistry = {
|
|
5703
5752
|
json: jsonFormat,
|
|
5704
|
-
toml: tomlFormat
|
|
5753
|
+
toml: tomlFormat,
|
|
5754
|
+
yaml: yamlFormat
|
|
5705
5755
|
};
|
|
5706
5756
|
var extensionMap = {
|
|
5707
5757
|
".json": "json",
|
|
5708
|
-
".toml": "toml"
|
|
5758
|
+
".toml": "toml",
|
|
5759
|
+
".yaml": "yaml",
|
|
5760
|
+
".yml": "yaml"
|
|
5709
5761
|
};
|
|
5710
5762
|
function getConfigFormat(pathOrFormat) {
|
|
5711
5763
|
if (pathOrFormat in formatRegistry) {
|
|
@@ -5854,7 +5906,7 @@ function pruneKeysByPrefix(table, prefix) {
|
|
|
5854
5906
|
}
|
|
5855
5907
|
return result;
|
|
5856
5908
|
}
|
|
5857
|
-
function
|
|
5909
|
+
function isConfigObject4(value) {
|
|
5858
5910
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5859
5911
|
}
|
|
5860
5912
|
function mergeWithPruneByPrefix(base, patch, pruneByPrefix) {
|
|
@@ -5863,7 +5915,7 @@ function mergeWithPruneByPrefix(base, patch, pruneByPrefix) {
|
|
|
5863
5915
|
for (const [key, value] of Object.entries(patch)) {
|
|
5864
5916
|
const current = result[key];
|
|
5865
5917
|
const prefix = prefixMap[key];
|
|
5866
|
-
if (
|
|
5918
|
+
if (isConfigObject4(current) && isConfigObject4(value)) {
|
|
5867
5919
|
if (prefix) {
|
|
5868
5920
|
const pruned = pruneKeysByPrefix(current, prefix);
|
|
5869
5921
|
result[key] = { ...pruned, ...value };
|
|
@@ -6457,10 +6509,10 @@ async function runInstallStep(step, context) {
|
|
|
6457
6509
|
|
|
6458
6510
|
// src/providers/create-provider.ts
|
|
6459
6511
|
var templateImports = {
|
|
6460
|
-
"py-poe-spawn/env.
|
|
6461
|
-
"py-poe-spawn/main.py.
|
|
6462
|
-
"py-poe-spawn/requirements.txt.
|
|
6463
|
-
"codex/config.toml.
|
|
6512
|
+
"py-poe-spawn/env.mustache": () => Promise.resolve().then(() => __toESM(require_env(), 1)),
|
|
6513
|
+
"py-poe-spawn/main.py.mustache": () => Promise.resolve().then(() => __toESM(require_main_py(), 1)),
|
|
6514
|
+
"py-poe-spawn/requirements.txt.mustache": () => Promise.resolve().then(() => __toESM(require_requirements_txt(), 1)),
|
|
6515
|
+
"codex/config.toml.mustache": () => Promise.resolve().then(() => __toESM(require_config_toml(), 1))
|
|
6464
6516
|
};
|
|
6465
6517
|
async function loadTemplate(templateId) {
|
|
6466
6518
|
const loader = templateImports[templateId];
|
|
@@ -6483,6 +6535,7 @@ function createProvider(opts) {
|
|
|
6483
6535
|
supportsMcpSpawn: opts.supportsMcpSpawn,
|
|
6484
6536
|
configurePrompts: opts.configurePrompts,
|
|
6485
6537
|
postConfigureMessages: opts.postConfigureMessages,
|
|
6538
|
+
extendConfigurePayload: opts.extendConfigurePayload,
|
|
6486
6539
|
isolatedEnv: opts.isolatedEnv,
|
|
6487
6540
|
async configure(context, runOptions) {
|
|
6488
6541
|
await runMutations(opts.manifest.configure, {
|