@melihmucuk/pi-crew 1.0.17 → 1.0.18

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.
Files changed (31) hide show
  1. package/extension/catalog.ts +543 -0
  2. package/extension/crew.ts +383 -0
  3. package/extension/index.ts +5 -6
  4. package/extension/subagent-session.ts +270 -0
  5. package/extension/tools.ts +323 -0
  6. package/extension/ui.ts +309 -0
  7. package/package.json +1 -1
  8. package/extension/agent-catalog.ts +0 -369
  9. package/extension/agent-config-fields.ts +0 -359
  10. package/extension/agent-discovery.ts +0 -123
  11. package/extension/bootstrap-session.ts +0 -131
  12. package/extension/integration/crew-tool-actions.ts +0 -306
  13. package/extension/integration/crew-tool-executor.ts +0 -109
  14. package/extension/integration/register-renderers.ts +0 -77
  15. package/extension/integration/register-tools.ts +0 -47
  16. package/extension/integration/tool-presentation.ts +0 -30
  17. package/extension/integration/tools/crew-abort.ts +0 -56
  18. package/extension/integration/tools/crew-done.ts +0 -27
  19. package/extension/integration/tools/crew-list.ts +0 -36
  20. package/extension/integration/tools/crew-respond.ts +0 -38
  21. package/extension/integration/tools/crew-spawn.ts +0 -46
  22. package/extension/message-delivery-policy.ts +0 -22
  23. package/extension/runtime/crew-runtime.ts +0 -263
  24. package/extension/runtime/owner-session-coordinator.ts +0 -138
  25. package/extension/runtime/subagent-lifecycle.ts +0 -203
  26. package/extension/runtime/subagent-registry.ts +0 -122
  27. package/extension/runtime/subagent-transitions.ts +0 -100
  28. package/extension/status-widget.ts +0 -107
  29. package/extension/subagent-messages.ts +0 -116
  30. package/extension/tool-registry.ts +0 -19
  31. /package/extension/{runtime/overflow-recovery.ts → overflow-recovery.ts} +0 -0
@@ -1,116 +0,0 @@
1
- import { sendWithDeliveryPolicy, type SendMessageFn } from "./message-delivery-policy.js";
2
-
3
- export type { SendMessageFn } from "./message-delivery-policy.js";
4
- export type SubagentStatus = "running" | "waiting" | "done" | "error" | "aborted";
5
-
6
- export const STATUS_ICON: Record<SubagentStatus, string> = {
7
- running: "⏳",
8
- waiting: "⏳",
9
- done: "✅",
10
- error: "❌",
11
- aborted: "⏹️",
12
- };
13
-
14
- export const STATUS_LABEL: Record<SubagentStatus, string> = {
15
- running: "running",
16
- waiting: "waiting for response",
17
- done: "done",
18
- error: "failed",
19
- aborted: "aborted",
20
- };
21
-
22
- export interface SteeringPayload {
23
- id: string;
24
- agentName: string;
25
- sessionFile?: string;
26
- status: SubagentStatus;
27
- result?: string;
28
- error?: string;
29
- }
30
-
31
- export interface CrewResultMessageDetails {
32
- agentId: string;
33
- agentName: string;
34
- sessionFile?: string;
35
- status: SubagentStatus;
36
- body?: string;
37
- }
38
-
39
- export function getCrewResultTitle(details: {
40
- agentId: string;
41
- agentName: string;
42
- status: SubagentStatus;
43
- }): string {
44
- return `Subagent '${details.agentName}' (${details.agentId}) ${STATUS_LABEL[details.status]}`;
45
- }
46
-
47
- function getSteeringBody(payload: SteeringPayload): string | undefined {
48
- return (payload.status === "error" || payload.status === "aborted")
49
- ? (payload.error ?? payload.result)
50
- : (payload.result ?? payload.error);
51
- }
52
-
53
- export function sendSteeringMessage(
54
- payload: SteeringPayload,
55
- sendMessage: SendMessageFn,
56
- opts: { isIdle: boolean; triggerTurn: boolean },
57
- ): void {
58
- const body = getSteeringBody(payload);
59
- const title = getCrewResultTitle({
60
- agentId: payload.id,
61
- agentName: payload.agentName,
62
- status: payload.status,
63
- });
64
- const content = body
65
- ? `**${STATUS_ICON[payload.status]} ${title}**\n\n${body}`
66
- : `**${STATUS_ICON[payload.status]} ${title}**`;
67
-
68
- const message = {
69
- customType: "crew-result",
70
- content,
71
- display: true,
72
- details: {
73
- agentId: payload.id,
74
- agentName: payload.agentName,
75
- sessionFile: payload.sessionFile,
76
- status: payload.status,
77
- body,
78
- } satisfies CrewResultMessageDetails,
79
- };
80
-
81
- sendWithDeliveryPolicy(message, sendMessage, opts);
82
- }
83
-
84
- export function sendRemainingNote(
85
- remainingCount: number,
86
- sendMessage: SendMessageFn,
87
- opts: { isIdle: boolean; triggerTurn: boolean },
88
- ): void {
89
- if (remainingCount <= 0) return;
90
-
91
- sendWithDeliveryPolicy(
92
- {
93
- customType: "crew-remaining",
94
- content: `⏳ ${remainingCount} subagent(s) still running`,
95
- display: true,
96
- },
97
- sendMessage,
98
- opts,
99
- );
100
- }
101
-
102
- export function sendCrewListActiveWarning(
103
- sendMessage: SendMessageFn,
104
- opts: { isIdle: boolean; triggerTurn: boolean },
105
- ): void {
106
- sendWithDeliveryPolicy(
107
- {
108
- customType: "crew-list-warning",
109
- content:
110
- "⚠ Active subagents detected. Do not poll crew_list for completion — results arrive as steering messages. Continue with unrelated work or end your turn and wait for the steering messages.",
111
- display: true,
112
- },
113
- sendMessage,
114
- opts,
115
- );
116
- }
@@ -1,19 +0,0 @@
1
- const SUPPORTED_TOOL_NAMES_LITERAL = [
2
- "read",
3
- "bash",
4
- "edit",
5
- "write",
6
- "grep",
7
- "find",
8
- "ls",
9
- ] as const;
10
-
11
- export type SupportedToolName = (typeof SUPPORTED_TOOL_NAMES_LITERAL)[number];
12
-
13
- export const SUPPORTED_TOOL_NAMES = Object.freeze(
14
- [...SUPPORTED_TOOL_NAMES_LITERAL] as SupportedToolName[],
15
- );
16
-
17
- export function isSupportedToolName(name: string): name is SupportedToolName {
18
- return SUPPORTED_TOOL_NAMES.includes(name as SupportedToolName);
19
- }