@principal-ade/panel-layouts 0.2.6 → 0.2.8
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/index.d.ts +8 -0
- package/dist/index.esm.js +26 -21
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1192,16 +1192,24 @@ export declare interface UseAgentCommandPaletteReturn {
|
|
|
1192
1192
|
mode: AgentCommandPaletteMode;
|
|
1193
1193
|
/** Current execution status */
|
|
1194
1194
|
status: AgentCommandPaletteStatus;
|
|
1195
|
+
/** Set the execution status (for external AI integration) */
|
|
1196
|
+
setStatus: (status: AgentCommandPaletteStatus) => void;
|
|
1195
1197
|
/** Tools being executed */
|
|
1196
1198
|
pendingTools: ToolExecution[];
|
|
1197
1199
|
/** Completed tools */
|
|
1198
1200
|
completedTools: ToolExecution[];
|
|
1199
1201
|
/** Agent's text response */
|
|
1200
1202
|
agentResponse: string;
|
|
1203
|
+
/** Set the agent response text (for external AI integration) */
|
|
1204
|
+
setAgentResponse: (response: string) => void;
|
|
1201
1205
|
/** Submit the current query for execution */
|
|
1202
1206
|
submit: () => void;
|
|
1203
1207
|
/** Execute a quick command directly */
|
|
1204
1208
|
executeQuickCommand: (command: string) => void;
|
|
1209
|
+
/** Add a tool to the pending list (for external AI integration) */
|
|
1210
|
+
addPendingTool: (tool: Omit<ToolExecution, 'status'>) => ToolExecution;
|
|
1211
|
+
/** Update a tool's status (for external AI integration) */
|
|
1212
|
+
updateToolStatus: (toolId: string, status: ToolExecution['status'], result?: string, error?: string) => void;
|
|
1205
1213
|
/** Command history */
|
|
1206
1214
|
history: CommandHistoryEntry[];
|
|
1207
1215
|
/** Navigate to previous history entry */
|
package/dist/index.esm.js
CHANGED
|
@@ -1535,10 +1535,10 @@ function dt({
|
|
|
1535
1535
|
const {
|
|
1536
1536
|
key: S = " ",
|
|
1537
1537
|
altKey: E = !0,
|
|
1538
|
-
ctrlKey:
|
|
1538
|
+
ctrlKey: F = !1,
|
|
1539
1539
|
metaKey: V = !1,
|
|
1540
1540
|
shiftKey: Q = !1
|
|
1541
|
-
} = t, Z = y.altKey === E && y.ctrlKey ===
|
|
1541
|
+
} = t, Z = y.altKey === E && y.ctrlKey === F && y.metaKey === V && y.shiftKey === Q;
|
|
1542
1542
|
if ((S === " " ? y.code === "Space" : y.key === S) && Z) {
|
|
1543
1543
|
const G = y.target;
|
|
1544
1544
|
if (G.tagName === "INPUT" || G.tagName === "TEXTAREA" || G.isContentEditable)
|
|
@@ -2026,8 +2026,8 @@ const De = ({
|
|
|
2026
2026
|
} = o;
|
|
2027
2027
|
W(() => {
|
|
2028
2028
|
if (!s) return;
|
|
2029
|
-
const S = (
|
|
2030
|
-
r.current && !r.current.contains(
|
|
2029
|
+
const S = (F) => {
|
|
2030
|
+
r.current && !r.current.contains(F.target) && a();
|
|
2031
2031
|
}, E = setTimeout(() => {
|
|
2032
2032
|
document.addEventListener("mousedown", S);
|
|
2033
2033
|
}, 100);
|
|
@@ -2230,11 +2230,11 @@ const De = ({
|
|
|
2230
2230
|
cursor: "pointer",
|
|
2231
2231
|
transition: "background-color 150ms ease"
|
|
2232
2232
|
},
|
|
2233
|
-
onMouseEnter: (
|
|
2234
|
-
|
|
2233
|
+
onMouseEnter: (F) => {
|
|
2234
|
+
F.currentTarget.style.backgroundColor = t.colors.backgroundTertiary;
|
|
2235
2235
|
},
|
|
2236
|
-
onMouseLeave: (
|
|
2237
|
-
|
|
2236
|
+
onMouseLeave: (F) => {
|
|
2237
|
+
F.currentTarget.style.backgroundColor = t.colors.backgroundSecondary;
|
|
2238
2238
|
},
|
|
2239
2239
|
children: [
|
|
2240
2240
|
'"',
|
|
@@ -2340,7 +2340,7 @@ function ut({
|
|
|
2340
2340
|
a ? y() : C();
|
|
2341
2341
|
}, [a, C, y]), E = x(() => {
|
|
2342
2342
|
p(""), h("natural"), f("idle"), m([]), k([]), A(""), w(-1);
|
|
2343
|
-
}, []),
|
|
2343
|
+
}, []), F = x((T) => {
|
|
2344
2344
|
const j = {
|
|
2345
2345
|
...T,
|
|
2346
2346
|
status: "pending"
|
|
@@ -2351,13 +2351,13 @@ function ut({
|
|
|
2351
2351
|
m((N) => {
|
|
2352
2352
|
const K = N.find((B) => B.id === T);
|
|
2353
2353
|
if (!K) return N;
|
|
2354
|
-
const
|
|
2354
|
+
const O = {
|
|
2355
2355
|
...K,
|
|
2356
2356
|
status: j,
|
|
2357
2357
|
result: M,
|
|
2358
2358
|
error: J
|
|
2359
2359
|
};
|
|
2360
|
-
return j === "success" || j === "error" ? (k((B) => [...B,
|
|
2360
|
+
return j === "success" || j === "error" ? (k((B) => [...B, O]), N.filter((B) => B.id !== T)) : N.map((B) => B.id === T ? O : B);
|
|
2361
2361
|
});
|
|
2362
2362
|
},
|
|
2363
2363
|
[]
|
|
@@ -2367,34 +2367,34 @@ function ut({
|
|
|
2367
2367
|
if (!M) return;
|
|
2368
2368
|
f("executing");
|
|
2369
2369
|
const N = `quick-${Date.now()}`;
|
|
2370
|
-
|
|
2370
|
+
F({
|
|
2371
2371
|
id: N,
|
|
2372
2372
|
name: M,
|
|
2373
2373
|
args: { args: J }
|
|
2374
2374
|
}), V(N, "running");
|
|
2375
2375
|
try {
|
|
2376
2376
|
if (r) {
|
|
2377
|
-
const
|
|
2378
|
-
V(N, "success", String(
|
|
2377
|
+
const O = await r(M, { args: J });
|
|
2378
|
+
V(N, "success", String(O));
|
|
2379
2379
|
} else
|
|
2380
2380
|
V(N, "success", "Tool executed (no handler)");
|
|
2381
|
-
$((
|
|
2381
|
+
$((O) => [
|
|
2382
2382
|
{
|
|
2383
2383
|
query: T,
|
|
2384
2384
|
timestamp: Date.now(),
|
|
2385
2385
|
toolsExecuted: [M],
|
|
2386
2386
|
success: !0
|
|
2387
2387
|
},
|
|
2388
|
-
...
|
|
2388
|
+
...O.slice(0, (t.maxHistoryEntries || 50) - 1)
|
|
2389
2389
|
]), f("complete"), A(`Executed: ${M}`);
|
|
2390
2390
|
const K = t.autoCloseDelay ?? 1e3;
|
|
2391
2391
|
K > 0 && setTimeout(() => y(), K);
|
|
2392
2392
|
} catch (K) {
|
|
2393
|
-
const
|
|
2394
|
-
V(N, "error", void 0,
|
|
2393
|
+
const O = K instanceof Error ? K.message : "Unknown error";
|
|
2394
|
+
V(N, "error", void 0, O), f("error"), A(`Error: ${O}`);
|
|
2395
2395
|
}
|
|
2396
2396
|
},
|
|
2397
|
-
[r,
|
|
2397
|
+
[r, F, V, t.autoCloseDelay, t.maxHistoryEntries, y]
|
|
2398
2398
|
), Z = x(() => {
|
|
2399
2399
|
if (i.trim()) {
|
|
2400
2400
|
if (u === "quick-command") {
|
|
@@ -2435,8 +2435,8 @@ function ut({
|
|
|
2435
2435
|
ctrlKey: J = !1,
|
|
2436
2436
|
metaKey: N = !1,
|
|
2437
2437
|
shiftKey: K = !1
|
|
2438
|
-
} = e,
|
|
2439
|
-
if ((M ? T.code === `Key${j.toUpperCase()}` : T.key.toLowerCase() === j.toLowerCase()) &&
|
|
2438
|
+
} = e, O = T.altKey === M && T.ctrlKey === J && T.metaKey === N && T.shiftKey === K;
|
|
2439
|
+
if ((M ? T.code === `Key${j.toUpperCase()}` : T.key.toLowerCase() === j.toLowerCase()) && O) {
|
|
2440
2440
|
const U = T.target;
|
|
2441
2441
|
if (!U.closest("[data-agent-command-palette-input]") && (U.tagName === "INPUT" || U.tagName === "TEXTAREA" || U.isContentEditable))
|
|
2442
2442
|
return;
|
|
@@ -2457,11 +2457,16 @@ function ut({
|
|
|
2457
2457
|
mode: u,
|
|
2458
2458
|
// Execution
|
|
2459
2459
|
status: d,
|
|
2460
|
+
setStatus: f,
|
|
2460
2461
|
pendingTools: g,
|
|
2461
2462
|
completedTools: c,
|
|
2462
2463
|
agentResponse: R,
|
|
2464
|
+
setAgentResponse: A,
|
|
2463
2465
|
submit: Z,
|
|
2464
2466
|
executeQuickCommand: Q,
|
|
2467
|
+
// Tool management (for external AI integration)
|
|
2468
|
+
addPendingTool: F,
|
|
2469
|
+
updateToolStatus: V,
|
|
2465
2470
|
// History
|
|
2466
2471
|
history: I,
|
|
2467
2472
|
historyPrevious: te,
|