@dxos/introspect-tools 0.8.4-main.cb12b3f963 → 0.8.4-main.d9fc60f731

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.
package/LICENSE CHANGED
@@ -1,8 +1,105 @@
1
- MIT License
2
- Copyright (c) 2022 DXOS
1
+ # Functional Source License, Version 1.1, ALv2 Future License
3
2
 
4
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3
+ ## Abbreviation
5
4
 
6
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
5
+ FSL-1.1-Apache-2.0
7
6
 
8
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7
+ ## Notice
8
+
9
+ Copyright 2026 DXOS
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to
59
+ the infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
79
+ EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of
84
+ the Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the Apache License, Version 2.0 that is effective on the second anniversary of
91
+ the date we make the Software available. On or after that date, you may use the
92
+ Software under the Apache License, Version 2.0, in which case the following
93
+ will apply:
94
+
95
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
96
+ this file except in compliance with the License.
97
+
98
+ You may obtain a copy of the License at
99
+
100
+ http://www.apache.org/licenses/LICENSE-2.0
101
+
102
+ Unless required by applicable law or agreed to in writing, software distributed
103
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
104
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
105
+ specific language governing permissions and limitations under the License.
@@ -5,22 +5,154 @@ var DEFAULT_LIST_LIMIT = 30;
5
5
  var MAX_LIST_LIMIT = 200;
6
6
 
7
7
  // src/metadata.ts
8
+ import * as Schema3 from "effect/Schema";
8
9
  import { effectFieldsToZod } from "@dxos/effect-zod";
9
10
  import { trim as trim2 } from "@dxos/util";
10
11
 
11
- // src/schemas.ts
12
+ // src/output-schemas.ts
12
13
  import * as Schema from "effect/Schema";
