@polterware/polter 0.4.2 → 0.5.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 +0 -70
- package/dist/api.js +62 -30
- package/dist/app-HGIGWI7F.js +393 -0
- package/dist/appPanel-EZOHLTBX.js +1365 -0
- package/dist/applier-OEXIUYYO.js +10 -0
- package/dist/chunk-3RG5ZIWI.js +10 -0
- package/dist/chunk-45CQFZU7.js +262 -0
- package/dist/chunk-57CZSEY5.js +5398 -0
- package/dist/chunk-6IBRTRLX.js +257 -0
- package/dist/chunk-AK3NTS3Y.js +220 -0
- package/dist/chunk-BGT5TT2A.js +32 -0
- package/dist/chunk-BIN7BDA2.js +77 -0
- package/dist/chunk-E2B5FFBU.js +81 -0
- package/dist/chunk-EAMHFQKU.js +222 -0
- package/dist/chunk-ELSIHPJL.js +455 -0
- package/dist/{chunk-XCCKD3RZ.js → chunk-GCS7JEYU.js} +7 -3
- package/dist/chunk-GKROVUDG.js +15 -0
- package/dist/chunk-GVIKF6UI.js +738 -0
- package/dist/chunk-JQB2A3CA.js +72 -0
- package/dist/chunk-KEGROLGX.js +50 -0
- package/dist/chunk-OKHPN6X7.js +49 -0
- package/dist/chunk-RVMOIUSL.js +22 -0
- package/dist/chunk-TD6YNU6L.js +22 -0
- package/dist/chunk-U64WZOJ3.js +101 -0
- package/dist/chunk-U6725U7K.js +138 -0
- package/dist/chunk-XNRIN3VM.js +125 -0
- package/dist/chunk-ZU5VZHYD.js +28 -0
- package/dist/commands-BIIWGCVS.js +15 -0
- package/dist/editor-AUFJZ4PE.js +11 -0
- package/dist/engine-EZQ26HDJ.js +11 -0
- package/dist/globalConf-AGMMIKSL.js +7 -0
- package/dist/index.js +49 -7601
- package/dist/ipcServer-HXOPKNBP.js +10 -0
- package/dist/mcp.js +182 -13892
- package/dist/mcpInstaller-J2AGFNWR.js +19 -0
- package/dist/parser-4ZBGSI2U.js +10 -0
- package/dist/planner-ZVBA66V6.js +9 -0
- package/dist/processManager-6T5DBURV.js +37 -0
- package/dist/projectConfig-TRCJS3VI.js +21 -0
- package/dist/skillSetup-ZQEHJ5ZG.js +14 -0
- package/dist/status-QMRCV4XJ.js +8 -0
- package/dist/storage-C3D7TLJW.js +17 -0
- package/dist/toolResolver-A2BUT3NK.js +17 -0
- package/package.json +20 -2
- package/dist/chunk-CWBIXRZP.js +0 -2607
package/README.md
CHANGED
|
@@ -21,7 +21,6 @@ Polter is a productivity layer on top of the official `supabase` CLI. Instead of
|
|
|
21
21
|
- **Built-in Self-Update**: Update Polter for the current repository or globally through npm
|
|
22
22
|
- **Shell Execution**: Resolves `supabase` from the current repository first, then falls back to `PATH`
|
|
23
23
|
- **TypeScript-based CLI**: Strongly typed internal implementation
|
|
24
|
-
- **App Workflows**: Explicit `polter app ...` flows for repository-aware setup, linking, migrations, runtime configuration, and app installation
|
|
25
24
|
|
|
26
25
|
---
|
|
27
26
|
|
|
@@ -103,45 +102,6 @@ Install Supabase CLI (official docs):
|
|
|
103
102
|
|
|
104
103
|
## Quick Reference
|
|
105
104
|
|
|
106
|
-
### App Workflows
|
|
107
|
-
|
|
108
|
-
Polter keeps generic Supabase execution separate from app-specific automation.
|
|
109
|
-
Use the `app` namespace when you want project-aware workflows:
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
polter app setup ops --path .
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
polter app link ops --path .
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
```bash
|
|
120
|
-
polter app migrate ops push --path .
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
```bash
|
|
124
|
-
polter app configure ops --path .
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
polter app install ops
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
```bash
|
|
132
|
-
polter app update ops
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
`setup ops` installs dependencies, collects Supabase connection data, links the project, pushes migrations, and writes the runtime bootstrap payload used by the desktop app.
|
|
136
|
-
|
|
137
|
-
`configure ops` refreshes the runtime connection payload without reinstalling the app.
|
|
138
|
-
|
|
139
|
-
`install ops` is currently macOS-only. By default it resolves the latest GitHub release from `polterware/ops`, accepts `--version <version>` to pin a release, and still supports `--artifact-url` or `POLTER_OPS_MACOS_ARTIFACT_URL` as manual overrides.
|
|
140
|
-
|
|
141
|
-
`update ops` is also macOS-only. It replaces the installed `ops.app` with a newer release while preserving the persisted runtime configuration, local settings, and Supabase session state stored outside the app bundle.
|
|
142
|
-
|
|
143
|
-
Use `POLTER_OPS_GITHUB_REPO=owner/repo` when you need to resolve releases from a fork or a different repository.
|
|
144
|
-
|
|
145
105
|
### Execution Model
|
|
146
106
|
|
|
147
107
|
Polter executes workflow commands as:
|
|
@@ -260,36 +220,6 @@ Pins are persisted locally using OS-level app config storage.
|
|
|
260
220
|
|
|
261
221
|
## Usage Examples
|
|
262
222
|
|
|
263
|
-
### Bootstrap Ops from source
|
|
264
|
-
|
|
265
|
-
```bash
|
|
266
|
-
polter app setup ops --path /absolute/path/to/ops
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
### Reconfigure an installed Ops app
|
|
270
|
-
|
|
271
|
-
```bash
|
|
272
|
-
polter app configure ops
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
### Install the latest released Ops app
|
|
276
|
-
|
|
277
|
-
```bash
|
|
278
|
-
polter app install ops
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
Install a specific release:
|
|
282
|
-
|
|
283
|
-
```bash
|
|
284
|
-
polter app install ops --version 1.0.0
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
Update an existing installation without re-running runtime configuration:
|
|
288
|
-
|
|
289
|
-
```bash
|
|
290
|
-
polter app update ops
|
|
291
|
-
```
|
|
292
|
-
|
|
293
223
|
### Check Supabase CLI version
|
|
294
224
|
|
|
295
225
|
Interactive path:
|
package/dist/api.js
CHANGED
|
@@ -1,51 +1,82 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createIpcClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GCS7JEYU.js";
|
|
4
4
|
import {
|
|
5
|
-
allCommands,
|
|
6
|
-
applyActions,
|
|
7
|
-
createIpcServer,
|
|
8
|
-
deletePipeline,
|
|
9
|
-
detectPkgManager,
|
|
10
|
-
executePipeline,
|
|
11
5
|
features,
|
|
6
|
+
getFeatureById,
|
|
7
|
+
getFlagsForTool,
|
|
8
|
+
toolFlags
|
|
9
|
+
} from "./chunk-AK3NTS3Y.js";
|
|
10
|
+
import {
|
|
11
|
+
getSkillContent,
|
|
12
|
+
getSkillPath,
|
|
13
|
+
setupSkill,
|
|
14
|
+
setupSkillCli
|
|
15
|
+
} from "./chunk-XNRIN3VM.js";
|
|
16
|
+
import {
|
|
17
|
+
deletePipeline,
|
|
12
18
|
findPipelineByName,
|
|
19
|
+
getAllPipelines,
|
|
20
|
+
savePipeline
|
|
21
|
+
} from "./chunk-U64WZOJ3.js";
|
|
22
|
+
import "./chunk-BIN7BDA2.js";
|
|
23
|
+
import "./chunk-GKROVUDG.js";
|
|
24
|
+
import {
|
|
25
|
+
parsePolterYaml
|
|
26
|
+
} from "./chunk-U6725U7K.js";
|
|
27
|
+
import {
|
|
28
|
+
planChanges
|
|
29
|
+
} from "./chunk-E2B5FFBU.js";
|
|
30
|
+
import {
|
|
31
|
+
getCurrentStatus
|
|
32
|
+
} from "./chunk-OKHPN6X7.js";
|
|
33
|
+
import {
|
|
34
|
+
applyActions
|
|
35
|
+
} from "./chunk-BGT5TT2A.js";
|
|
36
|
+
import {
|
|
37
|
+
getMcpStatusInfo,
|
|
38
|
+
installMcpServerSilent,
|
|
39
|
+
removeMcpServerSilent
|
|
40
|
+
} from "./chunk-45CQFZU7.js";
|
|
41
|
+
import {
|
|
42
|
+
createIpcServer
|
|
43
|
+
} from "./chunk-EAMHFQKU.js";
|
|
44
|
+
import {
|
|
13
45
|
findProcessesByCwd,
|
|
14
46
|
findRunningByCommand,
|
|
15
47
|
generateProcessId,
|
|
16
|
-
getAllPipelines,
|
|
17
|
-
getCommandById,
|
|
18
|
-
getCommandValue,
|
|
19
|
-
getCommandsByTool,
|
|
20
|
-
getCurrentStatus,
|
|
21
|
-
getFeatureById,
|
|
22
|
-
getFlagsForTool,
|
|
23
|
-
getMcpStatusInfo,
|
|
24
48
|
getProcessOutput,
|
|
25
|
-
getSkillContent,
|
|
26
|
-
getSkillPath,
|
|
27
49
|
getSocketPath,
|
|
28
|
-
getToolDisplayName,
|
|
29
|
-
getToolInfo,
|
|
30
|
-
installMcpServerSilent,
|
|
31
50
|
isProcessRunning,
|
|
32
51
|
listProcesses,
|
|
33
|
-
parsePolterYaml,
|
|
34
|
-
planChanges,
|
|
35
52
|
registerForegroundProcess,
|
|
36
|
-
removeMcpServerSilent,
|
|
37
53
|
removeProcess,
|
|
54
|
+
startProcess,
|
|
55
|
+
stopProcess
|
|
56
|
+
} from "./chunk-6IBRTRLX.js";
|
|
57
|
+
import "./chunk-ZU5VZHYD.js";
|
|
58
|
+
import {
|
|
59
|
+
executePipeline
|
|
60
|
+
} from "./chunk-JQB2A3CA.js";
|
|
61
|
+
import {
|
|
62
|
+
allCommands,
|
|
63
|
+
getCommandById,
|
|
64
|
+
getCommandValue,
|
|
65
|
+
getCommandsByTool
|
|
66
|
+
} from "./chunk-GVIKF6UI.js";
|
|
67
|
+
import {
|
|
68
|
+
detectPkgManager,
|
|
69
|
+
getToolDisplayName,
|
|
70
|
+
getToolInfo,
|
|
38
71
|
resolvePkgArgs,
|
|
39
72
|
resolveToolCommand,
|
|
40
73
|
runCommand,
|
|
41
|
-
|
|
42
|
-
setupSkill,
|
|
43
|
-
setupSkillCli,
|
|
44
|
-
startProcess,
|
|
45
|
-
stopProcess,
|
|
46
|
-
toolFlags,
|
|
74
|
+
runCommandWithRetry,
|
|
47
75
|
translateCommand
|
|
48
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-ELSIHPJL.js";
|
|
77
|
+
import "./chunk-RVMOIUSL.js";
|
|
78
|
+
import "./chunk-TD6YNU6L.js";
|
|
79
|
+
import "./chunk-3RG5ZIWI.js";
|
|
49
80
|
export {
|
|
50
81
|
allCommands,
|
|
51
82
|
applyActions,
|
|
@@ -84,6 +115,7 @@ export {
|
|
|
84
115
|
resolvePkgArgs,
|
|
85
116
|
resolveToolCommand,
|
|
86
117
|
runCommand,
|
|
118
|
+
runCommandWithRetry,
|
|
87
119
|
savePipeline,
|
|
88
120
|
setupSkill,
|
|
89
121
|
setupSkillCli,
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CommandArgs,
|
|
3
|
+
CommandExecution,
|
|
4
|
+
CustomCommand,
|
|
5
|
+
DeclarativePlan,
|
|
6
|
+
DeclarativeStatus,
|
|
7
|
+
FlagSelection,
|
|
8
|
+
GhostBanner,
|
|
9
|
+
InitScaffold,
|
|
10
|
+
McpManage,
|
|
11
|
+
PipelineBuilder,
|
|
12
|
+
PipelineExecution,
|
|
13
|
+
PipelineList,
|
|
14
|
+
ProcessList,
|
|
15
|
+
ProcessLogs,
|
|
16
|
+
ProjectConfig,
|
|
17
|
+
ScriptPicker,
|
|
18
|
+
SelectList,
|
|
19
|
+
SelfUpdate,
|
|
20
|
+
SkillSetup,
|
|
21
|
+
StatusBar,
|
|
22
|
+
ToolStatus,
|
|
23
|
+
buildHomeItems,
|
|
24
|
+
colors,
|
|
25
|
+
getFeatures,
|
|
26
|
+
getPinnedCommands,
|
|
27
|
+
getPinnedRuns,
|
|
28
|
+
inkColors,
|
|
29
|
+
togglePinnedCommand,
|
|
30
|
+
togglePinnedRun,
|
|
31
|
+
useTerminalDimensions
|
|
32
|
+
} from "./chunk-57CZSEY5.js";
|
|
33
|
+
import "./chunk-KEGROLGX.js";
|
|
34
|
+
import "./chunk-AK3NTS3Y.js";
|
|
35
|
+
import "./chunk-XNRIN3VM.js";
|
|
36
|
+
import "./chunk-U64WZOJ3.js";
|
|
37
|
+
import "./chunk-BIN7BDA2.js";
|
|
38
|
+
import "./chunk-GKROVUDG.js";
|
|
39
|
+
import "./chunk-U6725U7K.js";
|
|
40
|
+
import "./chunk-E2B5FFBU.js";
|
|
41
|
+
import "./chunk-OKHPN6X7.js";
|
|
42
|
+
import "./chunk-BGT5TT2A.js";
|
|
43
|
+
import "./chunk-45CQFZU7.js";
|
|
44
|
+
import "./chunk-6IBRTRLX.js";
|
|
45
|
+
import "./chunk-ZU5VZHYD.js";
|
|
46
|
+
import "./chunk-JQB2A3CA.js";
|
|
47
|
+
import {
|
|
48
|
+
findCommandByValue
|
|
49
|
+
} from "./chunk-GVIKF6UI.js";
|
|
50
|
+
import "./chunk-ELSIHPJL.js";
|
|
51
|
+
import "./chunk-RVMOIUSL.js";
|
|
52
|
+
import "./chunk-TD6YNU6L.js";
|
|
53
|
+
import "./chunk-3RG5ZIWI.js";
|
|
54
|
+
|
|
55
|
+
// src/app.tsx
|
|
56
|
+
import { Box as Box3, Text as Text3, useApp } from "ink";
|
|
57
|
+
|
|
58
|
+
// src/hooks/useNavigation.ts
|
|
59
|
+
import { useState, useCallback } from "react";
|
|
60
|
+
function useNavigation() {
|
|
61
|
+
const [stack, setStack] = useState([
|
|
62
|
+
{ screen: "home", params: {} }
|
|
63
|
+
]);
|
|
64
|
+
const current = stack[stack.length - 1];
|
|
65
|
+
const navigate = useCallback((screen, params) => {
|
|
66
|
+
setStack((prev) => [...prev, { screen, params: params ?? {} }]);
|
|
67
|
+
}, []);
|
|
68
|
+
const goBack = useCallback(() => {
|
|
69
|
+
setStack((prev) => {
|
|
70
|
+
if (prev.length <= 1) return [{ screen: "home", params: {} }];
|
|
71
|
+
return prev.slice(0, -1);
|
|
72
|
+
});
|
|
73
|
+
}, []);
|
|
74
|
+
const goHome = useCallback(() => {
|
|
75
|
+
setStack([{ screen: "home", params: {} }]);
|
|
76
|
+
}, []);
|
|
77
|
+
return {
|
|
78
|
+
screen: current.screen,
|
|
79
|
+
params: current.params,
|
|
80
|
+
navigate,
|
|
81
|
+
goBack,
|
|
82
|
+
goHome
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// src/hooks/useTerminalWidth.ts
|
|
87
|
+
function useTerminalWidth() {
|
|
88
|
+
return useTerminalDimensions().width;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// src/hooks/useTerminalHeight.ts
|
|
92
|
+
function useTerminalHeight() {
|
|
93
|
+
return useTerminalDimensions().height;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// src/screens/Home.tsx
|
|
97
|
+
import { useEffect, useMemo, useState as useState2 } from "react";
|
|
98
|
+
import { Box as Box2, Text as Text2, useInput } from "ink";
|
|
99
|
+
import ms from "ms";
|
|
100
|
+
|
|
101
|
+
// src/components/TabBar.tsx
|
|
102
|
+
import { Box, Text } from "ink";
|
|
103
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
104
|
+
function TabBar({ tabs, activeIndex, width = 80 }) {
|
|
105
|
+
const narrow = width < 50;
|
|
106
|
+
const medium = width < 80;
|
|
107
|
+
return /* @__PURE__ */ jsx(Box, { gap: 1, children: tabs.map((tab, i) => {
|
|
108
|
+
const isActive = i === activeIndex;
|
|
109
|
+
const showLabel = narrow ? false : medium ? isActive : true;
|
|
110
|
+
const displayText = showLabel ? `${tab.icon} ${tab.label}` : tab.icon;
|
|
111
|
+
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
112
|
+
/* @__PURE__ */ jsx(
|
|
113
|
+
Text,
|
|
114
|
+
{
|
|
115
|
+
color: isActive ? inkColors.accent : void 0,
|
|
116
|
+
bold: isActive,
|
|
117
|
+
dimColor: !isActive,
|
|
118
|
+
children: displayText
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
isActive && !narrow && /* @__PURE__ */ jsx(Text, { color: inkColors.accent, children: "\u2550".repeat(displayText.length) })
|
|
122
|
+
] }, tab.id);
|
|
123
|
+
}) });
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// src/screens/Home.tsx
|
|
127
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
128
|
+
function Home({
|
|
129
|
+
onNavigate,
|
|
130
|
+
onExit,
|
|
131
|
+
width = 80,
|
|
132
|
+
height = 24
|
|
133
|
+
}) {
|
|
134
|
+
const allFeatures = useMemo(() => getFeatures(), []);
|
|
135
|
+
const [activeTabIndex, setActiveTabIndex] = useState2(0);
|
|
136
|
+
const [pinnedCommands, setPinnedCommands] = useState2(
|
|
137
|
+
() => getPinnedCommands()
|
|
138
|
+
);
|
|
139
|
+
const [pinnedRuns, setPinnedRuns] = useState2(
|
|
140
|
+
() => getPinnedRuns()
|
|
141
|
+
);
|
|
142
|
+
const [pinFeedback, setPinFeedback] = useState2();
|
|
143
|
+
const activeFeature = allFeatures[activeTabIndex];
|
|
144
|
+
useEffect(() => {
|
|
145
|
+
if (!pinFeedback) return;
|
|
146
|
+
const timeout = setTimeout(() => setPinFeedback(void 0), ms("1.4s"));
|
|
147
|
+
return () => clearTimeout(timeout);
|
|
148
|
+
}, [pinFeedback]);
|
|
149
|
+
useInput((_input, key) => {
|
|
150
|
+
if (key.leftArrow && !key.meta) {
|
|
151
|
+
setActiveTabIndex(
|
|
152
|
+
(prev) => prev > 0 ? prev - 1 : allFeatures.length - 1
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
if (key.rightArrow && !key.meta) {
|
|
156
|
+
setActiveTabIndex(
|
|
157
|
+
(prev) => prev < allFeatures.length - 1 ? prev + 1 : 0
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
if (key.tab) {
|
|
161
|
+
setActiveTabIndex(
|
|
162
|
+
(prev) => prev < allFeatures.length - 1 ? prev + 1 : 0
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
const tabs = useMemo(
|
|
167
|
+
() => allFeatures.map((f) => ({ id: f.id, icon: f.icon, label: f.label })),
|
|
168
|
+
[allFeatures]
|
|
169
|
+
);
|
|
170
|
+
const items = useMemo(
|
|
171
|
+
() => buildHomeItems({
|
|
172
|
+
activeFeature,
|
|
173
|
+
pinnedCommands,
|
|
174
|
+
pinnedRuns
|
|
175
|
+
}),
|
|
176
|
+
[activeFeature, pinnedCommands, pinnedRuns]
|
|
177
|
+
);
|
|
178
|
+
const pinnedCommandSet = useMemo(
|
|
179
|
+
() => new Set(pinnedCommands),
|
|
180
|
+
[pinnedCommands]
|
|
181
|
+
);
|
|
182
|
+
const pinnedRunSet = useMemo(() => new Set(pinnedRuns), [pinnedRuns]);
|
|
183
|
+
const refreshPins = () => {
|
|
184
|
+
setPinnedCommands(getPinnedCommands());
|
|
185
|
+
setPinnedRuns(getPinnedRuns());
|
|
186
|
+
};
|
|
187
|
+
const handleSelect = (value, item) => {
|
|
188
|
+
if (!item) return;
|
|
189
|
+
if (item.kind === "command") {
|
|
190
|
+
const cmdDef = findCommandByValue(value);
|
|
191
|
+
if (cmdDef) {
|
|
192
|
+
onNavigate("command-args", {
|
|
193
|
+
command: value,
|
|
194
|
+
commandId: cmdDef.id,
|
|
195
|
+
tool: cmdDef.tool
|
|
196
|
+
});
|
|
197
|
+
} else {
|
|
198
|
+
onNavigate("command-args", { command: value, tool: "supabase" });
|
|
199
|
+
}
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
if (item.kind === "run") {
|
|
203
|
+
const args = value.split(" ").filter(Boolean);
|
|
204
|
+
if (args.length > 0) {
|
|
205
|
+
const basePart = args[0] ?? "";
|
|
206
|
+
const cmdDef = findCommandByValue(basePart);
|
|
207
|
+
const tool = cmdDef?.tool ?? "supabase";
|
|
208
|
+
onNavigate("confirm-execute", { args, tool, interactive: cmdDef?.interactive });
|
|
209
|
+
}
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
switch (value) {
|
|
213
|
+
case "__action_custom__":
|
|
214
|
+
onNavigate("custom-command");
|
|
215
|
+
break;
|
|
216
|
+
case "__action_pipelines__":
|
|
217
|
+
onNavigate("pipeline-list");
|
|
218
|
+
break;
|
|
219
|
+
case "__action_tools__":
|
|
220
|
+
onNavigate("tool-status");
|
|
221
|
+
break;
|
|
222
|
+
case "__action_config__":
|
|
223
|
+
onNavigate("project-config");
|
|
224
|
+
break;
|
|
225
|
+
case "__action_skill_setup__":
|
|
226
|
+
onNavigate("skill-setup");
|
|
227
|
+
break;
|
|
228
|
+
case "__action_update__":
|
|
229
|
+
onNavigate("self-update");
|
|
230
|
+
break;
|
|
231
|
+
case "__action_declarative_plan__":
|
|
232
|
+
onNavigate("declarative-plan");
|
|
233
|
+
break;
|
|
234
|
+
case "__action_declarative_status__":
|
|
235
|
+
onNavigate("declarative-status");
|
|
236
|
+
break;
|
|
237
|
+
case "__action_init_scaffold__":
|
|
238
|
+
onNavigate("init-scaffold");
|
|
239
|
+
break;
|
|
240
|
+
case "__action_exit__":
|
|
241
|
+
onExit();
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
const handleRightAction = (item) => {
|
|
246
|
+
if (item.kind === "command") {
|
|
247
|
+
const wasPinned = pinnedCommandSet.has(item.value);
|
|
248
|
+
togglePinnedCommand(item.value);
|
|
249
|
+
refreshPins();
|
|
250
|
+
setPinFeedback(
|
|
251
|
+
wasPinned ? `Unpinned "${item.value}"` : `Pinned "${item.value}"`
|
|
252
|
+
);
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
if (item.kind === "run") {
|
|
256
|
+
const wasPinned = pinnedRunSet.has(item.value);
|
|
257
|
+
togglePinnedRun(item.value);
|
|
258
|
+
refreshPins();
|
|
259
|
+
setPinFeedback(
|
|
260
|
+
wasPinned ? `Unpinned run "${item.value}"` : `Pinned run "${item.value}"`
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", children: [
|
|
265
|
+
/* @__PURE__ */ jsx2(Box2, { marginBottom: 1, children: /* @__PURE__ */ jsx2(TabBar, { tabs, activeIndex: activeTabIndex, width }) }),
|
|
266
|
+
pinFeedback && /* @__PURE__ */ jsx2(Box2, { marginBottom: 1, children: /* @__PURE__ */ jsxs2(Text2, { color: inkColors.accent, children: [
|
|
267
|
+
"\u2713 ",
|
|
268
|
+
pinFeedback
|
|
269
|
+
] }) }),
|
|
270
|
+
/* @__PURE__ */ jsx2(
|
|
271
|
+
SelectList,
|
|
272
|
+
{
|
|
273
|
+
items,
|
|
274
|
+
onSelect: handleSelect,
|
|
275
|
+
onRightAction: handleRightAction,
|
|
276
|
+
boxedSections: true,
|
|
277
|
+
width,
|
|
278
|
+
maxVisible: Math.max(8, height - 14)
|
|
279
|
+
}
|
|
280
|
+
),
|
|
281
|
+
/* @__PURE__ */ jsx2(StatusBar, { hint: "\u2190\u2192 tab \xB7 \u2191\u2193 navigate \xB7 Enter select \xB7 p pin", width })
|
|
282
|
+
] });
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// src/app.tsx
|
|
286
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
287
|
+
function AppClassic() {
|
|
288
|
+
const { screen, params, navigate, goBack, goHome } = useNavigation();
|
|
289
|
+
const { exit } = useApp();
|
|
290
|
+
const width = useTerminalWidth();
|
|
291
|
+
const height = useTerminalHeight();
|
|
292
|
+
const handleExit = () => {
|
|
293
|
+
process.stdout.write(
|
|
294
|
+
"\n" + colors.dim("Thank you for using ") + colors.primaryBold("Polter") + colors.dim("!") + "\n\n"
|
|
295
|
+
);
|
|
296
|
+
exit();
|
|
297
|
+
};
|
|
298
|
+
const renderScreen = () => {
|
|
299
|
+
switch (screen) {
|
|
300
|
+
case "home":
|
|
301
|
+
return /* @__PURE__ */ jsx3(Home, { onNavigate: navigate, onExit: handleExit, width, height });
|
|
302
|
+
case "command-args":
|
|
303
|
+
return /* @__PURE__ */ jsx3(
|
|
304
|
+
CommandArgs,
|
|
305
|
+
{
|
|
306
|
+
command: params.command ?? "",
|
|
307
|
+
tool: params.tool,
|
|
308
|
+
onNavigate: navigate,
|
|
309
|
+
onBack: goBack,
|
|
310
|
+
width
|
|
311
|
+
}
|
|
312
|
+
);
|
|
313
|
+
case "custom-command":
|
|
314
|
+
return /* @__PURE__ */ jsx3(CustomCommand, { onNavigate: navigate, onBack: goBack, width });
|
|
315
|
+
case "flag-selection":
|
|
316
|
+
return /* @__PURE__ */ jsx3(
|
|
317
|
+
FlagSelection,
|
|
318
|
+
{
|
|
319
|
+
args: params.args ?? [],
|
|
320
|
+
tool: params.tool,
|
|
321
|
+
onNavigate: navigate,
|
|
322
|
+
onBack: goBack,
|
|
323
|
+
width
|
|
324
|
+
}
|
|
325
|
+
);
|
|
326
|
+
case "confirm-execute":
|
|
327
|
+
case "command-execution":
|
|
328
|
+
return /* @__PURE__ */ jsx3(
|
|
329
|
+
CommandExecution,
|
|
330
|
+
{
|
|
331
|
+
args: params.args ?? [],
|
|
332
|
+
tool: params.tool,
|
|
333
|
+
rawCommand: params.rawCommand,
|
|
334
|
+
onBack: goBack,
|
|
335
|
+
onExit: handleExit,
|
|
336
|
+
onRunSuggestion: (sugTool, sugArgs) => {
|
|
337
|
+
goHome();
|
|
338
|
+
navigate("confirm-execute", { tool: sugTool, args: sugArgs });
|
|
339
|
+
},
|
|
340
|
+
width
|
|
341
|
+
}
|
|
342
|
+
);
|
|
343
|
+
case "self-update":
|
|
344
|
+
return /* @__PURE__ */ jsx3(SelfUpdate, { onBack: goBack, onExit: handleExit, width });
|
|
345
|
+
case "tool-status":
|
|
346
|
+
return /* @__PURE__ */ jsx3(ToolStatus, { onBack: goBack, onNavigate: navigate, width });
|
|
347
|
+
case "mcp-manage":
|
|
348
|
+
return /* @__PURE__ */ jsx3(McpManage, { onBack: goBack, width });
|
|
349
|
+
case "process-list":
|
|
350
|
+
return /* @__PURE__ */ jsx3(ProcessList, { onNavigate: navigate, onBack: goBack, width, height });
|
|
351
|
+
case "process-logs":
|
|
352
|
+
return /* @__PURE__ */ jsx3(ProcessLogs, { processId: params.processId ?? "", onBack: goBack, width, height });
|
|
353
|
+
case "project-config":
|
|
354
|
+
return /* @__PURE__ */ jsx3(ProjectConfig, { onBack: goBack, width });
|
|
355
|
+
case "pipeline-list":
|
|
356
|
+
return /* @__PURE__ */ jsx3(PipelineList, { onNavigate: navigate, onBack: goBack, width });
|
|
357
|
+
case "pipeline-builder":
|
|
358
|
+
return /* @__PURE__ */ jsx3(PipelineBuilder, { onBack: goBack, width, height });
|
|
359
|
+
case "pipeline-execution":
|
|
360
|
+
return /* @__PURE__ */ jsx3(
|
|
361
|
+
PipelineExecution,
|
|
362
|
+
{
|
|
363
|
+
pipelineId: params.pipelineId ?? "",
|
|
364
|
+
onBack: goBack,
|
|
365
|
+
onExit: handleExit,
|
|
366
|
+
width
|
|
367
|
+
}
|
|
368
|
+
);
|
|
369
|
+
case "declarative-plan":
|
|
370
|
+
return /* @__PURE__ */ jsx3(DeclarativePlan, { onBack: goBack, onNavigate: navigate, width, height });
|
|
371
|
+
case "declarative-status":
|
|
372
|
+
return /* @__PURE__ */ jsx3(DeclarativeStatus, { onBack: goBack, width, height });
|
|
373
|
+
case "init-scaffold":
|
|
374
|
+
return /* @__PURE__ */ jsx3(InitScaffold, { onBack: goBack, onNavigate: navigate, width, height });
|
|
375
|
+
case "script-picker":
|
|
376
|
+
return /* @__PURE__ */ jsx3(ScriptPicker, { onNavigate: navigate, onBack: goBack, width, height });
|
|
377
|
+
case "skill-setup":
|
|
378
|
+
return /* @__PURE__ */ jsx3(SkillSetup, { onBack: goBack, width, height });
|
|
379
|
+
default:
|
|
380
|
+
return /* @__PURE__ */ jsx3(Box3, { children: /* @__PURE__ */ jsxs3(Text3, { color: "red", children: [
|
|
381
|
+
"Unknown screen: ",
|
|
382
|
+
screen
|
|
383
|
+
] }) });
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
return /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", children: [
|
|
387
|
+
/* @__PURE__ */ jsx3(GhostBanner, { width }),
|
|
388
|
+
renderScreen()
|
|
389
|
+
] });
|
|
390
|
+
}
|
|
391
|
+
export {
|
|
392
|
+
AppClassic
|
|
393
|
+
};
|