@a5c-ai/babysitter-sdk 0.0.187-staging.575126cd → 0.0.187-staging.658bbfef
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/dist/dashboard/ink/App.d.ts.map +1 -1
- package/dist/dashboard/ink/App.js +15 -3
- package/dist/dashboard/ink/components/PromptBar.d.ts.map +1 -1
- package/dist/dashboard/ink/components/PromptBar.js +24 -2
- package/dist/dashboard/ink/views/DashboardView.d.ts.map +1 -1
- package/dist/dashboard/ink/views/DashboardView.js +29 -19
- package/dist/dashboard/ink/views/SessionView.d.ts.map +1 -1
- package/dist/dashboard/ink/views/SessionView.js +46 -5
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../src/dashboard/ink/App.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAavD,OAAO,KAAK,EAAE,SAAS,EAAmC,MAAM,YAAY,CAAC;AAG7E,OAAO,EAAE,WAAW,EAAE,CAAC;AAOvB,MAAM,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAAC,CAAC;AACnG,MAAM,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../src/dashboard/ink/App.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAavD,OAAO,KAAK,EAAE,SAAS,EAAmC,MAAM,YAAY,CAAC;AAG7E,OAAO,EAAE,WAAW,EAAE,CAAC;AAOvB,MAAM,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAAC,CAAC;AACnG,MAAM,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAAC,CAAC;AA4FpG,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,EAC1B,KAAK,EACL,SAAoB,EACpB,KAAK,EACL,WAAW,EACX,OAAqB,GACtB,EAAE,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAmB/B"}
|
|
@@ -34,11 +34,24 @@ const useSession_js_1 = require("./hooks/useSession.js");
|
|
|
34
34
|
const DashboardView_js_1 = require("./views/DashboardView.js");
|
|
35
35
|
const SessionView_js_1 = require("./views/SessionView.js");
|
|
36
36
|
// ---------------------------------------------------------------------------
|
|
37
|
+
// Run-detail placeholder (needs its own component so it can call useInput)
|
|
38
|
+
// ---------------------------------------------------------------------------
|
|
39
|
+
function RunDetailPlaceholder() {
|
|
40
|
+
const { Box, Text, useInput } = (0, InkContext_js_2.useInk)();
|
|
41
|
+
const { state: navState, dispatch: navDispatch } = (0, useNavigation_js_1.useNavigation)();
|
|
42
|
+
useInput((_input, key) => {
|
|
43
|
+
if (key.escape) {
|
|
44
|
+
navDispatch({ type: "GO_BACK" });
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return react_1.default.createElement(Box, { flexDirection: "column", height: "100%" }, react_1.default.createElement(Box, { paddingX: 1, paddingY: 1 }, react_1.default.createElement(Text, { color: "cyan", bold: true }, `Run Detail: ${navState.selectedRunId ?? "none"}`)), react_1.default.createElement(Box, { paddingX: 1 }, react_1.default.createElement(Text, { color: "#6b7280" }, "Run detail view coming soon. Press Escape to go back.")));
|
|
48
|
+
}
|
|
49
|
+
// ---------------------------------------------------------------------------
|
|
37
50
|
// Inner App (rendered inside all providers)
|
|
38
51
|
// ---------------------------------------------------------------------------
|
|
39
52
|
const VERBOSITY_CYCLE = ["minimal", "normal", "verbose"];
|
|
40
53
|
function AppInner({ runsDir }) {
|
|
41
|
-
const {
|
|
54
|
+
const { Text, useInput } = (0, InkContext_js_2.useInk)();
|
|
42
55
|
const { state: sessionState, dispatch: sessionDispatch } = (0, useSession_js_1.useSession)();
|
|
43
56
|
const { state: navState } = (0, useNavigation_js_1.useNavigation)();
|
|
44
57
|
// 'v' key cycles verbosity at the app level (only in session view)
|
|
@@ -56,8 +69,7 @@ function AppInner({ runsDir }) {
|
|
|
56
69
|
case "session":
|
|
57
70
|
return react_1.default.createElement(SessionView_js_1.SessionView, null);
|
|
58
71
|
case "run-detail":
|
|
59
|
-
|
|
60
|
-
return react_1.default.createElement(Box, { flexDirection: "column", height: "100%" }, react_1.default.createElement(Box, { paddingX: 1, paddingY: 1 }, react_1.default.createElement(Text, { color: "cyan", bold: true }, `Run Detail: ${navState.selectedRunId ?? "none"}`)), react_1.default.createElement(Box, { paddingX: 1 }, react_1.default.createElement(Text, { color: "#6b7280" }, "Run detail view coming soon. Press Escape to go back.")));
|
|
72
|
+
return react_1.default.createElement(RunDetailPlaceholder, null);
|
|
61
73
|
default: {
|
|
62
74
|
const _exhaustive = navState.currentView;
|
|
63
75
|
return react_1.default.createElement(Text, null, "Unknown view");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromptBar.d.ts","sourceRoot":"","sources":["../../../../src/dashboard/ink/components/PromptBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAgC,MAAM,OAAO,CAAC;AAUrD,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;
|
|
1
|
+
{"version":3,"file":"PromptBar.d.ts","sourceRoot":"","sources":["../../../../src/dashboard/ink/components/PromptBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAgC,MAAM,OAAO,CAAC;AAUrD,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAsCD,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,WAAsE,GACvE,EAAE,cAAc,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA8IpC"}
|
|
@@ -51,6 +51,20 @@ const react_1 = __importStar(require("react"));
|
|
|
51
51
|
const useSession_js_1 = require("../hooks/useSession.js");
|
|
52
52
|
const useTheme_js_1 = require("../hooks/useTheme.js");
|
|
53
53
|
const InkContext_js_1 = require("../contexts/InkContext.js");
|
|
54
|
+
const SLASH_COMMANDS = [
|
|
55
|
+
{ name: "/status", description: "Show run status" },
|
|
56
|
+
{ name: "/refresh", description: "Refresh run data" },
|
|
57
|
+
{ name: "/clear", description: "Clear messages" },
|
|
58
|
+
{ name: "/back", description: "Go back to dashboard" },
|
|
59
|
+
{ name: "/verbosity", description: "Cycle verbosity level" },
|
|
60
|
+
{ name: "/help", description: "Show available commands" },
|
|
61
|
+
];
|
|
62
|
+
function getSlashHints(input) {
|
|
63
|
+
if (!input.startsWith("/"))
|
|
64
|
+
return [];
|
|
65
|
+
const prefix = input.toLowerCase();
|
|
66
|
+
return SLASH_COMMANDS.filter((cmd) => cmd.name.startsWith(prefix));
|
|
67
|
+
}
|
|
54
68
|
// ---------------------------------------------------------------------------
|
|
55
69
|
// Helpers
|
|
56
70
|
// ---------------------------------------------------------------------------
|
|
@@ -83,7 +97,7 @@ function PromptBar({ onSubmit, placeholder = "Type a message… (Enter=submit, E
|
|
|
83
97
|
setValue("");
|
|
84
98
|
dispatch({ type: "SET_INPUT_BUFFER", text: "" });
|
|
85
99
|
}
|
|
86
|
-
else if (key.backspace) {
|
|
100
|
+
else if (key.backspace || key.delete) {
|
|
87
101
|
setValue((prev) => prev.slice(0, -1));
|
|
88
102
|
dispatch({ type: "SET_INPUT_BUFFER", text: value.slice(0, -1) });
|
|
89
103
|
}
|
|
@@ -104,6 +118,8 @@ function PromptBar({ onSubmit, placeholder = "Type a message… (Enter=submit, E
|
|
|
104
118
|
const lineCount = countLines(value);
|
|
105
119
|
const isEmpty = value.length === 0;
|
|
106
120
|
const isActive = state.inputActive;
|
|
121
|
+
// Slash command hints
|
|
122
|
+
const slashHints = getSlashHints(value);
|
|
107
123
|
// Display text: show placeholder when empty and not active
|
|
108
124
|
const displayText = isEmpty && !isActive ? placeholder : value;
|
|
109
125
|
const displayColor = isEmpty && !isActive ? colors.muted : colors.foreground;
|
|
@@ -119,7 +135,12 @@ function PromptBar({ onSubmit, placeholder = "Type a message… (Enter=submit, E
|
|
|
119
135
|
const promptGlyph = react_1.default.createElement(Text, { color: isActive ? colors.primary : colors.muted, bold: isActive }, ">");
|
|
120
136
|
// Input display area
|
|
121
137
|
const inputArea = react_1.default.createElement(Box, { flexDirection: "row", flexGrow: 1, gap: 0 }, react_1.default.createElement(Text, { color: displayColor, wrap: "wrap" }, displayText), cursor);
|
|
122
|
-
|
|
138
|
+
// Slash command hints row (shown above the prompt when typing a slash command)
|
|
139
|
+
const slashHintsRow = slashHints.length > 0
|
|
140
|
+
? react_1.default.createElement(Box, { flexDirection: "row", paddingX: 2, gap: 2 }, ...slashHints.map((cmd) => react_1.default.createElement(Box, { key: cmd.name, flexDirection: "row", gap: 1 }, react_1.default.createElement(Text, { color: colors.primary, bold: true }, cmd.name), react_1.default.createElement(Text, { color: colors.muted }, cmd.description))))
|
|
141
|
+
: null;
|
|
142
|
+
// Prompt input row
|
|
143
|
+
const promptRow = react_1.default.createElement(Box, {
|
|
123
144
|
flexDirection: "row",
|
|
124
145
|
borderStyle: "single",
|
|
125
146
|
borderTop: true,
|
|
@@ -130,4 +151,5 @@ function PromptBar({ onSubmit, placeholder = "Type a message… (Enter=submit, E
|
|
|
130
151
|
paddingX: 1,
|
|
131
152
|
gap: 1,
|
|
132
153
|
}, promptGlyph, inputArea, lineHint);
|
|
154
|
+
return react_1.default.createElement(Box, { flexDirection: "column" }, slashHintsRow, promptRow);
|
|
133
155
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardView.d.ts","sourceRoot":"","sources":["../../../../src/dashboard/ink/views/DashboardView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAgC,MAAM,OAAO,CAAC;AAarD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CAC9B;AAMD,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,OAAO,EACP,MAAM,GACP,EAAE,kBAAkB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"DashboardView.d.ts","sourceRoot":"","sources":["../../../../src/dashboard/ink/views/DashboardView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAgC,MAAM,OAAO,CAAC;AAarD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CAC9B;AAMD,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,OAAO,EACP,MAAM,GACP,EAAE,kBAAkB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAsMxC"}
|
|
@@ -86,6 +86,9 @@ function DashboardView({ runsDir, version, onQuit, }) {
|
|
|
86
86
|
else if (input === "r") {
|
|
87
87
|
refresh();
|
|
88
88
|
}
|
|
89
|
+
else if (input === "n") {
|
|
90
|
+
handleAction("new");
|
|
91
|
+
}
|
|
89
92
|
else if (input === "s" && runs.length > 0) {
|
|
90
93
|
const run = runs[selectedIndex];
|
|
91
94
|
if (run) {
|
|
@@ -98,25 +101,8 @@ function DashboardView({ runsDir, version, onQuit, }) {
|
|
|
98
101
|
if (clampedIndex !== selectedIndex) {
|
|
99
102
|
setSelectedIndex(clampedIndex);
|
|
100
103
|
}
|
|
101
|
-
//
|
|
102
|
-
|
|
103
|
-
const waitingCount = runs.filter((r) => r.state === "waiting").length;
|
|
104
|
-
const failedCount = runs.filter((r) => r.state === "failed").length;
|
|
105
|
-
// Header
|
|
106
|
-
const versionText = version ? ` v${version}` : "";
|
|
107
|
-
const header = react_1.default.createElement(Box, { flexDirection: "column", paddingX: 1, marginBottom: 1 }, react_1.default.createElement(Box, { flexDirection: "row", gap: 1 }, react_1.default.createElement(Text, { color: colors.primary, bold: true }, "babysitter tui"), react_1.default.createElement(Text, { color: colors.muted }, versionText)), react_1.default.createElement(Box, { flexDirection: "row", gap: 2 }, react_1.default.createElement(Text, { color: colors.foreground }, `${String(runs.length)} runs:`), react_1.default.createElement(Text, { color: colors.success }, `${String(completedCount)} done`), react_1.default.createElement(Text, { color: colors.warning }, `${String(waitingCount)} waiting`), react_1.default.createElement(Text, { color: colors.error }, `${String(failedCount)} failed`)));
|
|
108
|
-
// Loading / error states
|
|
109
|
-
if (loading && runs.length === 0) {
|
|
110
|
-
return react_1.default.createElement(Box, { flexDirection: "column" }, header, react_1.default.createElement(Box, { paddingX: 2 }, react_1.default.createElement(Text, { color: colors.muted }, "Scanning runs...")));
|
|
111
|
-
}
|
|
112
|
-
if (error) {
|
|
113
|
-
return react_1.default.createElement(Box, { flexDirection: "column" }, header, react_1.default.createElement(Box, { paddingX: 2 }, react_1.default.createElement(Text, { color: colors.error }, `Error: ${error}`)));
|
|
114
|
-
}
|
|
115
|
-
// Empty state
|
|
116
|
-
if (runs.length === 0) {
|
|
117
|
-
return react_1.default.createElement(Box, { flexDirection: "column" }, header, react_1.default.createElement(Box, { paddingX: 2 }, react_1.default.createElement(Text, { color: colors.muted }, "No runs found. Press 'n' to create a new run, or 'q' to quit.")));
|
|
118
|
-
}
|
|
119
|
-
// Action menu handler (keyboard is handled above; this is for the component contract)
|
|
104
|
+
// Action menu handler — must be declared before any early returns so
|
|
105
|
+
// the hook call order is stable across renders (Rules of Hooks).
|
|
120
106
|
const handleAction = (0, react_1.useCallback)((action) => {
|
|
121
107
|
switch (action) {
|
|
122
108
|
case "details":
|
|
@@ -129,6 +115,9 @@ function DashboardView({ runsDir, version, onQuit, }) {
|
|
|
129
115
|
navDispatch({ type: "NAVIGATE_TO_SESSION", runId: runs[clampedIndex].runId });
|
|
130
116
|
}
|
|
131
117
|
break;
|
|
118
|
+
case "new":
|
|
119
|
+
navDispatch({ type: "NAVIGATE_TO_SESSION", runId: `new-${Date.now()}` });
|
|
120
|
+
break;
|
|
132
121
|
case "refresh":
|
|
133
122
|
refresh();
|
|
134
123
|
break;
|
|
@@ -139,6 +128,27 @@ function DashboardView({ runsDir, version, onQuit, }) {
|
|
|
139
128
|
break;
|
|
140
129
|
}
|
|
141
130
|
}, [runs, clampedIndex, navDispatch, refresh, onQuit]);
|
|
131
|
+
// --- Everything below here is render logic (no more hooks) ---
|
|
132
|
+
// Count stats
|
|
133
|
+
const completedCount = runs.filter((r) => r.state === "completed").length;
|
|
134
|
+
const waitingCount = runs.filter((r) => r.state === "waiting").length;
|
|
135
|
+
const failedCount = runs.filter((r) => r.state === "failed").length;
|
|
136
|
+
// Header
|
|
137
|
+
const versionText = version ? ` v${version}` : "";
|
|
138
|
+
const header = react_1.default.createElement(Box, { flexDirection: "column", paddingX: 1, marginBottom: 1 }, react_1.default.createElement(Box, { flexDirection: "row", gap: 1 }, react_1.default.createElement(Text, { color: colors.primary, bold: true }, "babysitter tui"), react_1.default.createElement(Text, { color: colors.muted }, versionText)), react_1.default.createElement(Box, { flexDirection: "row", gap: 2 }, react_1.default.createElement(Text, { color: colors.foreground }, `${String(runs.length)} runs:`), react_1.default.createElement(Text, { color: colors.success }, `${String(completedCount)} done`), react_1.default.createElement(Text, { color: colors.warning }, `${String(waitingCount)} waiting`), react_1.default.createElement(Text, { color: colors.error }, `${String(failedCount)} failed`)));
|
|
139
|
+
// Loading state
|
|
140
|
+
if (loading && runs.length === 0) {
|
|
141
|
+
return react_1.default.createElement(Box, { flexDirection: "column" }, header, react_1.default.createElement(Box, { paddingX: 2 }, react_1.default.createElement(Text, { color: colors.muted }, "Scanning runs...")));
|
|
142
|
+
}
|
|
143
|
+
// Error state
|
|
144
|
+
if (error) {
|
|
145
|
+
return react_1.default.createElement(Box, { flexDirection: "column" }, header, react_1.default.createElement(Box, { paddingX: 2 }, react_1.default.createElement(Text, { color: colors.error }, `Error: ${error}`)));
|
|
146
|
+
}
|
|
147
|
+
// Empty state
|
|
148
|
+
if (runs.length === 0) {
|
|
149
|
+
return react_1.default.createElement(Box, { flexDirection: "column" }, header, react_1.default.createElement(Box, { paddingX: 2 }, react_1.default.createElement(Text, { color: colors.muted }, "No runs found. Press 'n' to create a new run, or 'q' to quit.")));
|
|
150
|
+
}
|
|
151
|
+
// Normal state: run list + action menu
|
|
142
152
|
return react_1.default.createElement(Box, { flexDirection: "column", height: "100%" }, header, react_1.default.createElement(Box, { flexDirection: "column", flexGrow: 1 }, react_1.default.createElement(RunListTable_js_1.RunListTable, {
|
|
143
153
|
runs,
|
|
144
154
|
selectedIndex: clampedIndex,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionView.d.ts","sourceRoot":"","sources":["../../../../src/dashboard/ink/views/SessionView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"SessionView.d.ts","sourceRoot":"","sources":["../../../../src/dashboard/ink/views/SessionView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAsB,MAAM,OAAO,CAAC;AAc3C,wBAAgB,WAAW,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CA8C/C"}
|
|
@@ -10,12 +10,42 @@
|
|
|
10
10
|
*
|
|
11
11
|
* Box/Text are obtained from InkContext via useInk() — no prop drilling.
|
|
12
12
|
*/
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
16
46
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
47
|
exports.SessionView = SessionView;
|
|
18
|
-
const react_1 =
|
|
48
|
+
const react_1 = __importStar(require("react"));
|
|
19
49
|
const InkContext_js_1 = require("../contexts/InkContext.js");
|
|
20
50
|
const useNavigation_js_1 = require("../hooks/useNavigation.js");
|
|
21
51
|
const useSession_js_1 = require("../hooks/useSession.js");
|
|
@@ -41,8 +71,19 @@ function SessionView() {
|
|
|
41
71
|
navDispatch({ type: "GO_BACK" });
|
|
42
72
|
}
|
|
43
73
|
});
|
|
74
|
+
// Handle message submission from the PromptBar
|
|
75
|
+
const handleSubmit = (0, react_1.useCallback)((text) => {
|
|
76
|
+
const message = {
|
|
77
|
+
id: `msg-${Date.now()}`,
|
|
78
|
+
timestamp: new Date().toISOString(),
|
|
79
|
+
verbosity: "minimal",
|
|
80
|
+
content: { kind: "user", text },
|
|
81
|
+
};
|
|
82
|
+
sessionDispatch({ type: "APPEND_MESSAGE", message });
|
|
83
|
+
sessionDispatch({ type: "SET_INPUT_ACTIVE", active: false });
|
|
84
|
+
}, [sessionDispatch]);
|
|
44
85
|
return react_1.default.createElement(Box, {
|
|
45
86
|
flexDirection: "column",
|
|
46
87
|
height: "100%",
|
|
47
|
-
}, react_1.default.createElement(StatusBar_js_1.StatusBar, null), react_1.default.createElement(MessagePane_js_1.MessagePane, null), react_1.default.createElement(PromptBar_js_1.PromptBar,
|
|
88
|
+
}, react_1.default.createElement(StatusBar_js_1.StatusBar, null), react_1.default.createElement(MessagePane_js_1.MessagePane, null), react_1.default.createElement(PromptBar_js_1.PromptBar, { onSubmit: handleSubmit }));
|
|
48
89
|
}
|
package/package.json
CHANGED