bom-pi 0.0.0-stage → 0.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/README.md +33 -2
- package/apps/README.md +7 -0
- package/apps/web/README.md +21 -0
- package/apps/web/pocket-adapter.mjs +323 -0
- package/apps/web/public/LICENSE.pocket +21 -0
- package/apps/web/public/activity-fold.js +28 -0
- package/apps/web/public/agent-now.js +37 -0
- package/apps/web/public/agent-tile.js +79 -0
- package/apps/web/public/app.js +975 -0
- package/apps/web/public/apple-touch-icon.png +0 -0
- package/apps/web/public/artifact-bridge.js +687 -0
- package/apps/web/public/avatar.js +87 -0
- package/apps/web/public/back.js +554 -0
- package/apps/web/public/box-keys.js +216 -0
- package/apps/web/public/browser-panel.js +1097 -0
- package/apps/web/public/browser.js +68 -0
- package/apps/web/public/calls.js +139 -0
- package/apps/web/public/chat.js +919 -0
- package/apps/web/public/clock.js +34 -0
- package/apps/web/public/commands.js +578 -0
- package/apps/web/public/composer.js +2068 -0
- package/apps/web/public/diff-parse.js +672 -0
- package/apps/web/public/diff.js +1646 -0
- package/apps/web/public/dock.js +299 -0
- package/apps/web/public/extension-ui.js +2734 -0
- package/apps/web/public/files-panel.js +775 -0
- package/apps/web/public/files.js +368 -0
- package/apps/web/public/fonts/FiraCode-VF.woff2 +0 -0
- package/apps/web/public/fonts/Geist.woff2 +0 -0
- package/apps/web/public/fonts/IBMPlexMono-Variable-Italic.woff2 +0 -0
- package/apps/web/public/fonts/IBMPlexMono-Variable.woff2 +0 -0
- package/apps/web/public/fonts/InterVariable-Italic.woff2 +0 -0
- package/apps/web/public/fonts/InterVariable.woff2 +0 -0
- package/apps/web/public/fonts/Iosevka-Bold.woff2 +0 -0
- package/apps/web/public/fonts/Iosevka-BoldItalic.woff2 +0 -0
- package/apps/web/public/fonts/Iosevka-Italic.woff2 +0 -0
- package/apps/web/public/fonts/Iosevka-Regular.woff2 +0 -0
- package/apps/web/public/fonts/Iosevka-SemiBold.woff2 +0 -0
- package/apps/web/public/fonts/Iosevka-SemiBoldItalic.woff2 +0 -0
- package/apps/web/public/fonts/JetBrainsMono-Italic.woff2 +0 -0
- package/apps/web/public/fonts/JetBrainsMono.woff2 +0 -0
- package/apps/web/public/fonts/NerdFontsSymbolsMono.woff2 +0 -0
- package/apps/web/public/fonts/SOURCES.md +69 -0
- package/apps/web/public/gestures.js +610 -0
- package/apps/web/public/highlight.js +480 -0
- package/apps/web/public/history.js +70 -0
- package/apps/web/public/home.js +169 -0
- package/apps/web/public/icon-192.png +0 -0
- package/apps/web/public/icon-512.png +0 -0
- package/apps/web/public/icon-maskable-512.png +0 -0
- package/apps/web/public/icon.svg +16 -0
- package/apps/web/public/index.html +71 -0
- package/apps/web/public/launcher.js +1293 -0
- package/apps/web/public/linked-sessions.js +55 -0
- package/apps/web/public/live.js +39 -0
- package/apps/web/public/manifest.webmanifest +32 -0
- package/apps/web/public/model-refresh.js +73 -0
- package/apps/web/public/notify.js +251 -0
- package/apps/web/public/peeks.js +920 -0
- package/apps/web/public/pip-attachments.js +182 -0
- package/apps/web/public/pip-window.js +141 -0
- package/apps/web/public/pip.js +1217 -0
- package/apps/web/public/quote-reply.js +109 -0
- package/apps/web/public/quote-text.js +31 -0
- package/apps/web/public/rich.js +403 -0
- package/apps/web/public/run-frame.js +106 -0
- package/apps/web/public/safe-mode.js +71 -0
- package/apps/web/public/seen.js +169 -0
- package/apps/web/public/session-tree.js +117 -0
- package/apps/web/public/sessions.js +2695 -0
- package/apps/web/public/share.js +126 -0
- package/apps/web/public/sheets/appearance.js +820 -0
- package/apps/web/public/sheets/branch.js +353 -0
- package/apps/web/public/sheets/extensions.js +818 -0
- package/apps/web/public/sheets/file.js +318 -0
- package/apps/web/public/sheets/find.js +250 -0
- package/apps/web/public/sheets/folder.js +680 -0
- package/apps/web/public/sheets/gallery.js +2340 -0
- package/apps/web/public/sheets/hooks.js +350 -0
- package/apps/web/public/sheets/memory.js +531 -0
- package/apps/web/public/sheets/menu.js +580 -0
- package/apps/web/public/sheets/message.js +220 -0
- package/apps/web/public/sheets/model.js +412 -0
- package/apps/web/public/sheets/people.js +414 -0
- package/apps/web/public/sheets/pi-sessions.js +264 -0
- package/apps/web/public/sheets/providers.js +525 -0
- package/apps/web/public/sheets/running.js +130 -0
- package/apps/web/public/sheets/schedules.js +71 -0
- package/apps/web/public/sheets/session.js +249 -0
- package/apps/web/public/sheets/shortcuts.js +101 -0
- package/apps/web/public/sheets/spend.js +150 -0
- package/apps/web/public/sheets/text.js +53 -0
- package/apps/web/public/sheets/viewers.js +363 -0
- package/apps/web/public/sheets/worktree.js +50 -0
- package/apps/web/public/sheets.js +410 -0
- package/apps/web/public/signin.js +57 -0
- package/apps/web/public/slots.js +208 -0
- package/apps/web/public/store.js +1760 -0
- package/apps/web/public/style.css +18625 -0
- package/apps/web/public/subagents-board.js +879 -0
- package/apps/web/public/subagents.js +273 -0
- package/apps/web/public/sw.js +169 -0
- package/apps/web/public/taps.js +26 -0
- package/apps/web/public/theme-surface.d.ts +4 -0
- package/apps/web/public/theme-surface.js +266 -0
- package/apps/web/public/theme.js +845 -0
- package/apps/web/public/themes/lantern/colors.toml +25 -0
- package/apps/web/public/themes/lantern/direction.css +60 -0
- package/apps/web/public/themes/lantern/frame.css +254 -0
- package/apps/web/public/themes/lantern/theme.css +10 -0
- package/apps/web/public/themes/lantern/theme.json +7 -0
- package/apps/web/public/themes/pocket/theme.css +189 -0
- package/apps/web/public/themes/pocket/theme.json +6 -0
- package/apps/web/public/themes.js +556 -0
- package/apps/web/public/transcript.js +3348 -0
- package/apps/web/public/trust.js +295 -0
- package/apps/web/public/turns.js +507 -0
- package/apps/web/public/ui.js +1910 -0
- package/apps/web/public/voice.js +345 -0
- package/apps/web/server.mjs +774 -0
- package/package.json +43 -4
- package/packages/cli/src/bom-pi.mjs +452 -0
- package/packages/cli/templates/blank.factory.json +7 -0
- package/packages/cli/templates/dev.factory.json +11 -0
- package/packages/cli/templates/docs.factory.json +12 -0
- package/packages/cli/templates/ops.factory.json +14 -0
- package/packages/cli/templates/triage.factory.json +10 -0
- package/packages/core/src/daemon.mjs +2047 -0
- package/packages/core/src/limit-gate.mjs +192 -0
- package/packages/core/src/rpc-client.mjs +66 -0
- package/systemd/README.md +11 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// The Browser panel's state, for everything that opens it: whether it is open, and opening an address in it. The
|
|
2
|
+
// panel itself is browser-panel.js.
|
|
3
|
+
|
|
4
|
+
import { api, attempt, closePeople, EXT_PANEL_KEY, notify, store } from "./store.js";
|
|
5
|
+
|
|
6
|
+
const OPEN_KEY = "pocket.browser";
|
|
7
|
+
|
|
8
|
+
/** The browser is on while its extension is: the owner turns it off in Extensions. */
|
|
9
|
+
export const browserAvailable = () =>
|
|
10
|
+
store.state.server?.extensions?.includes("pocket-browser") === true;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Show or hide the panel. Kept per tab, so a reload after a live edit keeps it open. It takes the People panel's and
|
|
14
|
+
* the Files tile's place.
|
|
15
|
+
*/
|
|
16
|
+
export function setBrowserOpen(open) {
|
|
17
|
+
if (open) {
|
|
18
|
+
sessionStorage.setItem(OPEN_KEY, "1");
|
|
19
|
+
sessionStorage.removeItem("pocket.files");
|
|
20
|
+
sessionStorage.removeItem(EXT_PANEL_KEY);
|
|
21
|
+
closePeople();
|
|
22
|
+
} else {
|
|
23
|
+
sessionStorage.removeItem(OPEN_KEY);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// One panel beside the conversation at a time: the browser takes the Files tile's and an extension's place too.
|
|
27
|
+
store.set({
|
|
28
|
+
browserOpen: open,
|
|
29
|
+
drawer: false,
|
|
30
|
+
...(open ? { filesOpen: false, extPanel: null } : {}),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const toggleBrowser = () => setBrowserOpen(!store.state.browserOpen);
|
|
35
|
+
|
|
36
|
+
export const browserApi = (action, body) =>
|
|
37
|
+
api(`c/${store.state.conversationId}/browser/${action}`, body);
|
|
38
|
+
|
|
39
|
+
/** Open the panel, and an address in it. */
|
|
40
|
+
export function openInBrowser(url) {
|
|
41
|
+
setBrowserOpen(true);
|
|
42
|
+
|
|
43
|
+
if (url) {
|
|
44
|
+
return attempt(() => browserApi("navigate", { url }).then(reportNavigation));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function reportNavigation(result) {
|
|
51
|
+
if (result?.error) {
|
|
52
|
+
notify(
|
|
53
|
+
"error",
|
|
54
|
+
/CONNECTION_REFUSED/.test(result.error)
|
|
55
|
+
? `Nothing answers at that address (${result.error}). Is the server running?`
|
|
56
|
+
: `Could not open it: ${result.error}`,
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** The address as the address bar shows it: without http:// and a lone trailing slash. */
|
|
62
|
+
export function displayUrl(url) {
|
|
63
|
+
if (!url || url === "about:blank") {
|
|
64
|
+
return "";
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return url.replace(/^https?:\/\//, "").replace(/^([^/?#]+)\/$/, "$1");
|
|
68
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// A tool call in one line, as transcripts and peek tiles show it.
|
|
2
|
+
|
|
3
|
+
const short = (text, max = 90) => {
|
|
4
|
+
const flat = String(text ?? "")
|
|
5
|
+
.replace(/\s+/g, " ")
|
|
6
|
+
.trim();
|
|
7
|
+
|
|
8
|
+
return flat.length > max ? `${flat.slice(0, max - 1)}…` : flat;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* How extensions' browser modules show their own tools' calls (`pocket.toolCall`): `extension-ui.js` sets it, and it
|
|
13
|
+
* gives `{ label, subject, iconPath? }` in text, or undefined for the default display.
|
|
14
|
+
*/
|
|
15
|
+
let ownDescription = () => undefined;
|
|
16
|
+
/** Goes up when what extensions describe changes, so that calls drawn before draw again. */
|
|
17
|
+
let ownRevision = 0;
|
|
18
|
+
|
|
19
|
+
export function setCallDescriber(describe) {
|
|
20
|
+
ownDescription = describe;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function describersChanged() {
|
|
24
|
+
ownRevision++;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const describersRevision = () => ownRevision;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* A tool call in one line: an icon, a label, and what it acts on. Peek tiles describe calls this way too. `own` marks a
|
|
31
|
+
* call an extension described.
|
|
32
|
+
*/
|
|
33
|
+
export function describeCall(call) {
|
|
34
|
+
const args = call.args ?? {};
|
|
35
|
+
|
|
36
|
+
switch (call.name) {
|
|
37
|
+
case "read": {
|
|
38
|
+
const range = args.offset ? `:${args.offset}${args.limit ? `+${args.limit}` : ""}` : "";
|
|
39
|
+
|
|
40
|
+
return { icon: "▤", label: "Read", subject: `${args.path ?? ""}${range}`, mono: true };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
case "write":
|
|
44
|
+
return { icon: "✎", label: "Write", subject: args.path ?? "", mono: true };
|
|
45
|
+
case "edit":
|
|
46
|
+
return { icon: "✎", label: "Edit", subject: args.path ?? "", mono: true };
|
|
47
|
+
case "bash":
|
|
48
|
+
return { icon: ">_", label: "", subject: short(args.command, 140), mono: true };
|
|
49
|
+
case "artifact":
|
|
50
|
+
case "artifact_inline":
|
|
51
|
+
return {
|
|
52
|
+
icon: "✦",
|
|
53
|
+
label: "Artifact",
|
|
54
|
+
subject: args.title ?? args.id ?? "",
|
|
55
|
+
mono: false,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
case "codemode": {
|
|
59
|
+
// The first line that does something: not the options line, a comment, or blank.
|
|
60
|
+
const line = String(args.code ?? "")
|
|
61
|
+
.split("\n")
|
|
62
|
+
.map((each) => each.trim())
|
|
63
|
+
.find((each) => each !== "" && !each.startsWith("//"));
|
|
64
|
+
|
|
65
|
+
return { icon: "{}", label: "Codemode", subject: short(line ?? "", 140), mono: true };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
case "browser": {
|
|
69
|
+
const firstLine = String(args.script ?? "")
|
|
70
|
+
.split("\n")
|
|
71
|
+
.find((each) => each.trim() !== "");
|
|
72
|
+
const what =
|
|
73
|
+
args.url ??
|
|
74
|
+
(args.ref ? `[${String(args.ref).replace(/^\[|\]$/g, "")}]` : undefined) ??
|
|
75
|
+
args.selector ??
|
|
76
|
+
(args.label ? `“${args.label}”` : undefined) ??
|
|
77
|
+
args.key ??
|
|
78
|
+
args.viewport ??
|
|
79
|
+
firstLine ??
|
|
80
|
+
(args.text !== undefined ? `“${args.text}”` : "");
|
|
81
|
+
const typed =
|
|
82
|
+
args.action === "type" && args.text !== undefined && what !== `“${args.text}”`
|
|
83
|
+
? ` ← “${args.text}”`
|
|
84
|
+
: "";
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
icon: "◎",
|
|
88
|
+
label: `Browser ${args.action ?? ""}`,
|
|
89
|
+
subject: short(`${what}${typed}`, 120),
|
|
90
|
+
mono: true,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
case "ask": {
|
|
95
|
+
const questions = Array.isArray(args.questions) ? args.questions : [];
|
|
96
|
+
|
|
97
|
+
return {
|
|
98
|
+
icon: "?",
|
|
99
|
+
label: "Ask",
|
|
100
|
+
// A peek line's call carries only short scalar arguments (`peekArgs`): no questions, no subject.
|
|
101
|
+
subject:
|
|
102
|
+
questions.length === 0
|
|
103
|
+
? ""
|
|
104
|
+
: questions.length === 1
|
|
105
|
+
? short(String(questions[0]?.question ?? ""), 120)
|
|
106
|
+
: questions
|
|
107
|
+
.map((each) => each?.header)
|
|
108
|
+
.filter(Boolean)
|
|
109
|
+
.join(" · "),
|
|
110
|
+
mono: false,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
case "subagent":
|
|
115
|
+
return {
|
|
116
|
+
icon: "⧉",
|
|
117
|
+
label: `Subagent ${args.action ?? ""}`,
|
|
118
|
+
subject: [args.name, args.message && short(args.message, 60)]
|
|
119
|
+
.filter(Boolean)
|
|
120
|
+
.join(" · "),
|
|
121
|
+
mono: true,
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
default: {
|
|
125
|
+
const own = ownDescription(call.name, args);
|
|
126
|
+
|
|
127
|
+
if (own !== undefined) {
|
|
128
|
+
return { icon: "⚙", mono: false, own: true, ...own };
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return {
|
|
132
|
+
icon: "⚙",
|
|
133
|
+
label: call.name,
|
|
134
|
+
subject: short(JSON.stringify(args), 100),
|
|
135
|
+
mono: true,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|