@aparte/plugin-subagents 0.0.0-stage → 1.7.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/LICENSE +21 -0
- package/README.md +89 -2
- package/dist/aparte-subagent-view.d.ts +150 -0
- package/dist/aparte-subagent-view.d.ts.map +1 -0
- package/dist/connect-65jiVmf_.js +1469 -0
- package/dist/connect-65jiVmf_.js.map +1 -0
- package/dist/connect.d.ts +44 -0
- package/dist/connect.d.ts.map +1 -0
- package/dist/custom-elements.json +2057 -0
- package/dist/drawing.d.ts +52 -0
- package/dist/drawing.d.ts.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/index.node.d.ts +18 -0
- package/dist/index.node.d.ts.map +1 -0
- package/dist/index.node.js +10 -0
- package/dist/index.node.js.map +1 -0
- package/dist/lanes.d.ts +44 -0
- package/dist/lanes.d.ts.map +1 -0
- package/dist/line.d.ts +25 -0
- package/dist/line.d.ts.map +1 -0
- package/dist/open.d.ts +34 -0
- package/dist/open.d.ts.map +1 -0
- package/dist/segment.d.ts +20 -0
- package/dist/segment.d.ts.map +1 -0
- package/dist/setup.d.ts +23 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/status.d.ts +24 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/steps.d.ts +22 -0
- package/dist/steps.d.ts.map +1 -0
- package/dist/styles.d.ts +5 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/transcript.d.ts +28 -0
- package/dist/transcript.d.ts.map +1 -0
- package/dist/types.d.ts +131 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/words.d.ts +88 -0
- package/dist/words.d.ts.map +1 -0
- package/package.json +92 -3
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a sub-agent's conversation is drawn: core's own segment renderers, one row per
|
|
3
|
+
* segment, patched in place.
|
|
4
|
+
*
|
|
5
|
+
* Not `<aparte-chat-bubble>`: a bubble is ONE message of a chat, and it draws the chrome of
|
|
6
|
+
* one — a name and a time over the content, an avatar slot, the app's action bar
|
|
7
|
+
* (`setBubbleActions` reaches every bubble: Retry and Edit on a sub-agent's text would
|
|
8
|
+
* dispatch for a message that does not exist), the `‹1/2›` picker, the app's whole frame
|
|
9
|
+
* (`setBubbleShellRenderer`), `role="article"` named "Message from Assistant", and the
|
|
10
|
+
* waiting dots. None of it can be switched off without changing core, and hiding it from a
|
|
11
|
+
* stylesheet would out-specify core's recipes. What a conversation needs from the bubble is
|
|
12
|
+
* its row loop alone — and that is the renderer contract: `render`, then `setup`; `update`
|
|
13
|
+
* on a change (following the element when the renderer replaced its own); `relabel` on a
|
|
14
|
+
* language switch; `cleanup` when the row goes. So this is that loop, and nothing else.
|
|
15
|
+
*
|
|
16
|
+
* A row is found by its segment's id and patched when its segment is a new object (a
|
|
17
|
+
* segment list replaces the object it changes, and only that one), so a token costs the
|
|
18
|
+
* one row it lands in. A row whose renderer is no longer the one in effect is drawn again —
|
|
19
|
+
* for a tool call or an activity, the tool or activity renderer too, as the bubble does.
|
|
20
|
+
*/
|
|
21
|
+
import { type AparteConfig, type AparteSegment } from '@aparte/core';
|
|
22
|
+
/** The rows of one conversation, inside `container`. */
|
|
23
|
+
export declare class LaneDrawing {
|
|
24
|
+
readonly container: HTMLElement;
|
|
25
|
+
private readonly rows;
|
|
26
|
+
constructor(container: HTMLElement);
|
|
27
|
+
/** How many rows are drawn. */
|
|
28
|
+
get size(): number;
|
|
29
|
+
/**
|
|
30
|
+
* Draw `segments`, in order: a new segment gets a row, a changed one is patched, one that
|
|
31
|
+
* left loses its row. `live`: the sub-agent still works, so what it adds is arriving.
|
|
32
|
+
*/
|
|
33
|
+
sync(segments: readonly AparteSegment[], config: AparteConfig, live: boolean): void;
|
|
34
|
+
/** Every row re-reads what it takes from the config (a language switch). */
|
|
35
|
+
relabel(config: AparteConfig): void;
|
|
36
|
+
/** Every row goes: each renderer cleans up what it drew. */
|
|
37
|
+
clear(config: AparteConfig): void;
|
|
38
|
+
private draw;
|
|
39
|
+
private patch;
|
|
40
|
+
/** The row for `id` among the container's own children — never a decoy in a row's prose. */
|
|
41
|
+
private childOf;
|
|
42
|
+
/**
|
|
43
|
+
* The element standing where a row stood (before `next`) when it is no row's: what a
|
|
44
|
+
* renderer put in place of its own without the id (`outerHTML`, `replaceWith`), stamped so
|
|
45
|
+
* the loop finds it. A renderer that took its element away left another row there, or
|
|
46
|
+
* nothing: the row keeps its element, and the loop puts it back.
|
|
47
|
+
*/
|
|
48
|
+
private inPlaceOf;
|
|
49
|
+
private release;
|
|
50
|
+
private cleanup;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=drawing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawing.d.ts","sourceRoot":"","sources":["../src/drawing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAKH,KAAK,YAAY,EACjB,KAAK,aAAa,EAGrB,MAAM,cAAc,CAAC;AAiEtB,wDAAwD;AACxD,qBAAa,WAAW;IAGR,QAAQ,CAAC,SAAS,EAAE,WAAW;IAF3C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA0B;gBAE1B,SAAS,EAAE,WAAW;IAE3C,+BAA+B;IAC/B,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;;OAGG;IACH,IAAI,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI;IA2BnF,4EAA4E;IAC5E,OAAO,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IAQnC,4DAA4D;IAC5D,KAAK,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IAOjC,OAAO,CAAC,IAAI;IAeZ,OAAO,CAAC,KAAK;IA+Bb,4FAA4F;IAC5F,OAAO,CAAC,OAAO;IAOf;;;;;OAKG;IACH,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,OAAO;IAOf,OAAO,CAAC,OAAO;CASlB"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@aparte/plugin-subagents` — a sub-agent's work, shown as one line.
|
|
3
|
+
*
|
|
4
|
+
* Core keeps a sub-agent's events out of the reply (its text is not the reply's, its calls
|
|
5
|
+
* are not the reply's rows) and lets a plugin observe them. This plugin draws them: the call
|
|
6
|
+
* that opened a sub-agent becomes its line — name, task, what it is doing now, "3 tools ·
|
|
7
|
+
* 12 s", and its state — and the sub-agent's conversation is kept on that call, saved with
|
|
8
|
+
* the conversation and never sent to the model. A sub-agent no call opened gets the same
|
|
9
|
+
* line, from a segment of the plugin's own. Its conversation can be shown under the line
|
|
10
|
+
* (`subagentTranscript`, `details: 'transcript'`) or anywhere else
|
|
11
|
+
* (`<aparte-subagent-view>`), opened from the line's own button with `open: 'event'` and
|
|
12
|
+
* `connectSubagentView`.
|
|
13
|
+
*/
|
|
14
|
+
export { setupSubagents } from './setup.js';
|
|
15
|
+
export { subagentOf, subagentStatus } from './status.js';
|
|
16
|
+
export { subagentTranscript } from './transcript.js';
|
|
17
|
+
export { connectSubagentView } from './connect.js';
|
|
18
|
+
export type { ConnectSubagentViewOptions, SubagentViewSplit } from './connect.js';
|
|
19
|
+
export { AparteSubagentView } from './aparte-subagent-view.js';
|
|
20
|
+
export type { SubagentViewSource } from './aparte-subagent-view.js';
|
|
21
|
+
export { SUBAGENT_SEGMENT_TYPE } from './types.js';
|
|
22
|
+
export type { AparteSubagent, AparteSubagentStatus, AparteSubagentSegment, SubagentsOptions, AparteSubagentStartEventDetail, AparteSubagentEndEventDetail, AparteSubagentOpenEventDetail, } from './types.js';
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,YAAY,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,YAAY,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,YAAY,EACR,cAAc,EACd,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,8BAA8B,EAC9B,4BAA4B,EAC5B,6BAA6B,GAChC,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { A, S, c, s, a, b, d } from "./connect-65jiVmf_.js";
|
|
2
|
+
export {
|
|
3
|
+
A as AparteSubagentView,
|
|
4
|
+
S as SUBAGENT_SEGMENT_TYPE,
|
|
5
|
+
c as connectSubagentView,
|
|
6
|
+
s as setupSubagents,
|
|
7
|
+
a as subagentOf,
|
|
8
|
+
b as subagentStatus,
|
|
9
|
+
d as subagentTranscript
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@aparte/plugin-subagents` — the DOM-free entry, for Node and SSR.
|
|
3
|
+
*
|
|
4
|
+
* Everything the browser entry exports but the element is DOM-free at import: the observer
|
|
5
|
+
* and the line are plain functions, the `subagent` segment's renderer only builds DOM when a
|
|
6
|
+
* chat draws it — in a browser — and `subagentTranscript` returns `''` without a document. So `setupSubagents()` here installs the same three pieces, and a
|
|
7
|
+
* conversation rendered on a server reads its sub-agents' state through `subagentOf` and
|
|
8
|
+
* `subagentStatus`. `scripts/check-node-import.mjs` asserts this entry imports without a DOM.
|
|
9
|
+
*/
|
|
10
|
+
export { setupSubagents } from './setup.js';
|
|
11
|
+
export { subagentOf, subagentStatus } from './status.js';
|
|
12
|
+
export { subagentTranscript } from './transcript.js';
|
|
13
|
+
export { connectSubagentView } from './connect.js';
|
|
14
|
+
export type { ConnectSubagentViewOptions, SubagentViewSplit } from './connect.js';
|
|
15
|
+
export type { AparteSubagentView, SubagentViewSource } from './aparte-subagent-view.js';
|
|
16
|
+
export { SUBAGENT_SEGMENT_TYPE } from './types.js';
|
|
17
|
+
export type { AparteSubagent, AparteSubagentStatus, AparteSubagentSegment, SubagentsOptions, AparteSubagentStartEventDetail, AparteSubagentEndEventDetail, AparteSubagentOpenEventDetail, } from './types.js';
|
|
18
|
+
//# sourceMappingURL=index.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../src/index.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,YAAY,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGlF,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,YAAY,EACR,cAAc,EACd,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,8BAA8B,EAC9B,4BAA4B,EAC5B,6BAA6B,GAChC,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { S, c, s, a, b, d } from "./connect-65jiVmf_.js";
|
|
2
|
+
export {
|
|
3
|
+
S as SUBAGENT_SEGMENT_TYPE,
|
|
4
|
+
c as connectSubagentView,
|
|
5
|
+
s as setupSubagents,
|
|
6
|
+
a as subagentOf,
|
|
7
|
+
b as subagentStatus,
|
|
8
|
+
d as subagentTranscript
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=index.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.node.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/lanes.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The lanes: each sub-agent's conversation, kept apart from the reply and saved on the
|
|
3
|
+
* segment that stands for it.
|
|
4
|
+
*
|
|
5
|
+
* Core keeps a sub-agent's events out of the reply and hands every event of the run to the
|
|
6
|
+
* observers of `observeRunEvents`. This observer gives each sub-agent a lane: a segment list
|
|
7
|
+
* (`createSegmentList`) written by a stream adapter of core's own (`createStreamAdapter`), fed
|
|
8
|
+
* the sub-agent's events with their `agentId` taken off, so the lane holds exactly what a
|
|
9
|
+
* reply would — text, reasoning, its tool calls, stamped the same way.
|
|
10
|
+
*
|
|
11
|
+
* A lane lives on its ANCHOR, the segment that stands for the sub-agent: the call that opened
|
|
12
|
+
* it (`tool-<toolCallId>`, in a field `subagent`), or — with no call, or for the second
|
|
13
|
+
* sub-agent of one call — a `subagent` segment of the plugin's own, added to the reply. A
|
|
14
|
+
* sub-agent of a sub-agent follows the same two rules inside its parent's lane. The anchor is
|
|
15
|
+
* written once per animation frame while text streams, and at once for everything a person
|
|
16
|
+
* must see or the conversation must keep: a new segment, a tool's state, the sub-agent's end,
|
|
17
|
+
* the run's end or pause — the conversation is saved on those, so the lane is on the segment
|
|
18
|
+
* before anyone saves it.
|
|
19
|
+
*
|
|
20
|
+
* Memory is per reply, emptied when its run ends (done, stopped, failed), kept across a pause
|
|
21
|
+
* (the run resumes into the same reply), and capped.
|
|
22
|
+
*/
|
|
23
|
+
import { type AparteRunEventContext, type AparteSegment, type AparteStreamRunEvent } from '@aparte/core';
|
|
24
|
+
/** A sub-agent's anchor, just written: which chat, which reply, which agent, and the segment as it is now. */
|
|
25
|
+
export interface LaneWrite {
|
|
26
|
+
readonly target: object;
|
|
27
|
+
readonly targetId?: string;
|
|
28
|
+
readonly messageId: string;
|
|
29
|
+
readonly agentId: string;
|
|
30
|
+
readonly anchor: AparteSegment;
|
|
31
|
+
}
|
|
32
|
+
/** The last anchor written for this sub-agent while its run goes on, if any. */
|
|
33
|
+
export declare function lastLaneWrite(messageId: string, agentId: string): LaneWrite | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Hear every sub-agent's anchor as it is written — once a frame while it streams, at once
|
|
36
|
+
* for everything else. What `<aparte-subagent-view>` follows a live sub-agent with.
|
|
37
|
+
*/
|
|
38
|
+
export declare function watchLaneWrites(fn: (write: LaneWrite) => void): () => void;
|
|
39
|
+
/** The observer of one setup, and what forgets everything it follows. */
|
|
40
|
+
export declare function createLanes(): {
|
|
41
|
+
observe: (event: AparteStreamRunEvent, ctx: AparteRunEventContext) => void;
|
|
42
|
+
dispose: () => void;
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=lanes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lanes.d.ts","sourceRoot":"","sources":["../src/lanes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAIH,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAGlB,KAAK,oBAAoB,EAG5B,MAAM,cAAc,CAAC;AAwBtB,8GAA8G;AAC9G,MAAM,WAAW,SAAS;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;CAClC;AAWD,gFAAgF;AAChF,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAEvF;AAKD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,GAAG,MAAM,IAAI,CAG1E;AAqGD,yEAAyE;AACzE,wBAAgB,WAAW,IAAI;IAAE,OAAO,EAAE,CAAC,KAAK,EAAE,oBAAoB,EAAE,GAAG,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CA4djI"}
|
package/dist/line.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A sub-agent's line: core's tool row, named by what ran it.
|
|
3
|
+
*
|
|
4
|
+
* The plugin gives core a tool-line provider (`setToolLineProvider`): for a call that carries
|
|
5
|
+
* a sub-agent — the call that opened it, or the call the plugin's own segment stands in for —
|
|
6
|
+
* it says the sub-agent's name and its task, and on a second line, from the sub-agent's start to
|
|
7
|
+
* its end, what it is on ("Starting…", then its running call, else the step it announced, else
|
|
8
|
+
* its latest call) and once it is over what it did
|
|
9
|
+
* ("3 tools · 12s"). The second line is there the whole time, so the row keeps its height: one
|
|
10
|
+
* that grew a line when the sub-agent began acting and lost it at its end moved every row under
|
|
11
|
+
* it twice, and a count that grew beside the task moved the task. Core reads it AFTER the app's
|
|
12
|
+
* `registerToolDisplay`, field by field, so the app's label, summary and details always win. It
|
|
13
|
+
* is asked at every draw, update and relabel and stores nothing: the counts and the words follow
|
|
14
|
+
* the reader's language.
|
|
15
|
+
*/
|
|
16
|
+
import { type AparteToolCallSegment, type AparteToolLine } from '@aparte/core';
|
|
17
|
+
import type { SubagentsOptions } from './types.js';
|
|
18
|
+
/** Mark a call built to draw a `subagent` segment with core's row. */
|
|
19
|
+
export declare function markStandIn(segment: AparteToolCallSegment): AparteToolCallSegment;
|
|
20
|
+
/**
|
|
21
|
+
* The provider: the line of every call that carries a sub-agent, `undefined` for any other
|
|
22
|
+
* call (core's own line then).
|
|
23
|
+
*/
|
|
24
|
+
export declare function createLineProvider(options?: SubagentsOptions): (segment: AparteToolCallSegment) => AparteToolLine | undefined;
|
|
25
|
+
//# sourceMappingURL=line.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../src/line.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAMH,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACtB,MAAM,cAAc,CAAC;AAMtB,OAAO,KAAK,EAAwC,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAKzF,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,OAAO,EAAE,qBAAqB,GAAG,qBAAqB,CAGjF;AAgFD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,gBAAqB,GAAG,CAAC,OAAO,EAAE,qBAAqB,KAAK,cAAc,GAAG,SAAS,CAkEjI"}
|
package/dist/open.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A sub-agent's line opens its conversation elsewhere: what the line says (the Open button,
|
|
3
|
+
* which one is shown now) and what pressing it dispatches.
|
|
4
|
+
*
|
|
5
|
+
* The line provider gives core an `open` for every sub-agent's line when the setup asks for
|
|
6
|
+
* it; core draws the button and calls back with the row. The plugin then dispatches
|
|
7
|
+
* `aparte-subagent-open` from the row, and the app (or `connectSubagentView`) decides where the
|
|
8
|
+
* conversation goes. Which sub-agent is shown is kept here, by whoever shows it, so a line
|
|
9
|
+
* drawn again — a reload, a row rebuilt — still says it is the one open.
|
|
10
|
+
*/
|
|
11
|
+
import type { AparteToolCallSegment } from '@aparte/core';
|
|
12
|
+
import type { AparteSubagent } from './types.js';
|
|
13
|
+
/** Whether some view shows this sub-agent now. */
|
|
14
|
+
export declare function isShown(messageId: string | undefined, agentId: string): boolean;
|
|
15
|
+
/** `owner` shows this sub-agent now, or nothing (`null`). */
|
|
16
|
+
export declare function setShown(owner: object, at: {
|
|
17
|
+
messageId: string;
|
|
18
|
+
agentId: string;
|
|
19
|
+
} | null): void;
|
|
20
|
+
/**
|
|
21
|
+
* The row's Open button: core's, in its own line, or — a row with a detail — in the slot
|
|
22
|
+
* beside its disclosure (never in a summary, never a nested row's).
|
|
23
|
+
*/
|
|
24
|
+
export declare const openButtonOf: (row: Element) => HTMLElement | null;
|
|
25
|
+
/**
|
|
26
|
+
* Mark a row as the one shown, or not: the two marks core writes from `open.current` when it
|
|
27
|
+
* draws the row, written here on a row already drawn so it does not wait for its next draw.
|
|
28
|
+
*/
|
|
29
|
+
export declare function markRow(row: Element, on: boolean): void;
|
|
30
|
+
/** Every row marked as shown under `root`, unmarked. */
|
|
31
|
+
export declare function unmarkAll(root: ParentNode): void;
|
|
32
|
+
/** Dispatch `aparte-subagent-open` from the row of `sub`, drawn for `segment`. */
|
|
33
|
+
export declare function dispatchOpen(row: HTMLElement, segment: AparteToolCallSegment, sub: AparteSubagent, standIn: boolean): void;
|
|
34
|
+
//# sourceMappingURL=open.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open.d.ts","sourceRoot":"","sources":["../src/open.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAiC,MAAM,YAAY,CAAC;AAOhF,kDAAkD;AAClD,wBAAgB,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAK/E;AAED,6DAA6D;AAC7D,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GAAG,IAAI,CAG/F;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,QAAS,OAAO,KAAG,WAAW,GAAG,IACuD,CAAC;AAElH;;;GAGG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,GAAG,IAAI,CAMvD;AAED,wDAAwD;AACxD,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAEhD;AAeD,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,GAAG,EAAE,WAAW,EAAE,OAAO,EAAE,qBAAqB,EAAE,GAAG,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAc1H"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The line of a sub-agent no call opened: core's own tool row, drawn for a stand-in call.
|
|
3
|
+
*
|
|
4
|
+
* A sub-agent announced without a call (an AG-UI `SUBAGENT_STARTED` with no parent call), or
|
|
5
|
+
* the second one a call opens, has no row of its own in the reply, so the plugin adds a
|
|
6
|
+
* `subagent` segment for it. That segment is drawn by core's `tool_call` renderer, handed a
|
|
7
|
+
* call that stands for the agent: its name is the agent's (so `registerToolDisplay('<agent
|
|
8
|
+
* name>', …)` reaches it — label, icon, `quiet`, `hidden`, `details`), its status says the
|
|
9
|
+
* agent's. The renderer returns the row's own root — no wrapper — and forwards `setup`,
|
|
10
|
+
* `update`, `relabel` and `cleanup` to core's, so the line reads and behaves exactly like a
|
|
11
|
+
* call's sub-agent line.
|
|
12
|
+
*/
|
|
13
|
+
import { type AparteSegmentRenderer, type AparteToolCallSegment } from '@aparte/core';
|
|
14
|
+
import { type AparteSubagentSegment } from './types.js';
|
|
15
|
+
/** The tool name a sub-agent with no name stands in under. */
|
|
16
|
+
export declare const UNNAMED_AGENT = "subagent";
|
|
17
|
+
/** The call that stands for a `subagent` segment on core's row: same id, the agent's name, its status. */
|
|
18
|
+
export declare function standInCall(segment: AparteSubagentSegment): AparteToolCallSegment;
|
|
19
|
+
export declare const subagentRenderer: AparteSegmentRenderer<AparteSubagentSegment>;
|
|
20
|
+
//# sourceMappingURL=segment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segment.d.ts","sourceRoot":"","sources":["../src/segment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAGH,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC7B,MAAM,cAAc,CAAC;AAItB,OAAO,EAAyB,KAAK,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAE/E,8DAA8D;AAC9D,eAAO,MAAM,aAAa,aAAa,CAAC;AAExC,0GAA0G;AAC1G,wBAAgB,WAAW,CAAC,OAAO,EAAE,qBAAqB,GAAG,qBAAqB,CAkBjF;AAgBD,eAAO,MAAM,gBAAgB,EAAE,qBAAqB,CAAC,qBAAqB,CAsBzE,CAAC"}
|
package/dist/setup.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `setupSubagents()`: one line per sub-agent, on the config last, like every setup.
|
|
3
|
+
*/
|
|
4
|
+
import { type AparteConfig } from '@aparte/core';
|
|
5
|
+
import { type SubagentsOptions } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Show each sub-agent of a reply as one line: the line of the call that opened it — its
|
|
8
|
+
* name, its task, what it is doing now, "3 tools · 12 s" — and its conversation kept on that
|
|
9
|
+
* call, out of the reply and out of what the model reads. A sub-agent no call opened gets the
|
|
10
|
+
* same line, from a segment of the plugin's own.
|
|
11
|
+
*
|
|
12
|
+
* Installs one run-event observer, one tool-line provider and the `subagent` segment's
|
|
13
|
+
* renderer on `config` (the global config by default). Returns the function that takes them
|
|
14
|
+
* off; calling it again on the same config replaces the first setup.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* import { setupSubagents } from '@aparte/plugin-subagents';
|
|
18
|
+
* setupSubagents(); // the line alone
|
|
19
|
+
* setupSubagents({ counts: false }); // without "3 tools · 12 s"
|
|
20
|
+
* setupSubagents({ details: 'transcript' }); // its conversation under the line, closed
|
|
21
|
+
*/
|
|
22
|
+
export declare function setupSubagents(options?: SubagentsOptions, config?: AparteConfig): () => void;
|
|
23
|
+
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAKH,KAAK,YAAY,EACpB,MAAM,cAAc,CAAC;AAItB,OAAO,EAAyB,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAK1E;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE,gBAAqB,EAAE,MAAM,GAAE,YAAiC,GAAG,MAAM,IAAI,CAoBpH"}
|
package/dist/status.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a sub-agent's line says it is doing, read off the segment alone — so a reload and a
|
|
3
|
+
* Stop read right with no bookkeeping of their own.
|
|
4
|
+
*/
|
|
5
|
+
import type { AparteSegment, AparteToolCallSegment } from '@aparte/core';
|
|
6
|
+
import { type AparteSubagent, type AparteSubagentStatus } from './types.js';
|
|
7
|
+
/**
|
|
8
|
+
* The sub-agent a segment stands for: the one kept on a `tool_call` segment (the call that
|
|
9
|
+
* opened it) or on a `subagent` segment. `undefined` for any other segment.
|
|
10
|
+
*/
|
|
11
|
+
export declare function subagentOf(segment: AparteSegment): AparteSubagent | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Where the sub-agent a segment stands for is: its stored status, except that one stored as
|
|
14
|
+
* working (`running`, `waiting`) reads `stopped` once its segment has settled without it — the
|
|
15
|
+
* call that opened it is over, or its own segment streams no more. That is what a reloaded
|
|
16
|
+
* conversation and a Stop look like: nothing will ever end it. A segment that stands for no
|
|
17
|
+
* sub-agent reads `stopped`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function subagentStatus(segment: AparteSegment): AparteSubagentStatus;
|
|
20
|
+
/** What a call's own status says of a sub-agent, as its row shows it. */
|
|
21
|
+
export declare function statusOfCall(status: AparteToolCallSegment['status'] | undefined): AparteSubagentStatus;
|
|
22
|
+
/** The call status that says a sub-agent's status on a row — the reverse of {@link statusOfCall}. */
|
|
23
|
+
export declare function callStatusOf(status: AparteSubagentStatus): AparteToolCallSegment['status'];
|
|
24
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAAyB,KAAK,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAInG;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,aAAa,GAAG,cAAc,GAAG,SAAS,CAY7E;AAWD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,oBAAoB,CAK3E;AAED,yEAAyE;AACzE,wBAAgB,YAAY,CAAC,MAAM,EAAE,qBAAqB,CAAC,QAAQ,CAAC,GAAG,SAAS,GAAG,oBAAoB,CAQtG;AAED,qGAAqG;AACrG,wBAAgB,YAAY,CAAC,MAAM,EAAE,oBAAoB,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAQ1F"}
|
package/dist/steps.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The steps a sub-agent has open ("Reading the parser"), live: what its line says while none
|
|
3
|
+
* of its calls runs.
|
|
4
|
+
*
|
|
5
|
+
* Kept here, by reply and by agent, and never on a segment: a step lasts only as long as it is
|
|
6
|
+
* open, and the conversation a page saves must not keep one. The lanes write it as the
|
|
7
|
+
* sub-agent's `step-start` / `step-end` arrive and forget it with the sub-agent's end; the line
|
|
8
|
+
* reads it at each draw. Steps nest and overlap: the latest one open is the one said, and when
|
|
9
|
+
* it ends the one before it is said again.
|
|
10
|
+
*/
|
|
11
|
+
/** A step of the sub-agent `agentId` of the reply `messageId` begins. */
|
|
12
|
+
export declare function stepStarted(messageId: string, agentId: string, name: string): void;
|
|
13
|
+
/** The latest open step of that name ends. */
|
|
14
|
+
export declare function stepEnded(messageId: string, agentId: string, name: string): void;
|
|
15
|
+
/** Every step of the sub-agent ends: it ended, or its reply did. */
|
|
16
|
+
export declare function stepsEnded(messageId: string, agentId: string): void;
|
|
17
|
+
/**
|
|
18
|
+
* The step the sub-agent is on, if any. Without the reply's id (a segment that does not carry
|
|
19
|
+
* one), the first sub-agent of that id with a step open.
|
|
20
|
+
*/
|
|
21
|
+
export declare function currentStep(messageId: string | undefined, agentId: string): string | undefined;
|
|
22
|
+
//# sourceMappingURL=steps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"steps.d.ts","sourceRoot":"","sources":["../src/steps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,yEAAyE;AACzE,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAGlF;AAED,8CAA8C;AAC9C,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAShF;AAED,oEAAoE;AACpE,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAEnE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAK9F"}
|
package/dist/styles.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** What the segment renderer hands core: the sheet, unless the element already put it on the page. */
|
|
2
|
+
export declare function rendererStyles(): string;
|
|
3
|
+
/** Put the sheet on the page, unless it is there already. */
|
|
4
|
+
export declare function ensureStyles(): void;
|
|
5
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAsBA,sGAAsG;AACtG,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,6DAA6D;AAC7D,wBAAgB,YAAY,IAAI,IAAI,CAOnC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `subagentTranscript` — a sub-agent's conversation under its line.
|
|
3
|
+
*
|
|
4
|
+
* A tool display's `details`: core calls it when the row is drawn and on every update of the
|
|
5
|
+
* call, and leaves in place an element it already holds (so the conversation is never
|
|
6
|
+
* serialised or rewritten per token). It returns the SAME `<aparte-subagent-view>` for one
|
|
7
|
+
* sub-agent of one reply on every call, and hands it the call as it is now: the view patches
|
|
8
|
+
* the rows that changed and nothing else.
|
|
9
|
+
*/
|
|
10
|
+
import { type AparteToolDetails } from '@aparte/core';
|
|
11
|
+
/**
|
|
12
|
+
* A sub-agent's conversation, for a tool display's `details`: its task, then its text, its
|
|
13
|
+
* reasoning and its own tool rows, drawn by the same renderers as the reply, kept up to date
|
|
14
|
+
* while it works. `''` for a call that opened no sub-agent, and for one that has nothing to
|
|
15
|
+
* show yet — no disclosure until there is.
|
|
16
|
+
*
|
|
17
|
+
* `setupSubagents({ details: 'transcript' })` puts it under every sub-agent's line; register
|
|
18
|
+
* it yourself to put it under one tool's only.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* import { aparteGlobalConfig } from '@aparte/core';
|
|
22
|
+
* import { setupSubagents, subagentTranscript } from '@aparte/plugin-subagents';
|
|
23
|
+
*
|
|
24
|
+
* setupSubagents();
|
|
25
|
+
* aparteGlobalConfig.registerToolDisplay('task', { details: subagentTranscript, open: true });
|
|
26
|
+
*/
|
|
27
|
+
export declare const subagentTranscript: AparteToolDetails;
|
|
28
|
+
//# sourceMappingURL=transcript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../src/transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAoC,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AASxF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,kBAAkB,EAAE,iBA0BhC,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shapes the plugin writes and reads: a sub-agent, as it is kept on the segment that
|
|
3
|
+
* stands for it, the plugin's own segment for a sub-agent no call opened, the options, and
|
|
4
|
+
* the two events an app hears.
|
|
5
|
+
*/
|
|
6
|
+
import type { AparteSegment, AparteSegmentBase, AparteToolDetails } from '@aparte/core';
|
|
7
|
+
/** Where a sub-agent is: working, waiting for a person, or over — and how. */
|
|
8
|
+
export type AparteSubagentStatus = 'running' | 'waiting' | 'done' | 'failed' | 'stopped';
|
|
9
|
+
/**
|
|
10
|
+
* A sub-agent, as it is saved with the conversation: on the call that opened it (the
|
|
11
|
+
* `subagent` field of that `tool_call` segment), or on a `subagent` segment of its own.
|
|
12
|
+
*
|
|
13
|
+
* `segments` is its conversation — its text, its reasoning, its own tool calls — stamped
|
|
14
|
+
* like a message's, and never part of the reply: the model never reads it back.
|
|
15
|
+
*/
|
|
16
|
+
export interface AparteSubagent {
|
|
17
|
+
/** The sub-agent's id in the run (`agent-start`'s `agentId`). */
|
|
18
|
+
id: string;
|
|
19
|
+
/** Its name, what the line shows. */
|
|
20
|
+
name?: string;
|
|
21
|
+
/** What it was asked to do, shown after the name. */
|
|
22
|
+
description?: string;
|
|
23
|
+
/** As stored. Read it through `subagentStatus`, which knows a saved run is over. */
|
|
24
|
+
status: AparteSubagentStatus;
|
|
25
|
+
/** What it answered, when it is done. */
|
|
26
|
+
result?: string;
|
|
27
|
+
/** Why it failed, when it failed. */
|
|
28
|
+
error?: string;
|
|
29
|
+
/** The sub-agent that opened this one, when one did. */
|
|
30
|
+
parentId?: string;
|
|
31
|
+
/** Its conversation. */
|
|
32
|
+
segments: AparteSegment[];
|
|
33
|
+
}
|
|
34
|
+
/** The segment type of a sub-agent that no call opened. */
|
|
35
|
+
export declare const SUBAGENT_SEGMENT_TYPE = "subagent";
|
|
36
|
+
/**
|
|
37
|
+
* A sub-agent no call opened (or a second one opened by the same call): a segment of the
|
|
38
|
+
* plugin's own, drawn as the same line a call's sub-agent gets. `isStreaming` is true while
|
|
39
|
+
* it works.
|
|
40
|
+
*/
|
|
41
|
+
export interface AparteSubagentSegment extends AparteSegmentBase {
|
|
42
|
+
type: typeof SUBAGENT_SEGMENT_TYPE;
|
|
43
|
+
subagent: AparteSubagent;
|
|
44
|
+
}
|
|
45
|
+
declare module '@aparte/core' {
|
|
46
|
+
interface AparteSegmentTypes {
|
|
47
|
+
subagent: AparteSubagentSegment;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/** What `setupSubagents` shows on a sub-agent's line. */
|
|
51
|
+
export interface SubagentsOptions {
|
|
52
|
+
/** What it is doing now — its latest running tool call — while it works. Default `true`. */
|
|
53
|
+
activity?: boolean;
|
|
54
|
+
/** "3 tools · 12 s" after the line: its tool calls and how long it worked. Default `true`. */
|
|
55
|
+
counts?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* What is behind the line. `false` (the default): the line alone, with no disclosure.
|
|
58
|
+
* A function: what it returns is shown under the line, as a tool display's `details`.
|
|
59
|
+
* `'transcript'`: the sub-agent's conversation under the line (`subagentTranscript`),
|
|
60
|
+
* closed until the reader opens it — or open, with the tool display's `open: true`.
|
|
61
|
+
*/
|
|
62
|
+
details?: false | 'transcript' | AparteToolDetails;
|
|
63
|
+
/**
|
|
64
|
+
* What the line can open elsewhere. `'event'`: an Open button at the end of the line
|
|
65
|
+
* dispatches `aparte-subagent-open`, for the app to show the sub-agent's conversation
|
|
66
|
+
* somewhere else (`connectSubagentView` shows it in an `<aparte-subagent-view>` beside the
|
|
67
|
+
* chat). A line with nothing behind it opens on a click anywhere on it too; with `details`,
|
|
68
|
+
* the line keeps opening its detail and only the button opens elsewhere. Left out (the
|
|
69
|
+
* default), the line opens nothing: no button, no pointer.
|
|
70
|
+
*/
|
|
71
|
+
open?: false | 'event';
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A sub-agent started working for a reply, or started again after a pause. Bubbles out of
|
|
75
|
+
* the chat, so an app can list a reply's sub-agents wherever it likes; the detail says which
|
|
76
|
+
* call or which sub-agent opened it, when one did.
|
|
77
|
+
*
|
|
78
|
+
* @event aparte-subagent-start
|
|
79
|
+
*/
|
|
80
|
+
export interface AparteSubagentStartEventDetail {
|
|
81
|
+
/** The chat the reply is in. */
|
|
82
|
+
targetId?: string;
|
|
83
|
+
/** The reply the sub-agent works for. */
|
|
84
|
+
messageId: string;
|
|
85
|
+
agentId: string;
|
|
86
|
+
name?: string;
|
|
87
|
+
description?: string;
|
|
88
|
+
/** The call that opened it, when one did. */
|
|
89
|
+
toolCallId?: string;
|
|
90
|
+
/** The sub-agent that opened it, when one did. */
|
|
91
|
+
parentId?: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* A sub-agent ended, or the run ended without it: `status` says how (`done`, `failed`,
|
|
95
|
+
* `waiting` for a person, `stopped`). Bubbles out of the chat.
|
|
96
|
+
*
|
|
97
|
+
* @event aparte-subagent-end
|
|
98
|
+
*/
|
|
99
|
+
export interface AparteSubagentEndEventDetail {
|
|
100
|
+
/** The chat the reply is in. */
|
|
101
|
+
targetId?: string;
|
|
102
|
+
messageId: string;
|
|
103
|
+
agentId: string;
|
|
104
|
+
status: AparteSubagentStatus;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* A reader pressed a sub-agent's Open button (`setupSubagents({ open: 'event' })`): show its
|
|
108
|
+
* conversation elsewhere — an `<aparte-subagent-view>` with this `messageId` and `agentId`.
|
|
109
|
+
* Dispatched from the line, bubbles and is composed.
|
|
110
|
+
*
|
|
111
|
+
* @event aparte-subagent-open
|
|
112
|
+
*/
|
|
113
|
+
export interface AparteSubagentOpenEventDetail {
|
|
114
|
+
/** The chat the reply is in, when the line knows it. */
|
|
115
|
+
targetId?: string;
|
|
116
|
+
/** The reply the sub-agent works for: a view's `message-id`. */
|
|
117
|
+
messageId: string;
|
|
118
|
+
/** Which sub-agent: a view's `agent-id`. */
|
|
119
|
+
agentId: string;
|
|
120
|
+
name?: string;
|
|
121
|
+
/** The call that opened it, when its line is that call's row. */
|
|
122
|
+
toolCallId?: string;
|
|
123
|
+
}
|
|
124
|
+
declare global {
|
|
125
|
+
interface HTMLElementEventMap {
|
|
126
|
+
'aparte-subagent-start': CustomEvent<AparteSubagentStartEventDetail>;
|
|
127
|
+
'aparte-subagent-end': CustomEvent<AparteSubagentEndEventDetail>;
|
|
128
|
+
'aparte-subagent-open': CustomEvent<AparteSubagentOpenEventDetail>;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAExF,8EAA8E;AAC9E,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzF;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC3B,iEAAiE;IACjE,EAAE,EAAE,MAAM,CAAC;IACX,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oFAAoF;IACpF,MAAM,EAAE,oBAAoB,CAAC;IAC7B,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wBAAwB;IACxB,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC7B;AAED,2DAA2D;AAC3D,eAAO,MAAM,qBAAqB,aAAa,CAAC;AAEhD;;;;GAIG;AACH,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC5D,IAAI,EAAE,OAAO,qBAAqB,CAAC;IACnC,QAAQ,EAAE,cAAc,CAAC;CAC5B;AAED,OAAO,QAAQ,cAAc,CAAC;IAC1B,UAAU,kBAAkB;QACxB,QAAQ,EAAE,qBAAqB,CAAC;KACnC;CACJ;AAED,yDAAyD;AACzD,MAAM,WAAW,gBAAgB;IAC7B,4FAA4F;IAC5F,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,KAAK,GAAG,YAAY,GAAG,iBAAiB,CAAC;IACnD;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,8BAA8B;IAC3C,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,4BAA4B;IACzC,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,oBAAoB,CAAC;CAChC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,6BAA6B;IAC1C,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,mBAAmB;QACzB,uBAAuB,EAAE,WAAW,CAAC,8BAA8B,CAAC,CAAC;QACrE,qBAAqB,EAAE,WAAW,CAAC,4BAA4B,CAAC,CAAC;QACjE,sBAAsB,EAAE,WAAW,CAAC,6BAA6B,CAAC,CAAC;KACtE;CACJ"}
|