@cline/shared 0.0.62 → 0.0.64-nightly.1784258125

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.
@@ -119,6 +119,14 @@ export interface GatewayStreamRequest {
119
119
  tools?: readonly AgentToolDefinition[];
120
120
  temperature?: number;
121
121
  maxTokens?: number;
122
+ /**
123
+ * Set by the gateway when `maxTokens` was synthesized from gateway/model
124
+ * defaults rather than derived from an explicit caller cap. Providers can
125
+ * use this to avoid forwarding synthesized caps to backends that reject
126
+ * them, while still honoring explicit caps from any caller — including
127
+ * ones that reach the provider without going through the gateway.
128
+ */
129
+ defaultedMaxTokens?: boolean;
122
130
  metadata?: Record<string, unknown>;
123
131
  reasoning?: {
124
132
  enabled?: boolean;
package/dist/node.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { readFile } from "node:fs/promises";
3
+ type ReadFileSyncPath = Parameters<typeof readFileSync>[0];
4
+ type ReadFilePath = Parameters<typeof readFile>[0];
5
+ /** Read a UTF-8 text file and remove its optional leading byte order mark. */
6
+ export declare function readFileSyncStrippingUtf8Bom(path: ReadFileSyncPath): string;
7
+ /** Read a UTF-8 text file and remove its optional leading byte order mark. */
8
+ export declare function readFileStrippingUtf8Bom(path: ReadFilePath): Promise<string>;
9
+ export {};
package/dist/node.js ADDED
@@ -0,0 +1 @@
1
+ var D=Object.defineProperty;var G=(j)=>j;function H(j,q){this[j]=G.bind(null,q)}var P=(j,q)=>{for(var z in q)D(j,z,{get:q[z],enumerable:!0,configurable:!0,set:H.bind(q,z)})};import{readFileSync as J}from"node:fs";import{readFile as K}from"node:fs/promises";function V(j){return j.toLowerCase().replace(/[^\w.-]+/g,"_")}function X(j){let q=j?.trim();return q?q:void 0}function I(j,q){if(j.length<=q)return j;return`${j.slice(0,q-1)}…`}function Y(j,q="/",z=100){if(!j||j.length<=z)return j||"";let C=j.split(q)?.shift()?.trim()?.slice(0,z-1);return C?`${C}…`:I(j,z)}function Z(j){if(j.length<=8)return"****";return`${j.slice(0,4)}...${j.slice(-4)}`}function A(j){return j.charCodeAt(0)===65279?j.slice(1):j}function W(j){return A(J(j,"utf8"))}async function M(j){return A(await K(j,"utf8"))}export{W as readFileSyncStrippingUtf8Bom,M as readFileStrippingUtf8Bom};
@@ -3,3 +3,19 @@ export declare function trimNonEmpty(value: string | null | undefined): string |
3
3
  export declare function truncateStr(str: string, maxLen: number): string;
4
4
  export declare function truncateSplit(str?: string, splitBy?: string, maxLen?: number): string;
5
5
  export declare function maskSecret(value: string): string;
6
+ /**
7
+ * Strip a leading UTF-8 byte order mark (BOM, U+FEFF) from decoded text.
8
+ *
9
+ * Text editors on Windows (e.g. Notepad's "UTF-8" encoding option) prepend this mark to
10
+ * signal the encoding, but `fs.readFileSync(path, "utf8")` does not strip it, so it survives
11
+ * into the decoded string as a leading `\uFEFF` character. Frontmatter parsers anchor on
12
+ * `^---` and silently fail to match when that character is present, hiding the file's
13
+ * name/description (see cline/cline#12151).
14
+ *
15
+ * We only need to check for this one mark: a BOM disambiguates byte order for multi-byte
16
+ * code units (UTF-16, UTF-32), but UTF-8 is a byte-oriented encoding with no byte-order
17
+ * ambiguity to resolve, so it has exactly one BOM encoding (`EF BB BF`, i.e. U+FEFF) rather
18
+ * than a family of them. Every caller of this helper already reads its input as `utf8`, so a
19
+ * file actually encoded as UTF-16/32 would be mis-decoded well before reaching here.
20
+ */
21
+ export declare function stripUtf8Bom(text: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cline/shared",
3
- "version": "0.0.62",
3
+ "version": "0.0.64-nightly.1784258125",
4
4
  "description": "Shared utilities, types, and schemas for Cline packages",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,6 +33,10 @@
33
33
  "types": "./dist/db/index.d.ts",
34
34
  "import": "./dist/db/index.js"
35
35
  },
36
+ "./node": {
37
+ "types": "./dist/node.d.ts",
38
+ "import": "./dist/node.js"
39
+ },
36
40
  "./automation": {
37
41
  "types": "./dist/automation/index.d.ts",
38
42
  "import": "./dist/automation/index.js"