@introspection-ai/recipes 0.50.0 → 0.52.0

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 (249) hide show
  1. package/README.md +3 -3
  2. package/dist/api/api-bindings.d.ts +3 -0
  3. package/dist/api/api-bindings.d.ts.map +1 -0
  4. package/dist/api/api-bindings.js +2 -0
  5. package/dist/api/api-bindings.js.map +1 -0
  6. package/dist/api/session.d.ts +1 -0
  7. package/dist/api/session.d.ts.map +1 -1
  8. package/dist/api-bindings.d.ts +101 -0
  9. package/dist/api-bindings.d.ts.map +1 -0
  10. package/dist/api-bindings.js +406 -0
  11. package/dist/api-bindings.js.map +1 -0
  12. package/dist/channels/arguments.d.ts +116 -0
  13. package/dist/channels/arguments.d.ts.map +1 -0
  14. package/dist/channels/arguments.generated.d.ts +15 -0
  15. package/dist/channels/arguments.generated.d.ts.map +1 -0
  16. package/dist/channels/arguments.generated.js +181 -0
  17. package/dist/channels/arguments.generated.js.map +1 -0
  18. package/dist/channels/arguments.js +8 -0
  19. package/dist/channels/arguments.js.map +1 -0
  20. package/dist/channels/module.d.ts +5 -0
  21. package/dist/channels/module.d.ts.map +1 -1
  22. package/dist/channels/module.js +10 -5
  23. package/dist/channels/module.js.map +1 -1
  24. package/dist/channels/tools.d.ts.map +1 -1
  25. package/dist/channels/tools.js +22 -59
  26. package/dist/channels/tools.js.map +1 -1
  27. package/dist/channels/types.d.ts +5 -0
  28. package/dist/channels/types.d.ts.map +1 -1
  29. package/dist/child/session.d.ts +5 -0
  30. package/dist/child/session.d.ts.map +1 -1
  31. package/dist/child/session.js +2 -0
  32. package/dist/child/session.js.map +1 -1
  33. package/dist/clock.d.ts +80 -0
  34. package/dist/clock.d.ts.map +1 -0
  35. package/dist/clock.js +169 -0
  36. package/dist/clock.js.map +1 -0
  37. package/dist/command-parameters.d.ts +37 -5
  38. package/dist/command-parameters.d.ts.map +1 -1
  39. package/dist/command-parameters.js +73 -11
  40. package/dist/command-parameters.js.map +1 -1
  41. package/dist/connector-tools.d.ts +18 -0
  42. package/dist/connector-tools.d.ts.map +1 -1
  43. package/dist/connector-tools.js +49 -6
  44. package/dist/connector-tools.js.map +1 -1
  45. package/dist/documents/module.d.ts.map +1 -1
  46. package/dist/documents/module.js +1 -3
  47. package/dist/documents/module.js.map +1 -1
  48. package/dist/documents/tools.d.ts.map +1 -1
  49. package/dist/documents/tools.js +3 -3
  50. package/dist/documents/tools.js.map +1 -1
  51. package/dist/egress.d.ts +23 -0
  52. package/dist/egress.d.ts.map +1 -0
  53. package/dist/egress.js +36 -0
  54. package/dist/egress.js.map +1 -0
  55. package/dist/issues/index.d.ts +7 -0
  56. package/dist/issues/index.d.ts.map +1 -0
  57. package/dist/issues/index.js +4 -0
  58. package/dist/issues/index.js.map +1 -0
  59. package/dist/issues/module.d.ts +38 -0
  60. package/dist/issues/module.d.ts.map +1 -0
  61. package/dist/issues/module.js +114 -0
  62. package/dist/issues/module.js.map +1 -0
  63. package/dist/issues/tool.d.ts +95 -0
  64. package/dist/issues/tool.d.ts.map +1 -0
  65. package/dist/issues/tool.js +479 -0
  66. package/dist/issues/tool.js.map +1 -0
  67. package/dist/issues/types.d.ts +280 -0
  68. package/dist/issues/types.d.ts.map +1 -0
  69. package/dist/issues/types.js +79 -0
  70. package/dist/issues/types.js.map +1 -0
  71. package/dist/mcp/cli/command-context.d.ts +20 -1
  72. package/dist/mcp/cli/command-context.d.ts.map +1 -1
  73. package/dist/mcp/cli/command-context.js.map +1 -1
  74. package/dist/mcp/cli/core.d.ts +0 -2
  75. package/dist/mcp/cli/core.d.ts.map +1 -1
  76. package/dist/mcp/cli/core.js +9 -33
  77. package/dist/mcp/cli/core.js.map +1 -1
  78. package/dist/mcp/cli/handshake-retry.d.ts +5 -0
  79. package/dist/mcp/cli/handshake-retry.d.ts.map +1 -0
  80. package/dist/mcp/cli/handshake-retry.js +32 -0
  81. package/dist/mcp/cli/handshake-retry.js.map +1 -0
  82. package/dist/mcp/daemon/index.js +3 -4
  83. package/dist/mcp/daemon/index.js.map +1 -1
  84. package/dist/mcp/pi-client.d.ts +2 -0
  85. package/dist/mcp/pi-client.d.ts.map +1 -1
  86. package/dist/mcp/pi-client.js +5 -1
  87. package/dist/mcp/pi-client.js.map +1 -1
  88. package/dist/mcp/pi-mcp-runtime.d.ts +25 -0
  89. package/dist/mcp/pi-mcp-runtime.d.ts.map +1 -0
  90. package/dist/mcp/pi-mcp-runtime.js +215 -0
  91. package/dist/mcp/pi-mcp-runtime.js.map +1 -0
  92. package/dist/mcp/pi-runtime.d.ts +7 -0
  93. package/dist/mcp/pi-runtime.d.ts.map +1 -0
  94. package/dist/mcp/pi-runtime.js +26 -0
  95. package/dist/mcp/pi-runtime.js.map +1 -0
  96. package/dist/mcp-chunks/chunk-3UVHZECT.js +31 -0
  97. package/dist/mcp-chunks/{chunk-PO2SOBEN.js → chunk-CGJ2XOSF.js} +43 -35
  98. package/dist/mcp-chunks/{chunk-GTETFUPQ.js → chunk-IMG2JMBS.js} +8 -8
  99. package/dist/mcp-chunks/{chunk-UFV6SVQG.js → chunk-LQKMNWDE.js} +2 -2
  100. package/dist/mcp-chunks/{chunk-S2F7DDP5.js → chunk-QUDOU7MQ.js} +1 -1
  101. package/dist/mcp-chunks/{cli-IYD7Y7MO.js → cli-BM23ZXPJ.js} +54 -54
  102. package/dist/mcp-chunks/{client-5MNBV3Z7.js → client-RKTAKDAY.js} +7 -7
  103. package/dist/mcp-chunks/{daemon-command-V3B3EMXD.js → daemon-command-VU6WTFCJ.js} +8 -8
  104. package/dist/mcp-chunks/{generate-cli-runner-PW5WJ7KI.js → generate-cli-runner-JAAPSWGX.js} +12 -12
  105. package/dist/mcp-chunks/{generated-daemon-runtime-3C4NWGAU.js → generated-daemon-runtime-LX4L2X7Z.js} +8 -8
  106. package/dist/mcp-chunks/pi-mcp-runtime-GHDEPXUL.js +1231 -0
  107. package/dist/mcp-chunks/{runtime-RMI3XCYJ.js → runtime-T63YI7TC.js} +6 -6
  108. package/dist/mcp-chunks/{serve-command-UF5SVREV.js → serve-command-75P4VBJ6.js} +7 -7
  109. package/dist/mcp-daemon.js +21 -19
  110. package/dist/mcp-run-worker.js +11 -10
  111. package/dist/pi-extension.d.ts +3 -0
  112. package/dist/pi-extension.d.ts.map +1 -1
  113. package/dist/pi-extension.js +82 -18
  114. package/dist/pi-extension.js.map +1 -1
  115. package/dist/productivity/arguments.d.ts +298 -0
  116. package/dist/productivity/arguments.d.ts.map +1 -0
  117. package/dist/productivity/arguments.generated.d.ts +28 -0
  118. package/dist/productivity/arguments.generated.d.ts.map +1 -0
  119. package/dist/productivity/arguments.generated.js +489 -0
  120. package/dist/productivity/arguments.generated.js.map +1 -0
  121. package/dist/productivity/arguments.js +10 -0
  122. package/dist/productivity/arguments.js.map +1 -0
  123. package/dist/productivity/http.d.ts.map +1 -1
  124. package/dist/productivity/http.js +12 -22
  125. package/dist/productivity/http.js.map +1 -1
  126. package/dist/productivity/index.d.ts +1 -1
  127. package/dist/productivity/index.d.ts.map +1 -1
  128. package/dist/productivity/index.js +1 -1
  129. package/dist/productivity/index.js.map +1 -1
  130. package/dist/productivity/module.d.ts +15 -2
  131. package/dist/productivity/module.d.ts.map +1 -1
  132. package/dist/productivity/module.js +24 -21
  133. package/dist/productivity/module.js.map +1 -1
  134. package/dist/productivity/tools.d.ts +6 -0
  135. package/dist/productivity/tools.d.ts.map +1 -1
  136. package/dist/productivity/tools.js +64 -224
  137. package/dist/productivity/tools.js.map +1 -1
  138. package/dist/productivity/types.d.ts +2 -0
  139. package/dist/productivity/types.d.ts.map +1 -1
  140. package/dist/productivity/types.js.map +1 -1
  141. package/dist/recipe/agent.d.ts +40 -10
  142. package/dist/recipe/agent.d.ts.map +1 -1
  143. package/dist/recipe/agent.js +209 -30
  144. package/dist/recipe/agent.js.map +1 -1
  145. package/dist/recipe/companions.d.ts +2 -1
  146. package/dist/recipe/companions.d.ts.map +1 -1
  147. package/dist/recipe/companions.js +11 -9
  148. package/dist/recipe/companions.js.map +1 -1
  149. package/dist/recipe/manifest.generated.d.ts +4 -1
  150. package/dist/recipe/manifest.generated.d.ts.map +1 -1
  151. package/dist/recipe/manifest.generated.js +5 -2
  152. package/dist/recipe/manifest.generated.js.map +1 -1
  153. package/dist/recipe/package.d.ts +28 -3
  154. package/dist/recipe/package.d.ts.map +1 -1
  155. package/dist/recipe/package.js +155 -1
  156. package/dist/recipe/package.js.map +1 -1
  157. package/dist/recipe/providers.d.ts +62 -0
  158. package/dist/recipe/providers.d.ts.map +1 -0
  159. package/dist/recipe/providers.js +95 -0
  160. package/dist/recipe/providers.js.map +1 -0
  161. package/dist/recipe/resolve.d.ts +7 -3
  162. package/dist/recipe/resolve.d.ts.map +1 -1
  163. package/dist/recipe/resolve.js +7 -2
  164. package/dist/recipe/resolve.js.map +1 -1
  165. package/dist/run-controller.d.ts +6 -0
  166. package/dist/run-controller.d.ts.map +1 -1
  167. package/dist/run-controller.js +2 -0
  168. package/dist/run-controller.js.map +1 -1
  169. package/dist/search/egress.d.ts +12 -0
  170. package/dist/search/egress.d.ts.map +1 -0
  171. package/dist/search/egress.js +24 -0
  172. package/dist/search/egress.js.map +1 -0
  173. package/dist/search/http.d.ts +16 -0
  174. package/dist/search/http.d.ts.map +1 -0
  175. package/dist/search/http.js +75 -0
  176. package/dist/search/http.js.map +1 -0
  177. package/dist/search/index.d.ts +10 -0
  178. package/dist/search/index.d.ts.map +1 -0
  179. package/dist/search/index.js +5 -0
  180. package/dist/search/index.js.map +1 -0
  181. package/dist/search/mcp.d.ts +58 -0
  182. package/dist/search/mcp.d.ts.map +1 -0
  183. package/dist/search/mcp.js +84 -0
  184. package/dist/search/mcp.js.map +1 -0
  185. package/dist/search/module.d.ts +28 -0
  186. package/dist/search/module.d.ts.map +1 -0
  187. package/dist/search/module.js +49 -0
  188. package/dist/search/module.js.map +1 -0
  189. package/dist/search/tool.d.ts +101 -0
  190. package/dist/search/tool.d.ts.map +1 -0
  191. package/dist/search/tool.js +518 -0
  192. package/dist/search/tool.js.map +1 -0
  193. package/dist/search/types.d.ts +257 -0
  194. package/dist/search/types.d.ts.map +1 -0
  195. package/dist/search/types.js +63 -0
  196. package/dist/search/types.js.map +1 -0
  197. package/dist/session.d.ts +21 -1
  198. package/dist/session.d.ts.map +1 -1
  199. package/dist/session.js +132 -43
  200. package/dist/session.js.map +1 -1
  201. package/dist/test-utils.d.ts +2 -0
  202. package/dist/test-utils.d.ts.map +1 -1
  203. package/dist/test-utils.js +3 -1
  204. package/dist/test-utils.js.map +1 -1
  205. package/dist/tool-search.d.ts +9 -0
  206. package/dist/tool-search.d.ts.map +1 -1
  207. package/dist/tool-search.js +23 -0
  208. package/dist/tool-search.js.map +1 -1
  209. package/dist/tools/bridge.d.ts +44 -0
  210. package/dist/tools/bridge.d.ts.map +1 -0
  211. package/dist/tools/bridge.js +106 -0
  212. package/dist/tools/bridge.js.map +1 -0
  213. package/dist/tools/cli.d.ts +20 -0
  214. package/dist/tools/cli.d.ts.map +1 -0
  215. package/dist/tools/cli.js +246 -0
  216. package/dist/tools/cli.js.map +1 -0
  217. package/dist/tools/entry.d.ts +2 -0
  218. package/dist/tools/entry.d.ts.map +1 -0
  219. package/dist/tools/entry.js +3 -0
  220. package/dist/tools/entry.js.map +1 -0
  221. package/dist/tools/shell.d.ts +12 -0
  222. package/dist/tools/shell.d.ts.map +1 -0
  223. package/dist/tools/shell.js +50 -0
  224. package/dist/tools/shell.js.map +1 -0
  225. package/dist/tuning/tpe.d.ts +112 -0
  226. package/dist/tuning/tpe.d.ts.map +1 -0
  227. package/dist/tuning/tpe.js +286 -0
  228. package/dist/tuning/tpe.js.map +1 -0
  229. package/docs/README.md +4 -1
  230. package/docs/channels/README.md +10 -0
  231. package/docs/documents/README.md +20 -19
  232. package/docs/host-api.md +10 -0
  233. package/docs/issues/README.md +183 -0
  234. package/docs/mcp-configuration.md +67 -2
  235. package/docs/pi-extension.md +5 -0
  236. package/docs/productivity/README.md +8 -3
  237. package/docs/providers.md +321 -0
  238. package/docs/recipe-format.md +103 -32
  239. package/docs/search/README.md +818 -0
  240. package/package.json +33 -10
  241. package/skills/documents/SKILL.md +2 -1
  242. package/skills/search/SKILL.md +72 -0
  243. package/dist/mcp-chunks/{auth-command-M7TQE3AL.js → auth-command-UYFOGGQR.js} +6 -6
  244. package/dist/mcp-chunks/{call-command-7LD7UEFK.js → call-command-6U5BNDR7.js} +17 -17
  245. package/dist/mcp-chunks/{chunk-PSE442BC.js → chunk-36D4FILJ.js} +26 -26
  246. package/dist/mcp-chunks/{config-command-6DXILFNO.js → config-command-ZSPJI34E.js} +10 -10
  247. package/dist/mcp-chunks/{emit-ts-command-NDCDFDRM.js → emit-ts-command-SY4LQE4S.js} +3 -3
  248. package/dist/mcp-chunks/{inspect-cli-command-4MGF5CPP.js → inspect-cli-command-JPX4ON6N.js} +4 -4
  249. package/dist/mcp-chunks/{resource-command-SRFQQROJ.js → resource-command-DUY4SVE5.js} +4 -4
