@guuey/chat 0.16.0 → 0.16.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.
@@ -1 +1 @@
1
- {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../src/plan.ts"],"names":[],"mappings":"AAkCA,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpD,OAAO,KAAK,EAUV,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EAIf,MAAM,YAAY,CAAC;AA2pBpB,uCAAuC;AACvC,wBAAgB,cAAc,CAC5B,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,gBAAgB,EACxB,SAAS,GAAE,mBAAwB,GAClC,cAAc,CAwVhB;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,QAAQ,GAAG,cAAc,CAAC,GACxD;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAAE,GAAG,SAAS,CAiB5D"}
1
+ {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../src/plan.ts"],"names":[],"mappings":"AAkCA,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpD,OAAO,KAAK,EAUV,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EAIf,MAAM,YAAY,CAAC;AAuqBpB,uCAAuC;AACvC,wBAAgB,cAAc,CAC5B,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,gBAAgB,EACxB,SAAS,GAAE,mBAAwB,GAClC,cAAc,CA2VhB;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,QAAQ,GAAG,cAAc,CAAC,GACxD;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAAE,GAAG,SAAS,CAiB5D"}
package/dist/plan.js CHANGED
@@ -596,6 +596,17 @@ function deriveStatus(inputs, policy) {
596
596
  }
597
597
  }
598
598
  }
