@valbuild/shared 0.150.8 → 0.150.10

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @valbuild/shared
2
2
 
3
+ ## 0.150.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [#970](https://github.com/valbuild/val/pull/970) [`bc39500`](https://github.com/valbuild/val/commit/bc395000866ae9cbde8825f53d1bb606e1093c94) Thanks [@freekh](https://github.com/freekh)! - A proposal's shared AI chat now shows other people's turns live: their question appears as they send it, each tool the turn runs shows as a step, and the answer streams in as it is written, instead of turning up a few seconds later. Who is asking is what the content server says rather than a guess. Against a content server that does not relay chats yet, the Studio falls back to reading the chat again every few seconds, as before.
8
+
9
+ An answer's tool steps are now also shown when a chat is opened again or the page is reloaded, for every chat on a content server that keeps them.
10
+
3
11
  ## 0.150.8
4
12
 
5
13
  ### Patch Changes
@@ -21,6 +21,21 @@ export type PlanRefusalErrorT = z.infer<typeof PlanRefusalError>;
21
21
  * with the editor's cookie from another site.
22
22
  */
23
23
  export declare const VAL_STUDIO_HEADER = "x-val-studio";
24
+ /**
25
+ * On a user message in an AI chat: the tools called in the turn it asked for,
26
+ * as the content server keeps them (valbuild/home `docs/proposals.md`,
27
+ * Flow H) - what each tool row shows, never what the tool read or wrote.
28
+ *
29
+ * A chat with a summary this cannot read loads without its tool rows rather
30
+ * than not at all, hence the `catch`.
31
+ */
32
+ export declare const AIToolCallSummaries: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodObject<{
33
+ toolCallId: z.ZodString;
34
+ name: z.ZodString;
35
+ isError: z.ZodBoolean;
36
+ questions: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
37
+ answers: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
38
+ }, z.core.$strip>>>>;
24
39
  declare const cookies: z.ZodUnion<readonly [z.ZodLiteral<"val_session">, z.ZodLiteral<"val_enable">, z.ZodLiteral<"val_state">]>;
25
40
  type Cookies = z.infer<typeof cookies>;
