@esso0428/pi-subagents 0.17.16 → 0.17.17
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/CHANGELOG.md +6 -0
- package/ROADMAP.md +87 -0
- package/docs/post-0.17.6-agents-roster-viewer-spec.md +42 -0
- package/docs/post-0.17.6-durable-history-spec.md +41 -0
- package/docs/post-0.17.6-feature-specs.md +50 -0
- package/docs/post-0.17.6-nested-agents-spec.md +38 -0
- package/docs/post-0.17.6-recovery-shutdown-spec.md +46 -0
- package/docs/post-0.17.6-ui-latency-baseline-spec.md +46 -0
- package/docs/post-0.17.6-workflow-rpc-lifecycle-spec.md +54 -0
- package/package.json +1 -1
- package/src/agent-history.ts +2 -54
- package/src/agent-manager.ts +406 -1288
- package/src/agent-runner.ts +27 -251
- package/src/agent-types.ts +32 -188
- package/src/cross-extension-rpc.ts +20 -96
- package/src/custom-agents.ts +13 -170
- package/src/index.ts +480 -1920
- package/src/invocation-config.ts +3 -118
- package/src/model-resolver.ts +0 -18
- package/src/output-file.ts +6 -61
- package/src/prompts.ts +2 -45
- package/src/schedule.ts +14 -35
- package/src/settings.ts +2 -301
- package/src/status-note.ts +1 -66
- package/src/types.ts +10 -177
- package/src/ui/agent-widget.ts +57 -278
- package/src/ui/conversation-blocks.ts +0 -6
- package/src/ui/conversation-timeline.ts +25 -139
- package/src/ui/conversation-viewer.ts +48 -212
- package/src/ui/schedule-menu.ts +8 -9
- package/src/usage.ts +2 -109
- package/src/worktree.ts +55 -69
- package/dist/abortable.d.ts +0 -13
- package/dist/abortable.d.ts.map +0 -1
- package/dist/abortable.js +0 -43
- package/dist/abortable.js.map +0 -1
- package/dist/agent-color.d.ts +0 -36
- package/dist/agent-color.d.ts.map +0 -1
- package/dist/agent-color.js +0 -124
- package/dist/agent-color.js.map +0 -1
- package/dist/agent-file-toggle.d.ts +0 -126
- package/dist/agent-file-toggle.d.ts.map +0 -1
- package/dist/agent-file-toggle.js +0 -259
- package/dist/agent-file-toggle.js.map +0 -1
- package/dist/agent-history-list.d.ts +0 -19
- package/dist/agent-history-list.d.ts.map +0 -1
- package/dist/agent-history-list.js +0 -69
- package/dist/agent-history-list.js.map +0 -1
- package/dist/agent-history.d.ts +0 -35
- package/dist/agent-history.d.ts.map +0 -1
- package/dist/agent-history.js +0 -188
- package/dist/agent-history.js.map +0 -1
- package/dist/agent-manager.d.ts +0 -503
- package/dist/agent-manager.d.ts.map +0 -1
- package/dist/agent-manager.js +0 -1572
- package/dist/agent-manager.js.map +0 -1
- package/dist/agent-recovery.d.ts +0 -37
- package/dist/agent-recovery.d.ts.map +0 -1
- package/dist/agent-recovery.js +0 -171
- package/dist/agent-recovery.js.map +0 -1
- package/dist/agent-runner.d.ts +0 -303
- package/dist/agent-runner.d.ts.map +0 -1
- package/dist/agent-runner.js +0 -1003
- package/dist/agent-runner.js.map +0 -1
- package/dist/agent-types.d.ts +0 -120
- package/dist/agent-types.d.ts.map +0 -1
- package/dist/agent-types.js +0 -301
- package/dist/agent-types.js.map +0 -1
- package/dist/child-context.d.ts +0 -3
- package/dist/child-context.d.ts.map +0 -1
- package/dist/child-context.js +0 -13
- package/dist/child-context.js.map +0 -1
- package/dist/context.d.ts +0 -13
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js +0 -57
- package/dist/context.js.map +0 -1
- package/dist/cross-extension-rpc.d.ts +0 -67
- package/dist/cross-extension-rpc.d.ts.map +0 -1
- package/dist/cross-extension-rpc.js +0 -139
- package/dist/cross-extension-rpc.js.map +0 -1
- package/dist/custom-agents.d.ts +0 -55
- package/dist/custom-agents.d.ts.map +0 -1
- package/dist/custom-agents.js +0 -309
- package/dist/custom-agents.js.map +0 -1
- package/dist/default-agents.d.ts +0 -8
- package/dist/default-agents.d.ts.map +0 -1
- package/dist/default-agents.js +0 -123
- package/dist/default-agents.js.map +0 -1
- package/dist/enabled-models.d.ts +0 -50
- package/dist/enabled-models.d.ts.map +0 -1
- package/dist/enabled-models.js +0 -146
- package/dist/enabled-models.js.map +0 -1
- package/dist/env.d.ts +0 -7
- package/dist/env.d.ts.map +0 -1
- package/dist/env.js +0 -29
- package/dist/env.js.map +0 -1
- package/dist/group-join.d.ts +0 -33
- package/dist/group-join.d.ts.map +0 -1
- package/dist/group-join.js +0 -117
- package/dist/group-join.js.map +0 -1
- package/dist/index.d.ts +0 -51
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -3687
- package/dist/index.js.map +0 -1
- package/dist/invocation-config.d.ts +0 -108
- package/dist/invocation-config.d.ts.map +0 -1
- package/dist/invocation-config.js +0 -84
- package/dist/invocation-config.js.map +0 -1
- package/dist/memory.d.ts +0 -54
- package/dist/memory.d.ts.map +0 -1
- package/dist/memory.js +0 -166
- package/dist/memory.js.map +0 -1
- package/dist/mention-clone.d.ts +0 -88
- package/dist/mention-clone.d.ts.map +0 -1
- package/dist/mention-clone.js +0 -154
- package/dist/mention-clone.js.map +0 -1
- package/dist/mention.d.ts +0 -82
- package/dist/mention.d.ts.map +0 -1
- package/dist/mention.js +0 -132
- package/dist/mention.js.map +0 -1
- package/dist/model-resolver.d.ts +0 -37
- package/dist/model-resolver.d.ts.map +0 -1
- package/dist/model-resolver.js +0 -96
- package/dist/model-resolver.js.map +0 -1
- package/dist/model-scope.d.ts +0 -50
- package/dist/model-scope.d.ts.map +0 -1
- package/dist/model-scope.js +0 -49
- package/dist/model-scope.js.map +0 -1
- package/dist/nested-tools.d.ts +0 -57
- package/dist/nested-tools.d.ts.map +0 -1
- package/dist/nested-tools.js +0 -301
- package/dist/nested-tools.js.map +0 -1
- package/dist/nico-overrides.d.ts +0 -54
- package/dist/nico-overrides.d.ts.map +0 -1
- package/dist/nico-overrides.js +0 -170
- package/dist/nico-overrides.js.map +0 -1
- package/dist/output-file.d.ts +0 -44
- package/dist/output-file.d.ts.map +0 -1
- package/dist/output-file.js +0 -156
- package/dist/output-file.js.map +0 -1
- package/dist/prompts.d.ts +0 -56
- package/dist/prompts.d.ts.map +0 -1
- package/dist/prompts.js +0 -92
- package/dist/prompts.js.map +0 -1
- package/dist/schedule-store.d.ts +0 -39
- package/dist/schedule-store.d.ts.map +0 -1
- package/dist/schedule-store.js +0 -156
- package/dist/schedule-store.js.map +0 -1
- package/dist/schedule.d.ts +0 -110
- package/dist/schedule.d.ts.map +0 -1
- package/dist/schedule.js +0 -360
- package/dist/schedule.js.map +0 -1
- package/dist/settings.d.ts +0 -354
- package/dist/settings.d.ts.map +0 -1
- package/dist/settings.js +0 -247
- package/dist/settings.js.map +0 -1
- package/dist/skill-loader.d.ts +0 -25
- package/dist/skill-loader.d.ts.map +0 -1
- package/dist/skill-loader.js +0 -94
- package/dist/skill-loader.js.map +0 -1
- package/dist/status-note.d.ts +0 -62
- package/dist/status-note.d.ts.map +0 -1
- package/dist/status-note.js +0 -86
- package/dist/status-note.js.map +0 -1
- package/dist/structured-output.d.ts +0 -62
- package/dist/structured-output.d.ts.map +0 -1
- package/dist/structured-output.js +0 -113
- package/dist/structured-output.js.map +0 -1
- package/dist/types.d.ts +0 -372
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -6
- package/dist/types.js.map +0 -1
- package/dist/ui/agent-mention.d.ts +0 -83
- package/dist/ui/agent-mention.d.ts.map +0 -1
- package/dist/ui/agent-mention.js +0 -188
- package/dist/ui/agent-mention.js.map +0 -1
- package/dist/ui/agent-widget.d.ts +0 -241
- package/dist/ui/agent-widget.d.ts.map +0 -1
- package/dist/ui/agent-widget.js +0 -992
- package/dist/ui/agent-widget.js.map +0 -1
- package/dist/ui/ccstyle/diff/ansi-utils.d.ts +0 -11
- package/dist/ui/ccstyle/diff/ansi-utils.d.ts.map +0 -1
- package/dist/ui/ccstyle/diff/ansi-utils.js +0 -145
- package/dist/ui/ccstyle/diff/ansi-utils.js.map +0 -1
- package/dist/ui/ccstyle/diff/diff-presentation.d.ts +0 -12
- package/dist/ui/ccstyle/diff/diff-presentation.d.ts.map +0 -1
- package/dist/ui/ccstyle/diff/diff-presentation.js +0 -48
- package/dist/ui/ccstyle/diff/diff-presentation.js.map +0 -1
- package/dist/ui/ccstyle/diff/diff-renderer.d.ts +0 -46
- package/dist/ui/ccstyle/diff/diff-renderer.d.ts.map +0 -1
- package/dist/ui/ccstyle/diff/diff-renderer.js +0 -2049
- package/dist/ui/ccstyle/diff/diff-renderer.js.map +0 -1
- package/dist/ui/ccstyle/diff/line-width-safety.d.ts +0 -12
- package/dist/ui/ccstyle/diff/line-width-safety.d.ts.map +0 -1
- package/dist/ui/ccstyle/diff/line-width-safety.js +0 -58
- package/dist/ui/ccstyle/diff/line-width-safety.js.map +0 -1
- package/dist/ui/ccstyle/diff/render-utils.d.ts +0 -6
- package/dist/ui/ccstyle/diff/render-utils.d.ts.map +0 -1
- package/dist/ui/ccstyle/diff/render-utils.js +0 -25
- package/dist/ui/ccstyle/diff/render-utils.js.map +0 -1
- package/dist/ui/ccstyle/diff/shiki-highlight.d.ts +0 -19
- package/dist/ui/ccstyle/diff/shiki-highlight.d.ts.map +0 -1
- package/dist/ui/ccstyle/diff/shiki-highlight.js +0 -85
- package/dist/ui/ccstyle/diff/shiki-highlight.js.map +0 -1
- package/dist/ui/ccstyle/diff/types.d.ts +0 -22
- package/dist/ui/ccstyle/diff/types.d.ts.map +0 -1
- package/dist/ui/ccstyle/diff/types.js +0 -10
- package/dist/ui/ccstyle/diff/types.js.map +0 -1
- package/dist/ui/ccstyle/diff/write-display-utils.d.ts +0 -2
- package/dist/ui/ccstyle/diff/write-display-utils.d.ts.map +0 -1
- package/dist/ui/ccstyle/diff/write-display-utils.js +0 -12
- package/dist/ui/ccstyle/diff/write-display-utils.js.map +0 -1
- package/dist/ui/ccstyle/tool-renderer.d.ts +0 -17
- package/dist/ui/ccstyle/tool-renderer.d.ts.map +0 -1
- package/dist/ui/ccstyle/tool-renderer.js +0 -74
- package/dist/ui/ccstyle/tool-renderer.js.map +0 -1
- package/dist/ui/ccstyle/tool-result.d.ts +0 -44
- package/dist/ui/ccstyle/tool-result.d.ts.map +0 -1
- package/dist/ui/ccstyle/tool-result.js +0 -423
- package/dist/ui/ccstyle/tool-result.js.map +0 -1
- package/dist/ui/conversation-blocks.d.ts +0 -46
- package/dist/ui/conversation-blocks.d.ts.map +0 -1
- package/dist/ui/conversation-blocks.js +0 -313
- package/dist/ui/conversation-blocks.js.map +0 -1
- package/dist/ui/conversation-nvim.d.ts +0 -8
- package/dist/ui/conversation-nvim.d.ts.map +0 -1
- package/dist/ui/conversation-nvim.js +0 -117
- package/dist/ui/conversation-nvim.js.map +0 -1
- package/dist/ui/conversation-role.d.ts +0 -13
- package/dist/ui/conversation-role.d.ts.map +0 -1
- package/dist/ui/conversation-role.js +0 -39
- package/dist/ui/conversation-role.js.map +0 -1
- package/dist/ui/conversation-search.d.ts +0 -39
- package/dist/ui/conversation-search.d.ts.map +0 -1
- package/dist/ui/conversation-search.js +0 -124
- package/dist/ui/conversation-search.js.map +0 -1
- package/dist/ui/conversation-timeline.d.ts +0 -102
- package/dist/ui/conversation-timeline.d.ts.map +0 -1
- package/dist/ui/conversation-timeline.js +0 -555
- package/dist/ui/conversation-timeline.js.map +0 -1
- package/dist/ui/conversation-viewer.d.ts +0 -138
- package/dist/ui/conversation-viewer.d.ts.map +0 -1
- package/dist/ui/conversation-viewer.js +0 -1175
- package/dist/ui/conversation-viewer.js.map +0 -1
- package/dist/ui/schedule-menu.d.ts +0 -17
- package/dist/ui/schedule-menu.d.ts.map +0 -1
- package/dist/ui/schedule-menu.js +0 -95
- package/dist/ui/schedule-menu.js.map +0 -1
- package/dist/ui/select-item.d.ts +0 -28
- package/dist/ui/select-item.d.ts.map +0 -1
- package/dist/ui/select-item.js +0 -35
- package/dist/ui/select-item.js.map +0 -1
- package/dist/ui/viewer-keys.d.ts +0 -21
- package/dist/ui/viewer-keys.d.ts.map +0 -1
- package/dist/ui/viewer-keys.js +0 -18
- package/dist/ui/viewer-keys.js.map +0 -1
- package/dist/ui/workflow-card.d.ts +0 -176
- package/dist/ui/workflow-card.d.ts.map +0 -1
- package/dist/ui/workflow-card.js +0 -333
- package/dist/ui/workflow-card.js.map +0 -1
- package/dist/ui/workflow-dialog.d.ts +0 -306
- package/dist/ui/workflow-dialog.d.ts.map +0 -1
- package/dist/ui/workflow-dialog.js +0 -844
- package/dist/ui/workflow-dialog.js.map +0 -1
- package/dist/ui/workflow-menu.d.ts +0 -42
- package/dist/ui/workflow-menu.d.ts.map +0 -1
- package/dist/ui/workflow-menu.js +0 -127
- package/dist/ui/workflow-menu.js.map +0 -1
- package/dist/usage.d.ts +0 -136
- package/dist/usage.d.ts.map +0 -1
- package/dist/usage.js +0 -121
- package/dist/usage.js.map +0 -1
- package/dist/workflow/collisions.d.ts +0 -96
- package/dist/workflow/collisions.d.ts.map +0 -1
- package/dist/workflow/collisions.js +0 -89
- package/dist/workflow/collisions.js.map +0 -1
- package/dist/workflow/entry.d.ts +0 -33
- package/dist/workflow/entry.d.ts.map +0 -1
- package/dist/workflow/entry.js +0 -30
- package/dist/workflow/entry.js.map +0 -1
- package/dist/workflow/host.d.ts +0 -63
- package/dist/workflow/host.d.ts.map +0 -1
- package/dist/workflow/host.js +0 -363
- package/dist/workflow/host.js.map +0 -1
- package/dist/workflow/journal.d.ts +0 -98
- package/dist/workflow/journal.d.ts.map +0 -1
- package/dist/workflow/journal.js +0 -121
- package/dist/workflow/journal.js.map +0 -1
- package/dist/workflow/json-schema.d.ts +0 -52
- package/dist/workflow/json-schema.d.ts.map +0 -1
- package/dist/workflow/json-schema.js +0 -112
- package/dist/workflow/json-schema.js.map +0 -1
- package/dist/workflow/meta.d.ts +0 -68
- package/dist/workflow/meta.d.ts.map +0 -1
- package/dist/workflow/meta.js +0 -318
- package/dist/workflow/meta.js.map +0 -1
- package/dist/workflow/progress.d.ts +0 -225
- package/dist/workflow/progress.d.ts.map +0 -1
- package/dist/workflow/progress.js +0 -362
- package/dist/workflow/progress.js.map +0 -1
- package/dist/workflow/runtime.d.ts +0 -335
- package/dist/workflow/runtime.d.ts.map +0 -1
- package/dist/workflow/runtime.js +0 -831
- package/dist/workflow/runtime.js.map +0 -1
- package/dist/workflow/saved.d.ts +0 -91
- package/dist/workflow/saved.d.ts.map +0 -1
- package/dist/workflow/saved.js +0 -204
- package/dist/workflow/saved.js.map +0 -1
- package/dist/workflow/task.d.ts +0 -137
- package/dist/workflow/task.d.ts.map +0 -1
- package/dist/workflow/task.js +0 -208
- package/dist/workflow/task.js.map +0 -1
- package/dist/workflow/tool-description.d.ts +0 -39
- package/dist/workflow/tool-description.d.ts.map +0 -1
- package/dist/workflow/tool-description.js +0 -200
- package/dist/workflow/tool-description.js.map +0 -1
- package/dist/workflow/worker-source.d.ts +0 -48
- package/dist/workflow/worker-source.d.ts.map +0 -1
- package/dist/workflow/worker-source.js +0 -779
- package/dist/workflow/worker-source.js.map +0 -1
- package/dist/worktree.d.ts +0 -53
- package/dist/worktree.d.ts.map +0 -1
- package/dist/worktree.js +0 -165
- package/dist/worktree.js.map +0 -1
- package/dist/write-execution.d.ts +0 -42
- package/dist/write-execution.d.ts.map +0 -1
- package/dist/write-execution.js +0 -138
- package/dist/write-execution.js.map +0 -1
- package/dist/xml.d.ts +0 -11
- package/dist/xml.d.ts.map +0 -1
- package/dist/xml.js +0 -13
- package/dist/xml.js.map +0 -1
- package/src/abortable.ts +0 -43
- package/src/agent-color.ts +0 -161
- package/src/agent-file-toggle.ts +0 -269
- package/src/child-context.ts +0 -15
- package/src/mention-clone.ts +0 -196
- package/src/mention.ts +0 -141
- package/src/model-scope.ts +0 -70
- package/src/nested-tools.ts +0 -424
- package/src/structured-output.ts +0 -130
- package/src/ui/agent-mention.ts +0 -216
- package/src/ui/select-item.ts +0 -45
- package/src/ui/workflow-card.ts +0 -470
- package/src/ui/workflow-dialog.ts +0 -1115
- package/src/ui/workflow-menu.ts +0 -166
- package/src/workflow/collisions.ts +0 -123
- package/src/workflow/entry.ts +0 -47
- package/src/workflow/host.ts +0 -403
- package/src/workflow/journal.ts +0 -164
- package/src/workflow/json-schema.ts +0 -128
- package/src/workflow/meta.ts +0 -325
- package/src/workflow/progress.ts +0 -550
- package/src/workflow/runtime.ts +0 -1219
- package/src/workflow/saved.ts +0 -217
- package/src/workflow/task.ts +0 -302
- package/src/workflow/tool-description.ts +0 -200
- package/src/workflow/worker-source.ts +0 -781
- package/src/xml.ts +0 -13
package/dist/types.d.ts
DELETED
|
@@ -1,372 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* types.ts — Type definitions for the subagent system.
|
|
3
|
-
*/
|
|
4
|
-
import type { ThinkingLevel } from "@earendil-works/pi-ai";
|
|
5
|
-
import type { AgentSession } from "@earendil-works/pi-coding-agent";
|
|
6
|
-
import type { LifetimeUsage } from "./usage.js";
|
|
7
|
-
export type { ThinkingLevel };
|
|
8
|
-
/** Agent type: any string name (built-in defaults or user-defined). */
|
|
9
|
-
export type SubagentType = string;
|
|
10
|
-
/** Names of the three embedded default agents. */
|
|
11
|
-
export declare const DEFAULT_AGENT_NAMES: readonly ["general-purpose", "Explore", "Plan"];
|
|
12
|
-
/** Memory scope for persistent agent memory. */
|
|
13
|
-
export type MemoryScope = "user" | "project" | "local";
|
|
14
|
-
/**
|
|
15
|
-
* Isolation mode for agent execution.
|
|
16
|
-
*
|
|
17
|
-
* `"off"` exists for the caller's benefit, not the runtime's: models that fill
|
|
18
|
-
* every optional parameter had no legal way to decline a single-value
|
|
19
|
-
* `isolation` field and kept spawning worktrees they had just reasoned their
|
|
20
|
-
* way out of (#231, #184). It is an input spelling only —
|
|
21
|
-
* `resolveAgentInvocationConfig` collapses it to `undefined`, so nothing
|
|
22
|
-
* downstream sees a value other than `"worktree"`. In an agent file it is a
|
|
23
|
-
* genuine veto, since agent config outranks tool-call params.
|
|
24
|
-
*/
|
|
25
|
-
export type IsolationMode = "worktree" | "off";
|
|
26
|
-
/** Unified agent configuration — used for both default and user-defined agents. */
|
|
27
|
-
export interface AgentConfig {
|
|
28
|
-
name: string;
|
|
29
|
-
/** UI name. `display_name` wins; Claude Code's `name` is accepted as a fallback. */
|
|
30
|
-
displayName?: string;
|
|
31
|
-
/** Claude Code-compatible name color (named color or #RRGGBB). */
|
|
32
|
-
color?: string;
|
|
33
|
-
description: string;
|
|
34
|
-
builtinToolNames?: string[];
|
|
35
|
-
/** Raw `ext:` selector entries from the `tools:` CSV, e.g. ["ext:foo", "ext:bar/x"].
|
|
36
|
-
* Presence of any entry flips extension tools to an explicit allowlist. */
|
|
37
|
-
extSelectors?: string[];
|
|
38
|
-
/** Tool denylist — these tools are removed even if `builtinToolNames` or extensions include them. */
|
|
39
|
-
disallowedTools?: string[];
|
|
40
|
-
/** true = inherit all, string[] = only listed, false = none */
|
|
41
|
-
extensions: true | string[] | false;
|
|
42
|
-
/** Extension-name denylist applied after the `extensions:` include set. Exclude wins.
|
|
43
|
-
* Plain canonical names only (case-insensitive); no paths, no wildcard. */
|
|
44
|
-
excludeExtensions?: string[];
|
|
45
|
-
/** true = inherit all, string[] = only listed, false = none */
|
|
46
|
-
skills: true | string[] | false;
|
|
47
|
-
model?: string;
|
|
48
|
-
thinking?: ThinkingLevel;
|
|
49
|
-
maxTurns?: number;
|
|
50
|
-
/** Persist this subagent as a normal pi session instead of keeping it in memory only. */
|
|
51
|
-
persistSession?: boolean;
|
|
52
|
-
/** Write the subagent's .output transcript. Defaults to true; false suppresses only that transcript. */
|
|
53
|
-
outputTranscript?: boolean;
|
|
54
|
-
/** Optional session directory used when persistSession is true. Omitted = pi's normal session location. */
|
|
55
|
-
sessionDir?: string;
|
|
56
|
-
/**
|
|
57
|
-
* Nested delegation, off by default: undefined = no nested tools;
|
|
58
|
-
* "all" = any enabled agent; string[] = only those agent types.
|
|
59
|
-
*/
|
|
60
|
-
allowedSubagents?: "all" | string[];
|
|
61
|
-
systemPrompt: string;
|
|
62
|
-
promptMode: "replace" | "append";
|
|
63
|
-
/** Default for spawn: fork parent conversation. undefined = caller decides. */
|
|
64
|
-
inheritContext?: boolean;
|
|
65
|
-
/** Default for spawn: run in background. undefined = caller decides. */
|
|
66
|
-
runInBackground?: boolean;
|
|
67
|
-
/** Default for spawn: no extension tools. undefined = caller decides. */
|
|
68
|
-
isolated?: boolean;
|
|
69
|
-
/** Persistent memory scope — agents with memory get a persistent directory and MEMORY.md */
|
|
70
|
-
memory?: MemoryScope;
|
|
71
|
-
/**
|
|
72
|
-
* Isolation mode — "worktree" runs the agent in a temporary git worktree,
|
|
73
|
-
* "off" refuses one even when the caller asks (frontmatter outranks params).
|
|
74
|
-
*/
|
|
75
|
-
isolation?: IsolationMode;
|
|
76
|
-
/** true = this is an embedded default agent (informational) */
|
|
77
|
-
isDefault?: boolean;
|
|
78
|
-
/** false = agent is hidden from the registry */
|
|
79
|
-
enabled?: boolean;
|
|
80
|
-
/** Where this agent was loaded from */
|
|
81
|
-
source?: "default" | "project" | "global";
|
|
82
|
-
/** Path of the .md it was loaded from. Unset for embedded defaults. */
|
|
83
|
-
sourcePath?: string;
|
|
84
|
-
}
|
|
85
|
-
export type JoinMode = 'async' | 'group' | 'smart';
|
|
86
|
-
/**
|
|
87
|
-
* Display mode for the persistent above-editor agent widget.
|
|
88
|
-
* - `all`: show every agent (foreground + background).
|
|
89
|
-
* - `background`: hide foreground agents (they already render inline as the
|
|
90
|
-
* Agent tool result, #118); show background/queued/scheduled/RPC.
|
|
91
|
-
* - `off`: hide the widget entirely.
|
|
92
|
-
*/
|
|
93
|
-
export type WidgetMode = 'all' | 'background' | 'off';
|
|
94
|
-
/**
|
|
95
|
-
* How much of the conversation viewer's transcript is rendered as Markdown.
|
|
96
|
-
* - `off`: every line wraps as literal text, as it did before the mode existed.
|
|
97
|
-
* - `assistant`: assistant text renders as Markdown; tool results stay verbatim
|
|
98
|
-
* and dim. The default, because assistant text *is* Markdown by contract
|
|
99
|
-
* while a tool result is arbitrary bytes — a Markdown pass over a log or a
|
|
100
|
-
* diff eats `#` from shell comments, swallows a `---` line into a setext
|
|
101
|
-
* heading, re-fences indented output and redraws `| a | b |` as a table.
|
|
102
|
-
* (Ordered-list renumbering is the one such rewrite actively suppressed —
|
|
103
|
-
* see `MARKDOWN_OPTIONS` — because it silently changes data, not layout.)
|
|
104
|
-
* - `all`: tool results render as Markdown too, for tools that genuinely emit
|
|
105
|
-
* it (#210's `ctx_execute`), accepting the rewrites above on ones that don't.
|
|
106
|
-
*/
|
|
107
|
-
export type ViewerMarkdownMode = 'off' | 'assistant' | 'all';
|
|
108
|
-
/**
|
|
109
|
-
* How `@handle message` starts an agent that is not already running.
|
|
110
|
-
* - `model`: inject Claude Code's `agent_mention` reminder and let the main
|
|
111
|
-
* model spawn it with the `Agent` tool, which is what Claude Code does.
|
|
112
|
-
* - `direct`: spawn it here, immediately, with the typed message as its prompt
|
|
113
|
-
* and no main-model turn spent.
|
|
114
|
-
* - `off`: `@` means only "attach a file" again.
|
|
115
|
-
*
|
|
116
|
-
* Messaging a running agent and resuming a finished one are direct in every
|
|
117
|
-
* mode — Claude Code only differs from us on the *new* invocation.
|
|
118
|
-
*/
|
|
119
|
-
export type AgentMentionMode = 'model' | 'direct' | 'off';
|
|
120
|
-
/**
|
|
121
|
-
* What survives a record's eviction so `@handle` keeps working. The live record
|
|
122
|
-
* is discarded after ~10 minutes, but the pi session it wrote is still on disk,
|
|
123
|
-
* and this is the little that is needed to find and describe it again.
|
|
124
|
-
*/
|
|
125
|
-
export interface AgentTombstone {
|
|
126
|
-
handle: string;
|
|
127
|
-
alias?: string;
|
|
128
|
-
id: string;
|
|
129
|
-
type: SubagentType;
|
|
130
|
-
description: string;
|
|
131
|
-
/** Always set — a record with no session file is never tombstoned. */
|
|
132
|
-
sessionFile: string;
|
|
133
|
-
completedAt: number;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* What `@handle` resolved to: an agent still in memory, or the remains of one
|
|
137
|
-
* whose conversation can be reopened from disk.
|
|
138
|
-
*/
|
|
139
|
-
export type MentionResolution = {
|
|
140
|
-
kind: "live";
|
|
141
|
-
record: AgentRecord;
|
|
142
|
-
} | {
|
|
143
|
-
kind: "tombstone";
|
|
144
|
-
entry: AgentTombstone;
|
|
145
|
-
};
|
|
146
|
-
export interface AgentRecord {
|
|
147
|
-
id: string;
|
|
148
|
-
type: SubagentType;
|
|
149
|
-
/**
|
|
150
|
-
* Typeable name for the `@handle message` prompt mention, derived from the
|
|
151
|
-
* agent type and numbered when siblings collide (`explore`, `explore-2`).
|
|
152
|
-
* Top-level agents only — nested children are hidden from every top-level
|
|
153
|
-
* surface, so nothing can address them.
|
|
154
|
-
*/
|
|
155
|
-
handle?: string;
|
|
156
|
-
/**
|
|
157
|
-
* A second, memorable handle from the spawner's `name` (`@auth-audit`), drawn
|
|
158
|
-
* from the same namespace as `handle` so the two can never collide. Purely
|
|
159
|
-
* additive: `handle` is assigned regardless, so a named agent stays reachable
|
|
160
|
-
* by its type and `@explore` never comes to mean "start another one".
|
|
161
|
-
*/
|
|
162
|
-
alias?: string;
|
|
163
|
-
description: string;
|
|
164
|
-
status: "queued" | "running" | "completed" | "steered" | "aborted" | "stopped" | "error";
|
|
165
|
-
result?: string;
|
|
166
|
-
error?: string;
|
|
167
|
-
toolUses: number;
|
|
168
|
-
startedAt: number;
|
|
169
|
-
completedAt?: number;
|
|
170
|
-
session?: AgentSession;
|
|
171
|
-
abortController?: AbortController;
|
|
172
|
-
promise?: Promise<string>;
|
|
173
|
-
/**
|
|
174
|
-
* A caller is awaiting this agent inline (`spawnAndWait`) — what
|
|
175
|
-
* `maxConcurrentForeground` bounds. Distinct from `isBackground === false`,
|
|
176
|
-
* which says only that the agent has an inline result surface: a detached
|
|
177
|
-
* cross-extension RPC spawn is foreground by that measure and yet blocks
|
|
178
|
-
* nobody, so it takes no slot.
|
|
179
|
-
*/
|
|
180
|
-
blocking?: boolean;
|
|
181
|
-
/**
|
|
182
|
-
* Present only while the record is "queued": resolves when it leaves the
|
|
183
|
-
* queue, started or aborted. `spawnAndWait` waits on this because a queued
|
|
184
|
-
* record has no `promise` yet. Always resolves, never rejects — a rejection
|
|
185
|
-
* would escape into the caller's tool `execute` and take down pi's whole
|
|
186
|
-
* Promise.all tool batch.
|
|
187
|
-
*/
|
|
188
|
-
startGate?: Promise<void>;
|
|
189
|
-
groupId?: string;
|
|
190
|
-
joinMode?: JoinMode;
|
|
191
|
-
/** Set when result was already consumed via get_subagent_result — suppresses completion notification. */
|
|
192
|
-
resultConsumed?: boolean;
|
|
193
|
-
/** Steering messages queued before the session was ready. */
|
|
194
|
-
pendingSteers?: string[];
|
|
195
|
-
/** Worktree info if the agent is running in an isolated worktree. */
|
|
196
|
-
worktree?: {
|
|
197
|
-
path: string;
|
|
198
|
-
branch: string;
|
|
199
|
-
baseSha: string;
|
|
200
|
-
workPath: string;
|
|
201
|
-
};
|
|
202
|
-
/** Worktree cleanup result after agent completion. */
|
|
203
|
-
worktreeResult?: {
|
|
204
|
-
hasChanges: boolean;
|
|
205
|
-
branch?: string;
|
|
206
|
-
};
|
|
207
|
-
/** The tool_use_id from the original Agent tool call. */
|
|
208
|
-
toolCallId?: string;
|
|
209
|
-
/** Path to the streaming output transcript file. */
|
|
210
|
-
outputFile?: string;
|
|
211
|
-
/** Absolute path to the durable project-local transcript while live. */
|
|
212
|
-
historyFile?: string;
|
|
213
|
-
/** Project-relative durable transcript path persisted in the parent session. */
|
|
214
|
-
transcriptPath?: string;
|
|
215
|
-
/**
|
|
216
|
-
* The agent's pi session file, when it was persisted (`persist_session`, or
|
|
217
|
-
* the `rememberAgents` default). Captured so a mention can reopen the
|
|
218
|
-
* conversation after the record itself has been evicted; undefined for an
|
|
219
|
-
* in-memory session, which leaves nothing to reopen.
|
|
220
|
-
*/
|
|
221
|
-
sessionFile?: string;
|
|
222
|
-
/** Cleanup function for the optional `.output` stream subscription. */
|
|
223
|
-
outputCleanup?: () => void;
|
|
224
|
-
/** Cleanup function for the mandatory durable `.pi-subagents` history stream. */
|
|
225
|
-
historyCleanup?: () => void;
|
|
226
|
-
/**
|
|
227
|
-
* Lifetime usage breakdown, accumulated via `message_end` events. Survives
|
|
228
|
-
* compaction. Total = input + output + cacheWrite (cacheRead deliberately
|
|
229
|
-
* excluded — see issue #38). Initialized to zeros at spawn.
|
|
230
|
-
*/
|
|
231
|
-
lifetimeUsage: LifetimeUsage;
|
|
232
|
-
/** Number of times this agent's session has compacted. Initialized to 0 at spawn. */
|
|
233
|
-
compactionCount: number;
|
|
234
|
-
/**
|
|
235
|
-
* Whether this agent was spawned to run in the background. Tri-state, set at
|
|
236
|
-
* spawn from `SpawnOptions.isBackground`: `true` = background, `false` =
|
|
237
|
-
* foreground (has an inline Agent tool-result surface), `undefined` = the
|
|
238
|
-
* caller never declared it (e.g. a cross-extension RPC spawn, which is detached
|
|
239
|
-
* and has no inline surface). The widget's background-only filter keys off this
|
|
240
|
-
* — and excludes only explicit `false`, so `undefined` agents stay visible.
|
|
241
|
-
* Reliable across ALL spawn paths, unlike the UI-only `invocation` snapshot,
|
|
242
|
-
* which only the Agent-tool path populates.
|
|
243
|
-
*/
|
|
244
|
-
isBackground?: boolean;
|
|
245
|
-
/** Resolved spawn params, captured for UI display. Fixed at spawn time. */
|
|
246
|
-
invocation?: AgentInvocation;
|
|
247
|
-
/** Nesting depth: top-level subagent = 1. */
|
|
248
|
-
depth?: number;
|
|
249
|
-
/**
|
|
250
|
-
* The validated `StructuredOutput` payload, as canonical JSON.
|
|
251
|
-
*
|
|
252
|
-
* Set only when the spawn asked for a schema. Separate from `result` because
|
|
253
|
-
* `result` is prose for a reader — previewed in the widget, written to the
|
|
254
|
-
* transcript, and appended to with the worktree branch note — and JSON that
|
|
255
|
-
* has been appended to no longer parses.
|
|
256
|
-
*/
|
|
257
|
-
structuredJson?: string;
|
|
258
|
-
/** Whether the child needed the extra structured-output prompt. */
|
|
259
|
-
structuredRetried?: boolean;
|
|
260
|
-
/** Parent agent ID for ownership-scoped nested controls. */
|
|
261
|
-
parentAgentId?: string;
|
|
262
|
-
/**
|
|
263
|
-
* The workflow run that owns this child, when a workflow spawned it.
|
|
264
|
-
*
|
|
265
|
-
* Owned the same way a nested child is owned by its parent: filtered out of
|
|
266
|
-
* every top-level surface, and outside the `maxConcurrent` pool. See
|
|
267
|
-
* `isTopLevelAgent`.
|
|
268
|
-
*/
|
|
269
|
-
workflowId?: string;
|
|
270
|
-
/** Effective inherited nesting cap for this branch. */
|
|
271
|
-
maxSubagentDepth?: number;
|
|
272
|
-
/**
|
|
273
|
-
* Session id of the root (main) session this branch descends from. Nested
|
|
274
|
-
* spawns inherit it so their transcripts file under the same session
|
|
275
|
-
* directory as their ancestors' instead of the child session's own id.
|
|
276
|
-
*/
|
|
277
|
-
rootSessionId?: string;
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* What a session reports as its level: pi's `ThinkingLevel` plus the `"off"` a
|
|
281
|
-
* model with thinking disabled reports. Display-only — spawning still takes a
|
|
282
|
-
* `ThinkingLevel`, so this widening cannot leak into an invocation.
|
|
283
|
-
*/
|
|
284
|
-
export type EffectiveThinkingLevel = ThinkingLevel | "off";
|
|
285
|
-
export interface AgentInvocation {
|
|
286
|
-
/** Short display name for tight rows, e.g. "haiku 4.5". Always set once known. */
|
|
287
|
-
modelName?: string;
|
|
288
|
-
/** Canonical `provider/id`, for surfaces with room to disambiguate providers. */
|
|
289
|
-
modelId?: string;
|
|
290
|
-
/** The level actually in effect, once a session exists to report one. */
|
|
291
|
-
thinking?: EffectiveThinkingLevel;
|
|
292
|
-
/**
|
|
293
|
-
* What the caller asked for, kept only when they did not get it — pi clamped
|
|
294
|
-
* the level to the model's capabilities, or an agent file's frontmatter
|
|
295
|
-
* outranked the parameter (#182). The snapshot exists to answer "did the spawn
|
|
296
|
-
* honor my instructions?" (#62), which it cannot do if the request is lost, so
|
|
297
|
-
* neither `requested*` field is overwritten once set.
|
|
298
|
-
*/
|
|
299
|
-
requestedThinking?: EffectiveThinkingLevel;
|
|
300
|
-
/** The caller's `model` parameter, as written, when an agent file's pin won. */
|
|
301
|
-
requestedModel?: string;
|
|
302
|
-
maxTurns?: number;
|
|
303
|
-
isolated?: boolean;
|
|
304
|
-
inheritContext?: boolean;
|
|
305
|
-
runInBackground?: boolean;
|
|
306
|
-
isolation?: IsolationMode;
|
|
307
|
-
}
|
|
308
|
-
/** Details attached to custom notification messages for visual rendering. */
|
|
309
|
-
export interface NotificationDetails {
|
|
310
|
-
id: string;
|
|
311
|
-
description: string;
|
|
312
|
-
status: string;
|
|
313
|
-
toolUses: number;
|
|
314
|
-
turnCount: number;
|
|
315
|
-
maxTurns?: number;
|
|
316
|
-
totalTokens: number;
|
|
317
|
-
/**
|
|
318
|
-
* Estimated cost in USD, from pi's per-message `usage.cost.total`. Always
|
|
319
|
-
* populated (0 when the model has no pricing); the renderer decides whether
|
|
320
|
-
* to show it, per the `showCost` setting.
|
|
321
|
-
*/
|
|
322
|
-
totalCost?: number;
|
|
323
|
-
durationMs: number;
|
|
324
|
-
outputFile?: string;
|
|
325
|
-
error?: string;
|
|
326
|
-
resultPreview: string;
|
|
327
|
-
/** Additional agents in a group notification. */
|
|
328
|
-
others?: NotificationDetails[];
|
|
329
|
-
}
|
|
330
|
-
export interface EnvInfo {
|
|
331
|
-
isGitRepo: boolean;
|
|
332
|
-
branch: string;
|
|
333
|
-
platform: string;
|
|
334
|
-
}
|
|
335
|
-
/**
|
|
336
|
-
* A subagent spawn registered to fire on a schedule.
|
|
337
|
-
*
|
|
338
|
-
* Stored at `<cwd>/.pi/subagent-schedules/<sessionId>.json`. Session-scoped:
|
|
339
|
-
* survives `/resume` but resets on `/new`, mirroring pi-chonky-tasks.
|
|
340
|
-
*/
|
|
341
|
-
export interface ScheduledSubagent {
|
|
342
|
-
id: string;
|
|
343
|
-
/** Unique within store. Defaults to `description`. */
|
|
344
|
-
name: string;
|
|
345
|
-
description: string;
|
|
346
|
-
/** Raw user input — cron expr | "+10m" | ISO | "5m". */
|
|
347
|
-
schedule: string;
|
|
348
|
-
scheduleType: "cron" | "once" | "interval";
|
|
349
|
-
/** Computed at create time for interval/once. */
|
|
350
|
-
intervalMs?: number;
|
|
351
|
-
subagent_type: SubagentType;
|
|
352
|
-
prompt: string;
|
|
353
|
-
model?: string;
|
|
354
|
-
thinking?: ThinkingLevel;
|
|
355
|
-
max_turns?: number;
|
|
356
|
-
isolated?: boolean;
|
|
357
|
-
isolation?: IsolationMode;
|
|
358
|
-
enabled: boolean;
|
|
359
|
-
/** ISO timestamp. */
|
|
360
|
-
createdAt: string;
|
|
361
|
-
lastRun?: string;
|
|
362
|
-
lastStatus?: "success" | "error" | "running";
|
|
363
|
-
/** Refreshed on every fire and on store load. */
|
|
364
|
-
nextRun?: string;
|
|
365
|
-
runCount: number;
|
|
366
|
-
}
|
|
367
|
-
export interface ScheduleStoreData {
|
|
368
|
-
/** For future migrations. */
|
|
369
|
-
version: 1;
|
|
370
|
-
jobs: ScheduledSubagent[];
|
|
371
|
-
}
|
|
372
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,YAAY,EAAE,aAAa,EAAE,CAAC;AAE9B,uEAAuE;AACvE,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC,kDAAkD;AAClD,eAAO,MAAM,mBAAmB,iDAAkD,CAAC;AAEnF,gDAAgD;AAChD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,KAAK,CAAC;AAE/C,mFAAmF;AACnF,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,oFAAoF;IACpF,WAAW,CAAC,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IACjB,UAAU,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IAC7C,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,6BAA6B;IAC7B,OAAO,EAAE,CAAC,CAAC;IACX,IAAI,EAAE,iBAAiB,EAAE,CAAC;CAC3B"}
|
package/dist/types.js
DELETED
package/dist/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH,kDAAkD;AAClD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,iBAAiB,EAAE,SAAS,EAAE,MAAM,CAAU,CAAC"}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* agent-mention.ts — what `@` can address, and the suggestions pi renders for it.
|
|
3
|
-
*
|
|
4
|
-
* A subagent is addressable whether or not it is currently running: a live
|
|
5
|
-
* record is messaged or resumed, an evicted one whose session is still on disk
|
|
6
|
-
* is reopened, and an agent *type* with no instance at all is started. That is
|
|
7
|
-
* the point of the handle — `@explore` means the Explore agent, not "the
|
|
8
|
-
* Explore process that happens to exist right now" — so the roster below unions
|
|
9
|
-
* all three, and the dispatcher and the popup read the same list.
|
|
10
|
-
*
|
|
11
|
-
* Rows are per *agent*, not per handle. An agent given a `name` holds two names
|
|
12
|
-
* (its alias and its type-derived handle) and both resolve, but it lists once,
|
|
13
|
-
* under the alias, with its type moved into the description so the row still
|
|
14
|
-
* says what it is.
|
|
15
|
-
*
|
|
16
|
-
* pi's `CombinedAutocompleteProvider` already owns `@`, where it means "attach a
|
|
17
|
-
* file". Extensions can wrap it (`ctx.ui.addAutocompleteProvider`), so this
|
|
18
|
-
* provider adds the `@` tokens that name an agent and delegates everything else
|
|
19
|
-
* — including all of `applyCompletion`, whose `@`-branch already inserts
|
|
20
|
-
* `item.value` plus a trailing space, which is exactly what a handle needs.
|
|
21
|
-
*
|
|
22
|
-
* Matching mirrors Claude Code: case-insensitive prefix, not fuzzy. What it does
|
|
23
|
-
* NOT mirror is Claude Code dropping files whenever an agent matches. Here `@` is
|
|
24
|
-
* pi's file picker first, and the handles are additive, so a token matching both
|
|
25
|
-
* lists both — agents first. Suppressing on any match sounds narrow and is not:
|
|
26
|
-
* an empty token prefix-matches every handle, so a bare `@` — the gesture people
|
|
27
|
-
* use to browse files — would offer no files at all, and a single letter
|
|
28
|
-
* beginning any handle would do the same.
|
|
29
|
-
*
|
|
30
|
-
* Both halves ship under ONE `prefix`, which is sound because wherever BOTH sides
|
|
31
|
-
* produce rows they measured the same span. pi's `extractAtPrefix` takes the
|
|
32
|
-
* token after the last of `{space, tab, ", ', =}` and keeps it only if it starts
|
|
33
|
-
* with `@`; `MENTION_TRIGGER` matches `@[\w-]*` at the cursor, after start-of-line
|
|
34
|
-
* or `[\s。、?!]`. Where those two disagree, exactly one side answers and there
|
|
35
|
-
* is nothing to merge: `@src/index.ts` and `@"my file` are pi's alone (no handle
|
|
36
|
-
* matches), `=@ex` is pi's alone (`=` is a delimiter to pi, not a boundary to us),
|
|
37
|
-
* and `。@ex` is ours alone (the reverse). A merged response therefore never
|
|
38
|
-
* carries a prefix from one side and an item from the other.
|
|
39
|
-
*
|
|
40
|
-
* Offering never-started types is a deliberate step beyond Claude Code, whose
|
|
41
|
-
* registry holds only live tasks, so an agent you had not launched yet was
|
|
42
|
-
* unaddressable.
|
|
43
|
-
*/
|
|
44
|
-
import type { AutocompleteProvider } from "@earendil-works/pi-tui";
|
|
45
|
-
import type { AgentManager } from "../agent-manager.js";
|
|
46
|
-
import type { AgentRecord, AgentTombstone } from "../types.js";
|
|
47
|
-
/**
|
|
48
|
-
* One thing `@` can address, and what sending to it will do. `typeLabel` is the
|
|
49
|
-
* agent's `display_name`, resolved by the caller: this module stays independent
|
|
50
|
-
* of the type registry, but the popup must agree with the Agents widget,
|
|
51
|
-
* which renders the label rather than the raw type.
|
|
52
|
-
*/
|
|
53
|
-
export type MentionTarget = {
|
|
54
|
-
kind: "record";
|
|
55
|
-
handle: string;
|
|
56
|
-
record: AgentRecord;
|
|
57
|
-
typeLabel: string;
|
|
58
|
-
} | {
|
|
59
|
-
kind: "tombstone";
|
|
60
|
-
handle: string;
|
|
61
|
-
entry: AgentTombstone;
|
|
62
|
-
typeLabel: string;
|
|
63
|
-
} | {
|
|
64
|
-
kind: "type";
|
|
65
|
-
handle: string;
|
|
66
|
-
type: string;
|
|
67
|
-
description: string;
|
|
68
|
-
};
|
|
69
|
-
/** The registry facts the roster needs, so it stays independent of agent-types. */
|
|
70
|
-
export type TypeInfo = {
|
|
71
|
-
name: string;
|
|
72
|
-
description: string;
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* Everything `@` can reach, in the order the popup lists it: steerable agents
|
|
76
|
-
* first, then the other live ones earliest-launched, then agent types with no
|
|
77
|
-
* live instance. A type whose handle a record already holds is omitted — that
|
|
78
|
-
* name addresses the existing agent, which is what makes `@explore` mean
|
|
79
|
-
* "message the one that's running" and only otherwise "start one".
|
|
80
|
-
*/
|
|
81
|
-
export declare function mentionRoster(manager: AgentManager, types: readonly TypeInfo[], displayNameOf?: (type: string) => string): MentionTarget[];
|
|
82
|
-
export declare function createMentionProvider(current: AutocompleteProvider, roster: () => MentionTarget[], isEnabled: () => boolean): AutocompleteProvider;
|
|
83
|
-
//# sourceMappingURL=agent-mention.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-mention.d.ts","sourceRoot":"","sources":["../../src/ui/agent-mention.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,KAAK,EAAoB,oBAAoB,EAA2B,MAAM,wBAAwB,CAAC;AAC9G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CA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