@qilin-agent/agent 0.0.0-stage → 3.1.3

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.
@@ -0,0 +1,410 @@
1
+ /**
2
+ * Public agent types and live-runtime events. Durable transcript facts and
3
+ * turn/step boundaries remain `@qilin-agent/session` events.
4
+ *
5
+ * @module @qilin-agent/agent
6
+ */
7
+ import type { Context } from '@qilin-agent/kylin';
8
+ import type { Scoped } from '@qilin-agent/scope';
9
+ import type { LlmAttemptId, LlmCallConfig, LlmFailure, MessageId, ReasoningEffortId, ResolvedRetryPolicy, StreamChunk } from '@qilin-agent/llm';
10
+ import type { AgentCancelCause, Session, SessionSeq, UserMessage } from '@qilin-agent/session';
11
+ export type { AgentCancelCause } from '@qilin-agent/session';
12
+ import type { Agent, InboxTarget } from './types.ts';
13
+ export type { Agent } from './types.ts';
14
+ declare module '@qilin-agent/system-prompt' {
15
+ interface AssembleContext {
16
+ /** Agent for this assembly; absent on diagnostics. When present, `scope` must identify the same agent. */
17
+ agent?: Agent;
18
+ }
19
+ }
20
+ /** Merge-extensible agent creation options. Persona belongs to system-prompt sections. */
21
+ export interface AgentOptions {
22
+ /** Provider route (must have a registered adapter at call time). */
23
+ provider?: string;
24
+ /** Model id interpreted by the selected provider adapter. */
25
+ model?: string;
26
+ /** Adapter-owned reasoning effort for the selected provider/model route. */
27
+ reasoningEffort?: ReasoningEffortId;
28
+ /** Maximum output tokens for each conversation-model request. */
29
+ maxTokens?: number;
30
+ }
31
+ /** Options for {@link Agent.cancel}. */
32
+ export interface CancelOptions {
33
+ /**
34
+ * Preserve queued and steering inbox items instead of discarding them. The
35
+ * active turn is still aborted, but un-started and pending work survives for a
36
+ * later turn and no canceled inbox splice is logged.
37
+ */
38
+ keepInbox?: boolean | undefined;
39
+ }
40
+ /** Agent-owned access to pending work; concrete storage belongs to the driver. */
41
+ export interface Inbox {
42
+ /** Prompts awaiting individual turns. */
43
+ readonly nextTurn: readonly UserMessage[];
44
+ /** Input awaiting the next step boundary. */
45
+ readonly nextStep: readonly UserMessage[];
46
+ /** Durably cancel all pending input, clearing next-step before next-turn. */
47
+ clear(): void;
48
+ /**
49
+ * Append one message to a pending list.
50
+ * @param target - pending list to extend.
51
+ * @param message - message to append.
52
+ */
53
+ append(target: InboxTarget, message: UserMessage): void;
54
+ /**
55
+ * Prepend one message to a pending list.
56
+ * @param target - pending list to extend.
57
+ * @param message - message to prepend.
58
+ */
59
+ prepend(target: InboxTarget, message: UserMessage): void;
60
+ /**
61
+ * Replace one pending message in place.
62
+ * @param messageId - identity of the pending message to replace.
63
+ * @param newMessage - replacement message.
64
+ * @returns whether the message was still pending.
65
+ */
66
+ replace(messageId: MessageId, newMessage: UserMessage): boolean;
67
+ /**
68
+ * Remove one pending message.
69
+ * @param messageId - identity of the pending message to remove.
70
+ * @returns whether the message was still pending.
71
+ */
72
+ remove(messageId: MessageId): boolean;
73
+ /**
74
+ * Apply standard splice semantics and durably record the normalized result.
75
+ * @param target - pending list to mutate.
76
+ * @param start - splice position.
77
+ * @param deleteCount - maximum number of messages to remove.
78
+ * @param inserted - messages to insert at the resolved position.
79
+ * @returns messages removed by the splice.
80
+ */
81
+ splice(target: InboxTarget, start: number, deleteCount: number, inserted: UserMessage[]): UserMessage[];
82
+ }
83
+ /**
84
+ * An agent's lifecycle state, emitted on every transition as `agent/status`:
85
+ * `idle` means no driver is active; `running` begins when waking input starts
86
+ * cancellable pre-step processing and lasts while the driver drains,
87
+ * closes, or checkpoints turns. Disposal removes the agent from its registry;
88
+ * it is not a third observable status.
89
+ */
90
+ export type AgentStatus = 'idle' | 'running';
91
+ /** Whether and with which messages the loop enters a proposed step. */
92
+ export type PreStepDecision = {
93
+ kind: 'reject';
94
+ } | {
95
+ kind: 'enter';
96
+ messages: UserMessage[];
97
+ /** Start a distinct model-message series before this step's admitted messages. */
98
+ startsRequestSeries?: true;
99
+ };
100
+ /** Action returned by a listener that owns model-request recovery. */
101
+ export type RequestErrorAction = {
102
+ kind: 'retry';
103
+ } | undefined;
104
+ /** Why a session lifecycle began; seeded creates are `startup`, while persisted loads are `resume`. */
105
+ export type SessionStartSource = 'startup' | 'resume' | 'clear' | 'compact';
106
+ /** One process-local live assistant streaming publication. */
107
+ export type AssistantStreamFrame = {
108
+ readonly type: 'start';
109
+ readonly attemptId: LlmAttemptId;
110
+ /** Monotone within one attached Agent lifecycle; replacement restarts at 1. */
111
+ readonly revision: number;
112
+ readonly turn: number;
113
+ readonly step: number;
114
+ } | {
115
+ readonly type: 'chunk';
116
+ readonly attemptId: LlmAttemptId;
117
+ readonly revision: number;
118
+ /** Dense zero-based position within the attempt. */
119
+ readonly index: number;
120
+ /** Safe-integer timestamp reused by the durable embedded stream. */
121
+ readonly time: number;
122
+ readonly chunk: StreamChunk;
123
+ } | {
124
+ readonly type: 'end';
125
+ readonly attemptId: LlmAttemptId;
126
+ readonly revision: number;
127
+ /** Number of chunk frames emitted by this attempt. */
128
+ readonly index: number;
129
+ /** Durable settlement committed before this notification, or live abandonment without one. */
130
+ readonly outcome: {
131
+ readonly kind: 'committed';
132
+ readonly eventType: 'assistant/message' | 'assistant/attempt';
133
+ readonly seq: SessionSeq;
134
+ } | {
135
+ readonly kind: 'abandoned';
136
+ };
137
+ };
138
+ declare module './types.ts' {
139
+ interface Agent {
140
+ /** The provider route and model this agent's requests use. */
141
+ readonly options: AgentOptions;
142
+ /** The live session this agent drives; its log is the durable source of truth. */
143
+ readonly session: Session;
144
+ /** Agent-owned access to durable pending work. */
145
+ readonly inbox: Inbox;
146
+ /** The current lifecycle state, mirrored on every `agent/status` transition. */
147
+ readonly status: AgentStatus;
148
+ /** Agent-scoped context; its contributions are agent-local, unwind on disposal, and reject registration afterward. */
149
+ readonly ctx: Context;
150
+ /**
151
+ * Clear queued and steering work — unless `keepInbox` — and abort the active
152
+ * turn or between-turn task. The first cause wins for that activity. With no
153
+ * active activity, cancellation is a no-op and does not arm later work.
154
+ * @param cause - the stable caller intent carried by the active operation signal.
155
+ * @param options - cancellation options; `keepInbox` preserves pending work.
156
+ */
157
+ cancel(cause: AgentCancelCause, options?: CancelOptions): void;
158
+ /**
159
+ * Resolve after the current whole-agent activity reaches quiescence. This
160
+ * follows replacement work started before the observed driver retires,
161
+ * but does not identify the settlement of any particular message.
162
+ * @returns fulfillment after no active driver or maintenance task remains.
163
+ */
164
+ whenIdle(): Promise<void>;
165
+ /**
166
+ * Run one non-turn maintenance task from the true idle phase. The task starts
167
+ * synchronously after claiming that phase; later waking input remains in the
168
+ * inbox until the task settles, while public status stays `idle`.
169
+ * `whenIdle()` follows both the task and any waking work released behind it.
170
+ * @param task - operation whose fulfillment or rejection is preserved, with a signal aborted by {@link cancel}.
171
+ * @throws synchronously when turn-driving or another maintenance task already owns the agent.
172
+ * @returns the task promise.
173
+ */
174
+ runMaintenance<T>(task: (signal: AbortSignal) => Promise<T>): Promise<T>;
175
+ /**
176
+ * Route identified input to an inbox boundary and optionally wake the driver.
177
+ * Waking input submitted after active cancellation is queued for the next
178
+ * turn and runs when the aborted activity converges to idle; a `disposed`
179
+ * cancel leaves it parked. A wake submitted while already idle always opens
180
+ * its turn boundary, even when its message is cleared before the driver
181
+ * claims ([cancel-convergence wake latch](../../../../.agents/notes/implemented/bug-fix/2026-08-07-cancel-convergence-wake-latch.md)).
182
+ * @param message - identified content and the source that supplied it.
183
+ * @param target - the preferred next-turn or next-step inbox boundary.
184
+ * @param wakeup - whether delivery may wake the driver.
185
+ */
186
+ send(message: UserMessage, target: InboxTarget, wakeup: boolean): void;
187
+ /**
188
+ * Queue an ordinary follow-up turn and wake the driver. The item becomes the
189
+ * sole ordinary message of its own turn.
190
+ * @param message - identified prompt content and the source that supplied it.
191
+ */
192
+ followup(message: UserMessage): void;
193
+ /**
194
+ * Submit steering for the nearest step. An idle driver starts a turn;
195
+ * a running driver consumes it at its next step boundary.
196
+ * A rejected step leaves steering parked in the inbox until the next
197
+ * wake; cancellation or disposal may discard pending steering.
198
+ * @param message - identified steering content and the source that supplied it.
199
+ */
200
+ steer(message: UserMessage): void;
201
+ /**
202
+ * Queue model-facing context for the next pre-step without waking the
203
+ * driver. A running driver claims it at the nearest later step boundary;
204
+ * idle drivers leave it pending until follow-up or steering
205
+ * wakes them. It may miss a request whose pre-step already claimed its
206
+ * batch. Cancellation or disposal may discard pending context.
207
+ * @param message - identified injected context and the source that supplied it.
208
+ */
209
+ inject(message: UserMessage): void;
210
+ }
211
+ }
212
+ declare module '@qilin-agent/kylin' {
213
+ interface Events {
214
+ /**
215
+ * An entered agent is ready for per-agent initialization after factory setup.
216
+ * Listeners run in order and are awaited before creation resolves. AgentLoop
217
+ * holds queued input until all listeners finish. A throw or rejection fails
218
+ * creation and skips later listeners. Disposal retains the scope and session
219
+ * until dispatch settles; listeners must not await agent.whenIdle() or their
220
+ * own owner's disposal.
221
+ * @param payload.agent - the newly registered agent with its live session and completed setup.
222
+ * @param payload.source - fresh creation, resume, clear, or compaction source.
223
+ * @param payload.signal - factory initialization cancellation signal, when provided.
224
+ * Scope-filtered dispatch (`@qilin-agent/scope`): agent-scoped listeners receive only that agent.
225
+ * @mode serial
226
+ */
227
+ 'agent/created'(this: Scoped<Agent>, payload: {
228
+ agent: Agent;
229
+ source: SessionStartSource;
230
+ signal?: AbortSignal;
231
+ }): undefined | Promise<undefined>;
232
+ /**
233
+ * An agent left the registry; AgentLoop emits this after driver quiescence
234
+ * and scoped-registration unwind, but before session detachment. Custom
235
+ * registry users own their driver-ordering contract.
236
+ * @param payload.agent - the exact agent removed from the registry.
237
+ * Scope-filtered dispatch (`@qilin-agent/scope`): agent-scoped listeners receive only that agent.
238
+ * @mode emit
239
+ */
240
+ 'agent/disposed'(this: Scoped<Agent>, payload: {
241
+ agent: Agent;
242
+ }): void;
243
+ /**
244
+ * Agent status changed (`idle` ⇄ `running`). A waking delivery enters
245
+ * `running` synchronously after reserving cancellation; `idle` means no
246
+ * driver remains scheduled or active.
247
+ * @param payload.agent - the agent whose status flipped.
248
+ * @param payload.status - the status just entered (the transition's destination).
249
+ * Scope-filtered dispatch (`@qilin-agent/scope`): agent-scoped listeners receive only that agent.
250
+ * @mode emit
251
+ */
252
+ 'agent/status'(this: Scoped<Agent>, payload: {
253
+ agent: Agent;
254
+ status: AgentStatus;
255
+ }): void;
256
+ /**
257
+ * One message entered the live inbox.
258
+ * @param payload.agent - the agent whose inbox changed.
259
+ * @param payload.message - the inserted message.
260
+ * Scope-filtered dispatch (`@qilin-agent/scope`): agent-scoped listeners receive only that agent.
261
+ * @mode emit
262
+ */
263
+ 'agent/inbox/inserted'(this: Scoped<Agent>, payload: {
264
+ agent: Agent;
265
+ message: UserMessage;
266
+ }): void;
267
+ /**
268
+ * One message left the inbox inside its open turn. If the proposed step
269
+ * is rejected, the claimed message ends here: it is neither discarded nor
270
+ * re-emitted as a user/message, and the turn closes without a step.
271
+ * @param payload.agent - the agent whose inbox changed.
272
+ * @param payload.message - the claimed message.
273
+ * @param payload.turn - the owning turn.
274
+ * Scope-filtered dispatch (`@qilin-agent/scope`): agent-scoped listeners receive only that agent.
275
+ * @mode emit
276
+ */
277
+ 'agent/inbox/claimed'(this: Scoped<Agent>, payload: {
278
+ agent: Agent;
279
+ message: UserMessage;
280
+ turn: number;
281
+ }): void;
282
+ /**
283
+ * One message was discarded from the live inbox.
284
+ * @param payload.agent - the agent whose inbox changed.
285
+ * @param payload.message - the discarded message.
286
+ * Scope-filtered dispatch (`@qilin-agent/scope`): agent-scoped listeners receive only that agent.
287
+ * @mode emit
288
+ */
289
+ 'agent/inbox/discarded'(this: Scoped<Agent>, payload: {
290
+ agent: Agent;
291
+ message: UserMessage;
292
+ }): void;
293
+ /**
294
+ * Reject a proposed step or replace the messages that enter it. Calling
295
+ * `next()` preserves the current messages.
296
+ * @param payload.agent - the agent proposing the step.
297
+ * @param payload.messages - messages removed from the inbox for this step.
298
+ * @param payload.turn - the turn that will own the step.
299
+ * @param payload.step - the step proposed by the loop.
300
+ * @param payload.signal - the current turn's cancellation signal.
301
+ * Scope-filtered dispatch (`@qilin-agent/scope`): agent-scoped listeners receive only that agent.
302
+ * @mode waterfall
303
+ */
304
+ 'agent/pre-step'(this: Scoped<Agent>, payload: {
305
+ agent: Agent;
306
+ messages: UserMessage[];
307
+ turn: number;
308
+ step: number;
309
+ signal: AbortSignal;
310
+ }, next: () => Promise<PreStepDecision>): Promise<PreStepDecision>;
311
+ /**
312
+ * Replace the frozen call configuration. `await next()` yields the config
313
+ * the machine would use (agent options on the first request, the logged
314
+ * header afterwards); return a replacement to switch. On step admission,
315
+ * this runs after assembly and `step/start`, before the system prompt and
316
+ * accepted user batch are committed. Cancellation here or during subsequent
317
+ * `prepareCall()` resolution commits neither. The prepared call capability
318
+ * governs prompt admission. Model-visible content must use logged channels;
319
+ * this waterfall cannot mutate messages.
320
+ * @param payload.agent - the agent making the model call.
321
+ * @param payload.turn - the open turn number.
322
+ * @param payload.step - the step whose request this is.
323
+ * @param payload.signal - the current turn's explicit abort signal.
324
+ * Scope-filtered dispatch (`@qilin-agent/scope`): agent-scoped listeners receive only that agent.
325
+ * @mode waterfall
326
+ */
327
+ 'agent/request'(this: Scoped<Agent>, payload: {
328
+ agent: Agent;
329
+ turn: number;
330
+ step: number;
331
+ signal: AbortSignal;
332
+ }, next: () => Promise<LlmCallConfig>): Promise<LlmCallConfig>;
333
+ /**
334
+ * Handle one failed model-request attempt before the loop retries or closes
335
+ * its step. A listener returns `{ kind: 'retry' }` without calling `next()`
336
+ * when it owns recovery, or calls `next()` to delegate. The default
337
+ * `undefined` leaves the failure terminal.
338
+ * @param payload.agent - the agent whose request failed.
339
+ * @param payload.turn - the turn containing the failed request.
340
+ * @param payload.step - the step containing the failed request attempt.
341
+ * @param payload.provider - the provider selected for the failed request.
342
+ * @param payload.failure - serializable facts normalized at the final adapter boundary.
343
+ * @param payload.retryPolicy - the policy of the adapter registration that served the failed request.
344
+ * @param payload.signal - the turn abort signal.
345
+ * Scope-filtered dispatch (`@qilin-agent/scope`): agent-scoped listeners receive only that agent.
346
+ * @mode waterfall
347
+ */
348
+ 'agent/request-error'(this: Scoped<Agent>, payload: {
349
+ agent: Agent;
350
+ turn: number;
351
+ step: number;
352
+ provider: string;
353
+ failure: LlmFailure;
354
+ retryPolicy: ResolvedRetryPolicy | undefined;
355
+ signal: AbortSignal;
356
+ }, next: () => Promise<RequestErrorAction>): Promise<RequestErrorAction>;
357
+ /**
358
+ * Process-local assistant-stream publication. Chunk frames are transient;
359
+ * the loop appends one final v2 `assistant/message` or `assistant/attempt`
360
+ * with the same stream before a committed end frame.
361
+ * @param payload.agent - the agent whose attempt produced the frame.
362
+ * @param payload.frame - one ordered start, chunk, or end publication.
363
+ * Scope-filtered dispatch (`@qilin-agent/scope`): agent-scoped listeners receive only that agent.
364
+ * @mode emit
365
+ */
366
+ 'agent/assistant-stream'(this: Scoped<Agent>, payload: {
367
+ agent: Agent;
368
+ frame: AssistantStreamFrame;
369
+ }): void;
370
+ /**
371
+ * The turn is about to close: the model owes no response (no live tool
372
+ * calls, no fresh steering). Awaited before the boundary commits — a
373
+ * listener that objects steers (`agent.steer(...)`) and the machine
374
+ * re-reads its inbox: fresh steering runs another step, none closes the
375
+ * turn. Data decides, so listener order cannot change the outcome. The
376
+ * inverse control (stop a tool loop early) is data too: a tool result
377
+ * carrying `concludesTurn` ends the turn at its step. The conclusion
378
+ * never short-circuits already-submitted next-step work: same-step
379
+ * `additionalContexts` or racing steering still runs, and the turn
380
+ * closes only when that inbox drains.
381
+ * @param payload.agent - the agent whose turn is at its stop boundary.
382
+ * @param payload.turn - the turn about to close.
383
+ * @param payload.signal - the current turn's explicit abort signal.
384
+ * Scope-filtered dispatch (`@qilin-agent/scope`): agent-scoped listeners receive only that agent.
385
+ * @mode serial
386
+ */
387
+ 'agent/turn-stopping'(this: Scoped<Agent>, payload: {
388
+ agent: Agent;
389
+ turn: number;
390
+ signal: AbortSignal;
391
+ }): Promise<void> | void;
392
+ /**
393
+ * A step or turn errored. The machine reports a failure here even when
394
+ * the error has no in-turn position for a durable record.
395
+ * @param payload.agent - the agent whose turn errored.
396
+ * @param payload.turn - the turn in which the failure surfaced.
397
+ * @param payload.step - the step at which the failure surfaced.
398
+ * @param payload.error - the failure, verbatim.
399
+ * Scope-filtered dispatch (`@qilin-agent/scope`): agent-scoped listeners receive only that agent.
400
+ * @mode emit
401
+ */
402
+ 'agent/error'(this: Scoped<Agent>, payload: {
403
+ agent: Agent;
404
+ turn: number;
405
+ step: number;
406
+ error: unknown;
407
+ }): void;
408
+ }
409
+ }
410
+ //# sourceMappingURL=runtime-types.d.ts.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Public agent types and live-runtime events. Durable transcript facts and
3
+ * turn/step boundaries remain `@qilin-agent/session` events.
4
+ *
5
+ * @module @qilin-agent/agent
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=runtime-types.js.map
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Durable agent session-event vocabulary shared with type-only consumers.
3
+ *
4
+ * @module @qilin-agent/agent/types
5
+ */
6
+ import type { UserMessage } from '@qilin-agent/llm/types';
7
+ import type { OptionalSessionSeq, SessionId, SessionSeq } from '@qilin-agent/session/types';
8
+ import type { TypertContext, TypertLookup } from '@qilin-agent/typert-protocol';
9
+ import type { JsonValue } from '@qilin-agent/util-values';
10
+ /** Public live-agent handle; the runtime face augments its live capabilities. */
11
+ export interface Agent {
12
+ /** Session-backed Agent identity. */
13
+ readonly id: SessionId;
14
+ }
15
+ declare module '@qilin-agent/workspace/types' {
16
+ interface SessionActivityKindMap {
17
+ /** The session's own Agent is inside a turn, including one waiting for an approval or an answer. */
18
+ turn: true;
19
+ }
20
+ }
21
+ declare module '@qilin-agent/typert-protocol' {
22
+ interface TypertLookupMap {
23
+ agent: TypertLookup<Agent, SessionId>;
24
+ }
25
+ interface TypertContextMap {
26
+ /** Agent Context identity shared by Host and Client adapters. */
27
+ agent: TypertContext<SessionId>;
28
+ }
29
+ }
30
+ /** One of the two ordered pending-message lists owned by an agent. */
31
+ export type InboxTarget = 'next-turn' | 'next-step';
32
+ /** Complete pending Inbox value reconstructed from durable splices. */
33
+ export interface InboxState {
34
+ readonly 'next-turn': readonly UserMessage[];
35
+ readonly 'next-step': readonly UserMessage[];
36
+ }
37
+ /**
38
+ * Wire-JSON pending Inbox value. Each message round-trips the session log
39
+ * losslessly, but the fold state's full `UserMessage` type cannot cross a
40
+ * typert Remote boundary (its source union carries an `unknown` replay
41
+ * field), so the typed projection table keeps this JSON-safe form.
42
+ */
43
+ export interface InboxWireState {
44
+ readonly 'next-turn': readonly JsonValue[];
45
+ readonly 'next-step': readonly JsonValue[];
46
+ }
47
+ declare module '@qilin-agent/session-projection/types' {
48
+ interface SessionProjectionStateMap {
49
+ /** Pending agent input reconstructed from durable inbox splices. */
50
+ inbox: InboxState;
51
+ }
52
+ interface SessionProjectionMap {
53
+ /** Pending agent input reconstructed from durable inbox splices. */
54
+ inbox: InboxWireState;
55
+ }
56
+ }
57
+ /**
58
+ * Turn and step boundaries folded from one agent session log.
59
+ *
60
+ * Reader contract: the key is registered by `qilin-agent-loop` and absent
61
+ * otherwise. Without agent-loop no turn events exist, so readers treat an
62
+ * absent key as "no open turn / no boundaries" — capability absence, not a
63
+ * corrupt state. A reader whose behavior has no safe fallback for that
64
+ * absence (the step-open decision, for example) may fail loud instead.
65
+ */
66
+ export interface TurnBoundaryProjection {
67
+ /** Seq of the open turn's `turn/start`, or null between turns. */
68
+ readonly openTurnStartSeq: OptionalSessionSeq;
69
+ /** Seq of the latest `step/start` event, or null before the first step. */
70
+ readonly lastStepStartSeq: OptionalSessionSeq;
71
+ /** The latest step boundary (`step/start` or `step/end`) and its seq, or null before the first step boundary. */
72
+ readonly lastStepBoundary: {
73
+ readonly kind: 'start' | 'end';
74
+ readonly seq: SessionSeq;
75
+ } | null;
76
+ /** Turn number of the latest `turn/start`; 0 before the first turn. */
77
+ readonly lastTurn: number;
78
+ }
79
+ declare module '@qilin-agent/session/types' {
80
+ interface SessionEventMap {
81
+ /**
82
+ * One normalized mutation of an agent's durable pending-message lists.
83
+ * The session-projection registry applies the committed event before
84
+ * `Session.append()` returns; Inbox live notifications follow that commit.
85
+ */
86
+ 'agent/inbox/spliced': {
87
+ target: InboxTarget;
88
+ start: number;
89
+ removedCount?: number;
90
+ inserted: UserMessage[];
91
+ outcome?: 'canceled';
92
+ };
93
+ }
94
+ }
95
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Durable agent session-event vocabulary shared with type-only consumers.
3
+ *
4
+ * @module @qilin-agent/agent/types
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=types.js.map
package/package.json CHANGED
@@ -1,6 +1,58 @@
1
1
  {
2
2
  "name": "@qilin-agent/agent",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "description": "Agent interface, registry, initiator scope, and event vocabulary for the QiLin",
4
+ "version": "3.1.3",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/kkutysllb/QiLin.git",
11
+ "directory": "packages/core/agent"
12
+ },
13
+ "engines": {
14
+ "node": "^22.19.0 || >=24.0.0"
15
+ },
16
+ "type": "module",
17
+ "main": "lib/index.js",
18
+ "types": "lib/types/index.d.ts",
19
+ "exports": {
20
+ ".": {
21
+ "types": "./lib/types/index.d.ts",
22
+ "default": "./lib/index.js"
23
+ },
24
+ "./types": {
25
+ "types": "./lib/types/types.d.ts",
26
+ "default": "./lib/types/types.js"
27
+ },
28
+ "./src/*": "./src/*",
29
+ "./package.json": "./package.json"
30
+ },
31
+ "files": [
32
+ "lib/index.js",
33
+ "lib/types/**/*.js",
34
+ "lib/types/**/*.d.ts"
35
+ ],
36
+ "license": "MIT",
37
+ "peerDependencies": {
38
+ "@qilin-agent/llm": "3.1.3",
39
+ "@qilin-agent/session": "3.1.3",
40
+ "@qilin-agent/scope": "3.1.3",
41
+ "@qilin-agent/typert-protocol": "3.1.3",
42
+ "@qilin-agent/system-prompt": "3.1.3",
43
+ "@qilin-agent/session-projection": "3.1.3",
44
+ "@qilin-agent/kylin": "~4.0.3",
45
+ "@qilin-agent/util-values": "3.1.3"
46
+ },
47
+ "devDependencies": {
48
+ "@qilin-agent/llm": "3.1.3",
49
+ "@qilin-agent/scope": "3.1.3",
50
+ "@qilin-agent/session-projection": "3.1.3",
51
+ "@qilin-agent/session": "3.1.3",
52
+ "@qilin-agent/system-prompt": "3.1.3",
53
+ "@qilin-agent/typert-protocol": "3.1.3",
54
+ "@qilin-agent/typert-registry": "3.1.3",
55
+ "@qilin-agent/util-values": "3.1.3",
56
+ "@qilin-agent/kylin": "~4.0.3"
57
+ }
6
58
  }