@introspection-ai/recipes 0.57.0 → 0.59.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 (164) hide show
  1. package/dist/agents.d.ts +6 -0
  2. package/dist/agents.d.ts.map +1 -1
  3. package/dist/agents.js.map +1 -1
  4. package/dist/batch/files.d.ts +5 -0
  5. package/dist/batch/files.d.ts.map +1 -1
  6. package/dist/batch/files.js +39 -0
  7. package/dist/batch/files.js.map +1 -1
  8. package/dist/batch/index.d.ts +33 -7
  9. package/dist/batch/index.d.ts.map +1 -1
  10. package/dist/batch/index.js +59 -27
  11. package/dist/batch/index.js.map +1 -1
  12. package/dist/batch/lines.d.ts +51 -9
  13. package/dist/batch/lines.d.ts.map +1 -1
  14. package/dist/batch/lines.js +86 -30
  15. package/dist/batch/lines.js.map +1 -1
  16. package/dist/batch/runner.d.ts +44 -5
  17. package/dist/batch/runner.d.ts.map +1 -1
  18. package/dist/batch/runner.js +433 -52
  19. package/dist/batch/runner.js.map +1 -1
  20. package/dist/compaction.d.ts +11 -0
  21. package/dist/compaction.d.ts.map +1 -0
  22. package/dist/compaction.js +27 -0
  23. package/dist/compaction.js.map +1 -0
  24. package/dist/issues/arguments.d.ts +51 -1
  25. package/dist/issues/arguments.d.ts.map +1 -1
  26. package/dist/issues/arguments.generated.d.ts.map +1 -1
  27. package/dist/issues/arguments.generated.js +97 -0
  28. package/dist/issues/arguments.generated.js.map +1 -1
  29. package/dist/issues/module.d.ts.map +1 -1
  30. package/dist/issues/module.js +8 -1
  31. package/dist/issues/module.js.map +1 -1
  32. package/dist/issues/tool.d.ts.map +1 -1
  33. package/dist/issues/tool.js +127 -4
  34. package/dist/issues/tool.js.map +1 -1
  35. package/dist/issues/types.d.ts +40 -1
  36. package/dist/issues/types.d.ts.map +1 -1
  37. package/dist/issues/types.js +8 -1
  38. package/dist/issues/types.js.map +1 -1
  39. package/dist/judges/classifier.d.ts +16 -0
  40. package/dist/judges/classifier.d.ts.map +1 -0
  41. package/dist/judges/classifier.js +47 -0
  42. package/dist/judges/classifier.js.map +1 -0
  43. package/dist/judges/cli-main.d.ts +41 -0
  44. package/dist/judges/cli-main.d.ts.map +1 -0
  45. package/dist/judges/cli-main.js +184 -0
  46. package/dist/judges/cli-main.js.map +1 -0
  47. package/dist/judges/cli.d.ts +2 -0
  48. package/dist/judges/cli.d.ts.map +1 -0
  49. package/dist/judges/cli.js +43 -0
  50. package/dist/judges/cli.js.map +1 -0
  51. package/dist/judges/controller.d.ts +78 -0
  52. package/dist/judges/controller.d.ts.map +1 -0
  53. package/dist/judges/controller.js +243 -0
  54. package/dist/judges/controller.js.map +1 -0
  55. package/dist/judges/definition.d.ts +93 -0
  56. package/dist/judges/definition.d.ts.map +1 -0
  57. package/dist/judges/definition.js +105 -0
  58. package/dist/judges/definition.js.map +1 -0
  59. package/dist/judges/gate.d.ts +46 -0
  60. package/dist/judges/gate.d.ts.map +1 -0
  61. package/dist/judges/gate.js +256 -0
  62. package/dist/judges/gate.js.map +1 -0
  63. package/dist/judges/identity.d.ts +21 -0
  64. package/dist/judges/identity.d.ts.map +1 -0
  65. package/dist/judges/identity.js +48 -0
  66. package/dist/judges/identity.js.map +1 -0
  67. package/dist/judges/index.d.ts +10 -0
  68. package/dist/judges/index.d.ts.map +1 -0
  69. package/dist/judges/index.js +10 -0
  70. package/dist/judges/index.js.map +1 -0
  71. package/dist/judges/resolve-hooks.d.ts +10 -0
  72. package/dist/judges/resolve-hooks.d.ts.map +1 -0
  73. package/dist/judges/resolve-hooks.js +25 -0
  74. package/dist/judges/resolve-hooks.js.map +1 -0
  75. package/dist/judges/run.d.ts +130 -0
  76. package/dist/judges/run.d.ts.map +1 -0
  77. package/dist/judges/run.js +356 -0
  78. package/dist/judges/run.js.map +1 -0
  79. package/dist/judges/session.d.ts +9 -0
  80. package/dist/judges/session.d.ts.map +1 -0
  81. package/dist/judges/session.js +109 -0
  82. package/dist/judges/session.js.map +1 -0
  83. package/dist/judges/trajectory.d.ts +82 -0
  84. package/dist/judges/trajectory.d.ts.map +1 -0
  85. package/dist/judges/trajectory.js +170 -0
  86. package/dist/judges/trajectory.js.map +1 -0
  87. package/dist/judges/verdict.d.ts +31 -0
  88. package/dist/judges/verdict.d.ts.map +1 -0
  89. package/dist/judges/verdict.js +121 -0
  90. package/dist/judges/verdict.js.map +1 -0
  91. package/dist/model-binding.d.ts +12 -0
  92. package/dist/model-binding.d.ts.map +1 -1
  93. package/dist/model-binding.js +38 -6
  94. package/dist/model-binding.js.map +1 -1
  95. package/dist/prompts/budget.d.ts +28 -0
  96. package/dist/prompts/budget.d.ts.map +1 -0
  97. package/dist/prompts/budget.js +31 -0
  98. package/dist/prompts/budget.js.map +1 -0
  99. package/dist/prompts/builder.d.ts +32 -0
  100. package/dist/prompts/builder.d.ts.map +1 -0
  101. package/dist/prompts/builder.js +22 -0
  102. package/dist/prompts/builder.js.map +1 -0
  103. package/dist/prompts/builders/conversation-synthesis.d.ts +106 -0
  104. package/dist/prompts/builders/conversation-synthesis.d.ts.map +1 -0
  105. package/dist/prompts/builders/conversation-synthesis.js +495 -0
  106. package/dist/prompts/builders/conversation-synthesis.js.map +1 -0
  107. package/dist/prompts/builders/trajectory.d.ts +14 -0
  108. package/dist/prompts/builders/trajectory.d.ts.map +1 -0
  109. package/dist/prompts/builders/trajectory.js +66 -0
  110. package/dist/prompts/builders/trajectory.js.map +1 -0
  111. package/dist/prompts/fit.d.ts +7 -0
  112. package/dist/prompts/fit.d.ts.map +1 -0
  113. package/dist/prompts/fit.js +15 -0
  114. package/dist/prompts/fit.js.map +1 -0
  115. package/dist/prompts/index.d.ts +8 -0
  116. package/dist/prompts/index.d.ts.map +1 -0
  117. package/dist/prompts/index.js +8 -0
  118. package/dist/prompts/index.js.map +1 -0
  119. package/dist/prompts/registry.d.ts +8 -0
  120. package/dist/prompts/registry.d.ts.map +1 -0
  121. package/dist/prompts/registry.js +15 -0
  122. package/dist/prompts/registry.js.map +1 -0
  123. package/dist/prompts/spec.d.ts +16 -0
  124. package/dist/prompts/spec.d.ts.map +1 -0
  125. package/dist/prompts/spec.js +12 -0
  126. package/dist/prompts/spec.js.map +1 -0
  127. package/dist/prompts/template.d.ts +12 -0
  128. package/dist/prompts/template.d.ts.map +1 -0
  129. package/dist/prompts/template.js +31 -0
  130. package/dist/prompts/template.js.map +1 -0
  131. package/dist/prompts/text.d.ts +5 -0
  132. package/dist/prompts/text.d.ts.map +1 -0
  133. package/dist/prompts/text.js +13 -0
  134. package/dist/prompts/text.js.map +1 -0
  135. package/dist/recipe/agent.d.ts +11 -1
  136. package/dist/recipe/agent.d.ts.map +1 -1
  137. package/dist/recipe/agent.js +76 -1
  138. package/dist/recipe/agent.js.map +1 -1
  139. package/dist/recipe/manifest.generated.d.ts +1 -1
  140. package/dist/recipe/manifest.generated.js +1 -1
  141. package/dist/recipe/model.d.ts +5 -12
  142. package/dist/recipe/model.d.ts.map +1 -1
  143. package/dist/recipe/model.js +197 -263
  144. package/dist/recipe/model.js.map +1 -1
  145. package/dist/recipe/session.d.ts +5 -0
  146. package/dist/recipe/session.d.ts.map +1 -1
  147. package/dist/recipe/session.js +82 -4
  148. package/dist/recipe/session.js.map +1 -1
  149. package/dist/run-controller.d.ts.map +1 -1
  150. package/dist/run-controller.js +4 -0
  151. package/dist/run-controller.js.map +1 -1
  152. package/dist/session.d.ts +6 -0
  153. package/dist/session.d.ts.map +1 -1
  154. package/dist/session.js +6 -2
  155. package/dist/session.js.map +1 -1
  156. package/docs/README.md +1 -0
  157. package/docs/agent-composition.md +3 -2
  158. package/docs/issues/README.md +34 -12
  159. package/docs/judges.md +269 -0
  160. package/docs/providers.md +12 -3
  161. package/docs/recipe-format.md +80 -12
  162. package/docs/recipe-judges.md +149 -61
  163. package/package.json +14 -6
  164. package/skills/issues/SKILL.md +28 -10