26
41
  declare const enableCookieValue: z.ZodObject<{
@@ -2075,6 +2090,13 @@ export declare const Api: {
2075
2090
  json: z.ZodObject<{
2076
2091
  messages: z.ZodArray<z.ZodObject<{
2077
2092
  authorId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2093
+ toolCalls: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodObject<{
2094
+ toolCallId: z.ZodString;
2095
+ name: z.ZodString;
2096
+ isError: z.ZodBoolean;
2097
+ questions: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
2098
+ answers: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
2099
+ }, z.core.$strip>>>>;
2078
2100
  role: z.ZodString;
2079
2101
  content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
2080
2102
  type: z.ZodLiteral<"text">;
@@ -1495,6 +1495,23 @@ var PlanRefusalError = zod.z.object({
1495
1495
  */
1496
1496
  var VAL_STUDIO_HEADER = "x-val-studio";
1497
1497
 
1498
+ /**
1499
+ * On a user message in an AI chat: the tools called in the turn it asked for,
1500
+ * as the content server keeps them (valbuild/home `docs/proposals.md`,
1501
+ * Flow H) - what each tool row shows, never what the tool read or wrote.
1502
+ *
1503
+ * A chat with a summary this cannot read loads without its tool rows rather
1504
+ * than not at all, hence the `catch`.
1505
+ */
1506
+ var AIToolCallSummaries = zod.z.array(zod.z.object({
1507
+ toolCallId: zod.z.string(),
1508
+ name: zod.z.string(),
1509
+ isError: zod.z["boolean"](),
1510
+ /** `ask_user_question`: what was asked, and what was answered. */
1511
+ questions: zod.z.array(zod.z.unknown()).optional(),
1512
+ answers: zod.z.array(zod.z.unknown()).optional()
1513
+ })).optional()["catch"](undefined);
1514
+
1498
1515
  /**
1499
1516
  * What Val Build answered, mapped onto the statuses this server speaks: a
1500
1517
  * `code` in the JSON is what the web components act on, so it is passed
@@ -3544,6 +3561,7 @@ var Api = {
3544
3561
  messages: zod.z.array(zod.z.object({
3545
3562
  /** Who asked, on a user message in a proposal's chat. */
3546
3563
  authorId: zod.z.string().nullable().optional(),
3564
+ toolCalls: AIToolCallSummaries,
3547
3565
  role: zod.z.string(),
3548
3566
  content: zod.z.union([zod.z.string(), zod.z.array(zod.z.union([zod.z.object({
3549
3567
  type: zod.z.literal("text"),
@@ -8714,6 +8732,7 @@ exports.startElementPicking = getSitemapTree.startElementPicking;
8714
8732
  exports.withValCanvasParam = getSitemapTree.withValCanvasParam;
8715
8733
  exports.AA_LARGE = AA_LARGE;
8716
8734
  exports.AA_TEXT = AA_TEXT;
8735
+ exports.AIToolCallSummaries = AIToolCallSummaries;
8717
8736
  exports.AnalyticsBeacon = AnalyticsBeacon;
8718
8737
  exports.Api = Api;
8719
8738
  exports.BRAND_CONTRAST_PAIRS = BRAND_CONTRAST_PAIRS;
@@ -1495,6 +1495,23 @@ var PlanRefusalError = zod.z.object({
1495
1495
  */
1496
1496
  var VAL_STUDIO_HEADER = "x-val-studio";
1497
1497
 
1498
+ /**
1499
+ * On a user message in an AI chat: the tools called in the turn it asked for,
1500
+ * as the content server keeps them (valbuild/home `docs/proposals.md`,
1501
+ * Flow H) - what each tool row shows, never what the tool read or wrote.
1502
+ *
1503
+ * A chat with a summary this cannot read loads without its tool rows rather
1504
+ * than not at all, hence the `catch`.
1505
+ */
1506
+ var AIToolCallSummaries = zod.z.array(zod.z.object({
1507
+ toolCallId: zod.z.string(),
1508
+ name: zod.z.string(),
1509
+ isError: zod.z["boolean"](),
1510
+ /** `ask_user_question`: what was asked, and what was answered. */
1511
+ questions: zod.z.array(zod.z.unknown()).optional(),
1512
+ answers: zod.z.array(zod.z.unknown()).optional()
1513
+ })).optional()["catch"](undefined);
1514
+
1498
1515
  /**
1499
1516
  * What Val Build answered, mapped onto the statuses this server speaks: a
1500
1517
  * `code` in the JSON is what the web components act on, so it is passed
@@ -3544,6 +3561,7 @@ var Api = {
3544
3561
  messages: zod.z.array(zod.z.object({
3545
3562
  /** Who asked, on a user message in a proposal's chat. */
3546
3563
  authorId: zod.z.string().nullable().optional(),
3564
+ toolCalls: AIToolCallSummaries,
3547
3565
  role: zod.z.string(),
3548
3566
  content: zod.z.union([zod.z.string(), zod.z.array(zod.z.union([zod.z.object({
3549
3567
  type: zod.z.literal("text"),
@@ -8714,6 +8732,7 @@ exports.startElementPicking = getSitemapTree.startElementPicking;
8714
8732
  exports.withValCanvasParam = getSitemapTree.withValCanvasParam;
8715
8733
  exports.AA_LARGE = AA_LARGE;
8716
8734
  exports.AA_TEXT = AA_TEXT;
8735
+ exports.AIToolCallSummaries = AIToolCallSummaries;
8717
8736
  exports.AnalyticsBeacon = AnalyticsBeacon;
8718
8737
  exports.Api = Api;
8719
8738
  exports.BRAND_CONTRAST_PAIRS = BRAND_CONTRAST_PAIRS;
@@ -1488,6 +1488,23 @@ var PlanRefusalError = z.object({
1488
1488
  */
1489
1489
  var VAL_STUDIO_HEADER = "x-val-studio";
1490
1490
 
1491
+ /**
1492
+ * On a user message in an AI chat: the tools called in the turn it asked for,
1493
+ * as the content server keeps them (valbuild/home `docs/proposals.md`,
1494
+ * Flow H) - what each tool row shows, never what the tool read or wrote.
1495
+ *
1496
+ * A chat with a summary this cannot read loads without its tool rows rather
1497
+ * than not at all, hence the `catch`.
1498
+ */
1499
+ var AIToolCallSummaries = z.array(z.object({
1500
+ toolCallId: z.string(),
1501
+ name: z.string(),
1502
+ isError: z["boolean"](),
1503
+ /** `ask_user_question`: what was asked, and what was answered. */
1504
+ questions: z.array(z.unknown()).optional(),
1505
+ answers: z.array(z.unknown()).optional()
1506
+ })).optional()["catch"](undefined);
1507
+
1491
1508
  /**
1492
1509
  * What Val Build answered, mapped onto the statuses this server speaks: a
1493
1510
  * `code` in the JSON is what the web components act on, so it is passed
@@ -3537,6 +3554,7 @@ var Api = {
3537
3554
  messages: z.array(z.object({
3538
3555
  /** Who asked, on a user message in a proposal's chat. */
3539
3556
  authorId: z.string().nullable().optional(),
3557
+ toolCalls: AIToolCallSummaries,
3540
3558
  role: z.string(),
3541
3559
  content: z.union([z.string(), z.array(z.union([z.object({
3542
3560
  type: z.literal("text"),
@@ -8662,4 +8680,4 @@ var messageOf = function messageOf(error) {
8662
8680
  return error instanceof Error ? error.message : String(error);
8663
8681
  };
8664
8682
 
8665
- export { AA_LARGE, AA_TEXT, AnalyticsBeacon, Api, BRAND_CONTRAST_PAIRS, BinaryFileRef, CodeOptions, ColorOptions, DEFAULT_ERROR_MESSAGE, DateOptions, ENCODE_DEFAULTS, ENCODE_MIME_TYPE_OF, FileOptions, HistoricalCommit, HistoricalModule, HistoricalPatchSet, HistoryError, ImageEncodeOption, ImageOptions, JSONValue, JSON_ENTRIES_BATCH_MAX, LOCAL_FILE_IN_REMOTE_PROJECT_HINT, LOCAL_FILE_IN_REMOTE_PROJECT_WARNING, ModuleComparison, NEVER_ENCODED, ParentRef$1 as ParentRef, Patch, PatchBlock, PatchId, PatchJSON, PatchSets, PlanRefusalError, RAMP_STEPS, RemirrorBr, RemirrorBulletList, RemirrorHeading, RemirrorImage, RemirrorJSON, RemirrorLinkMark, RemirrorListItem, RemirrorOrderedList, RemirrorParagraph, RemirrorText, RemirrorTextMark, RestoreVerdict, RichTextOptions, SCHEMA_SOURCE_FIXES, SELF_CHECK_VERSION, STUDIO_FIXES, SerializedArraySchema, SerializedBooleanSchema, SerializedCodeSchema, SerializedColorSchema, SerializedDateSchema, SerializedDateTimeSchema, SerializedDiscriminatedUnionSchema, SerializedEnumSchema, SerializedFileSchema, SerializedImageSchema, SerializedKeyOfSchema, SerializedLiteralSchema, SerializedLocaleSchema, SerializedNumberSchema, SerializedObjectSchema, SerializedRecordSchema, SerializedRichTextSchema, SerializedRouteSchema, SerializedSchema, SerializedSettingsSchema, SerializedStringSchema, SerializedValViewSchema, SerializedVideoSchema, SharedValConfig, VAL_ENABLE_COOKIE_NAME, VAL_GREEN_RAMP, VAL_SESSION_COOKIE, VAL_STATE_COOKIE, VAL_STUDIO_HEADER, ValCommit, ValDeployment, VideoOptions, VideoStreamOption, WARNING_FIXES, WASM_ENCODED_MIME_TYPES, accentRamp, buildDuplicatePatch, buildEmptyAtPathPatch, buildFileRefValue, buildImageGalleryPatch, buildRemoveImageGalleryEntryPatch, buildSearchIndex, chainHeadOf, checkCompatibility, chooseEncoded, concatModulePath, contrastRatio, createRegExpFromPattern, createSearchIndex, createValClient, declaredLocales, describeContainerAtPath, emptyOf, enumLocaleTag, explainIncompatible, fallbackMimeType, filterBlockingValidationErrors, filterRoutesByPatterns, findSimilar, fitWithin, flattenRichText, forEachRichTextImage, getErrorMessageFromUnknownJson, getFilenameFromRef, getInlineImgInfo, getKeyOfRecordAt, getRefParts, getRoutesOf, getRoutesWithModulePaths, getSourceAt, getValDemo, indexModule, isInsidePatchSetPath, isLocaleSchema, isMimeTypeAccepted, isRemoteSchema, isRepairedOnSave, isSchemaSourceFixError, isSkippedSource, isStudioFix, isValidationWarning, isWarningFix, joinSharedChanges, keyOfRecordPath, levenshtein, localeAt, localeMeantBy, memoizePerRequest, newestCommitSha, partitionValidationErrors, performSearch, proposalCustomProperties, relativeLuminance, remirrorToRichTextSource, removeModule, resolveEncodeSettings, resolvePairGround, resolveSchemaSourceFixForError, resolveSchemaSourceFixes, resolveSerializedSchemaAtPath, richTextImageSchema, richTextToRemirror, safeParsePatch, schemaErrorsOf, schemaTypesOfPath, selectionClosure, selfCheck, shouldEncodeWithWasm, sideFiles, sideSource, sourcePathOfChild, themeCustomProperties, toolNames, traverseSchemaSource, urlOf, validateRoutePatterns, withExtension };
8683
+ export { AA_LARGE, AA_TEXT, AIToolCallSummaries, AnalyticsBeacon, Api, BRAND_CONTRAST_PAIRS, BinaryFileRef, CodeOptions, ColorOptions, DEFAULT_ERROR_MESSAGE, DateOptions, ENCODE_DEFAULTS, ENCODE_MIME_TYPE_OF, FileOptions, HistoricalCommit, HistoricalModule, HistoricalPatchSet, HistoryError, ImageEncodeOption, ImageOptions, JSONValue, JSON_ENTRIES_BATCH_MAX, LOCAL_FILE_IN_REMOTE_PROJECT_HINT, LOCAL_FILE_IN_REMOTE_PROJECT_WARNING, ModuleComparison, NEVER_ENCODED, ParentRef$1 as ParentRef, Patch, PatchBlock, PatchId, PatchJSON, PatchSets, PlanRefusalError, RAMP_STEPS, RemirrorBr, RemirrorBulletList, RemirrorHeading, RemirrorImage, RemirrorJSON, RemirrorLinkMark, RemirrorListItem, RemirrorOrderedList, RemirrorParagraph, RemirrorText, RemirrorTextMark, RestoreVerdict, RichTextOptions, SCHEMA_SOURCE_FIXES, SELF_CHECK_VERSION, STUDIO_FIXES, SerializedArraySchema, SerializedBooleanSchema, SerializedCodeSchema, SerializedColorSchema, SerializedDateSchema, SerializedDateTimeSchema, SerializedDiscriminatedUnionSchema, SerializedEnumSchema, SerializedFileSchema, SerializedImageSchema, SerializedKeyOfSchema, SerializedLiteralSchema, SerializedLocaleSchema, SerializedNumberSchema, SerializedObjectSchema, SerializedRecordSchema, SerializedRichTextSchema, SerializedRouteSchema, SerializedSchema, SerializedSettingsSchema, SerializedStringSchema, SerializedValViewSchema, SerializedVideoSchema, SharedValConfig, VAL_ENABLE_COOKIE_NAME, VAL_GREEN_RAMP, VAL_SESSION_COOKIE, VAL_STATE_COOKIE, VAL_STUDIO_HEADER, ValCommit, ValDeployment, VideoOptions, VideoStreamOption, WARNING_FIXES, WASM_ENCODED_MIME_TYPES, accentRamp, buildDuplicatePatch, buildEmptyAtPathPatch, buildFileRefValue, buildImageGalleryPatch, buildRemoveImageGalleryEntryPatch, buildSearchIndex, chainHeadOf, checkCompatibility, chooseEncoded, concatModulePath, contrastRatio, createRegExpFromPattern, createSearchIndex, createValClient, declaredLocales, describeContainerAtPath, emptyOf, enumLocaleTag, explainIncompatible, fallbackMimeType, filterBlockingValidationErrors, filterRoutesByPatterns, findSimilar, fitWithin, flattenRichText, forEachRichTextImage, getErrorMessageFromUnknownJson, getFilenameFromRef, getInlineImgInfo, getKeyOfRecordAt, getRefParts, getRoutesOf, getRoutesWithModulePaths, getSourceAt, getValDemo, indexModule, isInsidePatchSetPath, isLocaleSchema, isMimeTypeAccepted, isRemoteSchema, isRepairedOnSave, isSchemaSourceFixError, isSkippedSource, isStudioFix, isValidationWarning, isWarningFix, joinSharedChanges, keyOfRecordPath, levenshtein, localeAt, localeMeantBy, memoizePerRequest, newestCommitSha, partitionValidationErrors, performSearch, proposalCustomProperties, relativeLuminance, remirrorToRichTextSource, removeModule, resolveEncodeSettings, resolvePairGround, resolveSchemaSourceFixForError, resolveSchemaSourceFixes, resolveSerializedSchemaAtPath, richTextImageSchema, richTextToRemirror, safeParsePatch, schemaErrorsOf, schemaTypesOfPath, selectionClosure, selfCheck, shouldEncodeWithWasm, sideFiles, sideSource, sourcePathOfChild, themeCustomProperties, toolNames, traverseSchemaSource, urlOf, validateRoutePatterns, withExtension };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valbuild/shared",
3
- "version": "0.150.8",
3
+ "version": "0.150.10",
4
4
  "private": false,
5
5
  "description": "Val shared types and utilities",
6
6
  "repository": {
@@ -71,7 +71,7 @@
71
71
  ],
72
72
  "devDependencies": {
73
73
  "typescript": "^6.0.3",
74
- "@valbuild/tanstack-build": "0.150.1"
74
+ "@valbuild/tanstack-build": "0.150.9"
75
75
  },
76
76
  "sideEffects": false,
77
77
  "scripts": {