@positronic/cli 0.0.77 → 0.0.78
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/src/cli.js +298 -196
- package/dist/src/commands/server.js +2 -2
- package/dist/src/components/event-detail.js +139 -139
- package/dist/src/components/events-view.js +60 -63
- package/dist/src/components/watch-keyboard.js +1 -1
- package/dist/src/components/watch-machine.js +344 -286
- package/dist/src/components/watch.js +17 -84
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/components/event-detail.d.ts.map +1 -1
- package/dist/types/components/events-view.d.ts.map +1 -1
- package/dist/types/components/watch-machine.d.ts +90 -146
- package/dist/types/components/watch-machine.d.ts.map +1 -1
- package/dist/types/components/watch.d.ts.map +1 -1
- package/dist/types/hooks/useBrainMachine.d.ts +0 -3
- package/dist/types/hooks/useBrainMachine.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/src/commands/auth.js +0 -91
- package/dist/src/commands/brain.js +0 -139
- package/dist/src/commands/pages.js +0 -47
- package/dist/src/commands/project.js +0 -130
- package/dist/src/commands/resources.js +0 -272
- package/dist/src/commands/schedule.js +0 -91
- package/dist/src/commands/secrets.js +0 -67
- package/dist/src/commands/store.js +0 -36
- package/dist/src/commands/users.js +0 -92
- package/dist/src/components/agent-chat-view.js +0 -125
- package/dist/src/utils/agent-utils.js +0 -107
- package/dist/types/commands/auth.d.ts +0 -32
- package/dist/types/commands/auth.d.ts.map +0 -1
- package/dist/types/commands/brain.d.ts +0 -46
- package/dist/types/commands/brain.d.ts.map +0 -1
- package/dist/types/commands/pages.d.ts +0 -15
- package/dist/types/commands/pages.d.ts.map +0 -1
- package/dist/types/commands/project.d.ts +0 -55
- package/dist/types/commands/project.d.ts.map +0 -1
- package/dist/types/commands/resources.d.ts +0 -13
- package/dist/types/commands/resources.d.ts.map +0 -1
- package/dist/types/commands/schedule.d.ts +0 -33
- package/dist/types/commands/schedule.d.ts.map +0 -1
- package/dist/types/commands/secrets.d.ts +0 -20
- package/dist/types/commands/secrets.d.ts.map +0 -1
- package/dist/types/commands/store.d.ts +0 -5
- package/dist/types/commands/store.d.ts.map +0 -1
- package/dist/types/commands/users.d.ts +0 -34
- package/dist/types/commands/users.d.ts.map +0 -1
- package/dist/types/components/agent-chat-view.d.ts +0 -12
- package/dist/types/components/agent-chat-view.d.ts.map +0 -1
- package/dist/types/utils/agent-utils.d.ts +0 -20
- package/dist/types/utils/agent-utils.d.ts.map +0 -1
|
@@ -95,12 +95,9 @@ import { authenticatedFetch } from '../lib/jwt-auth.js';
|
|
|
95
95
|
import { ErrorComponent } from './error.js';
|
|
96
96
|
import { EventsView } from './events-view.js';
|
|
97
97
|
import { StateView } from './state-view.js';
|
|
98
|
-
import { AgentChatView } from './agent-chat-view.js';
|
|
99
|
-
import { SelectList } from './select-list.js';
|
|
100
|
-
import { getAgentLoops } from '../utils/agent-utils.js';
|
|
101
98
|
import { handleKeyboardInput } from './watch-keyboard.js';
|
|
102
99
|
import { useAlternateScreen } from '../hooks/useAlternateScreen.js';
|
|
103
|
-
import {
|
|
100
|
+
import { useWatchReducer } from './watch-machine.js';
|
|
104
101
|
// Get the index of the currently running step (or last completed if none running)
|
|
105
102
|
var getCurrentStepIndex = function(steps) {
|
|
106
103
|
var runningIndex = steps.findIndex(function(s) {
|
|
@@ -238,18 +235,15 @@ var BrainSection = function(param) {
|
|
|
238
235
|
export var Watch = function(param) {
|
|
239
236
|
var runId = param.runId, _param_manageScreenBuffer = param.manageScreenBuffer, manageScreenBuffer = _param_manageScreenBuffer === void 0 ? true : _param_manageScreenBuffer, footer = param.footer, _param_startWithEvents = param.startWithEvents, startWithEvents = _param_startWithEvents === void 0 ? false : _param_startWithEvents;
|
|
240
237
|
var exit = useApp().exit;
|
|
241
|
-
// UI navigation state
|
|
242
|
-
var
|
|
243
|
-
|
|
244
|
-
var
|
|
245
|
-
|
|
246
|
-
var
|
|
247
|
-
|
|
248
|
-
var
|
|
249
|
-
var
|
|
250
|
-
var isPausing = isPausingState(watchState.name);
|
|
251
|
-
var isResuming = isResumingState(watchState.name);
|
|
252
|
-
var isSendingMessage = isSendingMessageState(watchState.name);
|
|
238
|
+
// UI navigation state — handles view transitions, async operations, and related context
|
|
239
|
+
var _useWatchReducer = _sliced_to_array(useWatchReducer(runId, startWithEvents), 2), watchState = _useWatchReducer[0], sendWatch = _useWatchReducer[1];
|
|
240
|
+
var viewMode = watchState.viewMode, previousViewMode = watchState.previousView, stateSnapshot = watchState.stateSnapshot, stateTitle = watchState.stateTitle, stateScrollOffset = watchState.stateScrollOffset, selectedAgentId = watchState.selectedAgentId, agentChatScrollOffset = watchState.agentChatScrollOffset, eventsSelectedIndex = watchState.eventsSelectedIndex, killStatus = watchState.killStatus, killError = watchState.killError, pauseResumeStatus = watchState.pauseResumeStatus, pauseResumeMessage = watchState.pauseResumeMessage, messageText = watchState.messageText, messageStatus = watchState.messageStatus, messageSentFeedback = watchState.messageFeedback;
|
|
241
|
+
var confirmingKill = killStatus === 'confirming';
|
|
242
|
+
var isKilling = killStatus === 'killing';
|
|
243
|
+
var isKilled = killStatus === 'killed';
|
|
244
|
+
var isPausing = pauseResumeStatus === 'pausing';
|
|
245
|
+
var isResuming = pauseResumeStatus === 'resuming';
|
|
246
|
+
var isSendingMessage = messageStatus === 'sending';
|
|
253
247
|
// Events array (large, not navigation state)
|
|
254
248
|
var _useState = _sliced_to_array(useState([]), 2), events = _useState[0], setEvents = _useState[1];
|
|
255
249
|
// Events view mode (delegated to EventsView component)
|
|
@@ -410,9 +404,7 @@ export var Watch = function(param) {
|
|
|
410
404
|
sendWatch
|
|
411
405
|
]);
|
|
412
406
|
// Build keyboard context for the handler
|
|
413
|
-
var
|
|
414
|
-
var agentLoops = getAgentLoops(events, brainTitle);
|
|
415
|
-
var hasAgents = agentLoops.length > 0;
|
|
407
|
+
var hasAgents = false;
|
|
416
408
|
// Keyboard handling - uses extracted handler for event mapping
|
|
417
409
|
useInput(function(input, key) {
|
|
418
410
|
var keyboardContext = {
|
|
@@ -482,20 +474,10 @@ export var Watch = function(param) {
|
|
|
482
474
|
case 'GO_TO_AGENTS':
|
|
483
475
|
{
|
|
484
476
|
var fromView = viewMode === 'events' ? 'events' : 'progress';
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
selectedAgentId: agentLoops[0].stepId,
|
|
490
|
-
fromView: fromView
|
|
491
|
-
});
|
|
492
|
-
} else {
|
|
493
|
-
// Show picker for multiple agents
|
|
494
|
-
sendWatch({
|
|
495
|
-
type: 'GO_TO_AGENTS',
|
|
496
|
-
fromView: fromView
|
|
497
|
-
});
|
|
498
|
-
}
|
|
477
|
+
sendWatch({
|
|
478
|
+
type: 'GO_TO_AGENTS',
|
|
479
|
+
fromView: fromView
|
|
480
|
+
});
|
|
499
481
|
break;
|
|
500
482
|
}
|
|
501
483
|
case 'GO_TO_MESSAGE_INPUT':
|
|
@@ -581,58 +563,9 @@ export var Watch = function(param) {
|
|
|
581
563
|
error: connectionErrorProps
|
|
582
564
|
}), brainErrorProps && /*#__PURE__*/ React.createElement(ErrorComponent, {
|
|
583
565
|
error: brainErrorProps
|
|
584
|
-
})) : viewMode === '
|
|
585
|
-
items: agentLoops.map(function(agent) {
|
|
586
|
-
return {
|
|
587
|
-
id: agent.stepId,
|
|
588
|
-
label: agent.label,
|
|
589
|
-
description: "".concat(agent.rawResponseEvents.length, " response(s)")
|
|
590
|
-
};
|
|
591
|
-
}),
|
|
592
|
-
header: "Select an agent to view:",
|
|
593
|
-
onSelect: function(item) {
|
|
594
|
-
sendWatch({
|
|
595
|
-
type: 'AGENT_SELECTED',
|
|
596
|
-
agentId: item.id
|
|
597
|
-
});
|
|
598
|
-
},
|
|
599
|
-
onCancel: function() {
|
|
600
|
-
return sendWatch({
|
|
601
|
-
type: 'GO_BACK'
|
|
602
|
-
});
|
|
603
|
-
},
|
|
604
|
-
footer: "j/k select | Enter view | b back"
|
|
605
|
-
}), connectionErrorProps && /*#__PURE__*/ React.createElement(ErrorComponent, {
|
|
606
|
-
error: connectionErrorProps
|
|
607
|
-
}), brainErrorProps && /*#__PURE__*/ React.createElement(ErrorComponent, {
|
|
608
|
-
error: brainErrorProps
|
|
609
|
-
})) : viewMode === 'agent-chat' && selectedAgentId ? function() {
|
|
610
|
-
var selectedAgent = agentLoops.find(function(a) {
|
|
611
|
-
return a.stepId === selectedAgentId;
|
|
612
|
-
});
|
|
613
|
-
if (!selectedAgent) {
|
|
614
|
-
return /*#__PURE__*/ React.createElement(Text, null, "Agent not found");
|
|
615
|
-
}
|
|
616
|
-
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(AgentChatView, {
|
|
617
|
-
label: selectedAgent.label,
|
|
618
|
-
agentStartEvent: selectedAgent.startEvent,
|
|
619
|
-
rawResponseEvents: selectedAgent.rawResponseEvents,
|
|
620
|
-
scrollOffset: agentChatScrollOffset,
|
|
621
|
-
onScrollChange: function(offset) {
|
|
622
|
-
return sendWatch({
|
|
623
|
-
type: 'SET_AGENT_CHAT_SCROLL_OFFSET',
|
|
624
|
-
offset: offset
|
|
625
|
-
});
|
|
626
|
-
},
|
|
627
|
-
isActive: viewMode === 'agent-chat'
|
|
628
|
-
}), connectionErrorProps && /*#__PURE__*/ React.createElement(ErrorComponent, {
|
|
629
|
-
error: connectionErrorProps
|
|
630
|
-
}), brainErrorProps && /*#__PURE__*/ React.createElement(ErrorComponent, {
|
|
631
|
-
error: brainErrorProps
|
|
632
|
-
}));
|
|
633
|
-
}() : viewMode === 'events' ? /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(EventsView, {
|
|
566
|
+
})) : viewMode === 'events' ? /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(EventsView, {
|
|
634
567
|
events: events,
|
|
635
|
-
totalTokens:
|
|
568
|
+
totalTokens: 0,
|
|
636
569
|
isActive: viewMode === 'events',
|
|
637
570
|
onModeChange: setEventsViewMode,
|
|
638
571
|
onViewState: handleViewStateAtEvent,
|
package/dist/types/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAuE5D,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,YAAY,KAAK,GAAG,CAAC;IAC7C,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAuDD,wBAAgB,QAAQ,CAAC,OAAO,EAAE,UAAU,4BAkpD3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-detail.d.ts","sourceRoot":"","sources":["../../../src/components/event-detail.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,UAAU,gBAAgB;IACxB,MAAM,EAAE,WAAW,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"event-detail.d.ts","sourceRoot":"","sources":["../../../src/components/event-detail.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,UAAU,gBAAgB;IACxB,MAAM,EAAE,WAAW,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAuRD,eAAO,MAAM,WAAW,GAAI,qDAKzB,gBAAgB,4CAsDlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events-view.d.ts","sourceRoot":"","sources":["../../../src/components/events-view.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE9D,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;AAE5C,UAAU,eAAe;IACvB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9C,WAAW,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACxD;
|
|
1
|
+
{"version":3,"file":"events-view.d.ts","sourceRoot":"","sources":["../../../src/components/events-view.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE9D,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;AAE5C,UAAU,eAAe;IACvB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9C,WAAW,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACxD;AA+OD,eAAO,MAAM,UAAU,GAAI,8HAQxB,eAAe,4CA6IjB,CAAC"}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* State
|
|
2
|
+
* State management for the Watch component.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Uses useReducer for UI navigation and async operations.
|
|
5
|
+
* Brain execution tracking (useBrainMachine) and EventSource connection
|
|
6
6
|
* remain separate concerns.
|
|
7
7
|
*/
|
|
8
|
-
import * as robot3 from 'robot3';
|
|
9
8
|
import type { ViewMode } from './watch-keyboard.js';
|
|
10
9
|
type JsonObject = {
|
|
11
10
|
[key: string]: unknown;
|
|
12
11
|
};
|
|
13
12
|
export type { ViewMode };
|
|
14
13
|
export type PreviousView = 'progress' | 'events';
|
|
15
|
-
export interface
|
|
16
|
-
|
|
14
|
+
export interface WatchState {
|
|
15
|
+
viewMode: ViewMode;
|
|
17
16
|
previousView: PreviousView;
|
|
18
17
|
stateSnapshot: JsonObject | null;
|
|
19
18
|
stateTitle: string;
|
|
@@ -21,151 +20,96 @@ export interface WatchContext {
|
|
|
21
20
|
selectedAgentId: string | null;
|
|
22
21
|
agentChatScrollOffset: number;
|
|
23
22
|
eventsSelectedIndex: number | null;
|
|
23
|
+
killStatus: 'idle' | 'confirming' | 'killing' | 'killed' | 'error';
|
|
24
24
|
killError: Error | null;
|
|
25
|
-
|
|
25
|
+
pauseResumeStatus: 'idle' | 'pausing' | 'resuming';
|
|
26
26
|
pauseResumeMessage: string | null;
|
|
27
27
|
messageText: string;
|
|
28
|
+
messageStatus: 'idle' | 'sending';
|
|
28
29
|
messageFeedback: 'success' | 'error' | null;
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
'
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
'
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
'
|
|
48
|
-
|
|
49
|
-
'
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
'
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
'
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
'
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
'
|
|
66
|
-
|
|
67
|
-
'
|
|
68
|
-
|
|
69
|
-
'
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
31
|
+
export type WatchAction = {
|
|
32
|
+
type: 'GO_TO_PROGRESS';
|
|
33
|
+
} | {
|
|
34
|
+
type: 'GO_TO_EVENTS';
|
|
35
|
+
} | {
|
|
36
|
+
type: 'GO_TO_STATE';
|
|
37
|
+
stateSnapshot: JsonObject;
|
|
38
|
+
stateTitle: string;
|
|
39
|
+
fromView: PreviousView;
|
|
40
|
+
} | {
|
|
41
|
+
type: 'GO_TO_AGENTS';
|
|
42
|
+
selectedAgentId?: string;
|
|
43
|
+
fromView: PreviousView;
|
|
44
|
+
} | {
|
|
45
|
+
type: 'GO_TO_MESSAGE_INPUT';
|
|
46
|
+
fromView: PreviousView;
|
|
47
|
+
} | {
|
|
48
|
+
type: 'GO_BACK';
|
|
49
|
+
} | {
|
|
50
|
+
type: 'SET_STATE_SCROLL_OFFSET';
|
|
51
|
+
offset: number;
|
|
52
|
+
} | {
|
|
53
|
+
type: 'AGENT_SELECTED';
|
|
54
|
+
agentId: string;
|
|
55
|
+
} | {
|
|
56
|
+
type: 'SET_AGENT_CHAT_SCROLL_OFFSET';
|
|
57
|
+
offset: number;
|
|
58
|
+
} | {
|
|
59
|
+
type: 'SET_EVENTS_SELECTED_INDEX';
|
|
60
|
+
index: number | null;
|
|
61
|
+
} | {
|
|
62
|
+
type: 'INITIATE_KILL';
|
|
63
|
+
} | {
|
|
64
|
+
type: 'CONFIRM_KILL';
|
|
65
|
+
} | {
|
|
66
|
+
type: 'CANCEL_KILL';
|
|
67
|
+
} | {
|
|
68
|
+
type: 'KILL_STARTED';
|
|
69
|
+
} | {
|
|
70
|
+
type: 'KILL_SUCCESS';
|
|
71
|
+
} | {
|
|
72
|
+
type: 'KILL_ERROR';
|
|
73
|
+
error: Error;
|
|
74
|
+
} | {
|
|
75
|
+
type: 'PAUSE';
|
|
76
|
+
} | {
|
|
77
|
+
type: 'RESUME';
|
|
78
|
+
} | {
|
|
79
|
+
type: 'PAUSE_STARTED';
|
|
80
|
+
} | {
|
|
81
|
+
type: 'PAUSE_SUCCESS';
|
|
82
|
+
} | {
|
|
83
|
+
type: 'PAUSE_ERROR';
|
|
84
|
+
} | {
|
|
85
|
+
type: 'RESUME_STARTED';
|
|
86
|
+
} | {
|
|
87
|
+
type: 'RESUME_SUCCESS';
|
|
88
|
+
} | {
|
|
89
|
+
type: 'RESUME_ERROR';
|
|
90
|
+
} | {
|
|
91
|
+
type: 'CLEAR_PAUSE_RESUME_MESSAGE';
|
|
92
|
+
} | {
|
|
93
|
+
type: 'SET_MESSAGE_TEXT';
|
|
94
|
+
text: string;
|
|
95
|
+
} | {
|
|
96
|
+
type: 'SEND_MESSAGE';
|
|
97
|
+
} | {
|
|
98
|
+
type: 'SEND_MESSAGE_STARTED';
|
|
99
|
+
} | {
|
|
100
|
+
type: 'MESSAGE_SUCCESS';
|
|
101
|
+
} | {
|
|
102
|
+
type: 'MESSAGE_ERROR';
|
|
103
|
+
} | {
|
|
104
|
+
type: 'CLEAR_FEEDBACK';
|
|
105
|
+
} | {
|
|
106
|
+
type: 'RESET';
|
|
107
|
+
viewMode: ViewMode;
|
|
108
|
+
};
|
|
100
109
|
/**
|
|
101
|
-
* React hook for the watch UI state
|
|
102
|
-
*
|
|
110
|
+
* React hook for the watch UI state.
|
|
111
|
+
* Manages view navigation, async operations (kill/pause/resume/message),
|
|
112
|
+
* and related UI state like scroll offsets and selections.
|
|
103
113
|
*/
|
|
104
|
-
export declare function
|
|
105
|
-
name: robot3.AllStateKeys<{
|
|
106
|
-
progress: robot3.MachineState<string>;
|
|
107
|
-
events: robot3.MachineState<string>;
|
|
108
|
-
state: robot3.MachineState<string>;
|
|
109
|
-
'route-back': robot3.MachineState<string>;
|
|
110
|
-
'route-agents': robot3.MachineState<string>;
|
|
111
|
-
'agent-picker': robot3.MachineState<string>;
|
|
112
|
-
'agent-chat': robot3.MachineState<string>;
|
|
113
|
-
'message-input': robot3.MachineState<string>;
|
|
114
|
-
'sending-message': robot3.MachineState<any>;
|
|
115
|
-
'message-sent': robot3.MachineState<string>;
|
|
116
|
-
'message-error': robot3.MachineState<string>;
|
|
117
|
-
'confirming-kill': robot3.MachineState<string>;
|
|
118
|
-
killing: robot3.MachineState<any>;
|
|
119
|
-
killed: robot3.MachineState<string>;
|
|
120
|
-
'kill-error': robot3.MachineState<string>;
|
|
121
|
-
pausing: robot3.MachineState<any>;
|
|
122
|
-
'pause-sent': robot3.MachineState<string>;
|
|
123
|
-
resuming: robot3.MachineState<any>;
|
|
124
|
-
'resume-sent': robot3.MachineState<string>;
|
|
125
|
-
}>;
|
|
126
|
-
value: robot3.MachineState<string>;
|
|
127
|
-
} & {
|
|
128
|
-
context: WatchContext;
|
|
129
|
-
}, robot3.SendFunction<string>, robot3.Service<robot3.Machine<{
|
|
130
|
-
progress: robot3.MachineState<string>;
|
|
131
|
-
events: robot3.MachineState<string>;
|
|
132
|
-
state: robot3.MachineState<string>;
|
|
133
|
-
'route-back': robot3.MachineState<string>;
|
|
134
|
-
'route-agents': robot3.MachineState<string>;
|
|
135
|
-
'agent-picker': robot3.MachineState<string>;
|
|
136
|
-
'agent-chat': robot3.MachineState<string>;
|
|
137
|
-
'message-input': robot3.MachineState<string>;
|
|
138
|
-
'sending-message': robot3.MachineState<any>;
|
|
139
|
-
'message-sent': robot3.MachineState<string>;
|
|
140
|
-
'message-error': robot3.MachineState<string>;
|
|
141
|
-
'confirming-kill': robot3.MachineState<string>;
|
|
142
|
-
killing: robot3.MachineState<any>;
|
|
143
|
-
killed: robot3.MachineState<string>;
|
|
144
|
-
'kill-error': robot3.MachineState<string>;
|
|
145
|
-
pausing: robot3.MachineState<any>;
|
|
146
|
-
'pause-sent': robot3.MachineState<string>;
|
|
147
|
-
resuming: robot3.MachineState<any>;
|
|
148
|
-
'resume-sent': robot3.MachineState<string>;
|
|
149
|
-
}, WatchContext, robot3.AllStateKeys<{
|
|
150
|
-
progress: robot3.MachineState<string>;
|
|
151
|
-
events: robot3.MachineState<string>;
|
|
152
|
-
state: robot3.MachineState<string>;
|
|
153
|
-
'route-back': robot3.MachineState<string>;
|
|
154
|
-
'route-agents': robot3.MachineState<string>;
|
|
155
|
-
'agent-picker': robot3.MachineState<string>;
|
|
156
|
-
'agent-chat': robot3.MachineState<string>;
|
|
157
|
-
'message-input': robot3.MachineState<string>;
|
|
158
|
-
'sending-message': robot3.MachineState<any>;
|
|
159
|
-
'message-sent': robot3.MachineState<string>;
|
|
160
|
-
'message-error': robot3.MachineState<string>;
|
|
161
|
-
'confirming-kill': robot3.MachineState<string>;
|
|
162
|
-
killing: robot3.MachineState<any>;
|
|
163
|
-
killed: robot3.MachineState<string>;
|
|
164
|
-
'kill-error': robot3.MachineState<string>;
|
|
165
|
-
pausing: robot3.MachineState<any>;
|
|
166
|
-
'pause-sent': robot3.MachineState<string>;
|
|
167
|
-
resuming: robot3.MachineState<any>;
|
|
168
|
-
'resume-sent': robot3.MachineState<string>;
|
|
169
|
-
}>, string>>];
|
|
170
|
-
export { createWatchMachine };
|
|
114
|
+
export declare function useWatchReducer(runId: string, startWithEvents?: boolean): readonly [WatchState, (action: WatchAction) => void];
|
|
171
115
|
//# sourceMappingURL=watch-machine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch-machine.d.ts","sourceRoot":"","sources":["../../../src/components/watch-machine.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"watch-machine.d.ts","sourceRoot":"","sources":["../../../src/components/watch-machine.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../../src/components/watch.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../../src/components/watch.tsx"],"names":[],"mappings":"AA6NA,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,KAAK,GAAI,yDAKnB,UAAU,4CAidZ,CAAC"}
|
|
@@ -11,7 +11,6 @@ export declare function useBrainMachine(key?: unknown, options?: CreateMachineOp
|
|
|
11
11
|
name: import("robot3").AllStateKeys<{
|
|
12
12
|
idle: import("robot3").MachineState<"brain:start">;
|
|
13
13
|
running: import("robot3").MachineState<string>;
|
|
14
|
-
agentLoop: import("robot3").MachineState<string>;
|
|
15
14
|
paused: import("robot3").MachineState<string>;
|
|
16
15
|
waiting: import("robot3").MachineState<string>;
|
|
17
16
|
complete: import("robot3").MachineState<any>;
|
|
@@ -24,7 +23,6 @@ export declare function useBrainMachine(key?: unknown, options?: CreateMachineOp
|
|
|
24
23
|
}, import("robot3").SendFunction<string>, import("robot3").Service<import("robot3").Machine<{
|
|
25
24
|
idle: import("robot3").MachineState<"brain:start">;
|
|
26
25
|
running: import("robot3").MachineState<string>;
|
|
27
|
-
agentLoop: import("robot3").MachineState<string>;
|
|
28
26
|
paused: import("robot3").MachineState<string>;
|
|
29
27
|
waiting: import("robot3").MachineState<string>;
|
|
30
28
|
complete: import("robot3").MachineState<any>;
|
|
@@ -33,7 +31,6 @@ export declare function useBrainMachine(key?: unknown, options?: CreateMachineOp
|
|
|
33
31
|
}, import("@positronic/core").BrainExecutionContext, import("robot3").AllStateKeys<{
|
|
34
32
|
idle: import("robot3").MachineState<"brain:start">;
|
|
35
33
|
running: import("robot3").MachineState<string>;
|
|
36
|
-
agentLoop: import("robot3").MachineState<string>;
|
|
37
34
|
paused: import("robot3").MachineState<string>;
|
|
38
35
|
waiting: import("robot3").MachineState<string>;
|
|
39
36
|
complete: import("robot3").MachineState<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBrainMachine.d.ts","sourceRoot":"","sources":["../../../src/hooks/useBrainMachine.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,oBAAoB
|
|
1
|
+
{"version":3,"file":"useBrainMachine.d.ts","sourceRoot":"","sources":["../../../src/hooks/useBrainMachine.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAI5E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@positronic/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.78",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"clean": "rm -rf tsconfig.tsbuildinfo dist node_modules"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@positronic/core": "^0.0.
|
|
27
|
-
"@positronic/spec": "^0.0.
|
|
28
|
-
"@positronic/template-new-project": "^0.0.
|
|
26
|
+
"@positronic/core": "^0.0.78",
|
|
27
|
+
"@positronic/spec": "^0.0.78",
|
|
28
|
+
"@positronic/template-new-project": "^0.0.78",
|
|
29
29
|
"caz": "^2.0.0",
|
|
30
30
|
"chokidar": "^3.6.0",
|
|
31
31
|
"dotenv": "^16.4.7",
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
function _class_call_check(instance, Constructor) {
|
|
2
|
-
if (!(instance instanceof Constructor)) {
|
|
3
|
-
throw new TypeError("Cannot call a class as a function");
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
function _defineProperties(target, props) {
|
|
7
|
-
for(var i = 0; i < props.length; i++){
|
|
8
|
-
var descriptor = props[i];
|
|
9
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
10
|
-
descriptor.configurable = true;
|
|
11
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
12
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
16
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
17
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
18
|
-
return Constructor;
|
|
19
|
-
}
|
|
20
|
-
function _define_property(obj, key, value) {
|
|
21
|
-
if (key in obj) {
|
|
22
|
-
Object.defineProperty(obj, key, {
|
|
23
|
-
value: value,
|
|
24
|
-
enumerable: true,
|
|
25
|
-
configurable: true,
|
|
26
|
-
writable: true
|
|
27
|
-
});
|
|
28
|
-
} else {
|
|
29
|
-
obj[key] = value;
|
|
30
|
-
}
|
|
31
|
-
return obj;
|
|
32
|
-
}
|
|
33
|
-
import React from 'react';
|
|
34
|
-
import { AuthLogin } from '../components/auth-login.js';
|
|
35
|
-
import { AuthLogout } from '../components/auth-logout.js';
|
|
36
|
-
import { Whoami } from '../components/whoami.js';
|
|
37
|
-
import { ProjectConfigManager } from './project-config-manager.js';
|
|
38
|
-
export var AuthCommand = /*#__PURE__*/ function() {
|
|
39
|
-
"use strict";
|
|
40
|
-
function AuthCommand(configManager, projectRootPath) {
|
|
41
|
-
_class_call_check(this, AuthCommand);
|
|
42
|
-
_define_property(this, "configManager", void 0);
|
|
43
|
-
_define_property(this, "projectRootPath", void 0);
|
|
44
|
-
this.configManager = configManager || new ProjectConfigManager();
|
|
45
|
-
this.projectRootPath = projectRootPath;
|
|
46
|
-
}
|
|
47
|
-
_create_class(AuthCommand, [
|
|
48
|
-
{
|
|
49
|
-
/**
|
|
50
|
-
* Handles the 'px login' command.
|
|
51
|
-
* Configure SSH key for authentication.
|
|
52
|
-
*/ key: "login",
|
|
53
|
-
value: function login(param) {
|
|
54
|
-
var path = param.path, project = param.project;
|
|
55
|
-
return React.createElement(AuthLogin, {
|
|
56
|
-
configManager: this.configManager,
|
|
57
|
-
keyPath: path,
|
|
58
|
-
forProject: project || false,
|
|
59
|
-
projectRootPath: this.projectRootPath
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
/**
|
|
65
|
-
* Handles the 'px logout' command.
|
|
66
|
-
* Clear SSH key configuration.
|
|
67
|
-
*/ key: "logout",
|
|
68
|
-
value: function logout(param) {
|
|
69
|
-
var project = param.project;
|
|
70
|
-
return React.createElement(AuthLogout, {
|
|
71
|
-
configManager: this.configManager,
|
|
72
|
-
forProject: project || false,
|
|
73
|
-
projectRootPath: this.projectRootPath
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
/**
|
|
79
|
-
* Handles the 'px whoami' command.
|
|
80
|
-
* Shows the current authenticated identity.
|
|
81
|
-
*/ key: "whoami",
|
|
82
|
-
value: function whoami() {
|
|
83
|
-
return React.createElement(Whoami, {
|
|
84
|
-
configManager: this.configManager,
|
|
85
|
-
projectRootPath: this.projectRootPath
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
]);
|
|
90
|
-
return AuthCommand;
|
|
91
|
-
}();
|