rivet-design 0.28.1 → 0.28.3

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.
Files changed (89) hide show
  1. package/dist/cli/commands/libraryOpen.js +1 -0
  2. package/dist/cli/commands/mcpServe.js +5 -1
  3. package/dist/cli/commands/open.js +17 -6
  4. package/dist/cli/commands/profile.js +8 -1
  5. package/dist/cli/commands/profileDisconnect.d.ts +3 -0
  6. package/dist/cli/commands/profileDisconnect.js +34 -0
  7. package/dist/cli/commands/serve.js +2 -0
  8. package/dist/cli/commands/shared.js +4 -1
  9. package/dist/cli/envelope.d.ts +1 -0
  10. package/dist/cli/router.js +8 -2
  11. package/dist/jest.globalSetup.d.ts +3 -0
  12. package/dist/jest.globalSetup.js +19 -0
  13. package/dist/library/browserLaunch.d.ts +2 -1
  14. package/dist/library/browserLaunch.js +3 -2
  15. package/dist/proxy-middleware/proxy-config.d.ts +0 -1
  16. package/dist/proxy-middleware/proxy-config.js +6 -34
  17. package/dist/routes/agentVariants.js +20 -173
  18. package/dist/routes/referenceProfiles.js +3 -3
  19. package/dist/routes/static.js +8 -2
  20. package/dist/server.d.ts +1 -1
  21. package/dist/server.js +15 -26
  22. package/dist/services/AuthService.js +7 -61
  23. package/dist/services/IntegrationsClient.d.ts +2 -1
  24. package/dist/services/IntegrationsClient.js +46 -20
  25. package/dist/services/TelemetryService.d.ts +16 -2
  26. package/dist/services/TelemetryService.js +18 -0
  27. package/dist/services/accessTokenRefresh.js +2 -2
  28. package/dist/services/profiles/DesignProfiles.d.ts +16 -0
  29. package/dist/services/profiles/DesignProfiles.js +78 -17
  30. package/dist/services/profiles/ProfileAnalysis.d.ts +3 -0
  31. package/dist/services/profiles/ProfileAnalysis.js +66 -1
  32. package/dist/services/profiles/ProfileImports.d.ts +2 -0
  33. package/dist/services/profiles/ProfileImports.js +2 -0
  34. package/dist/services/templates/viteReactTs.js +1 -1
  35. package/dist/storage/profiles/ProfileRecords.d.ts +17 -0
  36. package/dist/storage/profiles/ProfileRecords.js +45 -7
  37. package/dist/storage/profiles/migrations.d.ts +2 -2
  38. package/dist/storage/profiles/migrations.js +7 -0
  39. package/dist/storage/profiles/schema.d.ts +48 -0
  40. package/dist/storage/profiles/schema.js +3 -0
  41. package/dist/types/api-responses.d.ts +39 -0
  42. package/dist/types/api-responses.js +12 -1
  43. package/dist/types/design-profile.d.ts +12 -0
  44. package/dist/types/design-profile.js +10 -1
  45. package/dist/types/rivet-page-types.d.ts +48 -0
  46. package/dist/types/rivet-page-types.js +6 -0
  47. package/dist/utils/failureReason.js +1 -1
  48. package/dist/utils/hostedLogPrivacy.js +1 -1
  49. package/dist/utils/launchRuntime.d.ts +2 -0
  50. package/dist/utils/launchRuntime.js +12 -0
  51. package/dist/utils/rivetPage.d.ts +8 -0
  52. package/dist/utils/rivetPage.js +24 -0
  53. package/dist/utils/rivetPage.testHelpers.d.ts +6 -0
  54. package/dist/utils/rivetPage.testHelpers.js +18 -0
  55. package/dist/utils/rivetPageDocument.d.ts +7 -0
  56. package/dist/utils/rivetPageDocument.js +41 -0
  57. package/dist/utils/scriptJson.d.ts +2 -0
  58. package/dist/utils/scriptJson.js +9 -0
  59. package/dist/utils/skills/cli-guidance.d.ts +1 -1
  60. package/dist/utils/skills/cli-guidance.js +2 -1
  61. package/dist/utils/uiDistPath.d.ts +2 -0
  62. package/dist/utils/uiDistPath.js +22 -0
  63. package/package.json +8 -5
  64. package/src/ui/dist/assets/LibraryEntry-CSU5OJwC.js +2 -0
  65. package/src/ui/dist/assets/google-g-CpxN0HWb.png +0 -0
  66. package/src/ui/dist/assets/main-B89lcZEY.css +1 -0
  67. package/src/ui/dist/assets/main-DeCxjHC1.js +204 -0
  68. package/src/ui/dist/index.html +3 -3
  69. package/src/ui/dist/pages/empty-project.html +53 -0
  70. package/src/ui/dist/pages/rivet-page.html +53 -0
  71. package/dist/routes/emptyStatePage.d.ts +0 -2
  72. package/dist/routes/emptyStatePage.js +0 -589
  73. package/src/ui/dist/assets/LibraryEntry-DS6Ce0sW.js +0 -112
  74. package/src/ui/dist/assets/logo-animation/clasp.png +0 -0
  75. package/src/ui/dist/assets/logo-animation/eraser.png +0 -0
  76. package/src/ui/dist/assets/logo-animation/playdough.png +0 -0
  77. package/src/ui/dist/assets/logo-animation/sea/bubblephone.png +0 -0
  78. package/src/ui/dist/assets/logo-animation/sea/cart.png +0 -0
  79. package/src/ui/dist/assets/logo-animation/sea/chair.png +0 -0
  80. package/src/ui/dist/assets/logo-animation/sea/desk.png +0 -0
  81. package/src/ui/dist/assets/logo-animation/sea/mug.png +0 -0
  82. package/src/ui/dist/assets/logo-animation/sea/pitcher.png +0 -0
  83. package/src/ui/dist/assets/logo-animation/sea/pot.png +0 -0
  84. package/src/ui/dist/assets/logo-animation/sea/startac.png +0 -0
  85. package/src/ui/dist/assets/logo-animation/sea/terracotta-1.png +0 -0
  86. package/src/ui/dist/assets/logo-animation/sea/terracotta-2.png +0 -0
  87. package/src/ui/dist/assets/logo-animation/sea/vhsplant.png +0 -0
  88. package/src/ui/dist/assets/main-CQSk-6km.css +0 -1
  89. package/src/ui/dist/assets/main-DkKRuatC.js +0 -218
