@dxos/introspect-tools 0.8.4-main.fdfb99ef29 → 0.9.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.
- package/LICENSE +102 -5
- package/dist/lib/browser/index.mjs +258 -42
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +258 -42
- 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 +2 -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 +250 -0
- package/dist/types/src/output-schemas.d.ts.map +1 -0
- package/dist/types/src/schemas.d.ts +21 -0
- package/dist/types/src/schemas.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/src/index.ts +42 -0
- package/src/metadata.test.ts +55 -0
- package/src/metadata.ts +44 -0
- package/src/output-schemas.ts +223 -0
- package/src/schemas.ts +45 -3
package/LICENSE
CHANGED
|
@@ -1,8 +1,105 @@
|
|
|
1
|
-
|
|
2
|
-
Copyright (c) 2022 DXOS
|
|
1
|
+
# Functional Source License, Version 1.1, ALv2 Future License
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
## Abbreviation
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
FSL-1.1-Apache-2.0
|
|
7
6
|
|
|
8
|
-
|
|
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,20 +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
|
-
var
|
|
15
|
-
|
|
146
|
+
var PickerAnnotationId = "@dxos/introspect-tools/picker";
|
|
147
|
+
var getPicker = (ast) => ast.annotations[PickerAnnotationId];
|
|
148
|
+
var ListOptionsInput = Schema2.Struct({
|
|
149
|
+
limit: Schema2.optional(Schema2.Number.pipe(Schema2.int(), Schema2.positive(), Schema2.lessThanOrEqualTo(MAX_LIST_LIMIT))).annotations({
|
|
16
150
|
title: "Limit",
|
|
17
151
|
description: trim`
|
|
18
|
-
Maximum number of items
|
|
152
|
+
Maximum number of items. Default ${DEFAULT_LIST_LIMIT}; max ${MAX_LIST_LIMIT}.
|
|
19
153
|
`
|
|
20
154
|
}),
|
|
21
|
-
compact:
|
|
155
|
+
compact: Schema2.optional(Schema2.Boolean).annotations({
|
|
22
156
|
title: "Compact",
|
|
23
157
|
description: trim`
|
|
24
158
|
If true, returns only the most-essential identifying fields for each item — about 1/4 the response size.
|
|
@@ -26,72 +160,77 @@ var ListOptionsInput = Schema.Struct({
|
|
|
26
160
|
`
|
|
27
161
|
})
|
|
28
162
|
});
|
|
29
|
-
var SymbolKindEnum =
|
|
30
|
-
var IncludeEnum =
|
|
31
|
-
var ListPackagesInput =
|
|
32
|
-
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({
|
|
33
167
|
title: "Name filter",
|
|
34
|
-
description: "Substring of the package name (case-insensitive)."
|
|
168
|
+
description: "Substring of the package name (case-insensitive).",
|
|
169
|
+
[PickerAnnotationId]: "package-name"
|
|
35
170
|
}),
|
|
36
|
-
pathPrefix:
|
|
37
|
-
title: "Path prefix"
|
|
38
|
-
description: 'Restrict to packages whose path starts with this segment, e.g. "packages/plugins".'
|
|
171
|
+
pathPrefix: Schema2.optional(Schema2.String).annotations({
|
|
172
|
+
title: "Path prefix"
|
|
39
173
|
}),
|
|
40
|
-
privateOnly:
|
|
174
|
+
privateOnly: Schema2.optional(Schema2.Boolean).annotations({
|
|
41
175
|
title: "Private only",
|
|
42
176
|
description: "If true, only include workspace-private packages."
|
|
43
177
|
}),
|
|
44
178
|
...ListOptionsInput.fields
|
|
45
179
|
});
|
|
46
|
-
var GetPackageInput =
|
|
47
|
-
name:
|
|
180
|
+
var GetPackageInput = Schema2.Struct({
|
|
181
|
+
name: Schema2.String.annotations({
|
|
48
182
|
title: "Package name",
|
|
49
|
-
description: 'Exact package name, e.g. "@dxos/echo".'
|
|
183
|
+
description: 'Exact package name, e.g. "@dxos/echo".',
|
|
184
|
+
[PickerAnnotationId]: "package-name"
|
|
50
185
|
})
|
|
51
186
|
});
|
|
52
|
-
var ListSymbolsInput =
|
|
53
|
-
package:
|
|
187
|
+
var ListSymbolsInput = Schema2.Struct({
|
|
188
|
+
package: Schema2.String.annotations({
|
|
54
189
|
title: "Package",
|
|
55
|
-
description: 'Exact package name, e.g. "@dxos/ai".'
|
|
190
|
+
description: 'Exact package name, e.g. "@dxos/ai".',
|
|
191
|
+
[PickerAnnotationId]: "package-name"
|
|
56
192
|
}),
|
|
57
|
-
kind:
|
|
193
|
+
kind: Schema2.optional(SymbolKindEnum).annotations({
|
|
58
194
|
title: "Kind",
|
|
59
195
|
description: "Optional filter on declaration kind."
|
|
60
196
|
}),
|
|
61
197
|
...ListOptionsInput.fields
|
|
62
198
|
});
|
|
63
|
-
var FindSymbolInput =
|
|
64
|
-
query:
|
|
199
|
+
var FindSymbolInput = Schema2.Struct({
|
|
200
|
+
query: Schema2.String.annotations({
|
|
65
201
|
title: "Query",
|
|
66
202
|
description: "Symbol name or partial name (case-insensitive)."
|
|
67
203
|
}),
|
|
68
|
-
kind:
|
|
204
|
+
kind: Schema2.optional(SymbolKindEnum).annotations({
|
|
69
205
|
title: "Kind",
|
|
70
206
|
description: "Optional filter on declaration kind."
|
|
71
207
|
}),
|
|
72
208
|
...ListOptionsInput.fields
|
|
73
209
|
});
|
|
74
|
-
var GetSymbolInput =
|
|
75
|
-
ref:
|
|
210
|
+
var GetSymbolInput = Schema2.Struct({
|
|
211
|
+
ref: Schema2.String.annotations({
|
|
76
212
|
title: "Symbol ref",
|
|
77
213
|
description: 'Symbol ref in the form "<package>#<name>", e.g. "@dxos/echo#Expando".'
|
|
78
214
|
}),
|
|
79
|
-
include:
|
|
215
|
+
include: Schema2.optional(Schema2.Array(IncludeEnum)).annotations({
|
|
80
216
|
title: "Include",
|
|
81
217
|
description: "Optional fields to expand; default returns signature + summary only."
|
|
82
218
|
})
|
|
83
219
|
});
|
|
84
|
-
var ListPluginsInput =
|
|
85
|
-
|
|
220
|
+
var ListPluginsInput = Schema2.Struct({
|
|
221
|
+
// No picker annotation — this is a free-form substring filter, not an
|
|
222
|
+
// exact-match selector. Picking from the list of known plugin ids would
|
|
223
|
+
// defeat the purpose of `list_plugins`.
|
|
224
|
+
id: Schema2.optional(Schema2.String).annotations({
|
|
86
225
|
title: "Plugin id",
|
|
87
226
|
description: "Substring of the plugin id (case-insensitive). Omit to list every plugin."
|
|
88
227
|
}),
|
|
89
228
|
...ListOptionsInput.fields
|
|
90
229
|
});
|
|
91
|
-
var PluginIdFilter =
|
|
92
|
-
id:
|
|
230
|
+
var PluginIdFilter = Schema2.Struct({
|
|
231
|
+
id: Schema2.optional(Schema2.String).annotations({
|
|
93
232
|
title: "Plugin id",
|
|
94
|
-
|
|
233
|
+
[PickerAnnotationId]: "plugin-id"
|
|
95
234
|
}),
|
|
96
235
|
...ListOptionsInput.fields
|
|
97
236
|
});
|
|
@@ -99,6 +238,18 @@ var ListSurfacesInput = PluginIdFilter;
|
|
|
99
238
|
var ListCapabilitiesInput = PluginIdFilter;
|
|
100
239
|
var ListOperationsInput = PluginIdFilter;
|
|
101
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
|
+
});
|
|
102
253
|
|
|
103
254
|
// src/metadata.ts
|
|
104
255
|
var TOOL_METADATA = {
|
|
@@ -109,7 +260,10 @@ var TOOL_METADATA = {
|
|
|
109
260
|
Supports filtering by name substring, path prefix (e.g. "packages/plugins"), or workspace-private only.
|
|
110
261
|
Returns lightweight rows; call get_package for dependency and entry-point detail.
|
|
111
262
|
`,
|
|
112
|
-
inputSchema: ListPackagesInput
|
|
263
|
+
inputSchema: ListPackagesInput,
|
|
264
|
+
outputSchema: Schema3.Struct({
|
|
265
|
+
packages: Schema3.Array(PackageSchema)
|
|
266
|
+
})
|
|
113
267
|
},
|
|
114
268
|
get_package: {
|
|
115
269
|
title: "Get package detail",
|
|
@@ -118,7 +272,10 @@ var TOOL_METADATA = {
|
|
|
118
272
|
Returns workspace and external dependencies, entry points, and metadata.
|
|
119
273
|
Use after list_packages or when the user references a package directly.
|
|
120
274
|
`,
|
|
121
|
-
inputSchema: GetPackageInput
|
|
275
|
+
inputSchema: GetPackageInput,
|
|
276
|
+
outputSchema: Schema3.Struct({
|
|
277
|
+
package: Schema3.NullOr(PackageSchema)
|
|
278
|
+
})
|
|
122
279
|
},
|
|
123
280
|
list_symbols: {
|
|
124
281
|
title: "List all exported symbols of a package",
|
|
@@ -127,7 +284,10 @@ var TOOL_METADATA = {
|
|
|
127
284
|
Use this when the user wants to know what a specific package offers, or to browse a package after get_package.
|
|
128
285
|
Returns lightweight rows with refs you can pass to get_symbol; capped at 30 — refine with \`kind\` or call get_symbol directly.
|
|
129
286
|
`,
|
|
130
|
-
inputSchema: ListSymbolsInput
|
|
287
|
+
inputSchema: ListSymbolsInput,
|
|
288
|
+
outputSchema: Schema3.Struct({
|
|
289
|
+
symbols: Schema3.Array(SymbolMatchSchema)
|
|
290
|
+
})
|
|
131
291
|
},
|
|
132
292
|
find_symbol: {
|
|
133
293
|
title: "Find an exported symbol by name",
|
|
@@ -136,7 +296,10 @@ var TOOL_METADATA = {
|
|
|
136
296
|
Use this when the user references something by name and you need to locate which package owns it before reading more.
|
|
137
297
|
Returns refs you can pass to get_symbol. Ranking: exact match, then prefix, then substring.
|
|
138
298
|
`,
|
|
139
|
-
inputSchema: FindSymbolInput
|
|
299
|
+
inputSchema: FindSymbolInput,
|
|
300
|
+
outputSchema: Schema3.Struct({
|
|
301
|
+
matches: Schema3.Array(SymbolMatchSchema)
|
|
302
|
+
})
|
|
140
303
|
},
|
|
141
304
|
get_symbol: {
|
|
142
305
|
title: "Get symbol detail",
|
|
@@ -145,7 +308,10 @@ var TOOL_METADATA = {
|
|
|
145
308
|
Default response is signature + JSDoc summary + source location.
|
|
146
309
|
Pass include=["source"] to expand the full declaration text, include=["jsdoc"] for the full JSDoc body.
|
|
147
310
|
`,
|
|
148
|
-
inputSchema: GetSymbolInput
|
|
311
|
+
inputSchema: GetSymbolInput,
|
|
312
|
+
outputSchema: Schema3.Struct({
|
|
313
|
+
symbol: Schema3.NullOr(SymbolDetailSchema)
|
|
314
|
+
})
|
|
149
315
|
},
|
|
150
316
|
list_plugins: {
|
|
151
317
|
title: "List Composer plugins",
|
|
@@ -154,7 +320,10 @@ var TOOL_METADATA = {
|
|
|
154
320
|
Use this to discover what plugins exist before drilling into surfaces / capabilities / operations / schemas.
|
|
155
321
|
Filter by \`id\` substring (e.g. "markdown") to narrow the list.
|
|
156
322
|
`,
|
|
157
|
-
inputSchema: ListPluginsInput
|
|
323
|
+
inputSchema: ListPluginsInput,
|
|
324
|
+
outputSchema: Schema3.Struct({
|
|
325
|
+
plugins: Schema3.Array(PluginSchema)
|
|
326
|
+
})
|
|
158
327
|
},
|
|
159
328
|
list_surfaces: {
|
|
160
329
|
title: "List surfaces",
|
|
@@ -163,7 +332,10 @@ var TOOL_METADATA = {
|
|
|
163
332
|
surface ids when wiring a new container, or to check whether a surface name is already taken.
|
|
164
333
|
Filter by \`id\` (plugin id) to scope to a single plugin's surfaces.
|
|
165
334
|
`,
|
|
166
|
-
inputSchema: ListSurfacesInput
|
|
335
|
+
inputSchema: ListSurfacesInput,
|
|
336
|
+
outputSchema: Schema3.Struct({
|
|
337
|
+
surfaces: Schema3.Array(SurfaceSchema)
|
|
338
|
+
})
|
|
167
339
|
},
|
|
168
340
|
list_capabilities: {
|
|
169
341
|
title: "List capability contributions",
|
|
@@ -171,7 +343,10 @@ var TOOL_METADATA = {
|
|
|
171
343
|
List Capability.contributes(<key>, ...) calls across the monorepo. Use this to discover which capability
|
|
172
344
|
keys are produced (or required) by which plugins. Filter by \`id\` (plugin id) to scope to a single plugin.
|
|
173
345
|
`,
|
|
174
|
-
inputSchema: ListCapabilitiesInput
|
|
346
|
+
inputSchema: ListCapabilitiesInput,
|
|
347
|
+
outputSchema: Schema3.Struct({
|
|
348
|
+
capabilities: Schema3.Array(CapabilitySchema)
|
|
349
|
+
})
|
|
175
350
|
},
|
|
176
351
|
list_operations: {
|
|
177
352
|
title: "List operations",
|
|
@@ -182,7 +357,10 @@ var TOOL_METADATA = {
|
|
|
182
357
|
these via \`Capabilities.OperationHandler\`. Filter by \`id\` (plugin id)
|
|
183
358
|
to scope to a single plugin.
|
|
184
359
|
`,
|
|
185
|
-
inputSchema: ListOperationsInput
|
|
360
|
+
inputSchema: ListOperationsInput,
|
|
361
|
+
outputSchema: Schema3.Struct({
|
|
362
|
+
operations: Schema3.Array(OperationSchema)
|
|
363
|
+
})
|
|
186
364
|
},
|
|
187
365
|
list_schemas: {
|
|
188
366
|
title: "List schemas",
|
|
@@ -191,16 +369,39 @@ var TOOL_METADATA = {
|
|
|
191
369
|
Use this to discover what data types exist before reading their shape.
|
|
192
370
|
Filter by \`id\` (plugin id, e.g. "org.dxos.plugin.markdown") to scope to a single plugin's schemas.
|
|
193
371
|
`,
|
|
194
|
-
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
|
+
})
|
|
195
391
|
}
|
|
196
392
|
};
|
|
197
393
|
var inputSchemaToZod = (struct) => effectFieldsToZod(struct);
|
|
198
394
|
export {
|
|
395
|
+
CapabilitySchema,
|
|
199
396
|
DEFAULT_LIST_LIMIT,
|
|
200
397
|
FindSymbolInput,
|
|
201
398
|
GetPackageInput,
|
|
202
399
|
GetSymbolInput,
|
|
400
|
+
IdiomHostKindSchema,
|
|
401
|
+
IdiomHostSchema,
|
|
402
|
+
IdiomSchema,
|
|
203
403
|
ListCapabilitiesInput,
|
|
404
|
+
ListIdiomsInput,
|
|
204
405
|
ListOperationsInput,
|
|
205
406
|
ListOptionsInput,
|
|
206
407
|
ListPackagesInput,
|
|
@@ -209,7 +410,22 @@ export {
|
|
|
209
410
|
ListSurfacesInput,
|
|
210
411
|
ListSymbolsInput,
|
|
211
412
|
MAX_LIST_LIMIT,
|
|
413
|
+
OperationSchema,
|
|
414
|
+
PackageDetailSchema,
|
|
415
|
+
PackageSchema,
|
|
416
|
+
PickerAnnotationId,
|
|
417
|
+
PluginDetailSchema,
|
|
418
|
+
PluginIdSchema,
|
|
419
|
+
PluginSchema,
|
|
420
|
+
SchemaSchema,
|
|
421
|
+
SourceLocationSchema,
|
|
422
|
+
SurfaceSchema,
|
|
423
|
+
SymbolDetailSchema,
|
|
424
|
+
SymbolIncludeSchema,
|
|
425
|
+
SymbolKindSchema,
|
|
426
|
+
SymbolMatchSchema,
|
|
212
427
|
TOOL_METADATA,
|
|
428
|
+
getPicker,
|
|
213
429
|
inputSchemaToZod
|
|
214
430
|
};
|
|
215
431
|
//# sourceMappingURL=index.mjs.map
|