rivet-design 0.22.0 → 0.23.1
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/bin/rivet.js +6 -0
- package/dist/agent-variants/SessionStore.d.ts +2 -21
- package/dist/agent-variants/SessionStore.d.ts.map +1 -1
- package/dist/agent-variants/SessionStore.js +15 -279
- package/dist/agent-variants/SessionStore.js.map +1 -1
- package/dist/agent-variants/WorktreeOrchestrator.d.ts +0 -3
- package/dist/agent-variants/WorktreeOrchestrator.d.ts.map +1 -1
- package/dist/agent-variants/WorktreeOrchestrator.js +1 -62
- package/dist/agent-variants/WorktreeOrchestrator.js.map +1 -1
- package/dist/agent-variants/WorktreeOrchestrator.testHelpers.d.ts.map +1 -1
- package/dist/agent-variants/WorktreeOrchestrator.testHelpers.js +0 -12
- package/dist/agent-variants/WorktreeOrchestrator.testHelpers.js.map +1 -1
- package/dist/agent-variants/contracts.d.ts +1205 -2732
- package/dist/agent-variants/contracts.d.ts.map +1 -1
- package/dist/agent-variants/contracts.js +2 -84
- package/dist/agent-variants/contracts.js.map +1 -1
- package/dist/agent-variants/directionBriefs.d.ts +7 -0
- package/dist/agent-variants/directionBriefs.d.ts.map +1 -0
- package/dist/agent-variants/directionBriefs.js +51 -0
- package/dist/agent-variants/directionBriefs.js.map +1 -0
- package/dist/agent-variants/index.d.ts +1 -1
- package/dist/agent-variants/index.d.ts.map +1 -1
- package/dist/agent-variants/runPlan.d.ts +0 -1
- package/dist/agent-variants/runPlan.d.ts.map +1 -1
- package/dist/agent-variants/runPlan.js +0 -4
- package/dist/agent-variants/runPlan.js.map +1 -1
- package/dist/agent-variants/sourceContext.d.ts +0 -2
- package/dist/agent-variants/sourceContext.d.ts.map +1 -1
- package/dist/agent-variants/sourceContext.js +1 -35
- package/dist/agent-variants/sourceContext.js.map +1 -1
- package/dist/agent-variants/variantsTelemetry.d.ts +0 -3
- package/dist/agent-variants/variantsTelemetry.d.ts.map +1 -1
- package/dist/agent-variants/variantsTelemetry.js.map +1 -1
- package/dist/agent-variants/workItemInput.d.ts +662 -662
- package/dist/cli/commands/context.d.ts +3 -1
- package/dist/cli/commands/context.d.ts.map +1 -1
- package/dist/cli/commands/context.js +38 -1
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/contextRequest.d.ts +1 -0
- package/dist/cli/commands/contextRequest.d.ts.map +1 -1
- package/dist/cli/commands/contextRequest.js +65 -5
- package/dist/cli/commands/contextRequest.js.map +1 -1
- package/dist/cli/commands/guidanceReferences.d.ts +1 -0
- package/dist/cli/commands/guidanceReferences.d.ts.map +1 -1
- package/dist/cli/commands/guidanceReferences.js +5 -4
- package/dist/cli/commands/guidanceReferences.js.map +1 -1
- package/dist/cli/commands/guidanceVerifierPackage.d.ts +9 -0
- package/dist/cli/commands/guidanceVerifierPackage.d.ts.map +1 -0
- package/dist/cli/commands/guidanceVerifierPackage.js +41 -0
- package/dist/cli/commands/guidanceVerifierPackage.js.map +1 -0
- package/dist/cli/commands/mcpServe.d.ts +1 -0
- package/dist/cli/commands/mcpServe.d.ts.map +1 -1
- package/dist/cli/commands/mcpServe.js +457 -326
- package/dist/cli/commands/mcpServe.js.map +1 -1
- package/dist/cli/commands/variants.js +2 -2
- package/dist/cli/commands/variants.js.map +1 -1
- package/dist/cli/handoffStore.d.ts +0 -1
- package/dist/cli/handoffStore.d.ts.map +1 -1
- package/dist/cli/handoffStore.js +1 -11
- package/dist/cli/handoffStore.js.map +1 -1
- package/dist/cli/router.d.ts +3 -1
- package/dist/cli/router.d.ts.map +1 -1
- package/dist/cli/router.js +4 -3
- package/dist/cli/router.js.map +1 -1
- package/dist/config/flags.d.ts +0 -3
- package/dist/config/flags.d.ts.map +1 -1
- package/dist/config/flags.js +0 -1
- package/dist/config/flags.js.map +1 -1
- package/dist/config/proxy.d.ts +0 -2
- package/dist/config/proxy.d.ts.map +1 -1
- package/dist/config/proxy.js +1 -10
- package/dist/config/proxy.js.map +1 -1
- package/dist/hosts/workerDefaults.d.ts +0 -1
- package/dist/hosts/workerDefaults.d.ts.map +1 -1
- package/dist/hosts/workerDefaults.js +1 -2
- package/dist/hosts/workerDefaults.js.map +1 -1
- package/dist/index-core.d.ts +1 -2
- package/dist/index-core.d.ts.map +1 -1
- package/dist/index-core.js +1 -3
- package/dist/index-core.js.map +1 -1
- package/dist/mcp/changeBatchClassification.d.ts +1 -11
- package/dist/mcp/changeBatchClassification.d.ts.map +1 -1
- package/dist/mcp/changeBatchClassification.js +0 -38
- package/dist/mcp/changeBatchClassification.js.map +1 -1
- package/dist/routes/git.d.ts +0 -1
- package/dist/routes/git.d.ts.map +1 -1
- package/dist/routes/git.js +2 -7
- package/dist/routes/git.js.map +1 -1
- package/dist/routes/library/guidance.d.ts.map +1 -1
- package/dist/routes/library/guidance.js +7 -0
- package/dist/routes/library/guidance.js.map +1 -1
- package/dist/server.d.ts +0 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +2 -8
- package/dist/server.js.map +1 -1
- package/dist/services/AuthService.d.ts +6 -12
- package/dist/services/AuthService.d.ts.map +1 -1
- package/dist/services/AuthService.js +1 -116
- package/dist/services/AuthService.js.map +1 -1
- package/dist/services/CommitMessageGenerator.d.ts +1 -5
- package/dist/services/CommitMessageGenerator.d.ts.map +1 -1
- package/dist/services/CommitMessageGenerator.js +9 -38
- package/dist/services/CommitMessageGenerator.js.map +1 -1
- package/dist/services/GuidanceVerifierRunner.d.ts +15 -0
- package/dist/services/GuidanceVerifierRunner.d.ts.map +1 -0
- package/dist/services/GuidanceVerifierRunner.js +373 -0
- package/dist/services/GuidanceVerifierRunner.js.map +1 -0
- package/dist/services/HubDiscovery.d.ts +2 -2
- package/dist/services/IntegrationsClient.d.ts +6 -6
- package/dist/services/LocalGitService.d.ts +0 -3
- package/dist/services/LocalGitService.d.ts.map +1 -1
- package/dist/services/LocalGitService.js +0 -41
- package/dist/services/LocalGitService.js.map +1 -1
- package/dist/services/MCPOnboardingTelemetry.d.ts +0 -2
- package/dist/services/MCPOnboardingTelemetry.d.ts.map +1 -1
- package/dist/services/MCPOnboardingTelemetry.js +1 -78
- package/dist/services/MCPOnboardingTelemetry.js.map +1 -1
- package/dist/services/OperatingSystemServices.d.ts.map +1 -1
- package/dist/services/OperatingSystemServices.js +12 -5
- package/dist/services/OperatingSystemServices.js.map +1 -1
- package/dist/services/PRTitleGenerator.d.ts +2 -8
- package/dist/services/PRTitleGenerator.d.ts.map +1 -1
- package/dist/services/PRTitleGenerator.js +12 -74
- package/dist/services/PRTitleGenerator.js.map +1 -1
- package/dist/services/ProjectRegistry.d.ts +2 -2
- package/dist/services/SessionService.d.ts +1 -4
- package/dist/services/SessionService.d.ts.map +1 -1
- package/dist/services/SessionService.js +5 -16
- package/dist/services/SessionService.js.map +1 -1
- package/dist/services/TelemetryService.d.ts +1 -9
- package/dist/services/TelemetryService.d.ts.map +1 -1
- package/dist/services/TelemetryService.js +0 -28
- package/dist/services/TelemetryService.js.map +1 -1
- package/dist/services/VariantGenerationService.d.ts +1 -9
- package/dist/services/VariantGenerationService.d.ts.map +1 -1
- package/dist/services/VariantGenerationService.js +16 -140
- package/dist/services/VariantGenerationService.js.map +1 -1
- package/dist/services/VariantRunService.d.ts +0 -6
- package/dist/services/VariantRunService.d.ts.map +1 -1
- package/dist/services/VariantRunService.js +1 -28
- package/dist/services/VariantRunService.js.map +1 -1
- package/dist/services/VariantsRuntime.d.ts.map +1 -1
- package/dist/services/VariantsRuntime.js +0 -1
- package/dist/services/VariantsRuntime.js.map +1 -1
- package/dist/services/accessTokenRefresh.d.ts +0 -3
- package/dist/services/accessTokenRefresh.d.ts.map +1 -1
- package/dist/services/accessTokenRefresh.js +1 -33
- package/dist/services/accessTokenRefresh.js.map +1 -1
- package/dist/services/guidanceDelivery.d.ts +0 -5
- package/dist/services/guidanceDelivery.d.ts.map +1 -1
- package/dist/services/guidanceDelivery.js +1 -20
- package/dist/services/guidanceDelivery.js.map +1 -1
- package/dist/services/guidanceReferences.d.ts.map +1 -1
- package/dist/services/guidanceReferences.js +2 -76
- package/dist/services/guidanceReferences.js.map +1 -1
- package/dist/services/profiles/DesignProfiles.d.ts +61 -46
- package/dist/services/profiles/DesignProfiles.d.ts.map +1 -1
- package/dist/services/profiles/DesignProfiles.js +71 -17
- package/dist/services/profiles/DesignProfiles.js.map +1 -1
- package/dist/services/profiles/ProfileImports.d.ts +1 -1
- package/dist/services/profiles/ProfilePlanning.d.ts +9 -9
- package/dist/services/profiles/ReferenceReader.d.ts +5 -5
- package/dist/services/profiles/profileContext.d.ts +2 -2
- package/dist/services/retainedTextFiles.d.ts +8 -0
- package/dist/services/retainedTextFiles.d.ts.map +1 -0
- package/dist/services/retainedTextFiles.js +95 -0
- package/dist/services/retainedTextFiles.js.map +1 -0
- package/dist/services/staticProjectTarget.d.ts +0 -1
- package/dist/services/staticProjectTarget.d.ts.map +1 -1
- package/dist/services/staticProjectTarget.js +1 -5
- package/dist/services/staticProjectTarget.js.map +1 -1
- package/dist/services/templates/designCatalog.d.ts +0 -4
- package/dist/services/templates/designCatalog.d.ts.map +1 -1
- package/dist/services/templates/designCatalog.js +1 -27
- package/dist/services/templates/designCatalog.js.map +1 -1
- package/dist/storage/profiles/ProfilePlans.d.ts +33 -33
- package/dist/storage/profiles/ProfileRecords.d.ts +60 -11
- package/dist/storage/profiles/ProfileRecords.d.ts.map +1 -1
- package/dist/storage/profiles/ProfileRecords.js +74 -17
- package/dist/storage/profiles/ProfileRecords.js.map +1 -1
- package/dist/storage/profiles/guidanceVerifier.d.ts +3 -0
- package/dist/storage/profiles/guidanceVerifier.d.ts.map +1 -0
- package/dist/storage/profiles/guidanceVerifier.js +30 -0
- package/dist/storage/profiles/guidanceVerifier.js.map +1 -0
- package/dist/storage/profiles/migrations.d.ts +2 -2
- package/dist/storage/profiles/migrations.d.ts.map +1 -1
- package/dist/storage/profiles/migrations.js +3 -0
- package/dist/storage/profiles/migrations.js.map +1 -1
- package/dist/storage/profiles/planSchema.d.ts +9 -9
- package/dist/storage/profiles/schema.d.ts +35 -8
- package/dist/storage/profiles/schema.d.ts.map +1 -1
- package/dist/storage/profiles/schema.js +1 -0
- package/dist/storage/profiles/schema.js.map +1 -1
- package/dist/types/change-types.d.ts +0 -25
- package/dist/types/change-types.d.ts.map +1 -1
- package/dist/types/cosmos-profile.d.ts +18 -18
- package/dist/types/cosmos.d.ts +30 -30
- package/dist/types/design-profile.d.ts +33 -33
- package/dist/types/guidance-references.d.ts +22 -6
- package/dist/types/guidance-references.d.ts.map +1 -1
- package/dist/types/guidance-references.js +44 -30
- package/dist/types/guidance-references.js.map +1 -1
- package/dist/types/guidance-verifier.d.ts +265 -0
- package/dist/types/guidance-verifier.d.ts.map +1 -0
- package/dist/types/guidance-verifier.js +71 -0
- package/dist/types/guidance-verifier.js.map +1 -0
- package/dist/types/guidance.d.ts +508 -93
- package/dist/types/guidance.d.ts.map +1 -1
- package/dist/types/guidance.js +13 -2
- package/dist/types/guidance.js.map +1 -1
- package/dist/types/reference-connectors.d.ts +30 -30
- package/dist/types/reference-onboarding.d.ts +111 -111
- package/dist/types/reference-pages.d.ts +10 -10
- package/dist/types/variant-reference.d.ts +8 -8
- package/dist/types/x-bookmarks.d.ts +10 -10
- package/dist/utils/skills/cli-guidance.d.ts +1 -1
- package/dist/utils/skills/cli-guidance.d.ts.map +1 -1
- package/dist/utils/skills/cli-guidance.js +19 -6
- package/dist/utils/skills/cli-guidance.js.map +1 -1
- package/dist/utils/skills/codex-skill.d.ts +1 -1
- package/dist/utils/skills/codex-skill.d.ts.map +1 -1
- package/dist/utils/skills/codex-skill.js +1 -1
- package/package.json +2 -2
- package/src/ui/dist/assets/{LibraryEntry-CjxmVfhv.js → LibraryEntry-BUwOgHmJ.js} +8 -8
- package/src/ui/dist/assets/main-CXP-A-qy.css +1 -0
- package/src/ui/dist/assets/main-DQKavyjz.js +435 -0
- package/src/ui/dist/index.html +2 -2
- package/dist/agent-variants/directionAuthoring.d.ts +0 -27
- package/dist/agent-variants/directionAuthoring.d.ts.map +0 -1
- package/dist/agent-variants/directionAuthoring.js +0 -380
- package/dist/agent-variants/directionAuthoring.js.map +0 -1
- package/dist/prompts/gitPrompts.d.ts +0 -4
- package/dist/prompts/gitPrompts.d.ts.map +0 -1
- package/dist/prompts/gitPrompts.js +0 -61
- package/dist/prompts/gitPrompts.js.map +0 -1
- package/dist/services/ComponentSearchService.d.ts +0 -13
- package/dist/services/ComponentSearchService.d.ts.map +0 -1
- package/dist/services/ComponentSearchService.js +0 -167
- package/dist/services/ComponentSearchService.js.map +0 -1
- package/dist/services/GatewayClient.d.ts +0 -44
- package/dist/services/GatewayClient.d.ts.map +0 -1
- package/dist/services/GatewayClient.js +0 -204
- package/dist/services/GatewayClient.js.map +0 -1
- package/dist/types/style-manipulation-types.d.ts +0 -63
- package/dist/types/style-manipulation-types.d.ts.map +0 -1
- package/dist/types/style-manipulation-types.js +0 -68
- package/dist/types/style-manipulation-types.js.map +0 -1
- package/dist/types/token-types.d.ts +0 -24
- package/dist/types/token-types.d.ts.map +0 -1
- package/dist/types/token-types.js +0 -3
- package/dist/types/token-types.js.map +0 -1
- package/src/ui/dist/assets/main-CdSzrhWD.js +0 -435
- package/src/ui/dist/assets/main-DVb3ws41.css +0 -1
|
@@ -10,18 +10,18 @@ export declare class ProfilePlans {
|
|
|
10
10
|
id: string;
|
|
11
11
|
total: number;
|
|
12
12
|
collections: {
|
|
13
|
-
id: string;
|
|
14
|
-
description: string | null;
|
|
15
13
|
url: string | null;
|
|
16
14
|
title: string;
|
|
15
|
+
description: string | null;
|
|
16
|
+
id: string;
|
|
17
17
|
children: string[];
|
|
18
18
|
total: number | null;
|
|
19
19
|
parentId: string | null;
|
|
20
20
|
}[];
|
|
21
21
|
profile: {
|
|
22
|
-
id: string;
|
|
23
22
|
url: string;
|
|
24
23
|
title: string;
|
|
24
|
+
id: string;
|
|
25
25
|
username: string;
|
|
26
26
|
};
|
|
27
27
|
createdAt: string;
|
|
@@ -30,18 +30,18 @@ export declare class ProfilePlans {
|
|
|
30
30
|
id: string;
|
|
31
31
|
total: number;
|
|
32
32
|
collections: {
|
|
33
|
-
id: string;
|
|
34
|
-
description: string | null;
|
|
35
33
|
url: string | null;
|
|
36
34
|
title: string;
|
|
35
|
+
description: string | null;
|
|
36
|
+
id: string;
|
|
37
37
|
children: string[];
|
|
38
38
|
total: number | null;
|
|
39
39
|
parentId: string | null;
|
|
40
40
|
}[];
|
|
41
41
|
profile: {
|
|
42
|
-
id: string;
|
|
43
42
|
url: string;
|
|
44
43
|
title: string;
|
|
44
|
+
id: string;
|
|
45
45
|
username: string;
|
|
46
46
|
};
|
|
47
47
|
createdAt: string;
|
|
@@ -50,46 +50,46 @@ export declare class ProfilePlans {
|
|
|
50
50
|
id: string;
|
|
51
51
|
total: number;
|
|
52
52
|
collections: {
|
|
53
|
-
id: string;
|
|
54
|
-
description: string | null;
|
|
55
53
|
url: string | null;
|
|
56
54
|
title: string;
|
|
55
|
+
description: string | null;
|
|
56
|
+
id: string;
|
|
57
57
|
children: string[];
|
|
58
58
|
total: number | null;
|
|
59
59
|
parentId: string | null;
|
|
60
60
|
}[];
|
|
61
61
|
profile: {
|
|
62
|
-
id: string;
|
|
63
62
|
url: string;
|
|
64
63
|
title: string;
|
|
64
|
+
id: string;
|
|
65
65
|
username: string;
|
|
66
66
|
};
|
|
67
67
|
createdAt: string;
|
|
68
68
|
}[];
|
|
69
69
|
savePlan(input: z.input<typeof ReferencePlanInputSchema>): {
|
|
70
|
-
id: string;
|
|
71
70
|
expiresAt: string;
|
|
72
71
|
revision: string;
|
|
73
72
|
runtime: "claude" | "codex" | "cursor";
|
|
73
|
+
id: string;
|
|
74
74
|
profile: {
|
|
75
|
-
id: string;
|
|
76
75
|
url: string;
|
|
77
76
|
title: string;
|
|
77
|
+
id: string;
|
|
78
78
|
username: string;
|
|
79
79
|
};
|
|
80
80
|
createdAt: string;
|
|
81
81
|
discoveryId: string;
|
|
82
82
|
sources: {
|
|
83
83
|
references: {
|
|
84
|
+
provider: "arena" | "pinterest" | "x" | "cosmos";
|
|
84
85
|
title: string;
|
|
85
86
|
text: string;
|
|
86
|
-
provider: "arena" | "pinterest" | "x" | "cosmos";
|
|
87
87
|
remoteId: string;
|
|
88
88
|
media: {
|
|
89
89
|
hash: string;
|
|
90
90
|
mimeType: "image/png" | "image/jpeg" | "image/webp" | "image/gif";
|
|
91
91
|
bytes: number;
|
|
92
|
-
representation: "
|
|
92
|
+
representation: "variant" | "image" | "video-cover" | "page";
|
|
93
93
|
page?: number | undefined;
|
|
94
94
|
}[];
|
|
95
95
|
url?: string | undefined;
|
|
@@ -105,10 +105,10 @@ export declare class ProfilePlans {
|
|
|
105
105
|
unsupportedReason?: string | undefined;
|
|
106
106
|
}[];
|
|
107
107
|
collection: {
|
|
108
|
-
id: string;
|
|
109
|
-
description: string | null;
|
|
110
108
|
url: string | null;
|
|
111
109
|
title: string;
|
|
110
|
+
description: string | null;
|
|
111
|
+
id: string;
|
|
112
112
|
children: string[];
|
|
113
113
|
total: number | null;
|
|
114
114
|
parentId: string | null;
|
|
@@ -120,29 +120,29 @@ export declare class ProfilePlans {
|
|
|
120
120
|
jobIds: string[];
|
|
121
121
|
};
|
|
122
122
|
plan(id: string): {
|
|
123
|
-
id: string;
|
|
124
123
|
expiresAt: string;
|
|
125
124
|
revision: string;
|
|
126
125
|
runtime: "claude" | "codex" | "cursor";
|
|
126
|
+
id: string;
|
|
127
127
|
profile: {
|
|
128
|
-
id: string;
|
|
129
128
|
url: string;
|
|
130
129
|
title: string;
|
|
130
|
+
id: string;
|
|
131
131
|
username: string;
|
|
132
132
|
};
|
|
133
133
|
createdAt: string;
|
|
134
134
|
discoveryId: string;
|
|
135
135
|
sources: {
|
|
136
136
|
references: {
|
|
137
|
+
provider: "arena" | "pinterest" | "x" | "cosmos";
|
|
137
138
|
title: string;
|
|
138
139
|
text: string;
|
|
139
|
-
provider: "arena" | "pinterest" | "x" | "cosmos";
|
|
140
140
|
remoteId: string;
|
|
141
141
|
media: {
|
|
142
142
|
hash: string;
|
|
143
143
|
mimeType: "image/png" | "image/jpeg" | "image/webp" | "image/gif";
|
|
144
144
|
bytes: number;
|
|
145
|
-
representation: "
|
|
145
|
+
representation: "variant" | "image" | "video-cover" | "page";
|
|
146
146
|
page?: number | undefined;
|
|
147
147
|
}[];
|
|
148
148
|
url?: string | undefined;
|
|
@@ -158,10 +158,10 @@ export declare class ProfilePlans {
|
|
|
158
158
|
unsupportedReason?: string | undefined;
|
|
159
159
|
}[];
|
|
160
160
|
collection: {
|
|
161
|
-
id: string;
|
|
162
|
-
description: string | null;
|
|
163
161
|
url: string | null;
|
|
164
162
|
title: string;
|
|
163
|
+
description: string | null;
|
|
164
|
+
id: string;
|
|
165
165
|
children: string[];
|
|
166
166
|
total: number | null;
|
|
167
167
|
parentId: string | null;
|
|
@@ -173,29 +173,29 @@ export declare class ProfilePlans {
|
|
|
173
173
|
jobIds: string[];
|
|
174
174
|
};
|
|
175
175
|
plans(): {
|
|
176
|
-
id: string;
|
|
177
176
|
expiresAt: string;
|
|
178
177
|
revision: string;
|
|
179
178
|
runtime: "claude" | "codex" | "cursor";
|
|
179
|
+
id: string;
|
|
180
180
|
profile: {
|
|
181
|
-
id: string;
|
|
182
181
|
url: string;
|
|
183
182
|
title: string;
|
|
183
|
+
id: string;
|
|
184
184
|
username: string;
|
|
185
185
|
};
|
|
186
186
|
createdAt: string;
|
|
187
187
|
discoveryId: string;
|
|
188
188
|
sources: {
|
|
189
189
|
references: {
|
|
190
|
+
provider: "arena" | "pinterest" | "x" | "cosmos";
|
|
190
191
|
title: string;
|
|
191
192
|
text: string;
|
|
192
|
-
provider: "arena" | "pinterest" | "x" | "cosmos";
|
|
193
193
|
remoteId: string;
|
|
194
194
|
media: {
|
|
195
195
|
hash: string;
|
|
196
196
|
mimeType: "image/png" | "image/jpeg" | "image/webp" | "image/gif";
|
|
197
197
|
bytes: number;
|
|
198
|
-
representation: "
|
|
198
|
+
representation: "variant" | "image" | "video-cover" | "page";
|
|
199
199
|
page?: number | undefined;
|
|
200
200
|
}[];
|
|
201
201
|
url?: string | undefined;
|
|
@@ -211,10 +211,10 @@ export declare class ProfilePlans {
|
|
|
211
211
|
unsupportedReason?: string | undefined;
|
|
212
212
|
}[];
|
|
213
213
|
collection: {
|
|
214
|
-
id: string;
|
|
215
|
-
description: string | null;
|
|
216
214
|
url: string | null;
|
|
217
215
|
title: string;
|
|
216
|
+
description: string | null;
|
|
217
|
+
id: string;
|
|
218
218
|
children: string[];
|
|
219
219
|
total: number | null;
|
|
220
220
|
parentId: string | null;
|
|
@@ -235,29 +235,29 @@ export declare class ProfilePlans {
|
|
|
235
235
|
collectionId: string;
|
|
236
236
|
}>;
|
|
237
237
|
}): {
|
|
238
|
-
id: string;
|
|
239
238
|
expiresAt: string;
|
|
240
239
|
revision: string;
|
|
241
240
|
runtime: "claude" | "codex" | "cursor";
|
|
241
|
+
id: string;
|
|
242
242
|
profile: {
|
|
243
|
-
id: string;
|
|
244
243
|
url: string;
|
|
245
244
|
title: string;
|
|
245
|
+
id: string;
|
|
246
246
|
username: string;
|
|
247
247
|
};
|
|
248
248
|
createdAt: string;
|
|
249
249
|
discoveryId: string;
|
|
250
250
|
sources: {
|
|
251
251
|
references: {
|
|
252
|
+
provider: "arena" | "pinterest" | "x" | "cosmos";
|
|
252
253
|
title: string;
|
|
253
254
|
text: string;
|
|
254
|
-
provider: "arena" | "pinterest" | "x" | "cosmos";
|
|
255
255
|
remoteId: string;
|
|
256
256
|
media: {
|
|
257
257
|
hash: string;
|
|
258
258
|
mimeType: "image/png" | "image/jpeg" | "image/webp" | "image/gif";
|
|
259
259
|
bytes: number;
|
|
260
|
-
representation: "
|
|
260
|
+
representation: "variant" | "image" | "video-cover" | "page";
|
|
261
261
|
page?: number | undefined;
|
|
262
262
|
}[];
|
|
263
263
|
url?: string | undefined;
|
|
@@ -273,10 +273,10 @@ export declare class ProfilePlans {
|
|
|
273
273
|
unsupportedReason?: string | undefined;
|
|
274
274
|
}[];
|
|
275
275
|
collection: {
|
|
276
|
-
id: string;
|
|
277
|
-
description: string | null;
|
|
278
276
|
url: string | null;
|
|
279
277
|
title: string;
|
|
278
|
+
description: string | null;
|
|
279
|
+
id: string;
|
|
280
280
|
children: string[];
|
|
281
281
|
total: number | null;
|
|
282
282
|
parentId: string | null;
|
|
@@ -35,6 +35,55 @@ export declare class ProfileRecords {
|
|
|
35
35
|
setEnabled(isEnabled: boolean): void;
|
|
36
36
|
listGuidance(): SavedGuidance[];
|
|
37
37
|
getGuidance(id: string): SavedGuidance;
|
|
38
|
+
private guidanceRecord;
|
|
39
|
+
getGuidanceVerifier(id: string): {
|
|
40
|
+
verifier?: {
|
|
41
|
+
markdown: string;
|
|
42
|
+
sourceDigest: string;
|
|
43
|
+
package?: {
|
|
44
|
+
files: {
|
|
45
|
+
name: string;
|
|
46
|
+
content: string;
|
|
47
|
+
}[];
|
|
48
|
+
runtime: "node";
|
|
49
|
+
entrypoint: string;
|
|
50
|
+
} | undefined;
|
|
51
|
+
} | undefined;
|
|
52
|
+
source: {
|
|
53
|
+
title: string;
|
|
54
|
+
id: string;
|
|
55
|
+
markdown: string;
|
|
56
|
+
attachments?: {
|
|
57
|
+
path: string;
|
|
58
|
+
hash: string;
|
|
59
|
+
mimeType: "image/png" | "image/jpeg" | "image/webp" | "image/gif";
|
|
60
|
+
bytes: number;
|
|
61
|
+
representation: "variant" | "image" | "video-cover" | "page";
|
|
62
|
+
source: string;
|
|
63
|
+
alt: string;
|
|
64
|
+
title?: string | undefined;
|
|
65
|
+
page?: number | undefined;
|
|
66
|
+
}[] | undefined;
|
|
67
|
+
references?: ({
|
|
68
|
+
path: string;
|
|
69
|
+
kind: "directory";
|
|
70
|
+
intent: string;
|
|
71
|
+
} | {
|
|
72
|
+
url: string;
|
|
73
|
+
kind: "url" | "repository";
|
|
74
|
+
intent: string;
|
|
75
|
+
files?: {
|
|
76
|
+
name: string;
|
|
77
|
+
content: string;
|
|
78
|
+
path?: string | undefined;
|
|
79
|
+
sha256?: string | undefined;
|
|
80
|
+
}[] | undefined;
|
|
81
|
+
digest?: string | undefined;
|
|
82
|
+
revision?: string | undefined;
|
|
83
|
+
})[] | undefined;
|
|
84
|
+
};
|
|
85
|
+
sourceDigest: string;
|
|
86
|
+
};
|
|
38
87
|
addGuidance(input: GuidanceInput): SavedGuidance;
|
|
39
88
|
updateGuidance({ id, ...input }: GuidanceUpdate & {
|
|
40
89
|
id: string;
|
|
@@ -43,7 +92,7 @@ export declare class ProfileRecords {
|
|
|
43
92
|
resolveGuidance(input: GuidanceSelection): GuidanceDocument[];
|
|
44
93
|
sources(): {
|
|
45
94
|
id: string;
|
|
46
|
-
provider: "
|
|
95
|
+
provider: "variant" | "text" | "arena" | "pinterest" | "image" | "x" | "cosmos" | "pdf";
|
|
47
96
|
remoteId: string;
|
|
48
97
|
resolvedRemoteId: string | null;
|
|
49
98
|
title: string;
|
|
@@ -53,7 +102,7 @@ export declare class ProfileRecords {
|
|
|
53
102
|
}[];
|
|
54
103
|
addSource(input: ProfileSourceInput): {
|
|
55
104
|
id: string;
|
|
56
|
-
provider: "
|
|
105
|
+
provider: "variant" | "text" | "arena" | "pinterest" | "image" | "x" | "cosmos" | "pdf";
|
|
57
106
|
remoteId: string;
|
|
58
107
|
resolvedRemoteId: string | null;
|
|
59
108
|
title: string;
|
|
@@ -63,7 +112,7 @@ export declare class ProfileRecords {
|
|
|
63
112
|
};
|
|
64
113
|
source(id: string): {
|
|
65
114
|
id: string;
|
|
66
|
-
provider: "
|
|
115
|
+
provider: "variant" | "text" | "arena" | "pinterest" | "image" | "x" | "cosmos" | "pdf";
|
|
67
116
|
remoteId: string;
|
|
68
117
|
resolvedRemoteId: string | null;
|
|
69
118
|
title: string;
|
|
@@ -120,7 +169,7 @@ export declare class ProfileRecords {
|
|
|
120
169
|
}): {
|
|
121
170
|
source: {
|
|
122
171
|
id: string;
|
|
123
|
-
provider: "
|
|
172
|
+
provider: "variant" | "text" | "arena" | "pinterest" | "image" | "x" | "cosmos" | "pdf";
|
|
124
173
|
remoteId: string;
|
|
125
174
|
resolvedRemoteId: string | null;
|
|
126
175
|
title: string;
|
|
@@ -176,7 +225,7 @@ export declare class ProfileRecords {
|
|
|
176
225
|
id: string;
|
|
177
226
|
retryAfterMs?: number;
|
|
178
227
|
}): {
|
|
179
|
-
provider: "
|
|
228
|
+
provider: "variant" | "text" | "arena" | "pinterest" | "image" | "x" | "cosmos" | "pdf";
|
|
180
229
|
retryAt: string;
|
|
181
230
|
attempts: number;
|
|
182
231
|
};
|
|
@@ -208,29 +257,29 @@ export declare class ProfileRecords {
|
|
|
208
257
|
revision: string;
|
|
209
258
|
isApproved: boolean;
|
|
210
259
|
}): {
|
|
211
|
-
id: string;
|
|
212
260
|
expiresAt: string;
|
|
213
261
|
revision: string;
|
|
214
262
|
runtime: "claude" | "codex" | "cursor";
|
|
263
|
+
id: string;
|
|
215
264
|
profile: {
|
|
216
|
-
id: string;
|
|
217
265
|
url: string;
|
|
218
266
|
title: string;
|
|
267
|
+
id: string;
|
|
219
268
|
username: string;
|
|
220
269
|
};
|
|
221
270
|
createdAt: string;
|
|
222
271
|
discoveryId: string;
|
|
223
272
|
sources: {
|
|
224
273
|
references: {
|
|
274
|
+
provider: "arena" | "pinterest" | "x" | "cosmos";
|
|
225
275
|
title: string;
|
|
226
276
|
text: string;
|
|
227
|
-
provider: "arena" | "pinterest" | "x" | "cosmos";
|
|
228
277
|
remoteId: string;
|
|
229
278
|
media: {
|
|
230
279
|
hash: string;
|
|
231
280
|
mimeType: "image/png" | "image/jpeg" | "image/webp" | "image/gif";
|
|
232
281
|
bytes: number;
|
|
233
|
-
representation: "
|
|
282
|
+
representation: "variant" | "image" | "video-cover" | "page";
|
|
234
283
|
page?: number | undefined;
|
|
235
284
|
}[];
|
|
236
285
|
url?: string | undefined;
|
|
@@ -246,10 +295,10 @@ export declare class ProfileRecords {
|
|
|
246
295
|
unsupportedReason?: string | undefined;
|
|
247
296
|
}[];
|
|
248
297
|
collection: {
|
|
249
|
-
id: string;
|
|
250
|
-
description: string | null;
|
|
251
298
|
url: string | null;
|
|
252
299
|
title: string;
|
|
300
|
+
description: string | null;
|
|
301
|
+
id: string;
|
|
253
302
|
children: string[];
|
|
254
303
|
total: number | null;
|
|
255
304
|
parentId: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileRecords.d.ts","sourceRoot":"","sources":["../../../src/storage/profiles/ProfileRecords.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProfileRecords.d.ts","sourceRoot":"","sources":["../../../src/storage/profiles/ProfileRecords.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAOL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAuB9B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAqBzE,OAAO,KAAK,EACV,gBAAgB,EAChB,yBAAyB,EACzB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,kBAAkB,EACnB,MAAM,4BAA4B,CAAC;AAGpC,KAAK,UAAU,GAAG;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,qBAAqB,EAAE,CAAC;IACpC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,yBAAyB,CAAC;CACxC,CAAC;AA8CF,qBAAa,cAAc;IAIvB,QAAQ,CAAC,SAAS,EAAE,MAAM;IAC1B,OAAO,CAAC,QAAQ,CAAC,EAAE;IAJrB,OAAO,CAAC,QAAQ,CA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B"}
|
|
@@ -4,6 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ProfileRecords = void 0;
|
|
7
|
+
const guidanceVerifier_1 = require("./guidanceVerifier");
|
|
8
|
+
const guidance_verifier_1 = require("../../types/guidance-verifier");
|
|
7
9
|
const reference_connectors_1 = require("../../types/reference-connectors");
|
|
8
10
|
const ProfilePlans_1 = require("./ProfilePlans");
|
|
9
11
|
const guidance_1 = require("../../types/guidance");
|
|
@@ -23,6 +25,32 @@ const MIN_RETRY_MS = 1000;
|
|
|
23
25
|
const MAX_BACKOFF_EXPONENT = 4;
|
|
24
26
|
const MAX_DATE_MS = 8_640_000_000_000_000;
|
|
25
27
|
const identity = (...parts) => (0, crypto_1.createHash)('sha256').update(JSON.stringify(parts)).digest('hex');
|
|
28
|
+
const guidanceDocument = (document) => guidance_1.GuidanceDocumentSchema.parse({
|
|
29
|
+
id: document.id,
|
|
30
|
+
title: document.title,
|
|
31
|
+
markdown: document.markdown,
|
|
32
|
+
...(document.attachments?.length
|
|
33
|
+
? { attachments: document.attachments }
|
|
34
|
+
: {}),
|
|
35
|
+
...(document.references ? { references: document.references } : {}),
|
|
36
|
+
});
|
|
37
|
+
const savedGuidance = (record) => {
|
|
38
|
+
const document = guidanceDocument(record);
|
|
39
|
+
const verifier = record.verifier
|
|
40
|
+
? guidance_verifier_1.GuidanceVerifierSchema.parse(record.verifier)
|
|
41
|
+
: undefined;
|
|
42
|
+
return guidance_1.SavedGuidanceSchema.parse({
|
|
43
|
+
...document,
|
|
44
|
+
isEnabled: record.isEnabled,
|
|
45
|
+
...(verifier
|
|
46
|
+
? {
|
|
47
|
+
verifier: {
|
|
48
|
+
isStale: verifier.sourceDigest !== (0, guidanceVerifier_1.guidanceSourceDigest)(document),
|
|
49
|
+
},
|
|
50
|
+
}
|
|
51
|
+
: {}),
|
|
52
|
+
});
|
|
53
|
+
};
|
|
26
54
|
class ProfileRecords {
|
|
27
55
|
directory;
|
|
28
56
|
db;
|
|
@@ -68,13 +96,12 @@ class ProfileRecords {
|
|
|
68
96
|
.from(schema_1.guidance)
|
|
69
97
|
.orderBy(schema_1.guidance.id)
|
|
70
98
|
.all()
|
|
71
|
-
.map(
|
|
72
|
-
...document,
|
|
73
|
-
...(attachments ? { attachments } : {}),
|
|
74
|
-
...(references ? { references } : {}),
|
|
75
|
-
}));
|
|
99
|
+
.map(savedGuidance);
|
|
76
100
|
}
|
|
77
101
|
getGuidance(id) {
|
|
102
|
+
return savedGuidance(this.guidanceRecord(id));
|
|
103
|
+
}
|
|
104
|
+
guidanceRecord(id) {
|
|
78
105
|
const document = this.db
|
|
79
106
|
.select()
|
|
80
107
|
.from(schema_1.guidance)
|
|
@@ -82,11 +109,16 @@ class ProfileRecords {
|
|
|
82
109
|
.get();
|
|
83
110
|
if (!document)
|
|
84
111
|
throw new guidance_1.GuidanceError('guidance_not_found', 'Unknown saved guidance');
|
|
85
|
-
return
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
112
|
+
return document;
|
|
113
|
+
}
|
|
114
|
+
getGuidanceVerifier(id) {
|
|
115
|
+
const stored = this.guidanceRecord(id);
|
|
116
|
+
const source = guidanceDocument(stored);
|
|
117
|
+
const sourceDigest = (0, guidanceVerifier_1.guidanceSourceDigest)(source);
|
|
118
|
+
const verifier = stored.verifier
|
|
119
|
+
? guidance_verifier_1.GuidanceVerifierSchema.parse(stored.verifier)
|
|
120
|
+
: undefined;
|
|
121
|
+
return { source, sourceDigest, ...(verifier ? { verifier } : {}) };
|
|
90
122
|
}
|
|
91
123
|
addGuidance(input) {
|
|
92
124
|
const document = { ...guidance_1.GuidanceInputSchema.parse(input), id: (0, crypto_1.randomUUID)() };
|
|
@@ -98,9 +130,26 @@ class ProfileRecords {
|
|
|
98
130
|
updateGuidance({ id, ...input }) {
|
|
99
131
|
const update = guidance_1.GuidanceUpdateSchema.parse(input);
|
|
100
132
|
return (0, database_1.transaction)(this.db, () => {
|
|
101
|
-
const
|
|
133
|
+
const source = this.guidanceRecord(id);
|
|
134
|
+
if (update.verifier &&
|
|
135
|
+
update.verifier.sourceDigest !==
|
|
136
|
+
(0, guidanceVerifier_1.guidanceSourceDigest)(guidanceDocument(source)))
|
|
137
|
+
throw new guidance_1.GuidanceError('guidance_source_changed', 'Saved context changed while the verifier was authored. Retrieve it again and revise the verifier before saving.');
|
|
138
|
+
if (update.verifier &&
|
|
139
|
+
update.verifier.package === undefined &&
|
|
140
|
+
source.verifier) {
|
|
141
|
+
const savedVerifier = guidance_verifier_1.GuidanceVerifierSchema.parse(source.verifier);
|
|
142
|
+
if (savedVerifier.package) {
|
|
143
|
+
if (savedVerifier.sourceDigest !== update.verifier.sourceDigest)
|
|
144
|
+
throw new guidance_1.GuidanceError('guidance_source_changed', 'The saved executable package belongs to different source content. Supply a revised --verifier-package or remove the saved verifier before saving a Markdown-only recipe.');
|
|
145
|
+
update.verifier = {
|
|
146
|
+
...update.verifier,
|
|
147
|
+
package: savedVerifier.package,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}
|
|
102
151
|
this.db.update(schema_1.guidance).set(update).where((0, drizzle_orm_1.eq)(schema_1.guidance.id, id)).run();
|
|
103
|
-
return
|
|
152
|
+
return this.getGuidance(id);
|
|
104
153
|
});
|
|
105
154
|
}
|
|
106
155
|
removeGuidance(id) {
|
|
@@ -113,15 +162,23 @@ class ProfileRecords {
|
|
|
113
162
|
const selection = guidance_1.GuidanceSelectionSchema.parse(input);
|
|
114
163
|
if (selection.mode === 'off')
|
|
115
164
|
return [];
|
|
116
|
-
const documents = this.
|
|
165
|
+
const documents = this.db
|
|
166
|
+
.select({
|
|
167
|
+
id: schema_1.guidance.id,
|
|
168
|
+
title: schema_1.guidance.title,
|
|
169
|
+
markdown: schema_1.guidance.markdown,
|
|
170
|
+
attachments: schema_1.guidance.attachments,
|
|
171
|
+
references: schema_1.guidance.references,
|
|
172
|
+
isEnabled: schema_1.guidance.isEnabled,
|
|
173
|
+
})
|
|
174
|
+
.from(schema_1.guidance)
|
|
175
|
+
.orderBy(schema_1.guidance.id)
|
|
176
|
+
.all();
|
|
117
177
|
if (selection.excludedIds.some((id) => !documents.some((document) => document.id === id)))
|
|
118
178
|
throw new guidance_1.GuidanceError('guidance_not_found', 'Unknown saved guidance exclusion');
|
|
119
179
|
const selected = documents
|
|
120
180
|
.filter((document) => document.isEnabled && !selection.excludedIds.includes(document.id))
|
|
121
|
-
.map(
|
|
122
|
-
...document,
|
|
123
|
-
...(attachments?.length ? { attachments } : {}),
|
|
124
|
-
}));
|
|
181
|
+
.map(guidanceDocument);
|
|
125
182
|
return selected;
|
|
126
183
|
}
|
|
127
184
|
sources() {
|