@positronic/cli 0.0.55 → 0.0.57
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 +142 -2
- package/dist/src/commands/auth.js +98 -0
- package/dist/src/commands/brain.js +3 -2
- package/dist/src/commands/helpers.js +48 -10
- package/dist/src/commands/project-config-manager.js +119 -0
- package/dist/src/commands/users.js +91 -0
- package/dist/src/components/agent-chat-view.js +125 -0
- package/dist/src/components/auth-list.js +56 -0
- package/dist/src/components/auth-login.js +209 -0
- package/dist/src/components/auth-logout.js +75 -0
- package/dist/src/components/auth-status.js +88 -0
- package/dist/src/components/brain-run.js +287 -254
- package/dist/src/components/brain-top-table.js +4 -0
- package/dist/src/components/event-detail.js +364 -0
- package/dist/src/components/events-view.js +379 -0
- package/dist/src/components/state-view.js +52 -0
- package/dist/src/components/top-navigator.js +80 -6
- package/dist/src/components/types.js +1 -0
- package/dist/src/components/users-create.js +293 -0
- package/dist/src/components/users-delete.js +294 -0
- package/dist/src/components/users-keys-add.js +156 -0
- package/dist/src/components/users-keys-list.js +119 -0
- package/dist/src/components/users-keys-remove.js +299 -0
- package/dist/src/components/users-list.js +109 -0
- package/dist/src/components/watch-keyboard.js +136 -0
- package/dist/src/components/watch-machine.js +573 -0
- package/dist/src/components/watch-resolver.js +3 -2
- package/dist/src/components/watch.js +390 -36
- package/dist/src/hooks/useApi.js +80 -42
- package/dist/src/lib/request-signer.js +208 -0
- package/dist/src/lib/ssh-key-utils.js +212 -0
- package/dist/src/utils/agent-utils.js +107 -0
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/commands/auth.d.ts +36 -0
- package/dist/types/commands/auth.d.ts.map +1 -0
- package/dist/types/commands/brain.d.ts +2 -1
- package/dist/types/commands/brain.d.ts.map +1 -1
- package/dist/types/commands/helpers.d.ts.map +1 -1
- package/dist/types/commands/project-config-manager.d.ts +43 -0
- package/dist/types/commands/project-config-manager.d.ts.map +1 -1
- package/dist/types/commands/users.d.ts +33 -0
- package/dist/types/commands/users.d.ts.map +1 -0
- package/dist/types/components/agent-chat-view.d.ts +12 -0
- package/dist/types/components/agent-chat-view.d.ts.map +1 -0
- package/dist/types/components/auth-list.d.ts +7 -0
- package/dist/types/components/auth-list.d.ts.map +1 -0
- package/dist/types/components/auth-login.d.ts +9 -0
- package/dist/types/components/auth-login.d.ts.map +1 -0
- package/dist/types/components/auth-logout.d.ts +8 -0
- package/dist/types/components/auth-logout.d.ts.map +1 -0
- package/dist/types/components/auth-status.d.ts +7 -0
- package/dist/types/components/auth-status.d.ts.map +1 -0
- package/dist/types/components/brain-run.d.ts +11 -1
- package/dist/types/components/brain-run.d.ts.map +1 -1
- package/dist/types/components/brain-top-table.d.ts.map +1 -1
- package/dist/types/components/event-detail.d.ts +10 -0
- package/dist/types/components/event-detail.d.ts.map +1 -0
- package/dist/types/components/events-view.d.ts +13 -0
- package/dist/types/components/events-view.d.ts.map +1 -0
- package/dist/types/components/state-view.d.ts +13 -0
- package/dist/types/components/state-view.d.ts.map +1 -0
- package/dist/types/components/top-navigator.d.ts.map +1 -1
- package/dist/types/components/types.d.ts +11 -0
- package/dist/types/components/types.d.ts.map +1 -0
- package/dist/types/components/users-create.d.ts +6 -0
- package/dist/types/components/users-create.d.ts.map +1 -0
- package/dist/types/components/users-delete.d.ts +7 -0
- package/dist/types/components/users-delete.d.ts.map +1 -0
- package/dist/types/components/users-keys-add.d.ts +8 -0
- package/dist/types/components/users-keys-add.d.ts.map +1 -0
- package/dist/types/components/users-keys-list.d.ts +6 -0
- package/dist/types/components/users-keys-list.d.ts.map +1 -0
- package/dist/types/components/users-keys-remove.d.ts +8 -0
- package/dist/types/components/users-keys-remove.d.ts.map +1 -0
- package/dist/types/components/users-list.d.ts +2 -0
- package/dist/types/components/users-list.d.ts.map +1 -0
- package/dist/types/components/watch-keyboard.d.ts +56 -0
- package/dist/types/components/watch-keyboard.d.ts.map +1 -0
- package/dist/types/components/watch-machine.d.ts +171 -0
- package/dist/types/components/watch-machine.d.ts.map +1 -0
- package/dist/types/components/watch-resolver.d.ts +2 -1
- package/dist/types/components/watch-resolver.d.ts.map +1 -1
- package/dist/types/components/watch.d.ts +2 -1
- package/dist/types/components/watch.d.ts.map +1 -1
- package/dist/types/hooks/useApi.d.ts.map +1 -1
- package/dist/types/hooks/useBrainMachine.d.ts +9 -3
- package/dist/types/hooks/useBrainMachine.d.ts.map +1 -1
- package/dist/types/lib/request-signer.d.ts +51 -0
- package/dist/types/lib/request-signer.d.ts.map +1 -0
- package/dist/types/lib/ssh-key-utils.d.ts +45 -0
- package/dist/types/lib/ssh-key-utils.d.ts.map +1 -0
- package/dist/types/utils/agent-utils.d.ts +20 -0
- package/dist/types/utils/agent-utils.d.ts.map +1 -0
- package/package.json +7 -4
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* State machine for the Watch component.
|
|
3
|
+
*
|
|
4
|
+
* This machine handles UI navigation and async operations for the watch view.
|
|
5
|
+
* The brain execution tracking (useBrainMachine) and EventSource connection
|
|
6
|
+
* remain separate concerns.
|
|
7
|
+
*/
|
|
8
|
+
import * as robot3 from 'robot3';
|
|
9
|
+
import type { ViewMode } from './watch-keyboard.js';
|
|
10
|
+
type JsonObject = {
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
};
|
|
13
|
+
export type { ViewMode };
|
|
14
|
+
export type PreviousView = 'progress' | 'events';
|
|
15
|
+
export interface WatchContext {
|
|
16
|
+
runId: string;
|
|
17
|
+
previousView: PreviousView;
|
|
18
|
+
stateSnapshot: JsonObject | null;
|
|
19
|
+
stateTitle: string;
|
|
20
|
+
stateScrollOffset: number;
|
|
21
|
+
selectedAgentId: string | null;
|
|
22
|
+
agentChatScrollOffset: number;
|
|
23
|
+
eventsSelectedIndex: number | null;
|
|
24
|
+
killError: Error | null;
|
|
25
|
+
isKilled: boolean;
|
|
26
|
+
pauseResumeMessage: string | null;
|
|
27
|
+
messageText: string;
|
|
28
|
+
messageFeedback: 'success' | 'error' | null;
|
|
29
|
+
}
|
|
30
|
+
declare const createWatchMachine: (runId: string, startWithEvents?: boolean) => robot3.Machine<{
|
|
31
|
+
progress: robot3.MachineState<string>;
|
|
32
|
+
events: robot3.MachineState<string>;
|
|
33
|
+
state: robot3.MachineState<string>;
|
|
34
|
+
'route-back': robot3.MachineState<string>;
|
|
35
|
+
'route-agents': robot3.MachineState<string>;
|
|
36
|
+
'agent-picker': robot3.MachineState<string>;
|
|
37
|
+
'agent-chat': robot3.MachineState<string>;
|
|
38
|
+
'message-input': robot3.MachineState<string>;
|
|
39
|
+
'sending-message': robot3.MachineState<any>;
|
|
40
|
+
'message-sent': robot3.MachineState<string>;
|
|
41
|
+
'message-error': robot3.MachineState<string>;
|
|
42
|
+
'confirming-kill': robot3.MachineState<string>;
|
|
43
|
+
killing: robot3.MachineState<any>;
|
|
44
|
+
killed: robot3.MachineState<string>;
|
|
45
|
+
'kill-error': robot3.MachineState<string>;
|
|
46
|
+
pausing: robot3.MachineState<any>;
|
|
47
|
+
'pause-sent': robot3.MachineState<string>;
|
|
48
|
+
resuming: robot3.MachineState<any>;
|
|
49
|
+
'resume-sent': robot3.MachineState<string>;
|
|
50
|
+
}, WatchContext, robot3.AllStateKeys<{
|
|
51
|
+
progress: robot3.MachineState<string>;
|
|
52
|
+
events: robot3.MachineState<string>;
|
|
53
|
+
state: robot3.MachineState<string>;
|
|
54
|
+
'route-back': robot3.MachineState<string>;
|
|
55
|
+
'route-agents': robot3.MachineState<string>;
|
|
56
|
+
'agent-picker': robot3.MachineState<string>;
|
|
57
|
+
'agent-chat': robot3.MachineState<string>;
|
|
58
|
+
'message-input': robot3.MachineState<string>;
|
|
59
|
+
'sending-message': robot3.MachineState<any>;
|
|
60
|
+
'message-sent': robot3.MachineState<string>;
|
|
61
|
+
'message-error': robot3.MachineState<string>;
|
|
62
|
+
'confirming-kill': robot3.MachineState<string>;
|
|
63
|
+
killing: robot3.MachineState<any>;
|
|
64
|
+
killed: robot3.MachineState<string>;
|
|
65
|
+
'kill-error': robot3.MachineState<string>;
|
|
66
|
+
pausing: robot3.MachineState<any>;
|
|
67
|
+
'pause-sent': robot3.MachineState<string>;
|
|
68
|
+
resuming: robot3.MachineState<any>;
|
|
69
|
+
'resume-sent': robot3.MachineState<string>;
|
|
70
|
+
}>, string>;
|
|
71
|
+
/**
|
|
72
|
+
* Map machine state name to ViewMode for rendering.
|
|
73
|
+
* The machine has routing/async states that need to be mapped to display views.
|
|
74
|
+
*/
|
|
75
|
+
export declare function machineStateToViewMode(stateName: string): ViewMode;
|
|
76
|
+
/**
|
|
77
|
+
* Check if the machine is in a "confirming kill" state.
|
|
78
|
+
*/
|
|
79
|
+
export declare function isConfirmingKill(stateName: string): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Check if the machine is in a "killing" state.
|
|
82
|
+
*/
|
|
83
|
+
export declare function isKillingState(stateName: string): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Check if the machine is in a "killed" state.
|
|
86
|
+
*/
|
|
87
|
+
export declare function isKilledState(stateName: string): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Check if the machine is in a "pausing" state.
|
|
90
|
+
*/
|
|
91
|
+
export declare function isPausingState(stateName: string): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Check if the machine is in a "resuming" state.
|
|
94
|
+
*/
|
|
95
|
+
export declare function isResumingState(stateName: string): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Check if the machine is in a "sending message" state.
|
|
98
|
+
*/
|
|
99
|
+
export declare function isSendingMessageState(stateName: string): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* React hook for the watch UI state machine.
|
|
102
|
+
* Creates a fresh machine when runId changes.
|
|
103
|
+
*/
|
|
104
|
+
export declare function useWatchMachine(runId: string, startWithEvents?: boolean): [{
|
|
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 };
|
|
171
|
+
//# sourceMappingURL=watch-machine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch-machine.d.ts","sourceRoot":"","sources":["../../../src/components/watch-machine.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAGjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAKpD,KAAK,UAAU,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAG7C,YAAY,EAAE,QAAQ,EAAE,CAAC;AAEzB,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,QAAQ,CAAC;AAGjD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,YAAY,CAAC;IAE3B,aAAa,EAAE,UAAU,GAAG,IAAI,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAE1B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,qBAAqB,EAAE,MAAM,CAAC;IAE9B,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC,SAAS,EAAE,KAAK,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;IAElB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAElC,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,SAAS,GAAG,OAAO,GAAG,IAAI,CAAC;CAC7C;AAsOD,QAAA,MAAM,kBAAkB,GAAI,OAAO,MAAM,EAAE,yBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAmJ/D,CAAC;AAMJ;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,CAgClE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEhE;AAMD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,eAAe,UAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAMrE;AAGD,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
interface WatchResolverProps {
|
|
2
2
|
identifier: string;
|
|
3
|
+
startWithEvents?: boolean;
|
|
3
4
|
}
|
|
4
5
|
/**
|
|
5
6
|
* WatchResolver - Resolves an identifier to either a brain name or run ID and starts watching.
|
|
@@ -10,6 +11,6 @@ interface WatchResolverProps {
|
|
|
10
11
|
* 2. If no brain matches, try as a run ID
|
|
11
12
|
* 3. If neither works, show an error
|
|
12
13
|
*/
|
|
13
|
-
export declare const WatchResolver: ({ identifier }: WatchResolverProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
14
|
+
export declare const WatchResolver: ({ identifier, startWithEvents }: WatchResolverProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
14
15
|
export {};
|
|
15
16
|
//# sourceMappingURL=watch-resolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch-resolver.d.ts","sourceRoot":"","sources":["../../../src/components/watch-resolver.tsx"],"names":[],"mappings":"AAmRA,UAAU,kBAAkB;IAC1B,UAAU,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"watch-resolver.d.ts","sourceRoot":"","sources":["../../../src/components/watch-resolver.tsx"],"names":[],"mappings":"AAmRA,UAAU,kBAAkB;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,GAAI,iCAAiC,kBAAkB,mDA4FhF,CAAC"}
|
|
@@ -2,7 +2,8 @@ interface WatchProps {
|
|
|
2
2
|
runId: string;
|
|
3
3
|
manageScreenBuffer?: boolean;
|
|
4
4
|
footer?: string;
|
|
5
|
+
startWithEvents?: boolean;
|
|
5
6
|
}
|
|
6
|
-
export declare const Watch: ({ runId, manageScreenBuffer, footer }: WatchProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const Watch: ({ runId, manageScreenBuffer, footer, startWithEvents }: WatchProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|
|
8
9
|
//# sourceMappingURL=watch.d.ts.map
|
|
@@ -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":"AAgMA,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,wDAAuE,UAAU,4CAketG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useApi.d.ts","sourceRoot":"","sources":["../../../src/hooks/useApi.ts"],"names":[],"mappings":"AAmBA,wBAAgB,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;;;;eAIjD,MAAM;iBACJ,MAAM;kBACL,MAAM;;
|
|
1
|
+
{"version":3,"file":"useApi.d.ts","sourceRoot":"","sources":["../../../src/hooks/useApi.ts"],"names":[],"mappings":"AAmBA,wBAAgB,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;;;;eAIjD,MAAM;iBACJ,MAAM;kBACL,MAAM;;EAoDnB;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,GAAG;;;;eAIzD,MAAM;iBACJ,MAAM;kBACL,MAAM;;qBAIF,GAAG,YAAY,GAAG;EA8DnC;AAED,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM;;;eAGtC,MAAM;iBACJ,MAAM;kBACL,MAAM;;wBAIC,MAAM,YAAY,GAAG;EA0DzC"}
|
|
@@ -9,9 +9,11 @@ import type { CreateMachineOptions } from '@positronic/core';
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function useBrainMachine(key?: unknown, options?: CreateMachineOptions): [{
|
|
11
11
|
name: import("robot3").AllStateKeys<{
|
|
12
|
-
idle: import("robot3").MachineState<
|
|
12
|
+
idle: import("robot3").MachineState<"brain:start">;
|
|
13
13
|
running: import("robot3").MachineState<string>;
|
|
14
|
+
agentLoop: import("robot3").MachineState<string>;
|
|
14
15
|
paused: import("robot3").MachineState<string>;
|
|
16
|
+
waiting: import("robot3").MachineState<string>;
|
|
15
17
|
complete: import("robot3").MachineState<any>;
|
|
16
18
|
error: import("robot3").MachineState<string>;
|
|
17
19
|
cancelled: import("robot3").MachineState<any>;
|
|
@@ -20,16 +22,20 @@ export declare function useBrainMachine(key?: unknown, options?: CreateMachineOp
|
|
|
20
22
|
} & {
|
|
21
23
|
context: import("@positronic/core").BrainExecutionContext;
|
|
22
24
|
}, import("robot3").SendFunction<string>, import("robot3").Service<import("robot3").Machine<{
|
|
23
|
-
idle: import("robot3").MachineState<
|
|
25
|
+
idle: import("robot3").MachineState<"brain:start">;
|
|
24
26
|
running: import("robot3").MachineState<string>;
|
|
27
|
+
agentLoop: import("robot3").MachineState<string>;
|
|
25
28
|
paused: import("robot3").MachineState<string>;
|
|
29
|
+
waiting: import("robot3").MachineState<string>;
|
|
26
30
|
complete: import("robot3").MachineState<any>;
|
|
27
31
|
error: import("robot3").MachineState<string>;
|
|
28
32
|
cancelled: import("robot3").MachineState<any>;
|
|
29
33
|
}, import("@positronic/core").BrainExecutionContext, import("robot3").AllStateKeys<{
|
|
30
|
-
idle: import("robot3").MachineState<
|
|
34
|
+
idle: import("robot3").MachineState<"brain:start">;
|
|
31
35
|
running: import("robot3").MachineState<string>;
|
|
36
|
+
agentLoop: import("robot3").MachineState<string>;
|
|
32
37
|
paused: import("robot3").MachineState<string>;
|
|
38
|
+
waiting: import("robot3").MachineState<string>;
|
|
33
39
|
complete: import("robot3").MachineState<any>;
|
|
34
40
|
error: import("robot3").MachineState<string>;
|
|
35
41
|
cancelled: 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"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export type SignedHeaders = {
|
|
2
|
+
Signature: string;
|
|
3
|
+
'Signature-Input': string;
|
|
4
|
+
[key: string]: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Request signer for RFC 9421 HTTP Message Signatures
|
|
8
|
+
*/
|
|
9
|
+
export declare class RequestSigner {
|
|
10
|
+
private privateKey;
|
|
11
|
+
private fingerprint;
|
|
12
|
+
private initialized;
|
|
13
|
+
private initError;
|
|
14
|
+
constructor();
|
|
15
|
+
private initialize;
|
|
16
|
+
/**
|
|
17
|
+
* Check if the signer is ready to sign requests
|
|
18
|
+
*/
|
|
19
|
+
isReady(): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Get the error that occurred during initialization, if any
|
|
22
|
+
*/
|
|
23
|
+
getError(): Error | null;
|
|
24
|
+
/**
|
|
25
|
+
* Get the fingerprint of the loaded private key
|
|
26
|
+
*/
|
|
27
|
+
getFingerprint(): string | null;
|
|
28
|
+
/**
|
|
29
|
+
* Sign an HTTP request and return the signature headers
|
|
30
|
+
*/
|
|
31
|
+
signRequest(method: string, url: string, headers?: Record<string, string>): SignedHeaders;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get the singleton request signer instance
|
|
35
|
+
*/
|
|
36
|
+
export declare function getRequestSigner(): RequestSigner;
|
|
37
|
+
/**
|
|
38
|
+
* Reset the request signer singleton
|
|
39
|
+
* Call this after auth config changes to force reinitialization with new key
|
|
40
|
+
*/
|
|
41
|
+
export declare function resetRequestSigner(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Check if request signing is available
|
|
44
|
+
*/
|
|
45
|
+
export declare function isSigningAvailable(): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Sign an HTTP request if signing is available
|
|
48
|
+
* Returns the additional headers to add, or empty object if signing is not available
|
|
49
|
+
*/
|
|
50
|
+
export declare function maybeSignRequest(method: string, url: string, headers?: Record<string, string>): Record<string, string>;
|
|
51
|
+
//# sourceMappingURL=request-signer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-signer.d.ts","sourceRoot":"","sources":["../../../src/lib/request-signer.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,UAAU,CAAiC;IACnD,OAAO,CAAC,WAAW,CAAuB;IAC1C,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,SAAS,CAAsB;;IAMvC,OAAO,CAAC,UAAU;IA0BlB;;OAEG;IACH,OAAO,IAAI,OAAO;IAIlB;;OAEG;IACH,QAAQ,IAAI,KAAK,GAAG,IAAI;IAIxB;;OAEG;IACH,cAAc,IAAI,MAAM,GAAG,IAAI;IAI/B;;OAEG;IACH,WAAW,CACT,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GACnC,aAAa;CAuDjB;AAKD;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,CAKhD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GACnC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAYxB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import sshpk from 'sshpk';
|
|
2
|
+
import { JsonWebKey } from 'crypto';
|
|
3
|
+
export interface SSHKeyInfo {
|
|
4
|
+
jwk: JsonWebKey;
|
|
5
|
+
fingerprint: string;
|
|
6
|
+
algorithm: string;
|
|
7
|
+
}
|
|
8
|
+
export interface DiscoveredKey {
|
|
9
|
+
path: string;
|
|
10
|
+
fingerprint: string;
|
|
11
|
+
algorithm: string;
|
|
12
|
+
comment?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Discover available SSH keys in the ~/.ssh directory
|
|
16
|
+
* Scans for common key files and returns metadata about each key
|
|
17
|
+
*/
|
|
18
|
+
export declare function discoverSSHKeys(): DiscoveredKey[];
|
|
19
|
+
/**
|
|
20
|
+
* Convert an SSH public key file to JWK format
|
|
21
|
+
* Uses sshpk for SSH parsing and Node.js crypto for PEM → JWK conversion
|
|
22
|
+
*/
|
|
23
|
+
export declare function convertSSHPubKeyToJWK(pubKeyPath: string): SSHKeyInfo;
|
|
24
|
+
/**
|
|
25
|
+
* Load an SSH private key from a file path or environment variable
|
|
26
|
+
*/
|
|
27
|
+
export declare function loadPrivateKey(pathOrEnv?: string): sshpk.PrivateKey;
|
|
28
|
+
/**
|
|
29
|
+
* Get the fingerprint of a private key (from its public component)
|
|
30
|
+
*/
|
|
31
|
+
export declare function getPrivateKeyFingerprint(privateKey: sshpk.PrivateKey): string;
|
|
32
|
+
/**
|
|
33
|
+
* Sign data with an SSH private key
|
|
34
|
+
*/
|
|
35
|
+
export declare function signWithPrivateKey(privateKey: sshpk.PrivateKey, data: Buffer | string): Buffer;
|
|
36
|
+
/**
|
|
37
|
+
* Resolve the private key path from environment, config, or default
|
|
38
|
+
* @param configuredPath - Optional configured path from ProjectConfigManager
|
|
39
|
+
*/
|
|
40
|
+
export declare function resolvePrivateKeyPath(configuredPath?: string | null): string;
|
|
41
|
+
/**
|
|
42
|
+
* Expand a path that may contain ~ to the full path
|
|
43
|
+
*/
|
|
44
|
+
export declare function expandPath(keyPath: string): string;
|
|
45
|
+
//# sourceMappingURL=ssh-key-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssh-key-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/ssh-key-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAmB,UAAU,EAAE,MAAM,QAAQ,CAAC;AAErD,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,UAAU,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,aAAa,EAAE,CAkDjD;AA0CD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,CAiBpE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,UAAU,CAyBnE;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,GAAG,MAAM,CAG7E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,KAAK,CAAC,UAAU,EAC5B,IAAI,EAAE,MAAM,GAAG,MAAM,GACpB,MAAM,CAMR;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAoB5E;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKlD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AgentStartEvent, AgentRawResponseMessageEvent } from '@positronic/core';
|
|
2
|
+
import type { StoredEvent } from '../components/events-view.js';
|
|
3
|
+
export interface AgentLoopInfo {
|
|
4
|
+
stepId: string;
|
|
5
|
+
stepTitle: string;
|
|
6
|
+
label: string;
|
|
7
|
+
startEvent: AgentStartEvent;
|
|
8
|
+
rawResponseEvents: AgentRawResponseMessageEvent[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Get display label for an agent.
|
|
12
|
+
* If stepTitle is 'main' (brain-level agent), use brainTitle instead.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getAgentLabel(stepTitle: string, brainTitle?: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Extract all unique agent loops from events.
|
|
17
|
+
* Groups by stepId to handle multiple agents.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getAgentLoops(events: StoredEvent[], brainTitle?: string): AgentLoopInfo[];
|
|
20
|
+
//# sourceMappingURL=agent-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-utils.d.ts","sourceRoot":"","sources":["../../../src/utils/agent-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,eAAe,EACf,4BAA4B,EAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAEhE,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,eAAe,CAAC;IAC5B,iBAAiB,EAAE,4BAA4B,EAAE,CAAC;CACnD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAK5E;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,WAAW,EAAE,EACrB,UAAU,CAAC,EAAE,MAAM,GAClB,aAAa,EAAE,CAqCjB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@positronic/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.57",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -23,22 +23,25 @@
|
|
|
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.57",
|
|
27
|
+
"@positronic/spec": "^0.0.57",
|
|
28
|
+
"@positronic/template-new-project": "^0.0.57",
|
|
29
29
|
"caz": "^2.0.0",
|
|
30
30
|
"chokidar": "^3.6.0",
|
|
31
31
|
"dotenv": "^16.4.7",
|
|
32
32
|
"eventsource": "^3.0.6",
|
|
33
33
|
"ink": "^5.2.1",
|
|
34
|
+
"ink-text-input": "^6.0.0",
|
|
34
35
|
"istextorbinary": "^9.5.0",
|
|
35
36
|
"node-fetch": "^3.3.2",
|
|
36
37
|
"react": "^18.3.1",
|
|
37
38
|
"react-robot": "^1.2.1",
|
|
39
|
+
"sshpk": "^1.18.0",
|
|
38
40
|
"yargs": "^17.7.2"
|
|
39
41
|
},
|
|
40
42
|
"devDependencies": {
|
|
41
43
|
"@types/react": "^19.1.3",
|
|
44
|
+
"@types/sshpk": "^1.17.4",
|
|
42
45
|
"@types/yargs": "^17.0.33",
|
|
43
46
|
"fuse.js": "^7.1.0",
|
|
44
47
|
"ink-testing-library": "^4.0.0",
|