poe-code 3.0.183 → 3.0.185

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 (232) hide show
  1. package/dist/cli/commands/configure-payload.d.ts +2 -1
  2. package/dist/cli/commands/configure-payload.js +4 -2
  3. package/dist/cli/commands/configure-payload.js.map +1 -1
  4. package/dist/cli/commands/configure.d.ts +1 -0
  5. package/dist/cli/commands/configure.js +50 -11
  6. package/dist/cli/commands/configure.js.map +1 -1
  7. package/dist/cli/commands/ensure-isolated-config.js +24 -2
  8. package/dist/cli/commands/ensure-isolated-config.js.map +1 -1
  9. package/dist/cli/commands/experiment.js +15 -2
  10. package/dist/cli/commands/experiment.js.map +1 -1
  11. package/dist/cli/commands/login.js +8 -4
  12. package/dist/cli/commands/login.js.map +1 -1
  13. package/dist/cli/commands/memory.js +16 -7
  14. package/dist/cli/commands/memory.js.map +1 -1
  15. package/dist/cli/commands/pipeline-init.d.ts +0 -1
  16. package/dist/cli/commands/pipeline-init.js +32 -46
  17. package/dist/cli/commands/pipeline-init.js.map +1 -1
  18. package/dist/cli/commands/pipeline.js +97 -41
  19. package/dist/cli/commands/pipeline.js.map +1 -1
  20. package/dist/cli/commands/provider.d.ts +6 -0
  21. package/dist/cli/commands/provider.js +100 -0
  22. package/dist/cli/commands/provider.js.map +1 -0
  23. package/dist/cli/commands/shared.d.ts +7 -0
  24. package/dist/cli/commands/shared.js +3 -0
  25. package/dist/cli/commands/shared.js.map +1 -1
  26. package/dist/cli/commands/test.js +1 -1
  27. package/dist/cli/commands/test.js.map +1 -1
  28. package/dist/cli/commands/unconfigure.js +12 -3
  29. package/dist/cli/commands/unconfigure.js.map +1 -1
  30. package/dist/cli/container.d.ts +2 -0
  31. package/dist/cli/container.js +3 -0
  32. package/dist/cli/container.js.map +1 -1
  33. package/dist/cli/isolated-env-runner.js +2 -2
  34. package/dist/cli/isolated-env-runner.js.map +1 -1
  35. package/dist/cli/isolated-env.d.ts +3 -2
  36. package/dist/cli/isolated-env.js +31 -40
  37. package/dist/cli/isolated-env.js.map +1 -1
  38. package/dist/cli/poe-code-command-runner.js +9 -2
  39. package/dist/cli/poe-code-command-runner.js.map +1 -1
  40. package/dist/cli/program.js +5 -0
  41. package/dist/cli/program.js.map +1 -1
  42. package/dist/cli/service-registry.d.ts +7 -7
  43. package/dist/cli/service-registry.js.map +1 -1
  44. package/dist/index.js +2965 -1968
  45. package/dist/index.js.map +4 -4
  46. package/dist/providers/claude-code.d.ts +2 -1
  47. package/dist/providers/claude-code.js +5 -5
  48. package/dist/providers/claude-code.js.map +2 -2
  49. package/dist/providers/codex.d.ts +5 -1
  50. package/dist/providers/codex.js +39 -12
  51. package/dist/providers/codex.js.map +2 -2
  52. package/dist/providers/goose.d.ts +2 -1
  53. package/dist/providers/goose.js +24 -8
  54. package/dist/providers/goose.js.map +3 -3
  55. package/dist/providers/kimi.js +3 -3
  56. package/dist/providers/kimi.js.map +3 -3
  57. package/dist/providers/opencode.js +2 -2
  58. package/dist/providers/opencode.js.map +3 -3
  59. package/dist/providers/poe-agent.js +786 -653
  60. package/dist/providers/poe-agent.js.map +4 -4
  61. package/dist/sdk/container.js +3 -0
  62. package/dist/sdk/container.js.map +1 -1
  63. package/dist/sdk/pipeline.d.ts +1 -2
  64. package/dist/sdk/pipeline.js +58 -9
  65. package/dist/sdk/pipeline.js.map +1 -1
  66. package/dist/services/config.d.ts +1 -0
  67. package/dist/services/config.js +27 -2
  68. package/dist/services/config.js.map +1 -1
  69. package/dist/templates/pipeline/SKILL_plan.md +7 -20
  70. package/dist/templates/pipeline/steps.yaml.mustache +5 -2
  71. package/package.json +10 -1
  72. package/packages/agent-mcp-config/dist/apply.d.ts +6 -0
  73. package/packages/agent-mcp-config/dist/apply.js +175 -0
  74. package/packages/agent-mcp-config/dist/configs.d.ts +22 -0
  75. package/packages/agent-mcp-config/dist/configs.js +74 -0
  76. package/packages/agent-mcp-config/dist/index.d.ts +3 -0
  77. package/packages/agent-mcp-config/dist/index.js +2 -0
  78. package/packages/agent-mcp-config/dist/shapes.d.ts +31 -0
  79. package/packages/agent-mcp-config/dist/shapes.js +87 -0
  80. package/packages/agent-mcp-config/dist/types.d.ts +25 -0
  81. package/packages/agent-mcp-config/dist/types.js +1 -0
  82. package/packages/agent-skill-config/dist/apply.d.ts +25 -0
  83. package/packages/agent-skill-config/dist/apply.js +109 -0
  84. package/packages/agent-skill-config/dist/configs.d.ts +16 -0
  85. package/packages/agent-skill-config/dist/configs.js +66 -0
  86. package/packages/agent-skill-config/dist/exports.compile-check.d.ts +1 -0
  87. package/packages/agent-skill-config/dist/exports.compile-check.js +1 -0
  88. package/packages/agent-skill-config/dist/index.d.ts +5 -0
  89. package/packages/agent-skill-config/dist/index.js +2 -0
  90. package/packages/agent-skill-config/dist/templates/poe-generate.md +47 -0
  91. package/packages/agent-skill-config/dist/templates/terminal-pilot.md +45 -0
  92. package/packages/agent-skill-config/dist/templates.d.ts +3 -0
  93. package/packages/agent-skill-config/dist/templates.js +63 -0
  94. package/packages/agent-skill-config/dist/types.d.ts +16 -0
  95. package/packages/agent-skill-config/dist/types.js +1 -0
  96. package/packages/cmdkit/dist/cli.js +7 -2
  97. package/packages/cmdkit/dist/cli.js.map +2 -2
  98. package/packages/config-mutations/dist/execution/apply-mutation.d.ts +5 -0
  99. package/packages/config-mutations/dist/execution/apply-mutation.js +552 -0
  100. package/packages/config-mutations/dist/execution/path-utils.d.ts +17 -0
  101. package/packages/config-mutations/dist/execution/path-utils.js +58 -0
  102. package/packages/config-mutations/dist/execution/run-mutations.d.ts +7 -0
  103. package/packages/config-mutations/dist/execution/run-mutations.js +46 -0
  104. package/packages/config-mutations/dist/formats/index.d.ts +13 -0
  105. package/packages/config-mutations/dist/formats/index.js +49 -0
  106. package/packages/config-mutations/dist/formats/json.d.ts +31 -0
  107. package/packages/config-mutations/dist/formats/json.js +140 -0
  108. package/packages/config-mutations/dist/formats/toml.d.ts +2 -0
  109. package/packages/config-mutations/dist/formats/toml.js +72 -0
  110. package/packages/config-mutations/dist/formats/yaml.d.ts +2 -0
  111. package/packages/config-mutations/dist/formats/yaml.js +73 -0
  112. package/packages/config-mutations/dist/fs-utils.d.ts +18 -0
  113. package/packages/config-mutations/dist/fs-utils.js +45 -0
  114. package/packages/config-mutations/dist/index.d.ts +8 -0
  115. package/packages/config-mutations/dist/index.js +8 -0
  116. package/packages/config-mutations/dist/mutations/config-mutation.d.ts +47 -0
  117. package/packages/config-mutations/dist/mutations/config-mutation.js +34 -0
  118. package/packages/config-mutations/dist/mutations/file-mutation.d.ts +52 -0
  119. package/packages/config-mutations/dist/mutations/file-mutation.js +46 -0
  120. package/packages/config-mutations/dist/mutations/template-mutation.d.ts +40 -0
  121. package/packages/config-mutations/dist/mutations/template-mutation.js +32 -0
  122. package/packages/config-mutations/dist/template/render.d.ts +7 -0
  123. package/packages/config-mutations/dist/template/render.js +28 -0
  124. package/packages/config-mutations/dist/testing/format-utils.d.ts +7 -0
  125. package/packages/config-mutations/dist/testing/format-utils.js +21 -0
  126. package/packages/config-mutations/dist/testing/index.d.ts +3 -0
  127. package/packages/config-mutations/dist/testing/index.js +2 -0
  128. package/packages/config-mutations/dist/testing/mock-fs.d.ts +25 -0
  129. package/packages/config-mutations/dist/testing/mock-fs.js +170 -0
  130. package/packages/config-mutations/dist/types.d.ts +156 -0
  131. package/packages/config-mutations/dist/types.js +6 -0
  132. package/packages/design-system/dist/dashboard/components/stats-pane.js +2 -1
  133. package/packages/design-system/dist/dashboard/types.d.ts +1 -0
  134. package/packages/memory/dist/audit.d.ts +11 -0
  135. package/packages/memory/dist/audit.js +131 -0
  136. package/packages/memory/dist/cache.cli.d.ts +9 -0
  137. package/packages/memory/dist/cache.cli.js +24 -0
  138. package/packages/memory/dist/cache.d.ts +14 -0
  139. package/packages/memory/dist/cache.js +149 -0
  140. package/packages/memory/dist/confidence.d.ts +4 -0
  141. package/packages/memory/dist/confidence.js +201 -0
  142. package/packages/memory/dist/corpus/001-archaeoastronomy.md +479 -0
  143. package/packages/memory/dist/corpus/002-magnetohydrodynamics.md +475 -0
  144. package/packages/memory/dist/corpus/003-biosemiotics.md +483 -0
  145. package/packages/memory/dist/corpus/004-cryopedology.md +483 -0
  146. package/packages/memory/dist/corpus/005-geomicrobiology.md +479 -0
  147. package/packages/memory/dist/corpus/006-aeronomy.md +487 -0
  148. package/packages/memory/dist/corpus/007-paleoclimatology.md +479 -0
  149. package/packages/memory/dist/corpus/008-hydrogeophysics.md +479 -0
  150. package/packages/memory/dist/corpus/009-magnetostratigraphy.md +475 -0
  151. package/packages/memory/dist/corpus/010-isotope-hydrology.md +481 -0
  152. package/packages/memory/dist/corpus/011-speleothem-geochemistry.md +474 -0
  153. package/packages/memory/dist/corpus/012-astrobiogeochemistry.md +475 -0
  154. package/packages/memory/dist/corpus/013-neuroethology.md +483 -0
  155. package/packages/memory/dist/corpus/014-chronophysiology.md +483 -0
  156. package/packages/memory/dist/corpus/015-limnogeochemistry.md +475 -0
  157. package/packages/memory/dist/corpus/016-palynology.md +483 -0
  158. package/packages/memory/dist/corpus/017-volcanotectonics.md +473 -0
  159. package/packages/memory/dist/corpus/018-seismotectonics.md +473 -0
  160. package/packages/memory/dist/corpus/019-biogeomorphology.md +475 -0
  161. package/packages/memory/dist/corpus/020-geobiophysics.md +479 -0
  162. package/packages/memory/dist/corpus/021-phytolith-analysis.md +481 -0
  163. package/packages/memory/dist/corpus/022-archaeometallurgy.md +479 -0
  164. package/packages/memory/dist/corpus/023-paleomagnetism.md +479 -0
  165. package/packages/memory/dist/corpus/024-biocalorimetry.md +475 -0
  166. package/packages/memory/dist/corpus/025-atmospheric-chemiluminescence.md +473 -0
  167. package/packages/memory/dist/corpus/026-cryoseismology.md +479 -0
  168. package/packages/memory/dist/corpus/027-extremophile-radiobiology.md +475 -0
  169. package/packages/memory/dist/corpus/028-heliophysics.md +479 -0
  170. package/packages/memory/dist/corpus/029-astroparticle-geophysics.md +474 -0
  171. package/packages/memory/dist/corpus/030-glaciohydrology.md +479 -0
  172. package/packages/memory/dist/corpus/031-permafrost-microbiology.md +477 -0
  173. package/packages/memory/dist/corpus/032-ecoacoustics.md +479 -0
  174. package/packages/memory/dist/corpus/033-dendroclimatology.md +473 -0
  175. package/packages/memory/dist/corpus/034-ionospheric-tomography.md +477 -0
  176. package/packages/memory/dist/corpus/035-marine-geodesy.md +481 -0
  177. package/packages/memory/dist/corpus/036-sedimentary-ancient-dna.md +481 -0
  178. package/packages/memory/dist/corpus/037-myrmecochory-dynamics.md +474 -0
  179. package/packages/memory/dist/corpus/038-chemosensory-ecology.md +477 -0
  180. package/packages/memory/dist/corpus/039-spintronics-materials.md +479 -0
  181. package/packages/memory/dist/corpus/040-nanotoxicology.md +483 -0
  182. package/packages/memory/dist/corpus/041-cosmochemistry.md +483 -0
  183. package/packages/memory/dist/corpus/042-quaternary-geochronology.md +471 -0
  184. package/packages/memory/dist/corpus/043-biophotonics.md +479 -0
  185. package/packages/memory/dist/corpus/044-evolutionary-morphometrics.md +481 -0
  186. package/packages/memory/dist/corpus/045-cryovolcanology.md +475 -0
  187. package/packages/memory/dist/corpus/046-exoplanet-atmospheric-dynamics.md +479 -0
  188. package/packages/memory/dist/corpus/047-microbial-electrosynthesis.md +477 -0
  189. package/packages/memory/dist/corpus/048-paleoseismology.md +479 -0
  190. package/packages/memory/dist/corpus/049-actinide-geochemistry.md +477 -0
  191. package/packages/memory/dist/corpus/050-quantum-biology.md +489 -0
  192. package/packages/memory/dist/edit.d.ts +10 -0
  193. package/packages/memory/dist/edit.js +43 -0
  194. package/packages/memory/dist/explain.cli.d.ts +8 -0
  195. package/packages/memory/dist/explain.cli.js +9 -0
  196. package/packages/memory/dist/explain.d.ts +8 -0
  197. package/packages/memory/dist/explain.js +77 -0
  198. package/packages/memory/dist/frontmatter.d.ts +9 -0
  199. package/packages/memory/dist/frontmatter.js +217 -0
  200. package/packages/memory/dist/index.d.ts +21 -0
  201. package/packages/memory/dist/index.js +4807 -0
  202. package/packages/memory/dist/index.js.map +7 -0
  203. package/packages/memory/dist/ingest.d.ts +3 -0
  204. package/packages/memory/dist/ingest.js +118 -0
  205. package/packages/memory/dist/init.d.ts +2 -0
  206. package/packages/memory/dist/init.js +24 -0
  207. package/packages/memory/dist/install.d.ts +18 -0
  208. package/packages/memory/dist/install.js +50 -0
  209. package/packages/memory/dist/lock.d.ts +19 -0
  210. package/packages/memory/dist/lock.js +102 -0
  211. package/packages/memory/dist/mcp.d.ts +7 -0
  212. package/packages/memory/dist/mcp.js +58 -0
  213. package/packages/memory/dist/pages.d.ts +4 -0
  214. package/packages/memory/dist/pages.js +92 -0
  215. package/packages/memory/dist/paths.d.ts +12 -0
  216. package/packages/memory/dist/paths.js +34 -0
  217. package/packages/memory/dist/query.d.ts +10 -0
  218. package/packages/memory/dist/query.js +130 -0
  219. package/packages/memory/dist/reconcile.d.ts +9 -0
  220. package/packages/memory/dist/reconcile.js +138 -0
  221. package/packages/memory/dist/resolve-root.d.ts +11 -0
  222. package/packages/memory/dist/resolve-root.js +22 -0
  223. package/packages/memory/dist/search.d.ts +2 -0
  224. package/packages/memory/dist/search.js +29 -0
  225. package/packages/memory/dist/status.d.ts +7 -0
  226. package/packages/memory/dist/status.js +46 -0
  227. package/packages/memory/dist/tokens.d.ts +2 -0
  228. package/packages/memory/dist/tokens.js +71 -0
  229. package/packages/memory/dist/types.d.ts +155 -0
  230. package/packages/memory/dist/types.js +1 -0
  231. package/packages/memory/dist/write.d.ts +9 -0
  232. package/packages/memory/dist/write.js +76 -0