14
+ var SymbolKindSchema = Schema.Literal("function", "class", "interface", "type", "enum", "variable", "namespace", "unknown");
15
+ var SymbolIncludeSchema = Schema.Literal("source", "jsdoc");
16
+ var SourceLocationSchema = Schema.Struct({
17
+ file: Schema.String,
18
+ line: Schema.Number,
19
+ column: Schema.Number
20
+ });
21
+ var PluginIdSchema = Schema.String;
22
+ var PackageSchema = Schema.Struct({
23
+ name: Schema.String,
24
+ version: Schema.String,
25
+ private: Schema.Boolean,
26
+ /** Path relative to the monorepo root (no trailing slash). */
27
+ path: Schema.String,
28
+ description: Schema.optional(Schema.String)
29
+ });
30
+ var PackageDetailSchema = Schema.Struct({
31
+ ...PackageSchema.fields,
32
+ /** Workspace dependencies (other packages in the monorepo). */
33
+ workspaceDependencies: Schema.Array(Schema.String),
34
+ /** External (catalog or pinned) dependency names. */
35
+ externalDependencies: Schema.Array(Schema.String),
36
+ /** Resolved entry points (relative to package root). */
37
+ entryPoints: Schema.Array(Schema.String),
38
+ /** Number of exported symbols at the top level. */
39
+ exportCount: Schema.Number
40
+ });
41
+ var SymbolMatchSchema = Schema.Struct({
42
+ ref: Schema.String,
43
+ package: Schema.String,
44
+ name: Schema.String,
45
+ kind: SymbolKindSchema,
46
+ /** One-line summary from JSDoc, if any. */
47
+ summary: Schema.optional(Schema.String)
48
+ });
49
+ var SymbolDetailSchema = Schema.Struct({
50
+ ref: Schema.String,
51
+ package: Schema.String,
52
+ name: Schema.String,
53
+ kind: SymbolKindSchema,
54
+ signature: Schema.String,
55
+ jsdoc: Schema.optional(Schema.String),
56
+ summary: Schema.optional(Schema.String),
57
+ location: SourceLocationSchema,
58
+ /** Source text — only present when `include` requested it. */
59
+ source: Schema.optional(Schema.String)
60
+ });
61
+ var PluginSchema = Schema.Struct({
62
+ /** e.g. `org.dxos.plugin.code`. */
63
+ id: PluginIdSchema,
64
+ /** npm package name, e.g. `@dxos/plugin-code`. */
65
+ package: Schema.String,
66
+ name: Schema.optional(Schema.String),
67
+ description: Schema.optional(Schema.String),
68
+ icon: Schema.optional(Schema.String),
69
+ iconHue: Schema.optional(Schema.String),
70
+ /** Static tags read from `meta.tags` (e.g. `['labs']`). Empty array if absent. */
71
+ tags: Schema.Array(Schema.String),
72
+ /**
73
+ * Ids of other plugins this plugin depends on, derived from its package's
74
+ * `workspace:*` dependencies. Sorted for deterministic output. Empty array
75
+ * if the plugin's package has no dependencies on other plugin packages.
76
+ */
77
+ dependsOn: Schema.Array(PluginIdSchema),
78
+ /** Source location of the `meta` declaration. */
79
+ metaLocation: SourceLocationSchema
80
+ });
81
+ var SurfaceSchema = Schema.Struct({
82
+ pluginId: PluginIdSchema,
83
+ /** Surface id passed to `Surface.create({ id })`. */
84
+ id: Schema.String,
85
+ /** One or more roles the surface answers to. */
86
+ role: Schema.Array(Schema.String),
87
+ location: SourceLocationSchema
88
+ });
89
+ var CapabilitySchema = Schema.Struct({
90
+ pluginId: PluginIdSchema,
91
+ /** Identifier expression as written in source, e.g. `Capabilities.ReactSurface`. */
92
+ type: Schema.String,
93
+ location: SourceLocationSchema
94
+ });
95
+ var OperationSchema = Schema.Struct({
96
+ pluginId: PluginIdSchema,
97
+ /** Operation identifier expression. */
98
+ type: Schema.String,
99
+ location: SourceLocationSchema
100
+ });
101
+ var SchemaSchema = Schema.Struct({
102
+ pluginId: PluginIdSchema,
103
+ /** Identifier expression as written in `addSchemaModule`, e.g. `CodeProject.CodeProject`. */
104
+ name: Schema.String,
105
+ /** Resolved typename (e.g. `org.dxos.type.codeProject`) when statically extractable. */
106
+ typename: Schema.optional(Schema.String),
107
+ location: SourceLocationSchema
108
+ });
109
+ var PluginDetailSchema = Schema.Struct({
110
+ ...PluginSchema.fields,
111
+ surfaces: Schema.Array(SurfaceSchema),
112
+ capabilities: Schema.Array(CapabilitySchema),
113
+ operations: Schema.Array(OperationSchema),
114
+ schemas: Schema.Array(SchemaSchema)
115
+ });
116
+ var IdiomHostKindSchema = Schema.Literal("story", "test", "symbol");
117
+ var IdiomHostSchema = Schema.Struct({
118
+ /** Path relative to the scan root. */
119
+ file: Schema.String,
120
+ /** 1-indexed line where the JSDoc opens. */
121
+ line: Schema.Number,
122
+ /** Best-effort name of the export immediately following the JSDoc. */
123
+ symbol: Schema.optional(Schema.String),
124
+ /** Detected host kind based on file location and symbol shape. */
125
+ kind: IdiomHostKindSchema
126
+ });
127
+ var IdiomSchema = Schema.Struct({
128
+ /** Globally unique AT Protocol NSID (https://atproto.com/specs/nsid). */
129
+ slug: Schema.String,
130
+ /** Leading JSDoc paragraph (rationale). */
131
+ summary: Schema.optional(Schema.String),
132
+ /** Applicability (required field per IDIOMS.md). */
133
+ applies: Schema.String,
134
+ /** Anti-pattern this replaces. */
135
+ insteadOf: Schema.optional(Schema.String),
136
+ /** Raw {@link …} targets named under `uses:`. */
137
+ uses: Schema.Array(Schema.String),
138
+ /** Slugs of related idioms. */
139
+ related: Schema.Array(Schema.String),
140
+ host: IdiomHostSchema
141
+ });
142
+
143
+ // src/schemas.ts
144
+ import * as Schema2 from "effect/Schema";
13
145
  import { trim } from "@dxos/util";
