flavor-code 1.4.0-beta.8 → 1.4.0-beta.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.
@@ -19,7 +19,7 @@ import {
19
19
  thinkingWindow,
20
20
  transcriptReducer,
21
21
  withTimeout
22
- } from "./chunk-LLC7WBXP.js";
22
+ } from "./chunk-CWCYXOH6.js";
23
23
  import "./chunk-N5MXHJKD.js";
24
24
  import "./chunk-EXOSMO57.js";
25
25
  import {
@@ -66,7 +66,7 @@ function normalizeProviderError(error) {
66
66
  code = "authentication";
67
67
  } else if (status === 429 || /rate.?limit|overloaded/.test(searchable)) {
68
68
  code = "rate_limit";
69
- } else if (/context|too many tokens|prompt.*long/.test(searchable)) {
69
+ } else if (/context[_\s-]?(?:length|window|overflow)(?:[_\s-]?(?:exceeded|limit))?/.test(searchable) || /maximum context length|too many tokens|prompt.*(?:too )?long/.test(searchable)) {
70
70
  code = "context_overflow";
71
71
  } else if (status === 404 || /model.*not.?found|not.?found.*model/.test(searchable)) {
72
72
  code = "model_not_found";
@@ -8811,12 +8811,13 @@ function ensureStrictSchema(schema) {
8811
8811
  ]));
8812
8812
  }
8813
8813
  }
