@capybara-hq/kernel 0.1.0-rc.110 → 0.1.0-rc.111
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/automations/events/acceptance.js +1 -0
- package/dist/automations/events/sweep.job.js +2 -1
- package/dist/catalog/marketplaces.service.d.ts +1 -1
- package/dist/conversations/permission-profiles.controller.js +3 -1
- package/dist/extensions/run-lifecycle-owe.d.ts +4 -1
- package/dist/extensions/run-lifecycle-owe.js +5 -1
- package/package.json +2 -2
|
@@ -347,7 +347,7 @@ let TriggerEventSweepJob = class TriggerEventSweepJob {
|
|
|
347
347
|
.where("org_id", "=", orgId)
|
|
348
348
|
.where("id", "=", eventId)
|
|
349
349
|
.where("state", "=", "pending")
|
|
350
|
-
.returning(["plugin", "audience", "subject"])
|
|
350
|
+
.returning(["plugin", "dedupe_key", "audience", "subject"])
|
|
351
351
|
.executeTakeFirst();
|
|
352
352
|
if (r === undefined)
|
|
353
353
|
return false;
|
|
@@ -356,6 +356,7 @@ let TriggerEventSweepJob = class TriggerEventSweepJob {
|
|
|
356
356
|
orgId,
|
|
357
357
|
plugin: r.plugin,
|
|
358
358
|
eventId,
|
|
359
|
+
dedupeKey: r.dedupe_key,
|
|
359
360
|
accountId: r.audience.accountId,
|
|
360
361
|
agentId: r.audience.agentId,
|
|
361
362
|
subject: r.subject,
|
|
@@ -208,7 +208,7 @@ export declare function headsToResolve(entries: readonly MarketplaceEntry[], imp
|
|
|
208
208
|
/** The host versions (an entry's `minKernel` is judged against them). */
|
|
209
209
|
export declare const HOST_VERSIONS: {
|
|
210
210
|
readonly kernel: string;
|
|
211
|
-
readonly sdk: "0.1.0-rc.
|
|
211
|
+
readonly sdk: "0.1.0-rc.88";
|
|
212
212
|
};
|
|
213
213
|
/** Whether this deployment satisfies the entry's `minKernel`. */
|
|
214
214
|
export declare const entryCompatible: (e: Pick<MarketplaceEntry, "minKernel">) => boolean;
|
|
@@ -8,6 +8,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
8
8
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
9
|
};
|
|
10
10
|
import { Controller, Get, Inject, Patch, Post, Res } from "@nestjs/common";
|
|
11
|
+
import { requestSignal } from "../http/request-signal.js";
|
|
11
12
|
import { CurrentPrincipal, requireUser, SessionOnly, } from "../identity/principal.js";
|
|
12
13
|
import { createZodDto } from "../infra/validation/create-zod-dto.js";
|
|
13
14
|
import { ZBody, ZParam, ZQuery } from "../infra/validation/zod-params.js";
|
|
@@ -50,6 +51,7 @@ let PermissionProfilesController = class PermissionProfilesController {
|
|
|
50
51
|
clientMessageId: message.clientMessageId,
|
|
51
52
|
...(message.attachments !== undefined ? { attachments: message.attachments } : {}),
|
|
52
53
|
...(message.files !== undefined ? { files: message.files } : {}),
|
|
54
|
+
...(message.projectFiles !== undefined ? { projectFiles: message.projectFiles } : {}),
|
|
53
55
|
...(message.model !== undefined ? { model: message.model } : {}),
|
|
54
56
|
...(message.effort !== undefined ? { effort: message.effort } : {}),
|
|
55
57
|
...(message.skill !== undefined ? { skill: message.skill } : {}),
|
|
@@ -58,7 +60,7 @@ let PermissionProfilesController = class PermissionProfilesController {
|
|
|
58
60
|
}, {
|
|
59
61
|
...(deviceId !== undefined ? { deviceId } : {}),
|
|
60
62
|
...(project !== undefined ? { project } : {}),
|
|
61
|
-
}, { source: "web", initialPermission: permission });
|
|
63
|
+
}, { source: "web", initialPermission: permission, signal: requestSignal(reply) });
|
|
62
64
|
reply.status(out.created ? 201 : 200);
|
|
63
65
|
return { conversation: out.conversation, event: out.event, events: out.events };
|
|
64
66
|
}
|
|
@@ -50,12 +50,15 @@ export declare function oweRunLifecycleFor(db: KernelSchemaDb, outbox: Pick<Outb
|
|
|
50
50
|
}): Promise<void>;
|
|
51
51
|
/**
|
|
52
52
|
* Owes `run.lifecycle` `offer_declined` to `plugin` (the plugin that emitted the directed event
|
|
53
|
-
* `eventId`), in the caller's transaction
|
|
53
|
+
* `eventId`, emitted with `dedupeKey`), in the caller's transaction; the payload names the event so
|
|
54
|
+
* the plugin can tell a stale decline from one for its latest event. Nothing when the plugin does
|
|
55
|
+
* not subscribe in the org.
|
|
54
56
|
*/
|
|
55
57
|
export declare function oweOfferDeclinedIn(db: KernelSchemaDb, outbox: Pick<OutboxService, "add">, a: {
|
|
56
58
|
orgId: string;
|
|
57
59
|
plugin: string;
|
|
58
60
|
eventId: string;
|
|
61
|
+
dedupeKey: string;
|
|
59
62
|
accountId: string;
|
|
60
63
|
agentId: string;
|
|
61
64
|
subject: {
|
|
@@ -68,7 +68,9 @@ export async function oweRunLifecycleFor(db, outbox, f, a) {
|
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
70
|
* Owes `run.lifecycle` `offer_declined` to `plugin` (the plugin that emitted the directed event
|
|
71
|
-
* `eventId`), in the caller's transaction
|
|
71
|
+
* `eventId`, emitted with `dedupeKey`), in the caller's transaction; the payload names the event so
|
|
72
|
+
* the plugin can tell a stale decline from one for its latest event. Nothing when the plugin does
|
|
73
|
+
* not subscribe in the org.
|
|
72
74
|
*/
|
|
73
75
|
export async function oweOfferDeclinedIn(db, outbox, a) {
|
|
74
76
|
if (!(await subscribesToRunLifecycle(db, a.orgId, a.plugin)))
|
|
@@ -80,5 +82,7 @@ export async function oweOfferDeclinedIn(db, outbox, a) {
|
|
|
80
82
|
phase: "offer_declined",
|
|
81
83
|
subject: { kind: a.subject.kind, id: a.subject.id },
|
|
82
84
|
reason: a.reason,
|
|
85
|
+
eventId: a.eventId,
|
|
86
|
+
dedupeKey: a.dedupeKey,
|
|
83
87
|
}, runLifecycleJobId({ id: a.eventId, phase: "offer_declined" }));
|
|
84
88
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capybara-hq/kernel",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.111",
|
|
4
4
|
"description": "Capybara kernel: config, database, plugin host and HTTP API of the Capybara agent platform",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"yaml": "^2.9.1",
|
|
67
67
|
"yauzl": "3.4.0",
|
|
68
68
|
"zod": "^4.6.7",
|
|
69
|
-
"@capybara-hq/plugin-sdk": "^0.1.0-rc.
|
|
69
|
+
"@capybara-hq/plugin-sdk": "^0.1.0-rc.88"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@langchain/langgraph-checkpoint-validation": "^1.2.0",
|