cliskill 1.0.2 → 1.0.4

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,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "../chunk-GCXQJ2SV.js";
4
+ } from "../chunk-UJMUL64T.js";
5
5
  import "../chunk-AJENHWD3.js";
6
6
  export {
7
7
  runCli
@@ -1189,12 +1189,22 @@ function zodToJsonSchema(schema) {
1189
1189
  return result2;
1190
1190
  }
1191
1191
  if (schema instanceof z2.ZodTuple) {
1192
- const items = schema.items.map((item) => zodToJsonSchema(item));
1192
+ const itemSchemas = schema.items.map((item) => zodToJsonSchema(item));
1193
+ const allTypes = itemSchemas.map((s) => s.type).filter(Boolean);
1194
+ const uniqueTypes = [...new Set(allTypes)];
1195
+ let mergedItems;
1196
+ if (uniqueTypes.length === 1) {
1197
+ mergedItems = { type: uniqueTypes[0] };
1198
+ } else if (uniqueTypes.length > 1) {
1199
+ mergedItems = { anyOf: uniqueTypes.map((t) => ({ type: t })) };
1200
+ } else {
1201
+ mergedItems = {};
1202
+ }
1193
1203
  const result2 = {
1194
1204
  type: "array",
1195
- items,
1196
- minItems: items.length,
1197
- maxItems: items.length
1205
+ items: mergedItems,
1206
+ minItems: itemSchemas.length,
1207
+ maxItems: itemSchemas.length
1198
1208
  };
1199
1209
  if (schema.description) result2.description = schema.description;
1200
1210
  return result2;
@@ -5607,40 +5617,36 @@ ${result.summary}` }]
5607
5617
  break;
5608
5618
  }
5609
5619
  if (parser.stopReason === "max_tokens") {
5610
- const truncatedCalls = extractToolCalls(parser.assistantContent);
5611
- const hasEmptyInput = truncatedCalls.some((tc) => Object.keys(tc.input).length === 0);
5612
- if (hasEmptyInput || truncatedCalls.length === 0) {
5613
- if (maxOutputTokensRecoveryCount === 0 && maxOutputTokensOverride === void 0) {
5614
- maxOutputTokensOverride = ESCALATED_MAX_TOKENS;
5615
- maxOutputTokensRecoveryCount++;
5616
- state.messages.pop();
5617
- yield { type: "assistant_text", text: " [escalating token limit...]" };
5618
- continue;
5619
- }
5620
- if (maxOutputTokensRecoveryCount < MAX_OUTPUT_TOKENS_RECOVERY_LIMIT) {
5621
- const textOnly = parser.assistantContent.filter((b) => b.type === "text");
5622
- state.messages[state.messages.length - 1] = {
5623
- role: "assistant",
5624
- content: textOnly.length > 0 ? textOnly : [{ type: "text", text: "[Response truncated \u2014 output token limit]" }]
5625
- };
5626
- state.messages.push({
5627
- role: "user",
5628
- content: [{
5629
- type: "text",
5630
- text: "Output token limit hit. Resume directly \u2014 no apology, no recap. Pick up mid-thought if that is where the cut happened. Break remaining work into smaller pieces."
5631
- }]
5632
- });
5633
- maxOutputTokensRecoveryCount++;
5634
- maxOutputTokensOverride = void 0;
5635
- yield { type: "assistant_text", text: " [truncated \u2014 requesting continuation...]" };
5636
- continue;
5637
- }
5638
- yield {
5639
- type: "error",
5640
- error: new Error("Output token limit reached after multiple recovery attempts. Consider splitting your request into smaller tasks.")
5620
+ if (maxOutputTokensRecoveryCount === 0 && maxOutputTokensOverride === void 0) {
5621
+ maxOutputTokensOverride = ESCALATED_MAX_TOKENS;
5622
+ maxOutputTokensRecoveryCount++;
5623
+ state.messages.pop();
5624
+ yield { type: "assistant_text", text: " [escalating token limit...]" };
5625
+ continue;
5626
+ }
5627
+ if (maxOutputTokensRecoveryCount < MAX_OUTPUT_TOKENS_RECOVERY_LIMIT) {
5628
+ const textOnly = parser.assistantContent.filter((b) => b.type === "text");
5629
+ state.messages[state.messages.length - 1] = {
5630
+ role: "assistant",
5631
+ content: textOnly.length > 0 ? textOnly : [{ type: "text", text: "[Response truncated \u2014 output token limit]" }]
5641
5632
  };
5642
- break;
5633
+ state.messages.push({
5634
+ role: "user",
5635
+ content: [{
5636
+ type: "text",
5637
+ text: "Output token limit hit. Resume directly \u2014 no apology, no recap. Pick up mid-thought if that is where the cut happened. IMPORTANT: Break remaining work into smaller pieces \u2014 write files in multiple smaller writes instead of one huge write."
5638
+ }]
5639
+ });
5640
+ maxOutputTokensRecoveryCount++;
5641
+ maxOutputTokensOverride = void 0;
5642
+ yield { type: "assistant_text", text: " [truncated \u2014 requesting continuation...]" };
5643
+ continue;
5643
5644
  }
5645
+ yield {
5646
+ type: "error",
5647
+ error: new Error("Output token limit reached after multiple recovery attempts. Consider splitting your request into smaller tasks.")
5648
+ };
5649
+ break;
5644
5650
  } else {
5645
5651
  maxOutputTokensRecoveryCount = 0;
5646
5652
  maxOutputTokensOverride = void 0;
@@ -10034,4 +10040,4 @@ export {
10034
10040
  MessageList,
10035
10041
  runCli
10036
10042
  };
10037
- //# sourceMappingURL=chunk-GCXQJ2SV.js.map
10043
+ //# sourceMappingURL=chunk-UJMUL64T.js.map