@@ -1,6 +1,6 @@
1
1
  # Recipe judge definitions
2
2
 
3
- Recipe judges are optional, recipe-owned LLM grading definitions. Author them
3
+ Recipe judges are optional, recipe-owned grading definitions. Author them
4
4
  as direct children of `judges/` using a lowercase `.yaml` or `.yml` extension:
5
5
 
6
6
  ```text
@@ -18,19 +18,20 @@ sources have no judge diagnostics.
18
18
  The validator behind `introspection check` owns the portable authored YAML
19
19
  specification and its static, file-oriented diagnostics.
20
20
 
21
- Evaluation systems own execution: applicability checks, conversation assembly,
22
- transcript protection, model requests, retries, verdict normalization, and
23
- evaluation identity. Implementations should consume or remain explicitly
24
- compatible with the authored specification defined here. New authored fields
25
- must land in this checker and its contract tests rather than appearing in only
26
- one evaluator.
21
+ `@introspection-ai/recipes/judges` owns execution: applicability checks,
22
+ transcript assembly and protection, model requests, verdict normalization and
23
+ evaluation identity. See [Running judges](judges.md). New authored fields must
24
+ land in the checker and its contract tests as well as in the runner.
27
25
 
28
26
  Validation reports do not contain normalized judge definitions or
29
27
  host-specific registry data.
30
28
 
31
29
  ## Definition shape
32
30
 
33
- The minimal definition is:
31
+ A judge is answered either by a chat model reading `instructions`, or by a
32
+ classifier answering yes-or-no `questions`. It declares exactly one of the two.
33
+
34
+ The minimal LLM judge is:
34
35
 
35
36
  ```yaml