@@ -0,0 +1,116 @@
1
+ /**
2
+ * The arguments each `channels` command takes, as the model sees them.
3
+ * `scripts/generate-tool-schemas.mjs` turns each `Channels<Command>Arguments`
4
+ * type into the JSON Schema in `arguments.generated.ts`: a field's doc
5
+ * comment is its description and its tags are its limits.
6
+ */
7
+ /**
8
+ * Markdown, rendered in the channel's native format
9
+ * @minLength 1
10
+ */
11
+ type Text = string;
12
+ /**
13
+ * A message reference a channel tool returned
14
+ * @minLength 1
15
+ */
16
+ type MessageRef = string;
17
+ /**
18
+ * A provider channel id, from list
19
+ * @minLength 1
20
+ */
21
+ type ChannelId = string;
22
+ export interface ChannelsReplyArguments {
23
+ text: Text;
24
+ /** false for progress; true, the default, for the completed answer */
25
+ final?: boolean;
26
+ }
27
+ export interface ChannelsSendArguments {
28
+ channel_id: ChannelId;
29
+ /**
30
+ * A thread to post in; without it, a top-level post
31
+ * @minLength 1
32
+ */
33
+ thread_id?: string;
34
+ text: Text;
35
+ }
36
+ export type ChannelsListArguments = Record<never, never>;
37
+ export interface ChannelsReadArguments {
38
+ /** The channel to read; default the origin */
39
+ channel_id?: ChannelId;
40
+ /**
41
+ * A thread to read, or null for the channel's timeline
42
+ * @minLength 1
43
+ */
44
+ thread_id?: string | null;
45
+ /**
46
+ * At most this many messages
47
+ * @asType integer
48
+ * @minimum 1
49
+ * @maximum 100
50
+ */
51
+ limit?: number;
52
+ /**
53
+ * A cursor from the previous page, with the same target
54
+ * @minLength 1
55
+ */
56
+ cursor?: string;
57
+ }
58
+ export interface ChannelsReactArguments {
59
+ message: MessageRef;
60
+ /**
61
+ * Emoji name or value accepted by the current channel provider.
62
+ * @minLength 1
63
+ */
64
+ emoji: string;
65
+ /**
66
+ * Add or remove the reaction
67
+ * @default "add"
68
+ */
69
+ action?: "add" | "remove";
70
+ }
71
+ export interface ChannelsEditArguments {
72
+ message: MessageRef;
73
+ text: Text;
74
+ }
75
+ export interface ChannelsRetractArguments {
76
+ message: MessageRef;
77
+ }
78
+ export interface ChannelsAttachArguments {
79
+ /**
80
+ * A file in the task workspace
81
+ * @minLength 1
82
+ */
83
+ path: string;
84
+ /** The file's title in the conversation */
85
+ title?: string;
86
+ /** A message posted with the file */
87
+ comment?: string;
88
+ }
89
+ export interface ChannelsFetchFileArguments {
90
+ /**
91
+ * A file reference from read
92
+ * @minLength 1
93
+ * @maxLength 200
94
+ */
95
+ file: string;
96
+ /**
97
+ * A provider-specific rendition of the file; default the original
98
+ * @minLength 1
99
+ * @maxLength 40
100
+ */
101
+ variant?: string;
102
+ }
103
+ export interface ChannelsPostDocumentArguments {
104
+ /**
105
+ * The document's title
106
+ * @minLength 1
107
+ */
108
+ title: string;
109
+ /**
110
+ * The document, in Markdown
111
+ * @minLength 1
112
+ */
113
+ markdown: string;
114
+ }
115
+ export {};
116
+ //# sourceMappingURL=arguments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arguments.d.ts","sourceRoot":"","sources":["../../src/channels/arguments.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAG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IACzC;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,6BAA6B;IAC5C;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,15 @@
1
+ import type { ArgumentsSchema } from "../command-parameters.js";
2
+ import type { ChannelsReplyArguments, ChannelsSendArguments, ChannelsListArguments, ChannelsReadArguments, ChannelsReactArguments, ChannelsEditArguments, ChannelsRetractArguments, ChannelsAttachArguments, ChannelsFetchFileArguments, ChannelsPostDocumentArguments } from "./arguments.js";
3
+ export declare const CHANNELS_ARGUMENTS: {
4
+ reply: ArgumentsSchema<ChannelsReplyArguments>;
5
+ send: ArgumentsSchema<ChannelsSendArguments>;
6
+ list: ArgumentsSchema<ChannelsListArguments>;
7
+ read: ArgumentsSchema<ChannelsReadArguments>;
8
+ react: ArgumentsSchema<ChannelsReactArguments>;
9
+ edit: ArgumentsSchema<ChannelsEditArguments>;
10
+ retract: ArgumentsSchema<ChannelsRetractArguments>;
11
+ attach: ArgumentsSchema<ChannelsAttachArguments>;
12
+ fetch_file: ArgumentsSchema<ChannelsFetchFileArguments>;
13
+ post_document: ArgumentsSchema<ChannelsPostDocumentArguments>;
14
+ };
15
+ //# sourceMappingURL=arguments.generated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arguments.generated.d.ts","sourceRoot":"","sources":["../../src/channels/arguments.generated.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,6BAA6B,EAC9B,MAAM,gBAAgB,CAAC;AAExB,eAAO,MAAM,kBAAkB;IAC7B,KAAK,EAgBA,eAAe,CAAC,sBAAsB,CAAC;IAC5C,IAAI,EAqBC,eAAe,CAAC,qBAAqB,CAAC;IAC3C,IAAI,EAIC,eAAe,CAAC,qBAAqB,CAAC;IAC3C,IAAI,EA0BC,eAAe,CAAC,qBAAqB,CAAC;IAC3C,KAAK,EAuBA,eAAe,CAAC,sBAAsB,CAAC;IAC5C,IAAI,EAgBC,eAAe,CAAC,qBAAqB,CAAC;IAC3C,OAAO,EAWF,eAAe,CAAC,wBAAwB,CAAC;IAC9C,MAAM,EAmBD,eAAe,CAAC,uBAAuB,CAAC;IAC7C,UAAU,EAmBL,eAAe,CAAC,0BAA0B,CAAC;IAChD,aAAa,EAgBR,eAAe,CAAC,6BAA6B,CAAC;CACpD,CAAC"}
@@ -0,0 +1,181 @@
1
+ export const CHANNELS_ARGUMENTS = {
2
+ reply: {
3
+ type: "object",
4
+ properties: {
5
+ text: {
6
+ type: "string",
7
+ description: "Markdown, rendered in the channel's native format",
8
+ minLength: 1,
9
+ },
10
+ final: {
11
+ type: "boolean",
12
+ description: "false for progress; true, the default, for the completed answer",
13
+ },
14
+ },
15
+ required: ["text"],
16
+ additionalProperties: false,
17
+ },
18
+ send: {
19
+ type: "object",
20
+ properties: {
21
+ channel_id: {
22
+ type: "string",
23
+ description: "A provider channel id, from list",
24
+ minLength: 1,
25
+ },
26
+ thread_id: {
27
+ type: "string",
28
+ description: "A thread to post in; without it, a top-level post",
29
+ minLength: 1,
30
+ },
31
+ text: {
32
+ type: "string",
33
+ description: "Markdown, rendered in the channel's native format",
34
+ minLength: 1,
35
+ },
36
+ },
37
+ required: ["channel_id", "text"],
38
+ additionalProperties: false,
39
+ },
40
+ list: {
41
+ type: "object",
42
+ properties: {},
43
+ additionalProperties: false,
44
+ },
45
+ read: {
46
+ type: "object",
47
+ properties: {
48
+ channel_id: {
49
+ type: "string",
50
+ description: "The channel to read; default the origin",
51
+ minLength: 1,
52
+ },
53
+ thread_id: {
54
+ type: ["string", "null"],
55
+ description: "A thread to read, or null for the channel's timeline",
56
+ minLength: 1,
57
+ },
58
+ limit: {
59
+ type: "integer",
60
+ description: "At most this many messages",
61
+ minimum: 1,
62
+ maximum: 100,
63
+ },
64
+ cursor: {
65
+ type: "string",
66
+ description: "A cursor from the previous page, with the same target",
67
+ minLength: 1,
68
+ },
69
+ },
70
+ additionalProperties: false,
71
+ },
72
+ react: {
73
+ type: "object",
74
+ properties: {
75
+ message: {
76
+ type: "string",
77
+ description: "A message reference a channel tool returned",
78
+ minLength: 1,
79
+ },
80
+ emoji: {
81
+ type: "string",
82
+ description: "Emoji name or value accepted by the current channel provider.",
83
+ minLength: 1,
84
+ },
85
+ action: {
86
+ type: "string",
87
+ enum: ["add", "remove"],
88
+ description: "Add or remove the reaction",
89
+ default: "add",
90
+ },
91
+ },
92
+ required: ["message", "emoji"],
93
+ additionalProperties: false,
94
+ },
95
+ edit: {
96
+ type: "object",
97
+ properties: {
98
+ message: {
99
+ type: "string",
100
+ description: "A message reference a channel tool returned",
101
+ minLength: 1,
102
+ },
103
+ text: {
104
+ type: "string",
105
+ description: "Markdown, rendered in the channel's native format",
106
+ minLength: 1,
107
+ },
108
+ },
109
+ required: ["message", "text"],
110
+ additionalProperties: false,
111
+ },
112
+ retract: {
113
+ type: "object",
114
+ properties: {
115
+ message: {
116
+ type: "string",
117
+ description: "A message reference a channel tool returned",
118
+ minLength: 1,
119
+ },
120
+ },
121
+ required: ["message"],
122
+ additionalProperties: false,
123
+ },
124
+ attach: {
125
+ type: "object",
126
+ properties: {
127
+ path: {
128
+ type: "string",
129
+ description: "A file in the task workspace",
130
+ minLength: 1,
131
+ },
132
+ title: {
133
+ type: "string",
134
+ description: "The file's title in the conversation",
135
+ },
136
+ comment: {
137
+ type: "string",
138
+ description: "A message posted with the file",
139
+ },
140
+ },
141
+ required: ["path"],
142
+ additionalProperties: false,
143
+ },
144
+ fetch_file: {
145
+ type: "object",
146
+ properties: {
147
+ file: {
148
+ type: "string",
149
+ description: "A file reference from read",
150
+ minLength: 1,
151
+ maxLength: 200,
152
+ },
153
+ variant: {
154
+ type: "string",
155
+ description: "A provider-specific rendition of the file; default the original",
156
+ minLength: 1,
157
+ maxLength: 40,
158
+ },
159
+ },
160
+ required: ["file"],
161
+ additionalProperties: false,
162
+ },
163
+ post_document: {
164
+ type: "object",
165
+ properties: {
166
+ title: {
167
+ type: "string",
168
+ description: "The document's title",
169
+ minLength: 1,
170
+ },
171
+ markdown: {
172
+ type: "string",
173
+ description: "The document, in Markdown",
174
+ minLength: 1,
175
+ },
176
+ },
177
+ required: ["title", "markdown"],
178
+ additionalProperties: false,
179
+ },
180
+ };
181
+ //# sourceMappingURL=arguments.generated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arguments.generated.js","sourceRoot":"","sources":["../../src/channels/arguments.generated.ts"],"names":[],"mappings":"AAeA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,KAAK,EAAE;QACL,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mDAAmD;gBAChE,SAAS,EAAE,CAAC;aACb;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,SAAS;gBACf,WAAW,EACT,iEAAiE;aACpE;SACF;QACD,QAAQ,EAAE,CAAC,MAAM,CAAC;QAClB,oBAAoB,EAAE,KAAK;KACe;IAC5C,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kCAAkC;gBAC/C,SAAS,EAAE,CAAC;aACb;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mDAAmD;gBAChE,SAAS,EAAE,CAAC;aACb;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mDAAmD;gBAChE,SAAS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AE,CAAC;gBACZ,SAAS,EAAE,EAAE;aACd;SACF;QACD,QAAQ,EAAE,CAAC,MAAM,CAAC;QAClB,oBAAoB,EAAE,KAAK;KACmB;IAChD,aAAa,EAAE;QACb,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,sBAAsB;gBACnC,SAAS,EAAE,CAAC;aACb;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,2BAA2B;gBACxC,SAAS,EAAE,CAAC;aACb;SACF;QACD,QAAQ,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC;QAC/B,oBAAoB,EAAE,KAAK;KACsB;CACpD,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The arguments each `channels` command takes, as the model sees them.
3
+ * `scripts/generate-tool-schemas.mjs` turns each `Channels<Command>Arguments`
4
+ * type into the JSON Schema in `arguments.generated.ts`: a field's doc
5
+ * comment is its description and its tags are its limits.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=arguments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arguments.js","sourceRoot":"","sources":["../../src/channels/arguments.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -29,6 +29,11 @@ export interface ChannelConnectorModuleOptions {
29
29
  config: ChannelConfig | null;
30
30
  env: NodeJS.ProcessEnv;
31
31
  cwd: string;
32
+ /**
33
+ * Whether a request to `url` goes where an API binding sends it rather
34
+ * than to the provider: such a request needs no egress credential.
35
+ */
36
+ isApiBound?: (url: string | URL) => boolean;
32
37
  }): ChannelConnectorSession;