@@ -19,6 +19,11 @@ const GUIDANCE_SCHEMA = `CREATE TABLE guidance (id TEXT PRIMARY KEY, title TEXT
19
19
  const GUIDANCE_ATTACHMENTS_SCHEMA = `ALTER TABLE guidance ADD COLUMN attachments TEXT;`;
20
20
  const GUIDANCE_REFERENCES_SCHEMA = `ALTER TABLE guidance ADD COLUMN "references" TEXT;`;
21
21
  const GUIDANCE_VERIFIER_SCHEMA = `ALTER TABLE guidance ADD COLUMN verifier TEXT;`;
22
+ const IMPORT_OUTCOME_SCHEMA = `
23
+ ALTER TABLE import_jobs ADD COLUMN added_count INTEGER NOT NULL DEFAULT 0;
24
+ ALTER TABLE import_jobs ADD COLUMN removed_count INTEGER NOT NULL DEFAULT 0;
25
+ ALTER TABLE reference_failures ADD COLUMN reason_code TEXT;
26
+ `;
22
27
  exports.PROFILE_SCHEMA = `
23
28
  CREATE TABLE profile (singleton INTEGER PRIMARY KEY CHECK(singleton = 1), id TEXT NOT NULL UNIQUE, is_enabled INTEGER NOT NULL, revision INTEGER NOT NULL);
