@superatomai/sdk-node 0.0.86-dsp → 0.0.88-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
@@ -386,8 +386,8 @@ var AuthVerifyRequestMessageSchema = import_zod3.z.object({
386
386
  type: import_zod3.z.literal("AUTH_VERIFY_REQ"),
387
387
  payload: AuthVerifyRequestPayloadSchema
388
388
  });
389
- var MAX_PROMPT_ATTACHMENTS = 5;
390
- var MAX_PROMPT_ATTACHMENT_SIZE = 25 * 1024 * 1024;
389
+ var MAX_PROMPT_ATTACHMENTS = 1e3;
390
+ var MAX_PROMPT_ATTACHMENT_SIZE = 100 * 1024 * 1024;
391
391
  var PromptAttachmentSchema = import_zod3.z.object({
392
392
  /** The R2 object key. */
393
393
  key: import_zod3.z.string(),
@@ -25422,6 +25422,9 @@ async function pruneRuns(agentDir, keep) {
25422
25422
  } catch {
25423
25423
  }
25424
25424
  }
25425
+ function runModel(def, input, ctx, fallback) {
25426
+ return (typeof def.model === "function" ? def.model(input, ctx) : def.model) || fallback;
25427
+ }
25425
25428
  async function runCodingAgent(agentId, options = {}) {
25426
25429
  const def = getCodingAgent(agentId);
25427
25430
  if (!def) {
@@ -25513,9 +25516,10 @@ async function runCodingAgent(agentId, options = {}) {
25513
25516
  (runAsJob && def.buildPrompt ? await def.buildPrompt(ws, input, ctx) : outputPath ? `Carry out the task described in ${INSTRUCTIONS_FILE}. Write your finished result to this exact absolute path: ${outputPath}` : `Carry out the task described in ${INSTRUCTIONS_FILE}.`);
25514
25517
  const tools = { ...cfg.sharedTools ?? {}, ...def.tools ?? {} };
25515
25518
  const sessionEnv = def.env ? await def.env(input, ctx) : void 0;
25519
+ const model = runModel(def, input, ctx, cfg.model);
25516
25520
  const session = createCodingAgentSession(def.harness || cfg.harness, {
25517
25521
  cwd: dir,
25518
- model: def.model || cfg.model,
25522
+ model,
25519
25523
  resumeId,
25520
25524
  instructionsFile: INSTRUCTIONS_FILE,
25521
25525
  // undefined, not {}, when this agent has no tools — see the driver.
@@ -25602,7 +25606,7 @@ async function runCodingAgent(agentId, options = {}) {
25602
25606
  logger.warn(`[CodingAgent:${def.id}] deliverable rejected (${message}) \u2014 asking the agent to repair it`);
25603
25607
  const repair = createCodingAgentSession(def.harness || cfg.harness, {
25604
25608
  cwd: dir,
25605
- model: def.model || cfg.model,
25609
+ model,
25606
25610
  resumeId: result.sessionId,
25607
25611
  instructionsFile: INSTRUCTIONS_FILE,
25608
25612
  mcpServers: tools && Object.keys(tools).length ? tools : void 0,
package/dist/index.mjs CHANGED
@@ -274,8 +274,8 @@ var AuthVerifyRequestMessageSchema = z3.object({
274
274
  type: z3.literal("AUTH_VERIFY_REQ"),
275
275
  payload: AuthVerifyRequestPayloadSchema
276
276
  });
277
- var MAX_PROMPT_ATTACHMENTS = 5;
278
- var MAX_PROMPT_ATTACHMENT_SIZE = 25 * 1024 * 1024;
277
+ var MAX_PROMPT_ATTACHMENTS = 1e3;
278
+ var MAX_PROMPT_ATTACHMENT_SIZE = 100 * 1024 * 1024;
279
279
  var PromptAttachmentSchema = z3.object({
280
280
  /** The R2 object key. */
281
281
  key: z3.string(),
@@ -25310,6 +25310,9 @@ async function pruneRuns(agentDir, keep) {
25310
25310
  } catch {
25311
25311
  }
25312
25312
  }
25313
+ function runModel(def, input, ctx, fallback) {
25314
+ return (typeof def.model === "function" ? def.model(input, ctx) : def.model) || fallback;
25315
+ }
25313
25316
  async function runCodingAgent(agentId, options = {}) {
25314
25317
  const def = getCodingAgent(agentId);
25315
25318
  if (!def) {
@@ -25401,9 +25404,10 @@ async function runCodingAgent(agentId, options = {}) {
25401
25404
  (runAsJob && def.buildPrompt ? await def.buildPrompt(ws, input, ctx) : outputPath ? `Carry out the task described in ${INSTRUCTIONS_FILE}. Write your finished result to this exact absolute path: ${outputPath}` : `Carry out the task described in ${INSTRUCTIONS_FILE}.`);
25402
25405
  const tools = { ...cfg.sharedTools ?? {}, ...def.tools ?? {} };
25403
25406
  const sessionEnv = def.env ? await def.env(input, ctx) : void 0;
25407
+ const model = runModel(def, input, ctx, cfg.model);
25404
25408
  const session = createCodingAgentSession(def.harness || cfg.harness, {
25405
25409
  cwd: dir,
25406
- model: def.model || cfg.model,
25410
+ model,
25407
25411
  resumeId,
25408
25412
  instructionsFile: INSTRUCTIONS_FILE,
25409
25413
  // undefined, not {}, when this agent has no tools — see the driver.
@@ -25490,7 +25494,7 @@ async function runCodingAgent(agentId, options = {}) {
25490
25494
  logger.warn(`[CodingAgent:${def.id}] deliverable rejected (${message}) \u2014 asking the agent to repair it`);
25491
25495
  const repair = createCodingAgentSession(def.harness || cfg.harness, {
25492
25496
  cwd: dir,
25493
- model: def.model || cfg.model,
25497
+ model,
25494
25498
  resumeId: result.sessionId,
25495
25499
  instructionsFile: INSTRUCTIONS_FILE,
25496
25500
  mcpServers: tools && Object.keys(tools).length ? tools : void 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superatomai/sdk-node",
3
- "version": "0.0.86-dsp",
3
+ "version": "0.0.88-dsp",
4
4
  "description": "Node.js TypeScript SDK for Superatom",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -50,6 +50,7 @@
50
50
  "build": "tsc --noEmit && tsup",
51
51
  "dev": "tsup --watch",
52
52
  "test": "tsx test-sdk.ts",
53
+ "test:unit": "node --import tsx --test tests/unit/*.test.ts",
53
54
  "type-check": "tsc --noEmit"
54
55
  }
55
56
  }