rivet-design 0.9.3 → 0.9.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/dist/mcp/agent-variants/SessionStore.d.ts +26 -10
- package/dist/mcp/agent-variants/SessionStore.d.ts.map +1 -1
- package/dist/mcp/agent-variants/SessionStore.js +189 -44
- package/dist/mcp/agent-variants/SessionStore.js.map +1 -1
- package/dist/mcp/agent-variants/WorktreeOrchestrator.d.ts +209 -13
- package/dist/mcp/agent-variants/WorktreeOrchestrator.d.ts.map +1 -1
- package/dist/mcp/agent-variants/WorktreeOrchestrator.js +1489 -61
- package/dist/mcp/agent-variants/WorktreeOrchestrator.js.map +1 -1
- package/dist/mcp/agent-variants/WorktreeOrchestrator.testHelpers.d.ts +65 -0
- package/dist/mcp/agent-variants/WorktreeOrchestrator.testHelpers.d.ts.map +1 -0
- package/dist/mcp/agent-variants/WorktreeOrchestrator.testHelpers.js +162 -0
- package/dist/mcp/agent-variants/WorktreeOrchestrator.testHelpers.js.map +1 -0
- package/dist/mcp/agent-variants/contracts.d.ts +1576 -64
- package/dist/mcp/agent-variants/contracts.d.ts.map +1 -1
- package/dist/mcp/agent-variants/contracts.js +202 -9
- package/dist/mcp/agent-variants/contracts.js.map +1 -1
- package/dist/mcp/agent-variants/createProjectArtifacts.d.ts +78 -0
- package/dist/mcp/agent-variants/createProjectArtifacts.d.ts.map +1 -0
- package/dist/mcp/agent-variants/createProjectArtifacts.js +123 -0
- package/dist/mcp/agent-variants/createProjectArtifacts.js.map +1 -0
- package/dist/mcp/agent-variants/createZeroToOneTool.d.ts +67 -25
- package/dist/mcp/agent-variants/createZeroToOneTool.d.ts.map +1 -1
- package/dist/mcp/agent-variants/createZeroToOneTool.js +60 -126
- package/dist/mcp/agent-variants/createZeroToOneTool.js.map +1 -1
- package/dist/mcp/agent-variants/errors.d.ts +1 -1
- package/dist/mcp/agent-variants/errors.d.ts.map +1 -1
- package/dist/mcp/agent-variants/errors.js +1 -0
- package/dist/mcp/agent-variants/errors.js.map +1 -1
- package/dist/mcp/agent-variants/index.d.ts +3 -4
- package/dist/mcp/agent-variants/index.d.ts.map +1 -1
- package/dist/mcp/agent-variants/index.js +2 -2
- package/dist/mcp/agent-variants/index.js.map +1 -1
- package/dist/mcp/agent-variants/inspirationDesignContext.d.ts +10 -0
- package/dist/mcp/agent-variants/inspirationDesignContext.d.ts.map +1 -1
- package/dist/mcp/agent-variants/inspirationDesignContext.js +104 -16
- package/dist/mcp/agent-variants/inspirationDesignContext.js.map +1 -1
- package/dist/mcp/agent-variants/pendingChangesAdapter.d.ts.map +1 -1
- package/dist/mcp/agent-variants/pendingChangesAdapter.js +11 -0
- package/dist/mcp/agent-variants/pendingChangesAdapter.js.map +1 -1
- package/dist/mcp/agent-variants/previewQa.d.ts +61 -0
- package/dist/mcp/agent-variants/previewQa.d.ts.map +1 -0
- package/dist/mcp/agent-variants/previewQa.js +374 -0
- package/dist/mcp/agent-variants/previewQa.js.map +1 -0
- package/dist/mcp/agent-variants/sourceContext.d.ts +1 -0
- package/dist/mcp/agent-variants/sourceContext.d.ts.map +1 -1
- package/dist/mcp/agent-variants/sourceContext.js +28 -3
- package/dist/mcp/agent-variants/sourceContext.js.map +1 -1
- package/dist/mcp/agent-variants/tools.d.ts +40 -3
- package/dist/mcp/agent-variants/tools.d.ts.map +1 -1
- package/dist/mcp/agent-variants/tools.js +262 -38
- package/dist/mcp/agent-variants/tools.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +32 -7
- package/dist/mcp/server.js.map +1 -1
- package/dist/prompts/agentModPrompts.d.ts.map +1 -1
- package/dist/prompts/agentModPrompts.js +11 -10
- package/dist/prompts/agentModPrompts.js.map +1 -1
- package/dist/proxy-middleware/proxy-config.d.ts +2 -2
- package/dist/proxy-middleware/proxy-config.d.ts.map +1 -1
- package/dist/proxy-middleware/proxy-config.js +66 -22
- package/dist/proxy-middleware/proxy-config.js.map +1 -1
- package/dist/routes/agentVariants.d.ts +2 -13
- package/dist/routes/agentVariants.d.ts.map +1 -1
- package/dist/routes/agentVariants.js +156 -2
- package/dist/routes/agentVariants.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +79 -4
- package/dist/server.js.map +1 -1
- package/dist/services/ProjectDetectionService.d.ts.map +1 -1
- package/dist/services/ProjectDetectionService.js +21 -0
- package/dist/services/ProjectDetectionService.js.map +1 -1
- package/dist/services/VariantHistoryService.d.ts +117 -0
- package/dist/services/VariantHistoryService.d.ts.map +1 -0
- package/dist/services/VariantHistoryService.js +385 -0
- package/dist/services/VariantHistoryService.js.map +1 -0
- package/dist/services/WorktreeManager.d.ts +67 -9
- package/dist/services/WorktreeManager.d.ts.map +1 -1
- package/dist/services/WorktreeManager.js +209 -26
- package/dist/services/WorktreeManager.js.map +1 -1
- package/dist/services/agent/AgentCore.d.ts +1 -1
- package/dist/services/agent/AgentCore.d.ts.map +1 -1
- package/dist/services/agent/AgentCore.js +24 -1
- package/dist/services/agent/AgentCore.js.map +1 -1
- package/dist/services/agent/AgentModService.d.ts +1 -1
- package/dist/services/agent/AgentModService.js +7 -7
- package/dist/services/agent/AgentModService.js.map +1 -1
- package/dist/services/templates/viteReactTs.d.ts +6 -0
- package/dist/services/templates/viteReactTs.d.ts.map +1 -1
- package/dist/services/templates/viteReactTs.js +8 -1
- package/dist/services/templates/viteReactTs.js.map +1 -1
- package/dist/types/change-request-types.d.ts +14 -0
- package/dist/types/change-request-types.d.ts.map +1 -1
- package/dist/utils/skills/claude-skill.d.ts +1 -1
- package/dist/utils/skills/claude-skill.js +2 -2
- package/dist/utils/skills/cursor-rules.d.ts +1 -1
- package/dist/utils/skills/cursor-rules.js +1 -1
- package/dist/utils/skills/shared-variants-protocol.d.ts +1 -1
- package/dist/utils/skills/shared-variants-protocol.d.ts.map +1 -1
- package/dist/utils/skills/shared-variants-protocol.js +31 -32
- package/dist/utils/skills/shared-variants-protocol.js.map +1 -1
- package/package.json +4 -5
- package/src/ui/dist/assets/main-OdmwI8Od.css +1 -0
- package/src/ui/dist/assets/{main-DejhsBWR.js → main-SuZlKEi0.js} +115 -115
- package/src/ui/dist/index.html +2 -2
- package/src/ui/dist/assets/main-C9jfEp80.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createProjectArtifacts.js","sourceRoot":"","sources":["../../../src/mcp/agent-variants/createProjectArtifacts.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAExB,MAAM,gCAAgC,GAAG,CAAC,QAAQ,EAAE,gBAAgB,CAAU,CAAC;AAC/E,MAAM,uBAAuB,GAAG,WAAW,CAAC;AAC5C,MAAM,aAAa,GAAG,QAAQ,CAAC;AAC/B,MAAM,gBAAgB,GAAG,UAAU,CAAC;AACpC,MAAM,iBAAiB,GAAG,WAAW,CAAC;AACtC,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAC1C,MAAM,wBAAwB,GAAG,aAAa,CAAC;AAC/C,MAAM,cAAc,GAAG,UAAU,CAAC;AAClC,MAAM,aAAa,GAAG,YAAY,CAAC;AACnC,MAAM,cAAc,GAAG,YAAY,CAAC;AAEvB,QAAA,sCAAsC,GAAG,CAAC,CAAC;AAiCxD,MAAM,6BAA6B,GAAG,CAAC,YAAoB,EAAQ,EAAE;IACnE,YAAE,CAAC,SAAS,CAAC,cAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAChE,CAAC,CAAC;AAEK,MAAM,0BAA0B,GAAG,CAAC,WAAmB,EAAU,EAAE;IACxE,OAAO,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,gCAAgC,CAAC,CAAC;AACrE,CAAC,CAAC;AAFW,QAAA,0BAA0B,8BAErC;AAEK,MAAM,wBAAwB,GAAG,CAAC,WAAmB,EAAU,EAAE;IACtE,MAAM,IAAI,GAAG,WAAW;SACrB,IAAI,EAAE;SACN,WA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AoB,EACpB,QAAW,EACL,EAAE;IACR,6BAA6B,CAAC,YAAY,CAAC,CAAC;IAC5C,YAAE,CAAC,aAAa,CAAC,GAAG,YAAY,EAAE,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACxF,CAAC,CAAC;AANW,QAAA,8BAA8B,kCAMzC"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod/v3';
|
|
2
2
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
3
|
import { sourceContextInputSchema, type VisualEditorAttachment } from './contracts';
|
|
4
|
-
import { type InspirationFetcher } from './inspirationDesignContext';
|
|
5
|
-
import { type DesignContextStore } from './designContextStore';
|
|
6
4
|
import type { ToolDeps } from './tools';
|
|
7
5
|
export declare const createZeroToOneInput: {
|
|
8
6
|
prompt: z.ZodString;
|
|
@@ -18,12 +16,12 @@ export declare const createZeroToOneInput: {
|
|
|
18
16
|
content: z.ZodString;
|
|
19
17
|
}, "strip", z.ZodTypeAny, {
|
|
20
18
|
kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
|
|
21
|
-
content: string;
|
|
22
19
|
label: string;
|
|
20
|
+
content: string;
|
|
23
21
|
}, {
|
|
24
22
|
kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
|
|
25
|
-
content: string;
|
|
26
23
|
label: string;
|
|
24
|
+
content: string;
|
|
27
25
|
}>, "many">>;
|
|
28
26
|
artifact: z.ZodOptional<z.ZodObject<{
|
|
29
27
|
sourceFindings: z.ZodArray<z.ZodString, "many">;
|
|
@@ -70,14 +68,46 @@ export declare const createZeroToOneInput: {
|
|
|
70
68
|
screenshotReferences?: string[] | undefined;
|
|
71
69
|
risks?: string[] | undefined;
|
|
72
70
|
}>>;
|
|
71
|
+
sourceIntent: z.ZodOptional<z.ZodObject<{
|
|
72
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
73
|
+
url: z.ZodString;
|
|
74
|
+
role: z.ZodEnum<["design_source", "interaction_reference", "asset_source", "content_reference", "other"]>;
|
|
75
|
+
confidence: z.ZodEnum<["low", "medium", "high"]>;
|
|
76
|
+
reason: z.ZodString;
|
|
77
|
+
}, "strip", z.ZodTypeAny, {
|
|
78
|
+
reason: string;
|
|
79
|
+
url: string;
|
|
80
|
+
role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
|
|
81
|
+
confidence: "low" | "medium" | "high";
|
|
82
|
+
}, {
|
|
83
|
+
reason: string;
|
|
84
|
+
url: string;
|
|
85
|
+
role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
|
|
86
|
+
confidence: "low" | "medium" | "high";
|
|
87
|
+
}>, "many">;
|
|
88
|
+
}, "strip", z.ZodTypeAny, {
|
|
89
|
+
sources: {
|
|
90
|
+
reason: string;
|
|
91
|
+
url: string;
|
|
92
|
+
role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
|
|
93
|
+
confidence: "low" | "medium" | "high";
|
|
94
|
+
}[];
|
|
95
|
+
}, {
|
|
96
|
+
sources: {
|
|
97
|
+
reason: string;
|
|
98
|
+
url: string;
|
|
99
|
+
role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
|
|
100
|
+
confidence: "low" | "medium" | "high";
|
|
101
|
+
}[];
|
|
102
|
+
}>>;
|
|
73
103
|
designDecision: z.ZodOptional<z.ZodEnum<["let_rivet_choose", "go_custom"]>>;
|
|
74
104
|
}, "strip", z.ZodTypeAny, {
|
|
75
105
|
sourceUrls?: string[] | undefined;
|
|
76
106
|
preserveBrand?: boolean | undefined;
|
|
77
107
|
sourceArtifacts?: {
|
|
78
108
|
kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
|
|
79
|
-
content: string;
|
|
80
109
|
label: string;
|
|
110
|
+
content: string;
|
|
81
111
|
}[] | undefined;
|
|
82
112
|
artifact?: {
|
|
83
113
|
sourceFindings: string[];
|
|
@@ -92,14 +122,22 @@ export declare const createZeroToOneInput: {
|
|
|
92
122
|
screenshotReferences?: string[] | undefined;
|
|
93
123
|
risks?: string[] | undefined;
|
|
94
124
|
} | undefined;
|
|
125
|
+
sourceIntent?: {
|
|
126
|
+
sources: {
|
|
127
|
+
reason: string;
|
|
128
|
+
url: string;
|
|
129
|
+
role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
|
|
130
|
+
confidence: "low" | "medium" | "high";
|
|
131
|
+
}[];
|
|
132
|
+
} | undefined;
|
|
95
133
|
designDecision?: "let_rivet_choose" | "go_custom" | undefined;
|
|
96
134
|
}, {
|
|
97
135
|
sourceUrls?: string[] | undefined;
|
|
98
136
|
preserveBrand?: boolean | undefined;
|
|
99
137
|
sourceArtifacts?: {
|
|
100
138
|
kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
|
|
101
|
-
content: string;
|
|
102
139
|
label: string;
|
|
140
|
+
content: string;
|
|
103
141
|
}[] | undefined;
|
|
104
142
|
artifact?: {
|
|
105
143
|
sourceFindings: string[];
|
|
@@ -114,6 +152,14 @@ export declare const createZeroToOneInput: {
|
|
|
114
152
|
screenshotReferences?: string[] | undefined;
|
|
115
153
|
risks?: string[] | undefined;
|
|
116
154
|
} | undefined;
|
|
155
|
+
sourceIntent?: {
|
|
156
|
+
sources: {
|
|
157
|
+
reason: string;
|
|
158
|
+
url: string;
|
|
159
|
+
role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
|
|
160
|
+
confidence: "low" | "medium" | "high";
|
|
161
|
+
}[];
|
|
162
|
+
} | undefined;
|
|
117
163
|
designDecision?: "let_rivet_choose" | "go_custom" | undefined;
|
|
118
164
|
}>>;
|
|
119
165
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
@@ -134,29 +180,25 @@ export declare const slugifyPrompt: (prompt: string) => string;
|
|
|
134
180
|
interface CreateZeroToOneDeps extends ToolDeps {
|
|
135
181
|
/** Optional homedir resolver — overridden in tests. */
|
|
136
182
|
homedir?: () => string;
|
|
137
|
-
/**
|
|
183
|
+
/** Optional cwd resolver — overridden in tests. Defaults to process.cwd. */
|
|
184
|
+
cwd?: () => string;
|
|
185
|
+
/**
|
|
186
|
+
* Resolves the path of the editor-bound project (e.g. `bridge.getProjectPath()`).
|
|
187
|
+
* Used as the default `destinationParent` when the caller omits it, so new
|
|
188
|
+
* projects land alongside the user's open workspace instead of `~`. Returns
|
|
189
|
+
* `null` when no project is bound, in which case the tool falls back to
|
|
190
|
+
* `cwd()`.
|
|
191
|
+
*/
|
|
192
|
+
getProjectPath?: () => string | null;
|
|
193
|
+
/** Ensure the Rivet UI server exists so the variants panel can attach.
|
|
194
|
+
* `projectPath` is the subproject (`<workspaceRoot>/.rivet/<slug>/`);
|
|
195
|
+
* `workspaceRoot` is the user's working dir, which the session bridge
|
|
196
|
+
* tracks so history accumulates per-workspace, not per-subproject. */
|
|
138
197
|
ensureVisualEditorOpen?: (input: {
|
|
139
198
|
projectPath: string;
|
|
199
|
+
workspaceRoot: string;
|
|
140
200
|
framework: 'vite';
|
|
141
201
|
}) => Promise<VisualEditorAttachment>;
|
|
142
|
-
/**
|
|
143
|
-
* Inspiration-link fetcher seam. Production wires the default fetcher
|
|
144
|
-
* that hits the network with timeout, content-type, and DNS protections.
|
|
145
|
-
* Tests inject deterministic stubs so the 0→1 flow never reaches the
|
|
146
|
-
* real network from a unit test.
|
|
147
|
-
*/
|
|
148
|
-
inspirationFetcher?: InspirationFetcher;
|
|
149
|
-
/**
|
|
150
|
-
* Persistent runtime cache for generated URL design context. Production
|
|
151
|
-
* wires a filesystem-backed store rooted at `~/.rivet/design-context-cache`
|
|
152
|
-
* by default; tests inject an in-memory or tmpdir-backed store so the
|
|
153
|
-
* real user cache is never touched.
|
|
154
|
-
*
|
|
155
|
-
* Pass `null` to explicitly disable caching — useful for tests that
|
|
156
|
-
* exercise the pre-cache extraction behaviour. Omitting the field falls
|
|
157
|
-
* back to the default filesystem store.
|
|
158
|
-
*/
|
|
159
|
-
designContextStore?: DesignContextStore | null;
|
|
160
202
|
telemetry?: {
|
|
161
203
|
track(event: string, properties: Record<string, unknown>): void;
|
|
162
204
|
trackAgentVariantsSourceContextQuality?: (data: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createZeroToOneTool.d.ts","sourceRoot":"","sources":["../../../src/mcp/agent-variants/createZeroToOneTool.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"createZeroToOneTool.d.ts","sourceRoot":"","sources":["../../../src/mcp/agent-variants/createZeroToOneTool.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,EAEL,wBAAwB,EAIxB,KAAK,sBAAsB,EAC5B,MAAM,aAAa,CAAC;AAQrB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAOxC,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOhC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;IACzD,SAAS,CAAC,EAA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a,EAAE,MAAM,CAAC;YACtB,cAAc,EAAE,MAAM,CAAC;YACvB,eAAe,EAAE,MAAM,CAAC;YACxB,yBAAyB,EAAE,MAAM,CAAC;YAClC,uBAAuB,EAAE,MAAM,CAAC;YAChC,sBAAsB,EAAE,MAAM,CAAC;YAC/B,kBAAkB,EAAE,OAAO,CAAC;YAC5B,mBAAmB,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;YACzE,0BAA0B,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;SACxD,KAAK,IAAI,CAAC;KACZ,CAAC;CACH;AAED;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,GACtC,KAAK,SAAS,EACd,MAAM,mBAAmB,KACxB,IAyLF,CAAC"}
|
|
@@ -12,9 +12,8 @@ const v3_1 = require("zod/v3");
|
|
|
12
12
|
const viteReactTs_1 = require("../../services/templates/viteReactTs");
|
|
13
13
|
const contracts_1 = require("./contracts");
|
|
14
14
|
const errors_1 = require("./errors");
|
|
15
|
+
const SessionStore_1 = require("./SessionStore");
|
|
15
16
|
const sourceContext_1 = require("./sourceContext");
|
|
16
|
-
const inspirationDesignContext_1 = require("./inspirationDesignContext");
|
|
17
|
-
const designContextStore_1 = require("./designContextStore");
|
|
18
17
|
const DEFAULT_VARIANT_COUNT = 3;
|
|
19
18
|
const MIN_VARIANT_COUNT = 2;
|
|
20
19
|
const MAX_VARIANT_COUNT = 8;
|
|
@@ -27,6 +26,8 @@ exports.createZeroToOneInput = {
|
|
|
27
26
|
sourceContext: contracts_1.sourceContextInputSchema.optional(),
|
|
28
27
|
sessionId: v3_1.z.string().optional(),
|
|
29
28
|
};
|
|
29
|
+
const createZeroToOneToolInput = exports.createZeroToOneInput;
|
|
30
|
+
const proposeVariantsInputSchema = v3_1.z.object(contracts_1.proposeVariantsInput);
|
|
30
31
|
/**
|
|
31
32
|
* Slugify a prompt into a directory-safe kebab-case name with a short random
|
|
32
33
|
* suffix so concurrent calls with the same prompt don't collide.
|
|
@@ -46,6 +47,16 @@ const failed = (code, message) => ({
|
|
|
46
47
|
errorCode: code,
|
|
47
48
|
message,
|
|
48
49
|
});
|
|
50
|
+
/**
|
|
51
|
+
* Returns true when a file-copy root is specific enough to authorize asset
|
|
52
|
+
* reads. Broad roots such as the home directory or filesystem root would let
|
|
53
|
+
* an agent-controlled asset plan copy unrelated personal files.
|
|
54
|
+
*/
|
|
55
|
+
const isSpecificAssetSourceRoot = (root, homePath) => {
|
|
56
|
+
const resolvedRoot = path_1.default.resolve(root);
|
|
57
|
+
return (resolvedRoot !== path_1.default.resolve(homePath) &&
|
|
58
|
+
resolvedRoot !== path_1.default.parse(resolvedRoot).root);
|
|
59
|
+
};
|
|
49
60
|
/**
|
|
50
61
|
* Register the `create_zero_to_one_project` convenience MCP tool. Normalizes
|
|
51
62
|
* the variant count, slugifies the prompt to derive a destination directory,
|
|
@@ -54,81 +65,56 @@ const failed = (code, message) => ({
|
|
|
54
65
|
*/
|
|
55
66
|
const registerCreateZeroToOneTool = (mcp, deps) => {
|
|
56
67
|
const homedir = deps.homedir ?? os_1.default.homedir;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
// caching entirely. The default store is constructed lazily so we only
|
|
60
|
-
// touch `os.homedir()` if the flow actually uses it. Memoized so the
|
|
61
|
-
// first call's `dirReady`/`mkdir` state survives across tool
|
|
62
|
-
// invocations instead of being thrown away after each request.
|
|
63
|
-
let defaultDesignContextStore;
|
|
64
|
-
const resolveDesignContextStore = () => {
|
|
65
|
-
if (deps.designContextStore === null)
|
|
66
|
-
return undefined;
|
|
67
|
-
if (deps.designContextStore !== undefined)
|
|
68
|
-
return deps.designContextStore;
|
|
69
|
-
if (!defaultDesignContextStore) {
|
|
70
|
-
defaultDesignContextStore = new designContextStore_1.FileDesignContextStore();
|
|
71
|
-
}
|
|
72
|
-
return defaultDesignContextStore;
|
|
73
|
-
};
|
|
74
|
-
mcp.tool('create_zero_to_one_project', 'Convenience entry point for creating a new project from scratch. Slugifies the prompt into a destination directory under the user home and starts an agent-variants session with projectContext.kind=fresh. Returns the same response shape as propose_variants. REQUIRED PROTOCOL: source_research (when requested) -> report_source_context -> briefs -> user confirmation -> approve -> IMMEDIATELY share the visualEditor.url with the user ("Generating variants — watch here: <url>") -> request_work -> generate static_preview HTML/CSS for each work item -> report_variant_complete -> when terminal, share each previewUrl from the response with the user as clickable links -> user picks variant -> commit. static_preview is the final deliverable — no code_gen or Vite scaffold is created. Briefs: label ≤ 4 words, body exactly ONE sentence ≤ 20 words — a single evocative descriptor (no bullets, no lists). MANDATORY USER CONFIRMATION: after report_variant_briefs, show the numbered brief list and wait for feedback before approve_variant_briefs. NEVER auto-approve. For static_preview work items, report_variant_complete output must be {html: string, css?: string, js?: string} — write self-contained HTML with no React/Vite-only imports. After user commit, Rivet writes the HTML to index.html at the destination directory.', exports.createZeroToOneInput, async (args) => {
|
|
68
|
+
mcp.tool('create_zero_to_one_project', 'Entry point for source-grounded fresh projects (inspiration URLs, custom design context). Slugifies the prompt into a destination directory under the user home, runs the source-research flow with an in-chat brief approval gate, and outputs static_preview HTML/CSS deliverables. Prefer start_variants(mode="zero_to_one") for prompt-only fresh projects without inspiration sources. Full protocol in the rivet skill.', createZeroToOneToolInput, async (rawArgs) => {
|
|
69
|
+
const args = rawArgs;
|
|
75
70
|
try {
|
|
76
71
|
const framework = args.framework ?? 'vite';
|
|
77
72
|
if (framework !== 'vite') {
|
|
78
73
|
return jsonResponse(failed('UNSUPPORTED_FRAMEWORK', `create_zero_to_one_project only supports framework='vite' in v1; got '${framework}'.`));
|
|
79
74
|
}
|
|
80
75
|
const count = clampCount(args.count);
|
|
76
|
+
const inputSourceUrls = args.sourceContext?.sourceUrls ?? [];
|
|
81
77
|
const sourceUrls = (0, sourceContext_1.resolveSourceUrls)(args.prompt, args.sourceContext);
|
|
78
|
+
// Compare raw inputs in their normalized form so URLs that only
|
|
79
|
+
// differ by hash fragments or trailing punctuation aren't reported
|
|
80
|
+
// as dropped when they were in fact included.
|
|
81
|
+
const resolvedSet = new Set(sourceUrls);
|
|
82
|
+
const droppedUrls = inputSourceUrls.filter((u) => {
|
|
83
|
+
const normalized = (0, sourceContext_1.normalizeUrl)(u);
|
|
84
|
+
return normalized === null || !resolvedSet.has(normalized);
|
|
85
|
+
});
|
|
86
|
+
const warnings = droppedUrls.map((url) => `Skipped source URL '${url}' — failed validation (private network, unsupported scheme, or unreachable).`);
|
|
82
87
|
const sourceArtifacts = (0, sourceContext_1.normalizeSourceArtifacts)(args.sourceContext?.sourceArtifacts);
|
|
83
|
-
const
|
|
88
|
+
const projectPath = deps.getProjectPath?.() ?? undefined;
|
|
89
|
+
const cwd = deps.cwd ?? (() => process.cwd());
|
|
90
|
+
// Default chain: explicit arg → currently-open editor project →
|
|
91
|
+
// MCP server cwd. cwd (not homedir) so generated projects land
|
|
92
|
+
// near where the user is actually working — their shell's PWD
|
|
93
|
+
// when claude-code spawned the MCP server — rather than dumped
|
|
94
|
+
// at the home root.
|
|
95
|
+
const destinationParent = args.destinationParent ?? projectPath ?? cwd();
|
|
84
96
|
if (!path_1.default.isAbsolute(destinationParent)) {
|
|
85
97
|
return jsonResponse(failed('SCHEMA_VALIDATION_FAILED', `destinationParent must be absolute; got '${destinationParent}'.`));
|
|
86
98
|
}
|
|
87
99
|
const slug = (0, exports.slugifyPrompt)(args.prompt);
|
|
88
|
-
|
|
100
|
+
// The generated subproject lives under `<workspaceRoot>/.rivet/<slug>/`
|
|
101
|
+
// so the user's working dir stays clean — every Rivet artifact
|
|
102
|
+
// (subprojects, variant history, create-project manifests, snapshots)
|
|
103
|
+
// sits inside the single `.rivet/` directory.
|
|
104
|
+
const workspaceRoot = destinationParent;
|
|
105
|
+
const destinationPath = path_1.default.join(workspaceRoot, '.rivet', slug);
|
|
89
106
|
if (!(0, viteReactTs_1.isDestinationEmpty)(destinationPath)) {
|
|
90
107
|
return jsonResponse(failed('DESTINATION_NOT_EMPTY', `Destination '${destinationPath}' is not empty.`));
|
|
91
108
|
}
|
|
92
|
-
const
|
|
93
|
-
?
|
|
94
|
-
|
|
95
|
-
prompt: args.prompt,
|
|
96
|
-
sourceContext: args.sourceContext,
|
|
97
|
-
slotCount: count,
|
|
98
|
-
fetcher: deps.inspirationFetcher,
|
|
99
|
-
store: resolveDesignContextStore(),
|
|
100
|
-
forceRefresh: (0, designContextStore_1.promptRequestsFreshExtraction)(args.prompt),
|
|
101
|
-
})
|
|
102
|
-
: {
|
|
103
|
-
entries: [],
|
|
104
|
-
warnings: [],
|
|
105
|
-
telemetry: {
|
|
106
|
-
inspirationLinkCount: 0,
|
|
107
|
-
referenceLinkCount: 0,
|
|
108
|
-
successfulExtractions: 0,
|
|
109
|
-
lowSignalCount: 0,
|
|
110
|
-
fetchFailureCount: 0,
|
|
111
|
-
blockedTargetCount: 0,
|
|
112
|
-
mergeStrategy: 'none',
|
|
113
|
-
cache: {
|
|
114
|
-
hitCount: 0,
|
|
115
|
-
missCount: 0,
|
|
116
|
-
staleCount: 0,
|
|
117
|
-
versionMismatchCount: 0,
|
|
118
|
-
lowConfidenceCount: 0,
|
|
119
|
-
regenerationCount: 0,
|
|
120
|
-
forcedRefresh: false,
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
};
|
|
124
|
-
const designContextEntries = collapseDesignContextEntries(inspirationOutcome.entries);
|
|
109
|
+
const assetSourceRoot = projectPath && isSpecificAssetSourceRoot(projectPath, homedir())
|
|
110
|
+
? path_1.default.resolve(projectPath)
|
|
111
|
+
: undefined;
|
|
125
112
|
const projectContext = {
|
|
126
113
|
kind: 'fresh',
|
|
127
114
|
workspacePath: destinationPath,
|
|
115
|
+
workspaceRoot,
|
|
128
116
|
framework: 'vite',
|
|
129
|
-
...(
|
|
130
|
-
? { designContext: designContextEntries }
|
|
131
|
-
: {}),
|
|
117
|
+
...(assetSourceRoot ? { assetSourceRoot } : {}),
|
|
132
118
|
...(sourceUrls.length > 0 ||
|
|
133
119
|
sourceArtifacts.length > 0 ||
|
|
134
120
|
args.sourceContext?.preserveBrand !== undefined
|
|
@@ -143,10 +129,10 @@ const registerCreateZeroToOneTool = (mcp, deps) => {
|
|
|
143
129
|
}
|
|
144
130
|
: {}),
|
|
145
131
|
};
|
|
146
|
-
// Ensure the destination's parent exists
|
|
147
|
-
// commit time has a directory to write
|
|
148
|
-
// is created during materialize.
|
|
149
|
-
fs_1.default.mkdirSync(
|
|
132
|
+
// Ensure the destination's parent (`<workspaceRoot>/.rivet/`) exists
|
|
133
|
+
// so the materialize step at commit time has a directory to write
|
|
134
|
+
// into. The destination itself is created during materialize.
|
|
135
|
+
fs_1.default.mkdirSync(path_1.default.dirname(destinationPath), { recursive: true });
|
|
150
136
|
const proposeInput = {
|
|
151
137
|
sessionId: args.sessionId,
|
|
152
138
|
prompt: args.prompt,
|
|
@@ -155,13 +141,14 @@ const registerCreateZeroToOneTool = (mcp, deps) => {
|
|
|
155
141
|
};
|
|
156
142
|
// Validate via the shared schema before delegating, so the proxy and
|
|
157
143
|
// direct callers see the same rejection shape.
|
|
158
|
-
const parsed =
|
|
144
|
+
const parsed = proposeVariantsInputSchema.safeParse(proposeInput);
|
|
159
145
|
if (!parsed.success) {
|
|
160
146
|
return jsonResponse(failed('SCHEMA_VALIDATION_FAILED', parsed.error.message));
|
|
161
147
|
}
|
|
162
148
|
const visualEditor = deps.ensureVisualEditorOpen
|
|
163
149
|
? await deps.ensureVisualEditorOpen({
|
|
164
150
|
projectPath: destinationPath,
|
|
151
|
+
workspaceRoot,
|
|
165
152
|
framework: 'vite',
|
|
166
153
|
})
|
|
167
154
|
: undefined;
|
|
@@ -175,46 +162,20 @@ const registerCreateZeroToOneTool = (mcp, deps) => {
|
|
|
175
162
|
preserveBrand: Boolean(args.sourceContext?.preserveBrand),
|
|
176
163
|
});
|
|
177
164
|
}
|
|
178
|
-
if (
|
|
179
|
-
inspirationOutcome.telemetry.referenceLinkCount > 0) {
|
|
180
|
-
const { cache, ...telemetryCounts } = inspirationOutcome.telemetry;
|
|
181
|
-
deps.telemetry?.trackAgentVariantsInspirationExtraction?.({
|
|
182
|
-
sessionId: result.sessionId,
|
|
183
|
-
...telemetryCounts,
|
|
184
|
-
cacheHitCount: cache.hitCount,
|
|
185
|
-
cacheMissCount: cache.missCount,
|
|
186
|
-
cacheStaleCount: cache.staleCount,
|
|
187
|
-
cacheVersionMismatchCount: cache.versionMismatchCount,
|
|
188
|
-
cacheLowConfidenceCount: cache.lowConfidenceCount,
|
|
189
|
-
cacheRegenerationCount: cache.regenerationCount,
|
|
190
|
-
cacheForcedRefresh: cache.forcedRefresh,
|
|
191
|
-
...(inspirationOutcome.cacheReuse
|
|
192
|
-
? {
|
|
193
|
-
cacheReuseAgeBucket: inspirationOutcome.cacheReuse.ageBucket,
|
|
194
|
-
cacheReuseConfidenceBucket: inspirationOutcome.cacheReuse.confidenceBucket,
|
|
195
|
-
}
|
|
196
|
-
: {}),
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
const warningsField = inspirationOutcome.warnings.length > 0
|
|
200
|
-
? { inspirationWarnings: inspirationOutcome.warnings }
|
|
201
|
-
: {};
|
|
202
|
-
if (result.stage === 'awaiting_source_research') {
|
|
165
|
+
if (result.stage === 'awaiting_source_plan') {
|
|
203
166
|
return jsonResponse({
|
|
204
167
|
sessionId: result.sessionId,
|
|
205
|
-
stage: '
|
|
206
|
-
|
|
207
|
-
id: result.
|
|
208
|
-
kind: '
|
|
209
|
-
attempt: result.
|
|
210
|
-
input: result.
|
|
211
|
-
output_schema:
|
|
212
|
-
sourceContext: 'sourceFindings, sectionInventory, visualObservations, sourceRoles, qualityBar, screenshotReferences?',
|
|
213
|
-
},
|
|
168
|
+
stage: 'awaiting_source_plan',
|
|
169
|
+
sourcePlanWorkItem: {
|
|
170
|
+
id: result.sourcePlanWorkItem.id,
|
|
171
|
+
kind: 'source_plan',
|
|
172
|
+
attempt: result.sourcePlanWorkItem.attempt,
|
|
173
|
+
input: result.sourcePlanWorkItem.input,
|
|
174
|
+
output_schema: SessionStore_1.SOURCE_PLAN_OUTPUT_SCHEMA,
|
|
214
175
|
},
|
|
215
176
|
nextAction: 'continue_variants',
|
|
216
177
|
...(visualEditor ? { visualEditor } : {}),
|
|
217
|
-
...
|
|
178
|
+
...(warnings.length > 0 ? { warnings } : {}),
|
|
218
179
|
});
|
|
219
180
|
}
|
|
220
181
|
return jsonResponse({
|
|
@@ -229,7 +190,7 @@ const registerCreateZeroToOneTool = (mcp, deps) => {
|
|
|
229
190
|
},
|
|
230
191
|
nextAction: 'report_variant_briefs',
|
|
231
192
|
...(visualEditor ? { visualEditor } : {}),
|
|
232
|
-
...
|
|
193
|
+
...(warnings.length > 0 ? { warnings } : {}),
|
|
233
194
|
});
|
|
234
195
|
}
|
|
235
196
|
catch (err) {
|
|
@@ -257,33 +218,6 @@ const clampCount = (count) => {
|
|
|
257
218
|
return MAX_VARIANT_COUNT;
|
|
258
219
|
return count;
|
|
259
220
|
};
|
|
260
|
-
/**
|
|
261
|
-
* Reduce inspiration-extraction output to the shape the project context
|
|
262
|
-
* accepts: a defined-only `DesignContextEntry[]` of length `entries.length`
|
|
263
|
-
* when every slot has extraction output, or `undefined` when at least one
|
|
264
|
-
* slot is missing so downstream slots fall back to prompt direction.
|
|
265
|
-
*
|
|
266
|
-
* The producer (`extractInspirationDesignContext`) currently populates the
|
|
267
|
-
* array all-or-nothing — either every slot gets an entry or every slot is
|
|
268
|
-
* `undefined`. Downstream consumers index per slot
|
|
269
|
-
* (`WorktreeManager.createFreshWorktrees` uses `designContext?.[i]`, and
|
|
270
|
-
* `summarizeDesignContext` tags telemetry with the slot index), so silently
|
|
271
|
-
* compacting `[A, undefined, B]` to `[A, B]` would shift B from slot 2 to
|
|
272
|
-
* slot 1 and misassign per-slot guidance. If the producer's invariant ever
|
|
273
|
-
* softens, fail closed here: drop the partial context rather than emitting
|
|
274
|
-
* a slot-shifted array.
|
|
275
|
-
*/
|
|
276
|
-
const collapseDesignContextEntries = (entries) => {
|
|
277
|
-
if (entries.length === 0)
|
|
278
|
-
return undefined;
|
|
279
|
-
const populated = [];
|
|
280
|
-
for (const entry of entries) {
|
|
281
|
-
if (entry === undefined)
|
|
282
|
-
return undefined;
|
|
283
|
-
populated.push(entry);
|
|
284
|
-
}
|
|
285
|
-
return populated;
|
|
286
|
-
};
|
|
287
221
|
const jsonResponse = (payload) => ({
|
|
288
222
|
content: [
|
|
289
223
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createZeroToOneTool.js","sourceRoot":"","sources":["../../../src/mcp/agent-variants/createZeroToOneTool.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAqC;AACrC,4CAAoB;AACpB,4CAAoB;AACpB,gDAAwB;AACxB,+BAA2B;
|
|
1
|
+
{"version":3,"file":"createZeroToOneTool.js","sourceRoot":"","sources":["../../../src/mcp/agent-variants/createZeroToOneTool.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAqC;AACrC,4CAAoB;AACpB,4CAAoB;AACpB,gDAAwB;AACxB,+BAA2B;AAG3B,sEAA0E;AAC1E,2CAOqB;AACrB,qCAA8D;AAC9D,iDAA2D;AAC3D,mDAIyB;AAGzB,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAChC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAEf,QAAA,oBAAoB,GAAG;IAClC,MAAM,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,KAAK,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,QAAQ,EAAE;IAChF,iBAAiB,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,SAAS,EAAE,MAAC,CAAC,IAAI,CA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gBACf,OAAO;aACR,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AA5LW,QAAA,2BAA2B,+BA4LtC;AAEF,MAAM,UAAU,GAAG,CAAC,KAAyB,EAAU,EAAE;IACvD,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,qBAAqB,CAAC;IACtD,IAAI,KAAK,GAAG,iBAAiB;QAAE,OAAO,iBAAiB,CAAC;IACxD,IAAI,KAAK,GAAG,iBAAiB;QAAE,OAAO,iBAAiB,CAAC;IACxD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAI,OAAU,EAAE,EAAE,CAAC,CAAC;IACvC,OAAO,EAAE;QACP;YACE,IAAI,EAAE,MAAe;YACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;SAC9B;KACF;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const ERROR_CODES: readonly ["INVALID_STAGE_ACTION", "INVALID_TRANSITION", "MISSING_REQUIRED_INPUT", "STALE_LEASE", "LEASE_EXPIRED", "LEASE_MISMATCH", "PENDING_CHANGE_CONFLICT", "SCHEMA_VALIDATION_FAILED", "RUNTIME_VALIDATION_FAILED", "CLEANUP_TIMEOUT", "DEPENDENCY_FAILED", "SESSION_NOT_FOUND", "WORK_ITEM_NOT_FOUND", "UNSUPPORTED_FRAMEWORK", "UNKNOWN_DESIGN_SYSTEM", "DESTINATION_NOT_EMPTY", "SCAFFOLD_FAILED", "SOURCE_CONTEXT_INVALID", "SOURCE_CONTEXT_TOO_LARGE"];
|
|
1
|
+
export declare const ERROR_CODES: readonly ["INVALID_STAGE_ACTION", "INVALID_TRANSITION", "MISSING_REQUIRED_INPUT", "STALE_LEASE", "LEASE_EXPIRED", "LEASE_MISMATCH", "PENDING_CHANGE_CONFLICT", "SCHEMA_VALIDATION_FAILED", "RUNTIME_VALIDATION_FAILED", "CLEANUP_TIMEOUT", "DEPENDENCY_FAILED", "SESSION_NOT_FOUND", "WORK_ITEM_NOT_FOUND", "UNSUPPORTED_FRAMEWORK", "UNKNOWN_DESIGN_SYSTEM", "DESTINATION_NOT_EMPTY", "SCAFFOLD_FAILED", "SOURCE_CONTEXT_INVALID", "SOURCE_CONTEXT_TOO_LARGE", "VARIANT_QA_FAILED"];
|
|
2
2
|
export type ErrorCode = (typeof ERROR_CODES)[number];
|
|
3
3
|
export declare class AgentVariantsError extends Error {
|
|
4
4
|
readonly code: ErrorCode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/mcp/agent-variants/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/mcp/agent-variants/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,sdAqBd,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM;CAM7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/mcp/agent-variants/errors.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG;IACzB,sBAAsB;IACtB,oBAAoB;IACpB,wBAAwB;IACxB,aAAa;IACb,eAAe;IACf,gBAAgB;IAChB,yBAAyB;IACzB,0BAA0B;IAC1B,2BAA2B;IAC3B,iBAAiB;IACjB,mBAAmB;IACnB,mBAAmB;IACnB,qBAAqB;IACrB,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;IACvB,iBAAiB;IACjB,wBAAwB;IACxB,0BAA0B;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/mcp/agent-variants/errors.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG;IACzB,sBAAsB;IACtB,oBAAoB;IACpB,wBAAwB;IACxB,aAAa;IACb,eAAe;IACf,gBAAgB;IAChB,yBAAyB;IACzB,0BAA0B;IAC1B,2BAA2B;IAC3B,iBAAiB;IACjB,mBAAmB;IACnB,mBAAmB;IACnB,qBAAqB;IACrB,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;IACvB,iBAAiB;IACjB,wBAAwB;IACxB,0BAA0B;IAC1B,mBAAmB;CACX,CAAC;AAIX,MAAa,kBAAmB,SAAQ,KAAK;IAClC,IAAI,CAAY;IAChB,MAAM,CAAS;IAExB,YAAY,IAAe,EAAE,OAAe;QAC1C,KAAK,CAAC,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF;AAVD,gDAUC"}
|
|
@@ -4,11 +4,10 @@ export { PendingChangesAdapter } from './pendingChangesAdapter';
|
|
|
4
4
|
export type { AdapterTelemetry, BridgeChangeIntent, BridgeQueue, } from './pendingChangesAdapter';
|
|
5
5
|
export { AgentVariantsOrchestrator } from './WorktreeOrchestrator';
|
|
6
6
|
export type { OrchestratorDeps, ProjectEnvironment, WorktreeManagerLike, } from './WorktreeOrchestrator';
|
|
7
|
-
export { registerAgentVariantsTools } from './tools';
|
|
7
|
+
export { registerAgentVariantsTools, slugifyPrompt } from './tools';
|
|
8
|
+
export { registerCreateZeroToOneTool } from './createZeroToOneTool';
|
|
8
9
|
export type { ToolDeps } from './tools';
|
|
9
|
-
export { registerCreateZeroToOneTool, slugifyPrompt, } from './createZeroToOneTool';
|
|
10
|
-
export type { CreateZeroToOneInput } from './createZeroToOneTool';
|
|
11
10
|
export { AgentVariantsError, ERROR_CODES, type ErrorCode } from './errors';
|
|
12
11
|
export { VARIANT_COUNT_MIN, VARIANT_COUNT_MAX } from './contracts';
|
|
13
|
-
export type { Brief, CancelVariantsInput, CancelVariantsOutput, ContinueVariantsInput, ContinueVariantsOutput, LeaseRecord, LeasedWorkItemDescriptor, ProjectContext, ProposeVariantsInput, ProposeVariantsOutput, ReportVariantBriefsInput, ReportVariantBriefsOutput,
|
|
12
|
+
export type { Brief, CancelVariantsInput, CancelVariantsOutput, ContinueVariantsInput, ContinueVariantsOutput, ExtractInspirationContextInput, ExtractInspirationContextOutput, LeaseRecord, LeasedWorkItemDescriptor, ProjectContext, ProposeVariantsInput, ProposeVariantsOutput, ReportVariantBriefsInput, ReportVariantBriefsOutput, ReportSourcePlanInput, ReportSourcePlanOutput, ReportVariantCompleteInput, ReportVariantCompleteOutput, SourceContextArtifact, SourceContextInput, SourcePlanArtifact, SourcePlanWorkItemDescriptor, Stage, Target, TerminalSummary, VariantPickEnvelope, VariantPickPayload, VisualEditorAttachment, WorkItem, WorkItemKind, WorkItemStatus, } from './contracts';
|
|
14
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mcp/agent-variants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EACV,sBAAsB,EACtB,aAAa,EACb,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,GACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,0BAA0B,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mcp/agent-variants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EACV,sBAAsB,EACtB,aAAa,EACb,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,GACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACnE,YAAY,EACV,KAAK,EACL,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,8BAA8B,EAC9B,+BAA+B,EAC/B,WAAW,EACX,wBAAwB,EACxB,cAAc,EACd,oBAAoB,EACpB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,EAC3B,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,4BAA4B,EAC5B,KAAK,EACL,MAAM,EACN,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,QAAQ,EACR,YAAY,EACZ,cAAc,GACf,MAAM,aAAa,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VARIANT_COUNT_MAX = exports.VARIANT_COUNT_MIN = exports.ERROR_CODES = exports.AgentVariantsError = exports.
|
|
3
|
+
exports.VARIANT_COUNT_MAX = exports.VARIANT_COUNT_MIN = exports.ERROR_CODES = exports.AgentVariantsError = exports.registerCreateZeroToOneTool = exports.slugifyPrompt = exports.registerAgentVariantsTools = exports.AgentVariantsOrchestrator = exports.PendingChangesAdapter = exports.SessionStore = void 0;
|
|
4
4
|
var SessionStore_1 = require("./SessionStore");
|
|
5
5
|
Object.defineProperty(exports, "SessionStore", { enumerable: true, get: function () { return SessionStore_1.SessionStore; } });
|
|
6
6
|
var pendingChangesAdapter_1 = require("./pendingChangesAdapter");
|
|
@@ -9,9 +9,9 @@ var WorktreeOrchestrator_1 = require("./WorktreeOrchestrator");
|
|
|
9
9
|
Object.defineProperty(exports, "AgentVariantsOrchestrator", { enumerable: true, get: function () { return WorktreeOrchestrator_1.AgentVariantsOrchestrator; } });
|
|
10
10
|
var tools_1 = require("./tools");
|
|
11
11
|
Object.defineProperty(exports, "registerAgentVariantsTools", { enumerable: true, get: function () { return tools_1.registerAgentVariantsTools; } });
|
|
12
|
+
Object.defineProperty(exports, "slugifyPrompt", { enumerable: true, get: function () { return tools_1.slugifyPrompt; } });
|
|
12
13
|
var createZeroToOneTool_1 = require("./createZeroToOneTool");
|
|
13
14
|
Object.defineProperty(exports, "registerCreateZeroToOneTool", { enumerable: true, get: function () { return createZeroToOneTool_1.registerCreateZeroToOneTool; } });
|
|
14
|
-
Object.defineProperty(exports, "slugifyPrompt", { enumerable: true, get: function () { return createZeroToOneTool_1.slugifyPrompt; } });
|
|
15
15
|
var errors_1 = require("./errors");
|
|
16
16
|
Object.defineProperty(exports, "AgentVariantsError", { enumerable: true, get: function () { return errors_1.AgentVariantsError; } });
|
|
17
17
|
Object.defineProperty(exports, "ERROR_CODES", { enumerable: true, get: function () { return errors_1.ERROR_CODES; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mcp/agent-variants/index.ts"],"names":[],"mappings":";;;AAAA,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AAUrB,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAM9B,+DAAmE;AAA1D,iIAAA,yBAAyB,OAAA;AAMlC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mcp/agent-variants/index.ts"],"names":[],"mappings":";;;AAAA,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AAUrB,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAM9B,+DAAmE;AAA1D,iIAAA,yBAAyB,OAAA;AAMlC,iCAAoE;AAA3D,mHAAA,0BAA0B,OAAA;AAAE,sGAAA,aAAa,OAAA;AAClD,6DAAoE;AAA3D,kIAAA,2BAA2B,OAAA;AAEpC,mCAA2E;AAAlE,4GAAA,kBAAkB,OAAA;AAAE,qGAAA,WAAW,OAAA;AACxC,yCAAmE;AAA1D,8GAAA,iBAAiB,OAAA;AAAE,8GAAA,iBAAiB,OAAA"}
|
|
@@ -275,6 +275,16 @@ export interface InspirationExtractionOutcome {
|
|
|
275
275
|
* confidence buckets, never raw URLs or extracted text.
|
|
276
276
|
*/
|
|
277
277
|
cacheReuse?: InspirationCacheOutcomeMetadata;
|
|
278
|
+
/**
|
|
279
|
+
* Structured error code surfaced when every supplied inspiration URL fails
|
|
280
|
+
* during fetch. Absent when URLs load but do not contain enough design signal.
|
|
281
|
+
*/
|
|
282
|
+
errorCode?: 'INSPIRATION_FETCH_ALL_FAILED';
|
|
283
|
+
/**
|
|
284
|
+
* Human-readable companion to `errorCode`. Recommends a recovery action
|
|
285
|
+
* (e.g. passing a local file via `assetUrls`). Safe to surface verbatim.
|
|
286
|
+
*/
|
|
287
|
+
errorMessage?: string;
|
|
278
288
|
}
|
|
279
289
|
/**
|
|
280
290
|
* Synchronous URL validator: enforces HTTP/HTTPS scheme and rejects literal
|