@aui.io/apollo 0.1.7 → 0.1.10
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/node_modules/@aui.io/apollo-cli/bin/apollo.js +8 -5
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/operate.js +3 -10
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/operate.js.map +1 -1
- package/node_modules/@aui.io/apollo-cli/package.json +3 -3
- package/node_modules/@aui.io/apollo-core/dist/src/api/runtime-api.d.ts +13 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/runtime-api.js +17 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/runtime-api.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/hierarchy.js +7 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/hierarchy.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/messaging.d.ts +17 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/messaging.js +27 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/messaging.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/package.json +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/actions/ActionPalette.d.ts +13 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/actions/ActionPalette.js +47 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/actions/ActionPalette.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/actions/registry.d.ts +28 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/actions/registry.js +219 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/actions/registry.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/activity/ActivityDrawer.d.ts +8 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/activity/ActivityDrawer.js +43 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/activity/ActivityDrawer.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/activity/ActivitySummary.d.ts +5 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/activity/ActivitySummary.js +26 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/activity/ActivitySummary.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/activity/operationStore.d.ts +67 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/activity/operationStore.js +138 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/activity/operationStore.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/AuthorHome.d.ts +27 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/AuthorHome.js +92 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/AuthorHome.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/DiffView.d.ts +46 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/DiffView.js +87 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/DiffView.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/SessionPane.d.ts +15 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/SessionPane.js +38 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/SessionPane.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/ValidationView.d.ts +11 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/ValidationView.js +34 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/ValidationView.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/VersionsView.d.ts +9 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/VersionsView.js +31 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/VersionsView.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/backend/claudeCode.d.ts +23 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/backend/claudeCode.js +293 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/backend/claudeCode.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/backend/index.d.ts +4 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/backend/index.js +13 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/backend/index.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/backend/sessions.d.ts +3 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/backend/sessions.js +36 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/backend/sessions.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/backend/types.d.ts +85 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/backend/types.js +11 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/backend/types.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/data.d.ts +78 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/data.js +279 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/data.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/session.d.ts +64 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/session.js +319 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/session.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/tree.d.ts +25 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/tree.js +69 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/tree.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/context/ContextSwitcher.d.ts +23 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/context/ContextSwitcher.js +60 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/context/ContextSwitcher.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/index.d.ts +19 -2
- package/node_modules/@aui.io/apollo-tui/dist/src/index.js +24 -2
- package/node_modules/@aui.io/apollo-tui/dist/src/index.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/keyprobe.d.ts +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/keyprobe.js +51 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/keyprobe.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/actions.d.ts +56 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/actions.js +1019 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/actions.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/clipboard.d.ts +7 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/clipboard.js +33 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/clipboard.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.d.ts +10 -4
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.js +444 -23
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/confirm.d.ts +10 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/confirm.js +12 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/confirm.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/ide.d.ts +16 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/ide.js +39 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/ide.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/keydiag.d.ts +17 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/keydiag.js +76 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/keydiag.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/keys.d.ts +64 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/keys.js +105 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/keys.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/modes.d.ts +18 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/modes.js +24 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/modes.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/picker.d.ts +28 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/picker.js +72 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/picker.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/place.d.ts +26 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/place.js +32 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/place.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/scope.d.ts +29 -6
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/scope.js +112 -13
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/scope.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/sheet.d.ts +5 -10
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/sheet.js +2 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/sheet.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/opentui-app.js +2106 -273
- package/node_modules/@aui.io/apollo-tui/dist/src/opentui-app.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/shell/Breadcrumb.d.ts +15 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/shell/Breadcrumb.js +22 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/shell/Breadcrumb.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/shell/FooterHints.d.ts +8 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/shell/FooterHints.js +23 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/shell/FooterHints.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/shell/ModeNav.d.ts +4 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/shell/ModeNav.js +7 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/shell/ModeNav.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/talk/Composer.d.ts +20 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/talk/Composer.js +29 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/talk/Composer.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/talk/InspectorPane.d.ts +15 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/talk/InspectorPane.js +27 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/talk/InspectorPane.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/talk/TalkView.d.ts +30 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/talk/TalkView.js +60 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/talk/TalkView.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/talk/ThreadsPane.d.ts +17 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/talk/ThreadsPane.js +61 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/talk/ThreadsPane.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/talk/data.d.ts +107 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/talk/data.js +235 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/talk/data.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/theme/tokens.d.ts +8 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/theme/tokens.js +9 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/theme/tokens.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/ui/ConfirmPane.d.ts +4 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/ui/ConfirmPane.js +15 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/ui/ConfirmPane.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/ui/OutputPane.d.ts +5 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/ui/OutputPane.js +16 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/ui/OutputPane.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/ui/PickerPane.d.ts +10 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/ui/PickerPane.js +29 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/ui/PickerPane.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/ui/SheetPane.d.ts +4 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/ui/SheetPane.js +22 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/ui/SheetPane.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/package.json +2 -2
- package/package.json +4 -4
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/tabs.d.ts +0 -10
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/tabs.js +0 -19
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/tabs.js.map +0 -1
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { SLASH_COMMANDS } from "../lib/commands.js";
|
|
2
|
+
const GROUP_BY_COMMAND_GROUP = {
|
|
3
|
+
session: "Session",
|
|
4
|
+
account: "Context",
|
|
5
|
+
place: "Context",
|
|
6
|
+
target: "Context",
|
|
7
|
+
bundle: "Author",
|
|
8
|
+
chat: "Talk",
|
|
9
|
+
mockdb: "Advanced",
|
|
10
|
+
nav: undefined, // navigation is navigation — not an action
|
|
11
|
+
};
|
|
12
|
+
const EXTRA_ALIASES = {
|
|
13
|
+
validate: ["check", "lint", "verify"],
|
|
14
|
+
diff: ["changes", "review", "files", "browse"],
|
|
15
|
+
push: ["publish", "upload", "ship"],
|
|
16
|
+
pull: ["fetch", "sync"],
|
|
17
|
+
workspace: ["place", "cd"],
|
|
18
|
+
"workspace-create": ["new-workspace"],
|
|
19
|
+
agent: ["target", "select-agent"],
|
|
20
|
+
"agent-import": ["import"],
|
|
21
|
+
"agent-create": ["create-agent"],
|
|
22
|
+
env: ["environment", "staging", "production"],
|
|
23
|
+
login: ["auth", "signin"],
|
|
24
|
+
logout: ["signout"],
|
|
25
|
+
thread: ["conversation", "threads"],
|
|
26
|
+
new: ["new-thread", "clear"],
|
|
27
|
+
"turn-trace": ["trace-turn", "inspect"],
|
|
28
|
+
"turn-debug": ["debug-turn", "inspect-debug"],
|
|
29
|
+
local: ["local-bundle", "bundle-mode"],
|
|
30
|
+
target: ["talk-target", "version-target", "run-against"],
|
|
31
|
+
versions: ["history"],
|
|
32
|
+
status: ["scope", "info"],
|
|
33
|
+
ide: ["open", "editor"],
|
|
34
|
+
"diff-style": ["split", "unified", "layout", "sidebar"],
|
|
35
|
+
activity: ["operations", "jobs", "drawer", "log"],
|
|
36
|
+
};
|
|
37
|
+
const KEYWORDS = {
|
|
38
|
+
validate: ["program", "schema", "local"],
|
|
39
|
+
push: ["bundle", "commit", "deploy"],
|
|
40
|
+
pull: ["bundle", "version", "remote"],
|
|
41
|
+
diff: ["baseline", "remote", "files"],
|
|
42
|
+
provision: ["mock", "database"],
|
|
43
|
+
ide: ["cursor", "vscode", "zed", "window", "checkout"],
|
|
44
|
+
"diff-style": ["diff", "view", "preview", "toggle", "side-by-side"],
|
|
45
|
+
activity: ["push", "pull", "progress", "output", "retry", "history"],
|
|
46
|
+
"turn-trace": ["trace", "reply", "inspector", "diagnostics"],
|
|
47
|
+
"turn-debug": ["debug", "reply", "inspector", "interaction"],
|
|
48
|
+
local: ["checkout", "unpushed", "inline", "toggle"],
|
|
49
|
+
target: ["version", "tag", "live", "local", "bundle", "pin"],
|
|
50
|
+
};
|
|
51
|
+
/** Actions needing an active agent binding to make sense. */
|
|
52
|
+
const NEEDS_AGENT = new Set([
|
|
53
|
+
"push",
|
|
54
|
+
"pull",
|
|
55
|
+
"validate",
|
|
56
|
+
"versions",
|
|
57
|
+
"version-publish",
|
|
58
|
+
"version-archive",
|
|
59
|
+
"thread",
|
|
60
|
+
"new",
|
|
61
|
+
"turn-trace",
|
|
62
|
+
"turn-debug",
|
|
63
|
+
"target",
|
|
64
|
+
]);
|
|
65
|
+
function cliEquivalentFor(name) {
|
|
66
|
+
if (name.startsWith("mdb-"))
|
|
67
|
+
return `apollo mockdb ${name.slice(4).replaceAll("-", " ")}`;
|
|
68
|
+
if (name === "workspace-create")
|
|
69
|
+
return "apollo workspace create";
|
|
70
|
+
if (name === "project-create")
|
|
71
|
+
return "apollo project create";
|
|
72
|
+
if (name === "agent-import")
|
|
73
|
+
return "apollo agent import";
|
|
74
|
+
if (name === "agent-create")
|
|
75
|
+
return "apollo agent create";
|
|
76
|
+
if (name === "agent-unlink")
|
|
77
|
+
return "apollo agent unlink";
|
|
78
|
+
if (name === "version-publish")
|
|
79
|
+
return "apollo version publish";
|
|
80
|
+
if (name === "version-archive")
|
|
81
|
+
return "apollo version archive";
|
|
82
|
+
if (name === "schema-pull")
|
|
83
|
+
return "apollo schema pull";
|
|
84
|
+
if (name === "quit" || name === "help")
|
|
85
|
+
return undefined;
|
|
86
|
+
// TUI-only surfaces — no CLI equivalent to teach.
|
|
87
|
+
if (name === "ide" ||
|
|
88
|
+
name === "diff-style" ||
|
|
89
|
+
name === "activity" ||
|
|
90
|
+
name === "turn-trace" ||
|
|
91
|
+
name === "turn-debug" ||
|
|
92
|
+
name === "target") {
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
if (name === "env" || name === "profile" || name === "workspace") {
|
|
96
|
+
return `apollo ${name} use`;
|
|
97
|
+
}
|
|
98
|
+
if (name === "org" || name === "project" || name === "agent") {
|
|
99
|
+
return `apollo ${name} use`;
|
|
100
|
+
}
|
|
101
|
+
return `apollo ${name}`;
|
|
102
|
+
}
|
|
103
|
+
function disabledReasonFor(command) {
|
|
104
|
+
return (context) => {
|
|
105
|
+
if (command.requiresAuth && !context.token)
|
|
106
|
+
return "Log in first";
|
|
107
|
+
if (NEEDS_AGENT.has(command.name) && !context.agentId && !context.agentRoot) {
|
|
108
|
+
return "Select an agent first";
|
|
109
|
+
}
|
|
110
|
+
if ((command.name === "agent-create" || command.name === "agent-import") &&
|
|
111
|
+
!context.workspaceRoot) {
|
|
112
|
+
return "Enter a workspace first";
|
|
113
|
+
}
|
|
114
|
+
if ((command.name === "ide" || command.name === "diff") &&
|
|
115
|
+
!context.agentRoot &&
|
|
116
|
+
!context.bindingPath &&
|
|
117
|
+
!context.workspaceRoot) {
|
|
118
|
+
return "Enter a workspace or agent directory first";
|
|
119
|
+
}
|
|
120
|
+
// Local mode sends the checkout's bundle inline — no checkout, no bundle.
|
|
121
|
+
if (command.name === "local" && !context.agentRoot) {
|
|
122
|
+
return "Open an agent checkout first";
|
|
123
|
+
}
|
|
124
|
+
return undefined;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
export function buildActionRegistry() {
|
|
128
|
+
const actions = [];
|
|
129
|
+
for (const command of SLASH_COMMANDS) {
|
|
130
|
+
const group = GROUP_BY_COMMAND_GROUP[command.group];
|
|
131
|
+
if (!group)
|
|
132
|
+
continue;
|
|
133
|
+
const cli = cliEquivalentFor(command.name);
|
|
134
|
+
actions.push({
|
|
135
|
+
id: command.name,
|
|
136
|
+
title: command.summary,
|
|
137
|
+
group,
|
|
138
|
+
aliases: [command.name, ...(EXTRA_ALIASES[command.name] ?? [])],
|
|
139
|
+
keywords: KEYWORDS[command.name] ?? [],
|
|
140
|
+
...(cli ? { cliEquivalent: cli } : {}),
|
|
141
|
+
disabledReason: disabledReasonFor(command),
|
|
142
|
+
command,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return actions;
|
|
146
|
+
}
|
|
147
|
+
const GROUP_ORDER = ["Author", "Talk", "Context", "Session", "Advanced"];
|
|
148
|
+
function modeGroup(mode) {
|
|
149
|
+
return mode === "author" ? "Author" : "Talk";
|
|
150
|
+
}
|
|
151
|
+
function subsequence(haystack, needle) {
|
|
152
|
+
let i = 0;
|
|
153
|
+
for (const ch of haystack) {
|
|
154
|
+
if (ch === needle[i])
|
|
155
|
+
i += 1;
|
|
156
|
+
if (i >= needle.length)
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
export function scoreAction(action, query, mode) {
|
|
162
|
+
const q = query.trim().toLowerCase();
|
|
163
|
+
const boost = action.group === modeGroup(mode) ? 15 : 0;
|
|
164
|
+
if (!q)
|
|
165
|
+
return boost;
|
|
166
|
+
const id = action.id.toLowerCase();
|
|
167
|
+
const title = action.title.toLowerCase();
|
|
168
|
+
if (id === q || title === q)
|
|
169
|
+
return 100 + boost;
|
|
170
|
+
if (action.aliases.some((a) => a.toLowerCase() === q))
|
|
171
|
+
return 90 + boost;
|
|
172
|
+
if (id.startsWith(q))
|
|
173
|
+
return 80 + boost;
|
|
174
|
+
if (action.aliases.some((a) => a.toLowerCase().startsWith(q)))
|
|
175
|
+
return 70 + boost;
|
|
176
|
+
if (title.split(/\s+/).some((word) => word.startsWith(q)))
|
|
177
|
+
return 65 + boost;
|
|
178
|
+
if (id.includes(q) || title.includes(q))
|
|
179
|
+
return 50 + boost;
|
|
180
|
+
if (action.keywords.some((k) => k.includes(q)))
|
|
181
|
+
return 40 + boost;
|
|
182
|
+
if (action.cliEquivalent?.includes(q))
|
|
183
|
+
return 35 + boost;
|
|
184
|
+
if (q.length >= 3 && subsequence(id + " " + title, q))
|
|
185
|
+
return 20 + boost;
|
|
186
|
+
return -1;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Palette search: empty query lists everything grouped (active-mode group
|
|
190
|
+
* first); otherwise fuzzy-ranked matches.
|
|
191
|
+
*/
|
|
192
|
+
export function searchActions(registry, query, mode) {
|
|
193
|
+
const q = query.trim();
|
|
194
|
+
if (!q) {
|
|
195
|
+
const order = [
|
|
196
|
+
modeGroup(mode),
|
|
197
|
+
...GROUP_ORDER.filter((g) => g !== modeGroup(mode)),
|
|
198
|
+
];
|
|
199
|
+
return [...registry].sort((a, b) => {
|
|
200
|
+
const ga = order.indexOf(a.group);
|
|
201
|
+
const gb = order.indexOf(b.group);
|
|
202
|
+
if (ga !== gb)
|
|
203
|
+
return ga - gb;
|
|
204
|
+
return a.id.localeCompare(b.id);
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
return registry
|
|
208
|
+
.map((action) => ({ action, score: scoreAction(action, q, mode) }))
|
|
209
|
+
.filter((entry) => entry.score >= 0)
|
|
210
|
+
.sort((a, b) => b.score - a.score || a.action.id.localeCompare(b.action.id))
|
|
211
|
+
.map((entry) => entry.action);
|
|
212
|
+
}
|
|
213
|
+
/** Find by id or alias — keeps legacy `/name` input working. */
|
|
214
|
+
export function actionByAlias(registry, name) {
|
|
215
|
+
const wanted = name.toLowerCase();
|
|
216
|
+
return (registry.find((a) => a.id === wanted) ??
|
|
217
|
+
registry.find((a) => a.aliases.some((alias) => alias.toLowerCase() === wanted)));
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/actions/registry.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAqB,MAAM,oBAAoB,CAAC;AAiBvE,MAAM,sBAAsB,GAA2D;IACrF,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,UAAU;IAClB,GAAG,EAAE,SAAS,EAAE,2CAA2C;CAC5D,CAAC;AAEF,MAAM,aAAa,GAA6B;IAC9C,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC;IACrC,IAAI,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC;IAC9C,IAAI,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC;IACnC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC;IAC1B,kBAAkB,EAAE,CAAC,eAAe,CAAC;IACrC,K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AAM,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAClC,OAAO,CACL,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC;QACrC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,CAAC,CAChF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type OperationRecord } from "./operationStore.js";
|
|
2
|
+
export declare function ActivityDrawerPane({ operations, cursor, pageSize, now, }: {
|
|
3
|
+
/** Already ordered: running first, newest first. */
|
|
4
|
+
operations: OperationRecord[];
|
|
5
|
+
cursor: number;
|
|
6
|
+
pageSize: number;
|
|
7
|
+
now: number;
|
|
8
|
+
}): import("react").ReactNode;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@opentui/react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Activity drawer (TUI_DESIGN §13.2) — Ctrl+J overlay listing operations:
|
|
4
|
+
* running with elapsed time, finished with outcome and age. The highlighted
|
|
5
|
+
* row shows its last raw output lines; `r`/Enter retries failed operations,
|
|
6
|
+
* `c` copies the raw output.
|
|
7
|
+
*/
|
|
8
|
+
import { relativeTime } from "../author/data.js";
|
|
9
|
+
import { OPERATION_GLYPH, formatElapsed, } from "./operationStore.js";
|
|
10
|
+
import { AMBER, DIM, FAINT, FG, RED, TEAL, TEAL_DIM } from "../theme/tokens.js";
|
|
11
|
+
const STATUS_COLOR = {
|
|
12
|
+
running: AMBER,
|
|
13
|
+
succeeded: TEAL,
|
|
14
|
+
failed: RED,
|
|
15
|
+
};
|
|
16
|
+
const OUTPUT_PREVIEW_LINES = 4;
|
|
17
|
+
export function ActivityDrawerPane({ operations, cursor, pageSize, now, }) {
|
|
18
|
+
const start = operations.length <= pageSize
|
|
19
|
+
? 0
|
|
20
|
+
: Math.max(0, Math.min(cursor - Math.floor(pageSize / 3), operations.length - pageSize));
|
|
21
|
+
const window = operations.slice(start, start + pageSize);
|
|
22
|
+
const highlighted = operations[cursor];
|
|
23
|
+
return (_jsx("box", { title: " activity ", style: {
|
|
24
|
+
border: true,
|
|
25
|
+
borderStyle: "rounded",
|
|
26
|
+
borderColor: TEAL_DIM,
|
|
27
|
+
flexDirection: "column",
|
|
28
|
+
flexGrow: 1,
|
|
29
|
+
width: "100%",
|
|
30
|
+
paddingLeft: 1,
|
|
31
|
+
paddingRight: 1,
|
|
32
|
+
}, children: operations.length === 0 ? (_jsx("text", { fg: DIM, children: "No operations yet \u2014 push, pull, and validate land here." })) : (_jsxs(_Fragment, { children: [start > 0 ? _jsxs("text", { fg: FAINT, children: ["\u2026 ", start, " above"] }) : null, window.map((op, i) => {
|
|
33
|
+
const index = start + i;
|
|
34
|
+
const active = index === cursor;
|
|
35
|
+
const time = op.status === "running"
|
|
36
|
+
? formatElapsed(now - op.startedAt)
|
|
37
|
+
: relativeTime(op.endedAt ?? op.startedAt);
|
|
38
|
+
return (_jsxs("text", { fg: active ? FG : DIM, children: [active ? "❯ " : " ", _jsx("span", { fg: STATUS_COLOR[op.status], children: OPERATION_GLYPH[op.status] }), " ", op.title.padEnd(28), _jsxs("span", { fg: active ? DIM : FAINT, children: [op.status === "running" ? "running" : op.status, " \u00B7 ", time] })] }, op.id));
|
|
39
|
+
}), start + window.length < operations.length ? (_jsxs("text", { fg: FAINT, children: ["\u2026 ", operations.length - start - window.length, " below"] })) : null, highlighted ? (_jsxs("box", { style: { flexDirection: "column", marginTop: 1 }, children: [highlighted.detail ? (_jsx("text", { fg: STATUS_COLOR[highlighted.status], children: highlighted.detail })) : null, highlighted.output.slice(-OUTPUT_PREVIEW_LINES).map((line, i) => (_jsx("text", { fg: FAINT, children: line || " " }, i))), _jsxs("text", { fg: FAINT, children: [highlighted.status === "failed" && highlighted.retry
|
|
40
|
+
? "r/Enter retry · "
|
|
41
|
+
: "", "c copy output \u00B7 Esc close"] })] })) : null] })) }));
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=ActivityDrawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActivityDrawer.js","sourceRoot":"","sources":["../../../src/activity/ActivityDrawer.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EACL,eAAe,EACf,aAAa,GAEd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEhF,MAAM,YAAY,GAA8C;IAC9D,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,GAAG;CACZ,CAAC;AAEF,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAE/B,MAAM,UAAU,kBAAkB,CAAC,EACjC,UAAU,EACV,MAAM,EACN,QAAQ,EACR,GAAG,GAOJ;IACC,MAAM,KAAK,GACT,UAAU,CAAC,MAAM,IAAI,QAAQ;QAC3B,CAAC,CAAC,CAAC;QACH,CAAC,CAAC,IAAI,CAAC,GAAG,CACN,CAAC,EACD,IAAI,CAAC,GAAG,CACN,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,EACjC,UAAU,CAAC,MAAM,GAAG,QAAQ,CAC7B,CACF,CAAC;IACR,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,QAAQ,CAAC,CAAC;IACzD,MAAM,WAAW,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IAEvC,OAAO,CACL,cACE,KAA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C,KAAK,aAC3B,EAAE,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,cAAK,IAAI,IACpD,KARE,EAAE,CAAC,EAAE,CAST,CACR,CAAC;gBACJ,CAAC,CAAC,EACD,KAAK,GAAG,MAAM,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAC3C,gBAAM,EAAE,EAAE,KAAK,wBACV,UAAU,CAAC,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC,MAAM,cACvC,CACR,CAAC,CAAC,CAAC,IAAI,EACP,WAAW,CAAC,CAAC,CAAC,CACb,eAAK,KAAK,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,aAClD,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CACpB,eAAM,EAAE,EAAE,YAAY,CAAC,WAAW,CAAC,MAAM,CAAC,YACvC,WAAW,CAAC,MAAM,GACd,CACR,CAAC,CAAC,CAAC,IAAI,EACP,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,oBAAoB,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAChE,eAAc,EAAE,EAAE,KAAK,YACpB,IAAI,IAAI,GAAG,IADH,CAAC,CAEL,CACR,CAAC,EACF,gBAAM,EAAE,EAAE,KAAK,aACZ,WAAW,CAAC,MAAM,KAAK,QAAQ,IAAI,WAAW,CAAC,KAAK;oCACnD,CAAC,CAAC,kBAAkB;oCACpB,CAAC,CAAC,EAAE,sCAED,IACH,CACP,CAAC,CAAC,CAAC,IAAI,IACP,CACJ,GACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "@opentui/react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* One-line activity summary in the shell (TUI_DESIGN §13.1): the latest
|
|
4
|
+
* meaningful operation state without occupying a pane. Teaches ^J.
|
|
5
|
+
*/
|
|
6
|
+
import { relativeTime } from "../author/data.js";
|
|
7
|
+
import { OPERATION_GLYPH, formatElapsed, } from "./operationStore.js";
|
|
8
|
+
import { AMBER, FAINT, RED, TEAL } from "../theme/tokens.js";
|
|
9
|
+
const TONE = {
|
|
10
|
+
running: AMBER,
|
|
11
|
+
succeeded: TEAL,
|
|
12
|
+
failed: RED,
|
|
13
|
+
};
|
|
14
|
+
export function ActivitySummaryLine({ operation, now, }) {
|
|
15
|
+
const time = operation.status === "running"
|
|
16
|
+
? formatElapsed(now - operation.startedAt)
|
|
17
|
+
: relativeTime(operation.endedAt ?? operation.startedAt);
|
|
18
|
+
return (_jsxs("box", { style: {
|
|
19
|
+
flexDirection: "row",
|
|
20
|
+
justifyContent: "space-between",
|
|
21
|
+
flexShrink: 0,
|
|
22
|
+
paddingLeft: 1,
|
|
23
|
+
paddingRight: 1,
|
|
24
|
+
}, children: [_jsxs("text", { fg: TONE[operation.status], children: [OPERATION_GLYPH[operation.status], " ", operation.title, operation.detail ? ` — ${operation.detail}` : "", " \u00B7 ", time] }), _jsx("text", { fg: FAINT, children: "^J activity" })] }));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=ActivitySummary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActivitySummary.js","sourceRoot":"","sources":["../../../src/activity/ActivitySummary.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EACL,eAAe,EACf,aAAa,GAEd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE7D,MAAM,IAAI,GAA8C;IACtD,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,GAAG;CACZ,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,EAClC,SAAS,EACT,GAAG,GAIJ;IACC,MAAM,IAAI,GACR,SAAS,CAAC,MAAM,KAAK,SAAS;QAC5B,CAAC,CAAC,aAAa,CAAC,GAAG,GAAG,SAAS,CAAC,SAAS,CAAC;QAC1C,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,OAAO,IAAI,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7D,OAAO,CACL,eACE,KAAK,EAAE;YACL,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,eAAe;YAC/B,UAAU,EAAE,CAAC;YACb,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,CAAC;SAChB,aAED,gBAAM,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,aAC7B,eAAe,CAAC,SAAS,CAAC,MAAM,CAAC,OAAG,SAAS,CAAC,KAAK,EACnD,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,cAAK,IAAI,IACrD,EACP,eAAM,EAAE,EAAE,KAAK,4BAAoB,IAC/B,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Durable operation store (TUI_DESIGN §13) — push/pull/validate and friends
|
|
3
|
+
* live here so they survive mode/view switches. Plain subscribable store:
|
|
4
|
+
* the lifecycle is three states (running → succeeded | failed), which does
|
|
5
|
+
* not justify a state-machine dependency; revisit if copilot turns add
|
|
6
|
+
* pause/permission states (Phase 5).
|
|
7
|
+
*/
|
|
8
|
+
export type OperationStatus = "running" | "succeeded" | "failed";
|
|
9
|
+
/** How to re-run an operation from the activity drawer. */
|
|
10
|
+
export type RetrySpec = {
|
|
11
|
+
mode: "simple";
|
|
12
|
+
name: string;
|
|
13
|
+
args: string;
|
|
14
|
+
} | {
|
|
15
|
+
mode: "sheet";
|
|
16
|
+
name: string;
|
|
17
|
+
values: Record<string, string | boolean>;
|
|
18
|
+
} | {
|
|
19
|
+
mode: "validate";
|
|
20
|
+
};
|
|
21
|
+
export interface OperationRecord {
|
|
22
|
+
id: number;
|
|
23
|
+
/** Command name (push, pull, validate, mdb-seed, …). */
|
|
24
|
+
kind: string;
|
|
25
|
+
/** Human label, e.g. "push · jaber". */
|
|
26
|
+
title: string;
|
|
27
|
+
status: OperationStatus;
|
|
28
|
+
startedAt: number;
|
|
29
|
+
endedAt?: number;
|
|
30
|
+
/** Latest one-line summary: progress while running, outcome after. */
|
|
31
|
+
detail?: string;
|
|
32
|
+
/** Raw output lines (copyable from the drawer). */
|
|
33
|
+
output: string[];
|
|
34
|
+
retry?: RetrySpec;
|
|
35
|
+
}
|
|
36
|
+
export declare class OperationStore {
|
|
37
|
+
private records;
|
|
38
|
+
private listeners;
|
|
39
|
+
private nextId;
|
|
40
|
+
private readonly now;
|
|
41
|
+
constructor(now?: () => number);
|
|
42
|
+
/** Stable reference between mutations — safe for useSyncExternalStore. */
|
|
43
|
+
snapshot: () => OperationRecord[];
|
|
44
|
+
subscribe: (listener: () => void) => (() => void);
|
|
45
|
+
start(kind: string, title: string, retry?: RetrySpec): number;
|
|
46
|
+
/** Update the progress line of a running operation. */
|
|
47
|
+
progress(id: number, detail: string): void;
|
|
48
|
+
succeed(id: number, detail?: string, output?: string[]): void;
|
|
49
|
+
fail(id: number, detail: string, output?: string[]): void;
|
|
50
|
+
find(id: number): OperationRecord | undefined;
|
|
51
|
+
private finish;
|
|
52
|
+
private patch;
|
|
53
|
+
/** Every mutation flows through here: prune, swap reference, notify. */
|
|
54
|
+
private commit;
|
|
55
|
+
private pruned;
|
|
56
|
+
private notify;
|
|
57
|
+
}
|
|
58
|
+
/** The one store — module-level so operations survive app re-renders. */
|
|
59
|
+
export declare const operationStore: OperationStore;
|
|
60
|
+
export declare function isOperationCommand(name: string): boolean;
|
|
61
|
+
/** Drawer ordering: running first, then most recent first. */
|
|
62
|
+
export declare function orderedOperations(records: OperationRecord[]): OperationRecord[];
|
|
63
|
+
/** What the shell summary line shows: newest running, else newest finished. */
|
|
64
|
+
export declare function latestOperation(records: OperationRecord[]): OperationRecord | undefined;
|
|
65
|
+
/** Compact elapsed time: "0s", "42s", "1m 05s", "2h 03m". */
|
|
66
|
+
export declare function formatElapsed(ms: number): string;
|
|
67
|
+
export declare const OPERATION_GLYPH: Record<OperationStatus, string>;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Durable operation store (TUI_DESIGN §13) — push/pull/validate and friends
|
|
3
|
+
* live here so they survive mode/view switches. Plain subscribable store:
|
|
4
|
+
* the lifecycle is three states (running → succeeded | failed), which does
|
|
5
|
+
* not justify a state-machine dependency; revisit if copilot turns add
|
|
6
|
+
* pause/permission states (Phase 5).
|
|
7
|
+
*/
|
|
8
|
+
/** Finished operations kept for the drawer; running ops are never evicted. */
|
|
9
|
+
const HISTORY_CAP = 50;
|
|
10
|
+
export class OperationStore {
|
|
11
|
+
records = [];
|
|
12
|
+
listeners = new Set();
|
|
13
|
+
nextId = 1;
|
|
14
|
+
now;
|
|
15
|
+
constructor(now = Date.now) {
|
|
16
|
+
this.now = now;
|
|
17
|
+
}
|
|
18
|
+
/** Stable reference between mutations — safe for useSyncExternalStore. */
|
|
19
|
+
snapshot = () => this.records;
|
|
20
|
+
subscribe = (listener) => {
|
|
21
|
+
this.listeners.add(listener);
|
|
22
|
+
return () => this.listeners.delete(listener);
|
|
23
|
+
};
|
|
24
|
+
start(kind, title, retry) {
|
|
25
|
+
const id = this.nextId++;
|
|
26
|
+
const record = {
|
|
27
|
+
id,
|
|
28
|
+
kind,
|
|
29
|
+
title,
|
|
30
|
+
status: "running",
|
|
31
|
+
startedAt: this.now(),
|
|
32
|
+
output: [],
|
|
33
|
+
...(retry ? { retry } : {}),
|
|
34
|
+
};
|
|
35
|
+
this.commit([...this.records, record]);
|
|
36
|
+
return id;
|
|
37
|
+
}
|
|
38
|
+
/** Update the progress line of a running operation. */
|
|
39
|
+
progress(id, detail) {
|
|
40
|
+
this.patch(id, { detail });
|
|
41
|
+
}
|
|
42
|
+
succeed(id, detail, output) {
|
|
43
|
+
this.finish(id, "succeeded", detail, output);
|
|
44
|
+
}
|
|
45
|
+
fail(id, detail, output) {
|
|
46
|
+
this.finish(id, "failed", detail, output);
|
|
47
|
+
}
|
|
48
|
+
find(id) {
|
|
49
|
+
return this.records.find((r) => r.id === id);
|
|
50
|
+
}
|
|
51
|
+
finish(id, status, detail, output) {
|
|
52
|
+
this.patch(id, {
|
|
53
|
+
status,
|
|
54
|
+
endedAt: this.now(),
|
|
55
|
+
...(detail !== undefined ? { detail } : {}),
|
|
56
|
+
...(output ? { output } : {}),
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
patch(id, patch) {
|
|
60
|
+
const index = this.records.findIndex((r) => r.id === id);
|
|
61
|
+
if (index < 0)
|
|
62
|
+
return;
|
|
63
|
+
const next = [...this.records];
|
|
64
|
+
next[index] = { ...next[index], ...patch };
|
|
65
|
+
this.commit(next);
|
|
66
|
+
}
|
|
67
|
+
/** Every mutation flows through here: prune, swap reference, notify. */
|
|
68
|
+
commit(records) {
|
|
69
|
+
this.records = this.pruned(records);
|
|
70
|
+
this.notify();
|
|
71
|
+
}
|
|
72
|
+
pruned(records) {
|
|
73
|
+
const finished = records.filter((r) => r.status !== "running");
|
|
74
|
+
if (finished.length <= HISTORY_CAP)
|
|
75
|
+
return records;
|
|
76
|
+
const drop = new Set(finished.slice(0, finished.length - HISTORY_CAP).map((r) => r.id));
|
|
77
|
+
return records.filter((r) => !drop.has(r.id));
|
|
78
|
+
}
|
|
79
|
+
notify() {
|
|
80
|
+
for (const listener of this.listeners)
|
|
81
|
+
listener();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/** The one store — module-level so operations survive app re-renders. */
|
|
85
|
+
export const operationStore = new OperationStore();
|
|
86
|
+
/**
|
|
87
|
+
* Commands worth tracking as operations: real work with output and failure
|
|
88
|
+
* modes. Context switches, pickers, and view toggles stay untracked.
|
|
89
|
+
*/
|
|
90
|
+
const OPERATION_COMMANDS = new Set([
|
|
91
|
+
"push",
|
|
92
|
+
"pull",
|
|
93
|
+
"validate",
|
|
94
|
+
"schema-pull",
|
|
95
|
+
"version-publish",
|
|
96
|
+
"version-archive",
|
|
97
|
+
"agent-import",
|
|
98
|
+
"agent-create",
|
|
99
|
+
"agent-unlink",
|
|
100
|
+
"workspace-create",
|
|
101
|
+
"project-create",
|
|
102
|
+
"reset",
|
|
103
|
+
]);
|
|
104
|
+
export function isOperationCommand(name) {
|
|
105
|
+
return OPERATION_COMMANDS.has(name) || name.startsWith("mdb-");
|
|
106
|
+
}
|
|
107
|
+
/** Drawer ordering: running first, then most recent first. */
|
|
108
|
+
export function orderedOperations(records) {
|
|
109
|
+
return [...records].sort((a, b) => {
|
|
110
|
+
const runA = a.status === "running" ? 0 : 1;
|
|
111
|
+
const runB = b.status === "running" ? 0 : 1;
|
|
112
|
+
if (runA !== runB)
|
|
113
|
+
return runA - runB;
|
|
114
|
+
return (b.endedAt ?? b.startedAt) - (a.endedAt ?? a.startedAt);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/** What the shell summary line shows: newest running, else newest finished. */
|
|
118
|
+
export function latestOperation(records) {
|
|
119
|
+
return orderedOperations(records)[0];
|
|
120
|
+
}
|
|
121
|
+
/** Compact elapsed time: "0s", "42s", "1m 05s", "2h 03m". */
|
|
122
|
+
export function formatElapsed(ms) {
|
|
123
|
+
const totalSeconds = Math.max(0, Math.floor(ms / 1000));
|
|
124
|
+
if (totalSeconds < 60)
|
|
125
|
+
return `${totalSeconds}s`;
|
|
126
|
+
const totalMinutes = Math.floor(totalSeconds / 60);
|
|
127
|
+
if (totalMinutes < 60) {
|
|
128
|
+
return `${totalMinutes}m ${String(totalSeconds % 60).padStart(2, "0")}s`;
|
|
129
|
+
}
|
|
130
|
+
const hours = Math.floor(totalMinutes / 60);
|
|
131
|
+
return `${hours}h ${String(totalMinutes % 60).padStart(2, "0")}m`;
|
|
132
|
+
}
|
|
133
|
+
export const OPERATION_GLYPH = {
|
|
134
|
+
running: "●",
|
|
135
|
+
succeeded: "✓",
|
|
136
|
+
failed: "✕",
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=operationStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operationStore.js","sourceRoot":"","sources":["../../../src/activity/operationStore.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA0BH,8EAA8E;AAC9E,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB,MAAM,OAAO,cAAc;IACjB,OAAO,GAAsB,EAAE,CAAC;IAChC,SAAS,GAAG,IAAI,GAAG,EAAc,CAAC;IAClC,MAAM,GAAG,CAAC,CAAC;IACF,GAAG,CAAe;IAEnC,YAAY,MAAoB,IAAI,CAAC,GAAG;QACtC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,0EAA0E;IAC1E,QAAQ,GAAG,GAAsB,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;IAEjD,SAAS,GAAG,CAAC,QAAoB,EAAgB,EAAE;QACjD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC7B,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC,CAAC;IAEF,KAAK,CAAC,IAAY,EAAE,KAAa,EAAE,KAAiB;QAClD,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QACzB,MAAM,MAAM,GAAoB;YAC9B,EAAE;YACF,IAAI;YACJ,KAAK;YACL,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,MAAM,EAAE,EAAE;YACV,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC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,IAAI,CAAC,CAAC,CAAC;IACxD,IAAI,YAAY,GAAG,EAAE;QAAE,OAAO,GAAG,YAAY,GAAG,CAAC;IACjD,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,EAAE,CAAC,CAAC;IACnD,IAAI,YAAY,GAAG,EAAE,EAAE,CAAC;QACtB,OAAO,GAAG,YAAY,KAAK,MAAM,CAAC,YAAY,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC;IAC3E,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,EAAE,CAAC,CAAC;IAC5C,OAAO,GAAG,KAAK,KAAK,MAAM,CAAC,YAAY,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC;AACpE,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAoC;IAC9D,OAAO,EAAE,GAAG;IACZ,SAAS,EAAE,GAAG;IACd,MAAM,EAAE,GAAG;CACZ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
import type { ScrollBoxRenderable } from "@opentui/core";
|
|
3
|
+
import { type ScopeStrip } from "../lib/scope.js";
|
|
4
|
+
import type { BackendDetection } from "./backend/types.js";
|
|
5
|
+
import type { AuthorSnapshot, ValidationRecord } from "./data.js";
|
|
6
|
+
import type { SessionRow, SessionState } from "./session.js";
|
|
7
|
+
/**
|
|
8
|
+
* Author mode home — program cockpit beside the IDE (TUI_DESIGN §8).
|
|
9
|
+
* Local card (baseline, changes, validation health) vs remote target card,
|
|
10
|
+
* plus a changes preview. d/v open the full diff / validation subviews.
|
|
11
|
+
*/
|
|
12
|
+
export declare function AuthorHome({ scope, snapshot, validation, frame, working, version, paneTitle, paneLines, session, sessionRows, sessionCursor, sessionScrollRef, backendLabel, backendDetection, }: {
|
|
13
|
+
scope: ScopeStrip;
|
|
14
|
+
snapshot?: AuthorSnapshot | undefined;
|
|
15
|
+
validation?: ValidationRecord | undefined;
|
|
16
|
+
frame: string[];
|
|
17
|
+
working: boolean;
|
|
18
|
+
version: string;
|
|
19
|
+
paneTitle?: string | undefined;
|
|
20
|
+
paneLines: string[];
|
|
21
|
+
session?: SessionState | undefined;
|
|
22
|
+
sessionRows: SessionRow[];
|
|
23
|
+
sessionCursor: number;
|
|
24
|
+
sessionScrollRef: RefObject<ScrollBoxRenderable | null>;
|
|
25
|
+
backendLabel: string;
|
|
26
|
+
backendDetection?: BackendDetection | undefined;
|
|
27
|
+
}): import("react").ReactNode;
|