36
37
  name: helpful
@@ -38,19 +39,18 @@ name: helpful
38
39
  instructions: |
39
40
  Determine whether the assistant answered the user correctly.
40
41
 
41
- llm:
42
- model: gpt-5
42
+ ai:
43
+ model: anthropic/claude-sonnet-5-5
43
44
  ```
44
45
 
45
- `name`, `instructions`, and `llm.model` are required and non-empty. Names use
46
- lowercase kebab-case and must be unique across all judge files in one Recipe.
47
- As with `agents/*.yaml`, the filename has no semantic meaning. Evaluators default
48
- `llm.provider` to `openai`.
46
+ `name`, `ai.model` and one of `instructions` and `questions` are required.
47
+ Names use lowercase kebab-case and must be unique across all judge files in one
48
+ Recipe. As with `agents/*.yaml`, the filename has no semantic meaning.
49
49
 
50
50
  Legacy definitions using `judge:` remain accepted as a deprecated input alias.
51
51
  Parsers normalize that field to `name`; a definition cannot declare both.
52
52
 
53
- The canonical expanded definition is:
53
+ The expanded definition is:
54
54
 
55
55
  ```yaml
56
56
  name: helpful
@@ -64,30 +64,102 @@ on:
64
64
  instructions: |
65
65
  Determine whether the assistant answered the user correctly.
66
66
 
67
+ ai:
68
+ model: anthropic/claude-sonnet-5-5
69
+ fallbacks:
70
+ - openai/gpt-6-luna
71
+ thinking_level: low
72
+ options:
73
+ temperature: 0
74
+ ```
75
+
76
+ Unknown fields are errors at every level.
77
+
78
+ ### The older `llm:` block
79
+
80
+ A judge declares its model under `ai:`. The `llm:` block that earlier versions
81
+ read is still accepted in its place, but never beside it: a judge with both, or
82
+ with neither, reports `judge.kind_invalid`. Every reader of the judge
83
+ (the checker, the runner and the hosted platform) sees the `ai:` block it maps
84
+ to:
85
+
86
+ | `llm:` | `ai:` |
87
+ | -------------------------- | ------------------------------------------------------------ |
88
+ | `provider` and `model` | `model: <provider>/<model>`; `provider` defaults to `openai` |
89
+ | `request.max_tokens` | `options.max_tokens` |
90
+ | `request.temperature` | `options.temperature`, unless it is 0 (the model's default) |
91
+ | `request.reasoning_effort` | `thinking_level`; `none` is `off` |
92
+ | `transport` | dropped: the host owns timeouts and retries |
93
+ | `local` | dropped with the warning `judge.llm.local_ignored` |
94
+
95
+ `ai:` cannot name a local endpoint, so a judge that declared `llm.local` runs on
96
+ its provider's hosted model. A `reasoning_effort` that names no thinking level
97
+ is an error.
98
+
99
+ ```yaml
100
+ # Read as ai: { model: anthropic/claude-sonnet-5-5, thinking_level: low }
67
101
  llm:
68
- provider: openai
69
- model: gpt-5
102
+ provider: anthropic
103
+ model: claude-sonnet-5-5
70
104
  request:
71
- temperature: 0
72
- max_tokens: 1024
73
- reasoning_effort: medium
74
- transport:
75
- timeout_ms: 60000
76
- max_retries: 2
77
- max_retry_delay_ms: 5000
78
- local:
79
- base_url: https://api.openai.com/v1
80
- api_key_env: OPENAI_API_KEY
105
+ reasoning_effort: low
106
+ ```
107
+
108
+ ### Model settings
109
+
110
+ `ai:` is the block an agent declares, with the same keys and the same rules:
111
+ `model`, `fallbacks`, `thinking_level`, `options` and `providers`. See
112
+ [Agents](recipe-format.md#agents). A judge has no `session:` block; the host's
113
+ retry settings apply.
114
+
115
+ An LLM judge returns `pass`, `fail` or `not_applicable` with a short reason.
116
+ That contract is the runner's and cannot be authored.
117
+
118
+ ### Classifier judges
119
+
120
+ A classifier judge asks a decision model yes-or-no questions and reads a
121
+ probability for each:
122
+
123
+ ```yaml
124
+ name: polite
125
+
126
+ ai:
127
+ model: typesafe/jev-latest
128
+ fallbacks:
129
+ - openai/gpt-6-luna
130
+
131
+ questions:
132
+ greeted:
133
+ instructions: Did the assistant greet the user?
134
+ criteria:
135
+ "true": The first reply opens with a greeting.
136
+ "false": It does not.
137
+ threshold: 0.8
138
+ apologised:
139
+ instructions: Did the assistant apologise for the delay?
140
+ criteria:
141
+ "true": It says sorry for the wait.
142
+ "false": It does not mention the wait.
81
143
  ```
82
144
 
83
- Unknown fields are errors at every level. The obsolete top-level `model:`
84
- block is rejected.
145
+ - `questions` maps between one and eight lowercase snake_case names to
146
+ questions.
147
+ - `instructions` is non-empty text, and `criteria` describes both `true` and
148
+ `false`.
149
+ - `threshold` is the probability of yes, above 0 and at most 1, that the
150
+ question must reach. It defaults to 0.5.
151
+ - The judge is `pass` when every question reaches its own threshold, and `fail`
152
+ otherwise. A classifier cannot abstain: `not_applicable` comes only from
153
+ `on`.
154
+ - `ai.model` names a classifier model. `thinking_level` and `options` do not
155
+ apply to one.
85
156
 
86
157
  ## Judge types
87
158
 
88
159
  `type` says when a judge runs:
89
160
 
90
- - `online`, the default: at the end of every runtime conversation.
161
+ - `online`, the default: at the end of every runtime conversation `on`
162
+ selects, or of a sample of them (see [Sampling](#sampling)).
91
163
  - `mission`: on a request leaving the sandbox, which a route in the Recipe's
92
164
  `policies/routes.yaml` names. Its answers reach the Recipe's Cedar policy
93
165
  before the request is allowed.
@@ -123,33 +195,8 @@ questions:
123
195
  describes both `true` and `false` in non-empty text.
124
196
  - `attributes` lists the request attributes the judge sees, and is empty to show
125
197
  them all.
126
- - `on` and `llm` belong to `online` judges and are rejected on a mission
127
- judge; `questions` and `attributes` are rejected on online judges.
128
-
129
- ### LLM settings
130
-
131
- - `provider` is a 1-64 byte lowercase slug containing ASCII letters, digits,
132
- and hyphens. The portable checker does not restrict it to managed platform
133
- providers because custom slugs can be used with an explicit local endpoint.
134
- - `model` is a trimmed, non-empty string of at most 255 bytes.
135
- - `request.temperature` is a finite number from 0 through 2 and defaults to 0.
136
- - `request.max_tokens` is an integer from 1 through 131072 when present;
137
- explicit `null` is treated as omitted.
138
- - `request.reasoning_effort` is a 1-64 byte lowercase slug containing ASCII
139
- letters and hyphens; explicit `null` is treated as omitted.
140
- - `transport.timeout_ms` is an integer from 1 through 600000 and defaults to
141
- 60000.
142
- - `transport.max_retries` is an integer from 0 through 10 and defaults to 0.
143
- - `transport.max_retry_delay_ms` is an integer from 0 through 60000 and
144
- defaults to 5000.
145
- - `local` requires both `base_url` and `api_key_env`. The URL must be HTTP(S),
146
- have a host, contain no embedded credentials, query, or fragment, and use
147
- HTTPS unless it targets `localhost`, `127.0.0.1`, or `::1`. `api_key_env` is
148
- an environment-variable name, not a credential value.
149
-
150
- Transport and local settings affect execution but not authored grading
151
- identity. The evaluator remains responsible for applying defaults, building
152
- requests, and routing execution.
198
+ - `on`, `ai` and `sample` belong to `online` judges and are rejected on a
199
+ mission judge; `attributes` is rejected on online judges.
153
200
 
154
201
  ## Applicability
155
202
 
@@ -173,10 +220,49 @@ on:
173
220
  sentiment: negative
174
221
  ```
175
222
 
176
- Match keys are non-empty field paths. Regex literals use Rust regex syntax and
177
- support unique `i`, `m`, `s`, and `u` flags. `environment`, `runtime_group`, and
223
+ Match keys are non-empty field paths. Regex literals support unique `i`, `m`,
224
+ `s`, and `u` flags. A pattern must compile both as a Rust regex, which the
225
+ hosted platform evaluates, and as a JavaScript `RegExp`, which the runner
226
+ evaluates. The runner compiles a pattern with the `v` flag and, when that
227
+ refuses it, with the `u` flag, so `[\w-]+` (which only `u` compiles) and
228
+ `[\w--\d]+` (which only `v` compiles) are both valid. The checker reports
229
+ `judge.on.regex_invalid` for a pattern either engine refuses, such as a
230
+ lookahead (`(?=…)`, which Rust refuses) or a Rust named group (`(?P<name>…)`,
231
+ which JavaScript refuses under both flags). `environment`, `runtime_group`, and
178
232
  paths ending in `pattern_id` are platform-owned and cannot appear as authored
179
- match fields. The evaluator owns dotted-path traversal and gate evaluation.
233
+ match fields. The runner owns dotted-path traversal and gate evaluation.
234
+
235
+ The checker compiles the JavaScript side with a Rust implementation of the
236
+ `RegExp` grammar, not with the runner's own engine, and the two differ at the
237
+ edges: the checker accepts `\Afoo\z`, `\-` and `\#`, which the runner refuses,
238
+ and `[[:alpha:]]` is a POSIX class to Rust and a nested class to JavaScript. A
239
+ pattern the checker accepts can therefore still be refused by the runner at
240
+ run time, where it records an error for that judgement.
241
+
242
+ ## Sampling
243
+
244
+ `sample` is optional on an online judge: the fraction of the conversations
245
+ `on` selects that the judge runs on, a number above 0 and at most 1. It
246
+ defaults to 1, every selected conversation.
247
+
248
+ ```yaml
249
+ name: helpful
250
+ sample: 0.1
251
+ ```
252
+
253
+ Sampling is deterministic per conversation, so a rerun, and every host that
254
+ judges the same conversation, makes the same choice. A conversation is sampled
255
+ when `h / 2^48 < sample`, where `h` is the first six bytes, read as a
256
+ big-endian unsigned integer, of the SHA-256 of
257
+ `<judge id>:<conversation id>`. The judge id is the platform's id for the
258
+ judge, or its name where the host has none. It is part of the key, so two
259
+ judges that each sample a tenth of conversations do not pick the same tenth;
260
+ renaming a judge draws a new sample. A sampling rate the platform sets for a
261
+ judge replaces `sample`. Only production conversations are sampled.
262
+
263
+ A conversation the sample leaves out records no verdict; it is not
264
+ `not_applicable`, which only `on` produces. An eval run judges every trial it
265
+ asks a judge for, whatever its `sample`.
180
266
 
181
267
  ## Diagnostics
182
268
 
@@ -185,4 +271,6 @@ diagnostics use stable `judge.*` codes, Recipe-relative source paths, useful
185
271
  help text, and deterministic ordering. YAML syntax failures use
186
272
  `judge.yaml_malformed` and include a 1-based source span when the parser
187
273
  provides one. An invalid mission judge reports `judge.mission_invalid`, and a
188
- `type` other than `online` and `mission` reports `judge.type_invalid`.
274
+ `type` other than `online` and `mission` reports `judge.type_invalid`. A
275
+ `sample` that is not a number above 0 and at most 1 reports
276
+ `judge.sample_invalid`; on a mission judge it reports `judge.mission_invalid`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@introspection-ai/recipes",
3
- "version": "0.57.0",
3
+ "version": "0.59.0",
4
4
  "description": "The open format for vertical agents, built on Pi.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -65,6 +65,14 @@
65
65
  "types": "./dist/batch/index.d.ts",
66
66
  "import": "./dist/batch/index.js"
67
67
  },
68
+ "./prompts": {
69
+ "types": "./dist/prompts/index.d.ts",
70
+ "import": "./dist/prompts/index.js"
71
+ },
72
+ "./judges": {
73
+ "types": "./dist/judges/index.d.ts",
74
+ "import": "./dist/judges/index.js"
75
+ },
68
76
  "./recipe": {
69
77
  "types": "./dist/recipe/resolve.d.ts",
70
78
  "import": "./dist/recipe/resolve.js"
@@ -142,10 +150,10 @@
142
150
  "@introspection-ai/recipe-productivity-microsoft": ">=0.1.0",
143
151
  "@introspection-ai/recipe-search": ">=0.1.0",
144
152
  "@introspection-ai/recipe-signature": ">=0.1.0",
145
- "@introspection-ai/mcp-client-linux-x64": "0.57.0",
146
- "@introspection-ai/mcp-client-linux-arm64": "0.57.0",
147
- "@introspection-ai/mcp-client-darwin-arm64": "0.57.0",
148
- "@introspection-ai/mcp-client-darwin-x64": "0.57.0"
153
+ "@introspection-ai/mcp-client-linux-x64": "0.59.0",
154
+ "@introspection-ai/mcp-client-linux-arm64": "0.59.0",
155
+ "@introspection-ai/mcp-client-darwin-arm64": "0.59.0",
156
+ "@introspection-ai/mcp-client-darwin-x64": "0.59.0"
149
157
  },
150
158
  "peerDependencies": {
151
159
  "@earendil-works/pi-agent-core": ">=1.1.0 <2.0.0",
@@ -193,7 +201,7 @@
193
201
  "format": "prettier --write \"{src,test,packages,examples}/**/*.{ts,mjs,md}\" \"*.{ts,mjs}\"",
