@crewx/sdk 0.8.9-rc.9 → 0.9.0-rc.0
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/activity-log/builder.d.ts +23 -0
- package/dist/config/pricing.d.ts +9 -0
- package/dist/conversation/sqlite-provider.d.ts +1 -0
- package/dist/esm/index.js +168 -45
- package/dist/esm/plugins/index.js +154 -27
- package/dist/esm/repository/index.js +150 -24
- package/dist/facade/Crewx.d.ts +1 -0
- package/dist/index.browser.d.ts +1 -0
- package/dist/index.browser.js +2 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.js +168 -45
- package/dist/migrations/0006_add_task_run_epoch.sql +1 -0
- package/dist/migrations/meta/_journal.json +7 -0
- package/dist/plugins/index.js +154 -27
- package/dist/provider/acp/adapters/index.d.ts +0 -1
- package/dist/provider/acp/index.d.ts +1 -1
- package/dist/provider/acp/meta.d.ts +3 -0
- package/dist/provider/bridge.browser.d.ts +1 -10
- package/dist/provider/bridge.d.ts +2 -10
- package/dist/provider/cli/adapter.types.d.ts +23 -2
- package/dist/provider/cli/adapters/claude.d.ts +1 -0
- package/dist/provider/cli/adapters/cli-knob.util.d.ts +7 -0
- package/dist/provider/cli/adapters/gemini.d.ts +4 -2
- package/dist/provider/cli/adapters/index.d.ts +0 -1
- package/dist/provider/cli/index.d.ts +1 -1
- package/dist/provider/cli/meta.d.ts +4 -0
- package/dist/provider/errors.d.ts +20 -0
- package/dist/provider/order.d.ts +3 -0
- package/dist/repository/index.d.ts +2 -1
- package/dist/repository/index.js +150 -24
- package/dist/repository/task.repository.d.ts +15 -0
- package/dist/repository/thread.repository.d.ts +1 -1
- package/dist/schema/tasks.d.ts +17 -0
- package/dist/types/index.d.ts +2 -0
- package/package.json +4 -4
- package/templates/agents/default.yaml +8 -4
package/dist/schema/tasks.d.ts
CHANGED
|
@@ -615,6 +615,23 @@ export declare const tasks: import("drizzle-orm/sqlite-core").SQLiteTableWithCol
|
|
|
615
615
|
identity: undefined;
|
|
616
616
|
generated: undefined;
|
|
617
617
|
}, {}, {}>;
|
|
618
|
+
run_epoch: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
619
|
+
name: "run_epoch";
|
|
620
|
+
tableName: "tasks";
|
|
621
|
+
dataType: "number";
|
|
622
|
+
columnType: "SQLiteInteger";
|
|
623
|
+
data: number;
|
|
624
|
+
driverParam: number;
|
|
625
|
+
notNull: false;
|
|
626
|
+
hasDefault: true;
|
|
627
|
+
isPrimaryKey: false;
|
|
628
|
+
isAutoincrement: false;
|
|
629
|
+
hasRuntimeDefault: false;
|
|
630
|
+
enumValues: undefined;
|
|
631
|
+
baseColumn: never;
|
|
632
|
+
identity: undefined;
|
|
633
|
+
generated: undefined;
|
|
634
|
+
}, {}, {}>;
|
|
618
635
|
};
|
|
619
636
|
dialect: "sqlite";
|
|
620
637
|
}>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1312,6 +1312,7 @@ export interface QueryOptions {
|
|
|
1312
1312
|
messages?: import('../conversation/types').TemplateMessage[];
|
|
1313
1313
|
vars?: Record<string, unknown>;
|
|
1314
1314
|
cwd?: string;
|
|
1315
|
+
resumeSessionId?: string;
|
|
1315
1316
|
trace?: TraceContext;
|
|
1316
1317
|
}
|
|
1317
1318
|
export interface QueryResult {
|
|
@@ -1348,6 +1349,7 @@ export interface ExecuteOptions {
|
|
|
1348
1349
|
messages?: import('../conversation/types').TemplateMessage[];
|
|
1349
1350
|
vars?: Record<string, unknown>;
|
|
1350
1351
|
cwd?: string;
|
|
1352
|
+
resumeSessionId?: string;
|
|
1351
1353
|
trace?: TraceContext;
|
|
1352
1354
|
}
|
|
1353
1355
|
export interface ExecuteResult {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crewx/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0-rc.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.19.0"
|
|
@@ -117,9 +117,9 @@
|
|
|
117
117
|
"vitest": "3.2.4"
|
|
118
118
|
},
|
|
119
119
|
"scripts": {
|
|
120
|
-
"build:cjs": "
|
|
121
|
-
"build:esm": "
|
|
122
|
-
"build:browser": "
|
|
120
|
+
"build:cjs": "tsup --config tsup.cjs.js",
|
|
121
|
+
"build:esm": "tsup --config tsup.esm.js",
|
|
122
|
+
"build:browser": "tsup --config tsup.browser.js",
|
|
123
123
|
"build:dts": "tsc -p tsconfig.dts.json",
|
|
124
124
|
"build": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:browser && pnpm run build:dts && node scripts/copy-migrations.mjs",
|
|
125
125
|
"db:generate": "cd ../.. && drizzle-kit generate --config drizzle.config.ts && node packages/sdk/scripts/post-generate.mjs",
|
|
@@ -313,7 +313,10 @@ layouts:
|
|
|
313
313
|
|
|
314
314
|
{{#if props.showConversationHistory}}
|
|
315
315
|
{{#if messages.length}}
|
|
316
|
-
{{#if
|
|
316
|
+
{{#if has_activity_log}}
|
|
317
|
+
**Activity log instructions**: If `<activity_log>` contains entries with `reused="ok"`, treat those results as current — do **not** re-run the same tool. Only re-run entries marked `reused="stale"` (file changed) or when you need fresher data than what is shown.
|
|
318
|
+
|
|
319
|
+
{{else}}{{#if thread_id}}
|
|
317
320
|
<crewx_system_message type="hint" thread_id="{{thread_id}}" agent_id="{{agent.id}}" now="{{now}}">
|
|
318
321
|
This thread may include your prior assistant task activity.
|
|
319
322
|
If the user is continuing previous work, run:
|
|
@@ -321,7 +324,7 @@ layouts:
|
|
|
321
324
|
Do not run dreaming for completely new, unrelated questions.
|
|
322
325
|
</crewx_system_message>
|
|
323
326
|
|
|
324
|
-
{{/if}}
|
|
327
|
+
{{/if}}{{/if}}
|
|
325
328
|
<conversation_history platform="{{platform}}">
|
|
326
329
|
{{#formatConversation messages platform agent.id thread_id}}
|
|
327
330
|
{{#if primaryAgentId}}
|
|
@@ -337,9 +340,9 @@ layouts:
|
|
|
337
340
|
{{/if}}
|
|
338
341
|
{{#each messages}}
|
|
339
342
|
{{#if isAssistant}}
|
|
340
|
-
<message role="assistant"{{#if metadata.agent_id}} agent="{{metadata.agent_id}}"{{/if}}{{#if
|
|
343
|
+
<message role="assistant"{{#if metadata.agent_id}} agent="{{metadata.agent_id}}"{{/if}}{{#if metadata.task_id}} task_id="{{metadata.task_id}}"{{/if}}{{#if metadata.status}} status="{{metadata.status}}"{{/if}}{{#if metadata.reason}} reason="{{metadata.reason}}"{{/if}}{{#if created_at}} created_at="{{created_at}}"{{/if}}{{#if metadata.slack}}{{#with metadata.slack}}{{#if bot_username}} name="{{bot_username}}"{{/if}}{{#if bot_user_id}} slack_user="{{bot_user_id}}"{{/if}}{{/with}}{{/if}}>
|
|
341
344
|
{{else}}
|
|
342
|
-
<message role="user"{{#if metadata.caller_agent_id}} from="@{{metadata.caller_agent_id}}"{{/if}}{{#if created_at}} created_at="{{created_at}}"{{/if}}{{#if
|
|
345
|
+
<message role="user"{{#if metadata.caller_agent_id}} from="@{{metadata.caller_agent_id}}"{{/if}}{{#if created_at}} created_at="{{created_at}}"{{/if}}{{#if metadata.slack}}{{#with metadata.slack}}{{#if user_profile.display_name}} name="{{user_profile.display_name}}"{{else if username}} name="{{username}}"{{/if}}{{#if user_id}} slack_user="{{user_id}}"{{/if}}{{/with}}{{/if}}>
|
|
343
346
|
{{/if}}
|
|
344
347
|
{{{escapeHandlebars text}}}
|
|
345
348
|
{{#if files}}
|
|
@@ -347,6 +350,7 @@ layouts:
|
|
|
347
350
|
📎 {{name}}{{#if size}} ({{formatFileSize size}}){{/if}}{{#if localPath}} - Local: {{localPath}}{{/if}}
|
|
348
351
|
{{/each}}
|
|
349
352
|
{{/if}}
|
|
353
|
+
{{#if activity_log}}{{{activity_log}}}{{/if}}
|
|
350
354
|
</message>
|
|
351
355
|
{{/each}}
|
|
352
356
|
{{/formatConversation}}
|