toolcraft 0.0.4 → 0.0.6

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.
Files changed (153) hide show
  1. package/dist/cli.js +5 -3
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.js +1 -0
  4. package/dist/mcp.d.ts +1 -1
  5. package/dist/mcp.js +10 -1
  6. package/dist/package-metadata.d.ts +10 -0
  7. package/dist/package-metadata.js +62 -0
  8. package/node_modules/@poe-code/agent-defs/dist/agents/claude-code.d.ts +2 -0
  9. package/node_modules/@poe-code/agent-defs/dist/agents/claude-code.js +15 -0
  10. package/node_modules/@poe-code/agent-defs/dist/agents/claude-desktop.d.ts +2 -0
  11. package/node_modules/@poe-code/agent-defs/dist/agents/claude-desktop.js +13 -0
  12. package/node_modules/@poe-code/agent-defs/dist/agents/codex.d.ts +2 -0
  13. package/node_modules/@poe-code/agent-defs/dist/agents/codex.js +14 -0
  14. package/node_modules/@poe-code/agent-defs/dist/agents/goose.d.ts +2 -0
  15. package/node_modules/@poe-code/agent-defs/dist/agents/goose.js +14 -0
  16. package/node_modules/@poe-code/agent-defs/dist/agents/index.d.ts +7 -0
  17. package/node_modules/@poe-code/agent-defs/dist/agents/index.js +7 -0
  18. package/node_modules/@poe-code/agent-defs/dist/agents/kimi.d.ts +2 -0
  19. package/node_modules/@poe-code/agent-defs/dist/agents/kimi.js +15 -0
  20. package/node_modules/@poe-code/agent-defs/dist/agents/opencode.d.ts +2 -0
  21. package/node_modules/@poe-code/agent-defs/dist/agents/opencode.js +14 -0
  22. package/node_modules/@poe-code/agent-defs/dist/agents/poe-agent.d.ts +2 -0
  23. package/node_modules/@poe-code/agent-defs/dist/agents/poe-agent.js +13 -0
  24. package/node_modules/@poe-code/agent-defs/dist/index.d.ts +5 -0
  25. package/node_modules/@poe-code/agent-defs/dist/index.js +3 -0
  26. package/node_modules/@poe-code/agent-defs/dist/registry.d.ts +3 -0
  27. package/node_modules/@poe-code/agent-defs/dist/registry.js +26 -0
  28. package/node_modules/@poe-code/agent-defs/dist/specifier.d.ts +7 -0
  29. package/node_modules/@poe-code/agent-defs/dist/specifier.js +27 -0
  30. package/node_modules/@poe-code/agent-defs/dist/types.d.ts +16 -0
  31. package/node_modules/@poe-code/agent-defs/dist/types.js +1 -0
  32. package/node_modules/@poe-code/agent-defs/package.json +20 -0
  33. package/node_modules/@poe-code/config-mutations/dist/execution/apply-mutation.d.ts +5 -0
  34. package/node_modules/@poe-code/config-mutations/dist/execution/apply-mutation.js +552 -0
  35. package/node_modules/@poe-code/config-mutations/dist/execution/path-utils.d.ts +17 -0
  36. package/node_modules/@poe-code/config-mutations/dist/execution/path-utils.js +58 -0
  37. package/node_modules/@poe-code/config-mutations/dist/execution/run-mutations.d.ts +7 -0
  38. package/node_modules/@poe-code/config-mutations/dist/execution/run-mutations.js +46 -0
  39. package/node_modules/@poe-code/config-mutations/dist/formats/index.d.ts +13 -0
  40. package/node_modules/@poe-code/config-mutations/dist/formats/index.js +49 -0
  41. package/node_modules/@poe-code/config-mutations/dist/formats/json.d.ts +31 -0
  42. package/node_modules/@poe-code/config-mutations/dist/formats/json.js +140 -0
  43. package/node_modules/@poe-code/config-mutations/dist/formats/toml.d.ts +2 -0
  44. package/node_modules/@poe-code/config-mutations/dist/formats/toml.js +72 -0
  45. package/node_modules/@poe-code/config-mutations/dist/formats/yaml.d.ts +2 -0
  46. package/node_modules/@poe-code/config-mutations/dist/formats/yaml.js +73 -0
  47. package/node_modules/@poe-code/config-mutations/dist/fs-utils.d.ts +18 -0
  48. package/node_modules/@poe-code/config-mutations/dist/fs-utils.js +45 -0
  49. package/node_modules/@poe-code/config-mutations/dist/index.d.ts +8 -0
  50. package/node_modules/@poe-code/config-mutations/dist/index.js +8 -0
  51. package/node_modules/@poe-code/config-mutations/dist/mutations/config-mutation.d.ts +47 -0
  52. package/node_modules/@poe-code/config-mutations/dist/mutations/config-mutation.js +34 -0
  53. package/node_modules/@poe-code/config-mutations/dist/mutations/file-mutation.d.ts +52 -0
  54. package/node_modules/@poe-code/config-mutations/dist/mutations/file-mutation.js +46 -0
  55. package/node_modules/@poe-code/config-mutations/dist/mutations/template-mutation.d.ts +40 -0
  56. package/node_modules/@poe-code/config-mutations/dist/mutations/template-mutation.js +32 -0
  57. package/node_modules/@poe-code/config-mutations/dist/template/render.d.ts +7 -0
  58. package/node_modules/@poe-code/config-mutations/dist/template/render.js +28 -0
  59. package/node_modules/@poe-code/config-mutations/dist/testing/format-utils.d.ts +7 -0
  60. package/node_modules/@poe-code/config-mutations/dist/testing/format-utils.js +21 -0
  61. package/node_modules/@poe-code/config-mutations/dist/testing/index.d.ts +3 -0
  62. package/node_modules/@poe-code/config-mutations/dist/testing/index.js +2 -0
  63. package/node_modules/@poe-code/config-mutations/dist/testing/mock-fs.d.ts +25 -0
  64. package/node_modules/@poe-code/config-mutations/dist/testing/mock-fs.js +170 -0
  65. package/node_modules/@poe-code/config-mutations/dist/types.d.ts +156 -0
  66. package/node_modules/@poe-code/config-mutations/dist/types.js +6 -0
  67. package/node_modules/@poe-code/config-mutations/package.json +33 -0
  68. package/node_modules/@poe-code/file-lock/README.md +52 -0
  69. package/node_modules/@poe-code/file-lock/dist/index.d.ts +1 -0
  70. package/node_modules/@poe-code/file-lock/dist/index.js +1 -0
  71. package/node_modules/@poe-code/file-lock/dist/lock.d.ts +27 -0
  72. package/node_modules/@poe-code/file-lock/dist/lock.js +203 -0
  73. package/node_modules/@poe-code/file-lock/package.json +23 -0
  74. package/node_modules/auth-store/README.md +47 -0
  75. package/node_modules/auth-store/dist/create-secret-store.d.ts +2 -0
  76. package/node_modules/auth-store/dist/create-secret-store.js +35 -0
  77. package/node_modules/auth-store/dist/encrypted-file-store.d.ts +39 -0
  78. package/node_modules/auth-store/dist/encrypted-file-store.js +156 -0
  79. package/node_modules/auth-store/dist/index.d.ts +7 -0
  80. package/node_modules/auth-store/dist/index.js +4 -0
  81. package/node_modules/auth-store/dist/keychain-store.d.ts +22 -0
  82. package/node_modules/auth-store/dist/keychain-store.js +111 -0
  83. package/node_modules/auth-store/dist/provider-store.d.ts +10 -0
  84. package/node_modules/auth-store/dist/provider-store.js +28 -0
  85. package/node_modules/auth-store/dist/types.d.ts +20 -0
  86. package/node_modules/auth-store/dist/types.js +1 -0
  87. package/node_modules/auth-store/package.json +25 -0
  88. package/node_modules/mcp-oauth/README.md +31 -0
  89. package/node_modules/mcp-oauth/dist/client/auth-store-session-store.d.ts +14 -0
  90. package/node_modules/mcp-oauth/dist/client/auth-store-session-store.js +97 -0
  91. package/node_modules/mcp-oauth/dist/client/authorization-state.d.ts +8 -0
  92. package/node_modules/mcp-oauth/dist/client/authorization-state.js +34 -0
  93. package/node_modules/mcp-oauth/dist/client/default-oauth-client-provider.d.ts +3 -0
  94. package/node_modules/mcp-oauth/dist/client/default-oauth-client-provider.js +491 -0
  95. package/node_modules/mcp-oauth/dist/client/loopback-authorization.d.ts +20 -0
  96. package/node_modules/mcp-oauth/dist/client/loopback-authorization.js +169 -0
  97. package/node_modules/mcp-oauth/dist/client/pkce.d.ts +2 -0
  98. package/node_modules/mcp-oauth/dist/client/pkce.js +7 -0
  99. package/node_modules/mcp-oauth/dist/client/token-endpoint.d.ts +40 -0
  100. package/node_modules/mcp-oauth/dist/client/token-endpoint.js +143 -0
  101. package/node_modules/mcp-oauth/dist/client/types.d.ts +113 -0
  102. package/node_modules/mcp-oauth/dist/client/types.js +1 -0
  103. package/node_modules/mcp-oauth/dist/index.d.ts +10 -0
  104. package/node_modules/mcp-oauth/dist/index.js +7 -0
  105. package/node_modules/mcp-oauth/dist/resource-indicator.d.ts +1 -0
  106. package/node_modules/mcp-oauth/dist/resource-indicator.js +11 -0
  107. package/node_modules/mcp-oauth/dist/server/jwks-token-verifier.d.ts +27 -0
  108. package/node_modules/mcp-oauth/dist/server/jwks-token-verifier.js +259 -0
  109. package/node_modules/mcp-oauth/dist/types.compile-check.d.ts +1 -0
  110. package/node_modules/mcp-oauth/dist/types.compile-check.js +22 -0
  111. package/node_modules/mcp-oauth/package.json +31 -0
  112. package/node_modules/tiny-mcp-client/.turbo/turbo-build.log +4 -0
  113. package/node_modules/tiny-mcp-client/dist/index.d.ts +2 -0
  114. package/node_modules/tiny-mcp-client/dist/index.js +1 -0
  115. package/node_modules/tiny-mcp-client/dist/internal.d.ts +547 -0
  116. package/node_modules/tiny-mcp-client/dist/internal.js +2404 -0
  117. package/node_modules/tiny-mcp-client/dist/jsonrpc-types.compile-check.d.ts +1 -0
  118. package/node_modules/tiny-mcp-client/dist/jsonrpc-types.compile-check.js +37 -0
  119. package/node_modules/tiny-mcp-client/dist/mcp-lifecycle-types.compile-check.d.ts +1 -0
  120. package/node_modules/tiny-mcp-client/dist/mcp-lifecycle-types.compile-check.js +50 -0
  121. package/node_modules/tiny-mcp-client/dist/mcp-prompt-types.compile-check.d.ts +1 -0
  122. package/node_modules/tiny-mcp-client/dist/mcp-prompt-types.compile-check.js +50 -0
  123. package/node_modules/tiny-mcp-client/dist/mcp-resource-types.compile-check.d.ts +1 -0
  124. package/node_modules/tiny-mcp-client/dist/mcp-resource-types.compile-check.js +51 -0
  125. package/node_modules/tiny-mcp-client/dist/mcp-tool-types.compile-check.d.ts +1 -0
  126. package/node_modules/tiny-mcp-client/dist/mcp-tool-types.compile-check.js +89 -0
  127. package/node_modules/tiny-mcp-client/dist/mcp-transport-types.compile-check.d.ts +1 -0
  128. package/node_modules/tiny-mcp-client/dist/mcp-transport-types.compile-check.js +56 -0
  129. package/node_modules/tiny-mcp-client/dist/mcp-utility-types.compile-check.d.ts +1 -0
  130. package/node_modules/tiny-mcp-client/dist/mcp-utility-types.compile-check.js +145 -0
  131. package/node_modules/tiny-mcp-client/dist/oauth-discovery.d.ts +24 -0
  132. package/node_modules/tiny-mcp-client/dist/oauth-discovery.js +385 -0
  133. package/node_modules/tiny-mcp-client/package.json +22 -0
  134. package/node_modules/tiny-mcp-client/src/http-oauth.integration.test.ts +823 -0
  135. package/node_modules/tiny-mcp-client/src/http-oauth.test.ts +882 -0
  136. package/node_modules/tiny-mcp-client/src/index.ts +94 -0
  137. package/node_modules/tiny-mcp-client/src/internal.ts +3566 -0
  138. package/node_modules/tiny-mcp-client/src/jsonrpc-types.compile-check.ts +66 -0
  139. package/node_modules/tiny-mcp-client/src/mcp-client-http-transport.integration.test.ts +222 -0
  140. package/node_modules/tiny-mcp-client/src/mcp-client-sdk.test.ts +1294 -0
  141. package/node_modules/tiny-mcp-client/src/mcp-client-tiny-stdio-test-server-tools.test.ts +143 -0
  142. package/node_modules/tiny-mcp-client/src/mcp-lifecycle-types.compile-check.ts +65 -0
  143. package/node_modules/tiny-mcp-client/src/mcp-prompt-types.compile-check.ts +66 -0
  144. package/node_modules/tiny-mcp-client/src/mcp-resource-types.compile-check.ts +70 -0
  145. package/node_modules/tiny-mcp-client/src/mcp-tool-types.compile-check.ts +117 -0
  146. package/node_modules/tiny-mcp-client/src/mcp-transport-types.compile-check.ts +75 -0
  147. package/node_modules/tiny-mcp-client/src/mcp-utility-types.compile-check.ts +181 -0
  148. package/node_modules/tiny-mcp-client/src/mock-servers.test.ts +980 -0
  149. package/node_modules/tiny-mcp-client/src/oauth-discovery.ts +583 -0
  150. package/node_modules/tiny-mcp-client/src/transports.test.ts +8139 -0
  151. package/node_modules/tiny-mcp-client/src/utilities.test.ts +372 -0
  152. package/node_modules/tiny-mcp-client/tsconfig.json +11 -0
  153. package/package.json +24 -11