194
202
  "format:check": "prettier --check \"{src,test,packages,examples}/**/*.{ts,mjs,md}\" \"*.{ts,mjs}\"",
195
203
  "knip": "pnpm manifest && pnpm schemas && knip --no-gitignore",
196
- "test": "pnpm build:ts && cargo test -p pi-mcp-client -p introspection-recipe-check && cargo build -p pi-mcp-client && MCP_CLIENT_BIN=target/debug/mcp-client node scripts/package-mcp-client.mjs && vitest run && pnpm --filter './examples' test",
204
+ "test": "pnpm build:ts && cargo test -p pi-mcp-client -p introspection-recipe-check && cargo build -p pi-mcp-client -p introspection-recipe-check && MCP_CLIENT_BIN=target/debug/mcp-client node scripts/package-mcp-client.mjs && vitest run && pnpm --filter './examples' test",
197
205
  "pack:check": "pnpm pack --dry-run --json | node scripts/check-npm-pack.mjs && pnpm --filter './packages/**' pack:check",
198
206
  "clean": "rm -rf dist .turbo node_modules target vendor/mcp-client",
199
207
  "report:tool-modes": "node scripts/tool-modes-report.mjs && prettier --write test/recordings/tool-modes/report.md"
@@ -27,14 +27,14 @@ leave it out.
27
27
 