33
38
  }
34
39
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/channels/module.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,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4 @@
1
+ import { isApiBound } from "../api-bindings.js";
1
2
  import { resolveChannelConfig } from "./config.js";
2
3
  import { ChannelRefStore } from "./refs.js";
3
4
  import { CHANNEL_TOOL_IDS, channelConnectorTools, registerChannelTools, } from "./tools.js";
@@ -10,19 +11,21 @@ export const CHANNEL_MODULE_API_VERSION = 1;
10
11
  const channelToolIds = new Set(CHANNEL_TOOL_IDS);
11
12
  /** Whether two capability descriptors say the same thing. */
12
13
  function sameCapabilities(left, right) {
13
- left = {
14
+ const { hosts: leftHosts = [], ...leftRest } = {
14
15
  ...left,
15
16
  targeting: left.targeting ?? false,
16
17
  list: left.list ?? false,
17
18
  };
18
- right = {
19
+ const { hosts: rightHosts = [], ...rightRest } = {
19
20
  ...right,
20
21
  targeting: right.targeting ?? false,
21
22
  list: right.list ?? false,
22
23
  };
23
- const keys = Object.keys(right);
24
- return (Object.keys(left).length === keys.length &&
25
- keys.every((key) => left[key] === right[key]));
24
+ const keys = Object.keys(rightRest);
25
+ return (Object.keys(leftRest).length === keys.length &&
26
+ keys.every((key) => leftRest[key] === rightRest[key]) &&
27
+ leftHosts.length === rightHosts.length &&
28
+ leftHosts.every((host, index) => host === rightHosts[index]));
26
29
  }
27
30
  /**
28
31
  * Build a `RecipeConnectorModule` from a channel adapter.
@@ -42,6 +45,7 @@ export function createChannelConnectorModule(options) {
42
45
  return {
43
46
  provider: options.provider,
44
47
  tools: connectorTools,
48
+ hosts: options.capabilities.hosts ?? [],
45
49
  createExtension(moduleOptions) {
46
50
  const unknown = moduleOptions.tools.filter((tool) => tool !== "channels");
47
51
  if (unknown.length > 0) {
@@ -65,6 +69,7 @@ export function createChannelConnectorModule(options) {
65
69
  config: resolveChannelConfig(moduleOptions.env ?? process.env),
66
70
  env: moduleOptions.env ?? process.env,
67
71
  cwd: moduleOptions.cwd ?? process.cwd(),
72
+ isApiBound,
68
73
  });
69
74
  if (session.adapter.provider !== options.provider) {
70
75
  throw new Error(`Channel adapter for '${options.provider}' returned provider '${session.adapter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AgB,oBAAoB,CAClC,EAAE,EAAE,eAAe,EACnB,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,2BAA2B,GACnC,IAAI,CA0eN"}
@@ -1,6 +1,6 @@
1
- import { Type } from "typebox";
2
1
  import { Check } from "typebox/value";
3
- import { commandParameters } from "../command-parameters.js";
2
+ import { commandParameters, commandSignature, commandVariant, withoutFields, } from "../command-parameters.js";
3
+ import { CHANNELS_ARGUMENTS } from "./arguments.generated.js";
4
4
  import { ChannelRefStore } from "./refs.js";
5
5
  /**
6
6
  * The neutral operation vocabulary.
@@ -223,10 +223,7 @@ export function registerChannelTools(pi, adapter, options) {
223
223
  };
224
224
  register("reply", () => ({
225
225
  description: "Post a message to the conversation this task answers. Text is Markdown and is rendered in the channel's native format. Replies land in the origin thread when there is one. Use final:false for progress; final:true (the default) for a completed answer.",
226
- parameters: Type.Object({
227
- text: Type.String({ minLength: 1 }),
228
- final: Type.Optional(Type.Boolean()),
229
- }, { additionalProperties: false }),
226
+ parameters: CHANNELS_ARGUMENTS.reply,
230
227
  async execute(_toolCallId, params, signal) {
231
228
  const ctx = context(signal);
232
229
  await options.validateTarget?.(ctx.target, "reply");
@@ -239,11 +236,7 @@ export function registerChannelTools(pi, adapter, options) {
239
236
  }));
240
237
  register("send", () => ({
241
238
  description: "Send Markdown to an explicit channel, optionally inside a thread, using this connection. No thread means a top-level post.",
242
- parameters: Type.Object({
243
- channel_id: Type.String({ minLength: 1 }),
244
- thread_id: Type.Optional(Type.String({ minLength: 1 })),
245
- text: Type.String({ minLength: 1 }),
246
- }, { additionalProperties: false }),
239
+ parameters: CHANNELS_ARGUMENTS.send,
247
240
  async execute(_toolCallId, params, signal) {
248
241
  if (typeof params.channel_id !== "string")
249
242
  throw new Error("send requires channel_id");
@@ -254,7 +247,7 @@ export function registerChannelTools(pi, adapter, options) {
254
247
  }));
255
248
  register("list", () => ({
256
249
  description: "List the channels available to the current provider credential session. Returns provider channel ids and names for use with explicitly targeted channel tools.",
257
- parameters: Type.Object({}, { additionalProperties: false }),
250
+ parameters: CHANNELS_ARGUMENTS.list,
258
251
  async execute(_toolCallId, _params, signal) {
259
252
  const channels = await adapter.list(signal);
260
253
  if (!options.validateTarget)
@@ -287,16 +280,9 @@ export function registerChannelTools(pi, adapter, options) {
287
280
  : adapter.capabilities.read === "thread"
288
281
  ? "Read earlier messages in this conversation's thread, most recent last."
289
282
  : "Read earlier messages in this conversation, most recent last.",
290
- parameters: Type.Object({
291
- ...(adapter.capabilities.targeting
292
- ? {
293
- channel_id: Type.Optional(Type.String({ minLength: 1 })),
294
- thread_id: Type.Optional(Type.Union([Type.String({ minLength: 1 }), Type.Null()])),
295
- }
296
- : {}),
297
- limit: Type.Optional(Type.Integer({ minimum: 1, maximum: 100 })),
298
- cursor: Type.Optional(Type.String({ minLength: 1 })),
299
- }, { additionalProperties: false }),
283
+ parameters: adapter.capabilities.targeting
284
+ ? CHANNELS_ARGUMENTS.read
285
+ : withoutFields(CHANNELS_ARGUMENTS.read, ["channel_id", "thread_id"]),
300
286
  async execute(_toolCallId, params, signal) {
301
287
  const ctx = context(signal, explicitTarget(params));
302
288
  if (adapter.capabilities.read === "thread" && !ctx.target.thread)
@@ -316,16 +302,7 @@ export function registerChannelTools(pi, adapter, options) {
316
302
  }));
317
303
  register("react", () => ({
318
304
  description: "Add or remove a provider-supported emoji reaction on a message in this conversation, named by a reference a channel tool returned. The action defaults to add.",
319
- parameters: Type.Object({
320
- message: Type.String({ minLength: 1 }),
321
- emoji: Type.String({
322
- minLength: 1,
323
- description: "Emoji name or value accepted by the current channel provider.",
324
- }),
325
- action: Type.Optional(Type.Union([Type.Literal("add"), Type.Literal("remove")], {
326
- default: "add",
327
- })),
328
- }, { additionalProperties: false }),
305
+ parameters: CHANNELS_ARGUMENTS.react,
329
306
  async execute(_toolCallId, params, signal) {
330
307
  const ctx = messageContext(params.message, signal);
331
308
  await options.validateTarget?.(ctx.target, "react");
@@ -339,10 +316,7 @@ export function registerChannelTools(pi, adapter, options) {
339
316
  }));
340
317
  register("edit", () => ({
341
318
  description: "Replace the text of a message this agent posted. Messages from other authors cannot be edited.",
342
- parameters: Type.Object({
343
- message: Type.String({ minLength: 1 }),
344
- text: Type.String({ minLength: 1 }),
345
- }, { additionalProperties: false }),
319
+ parameters: CHANNELS_ARGUMENTS.edit,
346
320
  async execute(_toolCallId, params, signal) {
347
321
  refs.resolveAuthored(params.message);
348
322
  const ctx = messageContext(params.message, signal);
@@ -355,7 +329,7 @@ export function registerChannelTools(pi, adapter, options) {
355
329
  }));
356
330
  register("retract", () => ({
357
331
  description: "Delete a message this agent posted. Messages from other authors cannot be retracted.",
358
- parameters: Type.Object({ message: Type.String({ minLength: 1 }) }, { additionalProperties: false }),
332
+ parameters: CHANNELS_ARGUMENTS.retract,
359
333
  async execute(_toolCallId, params, signal) {
360
334
  refs.resolveAuthored(params.message);
361
335
  const ctx = messageContext(params.message, signal);
@@ -366,11 +340,7 @@ export function registerChannelTools(pi, adapter, options) {
366
340
  }));
367
341
  register("attach", () => ({
368
342
  description: "Upload a file from the task workspace into this conversation.",
369
- parameters: Type.Object({
370
- path: Type.String({ minLength: 1 }),
371
- title: Type.Optional(Type.String()),
372
- comment: Type.Optional(Type.String()),
373
- }, { additionalProperties: false }),
343
+ parameters: CHANNELS_ARGUMENTS.attach,
374
344
  async execute(_toolCallId, params, signal) {
375
345
  const ctx = context(signal);
376
346
  await options.validateTarget?.(ctx.target, "attach");
@@ -379,10 +349,7 @@ export function registerChannelTools(pi, adapter, options) {
379
349
  }));
380
350
  register("fetch_file", () => ({
381
351
  description: "Download an observed file into the task workspace and return its local path, size, and digest. Takes a file reference returned by the read command. A provider file id is not accepted. The bytes stay on disk; they are not read into this conversation.",
382
- parameters: Type.Object({
383
- file: Type.String({ minLength: 1, maxLength: 200 }),
384
- variant: Type.Optional(Type.String({ minLength: 1, maxLength: 40 })),
385
- }, { additionalProperties: false }),
352
+ parameters: CHANNELS_ARGUMENTS.fetch_file,
386
353
  async execute(_toolCallId, params, signal) {
387
354
  const file = refs.resolveFile(params.file);
388
355
  if (!adapter.capabilities.targeting &&
@@ -399,10 +366,7 @@ export function registerChannelTools(pi, adapter, options) {
399
366
  }));
400
367
  register("post_document", () => ({
401
368
  description: "Publish long-form Markdown to this conversation as a document rather than a message, for output that reads badly when split across chat messages.",
402
- parameters: Type.Object({
403
- title: Type.String({ minLength: 1 }),
404
- markdown: Type.String({ minLength: 1 }),
405
- }, { additionalProperties: false }),
369
+ parameters: CHANNELS_ARGUMENTS.post_document,
406
370
  async execute(_toolCallId, params, signal) {
407
371
  const ctx = context(signal);
408
372
  await options.validateTarget?.(ctx.target, "post_document");
@@ -492,19 +456,18 @@ export function registerChannelTools(pi, adapter, options) {
492
456
  }
493
457
  const variants = [...definitions].map(([command, definition]) => {
494
458
  const schema = definition.parameters;
495
- return Type.Object({ command: Type.Literal(command), ...schema.properties }, {
496
- additionalProperties: false,
497
- description: definition.description,
498
- });
459
+ const description = definition.description;
460
+ return {
461
+ line: `${commandSignature(command, schema)}: ${description}`,
462
+ schema: commandVariant(command, schema, description),
463
+ };
499
464
  });
500
- const parameters = commandParameters(variants);
465
+ const parameters = commandParameters(variants.map((variant) => variant.schema));
501
466
  pi.registerTool({
502
467
  name: "channels",
503
468
  label: "Channels",
504
- description: "Read and manage channel conversations using this connection. Choose a command. " +
505
- [...definitions]
506
- .map(([command, definition]) => `${command}: ${definition.description}`)
507
- .join("\n"),
469
+ description: "Read and manage channel conversations using this connection. Choose a command.\n" +
470
+ variants.map((variant) => variant.line).join("\n"),
508
471
  parameters,
509
472
  executionMode: "sequential",
510
473
  async execute(toolCallId, params, ...rest) {