package/dist/cli.js CHANGED
@@ -7,6 +7,7 @@ import { mergeApprovalsGroup } from "./human-in-loop/approvals-commands.js";
7
7
  import { invokeWithHumanInLoop } from "./human-in-loop/index.js";
8
8
  import { resolveMcpProxies } from "./mcp-proxy.js";
9
9
  import { getExpectedNumberDescription, isValidNumberSchemaValue } from "./number-schema.js";
10
+ import { findEntrypointPackageMetadata } from "./package-metadata.js";
10
11
  import { renderResult } from "./renderer.js";
11
12
  const RESERVED_SERVICE_NAMES = new Set(["params", "secrets", "fetch", "fs", "env", "progress"]);
12
13
  const NULL_OPTION_VALUE = Symbol("toolcraft.cli.null");
@@ -1990,6 +1991,7 @@ export async function runCLI(roots, options = {}) {
1990
1991
  const casing = options.casing ?? "kebab";
1991
1992
  const services = (options.services ?? {});
1992
1993
  const runtimeOptions = options.humanInLoop ?? {};
1994
+ const version = options.version ?? findEntrypointPackageMetadata(process.argv[1])?.version;
1993
1995
  const servicesWithBuiltIns = {
1994
1996
  ...services,
1995
1997
  runtimeOptions,
@@ -2000,7 +2002,7 @@ export async function runCLI(roots, options = {}) {
2000
2002
  };
2001
2003
  validateServices(services);
2002
2004
  if (hasHelpFlag(process.argv)) {
2003
- await renderGeneratedHelp(root, process.argv, options);
2005
+ await renderGeneratedHelp(root, process.argv, { ...options, version });
2004
2006
  return;
2005
2007
  }
2006
2008
  const program = new CommanderCommand();
@@ -2009,8 +2011,8 @@ export async function runCLI(roots, options = {}) {
2009
2011
  program.showHelpAfterError();
2010
2012
  program.addHelpCommand(false);
2011
2013
  addGlobalOptions(program);
2012
- if (options.version !== undefined) {
2013
- program.version(options.version, "--version");
2014
+ if (version !== undefined) {
2015
+ program.version(version, "--version");
2014
2016
  }
2015
2017
  let lastActionCommand;
2016
2018
  const execute = async (state) => {
package/dist/index.d.ts CHANGED
@@ -179,5 +179,7 @@ export declare function defineGroup<TServices extends object = EmptyServices, TN
179
179
  export declare function getCommandSourcePath(command: Command<any, any, any, any>): string | undefined;
180
180
  export { S, toJsonSchema } from "toolcraft-schema";
181
181
  export { ApprovalDeclinedError, UserError };
182
+ export { findPackageMetadata, packageMetadata } from "./package-metadata.js";
183
+ export type { PackageMetadata } from "./package-metadata.js";
182
184
  export type { AnySchema, ArraySchema, BooleanSchema, EnumSchema, JsonSchema, NumberSchema, ObjectSchema, OptionalSchema, Static, StringSchema } from "toolcraft-schema";
183
185
  export type { HumanInLoopConfig, HumanInLoopPending, HumanInLoopRuntimeOptions };
package/dist/index.js CHANGED
@@ -429,3 +429,4 @@ export function getCommandSourcePath(command) {
429
429
  }
430
430
  export { S, toJsonSchema } from "toolcraft-schema";
431
431
  export { ApprovalDeclinedError, UserError };
432
+ export { findPackageMetadata, packageMetadata } from "./package-metadata.js";
package/dist/mcp.d.ts CHANGED
@@ -7,7 +7,7 @@ type CmdkitServer = Omit<TinyServer, "connect"> & {
7
7
  };
8
8
  export interface RunMCPOptions<TServices extends object = Record<string, unknown>> {
9
9
  name: string;
10
- version: string;
10
+ version?: string;
11
11
  humanInLoop?: HumanInLoopRuntimeOptions;
12
12
  /**
13
13
  * Optional allowlist of MCP tool names or group prefixes.
package/dist/mcp.js CHANGED
@@ -6,6 +6,7 @@ import { mergeApprovalsGroup } from "./human-in-loop/approvals-commands.js";
6
6
  import { ApprovalDeclinedError, invokeWithHumanInLoop, } from "./human-in-loop/index.js";
7
7
  import { hasMcpProxyGroups, resolveMcpProxies } from "./mcp-proxy.js";
8
8
  import { getExpectedNumberDescription, isValidNumberSchemaValue } from "./number-schema.js";
9
+ import { findEntrypointPackageMetadata } from "./package-metadata.js";
9
10
  import { filterSchemaForScope } from "./schema-scope.js";
10
11
  const RESERVED_SERVICE_NAMES = new Set(["params", "secrets", "fetch", "fs", "env", "progress"]);
11
12
  function normalizeRoots(roots) {
@@ -365,7 +366,8 @@ function createResolvedMCPServer(root, options) {
365
366
  };
366
367
  validateServices(services);
367
368
  const tools = enumerateTools(root, casing, options.tools);
368
- const server = createServer({ name: options.name, version: options.version });
369
+ const version = resolveMCPVersion(options.version);
370
+ const server = createServer({ name: options.name, version });
369
371
  for (const tool of tools) {
370
372
  server.tool(tool.name, tool.description, tool.inputSchema, async (argumentsValue) => {
371
373
  try {
@@ -406,6 +408,13 @@ function createResolvedMCPServer(root, options) {
406
408
  },
407
409
  };
408
410
  }
411
+ function resolveMCPVersion(version) {
412
+ const resolvedVersion = version ?? findEntrypointPackageMetadata(process.argv[1])?.version;
413
+ if (resolvedVersion === undefined) {
414
+ throw new Error("MCP version is required when no package.json version can be inferred from the entrypoint.");
415
+ }
416
+ return resolvedVersion;
417
+ }
409
418
  function createDeferredMCPServer(root, options) {
410
419
  let serverPromise;
411
420
  const resolveServer = () => {
@@ -0,0 +1,10 @@
1
+ export interface PackageMetadata {
2
+ name?: string;
3
+ path: string;
4
+ version?: string;
5
+ }
6
+ type PackageMetadataInput = string | URL;
7
+ export declare function findPackageMetadata(from: PackageMetadataInput): PackageMetadata | undefined;
8
+ export declare function packageMetadata(from?: PackageMetadataInput): PackageMetadata;
9
+ export declare function findEntrypointPackageMetadata(entrypoint: string | undefined): PackageMetadata | undefined;
10
+ export {};
@@ -0,0 +1,62 @@
1
+ import { existsSync, readFileSync, statSync } from "node:fs";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ function pathFromInput(from) {
5
+ if (from instanceof URL) {
6
+ return fileURLToPath(from);
7
+ }
8
+ if (from.startsWith("file:")) {
9
+ return fileURLToPath(from);
10
+ }
11
+ return path.resolve(from);
12
+ }
13
+ function getSearchDirectory(from) {
14
+ const resolved = pathFromInput(from);
15
+ try {
16
+ return statSync(resolved).isDirectory() ? resolved : path.dirname(resolved);
17
+ }
18
+ catch {
19
+ return path.dirname(resolved);
20
+ }
21
+ }
22
+ function readPackageMetadata(packageJsonPath) {
23
+ const parsed = JSON.parse(readFileSync(packageJsonPath, "utf8"));
24
+ const metadata = { path: packageJsonPath };
25
+ if (typeof parsed.name === "string") {
26
+ metadata.name = parsed.name;
27
+ }
28
+ if (typeof parsed.version === "string") {
29
+ metadata.version = parsed.version;
30
+ }
31
+ return metadata;
32
+ }
33
+ export function findPackageMetadata(from) {
34
+ let current = getSearchDirectory(from);
35
+ while (true) {
36
+ const packageJsonPath = path.join(current, "package.json");
37
+ if (existsSync(packageJsonPath)) {
38
+ return readPackageMetadata(packageJsonPath);
39
+ }
40
+ const parent = path.dirname(current);
41
+ if (parent === current) {
42
+ return undefined;
43
+ }
44
+ current = parent;
45
+ }
46
+ }
47
+ export function packageMetadata(from = process.cwd()) {
48
+ const metadata = findPackageMetadata(from);
49
+ if (metadata === undefined) {
50
+ throw new Error(`No package.json found from ${pathFromInput(from)}.`);
51
+ }
52
+ return metadata;
53
+ }
54
+ export function findEntrypointPackageMetadata(entrypoint) {
55
+ if (entrypoint === undefined || entrypoint.length === 0) {
56
+ return undefined;
57
+ }
58
+ if (!path.isAbsolute(entrypoint) && !entrypoint.startsWith("file:")) {
59
+ return undefined;
60
+ }
61
+ return findPackageMetadata(entrypoint);
62
+ }
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from "../types.js";
2
+ export declare const claudeCodeAgent: AgentDefinition;
@@ -0,0 +1,15 @@
1
+ export const claudeCodeAgent = {
2
+ id: "claude-code",
3
+ name: "claude-code",
4
+ label: "Claude Code",
5
+ summary: "Configure Claude Code to route through Poe.",
6
+ aliases: ["claude"],
7
+ binaryName: "claude",
8
+ configPath: "~/.claude/settings.json",
9
+ branding: {
10
+ colors: {
11
+ dark: "#C15F3C",
12
+ light: "#C15F3C"
13
+ }
14
+ }
15
+ };
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from "../types.js";
2
+ export declare const claudeDesktopAgent: AgentDefinition;
@@ -0,0 +1,13 @@
1
+ export const claudeDesktopAgent = {
2
+ id: "claude-desktop",
3
+ name: "claude-desktop",
4
+ label: "Claude Desktop",
5
+ summary: "Anthropic's official desktop application for Claude",
6
+ configPath: "~/.claude/settings.json",
7
+ branding: {
8
+ colors: {
9
+ dark: "#D97757",
10
+ light: "#D97757"
11
+ }
12
+ }
13
+ };
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from "../types.js";
2
+ export declare const codexAgent: AgentDefinition;
@@ -0,0 +1,14 @@
1
+ export const codexAgent = {
2
+ id: "codex",
3
+ name: "codex",
4
+ label: "Codex",
5
+ summary: "Configure Codex to use Poe as the model provider.",
6
+ binaryName: "codex",
7
+ configPath: "~/.codex/config.toml",
8
+ branding: {
9
+ colors: {
10
+ dark: "#D5D9DF",
11
+ light: "#7A7F86"
12
+ }
13
+ }
14
+ };
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from "../types.js";
2
+ export declare const gooseAgent: AgentDefinition;
@@ -0,0 +1,14 @@
1
+ export const gooseAgent = {
2
+ id: "goose",
3
+ name: "goose",
4
+ label: "Goose",
5
+ summary: "Block's open-source AI agent with ACP support.",
6
+ binaryName: "goose",
7
+ configPath: "~/.config/goose/config.yaml",
8
+ branding: {
9
+ colors: {
10
+ dark: "#FF6B35",
11
+ light: "#E85D26"
12
+ }
13
+ }
14
+ };
@@ -0,0 +1,7 @@
1
+ export { claudeCodeAgent } from "./claude-code.js";
2
+ export { claudeDesktopAgent } from "./claude-desktop.js";
3
+ export { codexAgent } from "./codex.js";
4
+ export { openCodeAgent } from "./opencode.js";
5
+ export { kimiAgent } from "./kimi.js";
6
+ export { gooseAgent } from "./goose.js";
7
+ export { poeAgentAgent } from "./poe-agent.js";
@@ -0,0 +1,7 @@
1
+ export { claudeCodeAgent } from "./claude-code.js";
2
+ export { claudeDesktopAgent } from "./claude-desktop.js";
3
+ export { codexAgent } from "./codex.js";
4
+ export { openCodeAgent } from "./opencode.js";
5
+ export { kimiAgent } from "./kimi.js";
6
+ export { gooseAgent } from "./goose.js";
7
+ export { poeAgentAgent } from "./poe-agent.js";
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from "../types.js";
2
+ export declare const kimiAgent: AgentDefinition;
@@ -0,0 +1,15 @@
1
+ export const kimiAgent = {
2
+ id: "kimi",
3
+ name: "kimi",
4
+ label: "Kimi",
5
+ summary: "Configure Kimi CLI to use Poe API",
6
+ aliases: ["kimi-cli"],
7
+ binaryName: "kimi",
8
+ configPath: "~/.kimi/config.toml",
9
+ branding: {
10
+ colors: {
11
+ dark: "#7B68EE",
12
+ light: "#6A5ACD"
13
+ }
14
+ }
15
+ };
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from "../types.js";
2
+ export declare const openCodeAgent: AgentDefinition;
@@ -0,0 +1,14 @@
1
+ export const openCodeAgent = {
2
+ id: "opencode",
3
+ name: "opencode",
4
+ label: "OpenCode CLI",
5
+ summary: "Configure OpenCode CLI to use the Poe API.",
6
+ binaryName: "opencode",
7
+ configPath: "~/.config/opencode/config.json",
8
+ branding: {
9
+ colors: {
10
+ dark: "#4A4F55",
11
+ light: "#2F3338"
12
+ }
13
+ }
14
+ };
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from "../types.js";
2
+ export declare const poeAgentAgent: AgentDefinition;
@@ -0,0 +1,13 @@
1
+ export const poeAgentAgent = {
2
+ id: "poe-agent",
3
+ name: "poe-agent",
4
+ label: "Poe Agent",
5
+ summary: "Run one-shot prompts with the built-in Poe agent runtime.",
6
+ configPath: "~/.poe-code/config.json",
7
+ branding: {
8
+ colors: {
9
+ dark: "#A465F7",
10
+ light: "#7A3FD3"
11
+ }
12
+ }
13
+ };
@@ -0,0 +1,5 @@
1
+ export type { AgentDefinition } from "./types.js";
2
+ export type { AgentSpecifier } from "./specifier.js";
3
+ export { claudeCodeAgent, claudeDesktopAgent, codexAgent, openCodeAgent, kimiAgent, gooseAgent, poeAgentAgent } from "./agents/index.js";
4
+ export { allAgents, resolveAgentId } from "./registry.js";
5
+ export { parseAgentSpecifier, formatAgentSpecifier, normalizeAgentId } from "./specifier.js";
@@ -0,0 +1,3 @@
1
+ export { claudeCodeAgent, claudeDesktopAgent, codexAgent, openCodeAgent, kimiAgent, gooseAgent, poeAgentAgent } from "./agents/index.js";
2
+ export { allAgents, resolveAgentId } from "./registry.js";
3
+ export { parseAgentSpecifier, formatAgentSpecifier, normalizeAgentId } from "./specifier.js";
@@ -0,0 +1,3 @@
1
+ import type { AgentDefinition } from "./types.js";
2
+ export declare const allAgents: AgentDefinition[];
3
+ export declare function resolveAgentId(input: string): string | undefined;
@@ -0,0 +1,26 @@
1
+ import { claudeCodeAgent, claudeDesktopAgent, codexAgent, openCodeAgent, kimiAgent, gooseAgent, poeAgentAgent } from "./agents/index.js";
2
+ export const allAgents = [
3
+ claudeCodeAgent,
4
+ claudeDesktopAgent,
5
+ codexAgent,
6
+ openCodeAgent,
7
+ kimiAgent,
8
+ gooseAgent,
9
+ poeAgentAgent
10
+ ];
11
+ const lookup = new Map();
12
+ for (const agent of allAgents) {
13
+ const values = [agent.id, agent.name, ...(agent.aliases ?? [])];
14
+ for (const value of values) {
15
+ const normalized = value.toLowerCase();
16
+ if (!lookup.has(normalized)) {
17
+ lookup.set(normalized, agent.id);
18
+ }
19
+ }
20
+ }
21
+ export function resolveAgentId(input) {
22
+ if (!input) {
23
+ return undefined;
24
+ }
25
+ return lookup.get(input.toLowerCase());
26
+ }
@@ -0,0 +1,7 @@
1
+ export interface AgentSpecifier {
2
+ agent: string;
3
+ model?: string;
4
+ }
5
+ export declare function parseAgentSpecifier(input: string): AgentSpecifier;
6
+ export declare function formatAgentSpecifier(specifier: AgentSpecifier): string;
7
+ export declare function normalizeAgentId(input: string): string;
@@ -0,0 +1,27 @@
1
+ import { resolveAgentId } from "./registry.js";
2
+ export function parseAgentSpecifier(input) {
3
+ const colonIndex = input.indexOf(":");
4
+ if (colonIndex === -1) {
5
+ return { agent: input.trim() };
6
+ }
7
+ const agent = input.slice(0, colonIndex).trim();
8
+ const model = input.slice(colonIndex + 1).trim();
9
+ return {
10
+ agent,
11
+ ...(model.length > 0 ? { model } : {}),
12
+ };
13
+ }
14
+ export function formatAgentSpecifier(specifier) {
15
+ if (specifier.model) {
16
+ return `${specifier.agent}:${specifier.model}`;
17
+ }
18
+ return specifier.agent;
19
+ }
20
+ export function normalizeAgentId(input) {
21
+ const specifier = parseAgentSpecifier(input.trim());
22
+ const agent = resolveAgentId(specifier.agent) ?? specifier.agent;
23
+ return formatAgentSpecifier({
24
+ agent,
25
+ model: specifier.model
26
+ });
27
+ }
@@ -0,0 +1,16 @@
1
+ export interface AgentDefinition {
2
+ id: string;
3
+ name: string;
4
+ label: string;
5
+ summary: string;
6
+ aliases?: string[];
7
+ /** Binary name for CLI agents. Optional for GUI-only apps like Claude Desktop. */
8
+ binaryName?: string;
9
+ configPath: string;
10
+ branding: {
11
+ colors: {
12
+ dark: string;
13
+ light: string;
14
+ };
15
+ };
16
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@poe-code/agent-defs",
3
+ "version": "0.0.1",
4
+ "private": true,
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "scripts": {
15
+ "build": "tsc"
16
+ },
17
+ "files": [
18
+ "dist"
19
+ ]
20
+ }
@@ -0,0 +1,5 @@
1
+ import type { Mutation, MutationContext, MutationOutcome, MutationDetails, MutationOptions } from "../types.js";
2
+ export declare function applyMutation(mutation: Mutation, context: MutationContext, options: MutationOptions): Promise<{
3
+ outcome: MutationOutcome;
4
+ details: MutationDetails;
5
+ }>;