gpt-driver-node 1.0.6 → 1.0.7

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/index.cjs CHANGED
@@ -954,6 +954,7 @@ class GptDriver {
954
954
  step_number = 1;
955
955
  organisationId;
956
956
  configFilePath;
957
+ additionalUserContext;
957
958
  // Session Execution Stats
958
959
  _stats_startTime = 0;
959
960
  _stats_executedSteps = 0;
@@ -989,6 +990,7 @@ class GptDriver {
989
990
  this.cachingMode = config.cachingMode ?? "NONE";
990
991
  this.organisationId = config.organisationId;
991
992
  this.configFilePath = config.configFilePath;
993
+ this.additionalUserContext = config.additionalUserContext;
992
994
  if (config.useGptDriverCloud) {
993
995
  if (config.serverConfig.device?.platform == null) {
994
996
  throw new Error("Platform is missing. Please specify the platform when using GPTDriver Cloud.");
@@ -1115,7 +1117,8 @@ class GptDriver {
1115
1117
  },
1116
1118
  use_internal_virtual_device: this.useGptDriverCloud,
1117
1119
  build_id: this.buildId,
1118
- caching_mode: this.cachingMode
1120
+ caching_mode: this.cachingMode,
1121
+ ...this.additionalUserContext && { additional_user_context: this.additionalUserContext }
1119
1122
  }
1120
1123
  );
1121
1124
  this.gptDriverSessionId = response.data.sessionId;
@@ -1617,7 +1620,7 @@ ${"=".repeat(50)}`);
1617
1620
  const smartLoopEndTime = performance.now();
1618
1621
  globalLogger.debug(`[Performance] Smart loop completed in ${(smartLoopEndTime - smartLoopStartTime).toFixed(2)}ms`);
1619
1622
  if (!result.success) {
1620
- throw new Error(result.error || "Smart loop execution failed");
1623
+ await this.setSessionFailed();
1621
1624
  }
1622
1625
  if (result.cacheHitCount) {
1623
1626
  this._stats_cacheHits += result.cacheHitCount;
package/dist/index.d.cts CHANGED
@@ -22,6 +22,7 @@ interface GptDriverConfig {
22
22
  useGptDriverCloud?: boolean;
23
23
  buildId?: string;
24
24
  cachingMode?: CachingMode;
25
+ additionalUserContext?: string;
25
26
  organisationId?: string;
26
27
  configFilePath?: string;
27
28
  }
@@ -512,6 +513,7 @@ declare class GptDriver {
512
513
  private step_number;
513
514
  private organisationId?;
514
515
  private configFilePath?;
516
+ private additionalUserContext?;
515
517
  private _stats_startTime;
516
518
  private _stats_executedSteps;
517
519
  private _stats_cacheHits;
package/dist/index.mjs CHANGED
@@ -952,6 +952,7 @@ class GptDriver {
952
952
  step_number = 1;
953
953
  organisationId;
954
954
  configFilePath;
955
+ additionalUserContext;
955
956
  // Session Execution Stats
956
957
  _stats_startTime = 0;
957
958
  _stats_executedSteps = 0;
@@ -987,6 +988,7 @@ class GptDriver {
987
988
  this.cachingMode = config.cachingMode ?? "NONE";
988
989
  this.organisationId = config.organisationId;
989
990
  this.configFilePath = config.configFilePath;
991
+ this.additionalUserContext = config.additionalUserContext;
990
992
  if (config.useGptDriverCloud) {
991
993
  if (config.serverConfig.device?.platform == null) {
992
994
  throw new Error("Platform is missing. Please specify the platform when using GPTDriver Cloud.");
@@ -1113,7 +1115,8 @@ class GptDriver {
1113
1115
  },
1114
1116
  use_internal_virtual_device: this.useGptDriverCloud,
1115
1117
  build_id: this.buildId,
1116
- caching_mode: this.cachingMode
1118
+ caching_mode: this.cachingMode,
1119
+ ...this.additionalUserContext && { additional_user_context: this.additionalUserContext }
1117
1120
  }
1118
1121
  );
1119
1122
  this.gptDriverSessionId = response.data.sessionId;
@@ -1615,7 +1618,7 @@ ${"=".repeat(50)}`);
1615
1618
  const smartLoopEndTime = performance.now();
1616
1619
  globalLogger.debug(`[Performance] Smart loop completed in ${(smartLoopEndTime - smartLoopStartTime).toFixed(2)}ms`);
1617
1620
  if (!result.success) {
1618
- throw new Error(result.error || "Smart loop execution failed");
1621
+ await this.setSessionFailed();
1619
1622
  }
1620
1623
  if (result.cacheHitCount) {
1621
1624
  this._stats_cacheHits += result.cacheHitCount;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gpt-driver-node",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.cts",