kode-sdk 2.7.0 → 2.7.1
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/core/agent.d.ts +9 -0
- package/dist/core/agent.js +10 -1
- package/package.json +2 -4
package/dist/core/agent.d.ts
CHANGED
|
@@ -205,6 +205,15 @@ export declare class Agent {
|
|
|
205
205
|
tools?: string[];
|
|
206
206
|
callId?: string;
|
|
207
207
|
streamEvents?: boolean;
|
|
208
|
+
/**
|
|
209
|
+
* When true, delete the sub-agent's persisted store directory after the task finishes successfully.
|
|
210
|
+
* This is useful for one-off helper sub-agents (e.g. generating follow-up suggestions) that should
|
|
211
|
+
* not leave behind on-disk artifacts.
|
|
212
|
+
*
|
|
213
|
+
* Note: if the delegated task returns `status: 'paused'` (waiting for approvals), cleanup is skipped
|
|
214
|
+
* so the run can be resumed.
|
|
215
|
+
*/
|
|
216
|
+
cleanupOnSuccess?: boolean;
|
|
208
217
|
}): Promise<CompleteResult>;
|
|
209
218
|
static resume(agentId: string, config: AgentConfig, deps: AgentDependencies, opts?: {
|
|
210
219
|
autoRun?: boolean;
|
package/dist/core/agent.js
CHANGED
|
@@ -710,6 +710,15 @@ class Agent {
|
|
|
710
710
|
}
|
|
711
711
|
try {
|
|
712
712
|
const result = await subAgent.complete(config.prompt);
|
|
713
|
+
// Best-effort cleanup for ephemeral sub-agents.
|
|
714
|
+
if (config.cleanupOnSuccess === true && result?.status === 'ok') {
|
|
715
|
+
try {
|
|
716
|
+
await this.deps.store.delete(subAgentId);
|
|
717
|
+
}
|
|
718
|
+
catch {
|
|
719
|
+
// ignore
|
|
720
|
+
}
|
|
721
|
+
}
|
|
713
722
|
return { ...result, agentId: subAgentId };
|
|
714
723
|
}
|
|
715
724
|
finally {
|
|
@@ -2276,7 +2285,7 @@ class Agent {
|
|
|
2276
2285
|
const now = Date.now();
|
|
2277
2286
|
const timePart = encodeUlid(now, 10, chars);
|
|
2278
2287
|
const random = Array.from({ length: 16 }, () => chars[Math.floor(Math.random() * chars.length)]).join('');
|
|
2279
|
-
return `agt
|
|
2288
|
+
return `agt-${timePart}${random}`;
|
|
2280
2289
|
}
|
|
2281
2290
|
}
|
|
2282
2291
|
exports.Agent = Agent;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kode-sdk",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.1",
|
|
4
4
|
"description": "Event-driven, long-running AI Agent development framework with enterprise-grade persistence and context management",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"nietzsche:openapi": "npm --workspace @shareai-lab/kode-app-assistant run openapi",
|
|
52
52
|
"nietzsche:release": "npm --workspace @shareai-lab/kode-app-assistant run release",
|
|
53
53
|
"nietzsche:deploy": "npm --workspace @shareai-lab/kode-app-assistant run deploy",
|
|
54
|
-
"cowork": "npm --workspace
|
|
54
|
+
"cowork": "npm run build && npm --workspace koda-cowork run dev"
|
|
55
55
|
},
|
|
56
56
|
"keywords": [
|
|
57
57
|
"agent",
|
|
@@ -80,11 +80,9 @@
|
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@modelcontextprotocol/sdk": "^1.19.1",
|
|
82
82
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
83
|
-
"@types/better-sqlite3": "^7.6.13",
|
|
84
83
|
"@types/express": "^5.0.6",
|
|
85
84
|
"ajv": "^8.17.1",
|
|
86
85
|
"axios": "^1.13.2",
|
|
87
|
-
"better-sqlite3": "^12.5.0",
|
|
88
86
|
"dotenv": "^16.6.1",
|
|
89
87
|
"express": "^5.2.1",
|
|
90
88
|
"fast-glob": "^3.3.2",
|