599
+ /**
600
+ * Built-in per-code voices (guuey#417) — consulted AFTER the policy's own
601
+ * `copyByCode` (host override always wins) and before family copy. These
602
+ * are codes whose family styling fits but whose family COPY lies:
603
+ * THREAD_HISTORY_UNAVAILABLE is not "something went wrong — try again"
604
+ * (nothing is wrong and there is nothing to retry — a fresh session is
605
+ * already composed); the honest notice is the guard's own.
606
+ */
607
+ const CODE_COPY = {
608
+ THREAD_HISTORY_UNAVAILABLE: (s) => s.errorHistoryUnavailable,
609
+ };
599
610
  const ERROR_FAMILIES = {
600
611
  UNAUTHORIZED: "auth",
601
612
  AUTH_REQUIRED: "auth",
@@ -849,7 +860,10 @@ export function planTranscript(inputs, policy, overrides = {}) {
849
860
  const { copyByCode, verbatimCodes } = policy.error;
850
861
  const perCode = code !== null ? copyByCode[code] : undefined;
851
862
  const verbatimVoice = verbatimCodes === "all" || (code !== null && verbatimCodes.includes(code));
852
- const copy = perCode ?? (verbatimVoice && inputs.error.message !== "" ? inputs.error.message : familyCopy);
863
+ const builtIn = code !== null ? CODE_COPY[code] : undefined;
864
+ const copy = perCode ??
865
+ (verbatimVoice && inputs.error.message !== "" ? inputs.error.message : undefined) ??
866
+ (builtIn !== undefined ? builtIn(policy.strings) : familyCopy);
853
867
  items.push({
854
868
  kind: "error",
855
869
  key: "error",
package/dist/strings.d.ts CHANGED
@@ -24,6 +24,15 @@ export interface ChatStrings {
24
24
  errorQuota: string;
25
25
  errorTransient: string;
26
26
  errorInvalid: string;
27
+ /**
28
+ * R11, code THREAD_HISTORY_UNAVAILABLE (guuey#417): the hydration
29
+ * guard's honest face — the old conversation could not be restored
30
+ * (identity moved / thread gone) and a FRESH session is already
31
+ * composed. Calm and forward-looking, never the failure banner: the
32
+ * generic transient copy on this code made two distinct causes wear one
33
+ * scary face and mis-attributed incident triage.
34
+ */
35
+ errorHistoryUnavailable: string;
27
36
  /** R3/R4. */
28
37
  toolGroup: (count: number) => string;
29
38
  toolGroupFailures: (count: number) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../src/strings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,WAAW;IAC1B,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAC;IAEhB,6EAA6E;IAC7E,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IAErB,aAAa;IACb,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACrC,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7C,eAAe,EAAE,MAAM,CAAC;IACxB,2EAA2E;IAC3E,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAEvC,UAAU;IACV,cAAc,EAAE,MAAM,CAAC;IAEvB,UAAU;IACV,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAErC,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAC;IAErB,WAAW;IACX,UAAU,EAAE,MAAM,CAAC;IAEnB,UAAU;IACV,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;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9B,KAAK,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAErC,kBAAkB;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IAEnB,kEAAkE;IAClE,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IAEf,6EAA6E;IAC7E,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,yDAAyD;IACzD,kBAAkB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAClD,oBAAoB,EAAE,MAAM,CAAC;IAC7B;;;;;OAKG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/C,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/C,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IAExC,wEAAwE;IACxE,WAAW,EAAE,MAAM,CAAC;IAEpB,uCAAuC;IACvC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAiBD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAWzD;AAED,eAAO,MAAM,kBAAkB,EAAE,WA0EhC,CAAC"}
package/dist/strings.js CHANGED
@@ -35,6 +35,7 @@ export const defaultChatStrings = {
35
35
  errorAuth: "Sign in to continue.",
36
36
  errorQuota: "This agent is over its usage limit.",
37
37
  errorTransient: "Something went wrong on our side — try again.",
38
+ errorHistoryUnavailable: "This conversation belonged to a previous session — starting fresh.",
38
39
  errorInvalid: "The app sent a request the agent couldn't read.",
39
40
  toolGroup: (count) => `Ran ${count} tools`,
40
41
  toolGroupFailures: (count) => (count === 1 ? "1 failed" : `${count} failed`),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guuey/chat",
3
- "version": "0.16.0",
3
+ "version": "0.16.1",
4
4
  "description": "The default end-user transcript UI for guuey agents — the headless view-model (planTranscript), calm/debug presets, the GuueyChatTheme token schema, the ChatStrings i18n seam, and (at ./react) the component kit that renders it: per-category components, <Transcript>, the live + history input assemblers, and stick-to-bottom/windowed/accessible transcript behavior; at ./native, the React Native renderer over the same view-model.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -39,8 +39,8 @@
39
39
  "@silverprotocol/core": "0.5.1",
40
40
  "@silverprotocol/richtext": "0.5.1",
41
41
  "zod": "^4.3.6",
42
- "@guuey/agent-client": "0.16.0",
43
- "@guuey/mcp-apps-host": "0.16.0"
42
+ "@guuey/agent-client": "0.16.1",
43
+ "@guuey/mcp-apps-host": "0.16.1"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "react": ">=18",
package/src/plan.ts CHANGED
@@ -715,6 +715,18 @@ function deriveStatus(inputs: TranscriptInputs, policy: TranscriptPolicy): Statu
715
715
  }
716
716
  }
717
717
 
718
+ /**
719
+ * Built-in per-code voices (guuey#417) — consulted AFTER the policy's own
720
+ * `copyByCode` (host override always wins) and before family copy. These
721
+ * are codes whose family styling fits but whose family COPY lies:
722
+ * THREAD_HISTORY_UNAVAILABLE is not "something went wrong — try again"
723
+ * (nothing is wrong and there is nothing to retry — a fresh session is
724
+ * already composed); the honest notice is the guard's own.
725
+ */
726
+ const CODE_COPY: Record<string, (s: import("./strings.js").ChatStrings) => string> = {
727
+ THREAD_HISTORY_UNAVAILABLE: (s) => s.errorHistoryUnavailable,
728
+ };
729
+
718
730
  const ERROR_FAMILIES: Record<string, "auth" | "quota" | "invalid"> = {
719
731
  UNAUTHORIZED: "auth",
720
732
  AUTH_REQUIRED: "auth",
@@ -978,8 +990,11 @@ export function planTranscript(
978
990
  const perCode = code !== null ? copyByCode[code] : undefined;
979
991
  const verbatimVoice =
980
992
  verbatimCodes === "all" || (code !== null && verbatimCodes.includes(code));
993
+ const builtIn = code !== null ? CODE_COPY[code] : undefined;
981
994
  const copy =
982
- perCode ?? (verbatimVoice && inputs.error.message !== "" ? inputs.error.message : familyCopy);
995
+ perCode ??
996
+ (verbatimVoice && inputs.error.message !== "" ? inputs.error.message : undefined) ??
997
+ (builtIn !== undefined ? builtIn(policy.strings) : familyCopy);
983
998
  items.push({
984
999
  kind: "error",
985
1000
  key: "error",
package/src/strings.ts CHANGED
@@ -25,6 +25,15 @@ export interface ChatStrings {
25
25
  errorQuota: string;
26
26
  errorTransient: string;
27
27
  errorInvalid: string;
28
+ /**
29
+ * R11, code THREAD_HISTORY_UNAVAILABLE (guuey#417): the hydration
30
+ * guard's honest face — the old conversation could not be restored
31
+ * (identity moved / thread gone) and a FRESH session is already
32
+ * composed. Calm and forward-looking, never the failure banner: the
33
+ * generic transient copy on this code made two distinct causes wear one
34
+ * scary face and mis-attributed incident triage.
35
+ */
36
+ errorHistoryUnavailable: string;
28
37
 
29
38
  /** R3/R4. */
30
39
  toolGroup: (count: number) => string;
@@ -166,6 +175,7 @@ export const defaultChatStrings: ChatStrings = {
166
175
  errorAuth: "Sign in to continue.",
167
176
  errorQuota: "This agent is over its usage limit.",
168
177
  errorTransient: "Something went wrong on our side — try again.",
178
+ errorHistoryUnavailable: "This conversation belonged to a previous session — starting fresh.",
169
179
  errorInvalid: "The app sent a request the agent couldn't read.",
170
180
 
171
181
  toolGroup: (count) => `Ran ${count} tools`,