8814
- if (schema.type !== "object" || typeof schema.properties !== "object" || schema.properties === null) {
8814
+ if (schema.type !== "object") {
8815
8815
  return output;
8816
8816
  }
8817
+ const sourceProperties = typeof schema.properties === "object" && schema.properties !== null && !Array.isArray(schema.properties) ? schema.properties : {};
8817
8818
  const requiredSet = new Set(Array.isArray(schema.required) ? schema.required : []);
8818
8819
  const properties = {};
8819
- for (const [key, value] of Object.entries(schema.properties)) {
8820
+ for (const [key, value] of Object.entries(sourceProperties)) {
8820
8821
  const child = typeof value === "object" && value !== null ? ensureStrictSchema(value) : value;
8821
8822
  if (requiredSet.has(key) || jsonSchemaAllowsNull(child)) properties[key] = child;
8822
8823
  else properties[key] = { anyOf: [child, { type: "null" }] };
@@ -19982,6 +19983,15 @@ var RegisterManagedToolInputSchema = z31.object({
19982
19983
  "Agent roles allowed to call the generated tool; omit to allow both"
19983
19984
  )
19984
19985
  }).strict();
19986
+ var RegisterManagedToolModelInputSchema = (() => {
19987
+ const schema = jsonSchemaFromZod(RegisterManagedToolInputSchema);
19988
+ const properties = schema.properties;
19989
+ const inputSchema = { ...properties.inputSchema };
19990
+ delete inputSchema.propertyNames;
19991
+ delete inputSchema.patternProperties;
19992
+ inputSchema.additionalProperties = true;
19993
+ return { ...schema, properties: { ...properties, inputSchema } };
19994
+ })();
19985
19995
  var RemoveManagedToolInputSchema = z31.object({
19986
19996
  name: z31.string().regex(TOOL_NAME).describe("Managed tool name to remove"),
19987
19997
  scope: z31.enum(["project", "global"]).optional().describe("Required only when the same name exists in both scopes")
@@ -20127,6 +20137,8 @@ function createManagedToolManagementTools(options) {
20127
20137
  name: "RegisterTool",
20128
20138
  description: "Create a durable custom tool from JSON Schema and async JavaScript, then expose it immediately",
20129
20139
  inputSchema: RegisterManagedToolInputSchema,
20140
+ modelInputSchema: RegisterManagedToolModelInputSchema,
20141
+ modelStrict: false,
20130
20142
  agents: mainOnly,
20131
20143
  paths: (rawInput) => {
20132
20144
  const parsed = RegisterManagedToolInputSchema.safeParse(rawInput);
@@ -4,7 +4,7 @@ import {
4
4
  message,
5
5
  redactErrorText,
6
6
  redactSecrets
7
- } from "./chunk-LLC7WBXP.js";
7
+ } from "./chunk-CWCYXOH6.js";
8
8
 
9
9
  // src/rpc/server.ts
10
10
  import { createInterface } from "readline";
package/dist/cli-main.js CHANGED
@@ -3,7 +3,7 @@ import { createRequire } from "node:module"; const require = createRequire(impor
3
3
  import {
4
4
  FlavorRpcServer,
5
5
  TraceRecorder
6
- } from "./chunk-EUKT7HEU.js";
6
+ } from "./chunk-D4OD67V6.js";
7
7
  import {
8
8
  staticTaskLines
9
9
  } from "./chunk-RAYH6K2H.js";
@@ -29,7 +29,7 @@ import {
29
29
  redactErrorText,
30
30
  runDoctor,
31
31
  runPalBroker
32
- } from "./chunk-LLC7WBXP.js";
32
+ } from "./chunk-CWCYXOH6.js";
33
33
  import {
34
34
  MEMORY_RESTART_EXIT_CODE
35
35
  } from "./chunk-N5MXHJKD.js";
@@ -921,7 +921,7 @@ async function runInteractiveCli(props) {
921
921
  const [{ render, AlternateScreen }, { createElement }, { App }] = await Promise.all([
922
922
  import("./claude-ink-6EZHF64C.js"),
923
923
  import("react"),
924
- import("./app-KSUBHHLR.js")
924
+ import("./app-XEW4ES4R.js")
925
925
  ]);
926
926
  const instance = await render(createElement(
927
927
  AlternateScreen,
@@ -4267,7 +4267,7 @@ function normalizeProviderError(error) {
4267
4267
  code = "authentication";
4268
4268
  } else if (status === 429 || /rate.?limit|overloaded/.test(searchable)) {
4269
4269
  code = "rate_limit";
4270
- } else if (/context|too many tokens|prompt.*long/.test(searchable)) {
4270
+ } else if (/context[_\s-]?(?:length|window|overflow)(?:[_\s-]?(?:exceeded|limit))?/.test(searchable) || /maximum context length|too many tokens|prompt.*(?:too )?long/.test(searchable)) {
4271
4271
  code = "context_overflow";
4272
4272
  } else if (status === 404 || /model.*not.?found|not.?found.*model/.test(searchable)) {
4273
4273
  code = "model_not_found";
@@ -6564,12 +6564,13 @@ function ensureStrictSchema(schema) {
6564
6564
  ]));
6565
6565
  }
6566
6566
  }
6567
- if (schema.type !== "object" || typeof schema.properties !== "object" || schema.properties === null) {
6567
+ if (schema.type !== "object") {
6568
6568
  return output;
6569
6569
  }
6570
+ const sourceProperties = typeof schema.properties === "object" && schema.properties !== null && !Array.isArray(schema.properties) ? schema.properties : {};
6570
6571
  const requiredSet = new Set(Array.isArray(schema.required) ? schema.required : []);
6571
6572
  const properties = {};
6572
- for (const [key, value] of Object.entries(schema.properties)) {
6573
+ for (const [key, value] of Object.entries(sourceProperties)) {
6573
6574
  const child = typeof value === "object" && value !== null ? ensureStrictSchema(value) : value;
6574
6575
  if (requiredSet.has(key) || jsonSchemaAllowsNull(child)) properties[key] = child;
6575
6576
  else properties[key] = { anyOf: [child, { type: "null" }] };
@@ -21467,6 +21468,15 @@ var RegisterManagedToolInputSchema = z37.object({
21467
21468
  "Agent roles allowed to call the generated tool; omit to allow both"
21468
21469
  )
21469
21470
  }).strict();
21471
+ var RegisterManagedToolModelInputSchema = (() => {
21472
+ const schema = jsonSchemaFromZod(RegisterManagedToolInputSchema);
21473
+ const properties = schema.properties;
21474
+ const inputSchema = { ...properties.inputSchema };
21475
+ delete inputSchema.propertyNames;
21476
+ delete inputSchema.patternProperties;
21477
+ inputSchema.additionalProperties = true;
21478
+ return { ...schema, properties: { ...properties, inputSchema } };
21479
+ })();
21470
21480
  var RemoveManagedToolInputSchema = z37.object({
21471
21481
  name: z37.string().regex(TOOL_NAME).describe("Managed tool name to remove"),
21472
21482
  scope: z37.enum(["project", "global"]).optional().describe("Required only when the same name exists in both scopes")
@@ -21612,6 +21622,8 @@ function createManagedToolManagementTools(options) {
21612
21622
  name: "RegisterTool",
21613
21623
  description: "Create a durable custom tool from JSON Schema and async JavaScript, then expose it immediately",
21614
21624
  inputSchema: RegisterManagedToolInputSchema,
21625
+ modelInputSchema: RegisterManagedToolModelInputSchema,
21626
+ modelStrict: false,
21615
21627
  agents: mainOnly,
21616
21628
  paths: (rawInput) => {
21617
21629
  const parsed = RegisterManagedToolInputSchema.safeParse(rawInput);
package/dist/sdk/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  FlavorRpcServer,
5
5
  TraceRecordSchema,
6
6
  TraceRecorder
7
- } from "../chunk-EUKT7HEU.js";
7
+ } from "../chunk-D4OD67V6.js";
8
8
  import {
9
9
  AgentMessageQueue,
10
10
  DockerExecutionEnvironment,
@@ -13,7 +13,7 @@ import {
13
13
  WorkspaceCheckpointStore,
14
14
  buildDockerInvocation,
15
15
  createProductionRuntime
16
- } from "../chunk-LLC7WBXP.js";
16
+ } from "../chunk-CWCYXOH6.js";
17
17
  import "../chunk-N5MXHJKD.js";
18
18
  import "../chunk-EXOSMO57.js";
19
19
  import "../chunk-ZJCAQXA7.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flavor-code",
3
- "version": "1.4.0-beta.8",
3
+ "version": "1.4.0-beta.9",
4
4
  "author": "YachuanWzh",
5
5
  "type": "module",
6
6
  "publishConfig": {