@dsh-enhanced/assistant-delivery 0.1.24 → 0.1.30
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 +81 -10
- package/lib/acceptance.d.ts +46 -0
- package/lib/acceptance.d.ts.map +1 -0
- package/lib/acceptance.js +2 -0
- package/lib/acceptance.js.map +1 -0
- package/lib/agent-runtime.d.ts +33 -3
- package/lib/agent-runtime.d.ts.map +1 -1
- package/lib/agent-runtime.js +835 -62
- package/lib/agent-runtime.js.map +1 -1
- package/lib/coordinator.d.ts +4 -1
- package/lib/coordinator.d.ts.map +1 -1
- package/lib/coordinator.js +9 -0
- package/lib/coordinator.js.map +1 -1
- package/lib/feedback-command.d.ts +21 -1
- package/lib/feedback-command.d.ts.map +1 -1
- package/lib/feedback-command.js +18 -0
- package/lib/feedback-command.js.map +1 -1
- package/lib/goal-wake-types.d.ts +93 -0
- package/lib/goal-wake-types.d.ts.map +1 -0
- package/lib/goal-wake-types.js +70 -0
- package/lib/goal-wake-types.js.map +1 -0
- package/lib/inbound-images.d.ts.map +1 -1
- package/lib/inbound-images.js +11 -9
- package/lib/inbound-images.js.map +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/native-web-owner.d.ts +78 -0
- package/lib/native-web-owner.d.ts.map +1 -0
- package/lib/native-web-owner.js +291 -0
- package/lib/native-web-owner.js.map +1 -0
- package/lib/operator-snapshot.d.ts +80 -0
- package/lib/operator-snapshot.d.ts.map +1 -0
- package/lib/operator-snapshot.js +935 -0
- package/lib/operator-snapshot.js.map +1 -0
- package/lib/operator.d.ts +2 -0
- package/lib/operator.d.ts.map +1 -1
- package/lib/operator.js +10 -0
- package/lib/operator.js.map +1 -1
- package/lib/service.d.ts +63 -13
- package/lib/service.d.ts.map +1 -1
- package/lib/service.js +917 -349
- package/lib/service.js.map +1 -1
- package/lib/session-lease-runtime.d.ts +69 -0
- package/lib/session-lease-runtime.d.ts.map +1 -0
- package/lib/session-lease-runtime.js +395 -0
- package/lib/session-lease-runtime.js.map +1 -0
- package/lib/session-lease-types.d.ts +27 -0
- package/lib/session-lease-types.d.ts.map +1 -0
- package/lib/session-lease-types.js +2 -0
- package/lib/session-lease-types.js.map +1 -0
- package/lib/sqlite.d.ts +1 -1
- package/lib/sqlite.d.ts.map +1 -1
- package/lib/sqlite.js +201 -3
- package/lib/sqlite.js.map +1 -1
- package/lib/store.d.ts +133 -4
- package/lib/store.d.ts.map +1 -1
- package/lib/store.js +771 -43
- package/lib/store.js.map +1 -1
- package/lib/types.d.ts +9 -2
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +61 -44
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { Agent, AgentHandle, CreateAgentOptions, ResumeAgentOptions } from '@deepseek-ai/dsh-agent';
|
|
3
|
+
import type { SessionLease, SessionLeaseClaim, SessionLeaseTarget } from './session-lease-types.js';
|
|
4
|
+
export interface SessionLeasePort {
|
|
5
|
+
leaseMs: number;
|
|
6
|
+
/** Whether this durable Session is Delivery-owned and must have a local execution lease. */
|
|
7
|
+
requiresLease(sessionId: string): boolean;
|
|
8
|
+
claim(target: SessionLeaseTarget, holderId: string, leaseMs: number): SessionLeaseClaim;
|
|
9
|
+
dispatch(lease: SessionLease): boolean;
|
|
10
|
+
valid(lease: SessionLease): boolean;
|
|
11
|
+
renew(lease: SessionLease, leaseMs: number): boolean;
|
|
12
|
+
finish(lease: SessionLease, input: {
|
|
13
|
+
quiescent: boolean;
|
|
14
|
+
}): boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare class SessionLeaseUnavailable extends Error {
|
|
17
|
+
readonly kind: 'busy' | 'unknown' | 'denied';
|
|
18
|
+
constructor(kind: 'busy' | 'unknown' | 'denied');
|
|
19
|
+
}
|
|
20
|
+
/** One process-local owner of a durable token. Unknown is never a takeover grant. */
|
|
21
|
+
export declare class SessionExecutionLease {
|
|
22
|
+
#private;
|
|
23
|
+
readonly token: SessionLease;
|
|
24
|
+
private readonly port;
|
|
25
|
+
private readonly released;
|
|
26
|
+
readonly controller: AbortController;
|
|
27
|
+
readonly agents: Map<Agent, boolean>;
|
|
28
|
+
constructor(token: SessionLease, port: SessionLeasePort, outer: AbortSignal, released: () => void);
|
|
29
|
+
get signal(): AbortSignal;
|
|
30
|
+
assert(): void;
|
|
31
|
+
assertAgent(agent: Agent): void;
|
|
32
|
+
dispatch(): void;
|
|
33
|
+
attach(agent: Agent): void;
|
|
34
|
+
disposed(agent: Agent): void;
|
|
35
|
+
enter(): () => void;
|
|
36
|
+
cancel(reason?: unknown): void;
|
|
37
|
+
close(): void;
|
|
38
|
+
/** A rejected cold resume can leave an unobservable, abort-raced load behind. */
|
|
39
|
+
abandonConstruction(): void;
|
|
40
|
+
}
|
|
41
|
+
/** Shared by bound foreground work and unbound Session construction; wake must use this same port. */
|
|
42
|
+
export declare class DeliverySessionLeases {
|
|
43
|
+
#private;
|
|
44
|
+
private readonly ctx;
|
|
45
|
+
private readonly port;
|
|
46
|
+
constructor(ctx: Context, port: SessionLeasePort);
|
|
47
|
+
/** Host-only, one occurrence: a client source tag alone never grants owner authority. */
|
|
48
|
+
admitNativeInput(agent: Agent, input: {
|
|
49
|
+
requestId: string;
|
|
50
|
+
content: readonly unknown[];
|
|
51
|
+
onClaimed(turn: number): void;
|
|
52
|
+
}): {
|
|
53
|
+
inserted(): boolean;
|
|
54
|
+
dispose(): void;
|
|
55
|
+
};
|
|
56
|
+
get leaseMs(): number;
|
|
57
|
+
/**
|
|
58
|
+
* Use the host's one factory and the caller's ownership scope. These methods
|
|
59
|
+
* only consume an already admitted lease; they do not authorize Web input.
|
|
60
|
+
*/
|
|
61
|
+
create(owner: Context, options: CreateAgentOptions): Promise<AgentHandle>;
|
|
62
|
+
resume(owner: Context, options: ResumeAgentOptions): Promise<AgentHandle>;
|
|
63
|
+
open(target: SessionLeaseTarget, signal: AbortSignal): SessionExecutionLease;
|
|
64
|
+
attach(agent: Agent): void;
|
|
65
|
+
assert(sessionId: string): void;
|
|
66
|
+
cancel(sessionId: string, reason: unknown): void;
|
|
67
|
+
disposed(agent: Agent): void;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=session-lease-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-lease-runtime.d.ts","sourceRoot":"","sources":["../src/session-lease-runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAc,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAc,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAEpH,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAMnG,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,4FAA4F;IAC5F,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAA;IACzC,KAAK,CAAC,MAAM,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAAA;IACvF,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAA;IACtC,KAAK,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAA;IACnC,KAAK,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAA;IACpD,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAA;CACpE;AACD,qBAAa,uBAAwB,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,E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C,OAAO,IAAI,IAAI,CAAA;KAAE;IAY1C,IAAI,OAAO,IAAI,MAAM,CAA6B;IAElD;;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC;IAKzE,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC;IAuFzE,IAAI,CAAC,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,WAAW,GAAG,qBAAqB;IAW5E,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAM1B,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAK/B,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IAChD,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;CAyB7B"}
|
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
// Cordis publishes this as an erased const enum. Keep the value type-checked
|
|
3
|
+
// against its exact member without requiring a nonexistent runtime export.
|
|
4
|
+
const activeFiberState = 2;
|
|
5
|
+
export class SessionLeaseUnavailable extends Error {
|
|
6
|
+
kind;
|
|
7
|
+
constructor(kind) {
|
|
8
|
+
super(`assistant-delivery: session execution ${kind}`);
|
|
9
|
+
this.kind = kind;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
/** One process-local owner of a durable token. Unknown is never a takeover grant. */
|
|
13
|
+
export class SessionExecutionLease {
|
|
14
|
+
token;
|
|
15
|
+
port;
|
|
16
|
+
released;
|
|
17
|
+
controller = new AbortController();
|
|
18
|
+
agents = new Map();
|
|
19
|
+
#closed = false;
|
|
20
|
+
#released = false;
|
|
21
|
+
#pending = 0;
|
|
22
|
+
#unobservedCleanup = false;
|
|
23
|
+
#timer;
|
|
24
|
+
#removeAbort;
|
|
25
|
+
constructor(token, port, outer, released) {
|
|
26
|
+
this.token = token;
|
|
27
|
+
this.port = port;
|
|
28
|
+
this.released = released;
|
|
29
|
+
const abort = () => this.cancel(outer.reason);
|
|
30
|
+
outer.addEventListener('abort', abort, { once: true });
|
|
31
|
+
this.#removeAbort = () => outer.removeEventListener('abort', abort);
|
|
32
|
+
this.#timer = setInterval(() => {
|
|
33
|
+
try {
|
|
34
|
+
if (port.renew(token, port.leaseMs))
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
catch { }
|
|
38
|
+
this.cancel();
|
|
39
|
+
}, Math.max(1, Math.floor(port.leaseMs / 3)));
|
|
40
|
+
this.#timer.unref?.();
|
|
41
|
+
if (outer.aborted)
|
|
42
|
+
abort();
|
|
43
|
+
}
|
|
44
|
+
get signal() { return this.controller.signal; }
|
|
45
|
+
assert() {
|
|
46
|
+
if (this.#closed || this.#released || this.signal.aborted)
|
|
47
|
+
throw new SessionLeaseUnavailable('denied');
|
|
48
|
+
try {
|
|
49
|
+
if (this.port.valid(this.token))
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
catch { }
|
|
53
|
+
this.cancel();
|
|
54
|
+
throw new SessionLeaseUnavailable('denied');
|
|
55
|
+
}
|
|
56
|
+
assertAgent(agent) {
|
|
57
|
+
this.assert();
|
|
58
|
+
if (this.agents.get(agent) !== false)
|
|
59
|
+
throw new SessionLeaseUnavailable('denied');
|
|
60
|
+
}
|
|
61
|
+
dispatch() {
|
|
62
|
+
this.assert();
|
|
63
|
+
if (!this.port.dispatch(this.token)) {
|
|
64
|
+
this.cancel();
|
|
65
|
+
throw new SessionLeaseUnavailable('denied');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
attach(agent) { this.assert(); this.agents.set(agent, false); }
|
|
69
|
+
disposed(agent) {
|
|
70
|
+
if (this.agents.has(agent))
|
|
71
|
+
this.agents.set(agent, true);
|
|
72
|
+
this.#settle();
|
|
73
|
+
}
|
|
74
|
+
enter() {
|
|
75
|
+
this.assert();
|
|
76
|
+
this.#pending += 1;
|
|
77
|
+
let done = false;
|
|
78
|
+
return () => { if (done)
|
|
79
|
+
return; done = true; this.#pending -= 1; this.#settle(); };
|
|
80
|
+
}
|
|
81
|
+
cancel(reason = new SessionLeaseUnavailable('denied')) {
|
|
82
|
+
if (!this.signal.aborted)
|
|
83
|
+
this.controller.abort(reason);
|
|
84
|
+
for (const [agent, disposed] of this.agents)
|
|
85
|
+
if (!disposed) {
|
|
86
|
+
try {
|
|
87
|
+
agent.cancel({ kind: 'hook', reason: 'assistant-delivery-session-lease-lost' });
|
|
88
|
+
}
|
|
89
|
+
catch { }
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
close() {
|
|
93
|
+
if (this.#closed)
|
|
94
|
+
return;
|
|
95
|
+
this.#closed = true;
|
|
96
|
+
clearInterval(this.#timer);
|
|
97
|
+
this.#removeAbort();
|
|
98
|
+
this.#settle();
|
|
99
|
+
}
|
|
100
|
+
/** A rejected cold resume can leave an unobservable, abort-raced load behind. */
|
|
101
|
+
abandonConstruction() {
|
|
102
|
+
this.#unobservedCleanup = true;
|
|
103
|
+
this.cancel();
|
|
104
|
+
this.close();
|
|
105
|
+
}
|
|
106
|
+
#settle() {
|
|
107
|
+
if (!this.#closed || this.#released)
|
|
108
|
+
return;
|
|
109
|
+
const quiescent = !this.#unobservedCleanup && this.#pending === 0 && [...this.agents.values()].every(Boolean);
|
|
110
|
+
try {
|
|
111
|
+
if (this.port.finish(this.token, { quiescent }) && quiescent) {
|
|
112
|
+
this.#released = true;
|
|
113
|
+
this.released();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
catch { /* Store outage keeps the durable dispatched/unknown fence occupied. */ }
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/** Shared by bound foreground work and unbound Session construction; wake must use this same port. */
|
|
120
|
+
export class DeliverySessionLeases {
|
|
121
|
+
ctx;
|
|
122
|
+
port;
|
|
123
|
+
#active = new Map();
|
|
124
|
+
#agents = new WeakMap();
|
|
125
|
+
#nativeInputs = new WeakMap();
|
|
126
|
+
#factoryGeneration = 0;
|
|
127
|
+
#live = true;
|
|
128
|
+
constructor(ctx, port) {
|
|
129
|
+
this.ctx = ctx;
|
|
130
|
+
this.port = port;
|
|
131
|
+
// Cordis synchronously notifies availability transitions and replacement.
|
|
132
|
+
// A new live provider must not make an old factory's abort look settled.
|
|
133
|
+
ctx.on('internal/service', name => {
|
|
134
|
+
if (name === 'agentLoop')
|
|
135
|
+
this.#factoryGeneration += 1;
|
|
136
|
+
});
|
|
137
|
+
const nativeInput = (agent, message, turn) => {
|
|
138
|
+
if (message.source !== undefined && message.source.kind !== 'user')
|
|
139
|
+
return;
|
|
140
|
+
const permit = this.#nativeInputs.get(agent);
|
|
141
|
+
const source = message.source;
|
|
142
|
+
try {
|
|
143
|
+
this.#agents.get(agent)?.assertAgent(agent);
|
|
144
|
+
if (permit !== undefined && source?.kind === 'user' && source.rpcId === permit.requestId
|
|
145
|
+
&& JSON.stringify(message.content) === permit.content) {
|
|
146
|
+
if (turn === undefined && permit.message === undefined) {
|
|
147
|
+
permit.message = message;
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (turn !== undefined && permit.message === message && !permit.claimed) {
|
|
151
|
+
permit.claimed = true;
|
|
152
|
+
permit.onClaimed(turn);
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
catch { /* A stale or invalid exact admission cancels the whole lane. */ }
|
|
158
|
+
this.#agents.get(agent)?.cancel();
|
|
159
|
+
};
|
|
160
|
+
ctx.on('agent/inbox/inserted', ({ agent, message }) => nativeInput(agent, message), { prepend: true });
|
|
161
|
+
ctx.on('agent/inbox/claimed', ({ agent, message, turn }) => nativeInput(agent, message, turn), { prepend: true });
|
|
162
|
+
ctx.on('agent/request', async ({ agent }, next) => {
|
|
163
|
+
this.#assertAgent(agent);
|
|
164
|
+
const result = await next();
|
|
165
|
+
this.#assertAgent(agent);
|
|
166
|
+
return result;
|
|
167
|
+
}, { prepend: true });
|
|
168
|
+
ctx.on('tools/pre-execute', async ({ agent }, next) => {
|
|
169
|
+
this.#assertAgent(agent);
|
|
170
|
+
const result = await next();
|
|
171
|
+
this.#assertAgent(agent);
|
|
172
|
+
return result;
|
|
173
|
+
}, { prepend: true });
|
|
174
|
+
ctx.on('tools/execute', async ({ agent }, next) => {
|
|
175
|
+
const lease = this.#assertAgent(agent);
|
|
176
|
+
const done = lease?.enter();
|
|
177
|
+
try {
|
|
178
|
+
const result = await next();
|
|
179
|
+
this.#assertAgent(agent);
|
|
180
|
+
return result;
|
|
181
|
+
}
|
|
182
|
+
finally {
|
|
183
|
+
done?.();
|
|
184
|
+
}
|
|
185
|
+
}, { prepend: true });
|
|
186
|
+
ctx.inject(['tools'], runtime => runtime.tools.guard(({ agent }) => {
|
|
187
|
+
try {
|
|
188
|
+
this.#assertAgent(agent);
|
|
189
|
+
return undefined;
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
return 'assistant-delivery: session lease no longer authorizes this tool';
|
|
193
|
+
}
|
|
194
|
+
}));
|
|
195
|
+
ctx.on('llm/stream', this.#stream.bind(this), { prepend: true });
|
|
196
|
+
ctx.effect(() => () => {
|
|
197
|
+
this.#live = false;
|
|
198
|
+
for (const lease of this.#active.values()) {
|
|
199
|
+
lease.cancel();
|
|
200
|
+
lease.close();
|
|
201
|
+
}
|
|
202
|
+
}, 'assistant-delivery.session-leases');
|
|
203
|
+
}
|
|
204
|
+
/** Host-only, one occurrence: a client source tag alone never grants owner authority. */
|
|
205
|
+
admitNativeInput(agent, input) {
|
|
206
|
+
const lease = this.#agents.get(agent);
|
|
207
|
+
if (lease === undefined || this.#nativeInputs.has(agent))
|
|
208
|
+
throw new SessionLeaseUnavailable('denied');
|
|
209
|
+
lease.assertAgent(agent);
|
|
210
|
+
const permit = { requestId: input.requestId, content: JSON.stringify(input.content),
|
|
211
|
+
claimed: false, onClaimed: input.onClaimed, message: undefined };
|
|
212
|
+
this.#nativeInputs.set(agent, permit);
|
|
213
|
+
return { inserted: () => permit.message !== undefined, dispose: () => {
|
|
214
|
+
if (this.#nativeInputs.get(agent) === permit)
|
|
215
|
+
this.#nativeInputs.delete(agent);
|
|
216
|
+
} };
|
|
217
|
+
}
|
|
218
|
+
get leaseMs() { return this.port.leaseMs; }
|
|
219
|
+
/**
|
|
220
|
+
* Use the host's one factory and the caller's ownership scope. These methods
|
|
221
|
+
* only consume an already admitted lease; they do not authorize Web input.
|
|
222
|
+
*/
|
|
223
|
+
create(owner, options) {
|
|
224
|
+
const agents = owner.reflect.trace(this.ctx.agents);
|
|
225
|
+
return this.#construct(owner, 'create', String(options.sessionId), options, (setup, signal) => agents.create({ ...options, setup, signal }));
|
|
226
|
+
}
|
|
227
|
+
resume(owner, options) {
|
|
228
|
+
const agents = owner.reflect.trace(this.ctx.agents);
|
|
229
|
+
return this.#construct(owner, 'resume', String(options.resumeSessionId), options, (setup, signal) => agents.resume({ ...options, setup, signal }));
|
|
230
|
+
}
|
|
231
|
+
async #construct(owner, kind, sessionId, options, factory) {
|
|
232
|
+
const lease = this.#active.get(sessionId);
|
|
233
|
+
if (lease === undefined)
|
|
234
|
+
throw new SessionLeaseUnavailable('denied');
|
|
235
|
+
lease.assert();
|
|
236
|
+
options.signal?.throwIfAborted();
|
|
237
|
+
const ownerAbort = new AbortController();
|
|
238
|
+
let constructing = true;
|
|
239
|
+
const unwatchOwner = owner.effect(() => () => {
|
|
240
|
+
if (constructing)
|
|
241
|
+
ownerAbort.abort(new SessionLeaseUnavailable('denied'));
|
|
242
|
+
}, 'assistant-delivery.agent-construction');
|
|
243
|
+
const signal = AbortSignal.any([lease.signal, ownerAbort.signal, ...(options.signal === undefined ? [] : [options.signal])]);
|
|
244
|
+
const factoryGeneration = this.#factoryGeneration;
|
|
245
|
+
const nativeFactory = this.ctx.get('agentLoop') !== undefined;
|
|
246
|
+
// A cold persistence load may not have produced an Agent yet. It still
|
|
247
|
+
// occupies the lease until the factory settles and native rollback drains.
|
|
248
|
+
let finishConstruction;
|
|
249
|
+
let prepared;
|
|
250
|
+
let native;
|
|
251
|
+
try {
|
|
252
|
+
finishConstruction = lease.enter();
|
|
253
|
+
native = await factory(async (agentCtx) => {
|
|
254
|
+
const agent = agentCtx.agent;
|
|
255
|
+
if (agent === undefined || String(agent.session.id) !== sessionId)
|
|
256
|
+
throw new SessionLeaseUnavailable('denied');
|
|
257
|
+
lease.attach(agent);
|
|
258
|
+
this.#agents.set(agent, lease);
|
|
259
|
+
prepared = agent;
|
|
260
|
+
const setup = await options.setup?.(agentCtx);
|
|
261
|
+
lease.assertAgent(agent);
|
|
262
|
+
// Preserve the native setup commit and revalidate at publication, not
|
|
263
|
+
// just before the last async setup operation returns.
|
|
264
|
+
return { commit: () => {
|
|
265
|
+
lease.assertAgent(agent);
|
|
266
|
+
setup?.commit();
|
|
267
|
+
lease.assertAgent(agent);
|
|
268
|
+
} };
|
|
269
|
+
}, signal);
|
|
270
|
+
if (native.agent !== prepared)
|
|
271
|
+
throw new SessionLeaseUnavailable('denied');
|
|
272
|
+
lease.assertAgent(native.agent);
|
|
273
|
+
const handle = native;
|
|
274
|
+
let disposal;
|
|
275
|
+
const drain = () => disposal ??= Promise.resolve().then(() => handle.dispose())
|
|
276
|
+
.then(() => lease.disposed(handle.agent));
|
|
277
|
+
let detached = false;
|
|
278
|
+
// Controller consumers may retain only the Agent. The owner's fiber
|
|
279
|
+
// must still await the native memoized disposer, not merely observe an
|
|
280
|
+
// idle status or a registry notification. This also covers concurrent
|
|
281
|
+
// teardown by the upstream factory's own owner effect.
|
|
282
|
+
const detachOwner = owner.effect(() => async () => {
|
|
283
|
+
if (detached)
|
|
284
|
+
return;
|
|
285
|
+
detached = true;
|
|
286
|
+
lease.cancel();
|
|
287
|
+
lease.close();
|
|
288
|
+
await drain();
|
|
289
|
+
}, 'assistant-delivery.owned-agent');
|
|
290
|
+
return { agent: handle.agent, dispose: async () => {
|
|
291
|
+
await drain();
|
|
292
|
+
if (!detached) {
|
|
293
|
+
detached = true;
|
|
294
|
+
await detachOwner();
|
|
295
|
+
}
|
|
296
|
+
} };
|
|
297
|
+
}
|
|
298
|
+
catch (error) {
|
|
299
|
+
// rc.1 races prepare against caller, owner and factory cancellation.
|
|
300
|
+
// Only an unchanged live native factory + live owner + non-aborted
|
|
301
|
+
// caller rules out all three abort branches. Otherwise the rejected
|
|
302
|
+
// public Promise says nothing about late preparation cleanup. Error
|
|
303
|
+
// names/text are deliberately not a settlement or release capability.
|
|
304
|
+
const loadSettled = nativeFactory && this.#live && !signal.aborted
|
|
305
|
+
&& owner.fiber.state === activeFiberState
|
|
306
|
+
&& factoryGeneration === this.#factoryGeneration
|
|
307
|
+
&& this.ctx.get('agentLoop') !== undefined;
|
|
308
|
+
if (kind === 'resume' && prepared === undefined && !loadSettled)
|
|
309
|
+
lease.abandonConstruction();
|
|
310
|
+
// Once setup has received an Agent, rc.1 awaits its native rollback.
|
|
311
|
+
// Unpublished setup has no agent/disposed event: remember its exact
|
|
312
|
+
// object rather than marking every Agent with the same Session disposed.
|
|
313
|
+
if (native !== undefined)
|
|
314
|
+
await native.dispose();
|
|
315
|
+
if (prepared !== undefined)
|
|
316
|
+
lease.disposed(prepared);
|
|
317
|
+
throw error;
|
|
318
|
+
}
|
|
319
|
+
finally {
|
|
320
|
+
constructing = false;
|
|
321
|
+
try {
|
|
322
|
+
await unwatchOwner();
|
|
323
|
+
}
|
|
324
|
+
finally {
|
|
325
|
+
finishConstruction?.();
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
open(target, signal) {
|
|
330
|
+
if (!this.#live)
|
|
331
|
+
throw new SessionLeaseUnavailable('denied');
|
|
332
|
+
signal.throwIfAborted();
|
|
333
|
+
const claim = this.port.claim(target, `delivery-session-${randomUUID()}`, this.port.leaseMs);
|
|
334
|
+
if (claim.kind !== 'claimed')
|
|
335
|
+
throw new SessionLeaseUnavailable(claim.kind);
|
|
336
|
+
const lease = new SessionExecutionLease(claim.lease, this.port, signal, () => {
|
|
337
|
+
if (this.#active.get(claim.lease.sessionId) === lease)
|
|
338
|
+
this.#active.delete(claim.lease.sessionId);
|
|
339
|
+
});
|
|
340
|
+
this.#active.set(claim.lease.sessionId, lease);
|
|
341
|
+
return lease;
|
|
342
|
+
}
|
|
343
|
+
attach(agent) {
|
|
344
|
+
const lease = this.#active.get(String(agent.session.id));
|
|
345
|
+
if (lease === undefined)
|
|
346
|
+
throw new SessionLeaseUnavailable('denied');
|
|
347
|
+
lease.attach(agent);
|
|
348
|
+
this.#agents.set(agent, lease);
|
|
349
|
+
}
|
|
350
|
+
assert(sessionId) {
|
|
351
|
+
const lease = this.#active.get(sessionId);
|
|
352
|
+
if (lease === undefined)
|
|
353
|
+
throw new SessionLeaseUnavailable('denied');
|
|
354
|
+
lease.assert();
|
|
355
|
+
}
|
|
356
|
+
cancel(sessionId, reason) { this.#active.get(sessionId)?.cancel(reason); }
|
|
357
|
+
disposed(agent) { this.#agents.get(agent)?.disposed(agent); }
|
|
358
|
+
async *#stream(_options, next) {
|
|
359
|
+
const agent = this.ctx.get('agents')?.currentInitiator();
|
|
360
|
+
const lease = this.#assertAgent(agent);
|
|
361
|
+
const done = lease?.enter();
|
|
362
|
+
try {
|
|
363
|
+
for await (const chunk of next()) {
|
|
364
|
+
this.#assertAgent(agent);
|
|
365
|
+
yield chunk;
|
|
366
|
+
}
|
|
367
|
+
this.#assertAgent(agent);
|
|
368
|
+
}
|
|
369
|
+
finally {
|
|
370
|
+
done?.();
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
#assertAgent(agent) {
|
|
374
|
+
if (agent === undefined)
|
|
375
|
+
return undefined;
|
|
376
|
+
const lease = this.#agents.get(agent);
|
|
377
|
+
if (lease !== undefined) {
|
|
378
|
+
lease.assertAgent(agent);
|
|
379
|
+
return lease;
|
|
380
|
+
}
|
|
381
|
+
try {
|
|
382
|
+
if (!this.port.requiresLease(String(agent.session.id)))
|
|
383
|
+
return undefined;
|
|
384
|
+
}
|
|
385
|
+
catch {
|
|
386
|
+
// A failed ownership lookup must not grant native/Web execution.
|
|
387
|
+
}
|
|
388
|
+
try {
|
|
389
|
+
agent.cancel({ kind: 'hook', reason: 'assistant-delivery-session-lease-required' });
|
|
390
|
+
}
|
|
391
|
+
catch { }
|
|
392
|
+
throw new SessionLeaseUnavailable('denied');
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
//# sourceMappingURL=session-lease-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-lease-runtime.js","sourceRoot":"","sources":["../src/session-lease-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAMxC,6EAA6E;AAC7E,2EAA2E;AAC3E,MAAM,gBAAgB,GAAsB,CAAC,CAAA;AAY7C,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAC3B;IAArB,YAAqB,IAAmC;QACtD,KAAK,CAAC,yCAAyC,IAAI,EAAE,CAAC,CAAA;QADnC,SAAI,GAAJ,IAAI,CAA+B;IAExD,CAAC;CACF;AAED,qFAAqF;AACrF,MAAM,OAAO,qBAAqB;IASX;IAAsC;IACpB;IAT9B,UAAU,GAAG,IAAI,eAAe,EAAE,CAAA;IAClC,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAA;IAC3C,OAAO,GAAG,KAAK,CAAA;IACf,SAAS,GAAG,KAAK,CAAA;IACjB,QAAQ,GAAG,CAAC,CAAA;IACZ,kBAAkB,GAAG,KAAK,CAAA;IAC1B,MAAM,CAAgC;IACtC,YAAY,CAAY;IACxB,YAAqB,KAAmB,EAAmB,IAAsB,EAC/E,KAAkB,EAAmB,QAAoB;QADtC,UAAK,GAAL,KAAK,CAAc;QAAmB,SAAI,GAAJ,IAAI,CAAkB;QAC1C,aAAQ,GAAR,QAAQ,CAAY;QACzD,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC,IAAI,C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,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QACrC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;YACxB,OAAO,KAAK,CAAA;QACd,CAAC;QACD,IAAI,CAAC;YACH,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;gBAAE,OAAO,SAAS,CAAA;QAC1E,CAAC;QAAC,MAAM,CAAC;YACP,iEAAiE;QACnE,CAAC;QACD,IAAI,CAAC;YAAC,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,2CAA2C,EAAE,CAAC,CAAA;QAAC,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;QACpG,MAAM,IAAI,uBAAuB,CAAC,QAAQ,CAAC,CAAA;IAC7C,CAAC;CACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ConversationBinding, ConversationRef, ExternalPrincipalKey } from './types.js';
|
|
2
|
+
export type SessionLeaseTarget = {
|
|
3
|
+
kind: 'bound';
|
|
4
|
+
binding: Readonly<ConversationBinding>;
|
|
5
|
+
} | {
|
|
6
|
+
kind: 'construction';
|
|
7
|
+
sessionId: string;
|
|
8
|
+
conversation: ConversationRef;
|
|
9
|
+
principal: ExternalPrincipalKey;
|
|
10
|
+
workspace: string;
|
|
11
|
+
agentPreset: string;
|
|
12
|
+
generation: number;
|
|
13
|
+
previous?: Readonly<ConversationBinding>;
|
|
14
|
+
};
|
|
15
|
+
export interface SessionLease {
|
|
16
|
+
sessionId: string;
|
|
17
|
+
holderId: string;
|
|
18
|
+
fencingToken: number;
|
|
19
|
+
leaseUntil: number;
|
|
20
|
+
}
|
|
21
|
+
export type SessionLeaseClaim = {
|
|
22
|
+
kind: 'claimed';
|
|
23
|
+
lease: SessionLease;
|
|
24
|
+
} | {
|
|
25
|
+
kind: 'busy' | 'unknown' | 'denied';
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=session-lease-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-lease-types.d.ts","sourceRoot":"","sources":["../src/session-lease-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAE5F,MAAM,MAAM,kBAAkB,GAC1B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAC,mBAAmB,CAAC,CAAA;CAAE,GACzD;IACA,IAAI,EAAE,cAAc,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,eAAe,CAAA;IAC7B,SAAS,EAAE,oBAAoB,CAAA;IAC/B,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,QAAQ,CAAC,mBAAmB,CAAC,CAAA;CACzC,CAAA;AAEH,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,YAAY,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAA;CAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-lease-types.js","sourceRoot":"","sources":["../src/session-lease-types.ts"],"names":[],"mappings":""}
|
package/lib/sqlite.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DatabaseSync } from 'node:sqlite';
|
|
2
|
-
export declare const deliverySchemaVersion =
|
|
2
|
+
export declare const deliverySchemaVersion = 20;
|
|
3
3
|
export declare class DeliveryDatabaseError extends Error {
|
|
4
4
|
readonly code: 'invalid-path' | 'schema-too-new';
|
|
5
5
|
constructor(code: 'invalid-path' | 'schema-too-new', message: string);
|
package/lib/sqlite.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../src/sqlite.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,eAAO,MAAM,qBAAqB,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../src/sqlite.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,eAAO,MAAM,qBAAqB,KAAK,CAAA;AA8qBvC,qBAAa,qBAAsB,SAAQ,KAAK;IAClC,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,gBAAgB;gBAAvC,IAAI,EAAE,cAAc,GAAG,gBAAgB,EAAE,OAAO,EAAE,MAAM;CAI9E;AAujBD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAwB/D"}
|