@superatomai/sdk-node 0.0.87-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/README.md +942 -942
- package/dist/index.d.mts +800 -126
- package/dist/index.d.ts +800 -126
- package/dist/index.js +6 -2
- package/dist/index.mjs +6 -2
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
@@ -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
|
|
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
|
|
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.
|
|
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
|
}
|