@dxos/introspect-tools 0.8.4-main.765dc60934 → 0.8.4-main.8baae0fced
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/dist/lib/browser/index.mjs +205 -171
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +205 -171
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/metadata.d.ts +8 -0
- package/dist/types/src/metadata.d.ts.map +1 -1
- package/dist/types/src/metadata.test.d.ts +2 -0
- package/dist/types/src/metadata.test.d.ts.map +1 -0
- package/dist/types/src/output-schemas.d.ts +14 -0
- package/dist/types/src/output-schemas.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/index.ts +1 -0
- package/src/metadata.test.ts +55 -0
- package/src/metadata.ts +31 -0
- package/src/output-schemas.ts +19 -0
|
@@ -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 =
|
|
17
|
-
limit:
|
|
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:
|
|
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 =
|
|
32
|
-
var IncludeEnum =
|
|
33
|
-
var ListPackagesInput =
|
|
34
|
-
name:
|
|
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:
|
|
171
|
+
pathPrefix: Schema2.optional(Schema2.String).annotations({
|
|
40
172
|
title: "Path prefix"
|
|
41
173
|
}),
|
|
42
|
-
privateOnly:
|
|
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 =
|
|
49
|
-
name:
|
|
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 =
|
|
56
|
-
package:
|
|
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:
|
|
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 =
|
|
68
|
-
query:
|
|
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:
|
|
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 =
|
|
79
|
-
ref:
|
|
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:
|
|
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 =
|
|
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:
|
|
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 =
|
|
99
|
-
id:
|
|
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,13 +238,13 @@ var ListSurfacesInput = PluginIdFilter;
|
|
|
106
238
|
var ListCapabilitiesInput = PluginIdFilter;
|
|
107
239
|
var ListOperationsInput = PluginIdFilter;
|
|
108
240
|
var ListSchemasInput = PluginIdFilter;
|
|
109
|
-
var IdiomHostKindEnum =
|
|
110
|
-
var ListIdiomsInput =
|
|
111
|
-
slug:
|
|
241
|
+
var IdiomHostKindEnum = Schema2.Literal("story", "test", "symbol");
|
|
242
|
+
var ListIdiomsInput = Schema2.Struct({
|
|
243
|
+
slug: Schema2.optional(Schema2.String).annotations({
|
|
112
244
|
title: "Slug filter",
|
|
113
245
|
description: "Substring of the idiom slug (case-insensitive). Omit to list every idiom."
|
|
114
246
|
}),
|
|
115
|
-
hostKind:
|
|
247
|
+
hostKind: Schema2.optional(IdiomHostKindEnum).annotations({
|
|
116
248
|
title: "Host kind",
|
|
117
249
|
description: "Filter idioms by their host site: `symbol` (production code), `story`, or `test`."
|
|
118
250
|
}),
|
|
@@ -128,7 +260,10 @@ var TOOL_METADATA = {
|
|
|
128
260
|
Supports filtering by name substring, path prefix (e.g. "packages/plugins"), or workspace-private only.
|
|
129
261
|
Returns lightweight rows; call get_package for dependency and entry-point detail.
|
|
130
262
|
`,
|
|
131
|
-
inputSchema: ListPackagesInput
|
|
263
|
+
inputSchema: ListPackagesInput,
|
|
264
|
+
outputSchema: Schema3.Struct({
|
|
265
|
+
packages: Schema3.Array(PackageSchema)
|
|
266
|
+
})
|
|
132
267
|
},
|
|
133
268
|
get_package: {
|
|
134
269
|
title: "Get package detail",
|
|
@@ -137,7 +272,10 @@ var TOOL_METADATA = {
|
|
|
137
272
|
Returns workspace and external dependencies, entry points, and metadata.
|
|
138
273
|
Use after list_packages or when the user references a package directly.
|
|
139
274
|
`,
|
|
140
|
-
inputSchema: GetPackageInput
|
|
275
|
+
inputSchema: GetPackageInput,
|
|
276
|
+
outputSchema: Schema3.Struct({
|
|
277
|
+
package: Schema3.NullOr(PackageSchema)
|
|
278
|
+
})
|
|
141
279
|
},
|
|
142
280
|
list_symbols: {
|
|
143
281
|
title: "List all exported symbols of a package",
|
|
@@ -146,7 +284,10 @@ var TOOL_METADATA = {
|
|
|
146
284
|
Use this when the user wants to know what a specific package offers, or to browse a package after get_package.
|
|
147
285
|
Returns lightweight rows with refs you can pass to get_symbol; capped at 30 — refine with \`kind\` or call get_symbol directly.
|
|
148
286
|
`,
|
|
149
|
-
inputSchema: ListSymbolsInput
|
|
287
|
+
inputSchema: ListSymbolsInput,
|
|
288
|
+
outputSchema: Schema3.Struct({
|
|
289
|
+
symbols: Schema3.Array(SymbolMatchSchema)
|
|
290
|
+
})
|
|
150
291
|
},
|
|
151
292
|
find_symbol: {
|
|
152
293
|
title: "Find an exported symbol by name",
|
|
@@ -155,7 +296,10 @@ var TOOL_METADATA = {
|
|
|
155
296
|
Use this when the user references something by name and you need to locate which package owns it before reading more.
|
|
156
297
|
Returns refs you can pass to get_symbol. Ranking: exact match, then prefix, then substring.
|
|
157
298
|
`,
|
|
158
|
-
inputSchema: FindSymbolInput
|
|
299
|
+
inputSchema: FindSymbolInput,
|
|
300
|
+
outputSchema: Schema3.Struct({
|
|
301
|
+
matches: Schema3.Array(SymbolMatchSchema)
|
|
302
|
+
})
|
|
159
303
|
},
|
|
160
304
|
get_symbol: {
|
|
161
305
|
title: "Get symbol detail",
|
|
@@ -164,7 +308,10 @@ var TOOL_METADATA = {
|
|
|
164
308
|
Default response is signature + JSDoc summary + source location.
|
|
165
309
|
Pass include=["source"] to expand the full declaration text, include=["jsdoc"] for the full JSDoc body.
|
|
166
310
|
`,
|
|
167
|
-
inputSchema: GetSymbolInput
|
|
311
|
+
inputSchema: GetSymbolInput,
|
|
312
|
+
outputSchema: Schema3.Struct({
|
|
313
|
+
symbol: Schema3.NullOr(SymbolDetailSchema)
|
|
314
|
+
})
|
|
168
315
|
},
|
|
169
316
|
list_plugins: {
|
|
170
317
|
title: "List Composer plugins",
|
|
@@ -173,7 +320,10 @@ var TOOL_METADATA = {
|
|
|
173
320
|
Use this to discover what plugins exist before drilling into surfaces / capabilities / operations / schemas.
|
|
174
321
|
Filter by \`id\` substring (e.g. "markdown") to narrow the list.
|
|
175
322
|
`,
|
|
176
|
-
inputSchema: ListPluginsInput
|
|
323
|
+
inputSchema: ListPluginsInput,
|
|
324
|
+
outputSchema: Schema3.Struct({
|
|
325
|
+
plugins: Schema3.Array(PluginSchema)
|
|
326
|
+
})
|
|
177
327
|
},
|
|
178
328
|
list_surfaces: {
|
|
179
329
|
title: "List surfaces",
|
|
@@ -182,7 +332,10 @@ var TOOL_METADATA = {
|
|
|
182
332
|
surface ids when wiring a new container, or to check whether a surface name is already taken.
|
|
183
333
|
Filter by \`id\` (plugin id) to scope to a single plugin's surfaces.
|
|
184
334
|
`,
|
|
185
|
-
inputSchema: ListSurfacesInput
|
|
335
|
+
inputSchema: ListSurfacesInput,
|
|
336
|
+
outputSchema: Schema3.Struct({
|
|
337
|
+
surfaces: Schema3.Array(SurfaceSchema)
|
|
338
|
+
})
|
|
186
339
|
},
|
|
187
340
|
list_capabilities: {
|
|
188
341
|
title: "List capability contributions",
|
|
@@ -190,7 +343,10 @@ var TOOL_METADATA = {
|
|
|
190
343
|
List Capability.contributes(<key>, ...) calls across the monorepo. Use this to discover which capability
|
|
191
344
|
keys are produced (or required) by which plugins. Filter by \`id\` (plugin id) to scope to a single plugin.
|
|
192
345
|
`,
|
|
193
|
-
inputSchema: ListCapabilitiesInput
|
|
346
|
+
inputSchema: ListCapabilitiesInput,
|
|
347
|
+
outputSchema: Schema3.Struct({
|
|
348
|
+
capabilities: Schema3.Array(CapabilitySchema)
|
|
349
|
+
})
|
|
194
350
|
},
|
|
195
351
|
list_operations: {
|
|
196
352
|
title: "List operations",
|
|
@@ -201,7 +357,10 @@ var TOOL_METADATA = {
|
|
|
201
357
|
these via \`Capabilities.OperationHandler\`. Filter by \`id\` (plugin id)
|
|
202
358
|
to scope to a single plugin.
|
|
203
359
|
`,
|
|
204
|
-
inputSchema: ListOperationsInput
|
|
360
|
+
inputSchema: ListOperationsInput,
|
|
361
|
+
outputSchema: Schema3.Struct({
|
|
362
|
+
operations: Schema3.Array(OperationSchema)
|
|
363
|
+
})
|
|
205
364
|
},
|
|
206
365
|
list_schemas: {
|
|
207
366
|
title: "List schemas",
|
|
@@ -210,7 +369,10 @@ var TOOL_METADATA = {
|
|
|
210
369
|
Use this to discover what data types exist before reading their shape.
|
|
211
370
|
Filter by \`id\` (plugin id, e.g. "org.dxos.plugin.markdown") to scope to a single plugin's schemas.
|
|
212
371
|
`,
|
|
213
|
-
inputSchema: ListSchemasInput
|
|
372
|
+
inputSchema: ListSchemasInput,
|
|
373
|
+
outputSchema: Schema3.Struct({
|
|
374
|
+
schemas: Schema3.Array(SchemaSchema)
|
|
375
|
+
})
|
|
214
376
|
},
|
|
215
377
|
list_idioms: {
|
|
216
378
|
title: "List idioms",
|
|
@@ -222,141 +384,13 @@ var TOOL_METADATA = {
|
|
|
222
384
|
before writing new code. Filter by \`slug\` substring or by \`hostKind\`
|
|
223
385
|
(\`symbol\`, \`story\`, \`test\`).
|
|
224
386
|
`,
|
|
225
|
-
inputSchema: ListIdiomsInput
|
|
387
|
+
inputSchema: ListIdiomsInput,
|
|
388
|
+
outputSchema: Schema3.Struct({
|
|
389
|
+
idioms: Schema3.Array(IdiomSchema)
|
|
390
|
+
})
|
|
226
391
|
}
|
|
227
392
|
};
|
|
228
393
|
var inputSchemaToZod = (struct) => effectFieldsToZod(struct);
|
|
229
|
-
|
|
230
|
-
// src/output-schemas.ts
|
|
231
|
-
import * as Schema2 from "effect/Schema";
|
|
232
|
-
var SymbolKindSchema = Schema2.Literal("function", "class", "interface", "type", "enum", "variable", "namespace", "unknown");
|
|
233
|
-
var SymbolIncludeSchema = Schema2.Literal("source", "jsdoc");
|
|
234
|
-
var SourceLocationSchema = Schema2.Struct({
|
|
235
|
-
file: Schema2.String,
|
|
236
|
-
line: Schema2.Number,
|
|
237
|
-
column: Schema2.Number
|
|
238
|
-
});
|
|
239
|
-
var PluginIdSchema = Schema2.String;
|
|
240
|
-
var PackageSchema = Schema2.Struct({
|
|
241
|
-
name: Schema2.String,
|
|
242
|
-
version: Schema2.String,
|
|
243
|
-
private: Schema2.Boolean,
|
|
244
|
-
/** Path relative to the monorepo root (no trailing slash). */
|
|
245
|
-
path: Schema2.String,
|
|
246
|
-
description: Schema2.optional(Schema2.String)
|
|
247
|
-
});
|
|
248
|
-
var PackageDetailSchema = Schema2.Struct({
|
|
249
|
-
...PackageSchema.fields,
|
|
250
|
-
/** Workspace dependencies (other packages in the monorepo). */
|
|
251
|
-
workspaceDependencies: Schema2.Array(Schema2.String),
|
|
252
|
-
/** External (catalog or pinned) dependency names. */
|
|
253
|
-
externalDependencies: Schema2.Array(Schema2.String),
|
|
254
|
-
/** Resolved entry points (relative to package root). */
|
|
255
|
-
entryPoints: Schema2.Array(Schema2.String),
|
|
256
|
-
/** Number of exported symbols at the top level. */
|
|
257
|
-
exportCount: Schema2.Number
|
|
258
|
-
});
|
|
259
|
-
var SymbolMatchSchema = Schema2.Struct({
|
|
260
|
-
ref: Schema2.String,
|
|
261
|
-
package: Schema2.String,
|
|
262
|
-
name: Schema2.String,
|
|
263
|
-
kind: SymbolKindSchema,
|
|
264
|
-
/** One-line summary from JSDoc, if any. */
|
|
265
|
-
summary: Schema2.optional(Schema2.String)
|
|
266
|
-
});
|
|
267
|
-
var SymbolDetailSchema = Schema2.Struct({
|
|
268
|
-
ref: Schema2.String,
|
|
269
|
-
package: Schema2.String,
|
|
270
|
-
name: Schema2.String,
|
|
271
|
-
kind: SymbolKindSchema,
|
|
272
|
-
signature: Schema2.String,
|
|
273
|
-
jsdoc: Schema2.optional(Schema2.String),
|
|
274
|
-
summary: Schema2.optional(Schema2.String),
|
|
275
|
-
location: SourceLocationSchema,
|
|
276
|
-
/** Source text — only present when `include` requested it. */
|
|
277
|
-
source: Schema2.optional(Schema2.String)
|
|
278
|
-
});
|
|
279
|
-
var PluginSchema = Schema2.Struct({
|
|
280
|
-
/** e.g. `org.dxos.plugin.code`. */
|
|
281
|
-
id: PluginIdSchema,
|
|
282
|
-
/** npm package name, e.g. `@dxos/plugin-code`. */
|
|
283
|
-
package: Schema2.String,
|
|
284
|
-
name: Schema2.optional(Schema2.String),
|
|
285
|
-
description: Schema2.optional(Schema2.String),
|
|
286
|
-
icon: Schema2.optional(Schema2.String),
|
|
287
|
-
iconHue: Schema2.optional(Schema2.String),
|
|
288
|
-
/** Static tags read from `meta.tags` (e.g. `['labs']`). Empty array if absent. */
|
|
289
|
-
tags: Schema2.Array(Schema2.String),
|
|
290
|
-
/**
|
|
291
|
-
* Ids of other plugins this plugin depends on, derived from its package's
|
|
292
|
-
* `workspace:*` dependencies. Sorted for deterministic output. Empty array
|
|
293
|
-
* if the plugin's package has no dependencies on other plugin packages.
|
|
294
|
-
*/
|
|
295
|
-
dependsOn: Schema2.Array(PluginIdSchema),
|
|
296
|
-
/** Source location of the `meta` declaration. */
|
|
297
|
-
metaLocation: SourceLocationSchema
|
|
298
|
-
});
|
|
299
|
-
var SurfaceSchema = Schema2.Struct({
|
|
300
|
-
pluginId: PluginIdSchema,
|
|
301
|
-
/** Surface id passed to `Surface.create({ id })`. */
|
|
302
|
-
id: Schema2.String,
|
|
303
|
-
/** One or more roles the surface answers to. */
|
|
304
|
-
role: Schema2.Array(Schema2.String),
|
|
305
|
-
location: SourceLocationSchema
|
|
306
|
-
});
|
|
307
|
-
var CapabilitySchema = Schema2.Struct({
|
|
308
|
-
pluginId: PluginIdSchema,
|
|
309
|
-
/** Identifier expression as written in source, e.g. `Capabilities.ReactSurface`. */
|
|
310
|
-
type: Schema2.String,
|
|
311
|
-
location: SourceLocationSchema
|
|
312
|
-
});
|
|
313
|
-
var OperationSchema = Schema2.Struct({
|
|
314
|
-
pluginId: PluginIdSchema,
|
|
315
|
-
/** Operation identifier expression. */
|
|
316
|
-
type: Schema2.String,
|
|
317
|
-
location: SourceLocationSchema
|
|
318
|
-
});
|
|
319
|
-
var SchemaSchema = Schema2.Struct({
|
|
320
|
-
pluginId: PluginIdSchema,
|
|
321
|
-
/** Identifier expression as written in `addSchemaModule`, e.g. `CodeProject.CodeProject`. */
|
|
322
|
-
name: Schema2.String,
|
|
323
|
-
/** Resolved typename (e.g. `org.dxos.type.codeProject`) when statically extractable. */
|
|
324
|
-
typename: Schema2.optional(Schema2.String),
|
|
325
|
-
location: SourceLocationSchema
|
|
326
|
-
});
|
|
327
|
-
var PluginDetailSchema = Schema2.Struct({
|
|
328
|
-
...PluginSchema.fields,
|
|
329
|
-
surfaces: Schema2.Array(SurfaceSchema),
|
|
330
|
-
capabilities: Schema2.Array(CapabilitySchema),
|
|
331
|
-
operations: Schema2.Array(OperationSchema),
|
|
332
|
-
schemas: Schema2.Array(SchemaSchema)
|
|
333
|
-
});
|
|
334
|
-
var IdiomHostKindSchema = Schema2.Literal("story", "test", "symbol");
|
|
335
|
-
var IdiomHostSchema = Schema2.Struct({
|
|
336
|
-
/** Path relative to the scan root. */
|
|
337
|
-
file: Schema2.String,
|
|
338
|
-
/** 1-indexed line where the JSDoc opens. */
|
|
339
|
-
line: Schema2.Number,
|
|
340
|
-
/** Best-effort name of the export immediately following the JSDoc. */
|
|
341
|
-
symbol: Schema2.optional(Schema2.String),
|
|
342
|
-
/** Detected host kind based on file location and symbol shape. */
|
|
343
|
-
kind: IdiomHostKindSchema
|
|
344
|
-
});
|
|
345
|
-
var IdiomSchema = Schema2.Struct({
|
|
346
|
-
/** Globally unique AT Protocol NSID (https://atproto.com/specs/nsid). */
|
|
347
|
-
slug: Schema2.String,
|
|
348
|
-
/** Leading JSDoc paragraph (rationale). */
|
|
349
|
-
summary: Schema2.optional(Schema2.String),
|
|
350
|
-
/** Applicability (required field per IDIOMS.md). */
|
|
351
|
-
applies: Schema2.String,
|
|
352
|
-
/** Anti-pattern this replaces. */
|
|
353
|
-
insteadOf: Schema2.optional(Schema2.String),
|
|
354
|
-
/** Raw {@link …} targets named under `uses:`. */
|
|
355
|
-
uses: Schema2.Array(Schema2.String),
|
|
356
|
-
/** Slugs of related idioms. */
|
|
357
|
-
related: Schema2.Array(Schema2.String),
|
|
358
|
-
host: IdiomHostSchema
|
|
359
|
-
});
|
|
360
394
|
export {
|
|
361
395
|
CapabilitySchema,
|
|
362
396
|
DEFAULT_LIST_LIMIT,
|