@gotgenes/pi-subagents 1.0.0 → 1.0.2
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/AGENTS.md +4 -82
- package/CHANGELOG.md +29 -0
- package/README.md +18 -4
- package/docs/architecture/architecture.md +391 -0
- package/docs/decisions/0001-deferred-patches.md +13 -14
- package/docs/plans/0051-update-adr-0001-hard-fork.md +74 -0
- package/package.json +12 -17
- package/.markdownlint-cli2.yaml +0 -19
- package/.release-please-manifest.json +0 -3
- package/dist/agent-manager.d.ts +0 -108
- package/dist/agent-manager.js +0 -390
- package/dist/agent-runner.d.ts +0 -93
- package/dist/agent-runner.js +0 -428
- package/dist/agent-types.d.ts +0 -48
- package/dist/agent-types.js +0 -136
- package/dist/context.d.ts +0 -12
- package/dist/context.js +0 -56
- package/dist/cross-extension-rpc.d.ts +0 -46
- package/dist/cross-extension-rpc.js +0 -54
- package/dist/custom-agents.d.ts +0 -14
- package/dist/custom-agents.js +0 -127
- package/dist/default-agents.d.ts +0 -7
- package/dist/default-agents.js +0 -119
- package/dist/env.d.ts +0 -6
- package/dist/env.js +0 -28
- package/dist/group-join.d.ts +0 -32
- package/dist/group-join.js +0 -116
- package/dist/index.d.ts +0 -13
- package/dist/index.js +0 -1731
- package/dist/invocation-config.d.ts +0 -22
- package/dist/invocation-config.js +0 -15
- package/dist/memory.d.ts +0 -49
- package/dist/memory.js +0 -151
- package/dist/model-resolver.d.ts +0 -19
- package/dist/model-resolver.js +0 -62
- package/dist/output-file.d.ts +0 -24
- package/dist/output-file.js +0 -86
- package/dist/prompts.d.ts +0 -29
- package/dist/prompts.js +0 -72
- package/dist/schedule-store.d.ts +0 -36
- package/dist/schedule-store.js +0 -144
- package/dist/schedule.d.ts +0 -109
- package/dist/schedule.js +0 -338
- package/dist/settings.d.ts +0 -66
- package/dist/settings.js +0 -130
- package/dist/skill-loader.d.ts +0 -24
- package/dist/skill-loader.js +0 -93
- package/dist/types.d.ts +0 -164
- package/dist/types.js +0 -5
- package/dist/ui/agent-widget.d.ts +0 -134
- package/dist/ui/agent-widget.js +0 -451
- package/dist/ui/conversation-viewer.d.ts +0 -35
- package/dist/ui/conversation-viewer.js +0 -252
- package/dist/ui/schedule-menu.d.ts +0 -16
- package/dist/ui/schedule-menu.js +0 -95
- package/dist/usage.d.ts +0 -50
- package/dist/usage.js +0 -49
- package/dist/worktree.d.ts +0 -36
- package/dist/worktree.js +0 -139
- package/prek.toml +0 -24
- package/release-please-config.json +0 -22
package/dist/group-join.js
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* group-join.ts — Manages grouped background agent completion notifications.
|
|
3
|
-
*
|
|
4
|
-
* Instead of each agent individually nudging the main agent on completion,
|
|
5
|
-
* agents in a group are held until all complete (or a timeout fires),
|
|
6
|
-
* then a single consolidated notification is sent.
|
|
7
|
-
*/
|
|
8
|
-
/** Default timeout: 30s after first completion in a group. */
|
|
9
|
-
const DEFAULT_TIMEOUT = 30_000;
|
|
10
|
-
/** Straggler re-batch timeout: 15s. */
|
|
11
|
-
const STRAGGLER_TIMEOUT = 15_000;
|
|
12
|
-
export class GroupJoinManager {
|
|
13
|
-
deliverCb;
|
|
14
|
-
groupTimeout;
|
|
15
|
-
groups = new Map();
|
|
16
|
-
agentToGroup = new Map();
|
|
17
|
-
constructor(deliverCb, groupTimeout = DEFAULT_TIMEOUT) {
|
|
18
|
-
this.deliverCb = deliverCb;
|
|
19
|
-
this.groupTimeout = groupTimeout;
|
|
20
|
-
}
|
|
21
|
-
/** Register a group of agent IDs that should be joined. */
|
|
22
|
-
registerGroup(groupId, agentIds) {
|
|
23
|
-
const group = {
|
|
24
|
-
groupId,
|
|
25
|
-
agentIds: new Set(agentIds),
|
|
26
|
-
completedRecords: new Map(),
|
|
27
|
-
delivered: false,
|
|
28
|
-
isStraggler: false,
|
|
29
|
-
};
|
|
30
|
-
this.groups.set(groupId, group);
|
|
31
|
-
for (const id of agentIds) {
|
|
32
|
-
this.agentToGroup.set(id, groupId);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Called when an agent completes.
|
|
37
|
-
* Returns:
|
|
38
|
-
* - 'pass' — agent is not grouped, caller should send individual nudge
|
|
39
|
-
* - 'held' — result held, waiting for group completion
|
|
40
|
-
* - 'delivered' — this completion triggered the group notification
|
|
41
|
-
*/
|
|
42
|
-
onAgentComplete(record) {
|
|
43
|
-
const groupId = this.agentToGroup.get(record.id);
|
|
44
|
-
if (!groupId)
|
|
45
|
-
return 'pass';
|
|
46
|
-
const group = this.groups.get(groupId);
|
|
47
|
-
if (!group || group.delivered)
|
|
48
|
-
return 'pass';
|
|
49
|
-
group.completedRecords.set(record.id, record);
|
|
50
|
-
// All done — deliver immediately
|
|
51
|
-
if (group.completedRecords.size >= group.agentIds.size) {
|
|
52
|
-
this.deliver(group, false);
|
|
53
|
-
return 'delivered';
|
|
54
|
-
}
|
|
55
|
-
// First completion in this batch — start timeout
|
|
56
|
-
if (!group.timeoutHandle) {
|
|
57
|
-
const timeout = group.isStraggler ? STRAGGLER_TIMEOUT : this.groupTimeout;
|
|
58
|
-
group.timeoutHandle = setTimeout(() => {
|
|
59
|
-
this.onTimeout(group);
|
|
60
|
-
}, timeout);
|
|
61
|
-
}
|
|
62
|
-
return 'held';
|
|
63
|
-
}
|
|
64
|
-
onTimeout(group) {
|
|
65
|
-
if (group.delivered)
|
|
66
|
-
return;
|
|
67
|
-
group.timeoutHandle = undefined;
|
|
68
|
-
// Partial delivery — some agents still running
|
|
69
|
-
const remaining = new Set();
|
|
70
|
-
for (const id of group.agentIds) {
|
|
71
|
-
if (!group.completedRecords.has(id))
|
|
72
|
-
remaining.add(id);
|
|
73
|
-
}
|
|
74
|
-
// Clean up agentToGroup for delivered agents (they won't complete again)
|
|
75
|
-
for (const id of group.completedRecords.keys()) {
|
|
76
|
-
this.agentToGroup.delete(id);
|
|
77
|
-
}
|
|
78
|
-
// Deliver what we have
|
|
79
|
-
this.deliverCb([...group.completedRecords.values()], true);
|
|
80
|
-
// Set up straggler group for remaining agents
|
|
81
|
-
group.completedRecords.clear();
|
|
82
|
-
group.agentIds = remaining;
|
|
83
|
-
group.isStraggler = true;
|
|
84
|
-
// Timeout will be started when the next straggler completes
|
|
85
|
-
}
|
|
86
|
-
deliver(group, partial) {
|
|
87
|
-
if (group.timeoutHandle) {
|
|
88
|
-
clearTimeout(group.timeoutHandle);
|
|
89
|
-
group.timeoutHandle = undefined;
|
|
90
|
-
}
|
|
91
|
-
group.delivered = true;
|
|
92
|
-
this.deliverCb([...group.completedRecords.values()], partial);
|
|
93
|
-
this.cleanupGroup(group.groupId);
|
|
94
|
-
}
|
|
95
|
-
cleanupGroup(groupId) {
|
|
96
|
-
const group = this.groups.get(groupId);
|
|
97
|
-
if (!group)
|
|
98
|
-
return;
|
|
99
|
-
for (const id of group.agentIds) {
|
|
100
|
-
this.agentToGroup.delete(id);
|
|
101
|
-
}
|
|
102
|
-
this.groups.delete(groupId);
|
|
103
|
-
}
|
|
104
|
-
/** Check if an agent is in a group. */
|
|
105
|
-
isGrouped(agentId) {
|
|
106
|
-
return this.agentToGroup.has(agentId);
|
|
107
|
-
}
|
|
108
|
-
dispose() {
|
|
109
|
-
for (const group of this.groups.values()) {
|
|
110
|
-
if (group.timeoutHandle)
|
|
111
|
-
clearTimeout(group.timeoutHandle);
|
|
112
|
-
}
|
|
113
|
-
this.groups.clear();
|
|
114
|
-
this.agentToGroup.clear();
|
|
115
|
-
}
|
|
116
|
-
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* pi-agents — A pi extension providing Claude Code-style autonomous sub-agents.
|
|
3
|
-
*
|
|
4
|
-
* Tools:
|
|
5
|
-
* Agent — LLM-callable: spawn a sub-agent
|
|
6
|
-
* get_subagent_result — LLM-callable: check background agent status/result
|
|
7
|
-
* steer_subagent — LLM-callable: send a steering message to a running agent
|
|
8
|
-
*
|
|
9
|
-
* Commands:
|
|
10
|
-
* /agents — Interactive agent management menu
|
|
11
|
-
*/
|
|
12
|
-
import { type ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
13
|
-
export default function (pi: ExtensionAPI): void;
|