14
146
  var PickerAnnotationId = "@dxos/introspect-tools/picker";
15
147
  var getPicker = (ast) => ast.annotations[PickerAnnotationId];
16
- var ListOptionsInput = Schema.Struct({
17
- limit: Schema.optional(Schema.Number.pipe(Schema.int(), Schema.positive(), Schema.lessThanOrEqualTo(MAX_LIST_LIMIT))).annotations({
148
+ var ListOptionsInput = Schema2.Struct({
149
+ limit: Schema2.optional(Schema2.Number.pipe(Schema2.int(), Schema2.positive(), Schema2.lessThanOrEqualTo(MAX_LIST_LIMIT))).annotations({
18
150
  title: "Limit",
19
151
  description: trim`
20
152
  Maximum number of items. Default ${DEFAULT_LIST_LIMIT}; max ${MAX_LIST_LIMIT}.
21
153
  `
22
154
  }),
23
- compact: Schema.optional(Schema.Boolean).annotations({
155
+ compact: Schema2.optional(Schema2.Boolean).annotations({
24
156
  title: "Compact",
25
157
  description: trim`
26
158
  If true, returns only the most-essential identifying fields for each item — about 1/4 the response size.
@@ -28,75 +160,75 @@ var ListOptionsInput = Schema.Struct({
28
160
  `
29
161
  })
30
162
  });
31
- var SymbolKindEnum = Schema.Literal("function", "class", "interface", "type", "enum", "variable", "namespace");
32
- var IncludeEnum = Schema.Literal("source", "jsdoc");
33
- var ListPackagesInput = Schema.Struct({
34
- name: Schema.optional(Schema.String).annotations({
163
+ var SymbolKindEnum = Schema2.Literal("function", "class", "interface", "type", "enum", "variable", "namespace");
164
+ var IncludeEnum = Schema2.Literal("source", "jsdoc");
165
+ var ListPackagesInput = Schema2.Struct({
166
+ name: Schema2.optional(Schema2.String).annotations({
35
167
  title: "Name filter",
36
168
  description: "Substring of the package name (case-insensitive).",
37
169
  [PickerAnnotationId]: "package-name"
38
170
  }),
39
- pathPrefix: Schema.optional(Schema.String).annotations({
171
+ pathPrefix: Schema2.optional(Schema2.String).annotations({
40
172
  title: "Path prefix"
41
173
  }),
42
- privateOnly: Schema.optional(Schema.Boolean).annotations({
174
+ privateOnly: Schema2.optional(Schema2.Boolean).annotations({
43
175
  title: "Private only",
44
176
  description: "If true, only include workspace-private packages."
45
177
  }),
46
178
  ...ListOptionsInput.fields
47
179
  });
48
- var GetPackageInput = Schema.Struct({
49
- name: Schema.String.annotations({
180
+ var GetPackageInput = Schema2.Struct({
181
+ name: Schema2.String.annotations({
50
182
  title: "Package name",
51
183
  description: 'Exact package name, e.g. "@dxos/echo".',
52
184
  [PickerAnnotationId]: "package-name"
53
185
  })
54
186
  });
55
- var ListSymbolsInput = Schema.Struct({
56
- package: Schema.String.annotations({
187
+ var ListSymbolsInput = Schema2.Struct({
188
+ package: Schema2.String.annotations({
57
189
  title: "Package",
58
190
  description: 'Exact package name, e.g. "@dxos/ai".',
59
191
  [PickerAnnotationId]: "package-name"
60
192
  }),
61
- kind: Schema.optional(SymbolKindEnum).annotations({
193
+ kind: Schema2.optional(SymbolKindEnum).annotations({
62
194
  title: "Kind",
63
195
  description: "Optional filter on declaration kind."
64
196
  }),
65
197
  ...ListOptionsInput.fields
66
198
  });
67
- var FindSymbolInput = Schema.Struct({
68
- query: Schema.String.annotations({
199
+ var FindSymbolInput = Schema2.Struct({
200
+ query: Schema2.String.annotations({
69
201
  title: "Query",
70
202
  description: "Symbol name or partial name (case-insensitive)."
71
203
  }),
72
- kind: Schema.optional(SymbolKindEnum).annotations({
204
+ kind: Schema2.optional(SymbolKindEnum).annotations({
73
205
  title: "Kind",
74
206
  description: "Optional filter on declaration kind."
75
207
  }),
76
208
  ...ListOptionsInput.fields
77
209
  });
78
- var GetSymbolInput = Schema.Struct({
79
- ref: Schema.String.annotations({
210
+ var GetSymbolInput = Schema2.Struct({
211
+ ref: Schema2.String.annotations({
80
212
  title: "Symbol ref",
81
213
  description: 'Symbol ref in the form "<package>#<name>", e.g. "@dxos/echo#Expando".'
82
214
  }),
83
- include: Schema.optional(Schema.Array(IncludeEnum)).annotations({
215
+ include: Schema2.optional(Schema2.Array(IncludeEnum)).annotations({
84
216
  title: "Include",
85
217
  description: "Optional fields to expand; default returns signature + summary only."
86
218
  })
87
219
  });
88
- var ListPluginsInput = Schema.Struct({
220
+ var ListPluginsInput = Schema2.Struct({
89
221
  // No picker annotation — this is a free-form substring filter, not an
90
222
  // exact-match selector. Picking from the list of known plugin ids would
91
223
  // defeat the purpose of `list_plugins`.
92
- id: Schema.optional(Schema.String).annotations({
224
+ id: Schema2.optional(Schema2.String).annotations({
93
225
  title: "Plugin id",
94
226
  description: "Substring of the plugin id (case-insensitive). Omit to list every plugin."
95
227
  }),
96
228
  ...ListOptionsInput.fields
97
229
  });
98
- var PluginIdFilter = Schema.Struct({
99
- id: Schema.optional(Schema.String).annotations({
230
+ var PluginIdFilter = Schema2.Struct({
231
+ id: Schema2.optional(Schema2.String).annotations({
100
232
  title: "Plugin id",
101
233
  [PickerAnnotationId]: "plugin-id"
102
234
  }),
@@ -106,6 +238,18 @@ var ListSurfacesInput = PluginIdFilter;
106
238
  var ListCapabilitiesInput = PluginIdFilter;
107
239
  var ListOperationsInput = PluginIdFilter;
108
240
  var ListSchemasInput = PluginIdFilter;
241
+ var IdiomHostKindEnum = Schema2.Literal("story", "test", "symbol");
242
+ var ListIdiomsInput = Schema2.Struct({
243
+ slug: Schema2.optional(Schema2.String).annotations({
244
+ title: "Slug filter",
245
+ description: "Substring of the idiom slug (case-insensitive). Omit to list every idiom."
246
+ }),
247
+ hostKind: Schema2.optional(IdiomHostKindEnum).annotations({
248
+ title: "Host kind",
249
+ description: "Filter idioms by their host site: `symbol` (production code), `story`, or `test`."
250
+ }),
251
+ ...ListOptionsInput.fields
252
+ });
109
253
 
110
254
  // src/metadata.ts
111
255
  var TOOL_METADATA = {
@@ -116,7 +260,10 @@ var TOOL_METADATA = {
116
260
  Supports filtering by name substring, path prefix (e.g. "packages/plugins"), or workspace-private only.
117
261
  Returns lightweight rows; call get_package for dependency and entry-point detail.
118
262
  `,
119
- inputSchema: ListPackagesInput
263
+ inputSchema: ListPackagesInput,
264
+ outputSchema: Schema3.Struct({
265
+ packages: Schema3.Array(PackageSchema)
266
+ })
120
267
  },
121
268
  get_package: {
122
269
  title: "Get package detail",
@@ -125,7 +272,10 @@ var TOOL_METADATA = {
125
272
  Returns workspace and external dependencies, entry points, and metadata.
126
273
  Use after list_packages or when the user references a package directly.
127
274
  `,
128
- inputSchema: GetPackageInput
275
+ inputSchema: GetPackageInput,
276
+ outputSchema: Schema3.Struct({
277
+ package: Schema3.NullOr(PackageSchema)
278
+ })
129
279
  },
130
280
  list_symbols: {
131
281
  title: "List all exported symbols of a package",
@@ -134,7 +284,10 @@ var TOOL_METADATA = {
134
284
  Use this when the user wants to know what a specific package offers, or to browse a package after get_package.
135
285
  Returns lightweight rows with refs you can pass to get_symbol; capped at 30 — refine with \`kind\` or call get_symbol directly.
136
286
  `,
137
- inputSchema: ListSymbolsInput
287
+ inputSchema: ListSymbolsInput,
288
+ outputSchema: Schema3.Struct({
289
+ symbols: Schema3.Array(SymbolMatchSchema)
290
+ })
138
291
  },
139
292
  find_symbol: {
140
293
  title: "Find an exported symbol by name",
@@ -143,7 +296,10 @@ var TOOL_METADATA = {
143
296
  Use this when the user references something by name and you need to locate which package owns it before reading more.
144
297
  Returns refs you can pass to get_symbol. Ranking: exact match, then prefix, then substring.
145
298
  `,
146
- inputSchema: FindSymbolInput
299
+ inputSchema: FindSymbolInput,
300
+ outputSchema: Schema3.Struct({
301
+ matches: Schema3.Array(SymbolMatchSchema)
302
+ })
147
303
  },
148
304
  get_symbol: {
149
305
  title: "Get symbol detail",
@@ -152,7 +308,10 @@ var TOOL_METADATA = {
152
308
  Default response is signature + JSDoc summary + source location.
153
309
  Pass include=["source"] to expand the full declaration text, include=["jsdoc"] for the full JSDoc body.
154
310
  `,
155
- inputSchema: GetSymbolInput
311
+ inputSchema: GetSymbolInput,
312
+ outputSchema: Schema3.Struct({
313
+ symbol: Schema3.NullOr(SymbolDetailSchema)
314
+ })
156
315
  },
157
316
  list_plugins: {
158
317
  title: "List Composer plugins",
@@ -161,7 +320,10 @@ var TOOL_METADATA = {
161
320
  Use this to discover what plugins exist before drilling into surfaces / capabilities / operations / schemas.
162
321
  Filter by \`id\` substring (e.g. "markdown") to narrow the list.
163
322
  `,
164
- inputSchema: ListPluginsInput
323
+ inputSchema: ListPluginsInput,
324
+ outputSchema: Schema3.Struct({
325
+ plugins: Schema3.Array(PluginSchema)
326
+ })
165
327
  },
166
328
  list_surfaces: {
167
329
  title: "List surfaces",
@@ -170,7 +332,10 @@ var TOOL_METADATA = {
170
332
  surface ids when wiring a new container, or to check whether a surface name is already taken.
171
333
  Filter by \`id\` (plugin id) to scope to a single plugin's surfaces.
172
334
  `,
173
- inputSchema: ListSurfacesInput
335
+ inputSchema: ListSurfacesInput,
336
+ outputSchema: Schema3.Struct({
337
+ surfaces: Schema3.Array(SurfaceSchema)
338
+ })
174
339
  },
175
340
  list_capabilities: {
176
341
  title: "List capability contributions",
@@ -178,7 +343,10 @@ var TOOL_METADATA = {
178
343
  List Capability.contributes(<key>, ...) calls across the monorepo. Use this to discover which capability
179
344
  keys are produced (or required) by which plugins. Filter by \`id\` (plugin id) to scope to a single plugin.
180
345
  `,
181
- inputSchema: ListCapabilitiesInput
346
+ inputSchema: ListCapabilitiesInput,
347
+ outputSchema: Schema3.Struct({
348
+ capabilities: Schema3.Array(CapabilitySchema)
349
+ })
182
350
  },
183
351
  list_operations: {
184
352
  title: "List operations",
@@ -189,7 +357,10 @@ var TOOL_METADATA = {
189
357
  these via \`Capabilities.OperationHandler\`. Filter by \`id\` (plugin id)
190
358
  to scope to a single plugin.
191
359
  `,
192
- inputSchema: ListOperationsInput
360
+ inputSchema: ListOperationsInput,
361
+ outputSchema: Schema3.Struct({
362
+ operations: Schema3.Array(OperationSchema)
363
+ })
193
364
  },
194
365
  list_schemas: {
195
366
  title: "List schemas",
@@ -198,114 +369,39 @@ var TOOL_METADATA = {
198
369
  Use this to discover what data types exist before reading their shape.
199
370
  Filter by \`id\` (plugin id, e.g. "org.dxos.plugin.markdown") to scope to a single plugin's schemas.
200
371
  `,
201
- inputSchema: ListSchemasInput
372
+ inputSchema: ListSchemasInput,
373
+ outputSchema: Schema3.Struct({
374
+ schemas: Schema3.Array(SchemaSchema)
375
+ })
376
+ },
377
+ list_idioms: {
378
+ title: "List idioms",
379
+ description: trim2`
380
+ List idioms catalogued across the monorepo. An *idiom* is a JSDoc-tagged
381
+ reference example (\`@idiom <slug>\`) that pins the canonical way to use a
382
+ symbol — applicability, anti-pattern, and links to related idioms. Use this
383
+ to discover how a feature is meant to be used, or to find a worked example
384
+ before writing new code. Filter by \`slug\` substring or by \`hostKind\`
385
+ (\`symbol\`, \`story\`, \`test\`).
386
+ `,
387
+ inputSchema: ListIdiomsInput,
388
+ outputSchema: Schema3.Struct({
389
+ idioms: Schema3.Array(IdiomSchema)
390
+ })
202
391
  }
203
392
  };
204
393
  var inputSchemaToZod = (struct) => effectFieldsToZod(struct);
205
-
206
- // src/output-schemas.ts
207
- import * as Schema2 from "effect/Schema";
208
- var SymbolKindSchema = Schema2.Literal("function", "class", "interface", "type", "enum", "variable", "namespace", "unknown");
209
- var SymbolIncludeSchema = Schema2.Literal("source", "jsdoc");
210
- var SourceLocationSchema = Schema2.Struct({
211
- file: Schema2.String,
212
- line: Schema2.Number,
213
- column: Schema2.Number
214
- });
215
- var PluginIdSchema = Schema2.String;
216
- var PackageSchema = Schema2.Struct({
217
- name: Schema2.String,
218
- version: Schema2.String,
219
- private: Schema2.Boolean,
220
- /** Path relative to the monorepo root (no trailing slash). */
221
- path: Schema2.String,
222
- description: Schema2.optional(Schema2.String)
223
- });
224
- var PackageDetailSchema = Schema2.Struct({
225
- ...PackageSchema.fields,
226
- /** Workspace dependencies (other packages in the monorepo). */
227
- workspaceDependencies: Schema2.Array(Schema2.String),
228
- /** External (catalog or pinned) dependency names. */
229
- externalDependencies: Schema2.Array(Schema2.String),
230
- /** Resolved entry points (relative to package root). */
231
- entryPoints: Schema2.Array(Schema2.String),
232
- /** Number of exported symbols at the top level. */
233
- exportCount: Schema2.Number
234
- });
235
- var SymbolMatchSchema = Schema2.Struct({
236
- ref: Schema2.String,
237
- package: Schema2.String,
238
- name: Schema2.String,
239
- kind: SymbolKindSchema,
240
- /** One-line summary from JSDoc, if any. */
241
- summary: Schema2.optional(Schema2.String)
242
- });
243
- var SymbolDetailSchema = Schema2.Struct({
244
- ref: Schema2.String,
245
- package: Schema2.String,
246
- name: Schema2.String,
247
- kind: SymbolKindSchema,
248
- signature: Schema2.String,
249
- jsdoc: Schema2.optional(Schema2.String),
250
- summary: Schema2.optional(Schema2.String),
251
- location: SourceLocationSchema,
252
- /** Source text — only present when `include` requested it. */
253
- source: Schema2.optional(Schema2.String)
254
- });
255
- var PluginSchema = Schema2.Struct({
256
- /** e.g. `org.dxos.plugin.code`. */
257
- id: PluginIdSchema,
258
- /** npm package name, e.g. `@dxos/plugin-code`. */
259
- package: Schema2.String,
260
- name: Schema2.optional(Schema2.String),
261
- description: Schema2.optional(Schema2.String),
262
- icon: Schema2.optional(Schema2.String),
263
- iconHue: Schema2.optional(Schema2.String),
264
- /** Source location of the `meta` declaration. */
265
- metaLocation: SourceLocationSchema
266
- });
267
- var SurfaceSchema = Schema2.Struct({
268
- pluginId: PluginIdSchema,
269
- /** Surface id passed to `Surface.create({ id })`. */
270
- id: Schema2.String,
271
- /** One or more roles the surface answers to. */
272
- role: Schema2.Array(Schema2.String),
273
- location: SourceLocationSchema
274
- });
275
- var CapabilitySchema = Schema2.Struct({
276
- pluginId: PluginIdSchema,
277
- /** Identifier expression as written in source, e.g. `Capabilities.ReactSurface`. */
278
- type: Schema2.String,
279
- location: SourceLocationSchema
280
- });
281
- var OperationSchema = Schema2.Struct({
282
- pluginId: PluginIdSchema,
283
- /** Operation identifier expression. */
284
- type: Schema2.String,
285
- location: SourceLocationSchema
286
- });
287
- var SchemaSchema = Schema2.Struct({
288
- pluginId: PluginIdSchema,
289
- /** Identifier expression as written in `addSchemaModule`, e.g. `CodeProject.CodeProject`. */
290
- name: Schema2.String,
291
- /** Resolved typename (e.g. `org.dxos.type.codeProject`) when statically extractable. */
292
- typename: Schema2.optional(Schema2.String),
293
- location: SourceLocationSchema
294
- });
295
- var PluginDetailSchema = Schema2.Struct({
296
- ...PluginSchema.fields,
297
- surfaces: Schema2.Array(SurfaceSchema),
298
- capabilities: Schema2.Array(CapabilitySchema),
299
- operations: Schema2.Array(OperationSchema),
300
- schemas: Schema2.Array(SchemaSchema)
301
- });
302
394
  export {
303
395
  CapabilitySchema,
304
396
  DEFAULT_LIST_LIMIT,
305
397
  FindSymbolInput,
306
398
  GetPackageInput,
307
399
  GetSymbolInput,
400
+ IdiomHostKindSchema,
401
+ IdiomHostSchema,
402
+ IdiomSchema,
308
403
  ListCapabilitiesInput,
404
+ ListIdiomsInput,
309
405
  ListOperationsInput,
310
406
  ListOptionsInput,
311
407
  ListPackagesInput,