@@ -0,0 +1,74 @@
1
+ import { resolveAgentId } from "@poe-code/agent-defs";
2
+ const agentMcpConfigs = {
3
+ "claude-code": {
4
+ configFile: "~/.claude.json",
5
+ configKey: "mcpServers",
6
+ format: "json",
7
+ shape: "standard"
8
+ },
9
+ "claude-desktop": {
10
+ configFile: (platform) => {
11
+ switch (platform) {
12
+ case "darwin":
13
+ return "~/Library/Application Support/Claude/claude_desktop_config.json";
14
+ case "win32":
15
+ return "~/AppData/Roaming/Claude/claude_desktop_config.json";
16
+ default:
17
+ return "~/.config/Claude/claude_desktop_config.json";
18
+ }
19
+ },
20
+ configKey: "mcpServers",
21
+ format: "json",
22
+ shape: "standard",
23
+ mcpOutputFormat: "markdown_instructions"
24
+ },
25
+ codex: {
26
+ configFile: "~/.codex/config.toml",
27
+ configKey: "mcp_servers",
28
+ format: "toml",
29
+ shape: "standard"
30
+ },
31
+ opencode: {
32
+ configFile: "~/.config/opencode/opencode.json",
33
+ configKey: "mcp",
34
+ format: "json",
35
+ shape: "opencode"
36
+ },
37
+ kimi: {
38
+ configFile: "~/.kimi/mcp.json",
39
+ configKey: "mcpServers",
40
+ format: "json",
41
+ shape: "standard"
42
+ },
43
+ goose: {
44
+ configFile: "~/.config/goose/config.yaml",
45
+ configKey: "extensions",
46
+ format: "yaml",
47
+ shape: "goose"
48
+ }
49
+ };
50
+ export const supportedAgents = Object.keys(agentMcpConfigs);
51
+ export function resolveAgentSupport(input, registry = agentMcpConfigs) {
52
+ const resolvedId = resolveAgentId(input);
53
+ if (!resolvedId) {
54
+ return { status: "unknown", input };
55
+ }
56
+ const config = registry[resolvedId];
57
+ if (!config) {
58
+ return { status: "unsupported", input, id: resolvedId };
59
+ }
60
+ return { status: "supported", input, id: resolvedId, config };
61
+ }
62
+ export function isSupported(agentId) {
63
+ return resolveAgentSupport(agentId).status === "supported";
64
+ }
65
+ export function getAgentConfig(agentId) {
66
+ const support = resolveAgentSupport(agentId);
67
+ return support.status === "supported" ? support.config : undefined;
68
+ }
69
+ export function resolveConfigPath(config, platform) {
70
+ if (typeof config.configFile === "function") {
71
+ return config.configFile(platform);
72
+ }
73
+ return config.configFile;
74
+ }
@@ -0,0 +1,3 @@
1
+ export type { McpStdioServer, McpHttpServer, McpServerConfig, McpServerEntry, ApplyOptions } from "./types.js";
2
+ export { supportedAgents, isSupported, resolveAgentSupport } from "./configs.js";
3
+ export { configure, unconfigure, UnsupportedAgentError } from "./apply.js";
@@ -0,0 +1,2 @@
1
+ export { supportedAgents, isSupported, resolveAgentSupport } from "./configs.js";
2
+ export { configure, unconfigure, UnsupportedAgentError } from "./apply.js";
@@ -0,0 +1,31 @@
1
+ import type { McpServerEntry } from "./types.js";
2
+ export type ShapeName = "standard" | "opencode" | "goose";
3
+ export interface StandardShapeOutput {
4
+ command: string;
5
+ args?: string[];
6
+ env?: Record<string, string>;
7
+ }
8
+ export interface OpencodeShapeOutput {
9
+ type: "local";
10
+ command: string[];
11
+ env?: Record<string, string>;
12
+ enabled: boolean;
13
+ }
14
+ export interface GooseStdioShapeOutput {
15
+ type: "stdio";
16
+ cmd: string;
17
+ args?: string[];
18
+ envs?: Record<string, string>;
19
+ }
20
+ export interface GooseHttpShapeOutput {
21
+ type: "http";
22
+ url: string;
23
+ headers?: Record<string, string>;
24
+ }
25
+ export type GooseShapeOutput = GooseStdioShapeOutput | GooseHttpShapeOutput;
26
+ export type ShapeOutput = StandardShapeOutput | OpencodeShapeOutput | GooseShapeOutput;
27
+ export type ShapeTransformer = (entry: McpServerEntry) => ShapeOutput | undefined;
28
+ export declare function standardShape(entry: McpServerEntry): ShapeOutput | undefined;
29
+ export declare function opencodeShape(entry: McpServerEntry): OpencodeShapeOutput;
30
+ export declare function gooseShape(entry: McpServerEntry): GooseShapeOutput | undefined;
31
+ export declare function getShapeTransformer(shape: ShapeName): ShapeTransformer;
@@ -0,0 +1,87 @@
1
+ function transformStdioServer(config, enabled) {
2
+ if (!enabled) {
3
+ return undefined;
4
+ }
5
+ const result = {
6
+ command: config.command
7
+ };
8
+ if (config.args && config.args.length > 0) {
9
+ result.args = config.args;
10
+ }
11
+ if (config.env && Object.keys(config.env).length > 0) {
12
+ result.env = config.env;
13
+ }
14
+ return result;
15
+ }
16
+ export function standardShape(entry) {
17
+ const enabled = entry.enabled !== false;
18
+ if (entry.config.transport === "stdio") {
19
+ return transformStdioServer(entry.config, enabled);
20
+ }
21
+ if (!enabled) {
22
+ return undefined;
23
+ }
24
+ return {
25
+ command: entry.config.url
26
+ };
27
+ }
28
+ function transformStdioServerOpencode(config, enabled) {
29
+ const command = config.args && config.args.length > 0
30
+ ? [config.command, ...config.args]
31
+ : [config.command];
32
+ const result = {
33
+ type: "local",
34
+ command,
35
+ enabled
36
+ };
37
+ if (config.env && Object.keys(config.env).length > 0) {
38
+ result.env = config.env;
39
+ }
40
+ return result;
41
+ }
42
+ export function opencodeShape(entry) {
43
+ const enabled = entry.enabled !== false;
44
+ if (entry.config.transport === "stdio") {
45
+ return transformStdioServerOpencode(entry.config, enabled);
46
+ }
47
+ return {
48
+ type: "local",
49
+ command: [entry.config.url],
50
+ enabled
51
+ };
52
+ }
53
+ export function gooseShape(entry) {
54
+ const enabled = entry.enabled !== false;
55
+ if (!enabled) {
56
+ return undefined;
57
+ }
58
+ if (entry.config.transport === "stdio") {
59
+ const result = {
60
+ type: "stdio",
61
+ cmd: entry.config.command
62
+ };
63
+ if (entry.config.args && entry.config.args.length > 0) {
64
+ result.args = entry.config.args;
65
+ }
66
+ if (entry.config.env && Object.keys(entry.config.env).length > 0) {
67
+ result.envs = entry.config.env;
68
+ }
69
+ return result;
70
+ }
71
+ const result = {
72
+ type: "http",
73
+ url: entry.config.url
74
+ };
75
+ if (entry.config.headers && Object.keys(entry.config.headers).length > 0) {
76
+ result.headers = entry.config.headers;
77
+ }
78
+ return result;
79
+ }
80
+ const shapeTransformers = {
81
+ standard: standardShape,
82
+ opencode: opencodeShape,
83
+ goose: gooseShape
84
+ };
85
+ export function getShapeTransformer(shape) {
86
+ return shapeTransformers[shape];
87
+ }
@@ -0,0 +1,25 @@
1
+ import type { FileSystem, MutationObservers } from "../../config-mutations/dist/index.js";
2
+ export interface McpStdioServer {
3
+ transport: "stdio";
4
+ command: string;
5
+ args?: string[];
6
+ env?: Record<string, string>;
7
+ }
8
+ export interface McpHttpServer {
9
+ transport: "http";
10
+ url: string;
11
+ headers?: Record<string, string>;
12
+ }
13
+ export type McpServerConfig = McpStdioServer | McpHttpServer;
14
+ export interface McpServerEntry {
15
+ name: string;
16
+ config: McpServerConfig;
17
+ enabled?: boolean;
18
+ }
19
+ export interface ApplyOptions {
20
+ fs: FileSystem;
21
+ homeDir: string;
22
+ platform: "darwin" | "linux" | "win32";
23
+ dryRun?: boolean;
24
+ observers?: MutationObservers;
25
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,25 @@
1
+ import type { ApplyOptions, SkillFile } from "./types.js";
2
+ export declare class UnsupportedAgentError extends Error {
3
+ constructor(agentId: string);
4
+ }
5
+ export declare function configure(agentId: string, options: ApplyOptions): Promise<void>;
6
+ export declare function unconfigure(agentId: string, options: ApplyOptions & {
7
+ force?: boolean;
8
+ }): Promise<void>;
9
+ export type InstallSkillOptions = {
10
+ fs: ApplyOptions["fs"];
11
+ cwd: string;
12
+ homeDir: string;
13
+ scope: ApplyOptions["scope"];
14
+ dryRun?: boolean;
15
+ observers?: ApplyOptions["observers"];
16
+ };
17
+ export type InstallSkillResult = {
18
+ skillPath: string;
19
+ displayPath: string;
20
+ };
21
+ /**
22
+ * Install a skill for an agent.
23
+ * Creates folder structure: skillDir/<skill.name>/SKILL.md
24
+ */
25
+ export declare function installSkill(agentId: string, skill: SkillFile, options: InstallSkillOptions): Promise<InstallSkillResult>;
@@ -0,0 +1,109 @@
1
+ import { fileMutation, runMutations, templateMutation } from "@poe-code/config-mutations";
2
+ import { resolveAgentSupport } from "./configs.js";
3
+ import { createTemplateLoader } from "./templates.js";
4
+ export class UnsupportedAgentError extends Error {
5
+ constructor(agentId) {
6
+ super(`Unsupported agent: ${agentId}`);
7
+ this.name = "UnsupportedAgentError";
8
+ }
9
+ }
10
+ function toHomeRelative(localSkillDir) {
11
+ if (localSkillDir.startsWith("~/") || localSkillDir === "~") {
12
+ return localSkillDir;
13
+ }
14
+ const normalized = localSkillDir.startsWith("./")
15
+ ? localSkillDir.slice(2)
16
+ : localSkillDir;
17
+ return `~/${normalized}`;
18
+ }
19
+ const bundledSkillTemplateIds = ["poe-generate.md"];
20
+ export async function configure(agentId, options) {
21
+ const support = resolveAgentSupport(agentId);
22
+ if (support.status !== "supported") {
23
+ throw new UnsupportedAgentError(agentId);
24
+ }
25
+ const scope = options.scope ?? "global";
26
+ const config = support.config;
27
+ const skillDir = scope === "global" ? config.globalSkillDir : toHomeRelative(config.localSkillDir);
28
+ const homeDir = scope === "global" ? options.homeDir : options.cwd;
29
+ await runMutations([
30
+ fileMutation.ensureDirectory({
31
+ path: skillDir,
32
+ label: `Ensure directory ${skillDir}`
33
+ }),
34
+ ...bundledSkillTemplateIds.map((templateId) => templateMutation.write({
35
+ target: `${skillDir}/${templateId}`,
36
+ templateId,
37
+ label: `Write bundled skill ${templateId} to ${skillDir}`
38
+ }))
39
+ ], {
40
+ fs: options.fs,
41
+ homeDir,
42
+ dryRun: options.dryRun,
43
+ observers: options.observers,
44
+ templates: createTemplateLoader()
45
+ });
46
+ }
47
+ export async function unconfigure(agentId, options) {
48
+ const support = resolveAgentSupport(agentId);
49
+ if (support.status !== "supported") {
50
+ throw new UnsupportedAgentError(agentId);
51
+ }
52
+ const scope = options.scope ?? "global";
53
+ const config = support.config;
54
+ const skillDir = scope === "global" ? config.globalSkillDir : toHomeRelative(config.localSkillDir);
55
+ const homeDir = scope === "global" ? options.homeDir : options.cwd;
56
+ await runMutations([
57
+ fileMutation.removeDirectory({
58
+ path: skillDir,
59
+ force: options.force,
60
+ label: `Remove skills directory ${skillDir}`
61
+ })
62
+ ], {
63
+ fs: options.fs,
64
+ homeDir,
65
+ dryRun: options.dryRun,
66
+ observers: options.observers
67
+ });
68
+ }
69
+ const SKILL_TEMPLATE_ID = "__skill_content__";
70
+ /**
71
+ * Install a skill for an agent.
72
+ * Creates folder structure: skillDir/<skill.name>/SKILL.md
73
+ */
74
+ export async function installSkill(agentId, skill, options) {
75
+ const support = resolveAgentSupport(agentId);
76
+ if (support.status !== "supported") {
77
+ throw new UnsupportedAgentError(agentId);
78
+ }
79
+ const scope = options.scope ?? "local";
80
+ const config = support.config;
81
+ // Use home-relative paths for mutations (same pattern as configure/unconfigure)
82
+ const skillDir = scope === "global" ? config.globalSkillDir : toHomeRelative(config.localSkillDir);
83
+ const skillFolderPath = `${skillDir}/${skill.name}`;
84
+ const skillFilePath = `${skillFolderPath}/SKILL.md`;
85
+ const displayPath = `${scope === "global" ? config.globalSkillDir : config.localSkillDir}/${skill.name}/SKILL.md`;
86
+ await runMutations([
87
+ fileMutation.ensureDirectory({
88
+ path: skillFolderPath,
89
+ label: `Ensure skill directory ${skill.name}`
90
+ }),
91
+ templateMutation.write({
92
+ target: skillFilePath,
93
+ templateId: SKILL_TEMPLATE_ID,
94
+ label: `Write skill ${skill.name}`
95
+ })
96
+ ], {
97
+ fs: options.fs,
98
+ homeDir: scope === "global" ? options.homeDir : options.cwd,
99
+ dryRun: options.dryRun,
100
+ observers: options.observers,
101
+ templates: async (templateId) => {
102
+ if (templateId === SKILL_TEMPLATE_ID) {
103
+ return skill.content;
104
+ }
105
+ throw new Error(`Unknown template: ${templateId}`);
106
+ }
107
+ });
108
+ return { skillPath: skillFilePath, displayPath };
109
+ }
@@ -0,0 +1,16 @@
1
+ export interface AgentSkillConfig {
2
+ globalSkillDir: string;
3
+ localSkillDir: string;
4
+ }
5
+ export type SkillScope = "global" | "local";
6
+ export declare const supportedAgents: readonly string[];
7
+ export type AgentSupportStatus = "supported" | "unsupported" | "unknown";
8
+ export interface AgentSupportResult {
9
+ status: AgentSupportStatus;
10
+ input: string;
11
+ id?: string;
12
+ config?: AgentSkillConfig;
13
+ }
14
+ export declare function resolveAgentSupport(input: string, registry?: Record<string, AgentSkillConfig>): AgentSupportResult;
15
+ export declare function getAgentConfig(agentId: string): AgentSkillConfig | undefined;
16
+ export declare function resolveSkillDir(config: AgentSkillConfig, scope: SkillScope, cwd: string): string;
@@ -0,0 +1,66 @@
1
+ import os from "node:os";
2
+ import path from "node:path";
3
+ import { resolveAgentId } from "@poe-code/agent-defs";
4
+ const agentSkillConfigs = {
5
+ "claude-code": {
6
+ globalSkillDir: "~/.claude/skills",
7
+ localSkillDir: ".claude/skills"
8
+ },
9
+ codex: {
10
+ globalSkillDir: "~/.codex/skills",
11
+ localSkillDir: ".codex/skills"
12
+ },
13
+ opencode: {
14
+ globalSkillDir: "~/.config/opencode/skills",
15
+ localSkillDir: ".opencode/skills"
16
+ },
17
+ goose: {
18
+ globalSkillDir: "~/.agents/skills",
19
+ localSkillDir: ".agents/skills"
20
+ }
21
+ };
22
+ export const supportedAgents = Object.keys(agentSkillConfigs);
23
+ export function resolveAgentSupport(input, registry = agentSkillConfigs) {
24
+ const resolvedId = resolveAgentId(input);
25
+ if (!resolvedId) {
26
+ return { status: "unknown", input };
27
+ }
28
+ const config = registry[resolvedId];
29
+ if (!config) {
30
+ return { status: "unsupported", input, id: resolvedId };
31
+ }
32
+ return { status: "supported", input, id: resolvedId, config };
33
+ }
34
+ export function getAgentConfig(agentId) {
35
+ const support = resolveAgentSupport(agentId);
36
+ return support.status === "supported" ? support.config : undefined;
37
+ }
38
+ function expandHome(targetPath) {
39
+ if (!targetPath?.startsWith("~")) {
40
+ return targetPath;
41
+ }
42
+ if (targetPath === "~") {
43
+ return os.homedir();
44
+ }
45
+ // Handle ~./ -> ~/.
46
+ if (targetPath.startsWith("~./")) {
47
+ targetPath = `~/.${targetPath.slice(3)}`;
48
+ }
49
+ let remainder = targetPath.slice(1);
50
+ if (remainder.startsWith("/") || remainder.startsWith("\\")) {
51
+ remainder = remainder.slice(1);
52
+ }
53
+ else if (remainder.startsWith(".")) {
54
+ remainder = remainder.slice(1);
55
+ if (remainder.startsWith("/") || remainder.startsWith("\\")) {
56
+ remainder = remainder.slice(1);
57
+ }
58
+ }
59
+ return remainder.length === 0 ? os.homedir() : path.join(os.homedir(), remainder);
60
+ }
61
+ export function resolveSkillDir(config, scope, cwd) {
62
+ if (scope === "global") {
63
+ return path.resolve(expandHome(config.globalSkillDir));
64
+ }
65
+ return path.resolve(cwd, config.localSkillDir);
66
+ }
@@ -0,0 +1,5 @@
1
+ export type { AgentSkillConfig, AgentSupportResult, AgentSupportStatus, SkillScope } from "./configs.js";
2
+ export type { ApplyOptions, SkillFile } from "./types.js";
3
+ export { supportedAgents, resolveAgentSupport, getAgentConfig, resolveSkillDir } from "./configs.js";
4
+ export { configure, unconfigure, installSkill, UnsupportedAgentError } from "./apply.js";
5
+ export type { InstallSkillOptions, InstallSkillResult } from "./apply.js";
@@ -0,0 +1,2 @@
1
+ export { supportedAgents, resolveAgentSupport, getAgentConfig, resolveSkillDir } from "./configs.js";
2
+ export { configure, unconfigure, installSkill, UnsupportedAgentError } from "./apply.js";
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: poe-generate
3
+ description: 'Poe code generation skill'
4
+ ---
5
+
6
+ # poe-code generate
7
+
8
+ Use `poe-code generate` to create text, images, audio, or video via the Poe API.
9
+
10
+ ## Text generation
11
+
12
+ ```bash
13
+ poe-code generate "Write a short function that parses a JSON string safely."
14
+ ```
15
+
16
+ Specify the model/bot:
17
+
18
+ ```bash
19
+ # CLI option
20
+ poe-code generate --model "gpt-4.1" "Summarize this codebase change."
21
+
22
+ # Some agent runtimes call the model selector `--bot`
23
+ poe-code generate --bot "gpt-4.1" "Summarize this codebase change."
24
+ ```
25
+
26
+ ## Media generation
27
+
28
+ The CLI supports media generation as subcommands:
29
+
30
+ ```bash
31
+ poe-code generate image "A 3D render of a rubber duck wearing sunglasses" --model "gpt-image-1" -o duck.png
32
+ poe-code generate video "A cinematic timelapse of a city at night" --model "veo" -o city.mp4
33
+ poe-code generate audio "A calm 10 second lo-fi beat" --model "audio-model" -o beat.wav
34
+ ```
35
+
36
+ Some agent runtimes expose the same media types as flags. If available, these are equivalent:
37
+
38
+ ```bash
39
+ poe-code generate --image "A 3D render of a rubber duck wearing sunglasses" --bot "gpt-image-1" -o duck.png
40
+ poe-code generate --video "A cinematic timelapse of a city at night" --bot "veo" -o city.mp4
41
+ poe-code generate --audio "A calm 10 second lo-fi beat" --bot "audio-model" -o beat.wav
42
+ ```
43
+
44
+ ## Tips
45
+
46
+ - Use `--param key=value` to pass provider/model parameters (repeatable).
47
+ - Use `--output <path>` (or `-o`) for media outputs.
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: terminal-pilot
3
+ description: 'Terminal automation skill using the terminal-pilot CLI'
4
+ ---
5
+
6
+ # Terminal Pilot
7
+
8
+ Use the `terminal-pilot` CLI when you need to automate or inspect interactive
9
+ CLI applications through a real PTY session.
10
+
11
+ ## Commands
12
+
13
+ - `terminal-pilot create-session` - start a PTY-backed command
14
+ - `terminal-pilot fill` - paste text into a session
15
+ - `terminal-pilot type` - type character-by-character for TUIs and readline
16
+ - `terminal-pilot press-key` - send named keys such as `Enter` or `ArrowDown`
17
+ - `terminal-pilot wait-for` - wait for terminal output to match a pattern
18
+ - `terminal-pilot wait-for-exit` - block until a session exits
19
+ - `terminal-pilot read-screen` - inspect the current visible terminal screen
20
+ - `terminal-pilot read-history` - read scrollback output
21
+ - `terminal-pilot list-sessions` - list active sessions
22
+ - `terminal-pilot close-session` - close a session and return its exit code
23
+
24
+ ## Examples
25
+
26
+ ```bash
27
+ terminal-pilot --help
28
+ terminal-pilot create-session --help
29
+ terminal-pilot read-screen --help
30
+ ```
31
+
32
+ Use JSON output when another tool or script needs to read the result:
33
+
34
+ ```bash
35
+ terminal-pilot list-sessions --output json
36
+ terminal-pilot read-screen --session s1 --output json
37
+ ```
38
+
39
+ ## Tips
40
+
41
+ - Use `fill` for pasted text and multi-line input.
42
+ - Use `type` when the app reacts to individual keystrokes.
43
+ - Use `press-key` for Enter, Tab, arrow keys, Escape, and control-key chords.
44
+ - Use `wait-for --literal` for exact string matching.
45
+ - Default terminal size is 120x40.
@@ -0,0 +1,3 @@
1
+ import type { TemplateLoader } from "../../config-mutations/dist/index.js";
2
+ export declare function loadTemplate(templateId: string): Promise<string>;
3
+ export declare function createTemplateLoader(): TemplateLoader;
@@ -0,0 +1,63 @@
1
+ import { readFile, stat } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ const TEMPLATE_IDS = ["poe-generate.md", "terminal-pilot.md"];
5
+ const cache = new Map();
6
+ async function pathExists(target) {
7
+ try {
8
+ await stat(target);
9
+ return true;
10
+ }
11
+ catch (error) {
12
+ if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") {
13
+ return false;
14
+ }
15
+ throw error;
16
+ }
17
+ }
18
+ async function findPackageRoot(entryFilePath) {
19
+ let current = path.dirname(entryFilePath);
20
+ while (true) {
21
+ if (await pathExists(path.join(current, "package.json"))) {
22
+ return current;
23
+ }
24
+ const parent = path.dirname(current);
25
+ if (parent === current) {
26
+ throw new Error("Unable to locate package root for agent-skill-config templates.");
27
+ }
28
+ current = parent;
29
+ }
30
+ }
31
+ async function resolveTemplatePath(templateId) {
32
+ const packageRoot = await findPackageRoot(fileURLToPath(import.meta.url));
33
+ const candidates = [
34
+ path.join(packageRoot, "src", "templates", templateId),
35
+ path.join(packageRoot, "dist", "templates", templateId),
36
+ path.join(packageRoot, "dist", "templates", "skill", templateId)
37
+ ];
38
+ for (const candidate of candidates) {
39
+ if (await pathExists(candidate)) {
40
+ return candidate;
41
+ }
42
+ }
43
+ throw new Error(`Template not found: ${templateId}`);
44
+ }
45
+ function isKnownTemplate(templateId) {
46
+ return TEMPLATE_IDS.includes(templateId);
47
+ }
48
+ export async function loadTemplate(templateId) {
49
+ if (!isKnownTemplate(templateId)) {
50
+ throw new Error(`Template not found: ${templateId}`);
51
+ }
52
+ const cached = cache.get(templateId);
53
+ if (cached !== undefined) {
54
+ return cached;
55
+ }
56
+ const resolved = await resolveTemplatePath(templateId);
57
+ const content = await readFile(resolved, "utf8");
58
+ cache.set(templateId, content);
59
+ return content;
60
+ }
61
+ export function createTemplateLoader() {
62
+ return loadTemplate;
63
+ }
@@ -0,0 +1,16 @@
1
+ import type { FileSystem, MutationObservers } from "../../config-mutations/dist/index.js";
2
+ import type { SkillScope } from "./configs.js";
3
+ export interface ApplyOptions {
4
+ fs: FileSystem;
5
+ homeDir: string;
6
+ cwd: string;
7
+ scope?: SkillScope;
8
+ dryRun?: boolean;
9
+ observers?: MutationObservers;
10
+ }
11
+ export interface SkillFile {
12
+ /** Skill folder name */
13
+ name: string;
14
+ /** Content to write to SKILL.md */
15
+ content: string;
16
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1276,8 +1276,13 @@ function createOption(field) {
1276
1276
  if (collidesWithGlobalFlag) {
1277
1277
  return [createCommanderOption(flags, field.description, field)];
1278
1278
  }
1279
+ const mainOption = createCommanderOption(`${flags} [value]`, field.description, field);
1280
+ mainOption.preset(true);
1281
+ mainOption.argParser(
1282
+ (value) => typeof value === "boolean" ? value : parseBooleanText(value, field.displayPath)
1283
+ );
1279
1284
  return [
1280
- createCommanderOption(flags, field.description, field),
1285
+ mainOption,
1281
1286
  createCommanderOption(`--no-${field.optionFlag.slice(2)}`, field.description, field)
1282
1287
  ];
1283
1288
  }
@@ -1395,7 +1400,7 @@ function formatHelpFieldFlags(field) {
1395
1400
  return formatPositionalToken(field);
1396
1401
  }
1397
1402
  if (field.schema.kind === "boolean") {
1398
- return formatOptionFlags(field);
1403
+ return `${formatOptionFlags(field)} [value]`;
1399
1404
  }
1400
1405
  return `${formatOptionFlags(field)} <${describeSchemaType(field.schema)}>`;
1401
1406
  }