28
28
  ## The commands
29
29
 
30
- | Command | Takes |
31
- | ------------ | ---------------------------------------------------------------------------------------------- |
32
- | `search` | `query`, `status`, `assignee`, `container`, `label`, `limit` (1-50, default 20) |
33
- | `get` | `handle`; returns the issue with its comments |
34
- | `create` | `title` (required), `description`, `priority`, `labels`, `assignee`, `container`, `issue_type` |
35
- | `update` | `handle`, and at least one of `title`, `description`, `priority`, `labels`, `assignee` |
36
- | `comment` | `handle`, `body` (markdown) |
37
- | `transition` | `handle`, `status` |
30
+ | Command | Takes |
31
+ | ------------ | ------------------------------------------------------------------------------------------------------------------------------- |
32
+ | `search` | `query`, `status`, `assignee`, `container`, `label`, `limit` (1-50, default 20) |
33
+ | `get` | `handle`; returns the issue with its comments and attachments |
34
+ | `create` | `title` (required), `description`, `priority`, `labels`, `assignee`, `container`, `issue_type`, `attachments` |
35
+ | `update` | `handle`, and at least one of `title`, `description`, `priority`, `labels`, `assignee`, `add_attachments`, `remove_attachments` |
36
+ | `comment` | `handle`, `body` (markdown) |
37
+ | `transition` | `handle`, `status` |
38
38
 
