@superatomai/sdk-node 0.0.75-dsp → 0.0.76-dsp

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.js CHANGED
@@ -25317,20 +25317,8 @@ async function runCodingAgent(agentId, options = {}) {
25317
25317
  };
25318
25318
  }
25319
25319
  inFlight.add(lockKey);
25320
- const state = loadState(scopeDir);
25321
25320
  let resumeId = options.resumeId;
25322
- let turns = state.turns;
25323
- if (persistentSession && !resumeId) {
25324
- const overThreshold = policy.resetAfterTurns !== void 0 && state.turns >= policy.resetAfterTurns;
25325
- if (overThreshold) {
25326
- logger.info(
25327
- `[CodingAgent:${def.id}] session reset after ${state.turns} runs (resetAfterTurns=${policy.resetAfterTurns}) \u2014 memory/ carries over`
25328
- );
25329
- turns = 0;
25330
- } else {
25331
- resumeId = state.sessionId;
25332
- }
25333
- }
25321
+ let turns = 0;
25334
25322
  const ws = createWorkspace(dir, runId);
25335
25323
  const ctx = {
25336
25324
  projectId: options.projectId,
@@ -25357,6 +25345,19 @@ async function runCodingAgent(agentId, options = {}) {
25357
25345
  try {
25358
25346
  await installInstructions(def, ws);
25359
25347
  if (def.prepare && runAsJob) await def.prepare(ws, input, ctx);
25348
+ const state = loadState(scopeDir);
25349
+ turns = state.turns;
25350
+ if (persistentSession && !resumeId) {
25351
+ const overThreshold = policy.resetAfterTurns !== void 0 && state.turns >= policy.resetAfterTurns;
25352
+ if (overThreshold) {
25353
+ logger.info(
25354
+ `[CodingAgent:${def.id}] session reset after ${state.turns} runs (resetAfterTurns=${policy.resetAfterTurns}) \u2014 memory/ carries over`
25355
+ );
25356
+ turns = 0;
25357
+ } else {
25358
+ resumeId = state.sessionId;
25359
+ }
25360
+ }
25360
25361
  const outputPath = runAsJob && def.output ? ws.pathTo(def.output.file) : void 0;
25361
25362
  if (outputPath) await fsp.rm(outputPath, { force: true });
25362
25363
  const prompt = options.prompt ?? // buildPrompt may read what prepare() wrote, so it is only asked when
@@ -29446,7 +29447,11 @@ var SuperatomSDK = class {
29446
29447
  }
29447
29448
  url.searchParams.set("projectId", this.projectId);
29448
29449
  url.searchParams.set("type", this.type);
29449
- logger.info(`Connecting to WebSocket: ${url.toString()}`);
29450
+ const loggedUrl = new URL(url.toString());
29451
+ if (this.apiKey) {
29452
+ loggedUrl.searchParams.set("apiKey", "***");
29453
+ }
29454
+ logger.info(`Connecting to WebSocket: ${loggedUrl.toString()}`);
29450
29455
  this.ws = createWebSocket(url.toString());
29451
29456
  this.ws.addEventListener("open", () => {
29452
29457
  this.connected = true;
package/dist/index.mjs CHANGED
@@ -25204,20 +25204,8 @@ async function runCodingAgent(agentId, options = {}) {
25204
25204
  };
25205
25205
  }
25206
25206
  inFlight.add(lockKey);
25207
- const state = loadState(scopeDir);
25208
25207
  let resumeId = options.resumeId;
25209
- let turns = state.turns;
25210
- if (persistentSession && !resumeId) {
25211
- const overThreshold = policy.resetAfterTurns !== void 0 && state.turns >= policy.resetAfterTurns;
25212
- if (overThreshold) {
25213
- logger.info(
25214
- `[CodingAgent:${def.id}] session reset after ${state.turns} runs (resetAfterTurns=${policy.resetAfterTurns}) \u2014 memory/ carries over`
25215
- );
25216
- turns = 0;
25217
- } else {
25218
- resumeId = state.sessionId;
25219
- }
25220
- }
25208
+ let turns = 0;
25221
25209
  const ws = createWorkspace(dir, runId);
25222
25210
  const ctx = {
25223
25211
  projectId: options.projectId,
@@ -25244,6 +25232,19 @@ async function runCodingAgent(agentId, options = {}) {
25244
25232
  try {
25245
25233
  await installInstructions(def, ws);
25246
25234
  if (def.prepare && runAsJob) await def.prepare(ws, input, ctx);
25235
+ const state = loadState(scopeDir);
25236
+ turns = state.turns;
25237
+ if (persistentSession && !resumeId) {
25238
+ const overThreshold = policy.resetAfterTurns !== void 0 && state.turns >= policy.resetAfterTurns;
25239
+ if (overThreshold) {
25240
+ logger.info(
25241
+ `[CodingAgent:${def.id}] session reset after ${state.turns} runs (resetAfterTurns=${policy.resetAfterTurns}) \u2014 memory/ carries over`
25242
+ );
25243
+ turns = 0;
25244
+ } else {
25245
+ resumeId = state.sessionId;
25246
+ }
25247
+ }
25247
25248
  const outputPath = runAsJob && def.output ? ws.pathTo(def.output.file) : void 0;
25248
25249
  if (outputPath) await fsp.rm(outputPath, { force: true });
25249
25250
  const prompt = options.prompt ?? // buildPrompt may read what prepare() wrote, so it is only asked when
@@ -29333,7 +29334,11 @@ var SuperatomSDK = class {
29333
29334
  }
29334
29335
  url.searchParams.set("projectId", this.projectId);
29335
29336
  url.searchParams.set("type", this.type);
29336
- logger.info(`Connecting to WebSocket: ${url.toString()}`);
29337
+ const loggedUrl = new URL(url.toString());
29338
+ if (this.apiKey) {
29339
+ loggedUrl.searchParams.set("apiKey", "***");
29340
+ }
29341
+ logger.info(`Connecting to WebSocket: ${loggedUrl.toString()}`);
29337
29342
  this.ws = createWebSocket(url.toString());
29338
29343
  this.ws.addEventListener("open", () => {
29339
29344
  this.connected = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superatomai/sdk-node",
3
- "version": "0.0.75-dsp",
3
+ "version": "0.0.76-dsp",
4
4
  "description": "Node.js TypeScript SDK for Superatom",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",