poe-code 3.0.98 → 3.0.99-beta.1

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.
@@ -1,4 +1,4 @@
1
- import type { AcpEvent, McpSpawnConfig } from "@poe-code/agent-spawn";
1
+ import type { AcpEvent, McpSpawnConfig, SpawnUsage } from "@poe-code/agent-spawn";
2
2
  import type { EmptyProviderOptions } from "./spawn-options.js";
3
3
  interface PoeAgentSpawnResult {
4
4
  stdout: string;
@@ -6,6 +6,7 @@ interface PoeAgentSpawnResult {
6
6
  exitCode: number;
7
7
  threadId?: string;
8
8
  sessionId?: string;
9
+ usage?: SpawnUsage;
9
10
  }
10
11
  export declare function spawnPoeAgentWithAcp(options: {
11
12
  prompt: string;
@@ -1406,7 +1406,7 @@ var require_config_toml = __commonJS({
1406
1406
  }
1407
1407
  });
1408
1408
 
1409
- // packages/auth/src/encrypted-file-auth-store.ts
1409
+ // packages/poe-auth/src/encrypted-file-auth-store.ts
1410
1410
  import { createCipheriv, createDecipheriv, randomBytes, scrypt } from "node:crypto";
1411
1411
  import { promises as fs } from "node:fs";
1412
1412
  import { homedir as homedir2, hostname, userInfo } from "node:os";
@@ -1462,7 +1462,7 @@ function isNotFoundError(error) {
1462
1462
  }
1463
1463
  var ENCRYPTION_ALGORITHM, ENCRYPTION_VERSION, ENCRYPTION_KEY_BYTES, ENCRYPTION_IV_BYTES, ENCRYPTION_AUTH_TAG_BYTES, ENCRYPTION_SALT, ENCRYPTION_FILE_MODE, EncryptedFileAuthStore;
1464
1464
  var init_encrypted_file_auth_store = __esm({
1465
- "packages/auth/src/encrypted-file-auth-store.ts"() {
1465
+ "packages/poe-auth/src/encrypted-file-auth-store.ts"() {
1466
1466
  "use strict";
1467
1467
  ENCRYPTION_ALGORITHM = "aes-256-gcm";
1468
1468
  ENCRYPTION_VERSION = 1;
@@ -1557,7 +1557,7 @@ var init_encrypted_file_auth_store = __esm({
1557
1557
  }
1558
1558
  });
1559
1559
 
1560
- // packages/auth/src/keychain-auth-store.ts
1560
+ // packages/poe-auth/src/keychain-auth-store.ts
1561
1561
  import { spawn } from "node:child_process";
1562
1562
  function runSecurityCommand(command, args) {
1563
1563
  return new Promise((resolve) => {
@@ -1619,7 +1619,7 @@ function createSecurityCliFailure(operation, result) {
1619
1619
  }
1620
1620
  var SECURITY_CLI, KEYCHAIN_SERVICE, KEYCHAIN_ACCOUNT, KEYCHAIN_ITEM_NOT_FOUND_EXIT_CODE, KeychainAuthStore;
1621
1621
  var init_keychain_auth_store = __esm({
1622
- "packages/auth/src/keychain-auth-store.ts"() {
1622
+ "packages/poe-auth/src/keychain-auth-store.ts"() {
1623
1623
  "use strict";
1624
1624
  SECURITY_CLI = "security";
1625
1625
  KEYCHAIN_SERVICE = "poe-code";
@@ -1687,7 +1687,7 @@ var init_keychain_auth_store = __esm({
1687
1687
  }
1688
1688
  });
1689
1689
 
1690
- // packages/auth/src/create-auth-store.ts
1690
+ // packages/poe-auth/src/create-auth-store.ts
1691
1691
  import { promises as nodeFs } from "node:fs";
1692
1692
  import { homedir as homedir3 } from "node:os";
1693
1693
  import path3 from "node:path";
@@ -1826,7 +1826,7 @@ function isNotFoundError2(error) {
1826
1826
  }
1827
1827
  var AUTH_BACKEND_ENV_VAR, MACOS_PLATFORM, LEGACY_CREDENTIALS_RELATIVE_PATH, authStoreFactories;
1828
1828
  var init_create_auth_store = __esm({
1829
- "packages/auth/src/create-auth-store.ts"() {
1829
+ "packages/poe-auth/src/create-auth-store.ts"() {
1830
1830
  "use strict";
1831
1831
  init_encrypted_file_auth_store();
1832
1832
  init_keychain_auth_store();
@@ -1840,20 +1840,66 @@ var init_create_auth_store = __esm({
1840
1840
  }
1841
1841
  });
1842
1842
 
1843
- // packages/auth/src/oauth-client.ts
1843
+ // packages/poe-auth/src/check-auth.ts
1844
+ var init_check_auth = __esm({
1845
+ "packages/poe-auth/src/check-auth.ts"() {
1846
+ "use strict";
1847
+ init_create_auth_store();
1848
+ }
1849
+ });
1850
+
1851
+ // packages/poe-auth/src/get-token.ts
1852
+ var init_get_token = __esm({
1853
+ "packages/poe-auth/src/get-token.ts"() {
1854
+ "use strict";
1855
+ init_create_auth_store();
1856
+ }
1857
+ });
1858
+
1859
+ // packages/poe-auth/src/api-key-validation.ts
1860
+ var init_api_key_validation = __esm({
1861
+ "packages/poe-auth/src/api-key-validation.ts"() {
1862
+ "use strict";
1863
+ }
1864
+ });
1865
+
1866
+ // packages/poe-auth/src/oauth-client.ts
1844
1867
  import http from "node:http";
1845
1868
  import crypto from "node:crypto";
1846
1869
  var init_oauth_client = __esm({
1847
- "packages/auth/src/oauth-client.ts"() {
1870
+ "packages/poe-auth/src/oauth-client.ts"() {
1848
1871
  "use strict";
1849
1872
  }
1850
1873
  });
1851
1874
 
1852
- // packages/auth/src/index.ts
1875
+ // packages/poe-auth/src/login.ts
1876
+ var init_login = __esm({
1877
+ "packages/poe-auth/src/login.ts"() {
1878
+ "use strict";
1879
+ init_api_key_validation();
1880
+ init_create_auth_store();
1881
+ init_oauth_client();
1882
+ }
1883
+ });
1884
+
1885
+ // packages/poe-auth/src/logout.ts
1886
+ var init_logout = __esm({
1887
+ "packages/poe-auth/src/logout.ts"() {
1888
+ "use strict";
1889
+ init_create_auth_store();
1890
+ }
1891
+ });
1892
+
1893
+ // packages/poe-auth/src/index.ts
1853
1894
  var init_src2 = __esm({
1854
- "packages/auth/src/index.ts"() {
1895
+ "packages/poe-auth/src/index.ts"() {
1855
1896
  "use strict";
1856
1897
  init_create_auth_store();
1898
+ init_check_auth();
1899
+ init_get_token();
1900
+ init_api_key_validation();
1901
+ init_login();
1902
+ init_logout();
1857
1903
  init_oauth_client();
1858
1904
  init_encrypted_file_auth_store();
1859
1905
  init_keychain_auth_store();
@@ -5205,7 +5251,9 @@ async function createPoeAcpModel(options) {
5205
5251
  });
5206
5252
  if (!response.ok) {
5207
5253
  const details = await response.text().catch(() => "");
5208
- throw new Error(`Poe API request failed (${response.status}): ${details || response.statusText}`);
5254
+ throw new Error(
5255
+ `Poe API request failed (${response.status}): ${details || response.statusText}`
5256
+ );
5209
5257
  }
5210
5258
  const json = await response.json();
5211
5259
  const message = json.choices?.[0]?.message;
@@ -5379,7 +5427,10 @@ var init_agent = __esm({
5379
5427
  return new _ImmutableAgentBuilder(
5380
5428
  createResolvedAgentConfig({
5381
5429
  ...this.#config,
5382
- mcpServers: [...this.#config.mcpServers, ...configs.map((config) => cloneMcpServerConfig(config))]
5430
+ mcpServers: [
5431
+ ...this.#config.mcpServers,
5432
+ ...configs.map((config) => cloneMcpServerConfig(config))
5433
+ ]
5383
5434
  })
5384
5435
  );
5385
5436
  }
@@ -5511,7 +5562,10 @@ var init_agent = __esm({
5511
5562
  try {
5512
5563
  await runContext.dispose();
5513
5564
  } catch (disposeError) {
5514
- throw new AggregateError([error, disposeError], "Run preparation failed and disposal failed.");
5565
+ throw new AggregateError(
5566
+ [error, disposeError],
5567
+ "Run preparation failed and disposal failed."
5568
+ );
5515
5569
  }
5516
5570
  throw error;
5517
5571
  }