@openagt/dashboard 0.27.0 → 0.29.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/dist/daemon-runtime.d.ts +4 -1
- package/dist/daemon-runtime.d.ts.map +1 -1
- package/dist/daemon-runtime.js +13 -1
- package/dist/daemon-runtime.js.map +1 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +7 -2
- package/dist/daemon.js.map +1 -1
- package/dist/dashboard/copy-logins.d.ts +48 -0
- package/dist/dashboard/copy-logins.d.ts.map +1 -0
- package/dist/dashboard/copy-logins.js +113 -0
- package/dist/dashboard/copy-logins.js.map +1 -0
- package/dist/dashboard/machine-logins.d.ts +58 -0
- package/dist/dashboard/machine-logins.d.ts.map +1 -0
- package/dist/dashboard/machine-logins.js +60 -0
- package/dist/dashboard/machine-logins.js.map +1 -0
- package/dist/dashboard/relay-endpoints.d.ts +15 -0
- package/dist/dashboard/relay-endpoints.d.ts.map +1 -1
- package/dist/dashboard/relay-endpoints.js +36 -0
- package/dist/dashboard/relay-endpoints.js.map +1 -1
- package/dist/dashboard/remote-run.d.ts +54 -0
- package/dist/dashboard/remote-run.d.ts.map +1 -1
- package/dist/dashboard/remote-run.js +96 -3
- package/dist/dashboard/remote-run.js.map +1 -1
- package/dist/dashboard/server.d.ts +2 -0
- package/dist/dashboard/server.d.ts.map +1 -1
- package/dist/dashboard/server.js +1 -1
- package/dist/dashboard/server.js.map +1 -1
- package/dist/dashboard-bundle/assets/main-BenA3DC-.js +145 -0
- package/dist/dashboard-bundle/assets/module-CZzF8pLL.js +14 -0
- package/dist/dashboard-bundle/host/module.js +1 -1
- package/dist/dashboard-bundle/index.html +2 -2
- package/dist/dashboard-rpc/index.d.ts +2 -2
- package/dist/dashboard-rpc/index.d.ts.map +1 -1
- package/dist/dashboard-rpc/index.js +2 -2
- package/dist/dashboard-rpc/index.js.map +1 -1
- package/dist/dashboard-rpc/machines.d.ts +65 -1
- package/dist/dashboard-rpc/machines.d.ts.map +1 -1
- package/dist/dashboard-rpc/machines.js +80 -10
- package/dist/dashboard-rpc/machines.js.map +1 -1
- package/dist/dashboard-rpc/modules.d.ts +14 -2
- package/dist/dashboard-rpc/modules.d.ts.map +1 -1
- package/dist/dashboard-rpc/modules.js +29 -4
- package/dist/dashboard-rpc/modules.js.map +1 -1
- package/dist/module-types/dashboard/lib/machines.d.ts +2 -0
- package/dist/module-types/dashboard/module/index.d.ts +28 -1
- package/dist/module-types/dashboard/rpc/machines.d.ts +7 -1
- package/dist/module-types/dashboard/rpc/modules.d.ts +2 -1
- package/dist/module-types/src/dashboard/machine-logins.d.ts +57 -0
- package/dist/module-types/src/dashboard/remote-run.d.ts +54 -0
- package/dist/module-types/src/dashboard-rpc/index.d.ts +2 -2
- package/dist/module-types/src/dashboard-rpc/machines.d.ts +65 -1
- package/dist/module-types/src/dashboard-rpc/modules.d.ts +14 -2
- package/dist/module-types/src/package-services.d.ts +6 -0
- package/dist/module-types/src/project-modules.d.ts +3 -1
- package/dist/module-types/src/registry.d.ts +13 -0
- package/dist/package-services.d.ts +6 -0
- package/dist/package-services.d.ts.map +1 -1
- package/dist/package-services.js +12 -1
- package/dist/package-services.js.map +1 -1
- package/dist/project-modules.d.ts +3 -1
- package/dist/project-modules.d.ts.map +1 -1
- package/dist/project-modules.js +4 -2
- package/dist/project-modules.js.map +1 -1
- package/dist/registry.d.ts +13 -0
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +20 -2
- package/dist/registry.js.map +1 -1
- package/package.json +13 -13
- package/dist/dashboard-bundle/assets/main-BCocp_Pu.js +0 -145
- package/dist/dashboard-bundle/assets/module-0fGWuh14.js +0 -14
|
@@ -2,5 +2,6 @@ import type * as impl from '../../src/dashboard-rpc/modules.js';
|
|
|
2
2
|
export type * from '../../src/dashboard-rpc/modules.js';
|
|
3
3
|
export declare const onModules: () => Promise<impl.DashboardModule[]>;
|
|
4
4
|
export declare const runModuleCommand: (projectId: string, pkg: string, args: string[], command?: string | undefined, acts?: boolean | undefined) => Promise<import("@openagt/agent-data").PackageCommandResult>;
|
|
5
|
-
export declare const runComputerCommand: (pkg: string, args: string[], command?: string | undefined) => Promise<import("@openagt/agent-data").PackageCommandResult>;
|
|
5
|
+
export declare const runComputerCommand: (pkg: string, args: string[], command?: string | null | undefined, input?: string | null | undefined) => Promise<import("@openagt/agent-data").PackageCommandResult>;
|
|
6
|
+
export declare const runComputerCommandOn: (pkg: string, machineId: string, args: string[], command?: string | null | undefined, input?: string | null | undefined) => Promise<import("@openagt/agent-data").PackageCommandResult>;
|
|
6
7
|
export declare const readModule: (projectId: string, pkg: string, name: string, input: unknown) => Promise<impl.ModuleReadResult>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A person's logins on another person's computer (#2140). That computer gives each person who
|
|
3
|
+
* starts a run on it a user and an OpenAgent of their own, and a run there uses that person's own
|
|
4
|
+
* GitHub and Claude logins. They reach it as copies: the person's own OpenAgent on the server
|
|
5
|
+
* both computers are in at copies its logins there, the first time it starts a run there. A
|
|
6
|
+
* person may make a login of their own there instead, and a copy never takes its place.
|
|
7
|
+
*
|
|
8
|
+
* What a computer says of a login there is only whose it is, where it came from and a mark of it:
|
|
9
|
+
* the start of its SHA-256, by which the copier tells whether the copy is still its own login.
|
|
10
|
+
* The login itself is never said. The marks are the servers package's (`own.ts`), made the same way.
|
|
11
|
+
*/
|
|
12
|
+
/** One login there, as that computer says it. */
|
|
13
|
+
export interface LoginThere {
|
|
14
|
+
/** GitHub: the account. */
|
|
15
|
+
account?: string;
|
|
16
|
+
/** A copy from the person's own OpenAgent on a server, or one the person made there. */
|
|
17
|
+
source: 'copied' | 'made';
|
|
18
|
+
/** For a copy: the server it came from. */
|
|
19
|
+
from?: string;
|
|
20
|
+
mark?: string;
|
|
21
|
+
}
|
|
22
|
+
/** The person's logins on that computer: each one it has. */
|
|
23
|
+
export interface MachineLogins {
|
|
24
|
+
github?: LoginThere;
|
|
25
|
+
claude?: LoginThere;
|
|
26
|
+
}
|
|
27
|
+
/** Logins handed to that computer: each as its own word, with the server they are copies from, when they are. */
|
|
28
|
+
export interface GivenLogins {
|
|
29
|
+
github?: string;
|
|
30
|
+
claude?: string;
|
|
31
|
+
from?: string;
|
|
32
|
+
}
|
|
33
|
+
export declare const isMark: (value: unknown) => value is string;
|
|
34
|
+
/** A server's name as a copied login says where it came from: its host or its address. */
|
|
35
|
+
export declare const isServerName: (value: unknown) => value is string;
|
|
36
|
+
/** A login as it is handed over: letters, digits and the few marks a token is written with, nothing a line could break on. */
|
|
37
|
+
export declare const isLoginWord: (value: unknown) => value is string;
|
|
38
|
+
/** A login's mark: the start of its SHA-256. */
|
|
39
|
+
export declare function markOf(login: string): string;
|
|
40
|
+
/** What another computer said of the logins there, as far as it reads as such: it is another computer's data. */
|
|
41
|
+
export declare function readLogins(value: unknown): MachineLogins;
|
|
42
|
+
/**
|
|
43
|
+
* The servers package's `own` answer of a person's own OpenAgent, as that computer says it: each
|
|
44
|
+
* login that is there, a copy when it names the server it came from.
|
|
45
|
+
*/
|
|
46
|
+
export declare function loginsOfOwn(said: unknown): MachineLogins;
|
|
47
|
+
/**
|
|
48
|
+
* Which of this OpenAgent's own logins go to that computer: one it has none of, and one it has a
|
|
49
|
+
* copy of that is no longer this one. Never one the person made there.
|
|
50
|
+
*/
|
|
51
|
+
export declare function loginsToCopy(own: {
|
|
52
|
+
github?: string;
|
|
53
|
+
claude?: string;
|
|
54
|
+
}, there: MachineLogins): {
|
|
55
|
+
github?: string;
|
|
56
|
+
claude?: string;
|
|
57
|
+
};
|
|
@@ -2,6 +2,7 @@ import { EventStream } from '../event-stream.js';
|
|
|
2
2
|
import type { OpenAgentEvent } from '../events.js';
|
|
3
3
|
import type { AgentMeta } from '../store/index.js';
|
|
4
4
|
import type { StartAgentOptions, StartAgentResult } from './types.js';
|
|
5
|
+
import { type GivenLogins, type MachineLogins } from './machine-logins.js';
|
|
5
6
|
/**
|
|
6
7
|
* The server-side half of "run on a saved machine" (#1067). The local daemon holds this computer's
|
|
7
8
|
* key on the saved machine, so it - not the browser - drives the remote daemon: it POSTs the agent to the
|
|
@@ -99,6 +100,8 @@ export interface ComputerOnServer {
|
|
|
99
100
|
name: string;
|
|
100
101
|
/** Its line is open right now. */
|
|
101
102
|
online: boolean;
|
|
103
|
+
/** Whose computer it is, when it is another person's that keeps its line there for everyone: their GitHub account. */
|
|
104
|
+
owner?: string;
|
|
102
105
|
}
|
|
103
106
|
/** The computers that keep a line open to a server this computer is in at, or why they could not be asked. */
|
|
104
107
|
export declare function remoteComputers(machine: MachineAccess): Promise<{
|
|
@@ -230,3 +233,54 @@ export declare class RelayedAgents {
|
|
|
230
233
|
* diary yields: the agent's session id, its cost, its end.
|
|
231
234
|
*/
|
|
232
235
|
export declare function foldRelayedEvent(meta: AgentMeta, event: OpenAgentEvent, at: string): AgentMeta;
|
|
236
|
+
/**
|
|
237
|
+
* Run one of a computer package's own commands on a machine, as that machine's own page runs it:
|
|
238
|
+
* a module on this computer reads and changes what the same package keeps over there. `input` is
|
|
239
|
+
* what the command reads on standard input there; it travels in the call's body, never in an
|
|
240
|
+
* address. The machine answers as its page is answered.
|
|
241
|
+
*/
|
|
242
|
+
export declare function remoteComputerCommand(machine: MachineAccess, pkg: string, args: readonly string[], command?: string, input?: string): Promise<{
|
|
243
|
+
ok: true;
|
|
244
|
+
output: unknown;
|
|
245
|
+
} | {
|
|
246
|
+
ok: false;
|
|
247
|
+
error: string;
|
|
248
|
+
}>;
|
|
249
|
+
/** The logins this computer's person has on a machine of another person's, as that machine says (machine-logins.ts). */
|
|
250
|
+
export declare function remoteLogins(machine: MachineAccess): Promise<{
|
|
251
|
+
ok: true;
|
|
252
|
+
logins: MachineLogins;
|
|
253
|
+
} | {
|
|
254
|
+
ok: false;
|
|
255
|
+
error: string;
|
|
256
|
+
}>;
|
|
257
|
+
/** Hand logins over to this computer's person on a machine of another person's; answers what it says of them after. */
|
|
258
|
+
export declare function giveRemoteLogins(machine: MachineAccess, given: GivenLogins): Promise<{
|
|
259
|
+
ok: true;
|
|
260
|
+
logins: MachineLogins;
|
|
261
|
+
} | {
|
|
262
|
+
ok: false;
|
|
263
|
+
error: string;
|
|
264
|
+
}>;
|
|
265
|
+
/** What a machine's door is asked about this computer's person there: who they are and their devices, one of those devices out, or a link for this computer's line. */
|
|
266
|
+
export type DoorAsk = {
|
|
267
|
+
what: 'me';
|
|
268
|
+
} | {
|
|
269
|
+
what: 'remove';
|
|
270
|
+
id: string;
|
|
271
|
+
} | {
|
|
272
|
+
what: 'line';
|
|
273
|
+
};
|
|
274
|
+
/**
|
|
275
|
+
* Ask a machine's door about the person this computer is in as there: the door answers it
|
|
276
|
+
* itself, from its own file, and passes nothing on to the OpenAgent behind it. Answers what the
|
|
277
|
+
* door said, as it said it: the caller reads it as the data of another computer.
|
|
278
|
+
*/
|
|
279
|
+
export declare function remoteDoor(machine: MachineAccess, ask: DoorAsk): Promise<{
|
|
280
|
+
ok: true;
|
|
281
|
+
said: unknown;
|
|
282
|
+
} | {
|
|
283
|
+
ok: false;
|
|
284
|
+
error: string;
|
|
285
|
+
unknown?: true;
|
|
286
|
+
}>;
|
|
@@ -6,8 +6,8 @@ export { onPreferences, savePreferences, patchPreferences, onProjectPresets, sav
|
|
|
6
6
|
export { type EditorInfo } from '../dashboard/open-in-app.js';
|
|
7
7
|
export { onQuota } from './quota.js';
|
|
8
8
|
export { onModels } from './models.js';
|
|
9
|
-
export { onMachines, sendAddMachine, sendRemoveMachine, onMachinesReachable, onMachineVersions, sendProjectToMachine, onProjectOnMachine, onComputersThrough, sendAddComputerThrough, type Machine, type AddMachineResult, type MachineVersions, type ProjectOnMachine, type ComputersThrough } from './machines.js';
|
|
10
|
-
export { onModules, runModuleCommand, runComputerCommand, readModule, type DashboardModule, type ModuleCommandResult, type ModuleReadResult } from './modules.js';
|
|
9
|
+
export { onMachines, sendAddMachine, sendRemoveMachine, onMachinesReachable, onMachineVersions, sendProjectToMachine, onProjectOnMachine, onComputersThrough, sendAddComputerThrough, onMachinePerson, sendRemoveMachineDevice, sendMachineLineLink, sendMachineTold, onMachineLogins, sendMachineLogins, type Machine, type MachineLoginsResult, type AddMachineResult, type MachineVersions, type ProjectOnMachine, type ComputersThrough, type MachinePerson } from './machines.js';
|
|
10
|
+
export { onModules, runModuleCommand, runComputerCommand, runComputerCommandOn, readModule, type DashboardModule, type ModuleCommandResult, type ModuleReadResult } from './modules.js';
|
|
11
11
|
export { onProjectSkills, sendChangeSkills, sendProjectSkills, type ProjectSkills, type ProjectSkill, type ChangeSkillsResult } from './skills.js';
|
|
12
12
|
export { onPerson, type Person } from './person.js';
|
|
13
13
|
import { streamAgentEvents } from './events.js';
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import { type MachineLogins } from '../dashboard/machine-logins.js';
|
|
1
2
|
/** A saved machine as the browser sees it: no key. */
|
|
2
3
|
export interface Machine {
|
|
3
4
|
id: string;
|
|
4
5
|
label: string;
|
|
5
6
|
url: string;
|
|
7
|
+
/** Whose computer it is, when it is another person's: a run there uses this person's own logins, copied there. */
|
|
8
|
+
owner?: string;
|
|
9
|
+
/** The person was told so, once. */
|
|
10
|
+
told?: true;
|
|
6
11
|
}
|
|
7
12
|
export type AddMachineResult = {
|
|
8
13
|
ok: true;
|
|
@@ -18,8 +23,11 @@ export declare function onMachines(): Promise<Machine[]>;
|
|
|
18
23
|
* computer is let in there with the link's code, once, and keeps the key it is answered. Adding
|
|
19
24
|
* a machine again, with a new link, replaces its name and the key, and the key it had there
|
|
20
25
|
* before is taken out.
|
|
26
|
+
*
|
|
27
|
+
* `owner` is said for a computer of another person's that keeps a line to this server for
|
|
28
|
+
* everyone: the door says whose it is when it tells this OpenAgent of it.
|
|
21
29
|
*/
|
|
22
|
-
export declare function sendAddMachine(pasted: string, label?: string): Promise<AddMachineResult>;
|
|
30
|
+
export declare function sendAddMachine(pasted: string, label?: string, owner?: string): Promise<AddMachineResult>;
|
|
23
31
|
export type RemoveMachineResult = {
|
|
24
32
|
ok: true;
|
|
25
33
|
} | {
|
|
@@ -39,6 +47,8 @@ export interface ComputerThrough {
|
|
|
39
47
|
name: string;
|
|
40
48
|
online: boolean;
|
|
41
49
|
added: boolean;
|
|
50
|
+
/** Whose computer it is, when it is another person's that keeps its line there for everyone. */
|
|
51
|
+
owner?: string;
|
|
42
52
|
}
|
|
43
53
|
export type ComputersThrough = {
|
|
44
54
|
ok: true;
|
|
@@ -59,6 +69,60 @@ export declare function onComputersThrough(machineId: string): Promise<Computers
|
|
|
59
69
|
* already lets this computer in, and passes its calls down the computer's line.
|
|
60
70
|
*/
|
|
61
71
|
export declare function sendAddComputerThrough(machineId: string, computerId: string): Promise<AddMachineResult>;
|
|
72
|
+
/** Write down that the person was told their logins are copied to a saved machine of another person's: the page says it once. */
|
|
73
|
+
export declare function sendMachineTold(machineId: string): Promise<{
|
|
74
|
+
ok: boolean;
|
|
75
|
+
}>;
|
|
76
|
+
export type MachineLoginsResult = {
|
|
77
|
+
ok: true;
|
|
78
|
+
logins: MachineLogins;
|
|
79
|
+
} | {
|
|
80
|
+
ok: false;
|
|
81
|
+
error: string;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* This person's logins on a saved machine of another person's, as that machine says: copied from
|
|
85
|
+
* a server, or made there. Read through the server when the machine is reached through one.
|
|
86
|
+
*/
|
|
87
|
+
export declare function onMachineLogins(machineId: string): Promise<MachineLoginsResult>;
|
|
88
|
+
/**
|
|
89
|
+
* Hand this person's own logins to a saved machine of another person's: the person made them for
|
|
90
|
+
* it, here, so they are no copies, and no server's copy takes their place later.
|
|
91
|
+
*/
|
|
92
|
+
export declare function sendMachineLogins(machineId: string, given: {
|
|
93
|
+
github?: unknown;
|
|
94
|
+
claude?: unknown;
|
|
95
|
+
}): Promise<MachineLoginsResult>;
|
|
96
|
+
/**
|
|
97
|
+
* What a saved machine's door says of the person this computer is in as there: their GitHub
|
|
98
|
+
* account, whether they are that computer's owner, and their devices, as the door lists them. A
|
|
99
|
+
* computer several people use answers it; `unknown` is a machine that does not say (one from
|
|
100
|
+
* before persons, or reached through a server). What it said is another computer's data: the page
|
|
101
|
+
* reads it as such.
|
|
102
|
+
*/
|
|
103
|
+
export type MachinePerson = {
|
|
104
|
+
ok: true;
|
|
105
|
+
said: unknown;
|
|
106
|
+
} | {
|
|
107
|
+
ok: false;
|
|
108
|
+
error: string;
|
|
109
|
+
unknown?: true;
|
|
110
|
+
};
|
|
111
|
+
export declare function onMachinePerson(machineId: string): Promise<MachinePerson>;
|
|
112
|
+
/** Take one of this person's devices out at a saved machine, by its id there; answers what {@link onMachinePerson} does, as it is after. */
|
|
113
|
+
export declare function sendRemoveMachineDevice(machineId: string, deviceId: string): Promise<MachinePerson>;
|
|
114
|
+
/**
|
|
115
|
+
* A link that lets this computer's line in at a saved machine, as this person's: what keeping a
|
|
116
|
+
* line open to a computer several people use starts from, for a person who cannot ask for one
|
|
117
|
+
* over SSH. The link works once, and only for a line.
|
|
118
|
+
*/
|
|
119
|
+
export declare function sendMachineLineLink(machineId: string): Promise<{
|
|
120
|
+
ok: true;
|
|
121
|
+
url: string;
|
|
122
|
+
} | {
|
|
123
|
+
ok: false;
|
|
124
|
+
error: string;
|
|
125
|
+
}>;
|
|
62
126
|
/** Whether each saved machine answers right now, by id: one short call to each, with this computer's key. */
|
|
63
127
|
export declare function onMachinesReachable(): Promise<Record<string, boolean>>;
|
|
64
128
|
/** This computer's OpenAgent, and the one each saved machine runs. */
|
|
@@ -41,9 +41,21 @@ export declare function runModuleCommand(projectId: string, pkg: string, args: s
|
|
|
41
41
|
* Run one of the commands of a package that is this computer's, in no project, and answer its
|
|
42
42
|
* JSON output: how the door's page and the servers' page read and change what they keep, which is
|
|
43
43
|
* in the person's home folder, where the command runs. Refused for any other package: a project's
|
|
44
|
-
* module runs its commands in its project ({@link runModuleCommand}).
|
|
44
|
+
* module runs its commands in its project ({@link runModuleCommand}). `input` is what the command
|
|
45
|
+
* reads on standard input: a login handed over there is on no command line.
|
|
46
|
+
*
|
|
47
|
+
* The command is told which computer this is and where this OpenAgent answers: what it sets up on
|
|
48
|
+
* another machine is listed there as this computer's, and what it asks of a saved machine it asks
|
|
49
|
+
* through this OpenAgent, which holds the keys.
|
|
50
|
+
*/
|
|
51
|
+
export declare function runComputerCommand(pkg: string, args: string[], command?: string | null, input?: string | null): Promise<ModuleCommandResult>;
|
|
52
|
+
/**
|
|
53
|
+
* Run one of the commands of a package that is this computer's on a saved machine, where the
|
|
54
|
+
* same package is that machine's: a module reads and changes what it keeps over there, with this
|
|
55
|
+
* computer's key there, as the machine's own page would. Not for a computer reached through a
|
|
56
|
+
* server: what comes down a line is a machine's calls, not its page's.
|
|
45
57
|
*/
|
|
46
|
-
export declare function
|
|
58
|
+
export declare function runComputerCommandOn(pkg: string, machineId: string, args: string[], command?: string | null, input?: string | null): Promise<ModuleCommandResult>;
|
|
47
59
|
/**
|
|
48
60
|
* Call read `name` of a module's server part in one project: how a module's browser part reads
|
|
49
61
|
* what a command cannot answer fast enough. Refused for an unknown project, a package that is not
|
|
@@ -10,6 +10,12 @@ import type { ProvidedCommand } from '@openagt/agent-data';
|
|
|
10
10
|
*/
|
|
11
11
|
/** How a package of this computer is told which computer this is: the name of the word in what it is started with. */
|
|
12
12
|
export declare const COMPUTER_ENV = "OPENAGENT_COMPUTER";
|
|
13
|
+
/** How a package of this computer is told where OpenAgent answers on it. */
|
|
14
|
+
export declare const URL_ENV = "OPENAGENT_URL";
|
|
15
|
+
/** Say where this OpenAgent answers, once it listens: what its packages' commands are told too. */
|
|
16
|
+
export declare function sayOwnUrl(url: string | undefined): void;
|
|
17
|
+
/** Where this OpenAgent answers, as it was said; nothing before it listens. */
|
|
18
|
+
export declare function ownUrlSaid(): string | undefined;
|
|
13
19
|
export interface PackageServicesOptions {
|
|
14
20
|
/** The commands to run, each a package's declared service. */
|
|
15
21
|
commands: readonly ProvidedCommand[];
|
|
@@ -59,4 +59,6 @@ export type ModuleCommandResult = PackageCommandResult;
|
|
|
59
59
|
*/
|
|
60
60
|
export declare function runModuleCommand(root: string, module: ProjectModule, args: readonly string[], command?: string,
|
|
61
61
|
/** What the command is started with, beside what this process itself has. */
|
|
62
|
-
more?: NodeJS.ProcessEnv
|
|
62
|
+
more?: NodeJS.ProcessEnv,
|
|
63
|
+
/** What the command reads on standard input. */
|
|
64
|
+
input?: string): Promise<ModuleCommandResult>;
|
|
@@ -40,7 +40,17 @@ export interface MachineRecord {
|
|
|
40
40
|
* machine that later says another name does not get another computer's runs by it.
|
|
41
41
|
*/
|
|
42
42
|
host?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Whose computer it is, by their GitHub account, when it is another person's: a computer that
|
|
45
|
+
* keeps a line to a server for everyone there. A run started on it uses this person's own logins
|
|
46
|
+
* there, which reach it as copies.
|
|
47
|
+
*/
|
|
48
|
+
owner?: string;
|
|
49
|
+
/** The person was told, once, that their logins are copied to that other person's computer. */
|
|
50
|
+
told?: true;
|
|
43
51
|
}
|
|
52
|
+
/** A GitHub account as a person on a computer is known by: letters, digits and single dashes, at most 39. */
|
|
53
|
+
export declare function isAccount(value: unknown): value is string;
|
|
44
54
|
/**
|
|
45
55
|
* The dashboard's Global options (#410), persisted next to the project list so they
|
|
46
56
|
* survive restarts without localStorage — the daemon reads/writes them, the SPA reads
|
|
@@ -290,6 +300,7 @@ export declare function addMachine(machine: {
|
|
|
290
300
|
door: string;
|
|
291
301
|
pin?: string;
|
|
292
302
|
label?: string;
|
|
303
|
+
owner?: string;
|
|
293
304
|
}, fs?: RegistryFs, env?: NodeJS.ProcessEnv): Promise<{
|
|
294
305
|
record: MachineRecord;
|
|
295
306
|
displaced: MachineRecord[];
|
|
@@ -304,6 +315,8 @@ export declare function nameMachine(machine: {
|
|
|
304
315
|
id: string;
|
|
305
316
|
key: string;
|
|
306
317
|
}, host: string, fs?: RegistryFs, env?: NodeJS.ProcessEnv): Promise<boolean>;
|
|
318
|
+
/** Write down that the person was told their logins are copied to a saved machine of another person's. Answers whether it is saved. */
|
|
319
|
+
export declare function tellMachine(id: string, fs?: RegistryFs, env?: NodeJS.ProcessEnv): Promise<boolean>;
|
|
307
320
|
/** Take a saved machine off the list, by id. Answers the one that was there. */
|
|
308
321
|
export declare function removeMachine(id: string, fs?: RegistryFs, env?: NodeJS.ProcessEnv): Promise<MachineRecord | undefined>;
|
|
309
322
|
/** A {@link PreferencesStore} bound to the real registry file, wired by the daemon so the
|
|
@@ -10,6 +10,12 @@ import type { ProvidedCommand } from '@openagt/agent-data';
|
|
|
10
10
|
*/
|
|
11
11
|
/** How a package of this computer is told which computer this is: the name of the word in what it is started with. */
|
|
12
12
|
export declare const COMPUTER_ENV = "OPENAGENT_COMPUTER";
|
|
13
|
+
/** How a package of this computer is told where OpenAgent answers on it. */
|
|
14
|
+
export declare const URL_ENV = "OPENAGENT_URL";
|
|
15
|
+
/** Say where this OpenAgent answers, once it listens: what its packages' commands are told too. */
|
|
16
|
+
export declare function sayOwnUrl(url: string | undefined): void;
|
|
17
|
+
/** Where this OpenAgent answers, as it was said; nothing before it listens. */
|
|
18
|
+
export declare function ownUrlSaid(): string | undefined;
|
|
13
19
|
export interface PackageServicesOptions {
|
|
14
20
|
/** The commands to run, each a package's declared service. */
|
|
15
21
|
commands: readonly ProvidedCommand[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-services.d.ts","sourceRoot":"","sources":["../src/package-services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAE1D;;;;;;;GAOG;AAEH,sHAAsH;AACtH,eAAO,MAAM,YAAY,uBAAuB,CAAA;AAEhD,MAAM,WAAW,sBAAsB;IACrC,8DAA8D;IAC9D,QAAQ,EAAE,SAAS,eAAe,EAAE,CAAA;IACpC,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAA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Y,CAAA;IAC7D,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,sDAAsD;IACtD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACtB;AAKD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,sBAAsB,GAAG,eAAe,CAwDlF"}
|
package/dist/package-services.js
CHANGED
|
@@ -9,11 +9,22 @@ import { spawn as nodeSpawn } from 'node:child_process';
|
|
|
9
9
|
*/
|
|
10
10
|
/** How a package of this computer is told which computer this is: the name of the word in what it is started with. */
|
|
11
11
|
export const COMPUTER_ENV = 'OPENAGENT_COMPUTER';
|
|
12
|
+
/** How a package of this computer is told where OpenAgent answers on it. */
|
|
13
|
+
export const URL_ENV = 'OPENAGENT_URL';
|
|
14
|
+
let ownUrl;
|
|
15
|
+
/** Say where this OpenAgent answers, once it listens: what its packages' commands are told too. */
|
|
16
|
+
export function sayOwnUrl(url) {
|
|
17
|
+
ownUrl = url;
|
|
18
|
+
}
|
|
19
|
+
/** Where this OpenAgent answers, as it was said; nothing before it listens. */
|
|
20
|
+
export function ownUrlSaid() {
|
|
21
|
+
return ownUrl;
|
|
22
|
+
}
|
|
12
23
|
/** How long a service gets to end by itself once asked, before it is killed. */
|
|
13
24
|
const STOP_GRACE_MS = 3_000;
|
|
14
25
|
export function startPackageServices(opts) {
|
|
15
26
|
const spawn = opts.spawn ?? ((bin, env) => nodeSpawn(process.execPath, [bin, 'serve'], { env, stdio: ['ignore', 'ignore', 'pipe'], detached: true }));
|
|
16
|
-
const env = { ...opts.env,
|
|
27
|
+
const env = { ...opts.env, [URL_ENV]: opts.url };
|
|
17
28
|
let stopping = false;
|
|
18
29
|
const running = new Map();
|
|
19
30
|
const timers = new Set();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-services.js","sourceRoot":"","sources":["../src/package-services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,SAA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AAA;AACH,CAAC"}
|
|
@@ -59,5 +59,7 @@ export type ModuleCommandResult = PackageCommandResult;
|
|
|
59
59
|
*/
|
|
60
60
|
export declare function runModuleCommand(root: string, module: ProjectModule, args: readonly string[], command?: string,
|
|
61
61
|
/** What the command is started with, beside what this process itself has. */
|
|
62
|
-
more?: NodeJS.ProcessEnv
|
|
62
|
+
more?: NodeJS.ProcessEnv,
|
|
63
|
+
/** What the command reads on standard input. */
|
|
64
|
+
input?: string): Promise<ModuleCommandResult>;
|
|
63
65
|
//# sourceMappingURL=project-modules.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-modules.d.ts","sourceRoot":"","sources":["../src/project-modules.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkC,KAAK,oBAAoB,EAAuB,MAAM,qBAAqB,CAAA;AAGpH;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,0BAA0B;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,4GAA4G;IAC5G,GAAG,EAAE,MAAM,CAAA;IACX,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAA;IACb,2IAA2I;IAC3I,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,sFAAsF;IACtF,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AA4BD;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAO/E;AAgBD,sEAAsE;AACtE,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAEtG;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC,CAOpE;AAED,yEAAyE;AACzE,wBAAsB,kBAA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tG;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC,CAOpE;AAED,yEAAyE;AACzE,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAEzF;AAED;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAKhG;AAED,+EAA+E;AAC/E,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,CAAA;AAMtD;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,CAAC,EAAE,MAAM;AAChB,6EAA6E;AAC7E,IAAI,CAAC,EAAE,MAAM,CAAC,UAAU;AACxB,gDAAgD;AAChD,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,mBAAmB,CAAC,CAS9B"}
|
package/dist/project-modules.js
CHANGED
|
@@ -111,7 +111,9 @@ const MAX_ARG_LENGTH = 4096;
|
|
|
111
111
|
*/
|
|
112
112
|
export async function runModuleCommand(root, module, args, command,
|
|
113
113
|
/** What the command is started with, beside what this process itself has. */
|
|
114
|
-
more
|
|
114
|
+
more,
|
|
115
|
+
/** What the command reads on standard input. */
|
|
116
|
+
input) {
|
|
115
117
|
const names = Object.keys(module.bins);
|
|
116
118
|
const name = command ?? (names.length === 1 ? names[0] : undefined);
|
|
117
119
|
const bin = name !== undefined ? module.bins[name] : undefined;
|
|
@@ -119,6 +121,6 @@ more) {
|
|
|
119
121
|
return { ok: false, error: command !== undefined ? `${module.package} has no command ${command}` : `${module.package} has ${names.length === 0 ? 'no command' : 'several commands; name one'}` };
|
|
120
122
|
if (args.length > MAX_ARGS || args.some(arg => typeof arg !== 'string' || arg.length > MAX_ARG_LENGTH))
|
|
121
123
|
return { ok: false, error: 'too many or too long arguments' };
|
|
122
|
-
return runPackageCommand(root, { name: name, bin }, args, more);
|
|
124
|
+
return runPackageCommand(root, { name: name, bin }, args, more, input);
|
|
123
125
|
}
|
|
124
126
|
//# sourceMappingURL=project-modules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-modules.js","sourceRoot":"","sources":["../src/project-modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAkD,MAAM,qBAAqB,CAAA;AACpH,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAyBhF,iGAAiG;AACjG,SAAS,YAAY,CAAC,OAAgB,EAAE,GAAW,EAAE,UAA6B;IAChF,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO,SAAS,CAAA;IACvF,MAAM,KAAK,GAAI,OAAmC,CAAC,GAAG,CAAC,CAAA;IACvD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC3C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAA;IACjF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,MAAM,GAAI,KAAiC,CAAC,SAAS,CAAC,CAAA;QAC5D,IAAI,OAAO,MAAM,KAAK,QAAQ;YAAE,OAAO,MAAM,CAAA;IAC/C,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,4E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,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,MAAM,GAAG,cAAc,CAAC;QACpG,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,gCAAgC,EAAE,CAAA;IAC/D,OAAO,iBAAiB,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAK,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;AACzE,CAAC"}
|
package/dist/registry.d.ts
CHANGED
|
@@ -40,7 +40,17 @@ export interface MachineRecord {
|
|
|
40
40
|
* machine that later says another name does not get another computer's runs by it.
|
|
41
41
|
*/
|
|
42
42
|
host?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Whose computer it is, by their GitHub account, when it is another person's: a computer that
|
|
45
|
+
* keeps a line to a server for everyone there. A run started on it uses this person's own logins
|
|
46
|
+
* there, which reach it as copies.
|
|
47
|
+
*/
|
|
48
|
+
owner?: string;
|
|
49
|
+
/** The person was told, once, that their logins are copied to that other person's computer. */
|
|
50
|
+
told?: true;
|
|
43
51
|
}
|
|
52
|
+
/** A GitHub account as a person on a computer is known by: letters, digits and single dashes, at most 39. */
|
|
53
|
+
export declare function isAccount(value: unknown): value is string;
|
|
44
54
|
/**
|
|
45
55
|
* The dashboard's Global options (#410), persisted next to the project list so they
|
|
46
56
|
* survive restarts without localStorage — the daemon reads/writes them, the SPA reads
|
|
@@ -290,6 +300,7 @@ export declare function addMachine(machine: {
|
|
|
290
300
|
door: string;
|
|
291
301
|
pin?: string;
|
|
292
302
|
label?: string;
|
|
303
|
+
owner?: string;
|
|
293
304
|
}, fs?: RegistryFs, env?: NodeJS.ProcessEnv): Promise<{
|
|
294
305
|
record: MachineRecord;
|
|
295
306
|
displaced: MachineRecord[];
|
|
@@ -304,6 +315,8 @@ export declare function nameMachine(machine: {
|
|
|
304
315
|
id: string;
|
|
305
316
|
key: string;
|
|
306
317
|
}, host: string, fs?: RegistryFs, env?: NodeJS.ProcessEnv): Promise<boolean>;
|
|
318
|
+
/** Write down that the person was told their logins are copied to a saved machine of another person's. Answers whether it is saved. */
|
|
319
|
+
export declare function tellMachine(id: string, fs?: RegistryFs, env?: NodeJS.ProcessEnv): Promise<boolean>;
|
|
307
320
|
/** Take a saved machine off the list, by id. Answers the one that was there. */
|
|
308
321
|
export declare function removeMachine(id: string, fs?: RegistryFs, env?: NodeJS.ProcessEnv): Promise<MachineRecord | undefined>;
|
|
309
322
|
/** A {@link PreferencesStore} bound to the real registry file, wired by the daemon so the
|
package/dist/registry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAGrE;;;;;;;GAOG;AAEH,8BAA8B;AAC9B,MAAM,WAAW,aAAa;IAC5B,iDAAiD;IACjD,EAAE,EAAE,MAAM,CAAA;IACV,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,qGAAqG;IACrG,EAAE,EAAE,MAAM,CAAA;IACV,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAA;IACb,8EAA8E;IAC9E,GAAG,EAAE,MAAM,CAAA;IACX,0EAA0E;IAC1E,GAAG,EAAE,MAAM,CAAA;IACX,uGAAuG;IACvG,IAAI,EAAE,MAAM,CAAA;IACZ,qHAAqH;IACrH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAGrE;;;;;;;GAOG;AAEH,8BAA8B;AAC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,GAAE,MAAM,CAAC,UAAwB,EACpC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,GACxC,gBAAgB,CAclB"}
|
package/dist/registry.js
CHANGED
|
@@ -3,6 +3,10 @@ import { randomBytes } from 'node:crypto';
|
|
|
3
3
|
import { isDriverName } from './driver-names.js';
|
|
4
4
|
import { isPublishPick } from './publish-levels.js';
|
|
5
5
|
import { nodeFs } from './node-fs.js';
|
|
6
|
+
/** A GitHub account as a person on a computer is known by: letters, digits and single dashes, at most 39. */
|
|
7
|
+
export function isAccount(value) {
|
|
8
|
+
return typeof value === 'string' && /^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9])){0,38}$/.test(value);
|
|
9
|
+
}
|
|
6
10
|
/** The cap on saved machines and on a name's length, so a hand-edited file cannot bloat. */
|
|
7
11
|
const MACHINE_LIMITS = { count: 50, label: 60 };
|
|
8
12
|
/** The cap on saved custom presets, and the per-field lengths — enough for real prompts, bounded
|
|
@@ -192,13 +196,13 @@ function sanitizeMachines(value) {
|
|
|
192
196
|
break;
|
|
193
197
|
if (typeof raw !== 'object' || raw === null)
|
|
194
198
|
continue;
|
|
195
|
-
const { label, url, key, door, pin, host } = raw;
|
|
199
|
+
const { label, url, key, door, pin, host, owner, told } = raw;
|
|
196
200
|
if (typeof label !== 'string' || typeof url !== 'string' || typeof key !== 'string' || typeof door !== 'string')
|
|
197
201
|
continue;
|
|
198
202
|
if (!url || !key || !door || seen.has(url))
|
|
199
203
|
continue;
|
|
200
204
|
seen.add(url);
|
|
201
|
-
machines.push({ id: url, label: label.trim().slice(0, MACHINE_LIMITS.label) || url, url, key, door, ...(typeof pin === 'string' && pin ? { pin } : {}), ...(isHostName(host) ? { host } : {}) });
|
|
205
|
+
machines.push({ id: url, label: label.trim().slice(0, MACHINE_LIMITS.label) || url, url, key, door, ...(typeof pin === 'string' && pin ? { pin } : {}), ...(isHostName(host) ? { host } : {}), ...(isAccount(owner) ? { owner } : {}), ...(told === true ? { told: true } : {}) });
|
|
202
206
|
}
|
|
203
207
|
return machines;
|
|
204
208
|
}
|
|
@@ -409,6 +413,7 @@ export async function addMachine(machine, fs = nodeRegistryFs(), env = process.e
|
|
|
409
413
|
key: machine.key,
|
|
410
414
|
door: machine.door,
|
|
411
415
|
...(machine.pin ? { pin: machine.pin } : {}),
|
|
416
|
+
...(isAccount(machine.owner) ? { owner: machine.owner } : {}),
|
|
412
417
|
};
|
|
413
418
|
const before = registry.machines ?? [];
|
|
414
419
|
const machines = [record, ...before.filter(saved => saved.id !== record.id)].slice(0, MACHINE_LIMITS.count);
|
|
@@ -435,6 +440,19 @@ export async function nameMachine(machine, host, fs = nodeRegistryFs(), env = pr
|
|
|
435
440
|
return true;
|
|
436
441
|
});
|
|
437
442
|
}
|
|
443
|
+
/** Write down that the person was told their logins are copied to a saved machine of another person's. Answers whether it is saved. */
|
|
444
|
+
export async function tellMachine(id, fs = nodeRegistryFs(), env = process.env) {
|
|
445
|
+
return serialize(async () => {
|
|
446
|
+
const registry = await readRegistry(fs, env);
|
|
447
|
+
const saved = (registry.machines ?? []).find(candidate => candidate.id === id);
|
|
448
|
+
if (!saved)
|
|
449
|
+
return false;
|
|
450
|
+
if (saved.told)
|
|
451
|
+
return true;
|
|
452
|
+
await writeRegistry({ ...registry, machines: (registry.machines ?? []).map(machine => (machine.id === id ? { ...machine, told: true } : machine)) }, fs, env);
|
|
453
|
+
return true;
|
|
454
|
+
});
|
|
455
|
+
}
|
|
438
456
|
/** Take a saved machine off the list, by id. Answers the one that was there. */
|
|
439
457
|
export async function removeMachine(id, fs = nodeRegistryFs(), env = process.env) {
|
|
440
458
|
return serialize(async () => {
|