@tanstack/ai-code-mode 0.3.7 → 0.3.9
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/dist/esm/agent-store.js +23 -27
- package/dist/esm/agent-store.js.map +1 -1
- package/dist/esm/bindings/tool-to-binding.js +92 -87
- package/dist/esm/bindings/tool-to-binding.js.map +1 -1
- package/dist/esm/code-wrapper.js +14 -5
- package/dist/esm/code-wrapper.js.map +1 -1
- package/dist/esm/create-code-mode-tool.js +155 -153
- package/dist/esm/create-code-mode-tool.js.map +1 -1
- package/dist/esm/create-code-mode.js +36 -14
- package/dist/esm/create-code-mode.js.map +1 -1
- package/dist/esm/create-discovery-tool.js +63 -55
- package/dist/esm/create-discovery-tool.js.map +1 -1
- package/dist/esm/create-system-prompt.js +43 -24
- package/dist/esm/create-system-prompt.js.map +1 -1
- package/dist/esm/index.js +5 -20
- package/dist/esm/strip-typescript.js +64 -46
- package/dist/esm/strip-typescript.js.map +1 -1
- package/dist/esm/type-generator/json-schema-to-ts.js +82 -92
- package/dist/esm/type-generator/json-schema-to-ts.js.map +1 -1
- package/dist/esm/validate-bindings.js +102 -91
- package/dist/esm/validate-bindings.js.map +1 -1
- package/package.json +5 -5
- package/skills/ai-code-mode/SKILL.md +1 -1
- package/dist/esm/index.js.map +0 -1
|
@@ -1,105 +1,116 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
//#region src/validate-bindings.ts
|
|
2
|
+
/**
|
|
3
|
+
* Single words that on their own signal "this is a credential".
|
|
4
|
+
* Matched after splitting a parameter name into camelCase/snake/kebab words.
|
|
5
|
+
* So `accessToken` → `['access', 'token']` → matches `token`,
|
|
6
|
+
* but `tokenizer` → `['tokenizer']` → does NOT match `token`.
|
|
7
|
+
*/
|
|
8
|
+
var DANGEROUS_WORDS = /* @__PURE__ */ new Set([
|
|
9
|
+
"password",
|
|
10
|
+
"passwd",
|
|
11
|
+
"pwd",
|
|
12
|
+
"passcode",
|
|
13
|
+
"secret",
|
|
14
|
+
"token",
|
|
15
|
+
"credential",
|
|
16
|
+
"credentials",
|
|
17
|
+
"authorization",
|
|
18
|
+
"jwt",
|
|
19
|
+
"bearer"
|
|
13
20
|
]);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Compound patterns matched as substrings of the normalized (lowercased,
|
|
23
|
+
* separator-stripped) parameter name. Catches forms like `openai_api_key`,
|
|
24
|
+
* `x-api-key`, and `webhookSecret`.
|
|
25
|
+
*/
|
|
26
|
+
var COMPOUND_PATTERNS = [
|
|
27
|
+
"apikey",
|
|
28
|
+
"accesskey",
|
|
29
|
+
"authkey",
|
|
30
|
+
"privatekey",
|
|
31
|
+
"clientsecret",
|
|
32
|
+
"webhooksecret"
|
|
21
33
|
];
|
|
22
34
|
function splitIntoWords(name) {
|
|
23
|
-
|
|
35
|
+
return name.replace(/[_\-\s]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").toLowerCase().split(/\s+/).filter(Boolean);
|
|
24
36
|
}
|
|
25
37
|
function looksLikeSecret(name) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return COMPOUND_PATTERNS.some((p) => normalized.includes(p));
|
|
38
|
+
if (splitIntoWords(name).some((w) => DANGEROUS_WORDS.has(w))) return true;
|
|
39
|
+
const normalized = name.replace(/[_\-\s]/g, "").toLowerCase();
|
|
40
|
+
return COMPOUND_PATTERNS.some((p) => normalized.includes(p));
|
|
30
41
|
}
|
|
31
42
|
function resolveRef(ref, root) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
43
|
+
const match = ref.match(/^#\/(\$defs|definitions)\/(.+)$/);
|
|
44
|
+
if (!match) return void 0;
|
|
45
|
+
const bucket = match[1];
|
|
46
|
+
const key = match[2];
|
|
47
|
+
return key === void 0 ? void 0 : root[bucket]?.[key];
|
|
37
48
|
}
|
|
38
49
|
function findSecretParams(schema, root, seen, path, found) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
if (typeof schema.$ref === "string") {
|
|
66
|
-
const target = resolveRef(schema.$ref, root);
|
|
67
|
-
if (target) findSecretParams(target, root, seen, path, found);
|
|
68
|
-
}
|
|
50
|
+
if (!schema || typeof schema !== "object" || seen.has(schema)) return;
|
|
51
|
+
seen.add(schema);
|
|
52
|
+
if (schema.properties && typeof schema.properties === "object") for (const [paramName, sub] of Object.entries(schema.properties)) {
|
|
53
|
+
if (looksLikeSecret(paramName)) found.push({
|
|
54
|
+
path: [...path, paramName],
|
|
55
|
+
name: paramName
|
|
56
|
+
});
|
|
57
|
+
findSecretParams(sub, root, seen, [...path, paramName], found);
|
|
58
|
+
}
|
|
59
|
+
if (Array.isArray(schema.items)) schema.items.forEach((s, i) => findSecretParams(s, root, seen, [...path, `[${i}]`], found));
|
|
60
|
+
else if (schema.items && typeof schema.items === "object") findSecretParams(schema.items, root, seen, [...path, "[]"], found);
|
|
61
|
+
if (schema.additionalProperties && typeof schema.additionalProperties === "object") findSecretParams(schema.additionalProperties, root, seen, path, found);
|
|
62
|
+
for (const key of [
|
|
63
|
+
"anyOf",
|
|
64
|
+
"oneOf",
|
|
65
|
+
"allOf"
|
|
66
|
+
]) {
|
|
67
|
+
const arr = schema[key];
|
|
68
|
+
if (Array.isArray(arr)) arr.forEach((s) => findSecretParams(s, root, seen, path, found));
|
|
69
|
+
}
|
|
70
|
+
if (typeof schema.$ref === "string") {
|
|
71
|
+
const target = resolveRef(schema.$ref, root);
|
|
72
|
+
if (target) findSecretParams(target, root, seen, path, found);
|
|
73
|
+
}
|
|
69
74
|
}
|
|
70
75
|
function buildMessage(toolName, paramPath) {
|
|
71
|
-
|
|
76
|
+
return `[TanStack AI Code Mode] Tool "${toolName}" has parameter "${paramPath.join(".")}" that looks like a secret. Code Mode executes LLM-generated code — any value passed through this parameter is accessible to generated code and could be exfiltrated. Keep secrets in your server-side tool implementation instead of passing them as tool parameters.`;
|
|
72
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Scan tool input schemas for parameter names that look like secrets.
|
|
80
|
+
* Emits a warning (or invokes the configured handler) for each match.
|
|
81
|
+
*
|
|
82
|
+
* Recurses into nested object properties, array items, union branches
|
|
83
|
+
* (anyOf/oneOf/allOf), additionalProperties, and `$ref` targets that
|
|
84
|
+
* resolve within the same schema's `$defs`/`definitions`.
|
|
85
|
+
*
|
|
86
|
+
* Best-effort heuristic, not a security boundary.
|
|
87
|
+
*/
|
|
73
88
|
function warnIfBindingsExposeSecrets(tools, options = {}) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
console.warn(buildMessage(tool.name, entry.path));
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
89
|
+
const { handler = "warn", dedupCache } = options;
|
|
90
|
+
if (handler === "ignore") return;
|
|
91
|
+
for (const tool of tools) {
|
|
92
|
+
const schema = tool.inputSchema;
|
|
93
|
+
if (!schema) continue;
|
|
94
|
+
const found = [];
|
|
95
|
+
findSecretParams(schema, schema, /* @__PURE__ */ new Set(), [], found);
|
|
96
|
+
for (const entry of found) {
|
|
97
|
+
const dedupKey = `${tool.name}::${entry.path.join(".")}`;
|
|
98
|
+
if (dedupCache) {
|
|
99
|
+
if (dedupCache.has(dedupKey)) continue;
|
|
100
|
+
dedupCache.add(dedupKey);
|
|
101
|
+
}
|
|
102
|
+
const info = {
|
|
103
|
+
toolName: tool.name,
|
|
104
|
+
paramName: entry.name,
|
|
105
|
+
paramPath: entry.path
|
|
106
|
+
};
|
|
107
|
+
if (typeof handler === "function") handler(info);
|
|
108
|
+
else if (handler === "throw") throw new Error(buildMessage(tool.name, entry.path));
|
|
109
|
+
else console.warn(buildMessage(tool.name, entry.path));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
101
112
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
//# sourceMappingURL=validate-bindings.js.map
|
|
113
|
+
//#endregion
|
|
114
|
+
export { warnIfBindingsExposeSecrets };
|
|
115
|
+
|
|
116
|
+
//# sourceMappingURL=validate-bindings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-bindings.js","sources":["../../src/validate-bindings.ts"],"sourcesContent":["/**\n * Single words that on their own signal \"this is a credential\".\n * Matched after splitting a parameter name into camelCase/snake/kebab words.\n * So `accessToken` → `['access', 'token']` → matches `token`,\n * but `tokenizer` → `['tokenizer']` → does NOT match `token`.\n */\nconst DANGEROUS_WORDS = new Set<string>([\n 'password',\n 'passwd',\n 'pwd',\n 'passcode',\n 'secret',\n 'token',\n 'credential',\n 'credentials',\n 'authorization',\n 'jwt',\n 'bearer',\n])\n\n/**\n * Compound patterns matched as substrings of the normalized (lowercased,\n * separator-stripped) parameter name. Catches forms like `openai_api_key`,\n * `x-api-key`, and `webhookSecret`.\n */\nconst COMPOUND_PATTERNS = [\n 'apikey',\n 'accesskey',\n 'authkey',\n 'privatekey',\n 'clientsecret',\n 'webhooksecret',\n] as const\n\nexport interface SecretParameterInfo {\n toolName: string\n paramName: string\n paramPath: Array<string>\n}\n\nexport type SecretParameterHandler =\n | 'warn'\n | 'throw'\n | 'ignore'\n | ((info: SecretParameterInfo) => void)\n\ninterface ToolLike {\n name: string\n inputSchema?: Record<string, unknown>\n}\n\ninterface JsonSchemaLike {\n type?: string\n properties?: Record<string, JsonSchemaLike>\n items?: JsonSchemaLike | Array<JsonSchemaLike>\n anyOf?: Array<JsonSchemaLike>\n oneOf?: Array<JsonSchemaLike>\n allOf?: Array<JsonSchemaLike>\n additionalProperties?: boolean | JsonSchemaLike\n $ref?: string\n $defs?: Record<string, JsonSchemaLike>\n definitions?: Record<string, JsonSchemaLike>\n}\n\nfunction splitIntoWords(name: string): Array<string> {\n return name\n .replace(/[_\\-\\s]+/g, ' ')\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .toLowerCase()\n .split(/\\s+/)\n .filter(Boolean)\n}\n\nfunction looksLikeSecret(name: string): boolean {\n const words = splitIntoWords(name)\n if (words.some((w) => DANGEROUS_WORDS.has(w))) return true\n const normalized = name.replace(/[_\\-\\s]/g, '').toLowerCase()\n return COMPOUND_PATTERNS.some((p) => normalized.includes(p))\n}\n\nfunction resolveRef(\n ref: string,\n root: JsonSchemaLike,\n): JsonSchemaLike | undefined {\n const match = ref.match(/^#\\/(\\$defs|definitions)\\/(.+)$/)\n if (!match) return undefined\n const bucket = match[1] as '$defs' | 'definitions'\n const key = match[2]\n return key === undefined ? undefined : root[bucket]?.[key]\n}\n\nfunction findSecretParams(\n schema: JsonSchemaLike | undefined,\n root: JsonSchemaLike,\n seen: Set<object>,\n path: Array<string>,\n found: Array<{ path: Array<string>; name: string }>,\n): void {\n if (!schema || typeof schema !== 'object' || seen.has(schema)) return\n seen.add(schema)\n\n if (schema.properties && typeof schema.properties === 'object') {\n for (const [paramName, sub] of Object.entries(schema.properties)) {\n if (looksLikeSecret(paramName)) {\n found.push({ path: [...path, paramName], name: paramName })\n }\n findSecretParams(sub, root, seen, [...path, paramName], found)\n }\n }\n\n if (Array.isArray(schema.items)) {\n schema.items.forEach((s, i) =>\n findSecretParams(s, root, seen, [...path, `[${i}]`], found),\n )\n } else if (schema.items && typeof schema.items === 'object') {\n findSecretParams(schema.items, root, seen, [...path, '[]'], found)\n }\n\n if (\n schema.additionalProperties &&\n typeof schema.additionalProperties === 'object'\n ) {\n findSecretParams(schema.additionalProperties, root, seen, path, found)\n }\n\n for (const key of ['anyOf', 'oneOf', 'allOf'] as const) {\n const arr = schema[key]\n if (Array.isArray(arr)) {\n arr.forEach((s) => findSecretParams(s, root, seen, path, found))\n }\n }\n\n if (typeof schema.$ref === 'string') {\n const target = resolveRef(schema.$ref, root)\n if (target) findSecretParams(target, root, seen, path, found)\n }\n}\n\nfunction buildMessage(toolName: string, paramPath: Array<string>): string {\n return (\n `[TanStack AI Code Mode] Tool \"${toolName}\" has parameter \"${paramPath.join('.')}\" ` +\n `that looks like a secret. Code Mode executes LLM-generated code — any ` +\n `value passed through this parameter is accessible to generated code and ` +\n `could be exfiltrated. Keep secrets in your server-side tool implementation ` +\n `instead of passing them as tool parameters.`\n )\n}\n\n/**\n * Scan tool input schemas for parameter names that look like secrets.\n * Emits a warning (or invokes the configured handler) for each match.\n *\n * Recurses into nested object properties, array items, union branches\n * (anyOf/oneOf/allOf), additionalProperties, and `$ref` targets that\n * resolve within the same schema's `$defs`/`definitions`.\n *\n * Best-effort heuristic, not a security boundary.\n */\nexport function warnIfBindingsExposeSecrets(\n tools: Array<ToolLike>,\n options: {\n handler?: SecretParameterHandler\n dedupCache?: Set<string>\n } = {},\n): void {\n const { handler = 'warn', dedupCache } = options\n if (handler === 'ignore') return\n\n for (const tool of tools) {\n const schema = tool.inputSchema as JsonSchemaLike | undefined\n if (!schema) continue\n\n const found: Array<{ path: Array<string>; name: string }> = []\n findSecretParams(schema, schema, new Set(), [], found)\n\n for (const entry of found) {\n const dedupKey = `${tool.name}::${entry.path.join('.')}`\n if (dedupCache) {\n if (dedupCache.has(dedupKey)) continue\n dedupCache.add(dedupKey)\n }\n\n const info: SecretParameterInfo = {\n toolName: tool.name,\n paramName: entry.name,\n paramPath: entry.path,\n }\n\n if (typeof handler === 'function') {\n handler(info)\n } else if (handler === 'throw') {\n throw new Error(buildMessage(tool.name, entry.path))\n } else {\n console.warn(buildMessage(tool.name, entry.path))\n }\n }\n }\n}\n"],"
|
|
1
|
+
{"version":3,"file":"validate-bindings.js","names":[],"sources":["../../src/validate-bindings.ts"],"sourcesContent":["/**\n * Single words that on their own signal \"this is a credential\".\n * Matched after splitting a parameter name into camelCase/snake/kebab words.\n * So `accessToken` → `['access', 'token']` → matches `token`,\n * but `tokenizer` → `['tokenizer']` → does NOT match `token`.\n */\nconst DANGEROUS_WORDS = new Set<string>([\n 'password',\n 'passwd',\n 'pwd',\n 'passcode',\n 'secret',\n 'token',\n 'credential',\n 'credentials',\n 'authorization',\n 'jwt',\n 'bearer',\n])\n\n/**\n * Compound patterns matched as substrings of the normalized (lowercased,\n * separator-stripped) parameter name. Catches forms like `openai_api_key`,\n * `x-api-key`, and `webhookSecret`.\n */\nconst COMPOUND_PATTERNS = [\n 'apikey',\n 'accesskey',\n 'authkey',\n 'privatekey',\n 'clientsecret',\n 'webhooksecret',\n] as const\n\nexport interface SecretParameterInfo {\n toolName: string\n paramName: string\n paramPath: Array<string>\n}\n\nexport type SecretParameterHandler =\n | 'warn'\n | 'throw'\n | 'ignore'\n | ((info: SecretParameterInfo) => void)\n\ninterface ToolLike {\n name: string\n inputSchema?: Record<string, unknown>\n}\n\ninterface JsonSchemaLike {\n type?: string\n properties?: Record<string, JsonSchemaLike>\n items?: JsonSchemaLike | Array<JsonSchemaLike>\n anyOf?: Array<JsonSchemaLike>\n oneOf?: Array<JsonSchemaLike>\n allOf?: Array<JsonSchemaLike>\n additionalProperties?: boolean | JsonSchemaLike\n $ref?: string\n $defs?: Record<string, JsonSchemaLike>\n definitions?: Record<string, JsonSchemaLike>\n}\n\nfunction splitIntoWords(name: string): Array<string> {\n return name\n .replace(/[_\\-\\s]+/g, ' ')\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .toLowerCase()\n .split(/\\s+/)\n .filter(Boolean)\n}\n\nfunction looksLikeSecret(name: string): boolean {\n const words = splitIntoWords(name)\n if (words.some((w) => DANGEROUS_WORDS.has(w))) return true\n const normalized = name.replace(/[_\\-\\s]/g, '').toLowerCase()\n return COMPOUND_PATTERNS.some((p) => normalized.includes(p))\n}\n\nfunction resolveRef(\n ref: string,\n root: JsonSchemaLike,\n): JsonSchemaLike | undefined {\n const match = ref.match(/^#\\/(\\$defs|definitions)\\/(.+)$/)\n if (!match) return undefined\n const bucket = match[1] as '$defs' | 'definitions'\n const key = match[2]\n return key === undefined ? undefined : root[bucket]?.[key]\n}\n\nfunction findSecretParams(\n schema: JsonSchemaLike | undefined,\n root: JsonSchemaLike,\n seen: Set<object>,\n path: Array<string>,\n found: Array<{ path: Array<string>; name: string }>,\n): void {\n if (!schema || typeof schema !== 'object' || seen.has(schema)) return\n seen.add(schema)\n\n if (schema.properties && typeof schema.properties === 'object') {\n for (const [paramName, sub] of Object.entries(schema.properties)) {\n if (looksLikeSecret(paramName)) {\n found.push({ path: [...path, paramName], name: paramName })\n }\n findSecretParams(sub, root, seen, [...path, paramName], found)\n }\n }\n\n if (Array.isArray(schema.items)) {\n schema.items.forEach((s, i) =>\n findSecretParams(s, root, seen, [...path, `[${i}]`], found),\n )\n } else if (schema.items && typeof schema.items === 'object') {\n findSecretParams(schema.items, root, seen, [...path, '[]'], found)\n }\n\n if (\n schema.additionalProperties &&\n typeof schema.additionalProperties === 'object'\n ) {\n findSecretParams(schema.additionalProperties, root, seen, path, found)\n }\n\n for (const key of ['anyOf', 'oneOf', 'allOf'] as const) {\n const arr = schema[key]\n if (Array.isArray(arr)) {\n arr.forEach((s) => findSecretParams(s, root, seen, path, found))\n }\n }\n\n if (typeof schema.$ref === 'string') {\n const target = resolveRef(schema.$ref, root)\n if (target) findSecretParams(target, root, seen, path, found)\n }\n}\n\nfunction buildMessage(toolName: string, paramPath: Array<string>): string {\n return (\n `[TanStack AI Code Mode] Tool \"${toolName}\" has parameter \"${paramPath.join('.')}\" ` +\n `that looks like a secret. Code Mode executes LLM-generated code — any ` +\n `value passed through this parameter is accessible to generated code and ` +\n `could be exfiltrated. Keep secrets in your server-side tool implementation ` +\n `instead of passing them as tool parameters.`\n )\n}\n\n/**\n * Scan tool input schemas for parameter names that look like secrets.\n * Emits a warning (or invokes the configured handler) for each match.\n *\n * Recurses into nested object properties, array items, union branches\n * (anyOf/oneOf/allOf), additionalProperties, and `$ref` targets that\n * resolve within the same schema's `$defs`/`definitions`.\n *\n * Best-effort heuristic, not a security boundary.\n */\nexport function warnIfBindingsExposeSecrets(\n tools: Array<ToolLike>,\n options: {\n handler?: SecretParameterHandler\n dedupCache?: Set<string>\n } = {},\n): void {\n const { handler = 'warn', dedupCache } = options\n if (handler === 'ignore') return\n\n for (const tool of tools) {\n const schema = tool.inputSchema as JsonSchemaLike | undefined\n if (!schema) continue\n\n const found: Array<{ path: Array<string>; name: string }> = []\n findSecretParams(schema, schema, new Set(), [], found)\n\n for (const entry of found) {\n const dedupKey = `${tool.name}::${entry.path.join('.')}`\n if (dedupCache) {\n if (dedupCache.has(dedupKey)) continue\n dedupCache.add(dedupKey)\n }\n\n const info: SecretParameterInfo = {\n toolName: tool.name,\n paramName: entry.name,\n paramPath: entry.path,\n }\n\n if (typeof handler === 'function') {\n handler(info)\n } else if (handler === 'throw') {\n throw new Error(buildMessage(tool.name, entry.path))\n } else {\n console.warn(buildMessage(tool.name, entry.path))\n }\n }\n }\n}\n"],"mappings":";;;;;;;AAMA,IAAM,kCAAkB,IAAI,IAAY;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;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;GACnB;GAEA,IAAI,OAAO,YAAY,YACrB,QAAQ,IAAI;QACP,IAAI,YAAY,SACrB,MAAM,IAAI,MAAM,aAAa,KAAK,MAAM,MAAM,IAAI,CAAC;QAEnD,QAAQ,KAAK,aAAa,KAAK,MAAM,MAAM,IAAI,CAAC;EAEpD;CACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/ai-code-mode",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9",
|
|
4
4
|
"description": "Secure TypeScript Code Mode for TanStack AI agents to execute sandboxed tool orchestration programs.",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -54,19 +54,19 @@
|
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"zod": "^3.0.0 || ^4.0.0",
|
|
57
|
-
"@tanstack/ai": "0.
|
|
57
|
+
"@tanstack/ai": "0.43.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@vitest/coverage-v8": "4.0.14",
|
|
61
61
|
"zod": "^4.2.0",
|
|
62
|
-
"@tanstack/ai": "0.
|
|
62
|
+
"@tanstack/ai": "0.43.0"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"build": "vite build",
|
|
66
66
|
"clean": "premove ./build ./dist",
|
|
67
|
-
"lint:fix": "
|
|
67
|
+
"lint:fix": "oxlint src --type-aware --fix",
|
|
68
68
|
"test:build": "publint --strict",
|
|
69
|
-
"test:
|
|
69
|
+
"test:oxlint": "oxlint src --type-aware",
|
|
70
70
|
"test:lib": "vitest",
|
|
71
71
|
"test:lib:dev": "pnpm test:lib --watch",
|
|
72
72
|
"test:types": "tsc"
|
|
@@ -9,7 +9,7 @@ description: >
|
|
|
9
9
|
execution progress via code_mode:* custom events in useChat.
|
|
10
10
|
type: core
|
|
11
11
|
library: tanstack-ai
|
|
12
|
-
library_version: '0.
|
|
12
|
+
library_version: '0.3.8'
|
|
13
13
|
sources:
|
|
14
14
|
- 'TanStack/ai:docs/code-mode/code-mode.md'
|
|
15
15
|
- 'TanStack/ai:docs/code-mode/code-mode-isolates.md'
|
package/dist/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|