@vibesdotdev/mcp 1.0.0-rc.2 → 1.0.0-rc.5
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/README.md +11 -11
- package/dist/adapters/index.d.ts +0 -2
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +0 -2
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/mcp/connection-identity.d.ts +18 -0
- package/dist/adapters/mcp/connection-identity.d.ts.map +1 -1
- package/dist/adapters/mcp/connection-identity.js +26 -0
- package/dist/adapters/mcp/connection-identity.js.map +1 -1
- package/dist/adapters/mcp/dual-era-handler.d.ts +22 -0
- package/dist/adapters/mcp/dual-era-handler.d.ts.map +1 -0
- package/dist/adapters/mcp/dual-era-handler.js +150 -0
- package/dist/adapters/mcp/dual-era-handler.js.map +1 -0
- package/dist/adapters/mcp/index.d.ts +0 -4
- package/dist/adapters/mcp/index.d.ts.map +1 -1
- package/dist/adapters/mcp/index.js +2 -10
- package/dist/adapters/mcp/index.js.map +1 -1
- package/dist/adapters/mcp/mcp-http-session.d.ts +1 -1
- package/dist/adapters/mcp/mcp-http-session.d.ts.map +1 -1
- package/dist/adapters/mcp/mcp-http-session.js +1 -1
- package/dist/adapters/mcp/mcp-http-session.js.map +1 -1
- package/dist/adapters/mcp/projection-doctor.d.ts.map +1 -1
- package/dist/adapters/mcp/projection-doctor.js +11 -4
- package/dist/adapters/mcp/projection-doctor.js.map +1 -1
- package/dist/adapters/mcp/projection.d.ts +1 -1
- package/dist/adapters/mcp/projection.d.ts.map +1 -1
- package/dist/adapters/mcp/projection.js.map +1 -1
- package/dist/adapters/mcp/sampling-context.d.ts.map +1 -1
- package/dist/adapters/mcp/sampling-context.js +1 -1
- package/dist/adapters/mcp/sampling-context.js.map +1 -1
- package/dist/adapters/mcp/sampling.d.ts +1 -1
- package/dist/adapters/mcp/sampling.d.ts.map +1 -1
- package/dist/adapters/mcp/server.consumer.d.ts +1 -1
- package/dist/adapters/mcp/server.consumer.d.ts.map +1 -1
- package/dist/adapters/mcp/server.consumer.js +59 -32
- package/dist/adapters/mcp/server.consumer.js.map +1 -1
- package/dist/adapters/mcp/server.d.ts +1 -22
- package/dist/adapters/mcp/server.d.ts.map +1 -1
- package/dist/adapters/mcp/server.js +232 -266
- package/dist/adapters/mcp/server.js.map +1 -1
- package/dist/adapters/mcp/startup-refusal.d.ts +2 -2
- package/dist/adapters/mcp/startup-refusal.d.ts.map +1 -1
- package/dist/adapters/mcp/startup-refusal.js +10 -10
- package/dist/adapters/mcp/startup-refusal.js.map +1 -1
- package/dist/adapters/mcp/stdio-relay.d.ts +1 -34
- package/dist/adapters/mcp/stdio-relay.d.ts.map +1 -1
- package/dist/adapters/mcp/stdio-relay.js +55 -71
- package/dist/adapters/mcp/stdio-relay.js.map +1 -1
- package/dist/adapters/mcp/tool-approval.d.ts +35 -0
- package/dist/adapters/mcp/tool-approval.d.ts.map +1 -0
- package/dist/adapters/mcp/tool-approval.js +156 -0
- package/dist/adapters/mcp/tool-approval.js.map +1 -0
- package/dist/adapters/mcp/tool-audit-live.d.ts +8 -12
- package/dist/adapters/mcp/tool-audit-live.d.ts.map +1 -1
- package/dist/adapters/mcp/tool-audit-live.js +9 -13
- package/dist/adapters/mcp/tool-audit-live.js.map +1 -1
- package/dist/adapters/mcp/tool-audit.d.ts +5 -0
- package/dist/adapters/mcp/tool-audit.d.ts.map +1 -1
- package/dist/adapters/mcp/tool-audit.js +73 -5
- package/dist/adapters/mcp/tool-audit.js.map +1 -1
- package/dist/adapters/mcp/trust-tag.d.ts.map +1 -1
- package/dist/adapters/mcp/trust-tag.js +5 -0
- package/dist/adapters/mcp/trust-tag.js.map +1 -1
- package/dist/adapters/mcp/web-handler.d.ts +6 -1
- package/dist/adapters/mcp/web-handler.d.ts.map +1 -1
- package/dist/adapters/mcp/web-handler.js +33 -13
- package/dist/adapters/mcp/web-handler.js.map +1 -1
- package/dist/adapters/transport-bun-http.d.ts +7 -3
- package/dist/adapters/transport-bun-http.d.ts.map +1 -1
- package/dist/adapters/transport-bun-http.js +5 -5
- package/dist/adapters/transport-bun-http.js.map +1 -1
- package/dist/adapters/types.d.ts +7 -9
- package/dist/adapters/types.d.ts.map +1 -1
- package/dist/adapters/zod-mcp.d.ts.map +1 -1
- package/dist/adapters/zod-mcp.js +4 -6
- package/dist/adapters/zod-mcp.js.map +1 -1
- package/dist/cli/mcp/audit/dev.audit.tools.impl.consumer.d.ts.map +1 -1
- package/dist/cli/mcp/audit/dev.audit.tools.impl.consumer.js +6 -1
- package/dist/cli/mcp/audit/dev.audit.tools.impl.consumer.js.map +1 -1
- package/dist/cli/surface-mcp/dev.mcp.serve.impl.consumer.d.ts.map +1 -1
- package/dist/cli/surface-mcp/dev.mcp.serve.impl.consumer.js +2 -0
- package/dist/cli/surface-mcp/dev.mcp.serve.impl.consumer.js.map +1 -1
- package/dist/config/mcp.config.descriptor.d.ts +28 -33
- package/dist/config/mcp.config.descriptor.d.ts.map +1 -1
- package/dist/config/mcp.config.descriptor.js +23 -19
- package/dist/config/mcp.config.descriptor.js.map +1 -1
- package/dist/docs/resources.docs.descriptor.d.ts.map +1 -1
- package/dist/docs/resources.docs.descriptor.js +43 -332
- package/dist/docs/resources.docs.descriptor.js.map +1 -1
- package/dist/docs/server.docs.descriptor.d.ts.map +1 -1
- package/dist/docs/server.docs.descriptor.js +71 -300
- package/dist/docs/server.docs.descriptor.js.map +1 -1
- package/dist/docs/tools.docs.descriptor.d.ts.map +1 -1
- package/dist/docs/tools.docs.descriptor.js +69 -244
- package/dist/docs/tools.docs.descriptor.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/mcp.runtime.plugin.d.ts.map +1 -1
- package/dist/mcp.runtime.plugin.js +3 -1
- package/dist/mcp.runtime.plugin.js.map +1 -1
- package/dist/svelte/tool-widgets/summary.d.ts +2 -2
- package/dist/svelte/tool-widgets/summary.d.ts.map +1 -1
- package/dist/svelte/tool-widgets/summary.js +9 -4
- package/dist/tools/vibes-context/schemas.d.ts +2 -1
- package/dist/tools/vibes-context/schemas.d.ts.map +1 -1
- package/dist/tools/vibes-context/schemas.js +22 -4
- package/dist/tools/vibes-context/schemas.js.map +1 -1
- package/dist/tools/vibes-context/vibes-context.descriptor.d.ts.map +1 -1
- package/dist/tools/vibes-context/vibes-context.descriptor.js +11 -1
- package/dist/tools/vibes-context/vibes-context.descriptor.js.map +1 -1
- package/dist/tools/vibes-context/vibes-context.impl.d.ts.map +1 -1
- package/dist/tools/vibes-context/vibes-context.impl.js +22 -11
- package/dist/tools/vibes-context/vibes-context.impl.js.map +1 -1
- package/dist/types.d.ts +0 -32
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -1
- package/dist/types.registry.d.ts +0 -59
- package/dist/types.registry.d.ts.map +1 -1
- package/dist/types.registry.js.map +1 -1
- package/package.json +61 -92
- package/dist/adapters/compatibility.d.ts +0 -20
- package/dist/adapters/compatibility.d.ts.map +0 -1
- package/dist/adapters/compatibility.js +0 -57
- package/dist/adapters/compatibility.js.map +0 -1
- package/dist/adapters/host-context.consumer.d.ts +0 -12
- package/dist/adapters/host-context.consumer.d.ts.map +0 -1
- package/dist/adapters/host-context.consumer.js +0 -10
- package/dist/adapters/host-context.consumer.js.map +0 -1
- package/dist/adapters/host-context.d.ts +0 -32
- package/dist/adapters/host-context.d.ts.map +0 -1
- package/dist/adapters/host-context.js +0 -17
- package/dist/adapters/host-context.js.map +0 -1
- package/dist/adapters/mcp/context.d.ts +0 -137
- package/dist/adapters/mcp/context.d.ts.map +0 -1
- package/dist/adapters/mcp/context.js +0 -230
- package/dist/adapters/mcp/context.js.map +0 -1
- package/dist/adapters/mcp/formatters.d.ts +0 -41
- package/dist/adapters/mcp/formatters.d.ts.map +0 -1
- package/dist/adapters/mcp/formatters.js +0 -102
- package/dist/adapters/mcp/formatters.js.map +0 -1
- package/dist/adapters/mcp/from-api-endpoint.d.ts +0 -59
- package/dist/adapters/mcp/from-api-endpoint.d.ts.map +0 -1
- package/dist/adapters/mcp/from-api-endpoint.js +0 -206
- package/dist/adapters/mcp/from-api-endpoint.js.map +0 -1
- package/dist/adapters/mcp/vibes-types.d.ts +0 -115
- package/dist/adapters/mcp/vibes-types.d.ts.map +0 -1
- package/dist/adapters/mcp/vibes-types.js +0 -7
- package/dist/adapters/mcp/vibes-types.js.map +0 -1
- package/dist/mcp/index.d.ts +0 -20
- package/dist/mcp/index.d.ts.map +0 -1
- package/dist/mcp/index.js +0 -19
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp.consumer.plugin.d.ts +0 -4
- package/dist/mcp.consumer.plugin.d.ts.map +0 -1
- package/dist/mcp.consumer.plugin.js +0 -19
- package/dist/mcp.consumer.plugin.js.map +0 -1
- package/dist/schemas/host-adapters.d.ts +0 -14
- package/dist/schemas/host-adapters.d.ts.map +0 -1
- package/dist/schemas/host-adapters.js +0 -7
- package/dist/schemas/host-adapters.js.map +0 -1
- package/dist/schemas/tool.d.ts +0 -8
- package/dist/schemas/tool.d.ts.map +0 -1
- package/dist/schemas/tool.js +0 -8
- package/dist/schemas/tool.js.map +0 -1
|
@@ -2,303 +2,128 @@ const descriptor = {
|
|
|
2
2
|
kind: 'docs/topic',
|
|
3
3
|
id: 'mcp.tools',
|
|
4
4
|
title: 'MCP Tools',
|
|
5
|
-
summary: 'Tool exposure, discovery, and invocation via MCP
|
|
5
|
+
summary: 'Tool exposure, discovery, approval, and invocation via MCP',
|
|
6
6
|
body: {
|
|
7
7
|
type: 'markdown',
|
|
8
8
|
sourceType: 'raw',
|
|
9
9
|
source: `---
|
|
10
10
|
title: MCP Tools
|
|
11
|
-
summary: Expose and invoke
|
|
12
|
-
tags: [mcp, tools, discovery, invocation, adapters]
|
|
11
|
+
summary: Expose and invoke universal tools through MCP
|
|
12
|
+
tags: [mcp, tools, discovery, invocation, approval, adapters]
|
|
13
13
|
parent: mcp
|
|
14
14
|
order: 2
|
|
15
15
|
surfaces: [cli, web, in-app]
|
|
16
16
|
hardware: [consumer, cloud]
|
|
17
17
|
---
|
|
18
18
|
|
|
19
|
-
MCP **tools** are
|
|
19
|
+
MCP **tools** are \`tools/tool\` descriptors projected over the protocol. The MCP
|
|
20
|
+
package owns the projection; [Tools](../../tools/SPEC.md) owns descriptors,
|
|
21
|
+
schemas, invocation and safety. There is one tool path.
|
|
20
22
|
|
|
21
|
-
MCP owns one orientation tool: \`vibes-context\`. It returns a read-only snapshot
|
|
23
|
+
MCP owns one orientation tool: \`vibes-context\`. It returns a read-only snapshot
|
|
24
|
+
of workspace path, project id, Atlas index, workspace file index, and the bound
|
|
25
|
+
work session. It is required, universal, and the first Wire Selfie/Doctor canary.
|
|
22
26
|
|
|
23
|
-
##
|
|
27
|
+
## Discovery
|
|
24
28
|
|
|
25
|
-
|
|
29
|
+
The server folds the live \`tools/tool\` catalog and applies the selected preset.
|
|
30
|
+
A settled fold excludes descriptors whose loader is unavailable; an advisory
|
|
31
|
+
fold keeps them and warns. A required tool without a loader refuses to serve.
|
|
26
32
|
|
|
27
|
-
|
|
28
|
-
const descriptors = runtime.query('tools/tool').descriptors();
|
|
29
|
-
const enabled = runtime.query('tools/tool').enabled().descriptors();
|
|
30
|
-
\`\`\`
|
|
31
|
-
|
|
32
|
-
Tools are filtered based on:
|
|
33
|
-
1. **Enabled status** — Disabled tools not exposed
|
|
34
|
-
2. **MCP client ID** — Some tools client-specific
|
|
35
|
-
3. **Safety category** — High-risk tools may require approval
|
|
36
|
-
|
|
37
|
-
## Tool exposure
|
|
33
|
+
The long-tail discovery path is itself three tools:
|
|
38
34
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
descriptor.id,
|
|
44
|
-
{
|
|
45
|
-
title: descriptor.name ?? descriptor.id,
|
|
46
|
-
description: resolveMcpDescription(descriptor),
|
|
47
|
-
inputSchema: flattenDiscriminatedUnion(descriptor.schemas.input),
|
|
48
|
-
outputSchema: descriptor.schemas.output,
|
|
49
|
-
annotations: deriveMcpAnnotations(descriptor.safety)
|
|
50
|
-
},
|
|
51
|
-
async (args, extra) => {
|
|
52
|
-
// Invoke through runtime
|
|
53
|
-
const result = await invokeTool({
|
|
54
|
-
runtime,
|
|
55
|
-
toolId: descriptor.id,
|
|
56
|
-
input: args,
|
|
57
|
-
ctx: {
|
|
58
|
-
callId: \`mcp_\${Date.now()}_\${crypto.randomUUID()}\`,
|
|
59
|
-
signal: extra.signal,
|
|
60
|
-
sendProgress: extra.sendProgress
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
return formatMcpResponse(result);
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
\`\`\`
|
|
35
|
+
- \`tool-search\` — find eligible tools by capability.
|
|
36
|
+
- \`tool-help\` — read the exact schema, examples and per-action safety.
|
|
37
|
+
- \`tool-call\` — invoke a callable match. The bridge refuses nested write actions;
|
|
38
|
+
those must go through the target tool's own approval path.
|
|
68
39
|
|
|
69
|
-
##
|
|
40
|
+
## Authoring a tool
|
|
70
41
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
union-branch tightening). Tool authors write the zod schema; there is no conversion
|
|
74
|
-
call to make:
|
|
42
|
+
Write one Zod schema with field descriptions. The adapter derives the wire JSON
|
|
43
|
+
Schema; there is no separate conversion step.
|
|
75
44
|
|
|
76
45
|
\`\`\`ts
|
|
77
46
|
schemas: {
|
|
78
47
|
input: z.object({
|
|
79
48
|
path: z.string().describe('File path to read'),
|
|
80
|
-
encoding: z.enum(['utf8', 'binary']).optional()
|
|
81
|
-
})
|
|
82
|
-
}
|
|
83
|
-
\`\`\`
|
|
84
|
-
|
|
85
|
-
**Supported Zod features:**
|
|
86
|
-
- ✅ \`z.string()\`, \`z.number()\`, \`z.boolean()\`
|
|
87
|
-
- ✅ \`z.object()\` with nested properties
|
|
88
|
-
- ✅ \`z.enum()\` for fixed options
|
|
89
|
-
- ✅ \`z.array()\` for lists
|
|
90
|
-
- ✅ \`z.optional()\` for optional fields
|
|
91
|
-
- ✅ \`z.describe()\` for field descriptions
|
|
92
|
-
|
|
93
|
-
**Discriminated unions:** Flattened to merged object schema:
|
|
94
|
-
|
|
95
|
-
\`\`\`ts
|
|
96
|
-
// Zod discriminated union
|
|
97
|
-
const schema = z.discriminatedUnion('action', [
|
|
98
|
-
z.object({ action: z.literal('read'), path: z.string() }),
|
|
99
|
-
z.object({ action: z.literal('write'), path: z.string(), content: z.string() })
|
|
100
|
-
]);
|
|
101
|
-
|
|
102
|
-
// MCP schema (flattened)
|
|
103
|
-
{
|
|
104
|
-
type: 'object',
|
|
105
|
-
properties: {
|
|
106
|
-
action: { type: 'string', enum: ['read', 'write'] },
|
|
107
|
-
path: { type: 'string' },
|
|
108
|
-
content: { type: 'string', optional: true }
|
|
109
|
-
}
|
|
49
|
+
encoding: z.enum(['utf8', 'binary']).optional().describe('Decode as text or bytes')
|
|
50
|
+
}),
|
|
51
|
+
output: z.object({ ... })
|
|
110
52
|
}
|
|
111
53
|
\`\`\`
|
|
112
54
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
\`\`\`ts
|
|
118
|
-
annotations: {
|
|
119
|
-
readOnlyHint: true, // Tool doesn't modify state
|
|
120
|
-
destructiveHint: false, // Tool doesn't delete/destroy
|
|
121
|
-
idempotentHint: true, // Multiple calls = same result
|
|
122
|
-
openWorldHint: false // Tool operates in closed system
|
|
123
|
-
}
|
|
124
|
-
\`\`\`
|
|
125
|
-
|
|
126
|
-
Derived from tool safety category:
|
|
127
|
-
- \`read\` → readOnlyHint: true
|
|
128
|
-
- \`write\` → destructiveHint: true
|
|
129
|
-
- \`execute\` → openWorldHint: true
|
|
130
|
-
|
|
131
|
-
## Tool invocation flow
|
|
132
|
-
|
|
133
|
-
\`\`\`
|
|
134
|
-
1. MCP client calls tools/list
|
|
135
|
-
↓
|
|
136
|
-
2. Server returns available tools
|
|
137
|
-
↓
|
|
138
|
-
3. Client calls tools/call with tool ID + args
|
|
139
|
-
↓
|
|
140
|
-
4. Server invokes tool via runtime.invokeTool()
|
|
141
|
-
↓
|
|
142
|
-
5. Tool executes (may call other tools, access resources)
|
|
143
|
-
↓
|
|
144
|
-
6. Result formatted as MCP response
|
|
145
|
-
↓
|
|
146
|
-
7. Client receives result
|
|
147
|
-
\`\`\`
|
|
148
|
-
|
|
149
|
-
## Response formatting
|
|
150
|
-
|
|
151
|
-
Tool results formatted per MCP spec:
|
|
152
|
-
|
|
153
|
-
\`\`\`ts
|
|
154
|
-
// String result
|
|
155
|
-
{
|
|
156
|
-
content: [{ type: 'text', text: 'Operation successful' }]
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// Object result
|
|
160
|
-
{
|
|
161
|
-
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
|
|
162
|
-
structuredContent: result // Typed data for clients
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// MCP content (from tool)
|
|
166
|
-
{
|
|
167
|
-
content: [
|
|
168
|
-
{ type: 'text', text: 'Processing...' },
|
|
169
|
-
{ type: 'resource_link', name: 'file.txt', uri: 'file://file.txt' }
|
|
170
|
-
]
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
// Error result
|
|
174
|
-
{
|
|
175
|
-
content: [{ type: 'text', text: 'Error: Permission denied' }],
|
|
176
|
-
isError: true,
|
|
177
|
-
_meta: {
|
|
178
|
-
errorCode: 'PERMISSION_DENIED',
|
|
179
|
-
recoveryHint: 'Grant workspace access first',
|
|
180
|
-
suggestedToolCall: {
|
|
181
|
-
toolId: 'workspace-grant',
|
|
182
|
-
input: { path: '/workspace' }
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
\`\`\`
|
|
55
|
+
For a multi-action tool, declare \`schemas.actionSafety\` per action. It is the
|
|
56
|
+
single source for sandbox policy, \`tool-help\`, MCP annotations and the
|
|
57
|
+
capability bridge.
|
|
187
58
|
|
|
188
|
-
##
|
|
59
|
+
## Annotations
|
|
189
60
|
|
|
190
|
-
|
|
61
|
+
MCP annotations are the conservative union of the top-level safety and every
|
|
62
|
+
declared action/variant:
|
|
191
63
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
64
|
+
- any non-read action ⇒ \`readOnlyHint: false\`
|
|
65
|
+
- any write action ⇒ \`destructiveHint: true\`
|
|
66
|
+
- \`openWorldHint\` follows explicit hints and declared network permission
|
|
67
|
+
- no declared safety ⇒ the spec's conservative default, not "read-only"
|
|
195
68
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
tier: trustTier,
|
|
200
|
-
text: result,
|
|
201
|
-
nonce: callNonce // Unique per tool call
|
|
202
|
-
});
|
|
203
|
-
\`\`\`
|
|
69
|
+
A tool whose default action is a read can still be a write tool. \`workspace-search\`
|
|
70
|
+
is read by default and mutates through \`rename\` and index actions; its annotation
|
|
71
|
+
is not read-only.
|
|
204
72
|
|
|
205
|
-
|
|
73
|
+
## Approval
|
|
206
74
|
|
|
207
|
-
|
|
75
|
+
\`requiresApproval: true\` is enforced on MCP. The tool owner declares the
|
|
76
|
+
contract; the MCP adapter asks the connected client through form elicitation.
|
|
77
|
+
An unsupported client is refused \`UNAVAILABLE / tool-approval-unavailable\`; a
|
|
78
|
+
decline is \`PERMISSION_DENIED / tool-approval-declined\`; a cancel is
|
|
79
|
+
\`CANCELLED / tool-approval-cancelled\`. Reads proceed without a prompt.
|
|
208
80
|
|
|
209
|
-
|
|
81
|
+
## Invocation
|
|
210
82
|
|
|
211
83
|
\`\`\`ts
|
|
212
|
-
|
|
213
|
-
extra.sendProgress?.({
|
|
214
|
-
progress: 0.5, // 50% complete
|
|
215
|
-
total: 100,
|
|
216
|
-
message: 'Processing files...'
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
const result = await invokeTool({ ... });
|
|
220
|
-
return formatMcpResponse(result);
|
|
221
|
-
}
|
|
84
|
+
const result = await invokeTool({ runtime, toolId, input, ctx });
|
|
222
85
|
\`\`\`
|
|
223
86
|
|
|
224
|
-
|
|
87
|
+
\`invokeTool\` owns input validation, hooks, timeout, cancellation and error
|
|
88
|
+
enrichment. The MCP handler projects a failure as \`isError\` with
|
|
89
|
+
\`_meta.errorCode\`, \`retryable\`, \`recoveryHint\` and \`errorMetadata\`.
|
|
90
|
+
\`structuredContent\` is omitted on errors.
|
|
225
91
|
|
|
226
|
-
|
|
92
|
+
Text payloads are wrapped in the nonce trust-tag envelope. Machine consumers
|
|
93
|
+
should treat \`structuredContent\` as tool data, not as trusted instructions.
|
|
227
94
|
|
|
228
|
-
|
|
229
|
-
async (args, extra) => {
|
|
230
|
-
if (extra.signal?.aborted) {
|
|
231
|
-
throw new Error('Tool call cancelled');
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
return invokeTool({
|
|
235
|
-
...,
|
|
236
|
-
ctx: { signal: extra.signal }
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
\`\`\`
|
|
95
|
+
## Presets
|
|
240
96
|
|
|
241
|
-
|
|
97
|
+
- \`mcp\` — base catalog; includes the continuity body and the full local wire
|
|
98
|
+
- \`mcp:full\` — explicit name for the full catalog
|
|
99
|
+
- \`mcp:minimal\` — context + tool discovery
|
|
100
|
+
- \`mcp:presence\` — brain, presence, awareness, session
|
|
101
|
+
- \`mcp:code\` — workspace/code plus continuity
|
|
102
|
+
- \`mcp:workspace\` — \`workspace-*\` plus context and discovery
|
|
103
|
+
- \`mcp:cloud\` — cloud-eligible tools for the hosted endpoint
|
|
242
104
|
|
|
243
|
-
|
|
105
|
+
Harness names select identity and aliases; they are not catalog caps.
|
|
244
106
|
|
|
245
|
-
|
|
246
|
-
import { selectMcpTools } from '@vibesdotdev/mcp/adapters/mcp';
|
|
107
|
+
## Verify
|
|
247
108
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
109
|
+
\`\`\`bash
|
|
110
|
+
vibes dev audit tools # policy reachability + schema/annotation findings
|
|
111
|
+
vibes dev audit tools --live # spawn the real serve and diff the wire
|
|
112
|
+
vibes dev audit tools --doctor # birth, canary, and host attestation
|
|
252
113
|
\`\`\`
|
|
253
114
|
|
|
254
|
-
|
|
255
|
-
- \`minimal\` — Read-only tools (workspace-fs, workspace-fs)
|
|
256
|
-
- \`safe\` — Read + write with confirmation
|
|
257
|
-
- \`full\` — All tools including execute
|
|
258
|
-
|
|
259
|
-
## WRONG: Manual tool registration
|
|
115
|
+
## WRONG: manual tool registration
|
|
260
116
|
|
|
261
117
|
\`\`\`ts
|
|
262
|
-
|
|
263
|
-
server.registerTool('my-tool', {...}, handler);
|
|
118
|
+
server.registerTool('my-tool', { ... }, handler);
|
|
264
119
|
\`\`\`
|
|
265
120
|
|
|
266
|
-
## RIGHT:
|
|
121
|
+
## RIGHT: descriptor projection
|
|
267
122
|
|
|
268
123
|
\`\`\`ts
|
|
269
|
-
// ✅ Server auto-discovers all tools/tool descriptors
|
|
270
124
|
const server = buildServer(runtime, options, logger);
|
|
271
125
|
\`\`\`
|
|
272
126
|
|
|
273
|
-
## Tool debugging
|
|
274
|
-
|
|
275
|
-
Enable debug logging:
|
|
276
|
-
|
|
277
|
-
\`\`\`bash
|
|
278
|
-
vibes dev mcp start --log-level debug
|
|
279
|
-
\`\`\`
|
|
280
|
-
|
|
281
|
-
Logs show:
|
|
282
|
-
- Tool discovery results
|
|
283
|
-
- Schema conversion warnings
|
|
284
|
-
- Invocation timing
|
|
285
|
-
- Error details
|
|
286
|
-
|
|
287
|
-
## Monitoring
|
|
288
|
-
|
|
289
|
-
Track tool usage:
|
|
290
|
-
|
|
291
|
-
\`\`\`ts
|
|
292
|
-
runtime.on('tools/invocation', (event) => {
|
|
293
|
-
metrics.histogram('tools.duration', event.duration);
|
|
294
|
-
metrics.increment(\`tools.\${event.toolId}.calls\`);
|
|
295
|
-
|
|
296
|
-
if (event.error) {
|
|
297
|
-
metrics.increment(\`tools.\${event.toolId}.errors\`);
|
|
298
|
-
}
|
|
299
|
-
});
|
|
300
|
-
\`\`\`
|
|
301
|
-
|
|
302
127
|
:::card{title="See also"}
|
|
303
128
|
- [\`mcp.server\`](mcp.server) — MCP server setup
|
|
304
129
|
- [\`tools.invoke\`](tools.invoke) — invokeTool API
|
|
@@ -307,7 +132,7 @@ runtime.on('tools/invocation', (event) => {
|
|
|
307
132
|
},
|
|
308
133
|
parent: 'mcp',
|
|
309
134
|
order: 2,
|
|
310
|
-
tags: ['mcp', 'tools', 'discovery', 'invocation', 'adapters'],
|
|
135
|
+
tags: ['mcp', 'tools', 'discovery', 'invocation', 'approval', 'adapters'],
|
|
311
136
|
surfaces: ['cli', 'web', 'in-app'],
|
|
312
137
|
hardware: ['consumer', 'cloud'],
|
|
313
138
|
enabled: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.docs.descriptor.js","sourceRoot":"","sources":["../../src/docs/tools.docs.descriptor.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAwB;IACtC,IAAI,EAAE,YAAY;IAClB,EAAE,EAAE,WAAW;IACf,KAAK,EAAE,WAAW;IAClB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"tools.docs.descriptor.js","sourceRoot":"","sources":["../../src/docs/tools.docs.descriptor.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAwB;IACtC,IAAI,EAAE,YAAY;IAClB,EAAE,EAAE,WAAW;IACf,KAAK,EAAE,WAAW;IAClB,OAAO,EAAE,4DAA4D;IACrE,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU;QAChB,UAAU,EAAE,KAAK;QACjB,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0HX;KACE;IACD,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,CAAC;IACzE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC;IAClC,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC;IAC/B,OAAO,EAAE,IAAI;CACd,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,25 +8,25 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```ts
|
|
11
|
-
* // Low-level transport
|
|
12
|
-
* import { createBunMcpServer
|
|
11
|
+
* // Low-level host transport
|
|
12
|
+
* import { createBunMcpServer } from '@vibesdotdev/mcp';
|
|
13
13
|
*
|
|
14
|
-
* // Tool-
|
|
15
|
-
* import { createMcpAdapter
|
|
14
|
+
* // Tool-aware server composition
|
|
15
|
+
* import { createMcpAdapter } from '@vibesdotdev/mcp/adapters/mcp';
|
|
16
16
|
*
|
|
17
17
|
* const adapter = createMcpAdapter(runtime, options, logger);
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
export { createBunMcpServer
|
|
20
|
+
export { createBunMcpServer } from './adapters/transport-bun-http.ts';
|
|
21
21
|
export type { BunMcpServerOptions } from './adapters/transport-bun-http.ts';
|
|
22
|
-
export { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
23
22
|
export type { McpAdapter, McpAdapterMode, McpAdapterOptions } from './adapters/index.ts';
|
|
24
23
|
export { createMcpAuthenticator, mcpAuthUnavailableError, mcpAuthResponseMalformedError, MCP_AUTH_UNAVAILABLE_REASON, MCP_AUTH_RESPONSE_MALFORMED_REASON, type McpAuthLogger, type McpAuthRequest, type McpAuthResult } from './adapters/auth-middleware.ts';
|
|
25
24
|
export { jsonRpcError, jsonRpcRequestId } from './adapters/mcp/json-rpc.ts';
|
|
25
|
+
export { isLegacyRequest as isLegacyMcpRequest } from "@modelcontextprotocol/server";
|
|
26
26
|
export { createMcpWebStandardHandler, handleMcpWebStandardRequest } from './adapters/web-compatibility.ts';
|
|
27
27
|
export { listMcpToolCatalog, type McpToolCatalogEntry } from './adapters/mcp/catalog.ts';
|
|
28
28
|
export { McpClient } from './client.ts';
|
|
29
|
-
export type { McpToolResult, McpUser, SamplingRequest, SamplingResult,
|
|
29
|
+
export type { McpToolResult, McpUser, SamplingRequest, SamplingResult, McpHttpPeerInfo, McpClientInfo, McpSessionAgentMetadata, McpSessionMetadata, McpConnectionState, } from './types.ts';
|
|
30
30
|
export { McpError, McpAuthError, McpPermissionError, McpToolError, McpResourceError, } from './types.ts';
|
|
31
31
|
export { mcpSamplingKind } from './kinds/sampling.kind.ts';
|
|
32
32
|
export type { McpSamplingFn } from './kinds/sampling.kind.ts';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EACN,sBAAsB,EACtB,uBAAuB,EACvB,6BAA6B,EAC7B,2BAA2B,EAC3B,kCAAkC,EAClC,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,eAAe,IAAI,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAKzF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,YAAY,EACX,aAAa,EACb,OAAO,EACP,eAAe,EACf,cAAc,EACd,eAAe,EACf,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,GAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,GAChB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC9F,OAAO,EAAE,+BAA+B,EAAE,KAAK,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAChH,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -8,20 +8,20 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```ts
|
|
11
|
-
* // Low-level transport
|
|
12
|
-
* import { createBunMcpServer
|
|
11
|
+
* // Low-level host transport
|
|
12
|
+
* import { createBunMcpServer } from '@vibesdotdev/mcp';
|
|
13
13
|
*
|
|
14
|
-
* // Tool-
|
|
15
|
-
* import { createMcpAdapter
|
|
14
|
+
* // Tool-aware server composition
|
|
15
|
+
* import { createMcpAdapter } from '@vibesdotdev/mcp/adapters/mcp';
|
|
16
16
|
*
|
|
17
17
|
* const adapter = createMcpAdapter(runtime, options, logger);
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
20
|
// Transport adapters
|
|
21
|
-
export { createBunMcpServer
|
|
22
|
-
export { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
21
|
+
export { createBunMcpServer } from "./adapters/transport-bun-http.js";
|
|
23
22
|
export { createMcpAuthenticator, mcpAuthUnavailableError, mcpAuthResponseMalformedError, MCP_AUTH_UNAVAILABLE_REASON, MCP_AUTH_RESPONSE_MALFORMED_REASON } from "./adapters/auth-middleware.js";
|
|
24
23
|
export { jsonRpcError, jsonRpcRequestId } from "./adapters/mcp/json-rpc.js";
|
|
24
|
+
export { isLegacyRequest as isLegacyMcpRequest } from "@modelcontextprotocol/server";
|
|
25
25
|
export { createMcpWebStandardHandler, handleMcpWebStandardRequest } from "./adapters/web-compatibility.js";
|
|
26
26
|
export { listMcpToolCatalog } from "./adapters/mcp/catalog.js";
|
|
27
27
|
// MCP-over-tools adapter. The full adapter surface is exported from
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,qBAAqB;AACrB,OAAO,EAAE,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,qBAAqB;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAGtE,OAAO,EACN,sBAAsB,EACtB,uBAAuB,EACvB,6BAA6B,EAC7B,2BAA2B,EAC3B,kCAAkC,EAIlC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,eAAe,IAAI,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAA4B,MAAM,2BAA2B,CAAC;AAGzF,oEAAoE;AACpE,mCAAmC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAcxC,OAAO,EACN,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,GAChB,MAAM,YAAY,CAAC;AAEpB,QAAQ;AACR,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC9F,OAAO,EAAE,+BAA+B,EAAkC,MAAM,+BAA+B,CAAC;AAChH,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.runtime.plugin.d.ts","sourceRoot":"","sources":["../src/mcp.runtime.plugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAoBH,QAAA,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"mcp.runtime.plugin.d.ts","sourceRoot":"","sources":["../src/mcp.runtime.plugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAoBH,QAAA,MAAM,aAAa,6CAmBjB,CAAC;AAEH,eAAe,aAAa,CAAC"}
|
|
@@ -33,7 +33,9 @@ const defaultExport = createRuntimePlugin({
|
|
|
33
33
|
},
|
|
34
34
|
descriptors: [mcpDescriptor, mcpServerDescriptor, mcpToolsDescriptor, mcpResourcesDescriptor, mcpPromptsDescriptor, vibesContextDescriptor, mcpConfigDescriptor, ...mcpInstructionPromptDescriptors, ...harnessIdentityDescriptors],
|
|
35
35
|
loaders: [
|
|
36
|
-
loader
|
|
36
|
+
// One universal loader: the orientation tool is `hardware: ['consumer','cloud']`
|
|
37
|
+
// and resolves host differences through the runtime at call time.
|
|
38
|
+
loader('vibes-context', () => import("./tools/vibes-context/vibes-context.impl.js"))
|
|
37
39
|
]
|
|
38
40
|
});
|
|
39
41
|
export default defaultExport;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.runtime.plugin.js","sourceRoot":"","sources":["../src/mcp.runtime.plugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,+BAA+B,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO;AACP,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,mBAAmB,MAAM,kCAAkC,CAAC;AACnE,OAAO,kBAAkB,MAAM,iCAAiC,CAAC;AACjE,OAAO,sBAAsB,MAAM,qCAAqC,CAAC;AACzE,OAAO,oBAAoB,MAAM,mCAAmC,CAAC;AACrE,OAAO,sBAAsB,MAAM,mDAAmD,CAAC;AACvF,OAAO,mBAAmB,MAAM,mCAAmC,CAAC;AAEpE,kIAAkI;AAClI,MAAM,aAAa,GAAG,mBAAmB,CAAC;IACzC,EAAE,EAAE,aAAa;IACjB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,mDAAmD;IAEhE,KAAK,EAAE,CAAC,eAAe,EAAE,mBAAmB,EAAE,mBAAmB,CAAC;IAElE,KAAK,CAAC,UAAU,CAAC,OAAO;QACvB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC;YAAE,MAAM,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;QACpF,MAAM,YAAY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,CAAC;IAElE,KAAK,CAAC,UAAU,CAAC,OAAO;QACvB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC;YAAE,MAAM,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;QACpF,MAAM,YAAY,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED,WAAW,EAAE,CAAC,aAAa,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,GAAG,+BAA+B,EAAE,GAAG,0BAA0B,CAAC;IAEnO,OAAO,EAAE;QACR,iFAAiF;QACjF,kEAAkE;QAClE,MAAM,CAAC,eAAe,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,6CAA6C,CAAC,CAAC;KACpF;CACD,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC"}
|
|
@@ -5,7 +5,7 @@ import * as z from 'zod/v4';
|
|
|
5
5
|
* still renders what it can.
|
|
6
6
|
*/
|
|
7
7
|
export declare const VibesContextPayloadSchema: z.ZodObject<{
|
|
8
|
-
workspacePath: z.ZodString
|
|
8
|
+
workspacePath: z.ZodNullable<z.ZodString>;
|
|
9
9
|
projectId: z.ZodCatch<z.ZodNullable<z.ZodString>>;
|
|
10
10
|
surface: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
11
11
|
hardware: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
@@ -36,7 +36,7 @@ export interface VibesContextSummary {
|
|
|
36
36
|
title: string;
|
|
37
37
|
unbound: boolean;
|
|
38
38
|
warning: boolean;
|
|
39
|
-
workspacePath: string;
|
|
39
|
+
workspacePath: string | null;
|
|
40
40
|
projectId: string | null;
|
|
41
41
|
surface?: string;
|
|
42
42
|
hardware?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/svelte/tool-widgets/summary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O,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,sBAAsB,EAAE,CAAC;IAC/B,KAAK,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKtD;AAMD,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,mBAAmB,GAAG,mBAAmB,CAiF9F"}
|
|
@@ -12,7 +12,7 @@ const countField = z.number().finite().optional().catch(undefined);
|
|
|
12
12
|
* still renders what it can.
|
|
13
13
|
*/
|
|
14
14
|
export const VibesContextPayloadSchema = z.object({
|
|
15
|
-
workspacePath: z.string().min(1),
|
|
15
|
+
workspacePath: z.string().min(1).nullable(),
|
|
16
16
|
projectId: z.string().min(1).nullable().catch(null),
|
|
17
17
|
surface: textField,
|
|
18
18
|
hardware: textField,
|
|
@@ -45,10 +45,15 @@ function isWarningHint(hint) {
|
|
|
45
45
|
}
|
|
46
46
|
export function summarizeVibesContextPayload(payload) {
|
|
47
47
|
const { workspacePath, projectId, surface, hardware, hints } = payload;
|
|
48
|
-
const unbound = projectId === null;
|
|
48
|
+
const unbound = projectId === null || workspacePath === null;
|
|
49
49
|
const warning = unbound || hints.some(isWarningHint);
|
|
50
50
|
const rows = [
|
|
51
|
-
{
|
|
51
|
+
{
|
|
52
|
+
id: 'workspace',
|
|
53
|
+
label: 'Workspace',
|
|
54
|
+
value: workspacePath ?? 'unbound',
|
|
55
|
+
tone: workspacePath === null ? 'warning' : 'default'
|
|
56
|
+
},
|
|
52
57
|
{
|
|
53
58
|
id: 'project',
|
|
54
59
|
label: 'Project',
|
|
@@ -102,7 +107,7 @@ export function summarizeVibesContextPayload(payload) {
|
|
|
102
107
|
});
|
|
103
108
|
}
|
|
104
109
|
return {
|
|
105
|
-
title: unbound
|
|
110
|
+
title: unbound || workspacePath === null
|
|
106
111
|
? 'Context — unbound'
|
|
107
112
|
: `Context — ${workspaceBasename(workspacePath)}`,
|
|
108
113
|
unbound,
|
|
@@ -3,9 +3,10 @@ export declare const VibesContextInputSchema: z.ZodObject<{
|
|
|
3
3
|
includeAtlas: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
4
4
|
includeWorkspaceIndex: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
5
5
|
includeSession: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
6
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
6
7
|
}, z.core.$strip>;
|
|
7
8
|
export declare const VibesContextOutputSchema: z.ZodObject<{
|
|
8
|
-
workspacePath: z.ZodString
|
|
9
|
+
workspacePath: z.ZodNullable<z.ZodString>;
|
|
9
10
|
projectId: z.ZodNullable<z.ZodString>;
|
|
10
11
|
surface: z.ZodOptional<z.ZodString>;
|
|
11
12
|
hardware: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/tools/vibes-context/schemas.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/tools/vibes-context/schemas.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,eAAO,MAAM,uBAAuB;;;;;iBAsBlC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuEnC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
import { ValueFreeFailureSchema } from '@vibesdotdev/kernel';
|
|
2
2
|
import * as z from 'zod/v4';
|
|
3
3
|
export const VibesContextInputSchema = z.object({
|
|
4
|
-
includeAtlas: z
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
includeAtlas: z
|
|
5
|
+
.boolean()
|
|
6
|
+
.optional()
|
|
7
|
+
.default(true)
|
|
8
|
+
.describe('Include Atlas index status and search readiness.'),
|
|
9
|
+
includeWorkspaceIndex: z
|
|
10
|
+
.boolean()
|
|
11
|
+
.optional()
|
|
12
|
+
.default(true)
|
|
13
|
+
.describe('Include the workspace dirty-file index summary.'),
|
|
14
|
+
includeSession: z
|
|
15
|
+
.boolean()
|
|
16
|
+
.optional()
|
|
17
|
+
.default(true)
|
|
18
|
+
.describe('Include the bound work session snapshot and unbound guidance.'),
|
|
19
|
+
sessionId: z
|
|
20
|
+
.string()
|
|
21
|
+
.trim()
|
|
22
|
+
.min(1)
|
|
23
|
+
.optional()
|
|
24
|
+
.describe('Read this session handle instead of the caller-bound session.')
|
|
7
25
|
});
|
|
8
26
|
export const VibesContextOutputSchema = z.object({
|
|
9
|
-
workspacePath: z.string(),
|
|
27
|
+
workspacePath: z.string().nullable(),
|
|
10
28
|
projectId: z.string().nullable(),
|
|
11
29
|
surface: z.string().optional(),
|
|
12
30
|
hardware: z.string().optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/tools/vibes-context/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAA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ACvG,cAAc,EAAE,sBAAsB,CAAC,QAAQ,EAAE;IACjD,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC1B,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vibes-context.descriptor.d.ts","sourceRoot":"","sources":["../../../src/tools/vibes-context/vibes-context.descriptor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAG1F,QAAA,MAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"vibes-context.descriptor.d.ts","sourceRoot":"","sources":["../../../src/tools/vibes-context/vibes-context.descriptor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAG1F,QAAA,MAAM,UAAU,EAAE,mBAoChB,CAAC;AAEH,eAAe,UAAU,CAAC"}
|