24
29
  CREATE TABLE sources (id TEXT PRIMARY KEY, provider TEXT NOT NULL, remote_id TEXT NOT NULL,
@@ -49,6 +54,7 @@ ${GUIDANCE_SCHEMA}
49
54
  ${GUIDANCE_ATTACHMENTS_SCHEMA}
50
55
  ${GUIDANCE_REFERENCES_SCHEMA}
51
56
  ${GUIDANCE_VERIFIER_SCHEMA}
57
+ ${IMPORT_OUTCOME_SCHEMA}
52
58
  `;
53
59
  exports.PROFILE_MIGRATIONS = [
54
60
  'ALTER TABLE import_jobs ADD COLUMN is_enumerated INTEGER NOT NULL DEFAULT 0',
@@ -62,6 +68,7 @@ exports.PROFILE_MIGRATIONS = [
62
68
  GUIDANCE_ATTACHMENTS_SCHEMA,
63
69
  GUIDANCE_REFERENCES_SCHEMA,
64
70
  GUIDANCE_VERIFIER_SCHEMA,
71
+ IMPORT_OUTCOME_SCHEMA,
65
72
  ];
66
73
  exports.PROFILE_SCHEMA_VERSION = 1 + exports.PROFILE_MIGRATIONS.length;
67
74
  //# sourceMappingURL=migrations.js.map
@@ -1008,6 +1008,38 @@ export declare const importJobs: import("drizzle-orm/sqlite-core").SQLiteTableWi
1008
1008
  identity: undefined;
1009
1009
  generated: undefined;
1010
1010
  }, {}>;
1011
+ addedCount: import("drizzle-orm/sqlite-core").SQLiteColumn<{
1012
+ name: string;
1013
+ tableName: "import_jobs";
1014
+ dataType: "number int53";
1015
+ data: number;
1016
+ driverParam: number;
1017
+ notNull: true;
1018
+ hasDefault: true;
1019
+ isPrimaryKey: false;
1020
+ isAutoincrement: false;
1021
+ hasRuntimeDefault: false;
1022
+ enumValues: undefined;
1023
+ baseColumn: never;
1024
+ identity: undefined;
1025
+ generated: undefined;
1026
+ }, {}>;
1027
+ removedCount: import("drizzle-orm/sqlite-core").SQLiteColumn<{
1028
+ name: string;
1029
+ tableName: "import_jobs";
1030
+ dataType: "number int53";
1031
+ data: number;
1032
+ driverParam: number;
1033
+ notNull: true;
1034
+ hasDefault: true;
1035
+ isPrimaryKey: false;
1036
+ isAutoincrement: false;
1037
+ hasRuntimeDefault: false;
1038
+ enumValues: undefined;
1039
+ baseColumn: never;
1040
+ identity: undefined;
1041
+ generated: undefined;
1042
+ }, {}>;
1011
1043
  };
1012
1044
  dialect: "sqlite";
1013
1045
  }>;
@@ -1134,6 +1166,22 @@ export declare const referenceFailures: import("drizzle-orm/sqlite-core").SQLite
1134
1166
  identity: undefined;
1135
1167
  generated: undefined;
1136
1168
  }, {}>;
1169
+ reasonCode: import("drizzle-orm/sqlite-core").SQLiteColumn<{
1170
+ name: string;
1171
+ tableName: "reference_failures";
1172
+ dataType: "string";
1173
+ data: "timeout" | "unknown" | "aborted" | "multiple_lockfiles" | "unsupported_package_manager" | "invalid_package_manager_field" | "invalid_manifest" | "invalid_workspace" | "path_outside_workspace" | "dangling_symlink" | "version_unreadable" | "version_mismatch" | "no_install_command" | "install_failed" | "lockfile_outdated" | "engine_incompatible" | "install_script_failed" | "installer_unstoppable" | "inputs_changed" | "ENOENT" | "EACCES" | "EPERM" | "EEXIST" | "ENOTDIR" | "EISDIR" | "ELOOP" | "ENOSPC" | "EMFILE" | "EADDRINUSE" | "ECONNREFUSED" | "ECONNRESET" | "ETIMEDOUT" | "EBUSY" | "ENOTSUP" | "EINVAL" | "ENOTEMPTY" | "EROFS" | "EAI_AGAIN";
1174
+ driverParam: string;
1175
+ notNull: false;
1176
+ hasDefault: false;
1177
+ isPrimaryKey: false;
1178
+ isAutoincrement: false;
1179
+ hasRuntimeDefault: false;
1180
+ enumValues: [string, ...string[]];
1181
+ baseColumn: never;
1182
+ identity: undefined;
1183
+ generated: undefined;
1184
+ }, {}>;
1137
1185
  attempts: import("drizzle-orm/sqlite-core").SQLiteColumn<{
1138
1186
  name: string;
1139
1187
  tableName: "reference_failures";
@@ -99,6 +99,8 @@ exports.importJobs = (0, sqlite_core_1.sqliteTable)('import_jobs', {
99
99
  total: (0, sqlite_core_1.integer)(),
100
100
  error: (0, sqlite_core_1.text)(),
101
101
  updatedAt: (0, sqlite_core_1.text)('updated_at').notNull(),
102
+ addedCount: (0, sqlite_core_1.integer)('added_count').notNull().default(0),
103
+ removedCount: (0, sqlite_core_1.integer)('removed_count').notNull().default(0),
102
104
  });
103
105
  exports.importCursors = (0, sqlite_core_1.sqliteTable)('import_cursors', {
104
106
  jobId: (0, sqlite_core_1.text)('job_id')
@@ -116,6 +118,7 @@ exports.referenceFailures = (0, sqlite_core_1.sqliteTable)('reference_failures',
116
118
  revision: (0, sqlite_core_1.integer)().notNull(),
117
119
  stage: (0, sqlite_core_1.text)({ enum: ['download', 'analysis'] }).notNull(),
118
120
  error: (0, sqlite_core_1.text)().notNull(),
121
+ reasonCode: (0, sqlite_core_1.text)('reason_code').$type(),
119
122
  attempts: (0, sqlite_core_1.integer)().notNull(),
120
123
  updatedAt: (0, sqlite_core_1.text)('updated_at').notNull(),
121
124
  }, (table) => [
@@ -129,6 +129,45 @@ export declare const ReferenceProfileStatusResponseSchema: z.ZodObject<{
129
129
  }, z.core.$strip>>;
130
130
  }, z.core.$strip>;
131
131
  export type ReferenceProfileStatusResponse = z.infer<typeof ReferenceProfileStatusResponseSchema>;
132
+ export declare const ReferenceDiscoveryResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
133
+ profile: z.ZodPipe<z.ZodObject<{
134
+ id: z.ZodString;
135
+ username: z.ZodString;
136
+ title: z.ZodString;
137
+ url: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString]>;
138
+ }, z.core.$strip>, z.ZodTransform<{
139
+ id: string;
140
+ username: string;
141
+ title: string;
142
+ url: string;
143
+ }, {
144
+ id: string;
145
+ username: string;
146
+ title: string;
147
+ url: string;
148
+ }>>;
149
+ collections: z.ZodArray<z.ZodObject<{
150
+ id: z.ZodString;
151
+ title: z.ZodString;
152
+ description: z.ZodNullable<z.ZodString>;
153
+ url: z.ZodNullable<z.ZodString>;
154
+ total: z.ZodNullable<z.ZodNumber>;
155
+ parentId: z.ZodNullable<z.ZodString>;
156
+ children: z.ZodArray<z.ZodString>;
157
+ }, z.core.$strip>>;
158
+ total: z.ZodNumber;
159
+ id: z.ZodString;
160
+ createdAt: z.ZodString;
161
+ }, z.core.$strip>, z.ZodObject<{
162
+ status: z.ZodLiteral<"authorization_required">;
163
+ provider: z.ZodEnum<{
164
+ pinterest: "pinterest";
165
+ arena: "arena";
166
+ x: "x";
167
+ }>;
168
+ authUrl: z.ZodString;
169
+ message: z.ZodString;
170
+ }, z.core.$strip>]>;
132
171
  export declare const ReferenceImportPlanSummarySchema: z.ZodObject<{
133
172
  id: z.ZodString;
134
173
  revision: z.ZodString;
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VariantsUiStateUpdateSchema = exports.VariantsUiStateResponseSchema = exports.VariantsUiStateSchema = exports.AccountResponseSchema = exports.ReferenceImportPlanSummarySchema = exports.ReferenceProfileStatusResponseSchema = exports.NavigationAcknowledgementResponseSchema = exports.ViewNavigationsResponseSchema = exports.ViewNavigationSchema = exports.DirectionUpdateResponseSchema = exports.DirectionPreviewResponseSchema = exports.ProjectRuntimeResponseSchema = exports.FolderSelectionResponseSchema = exports.LibraryProjectPreviewResponseSchema = exports.LibraryProjectRemovalResponseSchema = exports.LibraryProjectResponseSchema = exports.LibraryProjectListResponseSchema = exports.LibraryViewLaunchResponseSchema = exports.BrowserSessionResponseSchema = exports.SupportTicketErrorResponseSchema = exports.VariantsErrorResponseSchema = exports.ErrorResponseSchema = void 0;
3
+ exports.VariantsUiStateUpdateSchema = exports.VariantsUiStateResponseSchema = exports.VariantsUiStateSchema = exports.AccountResponseSchema = exports.ReferenceImportPlanSummarySchema = exports.ReferenceDiscoveryResponseSchema = exports.ReferenceProfileStatusResponseSchema = exports.NavigationAcknowledgementResponseSchema = exports.ViewNavigationsResponseSchema = exports.ViewNavigationSchema = exports.DirectionUpdateResponseSchema = exports.DirectionPreviewResponseSchema = exports.ProjectRuntimeResponseSchema = exports.FolderSelectionResponseSchema = exports.LibraryProjectPreviewResponseSchema = exports.LibraryProjectRemovalResponseSchema = exports.LibraryProjectResponseSchema = exports.LibraryProjectListResponseSchema = exports.LibraryViewLaunchResponseSchema = exports.BrowserSessionResponseSchema = exports.SupportTicketErrorResponseSchema = exports.VariantsErrorResponseSchema = exports.ErrorResponseSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const design_profile_1 = require("./design-profile");
6
+ const reference_onboarding_1 = require("./reference-onboarding");
7
+ const reference_connectors_1 = require("./reference-connectors");
6
8
  const project_library_1 = require("./project-library");
7
9
  exports.ErrorResponseSchema = zod_1.z.object({ error: zod_1.z.string() });
8
10
  exports.VariantsErrorResponseSchema = zod_1.z.object({
@@ -72,6 +74,15 @@ exports.ReferenceProfileStatusResponseSchema = zod_1.z.object({
72
74
  url: zod_1.z.string().nullable(),
73
75
  })),
74
76
  });
77
+ exports.ReferenceDiscoveryResponseSchema = zod_1.z.union([
78
+ reference_onboarding_1.ReferenceDiscoverySchema,
79
+ zod_1.z.object({
80
+ status: zod_1.z.literal('authorization_required'),
81
+ provider: reference_connectors_1.AuthenticatedReferenceProviderSchema,
82
+ authUrl: zod_1.z.string().url(),
83
+ message: zod_1.z.string(),
84
+ }),
85
+ ]);
75
86
  exports.ReferenceImportPlanSummarySchema = zod_1.z.object({
76
87
  id: zod_1.z.string(),
77
88
  revision: zod_1.z.string(),
@@ -26,6 +26,18 @@ export declare const ProfileProviderSchema: z.ZodEnum<{
26
26
  image: "image";
27
27
  pdf: "pdf";
28
28
  }>;
29
+ export declare const PROFILE_IMPORT_TRIGGERS: {
30
+ readonly connect: "manual";
31
+ readonly refresh: "manual";
32
+ readonly retry: "manual";
33
+ readonly upload: "manual";
34
+ readonly attachment: "auto";
35
+ readonly resume: "auto";
36
+ readonly cooldown_retry: "auto";
37
+ };
38
+ export type ProfileImportKind = keyof typeof PROFILE_IMPORT_TRIGGERS;
39
+ export type ProfileImportStep = 'memory_start' | 'enumerate' | 'download' | 'analysis' | 'index';
40
+ export type ProfilePreparationOffReason = 'request_mode_off' | 'profile_disabled' | 'no_uploads';
29
41
  export declare const ProfileRuntimeSchema: z.ZodEnum<{
30
42
  claude: "claude";
31
43
  codex: "codex";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProfileContextSchema = exports.ProfilePacketSchema = exports.ProfilePreparationRequestSchema = exports.ProfilePreparationSchema = exports.ProfileReferenceSchema = exports.ProfileObservationSchema = exports.ProfileUsageSchema = exports.ProfileReferenceInputSchema = exports.ProfileSourceInputSchema = exports.ProfileMediaSchema = exports.ProfileVariantInputSchema = exports.ProfileVariantIdentitySchema = exports.ProfileRuntimeSchema = exports.ProfileProviderSchema = exports.isRemoteProfileProvider = exports.RemoteProfileProviderSchema = exports.PROFILE_PREPARATION_BODY_BYTES = exports.PROFILE_UPLOAD_ENCODED_BYTES = exports.PROFILE_UPLOAD_BYTES = exports.PROFILE_UPLOAD_COUNT = exports.PROFILE_CANDIDATE_IMAGE_LIMIT = void 0;
3
+ exports.ProfileContextSchema = exports.ProfilePacketSchema = exports.ProfilePreparationRequestSchema = exports.ProfilePreparationSchema = exports.ProfileReferenceSchema = exports.ProfileObservationSchema = exports.ProfileUsageSchema = exports.ProfileReferenceInputSchema = exports.ProfileSourceInputSchema = exports.ProfileMediaSchema = exports.ProfileVariantInputSchema = exports.ProfileVariantIdentitySchema = exports.ProfileRuntimeSchema = exports.PROFILE_IMPORT_TRIGGERS = exports.ProfileProviderSchema = exports.isRemoteProfileProvider = exports.RemoteProfileProviderSchema = exports.PROFILE_PREPARATION_BODY_BYTES = exports.PROFILE_UPLOAD_ENCODED_BYTES = exports.PROFILE_UPLOAD_BYTES = exports.PROFILE_UPLOAD_COUNT = exports.PROFILE_CANDIDATE_IMAGE_LIMIT = void 0;
4
4
  const variant_reference_1 = require("./variant-reference");
5
5
  const zod_1 = require("zod");
6
6
  exports.PROFILE_CANDIDATE_IMAGE_LIMIT = 6;
@@ -25,6 +25,15 @@ exports.ProfileProviderSchema = zod_1.z.enum([
25
25
  'pdf',
26
26
  'variant',
27
27
  ]);
28
+ exports.PROFILE_IMPORT_TRIGGERS = {
29
+ connect: 'manual',
30
+ refresh: 'manual',
31
+ retry: 'manual',
32
+ upload: 'manual',
33
+ attachment: 'auto',
34
+ resume: 'auto',
35
+ cooldown_retry: 'auto',
36
+ };
28
37
  exports.ProfileRuntimeSchema = zod_1.z.enum(['codex', 'claude', 'cursor']);
29
38
  exports.ProfileVariantIdentitySchema = zod_1.z
30
39
  .object({
@@ -0,0 +1,48 @@
1
+ export declare const RIVET_PAGE_DATA_ELEMENT_ID = "rivet-page";
2
+ export declare const SIGN_IN_CALLBACK_COMPLETE_PATH = "/complete";
3
+ export type CanvasShareDirection = {
4
+ label: string;
5
+ brief: string;
6
+ shareUrl: string;
7
+ };
8
+ export type SharedShellRivetPage = {
9
+ kind: 'preview-waiting';
10
+ } | {
11
+ kind: 'sign-in-callback';
12
+ } | {
13
+ kind: 'canvas-share';
14
+ prompt: string;
15
+ directions: CanvasShareDirection[];
16
+ };
17
+ export type RivetPage = {
18
+ kind: 'empty-project';
19
+ } | SharedShellRivetPage;
20
+ export type ConnectResultMessage = {
21
+ type: 'rivet:connect-result';
22
+ provider: string;
23
+ status: 'connected' | 'error';
24
+ message?: string;
25
+ };
26
+ export type ConnectResultClosePolicy = 'always' | 'after-notifying-opener';
27
+ export type HostedRivetPage = {
28
+ kind: 'google-sign-in';
29
+ initiator: string;
30
+ providerAuthUrl: string;
31
+ } | {
32
+ kind: 'sign-in-link-expired';
33
+ } | {
34
+ kind: 'connect-result';
35
+ result: ConnectResultMessage;
36
+ notice: string;
37
+ closePolicy: ConnectResultClosePolicy;
38
+ };
39
+ export type RivetPageShareCard = {
40
+ description: string;
41
+ imageUrl: string;
42
+ };
43
+ export type RivetPageHead = {
44
+ title: string;
45
+ shareCard?: RivetPageShareCard;
46
+ robots?: 'noindex';
47
+ };
48
+ //# sourceMappingURL=rivet-page-types.d.ts.map
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SIGN_IN_CALLBACK_COMPLETE_PATH = exports.RIVET_PAGE_DATA_ELEMENT_ID = void 0;
4
+ exports.RIVET_PAGE_DATA_ELEMENT_ID = 'rivet-page';
5
+ exports.SIGN_IN_CALLBACK_COMPLETE_PATH = '/complete';
6
+ //# sourceMappingURL=rivet-page-types.js.map
@@ -52,7 +52,7 @@ exports.FAILURE_REASON_CODES = [
52
52
  ];
53
53
  const REASON_DETAIL_LIMIT = 400;
54
54
  const REDACTION_INPUT_LIMIT = 4_000;
55
- const ABSOLUTE_PATH = /(?<![\w.:/\\])\/(?:[\w.@+~-]+\/)+[\w.@+~-]*/g;
55
+ const ABSOLUTE_PATH = /(?<![\w.:/\\])\/(?:[\w.@+~-]+(?: [\w.@+~-]+)*\/)+[\w.@+~-]*/g;
56
56
  const REASON_CODES = new Set(exports.FAILURE_REASON_CODES);
57
57
  const ERRNO_CODES = new Set(ERRNO_REASON_CODES);
58
58
  const ERROR_NAME_REASON_CODES = new Map([
@@ -7,7 +7,7 @@ const HOSTED_LABEL_REDACTIONS = [
7
7
  /(?:https?|wss?):\/\/[^\s"'<>]+/gi,
8
8
  /\bBearer\s+[^\s,;"']+/gi,
9
9
  /\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/gi,
10
- /(?:[A-Z]:[\\/]|\/)(?:Users|home|private|tmp|var|opt|workspace|Volumes|root|mnt|srv)[\\/][^\s"'<>]+/gi,
10
+ /(?:[A-Z]:[\\/]|\/)(?:Users|home|private|tmp|var|opt|workspace|Volumes|root|mnt|srv)[\\/](?:[^\s"'<>]+ (?=[^\s"'<>]*[\\/]))*[^\s"'<>]+/gi,
11
11
  /\b[A-Z]:[\\/][^\s"'<>]+/gi,
12
12
  /\b[\w.-]{0,32}(?:token|secret|password|passwd|api[_-]?key)[\w.-]{0,32}["']?\s{0,3}[=:]\s{0,3}["']?[^\s,;"'<>]{1,256}/gi,
13
13
  /\b(?:sk-|sk_live_|sk_test_|rk_live_|rk_test_|sb_secret_|phx_|ghp_|gho_|ghs_|ghu_|github_pat_|glpat-|xox[abprs]-)[A-Za-z0-9_-]+/g,
@@ -0,0 +1,2 @@
1
+ export declare const withLaunchRuntime: (url: string, callerAgent?: string | null) => string;
2
+ //# sourceMappingURL=launchRuntime.d.ts.map
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withLaunchRuntime = void 0;
4
+ const design_profile_1 = require("../types/design-profile");
5
+ const withLaunchRuntime = (url, callerAgent) => {
6
+ const target = new URL(url);
7
+ const runtime = design_profile_1.ProfileRuntimeSchema.safeParse(callerAgent);
8
+ target.searchParams.set('runtime', runtime.success ? runtime.data : 'unknown');
9
+ return target.toString();
10
+ };
11
+ exports.withLaunchRuntime = withLaunchRuntime;
12
+ //# sourceMappingURL=launchRuntime.js.map
@@ -0,0 +1,8 @@
1
+ import type { RivetPage, RivetPageHead } from '../types/rivet-page-types';
2
+ export declare const RIVET_PAGE_SHELL_DIRECTORY: string;
3
+ export declare const RIVET_PAGE_SHELL_FILES: string[];
4
+ export declare const renderRivetPage: (args: {
5
+ page: RivetPage;
6
+ head: RivetPageHead;
7
+ }) => string;
8
+ //# sourceMappingURL=rivetPage.d.ts.map
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.renderRivetPage = exports.RIVET_PAGE_SHELL_FILES = exports.RIVET_PAGE_SHELL_DIRECTORY = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const rivetPageDocument_1 = require("./rivetPageDocument");
10
+ const uiDistPath_1 = require("./uiDistPath");
11
+ exports.RIVET_PAGE_SHELL_DIRECTORY = path_1.default.join(uiDistPath_1.DIST_UI_PATH, 'pages');
12
+ const SHARED_SHELL_FILE = 'rivet-page.html';
13
+ const EMPTY_PROJECT_SHELL_FILE = 'empty-project.html';
14
+ exports.RIVET_PAGE_SHELL_FILES = [
15
+ SHARED_SHELL_FILE,
16
+ EMPTY_PROJECT_SHELL_FILE,
17
+ ];
18
+ const shellFileFor = (page) => page.kind === 'empty-project' ? EMPTY_PROJECT_SHELL_FILE : SHARED_SHELL_FILE;
19
+ const renderRivetPage = (args) => (0, rivetPageDocument_1.composeRivetPage)({
20
+ shell: fs_1.default.readFileSync(path_1.default.join(exports.RIVET_PAGE_SHELL_DIRECTORY, shellFileFor(args.page)), 'utf8'),
21
+ ...args,
22
+ });
23
+ exports.renderRivetPage = renderRivetPage;
24
+ //# sourceMappingURL=rivetPage.js.map
@@ -0,0 +1,6 @@
1
+ export declare const readRivetPageData: (html: string) => unknown;
2
+ export declare const readRivetPageHead: (html: string) => {
3
+ title: string | null;
4
+ robots: string | null;
5
+ };
6
+ //# sourceMappingURL=rivetPage.testHelpers.d.ts.map
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.readRivetPageHead = exports.readRivetPageData = void 0;
4
+ const rivet_page_types_1 = require("../types/rivet-page-types");
5
+ const PAGE_DATA_PATTERN = new RegExp(`<script id="${rivet_page_types_1.RIVET_PAGE_DATA_ELEMENT_ID}" type="application/json">([\\s\\S]*?)</script>`);
6
+ const readRivetPageData = (html) => {
7
+ const data = html.match(PAGE_DATA_PATTERN)?.[1];
8
+ if (data === undefined)
9
+ throw new Error('Rivet page data is missing');
10
+ return JSON.parse(data);
11
+ };
12
+ exports.readRivetPageData = readRivetPageData;
13
+ const readRivetPageHead = (html) => ({
14
+ title: html.match(/<title>([\s\S]*?)<\/title>/)?.[1] ?? null,
15
+ robots: html.match(/<meta name="robots" content="([^"]*)" \/>/)?.[1] ?? null,
16
+ });
17
+ exports.readRivetPageHead = readRivetPageHead;
18
+ //# sourceMappingURL=rivetPage.testHelpers.js.map
@@ -0,0 +1,7 @@
1
+ import { type HostedRivetPage, type RivetPage, type RivetPageHead } from '../types/rivet-page-types';
2
+ export declare const composeRivetPage: ({ shell, page, head, }: {
3
+ shell: string;
4
+ page: RivetPage | HostedRivetPage;
5
+ head: RivetPageHead;
6
+ }) => string;
7
+ //# sourceMappingURL=rivetPageDocument.d.ts.map
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.composeRivetPage = void 0;
4
+ const rivet_page_types_1 = require("../types/rivet-page-types");
5
+ const scriptJson_1 = require("./scriptJson");
6
+ const PAGE_HEAD_MARKER = '<meta name="rivet-page-head" />';
7
+ const renderPageDataElement = (json) => `<script id="${rivet_page_types_1.RIVET_PAGE_DATA_ELEMENT_ID}" type="application/json">${json}</script>`;
8
+ const PAGE_DATA_PLACEHOLDER = renderPageDataElement('null');
9
+ const escapeHtml = (value) => value
10
+ .replace(/&/g, '&amp;')
11
+ .replace(/</g, '&lt;')
12
+ .replace(/>/g, '&gt;')
13
+ .replace(/"/g, '&quot;')
14
+ .replace(/'/g, '&#39;');
15
+ const renderShareCardTags = (title, { description, imageUrl }) => [
16
+ ['name', 'description', description],
17
+ ['property', 'og:type', 'website'],
18
+ ['property', 'og:title', title],
19
+ ['property', 'og:description', description],
20
+ ['property', 'og:image', imageUrl],
21
+ ['name', 'twitter:card', 'summary_large_image'],
22
+ ['name', 'twitter:title', title],
23
+ ['name', 'twitter:description', description],
24
+ ['name', 'twitter:image', imageUrl],
25
+ ].map(([attribute, key, content]) => `<meta ${attribute}="${key}" content="${escapeHtml(content)}" />`);
26
+ const renderHead = ({ title, shareCard, robots }) => [
27
+ ...(robots ? [`<meta name="robots" content="${robots}" />`] : []),
28
+ `<title>${escapeHtml(title)}</title>`,
29
+ ...(shareCard ? renderShareCardTags(title, shareCard) : []),
30
+ ].join('\n ');
31
+ const composeRivetPage = ({ shell, page, head, }) => {
32
+ if (!shell.includes(PAGE_HEAD_MARKER) ||
33
+ !shell.includes(PAGE_DATA_PLACEHOLDER)) {
34
+ throw new Error('Rivet page shell is missing its head or data placeholder');
35
+ }
36
+ return shell
37
+ .replace(PAGE_HEAD_MARKER, () => renderHead(head))
38
+ .replace(PAGE_DATA_PLACEHOLDER, () => renderPageDataElement((0, scriptJson_1.escapeScriptJson)(page)));
39
+ };
40
+ exports.composeRivetPage = composeRivetPage;
41
+ //# sourceMappingURL=rivetPageDocument.js.map
@@ -0,0 +1,2 @@
1
+ export declare const escapeScriptJson: (value: unknown) => string;
2
+ //# sourceMappingURL=scriptJson.d.ts.map
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.escapeScriptJson = void 0;
4
+ const escapeScriptJson = (value) => JSON.stringify(value)
5
+ .replace(/</g, '\\u003c')
6
+ .replace(/\u2028/g, '\\u2028')
7
+ .replace(/\u2029/g, '\\u2029');
8
+ exports.escapeScriptJson = escapeScriptJson;
9
+ //# sourceMappingURL=scriptJson.js.map
@@ -1,4 +1,4 @@
1
- export declare const CLI_GUIDANCE_VERSION = 58;
1
+ export declare const CLI_GUIDANCE_VERSION = 59;
2
2
  export declare const CLI_GUIDANCE_BODY: string;
3
3
  export declare const CLI_GUIDANCE_DESCRIPTION = "Rivet \u2014 open the visual editor or explore design directions for a web app.";
4
4
  //# sourceMappingURL=cli-guidance.d.ts.map
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CLI_GUIDANCE_DESCRIPTION = exports.CLI_GUIDANCE_BODY = exports.CLI_GUIDANCE_VERSION = void 0;
4
4
  const displayLocale_1 = require("../displayLocale");
5
- exports.CLI_GUIDANCE_VERSION = 58;
5
+ exports.CLI_GUIDANCE_VERSION = 59;
6
6
  const DISPLAY_LOCALE = (0, displayLocale_1.resolveDisplayLocale)();
7
7
  exports.CLI_GUIDANCE_BODY = `Rivet helps you **explore multiple design directions** for a web app. You drive it by running \`rivet\` CLI commands. Every command prints exactly one JSON envelope on stdout (\`{ schemaVersion, ok, command, data | error }\`), routes progress to stderr, and never prompts for input.
8
8
 
@@ -105,6 +105,7 @@ The export returns \`{checks:[{id,status:"pass"|"fail"|"blocked",priority:"high"
105
105
  - \`rivet variants cancel <sessionId> --project <path>\` — cancel a running variants session.
106
106
  - \`rivet evidence capture --url <url>\` — rendered design evidence (root variables, element styles, fonts) for a reference URL.
107
107
  - \`rivet reference fetch <url>\` — Pinterest / Are.na reference data via the user's connected account. Accepts full pin/board URLs and \`pin.it\` share links. Pinterest images are downloaded into \`.rivet/references/\` and returned as absolute paths (\`data.images\`, plus \`local_path\` per pin) — view them directly and pass them to variants via \`--context-images\` instead of relaying URLs. If Pinterest returns \`status: not_connected\`, present the returned \`authUrl\` to the user and retry after they authorize. On failure the error message says exactly what to tell the user (e.g. save the pin to a board first).
108
+ - \`rivet profile disconnect <pinterest|arena|x>\` — disconnect one reference account from Rivet while retaining saved references. Requires sign-in. No running editor or worker runtime is needed. This is account-wide; source/file selection flags are rejected. Provider authorization revocation varies by provider. Until independently exposed in the MCP catalog, this remains CLI-only maintenance.
108
109
  - \`rivet auth status\` — signed-in state. A signed-out \`rivet open\` starts Rivet sign-in in the browser itself and exits 3 with \`AUTH_REQUIRED\` and \`error.nextAction.authUrl\` if the user has not finished within a short wait. Share that \`authUrl\` as a clickable link (with \`--no-browser\` it is the only way in), ask the user to finish signing in, then rerun \`rivet open\`; it picks up the finished sign-in. For \`AUTH_REQUIRED\` from other commands, run \`rivet open\` the same way, or call the \`rivet_login\` MCP tool when this host has it. \`rivet login\` stays available for the user to run themselves — never run login in your own terminal (it blocks waiting on the browser).
109
110
  - \`rivet version status\` — check the installed and latest published CLI versions without changing the installation. Returns \`installedVersion\`, \`publishedVersion\`, and \`isUpdateAvailable\`.
110
111
  - \`rivet update\` — bypass the automatic-update cache, install the latest published CLI when available, and refresh existing host registrations and agent guidance. Run it when version status reports an available update, or for explicit verification or recovery.
@@ -0,0 +1,2 @@
1
+ export declare const DIST_UI_PATH: string;
2
+ //# sourceMappingURL=uiDistPath.d.ts.map
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DIST_UI_PATH = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const logger_1 = require("./logger");
10
+ const log = (0, logger_1.createLogger)('UiDistPath');
11
+ const resolveUiPath = () => {
12
+ const bundledPath = path_1.default.join(__dirname, '..', 'ui/dist');
13
+ const devPath = path_1.default.join(__dirname, '../../src/ui/dist');
14
+ if (fs_1.default.existsSync(bundledPath)) {
15
+ log.debug(`Using bundled UI path: ${bundledPath}`);
16
+ return bundledPath;
17
+ }
18
+ log.debug(`Using development UI path: ${devPath}`);
19
+ return devPath;
20
+ };
21
+ exports.DIST_UI_PATH = resolveUiPath();
22
+ //# sourceMappingURL=uiDistPath.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rivet-design",
3
- "version": "0.28.1",
3
+ "version": "0.28.3",
4
4
  "description": "Rivet is a design agent for your coding agent. It explores dozens of design directions in parallel so you can pick the one that fits.",
5
5
  "main": "dist/index.js",
6
6
  "workspaces": [
@@ -14,7 +14,7 @@
14
14
  "preinstall": "node scripts/verify-node-version.cjs",
15
15
  "build": "npm run clean && tsc && npm run build:assets && npm run build:ui && npm run build:bin",
16
16
  "build:assets": "mkdir -p dist/services/templates/designmd && cp src/services/templates/designmd/*.md dist/services/templates/designmd/",
17
- "build:ui": "cd src/ui && vite build",
17
+ "build:ui": "cd src/ui && vite build && vite build --config vite.pages.config.ts && vite build --config vite.pages.config.ts --mode empty-project",
18
18
  "storybook:ui": "yarn workspace @rivet/ui storybook",
19
19
  "build-storybook:ui": "yarn workspace @rivet/ui build-storybook",
20
20
  "build:bin": "mkdir -p bin && cp src/bin-template.js bin/rivet.js && chmod +x bin/rivet.js",
@@ -43,9 +43,9 @@
43
43
  "prepare": "husky",
44
44
  "docs:sync": "node scripts/sync-external-docs.js",
45
45
  "deploy:supabase:functions": "bash scripts/deploy-supabase-functions.sh",
46
- "ratchet": "tsx scripts/ratchet.ts",
46
+ "ratchet": "node scripts/ratchet.mts",
47
47
  "check:comments": "node scripts/code-comments.mjs --changed",
48
- "test:ratchet": "node --import tsx --test scripts/ratchet/*.test.ts scripts/code-comments.test.mjs && python3 scripts/python-comments.test.py",
48
+ "test:ratchet": "node --import tsx --test --test-concurrency=4 scripts/ratchet/*.test.ts scripts/semantic-colors.test.ts scripts/code-comments.test.mjs && python3 scripts/python-comments.test.py",
49
49
  "bench": "node --import tsx benchmarks/bench.ts",
50
50
  "bench:run": "node --import tsx benchmarks/runner.ts",
51
51
  "bench:compare": "node --import tsx benchmarks/compare.ts",
@@ -99,6 +99,7 @@
99
99
  "@csstools/css-tokenizer": "^3.0.4",
100
100
  "@eslint/js": "^9.36.0",
101
101
  "@playwright/test": "^1.58.2",
102
+ "@tailwindcss/node": "4.3.3",
102
103
  "@types/cors": "^2.8.19",
103
104
  "@types/express": "^5.0.3",
104
105
  "@types/express-serve-static-core": "^5.0.0",
@@ -114,6 +115,7 @@
114
115
  "@types/ws": "^8.18.1",
115
116
  "@typescript-eslint/eslint-plugin": "^8.44.0",
116
117
  "@typescript-eslint/parser": "^8.44.0",
118
+ "@typescript-eslint/typescript-estree": "^8.44.0",
117
119
  "@vitejs/plugin-react": "^4.2.1",
118
120
  "autoprefixer": "^10.4.16",
119
121
  "dockerfile-ast": "^0.7.1",
@@ -137,6 +139,7 @@
137
139
  "react-dom": "^18.2.0",
138
140
  "supabase": "^2.47.2",
139
141
  "supertest": "^7.1.4",
142
+ "tailwind-merge": "^3.6.0",
140
143
  "tailwindcss": "^3.4.0",
141
144
  "ts-jest": "^29.4.4",
142
145
  "ts-node": "^10.9.2",
@@ -202,5 +205,5 @@
202
205
  "rivetPlugin": {
203
206
  "toolContract": "intent-v2"
204
207
  },
205
- "gitHead": "b2fbc13c45997a1b003d0e124016e384f648e0e7"
208
+ "gitHead": "9ae0e06fae89bec6c2db38f921ba836507e5d972"
206
209
  }