privateer-agent 0.2.1 → 0.3.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/README.md +135 -443
- package/bin/privateer-tui +86 -0
- package/bin/privateer.mjs +17 -6
- package/bin/pv +28 -0
- package/package.json +26 -23
- package/src/auth/privateer.ts +57 -0
- package/src/boot.ts +43 -0
- package/src/bridge/engineAdapter.ts +182 -0
- package/src/cli/chat.ts +243 -0
- package/src/config/paths.ts +24 -46
- package/src/config/permissionMode.ts +5 -0
- package/src/crypto/outboxSeal.ts +61 -0
- package/src/daemon/index.ts +204 -121
- package/src/daemon/ipc.ts +1 -1
- package/src/engine/errors.ts +85 -45
- package/src/engine/router.ts +11 -165
- package/src/ext/permissionGate.ts +216 -0
- package/src/main.ts +32 -0
- package/src/permissions/classify.ts +172 -0
- package/src/permissions/gate.ts +11 -14
- package/src/permissions/mode.ts +6 -2
- package/src/permissions/{uiGate.ts → modeGate.ts} +18 -3
- package/src/providers/account.ts +170 -0
- package/src/providers/catalog.ts +73 -61
- package/src/providers/genModelsJson.ts +97 -0
- package/src/remote/relayClient.ts +15 -0
- package/src/remote/remoteBridge.ts +152 -0
- package/src/routines/delivery.ts +118 -9
- package/src/routines/schema.ts +24 -5
- package/src/routines/store.ts +44 -1
- package/src/routines/toolSelect.ts +3 -1
- package/src/session.ts +81 -273
- package/src/tools/routine.ts +120 -101
- package/src/tools/saveAttachment.ts +39 -42
- package/src/tools/sendFile.ts +75 -0
- package/src/util/attachmentStore.ts +18 -35
- package/src/util/redact.ts +33 -3
- package/LICENSE +0 -21
- package/src/agents/loader.ts +0 -49
- package/src/commands/custom.ts +0 -123
- package/src/commands/registry.ts +0 -618
- package/src/components/AgentGroupView.tsx +0 -104
- package/src/components/App.tsx +0 -1626
- package/src/components/ApprovalPrompt.tsx +0 -49
- package/src/components/Banner.tsx +0 -78
- package/src/components/Markdown.tsx +0 -183
- package/src/components/ModeHint.tsx +0 -40
- package/src/components/ModelPicker.tsx +0 -302
- package/src/components/Onboarding.tsx +0 -203
- package/src/components/OptionPicker.tsx +0 -134
- package/src/components/PlanConfirm.tsx +0 -37
- package/src/components/PrivateerLogin.tsx +0 -109
- package/src/components/PromptInput.tsx +0 -602
- package/src/components/RewindPicker.tsx +0 -69
- package/src/components/Root.tsx +0 -116
- package/src/components/SessionPicker.tsx +0 -64
- package/src/components/StatusBar.tsx +0 -131
- package/src/components/TodoPanel.tsx +0 -36
- package/src/components/ToolCallView.tsx +0 -113
- package/src/components/Transcript.tsx +0 -210
- package/src/components/figures.ts +0 -14
- package/src/components/promptModel.ts +0 -73
- package/src/components/spinnerVerbs.ts +0 -46
- package/src/components/theme.ts +0 -57
- package/src/components/types.ts +0 -34
- package/src/components/useTeeShield.ts +0 -104
- package/src/components/useTerminalWidth.ts +0 -24
- package/src/components/useZdrShield.ts +0 -126
- package/src/config/load.ts +0 -115
- package/src/config/schema.ts +0 -94
- package/src/context/outputStyles.ts +0 -42
- package/src/context/projectInfo.ts +0 -59
- package/src/context/systemPrompt.ts +0 -176
- package/src/engine/QueryEngine.ts +0 -399
- package/src/hooks/engine.ts +0 -155
- package/src/main.tsx +0 -209
- package/src/mcp/client.ts +0 -251
- package/src/mcp/oauth.ts +0 -245
- package/src/memory/auto.ts +0 -146
- package/src/memory/checkpoints.ts +0 -227
- package/src/memory/store.ts +0 -127
- package/src/providers/attestation.ts +0 -149
- package/src/providers/capabilities.ts +0 -104
- package/src/providers/models.ts +0 -183
- package/src/providers/registry.ts +0 -71
- package/src/providers/resolve.ts +0 -78
- package/src/skills/installer.ts +0 -222
- package/src/skills/loader.ts +0 -88
- package/src/tools/askUser.ts +0 -92
- package/src/tools/bash.ts +0 -98
- package/src/tools/context.ts +0 -128
- package/src/tools/edit.ts +0 -67
- package/src/tools/exec.ts +0 -60
- package/src/tools/glob.ts +0 -39
- package/src/tools/grep.ts +0 -86
- package/src/tools/index.ts +0 -83
- package/src/tools/memory.ts +0 -53
- package/src/tools/processRegistry.ts +0 -77
- package/src/tools/read.ts +0 -42
- package/src/tools/sendFileToClient.ts +0 -55
- package/src/tools/skill.ts +0 -44
- package/src/tools/task.ts +0 -52
- package/src/tools/todo.ts +0 -36
- package/src/tools/todoStore.ts +0 -31
- package/src/tools/walk.ts +0 -44
- package/src/tools/web.ts +0 -145
- package/src/tools/worktree.ts +0 -145
- package/src/tools/write.ts +0 -40
- package/src/util/images.ts +0 -378
- package/src/util/limit.ts +0 -32
- package/src/version.ts +0 -13
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import Spinner from "ink-spinner";
|
|
4
|
-
import type { ToolEntry } from "./types.ts";
|
|
5
|
-
import { theme } from "./theme.ts";
|
|
6
|
-
import { formatTokens } from "./StatusBar.tsx";
|
|
7
|
-
import { BULLET, BRANCH, CORNER, VLINE } from "./figures.ts";
|
|
8
|
-
|
|
9
|
-
// Title-case a sub-agent type for the header ("code-reviewer" → "Code-reviewer");
|
|
10
|
-
// the default read-only explorer (no type) is shown as "Explore", matching the
|
|
11
|
-
// stock agent's role.
|
|
12
|
-
function agentLabel(subagentType?: string): string {
|
|
13
|
-
if (!subagentType) return "Explore";
|
|
14
|
-
return subagentType.charAt(0).toUpperCase() + subagentType.slice(1);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function statusWord(s: ToolEntry["status"]): string {
|
|
18
|
-
return s === "running" ? "Running…" : s === "error" ? "Failed" : "Done";
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// The grouped "N agents finished" block for a run of concurrent `task` sub-agents,
|
|
22
|
-
// modeled on Claude Code's fan-out view: a header summarizing the batch, then one
|
|
23
|
-
// tree row per agent with its description, tool-use + token counts, and status.
|
|
24
|
-
// Collapsed (the default) shows just status; Ctrl+O expands each agent's full output.
|
|
25
|
-
export function AgentGroupView({
|
|
26
|
-
agents,
|
|
27
|
-
collapsed,
|
|
28
|
-
}: {
|
|
29
|
-
agents: ToolEntry[];
|
|
30
|
-
collapsed?: boolean;
|
|
31
|
-
}) {
|
|
32
|
-
const running = agents.some((a) => a.status === "running");
|
|
33
|
-
const errored = agents.some((a) => a.status === "error");
|
|
34
|
-
// A single shared label when every agent is the same type, else a bare "agents".
|
|
35
|
-
const types = new Set(agents.map((a) => a.agent?.subagentType ?? ""));
|
|
36
|
-
const label = types.size === 1 ? `${agentLabel([...types][0] || undefined)} ` : "";
|
|
37
|
-
const verb = running ? "running" : errored ? "finished (with errors)" : "finished";
|
|
38
|
-
const headColor = running ? theme.accent : errored ? theme.error : theme.success;
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<Box flexDirection="column" marginTop={1}>
|
|
42
|
-
<Box gap={1}>
|
|
43
|
-
{running ? (
|
|
44
|
-
<Text color={theme.accent}>
|
|
45
|
-
<Spinner type="dots" />
|
|
46
|
-
</Text>
|
|
47
|
-
) : (
|
|
48
|
-
<Text color={headColor}>{BULLET}</Text>
|
|
49
|
-
)}
|
|
50
|
-
<Text>
|
|
51
|
-
<Text bold>
|
|
52
|
-
{agents.length} {label}agent{agents.length === 1 ? "" : "s"} {verb}
|
|
53
|
-
</Text>
|
|
54
|
-
{collapsed && !running && <Text color={theme.dim}> (ctrl+o to expand)</Text>}
|
|
55
|
-
</Text>
|
|
56
|
-
</Box>
|
|
57
|
-
|
|
58
|
-
<Box flexDirection="column" marginLeft={2}>
|
|
59
|
-
{agents.map((a, i) => {
|
|
60
|
-
const last = i === agents.length - 1;
|
|
61
|
-
const m = a.agent;
|
|
62
|
-
const metrics =
|
|
63
|
-
a.status !== "running" && m && (m.toolUses != null || m.tokens != null)
|
|
64
|
-
? ` · ${m.toolUses ?? 0} tool uses · ${formatTokens(m.tokens ?? 0)} tokens`
|
|
65
|
-
: "";
|
|
66
|
-
const trunk = last ? " " : VLINE;
|
|
67
|
-
const body = a.status === "error" ? a.error ?? "" : a.output ?? "";
|
|
68
|
-
const outLines = body.trim() === "" ? [] : body.replace(/\n+$/, "").split("\n");
|
|
69
|
-
return (
|
|
70
|
-
<Box key={a.id} flexDirection="column">
|
|
71
|
-
<Text>
|
|
72
|
-
<Text color={theme.dim}>{last ? CORNER : BRANCH} </Text>
|
|
73
|
-
<Text bold>{m?.description ?? "agent"}</Text>
|
|
74
|
-
<Text color={theme.dim}>{metrics}</Text>
|
|
75
|
-
</Text>
|
|
76
|
-
<Text>
|
|
77
|
-
<Text color={theme.dim}>
|
|
78
|
-
{trunk} {CORNER}{" "}
|
|
79
|
-
</Text>
|
|
80
|
-
{a.status === "running" ? (
|
|
81
|
-
<Text color={theme.accent}>
|
|
82
|
-
<Spinner type="dots" /> {statusWord(a.status)}
|
|
83
|
-
</Text>
|
|
84
|
-
) : (
|
|
85
|
-
<Text color={a.status === "error" ? theme.error : theme.dim} dimColor={a.status !== "error"}>
|
|
86
|
-
{statusWord(a.status)}
|
|
87
|
-
</Text>
|
|
88
|
-
)}
|
|
89
|
-
</Text>
|
|
90
|
-
{!collapsed &&
|
|
91
|
-
outLines.map((l, j) => (
|
|
92
|
-
<Text key={j} color={theme.dim} dimColor>
|
|
93
|
-
{trunk}
|
|
94
|
-
{" "}
|
|
95
|
-
{l}
|
|
96
|
-
</Text>
|
|
97
|
-
))}
|
|
98
|
-
</Box>
|
|
99
|
-
);
|
|
100
|
-
})}
|
|
101
|
-
</Box>
|
|
102
|
-
</Box>
|
|
103
|
-
);
|
|
104
|
-
}
|