@protolabsai/proto 0.49.0 → 0.50.0

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.
Files changed (2) hide show
  1. package/cli.js +112 -5
  2. package/package.json +2 -2
package/cli.js CHANGED
@@ -168684,7 +168684,7 @@ __export(geminiContentGenerator_exports, {
168684
168684
  createGeminiContentGenerator: () => createGeminiContentGenerator
168685
168685
  });
168686
168686
  function createGeminiContentGenerator(config2, gcConfig) {
168687
- const version2 = "0.49.0";
168687
+ const version2 = "0.50.0";
168688
168688
  const userAgent2 = config2.userAgent || `QwenCode/${version2} (${process.platform}; ${process.arch})`;
168689
168689
  const baseHeaders = {
168690
168690
  "User-Agent": userAgent2
@@ -275245,6 +275245,7 @@ var init_config3 = __esm({
275245
275245
  ideMode;
275246
275246
  maxSessionTurns;
275247
275247
  maxToolCalls;
275248
+ maxWallTimeSeconds;
275248
275249
  sessionTokenLimit;
275249
275250
  listExtensions;
275250
275251
  overrideExtensions;
@@ -275358,6 +275359,7 @@ var init_config3 = __esm({
275358
275359
  this.bugCommand = params.bugCommand;
275359
275360
  this.maxSessionTurns = params.maxSessionTurns ?? -1;
275360
275361
  this.maxToolCalls = params.maxToolCalls ?? -1;
275362
+ this.maxWallTimeSeconds = params.maxWallTimeSeconds ?? -1;
275361
275363
  this.sessionTokenLimit = params.sessionTokenLimit ?? -1;
275362
275364
  this.experimentalZedIntegration = params.experimentalZedIntegration ?? false;
275363
275365
  this.cronEnabled = params.cronEnabled ?? false;
@@ -275789,6 +275791,9 @@ var init_config3 = __esm({
275789
275791
  getMaxToolCalls() {
275790
275792
  return this.maxToolCalls;
275791
275793
  }
275794
+ getMaxWallTimeSeconds() {
275795
+ return this.maxWallTimeSeconds;
275796
+ }
275792
275797
  getSessionTokenLimit() {
275793
275798
  return this.sessionTokenLimit;
275794
275799
  }
@@ -405867,6 +405872,15 @@ var SETTINGS_SCHEMA = {
405867
405872
  description: "Maximum number of tool calls for a headless run before aborting (exit code 55). -1 means unlimited.",
405868
405873
  showInDialog: false
405869
405874
  },
405875
+ maxWallTimeSeconds: {
405876
+ type: "number",
405877
+ label: "Max Wall Time (seconds)",
405878
+ category: "Model",
405879
+ requiresRestart: false,
405880
+ default: -1,
405881
+ description: "Wall-clock budget in seconds for a headless run before aborting (exit code 55). -1 means unlimited.",
405882
+ showInDialog: false
405883
+ },
405870
405884
  chatCompression: {
405871
405885
  type: "object",
405872
405886
  label: "Chat Compression",
@@ -415411,6 +415425,7 @@ async function handleQwenAuth(command2, options2) {
415411
415425
  sessionId: void 0,
415412
415426
  maxSessionTurns: void 0,
415413
415427
  maxToolCalls: void 0,
415428
+ maxWallTime: void 0,
415414
415429
  coreTools: void 0,
415415
415430
  excludeTools: void 0,
415416
415431
  disabledSlashCommands: void 0,
@@ -416561,7 +416576,7 @@ __name(getPackageJson, "getPackageJson");
416561
416576
  // packages/cli/src/utils/version.ts
416562
416577
  async function getCliVersion() {
416563
416578
  const pkgJson = await getPackageJson();
416564
- return "0.49.0";
416579
+ return "0.50.0";
416565
416580
  }
416566
416581
  __name(getCliVersion, "getCliVersion");
416567
416582
 
@@ -420674,6 +420689,81 @@ init_esbuild_shims();
420674
420689
  var SECOND = 1e3;
420675
420690
  var MAX_TIMEOUT_MS = 2147483647;
420676
420691
  var MAX_WALL_TIME_SECONDS = Math.floor(MAX_TIMEOUT_MS / SECOND);
420692
+ var MIN_WALL_TIME_SECONDS = 1;
420693
+ function parseDurationSeconds(input) {
420694
+ const trimmed2 = input.trim().toLowerCase();
420695
+ if (trimmed2.length === 0) {
420696
+ throw new Error("Invalid duration: empty string");
420697
+ }
420698
+ const match2 = /^(\d+(?:\.\d+)?)\s*(ms|s|m|h)?$/.exec(trimmed2);
420699
+ if (!match2) {
420700
+ throw new Error(
420701
+ `Invalid duration "${input}". Use a positive number of seconds (e.g. 90) or a duration with unit (e.g. 30s, 5m, 1h, 500ms).`
420702
+ );
420703
+ }
420704
+ const value = Number.parseFloat(match2[1]);
420705
+ const unit = match2[2] ?? "s";
420706
+ let seconds;
420707
+ switch (unit) {
420708
+ case "ms":
420709
+ seconds = value / 1e3;
420710
+ break;
420711
+ case "s":
420712
+ seconds = value;
420713
+ break;
420714
+ case "m":
420715
+ seconds = value * 60;
420716
+ break;
420717
+ case "h":
420718
+ seconds = value * 3600;
420719
+ break;
420720
+ default:
420721
+ throw new Error(`Invalid duration unit "${unit}"`);
420722
+ }
420723
+ if (seconds <= 0) {
420724
+ throw new Error(
420725
+ `Invalid duration "${input}": must be greater than zero. Omit the flag entirely if you don't want a wall-clock budget.`
420726
+ );
420727
+ }
420728
+ if (seconds < MIN_WALL_TIME_SECONDS) {
420729
+ const hint = /ms\b/i.test(trimmed2) ? ` (probably a typo \u2014 did you mean ${input.replace(/ms\b/i, "s")}?)` : "";
420730
+ throw new Error(
420731
+ `Invalid duration "${input}": below the ${MIN_WALL_TIME_SECONDS}s minimum${hint}. Sub-second wall-clock budgets fire before any model round-trip can complete.`
420732
+ );
420733
+ }
420734
+ if (seconds > MAX_WALL_TIME_SECONDS) {
420735
+ throw new Error(
420736
+ `Invalid duration "${input}": exceeds the maximum supported wall-clock budget (${MAX_WALL_TIME_SECONDS}s \u2248 24 days). Use a smaller value.`
420737
+ );
420738
+ }
420739
+ return seconds;
420740
+ }
420741
+ __name(parseDurationSeconds, "parseDurationSeconds");
420742
+ function validateMaxWallTimeSetting(value) {
420743
+ if (value === -1) return -1;
420744
+ if (!Number.isFinite(value)) {
420745
+ throw new Error(
420746
+ `model.maxWallTimeSeconds must be a finite number; got ${value}.`
420747
+ );
420748
+ }
420749
+ if (value <= 0) {
420750
+ throw new Error(
420751
+ `model.maxWallTimeSeconds must be > 0 (or -1 for unlimited); got ${value}. Use -1 to disable, not 0.`
420752
+ );
420753
+ }
420754
+ if (value < MIN_WALL_TIME_SECONDS) {
420755
+ throw new Error(
420756
+ `model.maxWallTimeSeconds ${value} is below the ${MIN_WALL_TIME_SECONDS}s minimum. Sub-second budgets fire before any model round-trip can complete.`
420757
+ );
420758
+ }
420759
+ if (value > MAX_WALL_TIME_SECONDS) {
420760
+ throw new Error(
420761
+ `model.maxWallTimeSeconds ${value} exceeds the maximum supported wall-clock budget (${MAX_WALL_TIME_SECONDS}s \u2248 24 days).`
420762
+ );
420763
+ }
420764
+ return value;
420765
+ }
420766
+ __name(validateMaxWallTimeSetting, "validateMaxWallTimeSetting");
420677
420767
  var MAX_TOOL_CALLS = 1e6;
420678
420768
  function validateMaxToolCalls(value) {
420679
420769
  if (value === -1) return -1;
@@ -421049,6 +421139,9 @@ async function parseArguments() {
421049
421139
  }).option("max-tool-calls", {
421050
421140
  type: "number",
421051
421141
  description: "Maximum number of tool calls for a headless run before aborting (exit code 55). Defaults to unlimited."
421142
+ }).option("max-wall-time", {
421143
+ type: "string",
421144
+ description: "Wall-clock budget for a headless run before aborting (exit code 55). Accepts seconds or a unit suffix (e.g. 90, 30s, 5m, 1h). Defaults to unlimited."
421052
421145
  }).option("core-tools", {
421053
421146
  type: "array",
421054
421147
  string: true,
@@ -421447,6 +421540,10 @@ async function loadCliConfig(settings2, argv, cwd6 = process.cwd(), overrideExte
421447
421540
  maxToolCalls: validateMaxToolCalls(
421448
421541
  argv.maxToolCalls ?? settings2.model?.maxToolCalls ?? -1
421449
421542
  ),
421543
+ // The CLI flag is a duration string (parsed/validated by
421544
+ // parseDurationSeconds); the settings entry is a plain number of seconds
421545
+ // (validated by validateMaxWallTimeSetting). Flag wins when both are set.
421546
+ maxWallTimeSeconds: argv.maxWallTime !== void 0 ? parseDurationSeconds(argv.maxWallTime) : validateMaxWallTimeSetting(settings2.model?.maxWallTimeSeconds ?? -1),
421450
421547
  experimentalZedIntegration: argv.acp || argv.experimentalAcp || false,
421451
421548
  cronEnabled: settings2.experimental?.cron ?? false,
421452
421549
  listExtensions: argv.listExtensions || false,
@@ -424679,7 +424776,7 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
424679
424776
 
424680
424777
  // packages/cli/src/generated/git-commit.ts
424681
424778
  init_esbuild_shims();
424682
- var GIT_COMMIT_INFO = "58b119575";
424779
+ var GIT_COMMIT_INFO = "8a7cb3843";
424683
424780
 
424684
424781
  // packages/cli/src/utils/systemInfo.ts
424685
424782
  async function getNpmVersion() {
@@ -436840,7 +436937,10 @@ async function runNonInteractive(config2, settings2, input, prompt_id, options2
436840
436937
  const geminiClient = config2.getGeminiClient();
436841
436938
  const abortController = options2.abortController ?? new AbortController();
436842
436939
  const budgetEnforcer = new RunBudgetEnforcer(
436843
- { maxToolCalls: config2.getMaxToolCalls() },
436940
+ {
436941
+ maxToolCalls: config2.getMaxToolCalls(),
436942
+ maxWallTimeSeconds: config2.getMaxWallTimeSeconds()
436943
+ },
436844
436944
  abortController
436845
436945
  );
436846
436946
  const routeAbort = /* @__PURE__ */ __name(() => {
@@ -436966,6 +437066,9 @@ async function runNonInteractive(config2, settings2, input, prompt_id, options2
436966
437066
  if (config2.getMaxSessionTurns() >= 0 && turnCount > config2.getMaxSessionTurns()) {
436967
437067
  handleMaxTurnsExceededError(config2);
436968
437068
  }
437069
+ if (abortController.signal.aborted) {
437070
+ routeAbort();
437071
+ }
436969
437072
  const toolCallRequests = [];
436970
437073
  const apiStartTime = Date.now();
436971
437074
  const responseStream = geminiClient.sendMessageStream(
@@ -437081,6 +437184,10 @@ async function runNonInteractive(config2, settings2, input, prompt_id, options2
437081
437184
  adapter.startAssistantMessage();
437082
437185
  for await (const event of cronStream) {
437083
437186
  if (abortController.signal.aborted) {
437187
+ if (budgetEnforcer.getExceeded()) {
437188
+ scheduler.stop();
437189
+ routeAbort();
437190
+ }
437084
437191
  const summary = scheduler.getExitSummary();
437085
437192
  scheduler.stop();
437086
437193
  if (summary) {
@@ -493447,7 +493554,7 @@ var QwenAgent = class {
493447
493554
  async initialize(args2) {
493448
493555
  this.clientCapabilities = args2.clientCapabilities;
493449
493556
  const authMethods = buildAuthMethods();
493450
- const version2 = "0.49.0";
493557
+ const version2 = "0.50.0";
493451
493558
  return {
493452
493559
  protocolVersion: PROTOCOL_VERSION,
493453
493560
  agentInfo: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protolabsai/proto",
3
- "version": "0.49.0",
3
+ "version": "0.50.0",
4
4
  "description": "proto - AI-powered coding agent",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,7 +21,7 @@
21
21
  "bundled"
22
22
  ],
23
23
  "config": {
24
- "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.49.0"
24
+ "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.50.0"
25
25
  },
26
26
  "dependencies": {},
27
27
  "optionalDependencies": {