@protolabsai/proto 0.16.2 → 0.16.3

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 +46 -9
  2. package/package.json +2 -2
package/cli.js CHANGED
@@ -170762,7 +170762,7 @@ __export(geminiContentGenerator_exports, {
170762
170762
  createGeminiContentGenerator: () => createGeminiContentGenerator
170763
170763
  });
170764
170764
  function createGeminiContentGenerator(config2, gcConfig) {
170765
- const version2 = "0.16.2";
170765
+ const version2 = "0.16.3";
170766
170766
  const userAgent2 = config2.userAgent || `QwenCode/${version2} (${process.platform}; ${process.arch})`;
170767
170767
  const baseHeaders = {
170768
170768
  "User-Agent": userAgent2
@@ -188973,6 +188973,43 @@ var init_checkpointStore = __esm({
188973
188973
  get size() {
188974
188974
  return this.checkpoints.length;
188975
188975
  }
188976
+ // ─── Rewind API ────────────────────────────────────────────
188977
+ /**
188978
+ * Restores all files snapshotted in the given checkpoint to their pre-turn state.
188979
+ *
188980
+ * For each file recorded in the checkpoint's `fileSnapshots`:
188981
+ * - If the file did not exist before the turn (i.e. it was newly created),
188982
+ * it is **deleted** from disk. If the file is already absent (because a
188983
+ * previous rewind already removed it), the deletion is silently skipped.
188984
+ * - Otherwise the original file content is written back to disk, overwriting
188985
+ * whatever is there now.
188986
+ *
188987
+ * This method is **idempotent**: calling it multiple times with the same
188988
+ * `promptId` always produces the same on-disk result.
188989
+ *
188990
+ * @param promptId - The turn identifier whose checkpoint should be rewound.
188991
+ * @returns An array of absolute file paths that were restored or deleted.
188992
+ * @throws {Error} if no checkpoint for `promptId` exists.
188993
+ */
188994
+ rewindToCheckpoint(promptId) {
188995
+ const checkpoint = this.getInternal(promptId);
188996
+ if (!checkpoint) {
188997
+ throw new Error(`rewindToCheckpoint: no checkpoint found for promptId "${promptId}"`);
188998
+ }
188999
+ const restoredPaths = [];
189000
+ for (const [filePath, content] of checkpoint.fileSnapshots) {
189001
+ if (content === CHECK_NOT_EXISTED) {
189002
+ try {
189003
+ fs27.unlinkSync(filePath);
189004
+ } catch {
189005
+ }
189006
+ } else {
189007
+ fs27.writeFileSync(filePath, content, "utf8");
189008
+ }
189009
+ restoredPaths.push(filePath);
189010
+ }
189011
+ return restoredPaths;
189012
+ }
188976
189013
  // ─── Private helpers ────────────────────────────────────────
188977
189014
  getInternal(promptId) {
188978
189015
  const idx = this.index.get(promptId);
@@ -411707,7 +411744,7 @@ __name(getPackageJson, "getPackageJson");
411707
411744
  // packages/cli/src/utils/version.ts
411708
411745
  async function getCliVersion() {
411709
411746
  const pkgJson = await getPackageJson();
411710
- return "0.16.2";
411747
+ return "0.16.3";
411711
411748
  }
411712
411749
  __name(getCliVersion, "getCliVersion");
411713
411750
 
@@ -419479,7 +419516,7 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
419479
419516
 
419480
419517
  // packages/cli/src/generated/git-commit.ts
419481
419518
  init_esbuild_shims();
419482
- var GIT_COMMIT_INFO = "0e0fc805f";
419519
+ var GIT_COMMIT_INFO = "d6fa3e6a3";
419483
419520
 
419484
419521
  // packages/cli/src/utils/systemInfo.ts
419485
419522
  async function getNpmVersion() {
@@ -476656,9 +476693,9 @@ node_default2(Temp.purgeSyncAll);
476656
476693
  var temp_default = Temp;
476657
476694
 
476658
476695
  // node_modules/atomically/dist/index.js
476659
- function writeFileSync14(filePath, data, options2 = DEFAULT_WRITE_OPTIONS) {
476696
+ function writeFileSync15(filePath, data, options2 = DEFAULT_WRITE_OPTIONS) {
476660
476697
  if (isString(options2))
476661
- return writeFileSync14(filePath, data, { encoding: options2 });
476698
+ return writeFileSync15(filePath, data, { encoding: options2 });
476662
476699
  const timeout2 = Date.now() + ((options2.timeout ?? DEFAULT_TIMEOUT_SYNC) || -1);
476663
476700
  let tempDisposer = null;
476664
476701
  let tempPath = null;
@@ -476731,7 +476768,7 @@ function writeFileSync14(filePath, data, options2 = DEFAULT_WRITE_OPTIONS) {
476731
476768
  temp_default.purge(tempPath);
476732
476769
  }
476733
476770
  }
476734
- __name(writeFileSync14, "writeFileSync");
476771
+ __name(writeFileSync15, "writeFileSync");
476735
476772
 
476736
476773
  // node_modules/dot-prop/index.js
476737
476774
  init_esbuild_shims();
@@ -476992,7 +477029,7 @@ ${permissionError}
476992
477029
  `;
476993
477030
  }
476994
477031
  if (error40.name === "SyntaxError") {
476995
- writeFileSync14(this._path, "", writeFileOptions);
477032
+ writeFileSync15(this._path, "", writeFileOptions);
476996
477033
  return {};
476997
477034
  }
476998
477035
  throw error40;
@@ -477001,7 +477038,7 @@ ${permissionError}
477001
477038
  set all(value) {
477002
477039
  try {
477003
477040
  import_graceful_fs.default.mkdirSync(path129.dirname(this._path), mkdirOptions);
477004
- writeFileSync14(this._path, JSON.stringify(value, void 0, " "), writeFileOptions);
477041
+ writeFileSync15(this._path, JSON.stringify(value, void 0, " "), writeFileOptions);
477005
477042
  } catch (error40) {
477006
477043
  if (error40.code === "EACCES") {
477007
477044
  error40.message = `${error40.message}
@@ -485773,7 +485810,7 @@ var QwenAgent = class {
485773
485810
  async initialize(args2) {
485774
485811
  this.clientCapabilities = args2.clientCapabilities;
485775
485812
  const authMethods = buildAuthMethods();
485776
- const version2 = "0.16.2";
485813
+ const version2 = "0.16.3";
485777
485814
  return {
485778
485815
  protocolVersion: PROTOCOL_VERSION,
485779
485816
  agentInfo: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protolabsai/proto",
3
- "version": "0.16.2",
3
+ "version": "0.16.3",
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.16.2"
24
+ "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.16.3"
25
25
  },
26
26
  "dependencies": {},
27
27
  "optionalDependencies": {