39
39
  - `description` and `body` are markdown.
40
40
  - `labels` on `update` replaces the whole set: `get` the issue first and pass the labels
@@ -45,6 +45,24 @@ leave it out.
45
45
  default. `issue_type` is Jira's alone.
46
46
  - `update` never changes the status. Use `transition` for that.
47
47
 
48
+ ## Attachments
49
+
50
+ An attachment is evidence on an issue, one object per item, by `kind`:
51
+
52
+ - `link`: `url` (http or https), optional `title`
53
+ - `file`: `file_id` (a data plane file), optional `name`
54
+ - `event`: `event_id`
55
+ - `span`: `trace_id` (32 hex) and `span_id` (16 hex)
56
+
57
+ `create` takes them as `attachments`; `update` appends `add_attachments` and removes
58
+ `remove_attachments`, a list of attachment ids. Ids come from `get`, which lists each
59
+ attachment with its id. Adding never replaces what is there, so send only the new item;
60
+ Introspection skips one the issue already holds (the same url, file, event or span).
61
+
62
+ Introspection takes every kind and removes. Linear and Jira take `link` alone and cannot
63
+ remove one. A file, event or span is `not_supported` there: mention it in a comment
64
+ instead.
65
+
48
66
  ## Statuses and priorities
49
67
 
50
68
  `status` (on `search` and `transition`) is the tracker's own status name, or one of the
@@ -98,8 +116,8 @@ The error names a code:
98
116
  - `not_connected`: the tracker is not connected for this person, or the runtime has no
99
117
  credential for it. Ask the person to connect it (with `introspection_open` where it is
100
118
  offered); don't retry.
101
- - `not_supported`: this provider does not serve that command or field. Leave the field
102
- out, or tell the person.
119
+ - `not_supported`: this provider does not serve that command, field or attachment kind.
120
+ Leave it out, or tell the person.
103
121
  - `not_found`: the handle no longer names an issue. Search again.
104
122
  - `invalid_request`: fix the arguments the message names (a missing title, a bad
105
123
  priority, a status the tracker does not have, several providers on offer).