@openagt/dashboard 0.10.0 → 0.12.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/README.md +1 -6
- package/dist/built-in.d.ts +18 -2
- package/dist/built-in.d.ts.map +1 -1
- package/dist/built-in.js +29 -6
- package/dist/built-in.js.map +1 -1
- package/dist/cli.d.ts +4 -10
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +11 -67
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +2 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +3 -4
- package/dist/client.js.map +1 -1
- package/dist/clone-project.d.ts +69 -0
- package/dist/clone-project.d.ts.map +1 -0
- package/dist/clone-project.js +124 -0
- package/dist/clone-project.js.map +1 -0
- package/dist/daemon-runtime.d.ts +12 -12
- package/dist/daemon-runtime.d.ts.map +1 -1
- package/dist/daemon-runtime.js +96 -35
- package/dist/daemon-runtime.js.map +1 -1
- package/dist/daemon.d.ts +3 -14
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +15 -26
- package/dist/daemon.js.map +1 -1
- package/dist/dashboard/bridge-endpoints.d.ts +5 -5
- package/dist/dashboard/bridge-endpoints.js +5 -5
- package/dist/dashboard/http.d.ts +1 -1
- package/dist/dashboard/http.js +1 -1
- package/dist/dashboard/machine-call.d.ts +10 -0
- package/dist/dashboard/machine-call.d.ts.map +1 -0
- package/dist/dashboard/machine-call.js +86 -0
- package/dist/dashboard/machine-call.js.map +1 -0
- package/dist/dashboard/module-serve.d.ts +6 -0
- package/dist/dashboard/module-serve.d.ts.map +1 -1
- package/dist/dashboard/module-serve.js +24 -8
- package/dist/dashboard/module-serve.js.map +1 -1
- package/dist/dashboard/relay-endpoints.d.ts +26 -17
- package/dist/dashboard/relay-endpoints.d.ts.map +1 -1
- package/dist/dashboard/relay-endpoints.js +70 -27
- package/dist/dashboard/relay-endpoints.js.map +1 -1
- package/dist/dashboard/remote-run.d.ts +77 -32
- package/dist/dashboard/remote-run.d.ts.map +1 -1
- package/dist/dashboard/remote-run.js +120 -42
- package/dist/dashboard/remote-run.js.map +1 -1
- package/dist/dashboard/rpc-serve.d.ts +28 -25
- package/dist/dashboard/rpc-serve.d.ts.map +1 -1
- package/dist/dashboard/rpc-serve.js +26 -22
- package/dist/dashboard/rpc-serve.js.map +1 -1
- package/dist/dashboard/screen.d.ts +53 -0
- package/dist/dashboard/screen.d.ts.map +1 -0
- package/dist/dashboard/screen.js +175 -0
- package/dist/dashboard/screen.js.map +1 -0
- package/dist/dashboard/server.d.ts +18 -19
- package/dist/dashboard/server.d.ts.map +1 -1
- package/dist/dashboard/server.js +57 -84
- package/dist/dashboard/server.js.map +1 -1
- package/dist/dashboard/types.d.ts +11 -16
- package/dist/dashboard/types.d.ts.map +1 -1
- package/dist/dashboard/web-start-endpoints.d.ts +2 -2
- package/dist/dashboard/web-start-endpoints.js +1 -1
- package/dist/dashboard-bundle/assets/main-BHMlP40v.css +2 -0
- package/dist/dashboard-bundle/assets/main-D0qZC1r-.js +140 -0
- package/dist/dashboard-bundle/assets/{module-gKz-ZvkG.js → module-ZjyA5WUg.js} +4 -4
- package/dist/dashboard-bundle/host/module.js +1 -1
- package/dist/dashboard-bundle/index.html +3 -3
- package/dist/dashboard-rpc/context.d.ts +4 -4
- package/dist/dashboard-rpc/context.js +5 -5
- package/dist/dashboard-rpc/context.js.map +1 -1
- package/dist/dashboard-rpc/control.d.ts +1 -1
- package/dist/dashboard-rpc/control.js +7 -7
- package/dist/dashboard-rpc/control.js.map +1 -1
- package/dist/dashboard-rpc/events.d.ts +1 -1
- package/dist/dashboard-rpc/events.js +1 -1
- package/dist/dashboard-rpc/index.d.ts +3 -3
- package/dist/dashboard-rpc/index.d.ts.map +1 -1
- package/dist/dashboard-rpc/index.js +5 -5
- package/dist/dashboard-rpc/index.js.map +1 -1
- package/dist/dashboard-rpc/machines.d.ts +52 -0
- package/dist/dashboard-rpc/machines.d.ts.map +1 -0
- package/dist/dashboard-rpc/machines.js +82 -0
- package/dist/dashboard-rpc/machines.js.map +1 -0
- package/dist/dashboard-rpc/modules.d.ts +12 -4
- package/dist/dashboard-rpc/modules.d.ts.map +1 -1
- package/dist/dashboard-rpc/modules.js +24 -5
- package/dist/dashboard-rpc/modules.js.map +1 -1
- package/dist/dashboard-rpc/projects.d.ts +18 -0
- package/dist/dashboard-rpc/projects.d.ts.map +1 -1
- package/dist/dashboard-rpc/projects.js +27 -5
- package/dist/dashboard-rpc/projects.js.map +1 -1
- package/dist/dashboard-rpc/reads.d.ts +3 -4
- package/dist/dashboard-rpc/reads.d.ts.map +1 -1
- package/dist/dashboard-rpc/reads.js +5 -6
- package/dist/dashboard-rpc/reads.js.map +1 -1
- package/dist/dashboard-rpc/relay-agent.d.ts +3 -3
- package/dist/dashboard-rpc/relay-agent.js +3 -3
- package/dist/dashboard-rpc/relay-dispatch.d.ts +4 -4
- package/dist/dashboard-rpc/relay-dispatch.d.ts.map +1 -1
- package/dist/dashboard-rpc/relay-dispatch.js +7 -7
- package/dist/dashboard-rpc/relay-dispatch.js.map +1 -1
- package/dist/dashboard-rpc/test-context.js +1 -1
- package/dist/dashboard-rpc/test-context.js.map +1 -1
- package/dist/events.d.ts +4 -3
- package/dist/events.d.ts.map +1 -1
- package/dist/loopback-host.d.ts +3 -5
- package/dist/loopback-host.d.ts.map +1 -1
- package/dist/loopback-host.js +3 -5
- package/dist/loopback-host.js.map +1 -1
- package/dist/machine-link.d.ts +21 -0
- package/dist/machine-link.d.ts.map +1 -0
- package/dist/machine-link.js +20 -0
- package/dist/machine-link.js.map +1 -0
- package/dist/module-server.d.ts +1 -1
- package/dist/module-types/dashboard/components/QrCode.d.ts +8 -0
- package/dist/module-types/dashboard/lib/draft-handoff.d.ts +5 -9
- package/dist/module-types/dashboard/module/index.d.ts +56 -4
- package/dist/module-types/dashboard/rpc/modules.d.ts +1 -0
- package/dist/module-types/src/built-in.d.ts +18 -2
- package/dist/module-types/src/client.d.ts +2 -1
- package/dist/module-types/src/clone-project.d.ts +68 -0
- package/dist/module-types/src/dashboard/bridge-endpoints.d.ts +5 -5
- package/dist/module-types/src/dashboard/http.d.ts +1 -1
- package/dist/module-types/src/dashboard/machine-call.d.ts +9 -0
- package/dist/module-types/src/dashboard/module-serve.d.ts +6 -0
- package/dist/module-types/src/dashboard/remote-run.d.ts +77 -32
- package/dist/module-types/src/dashboard/rpc-serve.d.ts +28 -25
- package/dist/module-types/src/dashboard/types.d.ts +11 -16
- package/dist/module-types/src/dashboard-rpc/context.d.ts +4 -4
- package/dist/module-types/src/dashboard-rpc/control.d.ts +1 -1
- package/dist/module-types/src/dashboard-rpc/events.d.ts +1 -1
- package/dist/module-types/src/dashboard-rpc/index.d.ts +3 -3
- package/dist/module-types/src/dashboard-rpc/machines.d.ts +51 -0
- package/dist/module-types/src/dashboard-rpc/modules.d.ts +12 -4
- package/dist/module-types/src/dashboard-rpc/projects.d.ts +18 -0
- package/dist/module-types/src/dashboard-rpc/reads.d.ts +3 -4
- package/dist/module-types/src/dashboard-rpc/relay-agent.d.ts +3 -3
- package/dist/module-types/src/events.d.ts +4 -3
- package/dist/module-types/src/loopback-host.d.ts +3 -5
- package/dist/module-types/src/machine-link.d.ts +20 -0
- package/dist/module-types/src/pick-directory.d.ts +2 -0
- package/dist/module-types/src/project-modules.d.ts +12 -3
- package/dist/module-types/src/registry.d.ts +59 -16
- package/dist/module-types/src/repository-address.d.ts +22 -0
- package/dist/module-types/src/screens.d.ts +13 -0
- package/dist/module-types/src/store/agent-store.d.ts +2 -2
- package/dist/module-types/src/version.d.ts +1 -0
- package/dist/package-services.d.ts +27 -0
- package/dist/package-services.d.ts.map +1 -0
- package/dist/package-services.js +62 -0
- package/dist/package-services.js.map +1 -0
- package/dist/pick-directory.d.ts +2 -0
- package/dist/pick-directory.d.ts.map +1 -1
- package/dist/pick-directory.js +7 -1
- package/dist/pick-directory.js.map +1 -1
- package/dist/project-modules.d.ts +12 -3
- package/dist/project-modules.d.ts.map +1 -1
- package/dist/project-modules.js +20 -2
- package/dist/project-modules.js.map +1 -1
- package/dist/registry.d.ts +59 -16
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +91 -20
- package/dist/registry.js.map +1 -1
- package/dist/repository-address.d.ts +23 -0
- package/dist/repository-address.d.ts.map +1 -0
- package/dist/repository-address.js +38 -0
- package/dist/repository-address.js.map +1 -0
- package/dist/screens.d.ts +14 -0
- package/dist/screens.d.ts.map +1 -0
- package/dist/screens.js +40 -0
- package/dist/screens.js.map +1 -0
- package/dist/store/agent-store.d.ts +2 -2
- package/dist/store/agent-store.d.ts.map +1 -1
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +26 -0
- package/dist/version.js.map +1 -0
- package/package.json +15 -11
- package/dist/dashboard-bundle/assets/main-Q7JMdMJI.css +0 -2
- package/dist/dashboard-bundle/assets/main-fDZWGOub.js +0 -140
- package/dist/dashboard-rpc/devices.d.ts +0 -9
- package/dist/dashboard-rpc/devices.d.ts.map +0 -1
- package/dist/dashboard-rpc/devices.js +0 -12
- package/dist/dashboard-rpc/devices.js.map +0 -1
- package/dist/install.d.ts +0 -31
- package/dist/install.d.ts.map +0 -1
- package/dist/install.js +0 -54
- package/dist/install.js.map +0 -1
- package/dist/module-types/src/dashboard-rpc/devices.d.ts +0 -8
- package/dist/module-types/src/openagent-gitignore.d.ts +0 -11
- package/dist/openagent-gitignore.d.ts +0 -12
- package/dist/openagent-gitignore.d.ts.map +0 -1
- package/dist/openagent-gitignore.js +0 -19
- package/dist/openagent-gitignore.js.map +0 -1
package/README.md
CHANGED
|
@@ -14,18 +14,13 @@ cd ~/code/my-repo
|
|
|
14
14
|
openagent # serves the dashboard at http://127.0.0.1:4200
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
## The CLI is
|
|
17
|
+
## The CLI is three options and no verbs
|
|
18
18
|
|
|
19
19
|
```
|
|
20
20
|
openagent Serve the dashboard in the foreground. Ctrl+C closes it; the
|
|
21
21
|
agents it started go on to their own end.
|
|
22
22
|
|
|
23
23
|
--port <n> Dashboard port (default: 4200).
|
|
24
|
-
--host <addr> Bind address (default: 127.0.0.1). A non-loopback address
|
|
25
|
-
exposes the dashboard to your network and generates a shared
|
|
26
|
-
token; the printed URL carries it, and any request without it
|
|
27
|
-
gets 401. Exposing the daemon to the network is a security
|
|
28
|
-
decision.
|
|
29
24
|
-h, --help Show this help.
|
|
30
25
|
-v, --version Print the version.
|
|
31
26
|
```
|
package/dist/built-in.d.ts
CHANGED
|
@@ -5,12 +5,18 @@ import { type ProjectPackage, type ProvidedCommand, type ProvidedCommandLookup }
|
|
|
5
5
|
* own install, so a project installs nothing for them and an empty folder starts an agent and
|
|
6
6
|
* shows it. Each comes through the same contract as any package: a module by its `./dashboard`
|
|
7
7
|
* export, a provider of a kind of data and the writer of its hook lines by its `openagent` key.
|
|
8
|
-
* These
|
|
8
|
+
* These three lists are the one place OpenAgent names a package. One of these names among a
|
|
9
9
|
* project's own dependencies is not read: OpenAgent's copy, and the rules below for which
|
|
10
10
|
* project has it, are the only ones.
|
|
11
11
|
*/
|
|
12
12
|
/** The packages every project has: an agent cannot start, be shown or be put on a git host without them. */
|
|
13
13
|
export declare const BUILT_IN_PACKAGES: readonly string[];
|
|
14
|
+
/**
|
|
15
|
+
* The packages that are this computer's and no project's: the door to it, and the servers it
|
|
16
|
+
* installed OpenAgent on. Their pages show and their commands run with no project added, and
|
|
17
|
+
* what one keeps is in the person's home folder.
|
|
18
|
+
*/
|
|
19
|
+
export declare const COMPUTER_PACKAGES: readonly string[];
|
|
14
20
|
/**
|
|
15
21
|
* The packages a project has once it picked them (#2023). A skill's package is the project's
|
|
16
22
|
* when the project holds the skill's text where the coding agents read it
|
|
@@ -27,11 +33,21 @@ export declare function builtInPackages(): Promise<ProjectPackage[]>;
|
|
|
27
33
|
/**
|
|
28
34
|
* The packages OpenAgent brings to the project at `root`: the ones every project has, and
|
|
29
35
|
* each picked one the project has by its rule (see {@link PICKED_PACKAGES}). Read off the
|
|
30
|
-
* project's files each time, so a skill written or deleted a moment ago counts at once.
|
|
36
|
+
* project's files each time, so a skill written or deleted a moment ago counts at once. None of
|
|
37
|
+
* the computer's: no project has those.
|
|
31
38
|
*/
|
|
32
39
|
export declare function builtInPackagesOf(root: string): Promise<ProjectPackage[]>;
|
|
33
40
|
/** The project's own installed packages, less the names OpenAgent brings itself. */
|
|
34
41
|
export declare function ownPackages(root: string): Promise<ProjectPackage[]>;
|
|
42
|
+
/** The packages that are this computer's: see {@link COMPUTER_PACKAGES}. */
|
|
43
|
+
export declare function computerPackages(): Promise<ProjectPackage[]>;
|
|
44
|
+
/**
|
|
45
|
+
* The services of the computer's packages: a package declares
|
|
46
|
+
* `"openagent": { "service": "<command>" }`, and `<command> serve` runs for as long as OpenAgent
|
|
47
|
+
* runs (`package-services.ts`). Only those packages: a service is this computer's, and any
|
|
48
|
+
* other package is a project's.
|
|
49
|
+
*/
|
|
50
|
+
export declare function builtInServices(): Promise<ProvidedCommand[]>;
|
|
35
51
|
/** The directories the commands of OpenAgent's packages sit in: what a hook line's PATH gains after the project's own installed tools. */
|
|
36
52
|
export declare function builtInBinDirs(): Promise<string[]>;
|
|
37
53
|
/** What provides `kind` in the project at `root`: a package the project installed for it, else one OpenAgent brings to this project. */
|
package/dist/built-in.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"built-in.d.ts","sourceRoot":"","sources":["../src/built-in.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAGzD,OAAO,EAA6G,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,KAAK,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAEtN;;;;;;;;GAQG;AAEH,4GAA4G;AAC5G,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAA2H,CAAA;AAE1K;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,MA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CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAEtG;AAED,gGAAgG;AAChG,wBAAgB,SAAS,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAE3D;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAQpE;AAED;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAkBtE"}
|
package/dist/built-in.js
CHANGED
|
@@ -9,12 +9,18 @@ import { declaring, lineRuns, lookupProvidedCommand, packageBins, projectPackage
|
|
|
9
9
|
* own install, so a project installs nothing for them and an empty folder starts an agent and
|
|
10
10
|
* shows it. Each comes through the same contract as any package: a module by its `./dashboard`
|
|
11
11
|
* export, a provider of a kind of data and the writer of its hook lines by its `openagent` key.
|
|
12
|
-
* These
|
|
12
|
+
* These three lists are the one place OpenAgent names a package. One of these names among a
|
|
13
13
|
* project's own dependencies is not read: OpenAgent's copy, and the rules below for which
|
|
14
14
|
* project has it, are the only ones.
|
|
15
15
|
*/
|
|
16
16
|
/** The packages every project has: an agent cannot start, be shown or be put on a git host without them. */
|
|
17
17
|
export const BUILT_IN_PACKAGES = ['@openagt/files', '@openagt/skill-branches', '@openagt/skill-github', '@openagt/skill-logs', '@openagt/agent-runner'];
|
|
18
|
+
/**
|
|
19
|
+
* The packages that are this computer's and no project's: the door to it, and the servers it
|
|
20
|
+
* installed OpenAgent on. Their pages show and their commands run with no project added, and
|
|
21
|
+
* what one keeps is in the person's home folder.
|
|
22
|
+
*/
|
|
23
|
+
export const COMPUTER_PACKAGES = ['@openagt/remote-access', '@openagt/servers'];
|
|
18
24
|
/**
|
|
19
25
|
* The packages a project has once it picked them (#2023). A skill's package is the project's
|
|
20
26
|
* when the project holds the skill's text where the coding agents read it
|
|
@@ -23,9 +29,9 @@ export const BUILT_IN_PACKAGES = ['@openagt/files', '@openagt/skill-branches', '
|
|
|
23
29
|
* tool with no skill text (the scheduler) is the project's when one of the project's hook lines
|
|
24
30
|
* runs it.
|
|
25
31
|
*/
|
|
26
|
-
export const PICKED_PACKAGES = ['@openagt/skill-tickets', '@openagt/skill-queue', '@openagt/skill-orchestration', '@openagt/agent-scheduler'];
|
|
32
|
+
export const PICKED_PACKAGES = ['@openagt/skill-tickets', '@openagt/skill-queue', '@openagt/skill-orchestration', '@openagt/skill-browser', '@openagt/agent-scheduler'];
|
|
27
33
|
/** Every name OpenAgent brings itself. */
|
|
28
|
-
export const OWN_PACKAGE_NAMES = [...BUILT_IN_PACKAGES, ...PICKED_PACKAGES];
|
|
34
|
+
export const OWN_PACKAGE_NAMES = [...BUILT_IN_PACKAGES, ...COMPUTER_PACKAGES, ...PICKED_PACKAGES];
|
|
29
35
|
let resolved;
|
|
30
36
|
/** Every package OpenAgent brings, resolved from its own install, once; one that is not installed is skipped. */
|
|
31
37
|
export function builtInPackages() {
|
|
@@ -47,20 +53,24 @@ async function resolveOwn() {
|
|
|
47
53
|
if (!dir || !manifest)
|
|
48
54
|
continue;
|
|
49
55
|
const skill = /^name:[ \t]*([a-z0-9][a-z0-9-]*)[ \t]*$/m.exec(/^---\r?\n([\s\S]*?)\r?\n---/.exec(await readFile(join(dir, 'SKILL.md'), 'utf8').catch(() => ''))?.[1] ?? '')?.[1];
|
|
50
|
-
|
|
56
|
+
const of = PICKED_PACKAGES.includes(name) ? 'a pick' : COMPUTER_PACKAGES.includes(name) ? 'the computer' : 'every project';
|
|
57
|
+
packages.push({ name, dir, manifest, of, ...(skill !== undefined ? { skill } : {}) });
|
|
51
58
|
}
|
|
52
59
|
return packages;
|
|
53
60
|
}
|
|
54
61
|
/**
|
|
55
62
|
* The packages OpenAgent brings to the project at `root`: the ones every project has, and
|
|
56
63
|
* each picked one the project has by its rule (see {@link PICKED_PACKAGES}). Read off the
|
|
57
|
-
* project's files each time, so a skill written or deleted a moment ago counts at once.
|
|
64
|
+
* project's files each time, so a skill written or deleted a moment ago counts at once. None of
|
|
65
|
+
* the computer's: no project has those.
|
|
58
66
|
*/
|
|
59
67
|
export async function builtInPackagesOf(root) {
|
|
60
68
|
const packages = [];
|
|
61
69
|
let lines;
|
|
62
70
|
for (const pkg of await (resolved ??= resolveOwn())) {
|
|
63
|
-
if (pkg.
|
|
71
|
+
if (pkg.of === 'the computer')
|
|
72
|
+
continue;
|
|
73
|
+
if (pkg.of === 'a pick') {
|
|
64
74
|
if (pkg.skill !== undefined ? !(await holdsSkill(root, pkg.skill)) : !runsOneOf((lines ??= await hookLines(root)), pkg))
|
|
65
75
|
continue;
|
|
66
76
|
}
|
|
@@ -91,6 +101,19 @@ function runsOneOf(lines, pkg) {
|
|
|
91
101
|
export async function ownPackages(root) {
|
|
92
102
|
return (await projectPackages(root)).filter(pkg => !OWN_PACKAGE_NAMES.includes(pkg.name));
|
|
93
103
|
}
|
|
104
|
+
/** The packages that are this computer's: see {@link COMPUTER_PACKAGES}. */
|
|
105
|
+
export async function computerPackages() {
|
|
106
|
+
return (await (resolved ??= resolveOwn())).filter(pkg => pkg.of === 'the computer');
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The services of the computer's packages: a package declares
|
|
110
|
+
* `"openagent": { "service": "<command>" }`, and `<command> serve` runs for as long as OpenAgent
|
|
111
|
+
* runs (`package-services.ts`). Only those packages: a service is this computer's, and any
|
|
112
|
+
* other package is a project's.
|
|
113
|
+
*/
|
|
114
|
+
export async function builtInServices() {
|
|
115
|
+
return declaring(await computerPackages(), 'service');
|
|
116
|
+
}
|
|
94
117
|
/** The directories the commands of OpenAgent's packages sit in: what a hook line's PATH gains after the project's own installed tools. */
|
|
95
118
|
export async function builtInBinDirs() {
|
|
96
119
|
const dirs = new Set();
|
package/dist/built-in.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"built-in.js","sourceRoot":"","sources":["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A6D,CAAA;IAC3F,IAAI,EAAE,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,SAAS,CAAA;IACpF,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC;QAAE,OAAO,SAAS,CAAA;IACtE,MAAM,MAAM,GAAG,CAAC,KAAc,EAA6C,EAAE,CAC3E,OAAO,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAQ,KAA4B,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAQ,KAA8B,CAAC,MAAM,KAAK,QAAQ,CAAA;IACrK,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAA;IACzC,OAAO,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,CAAa,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAA;AACrH,CAAC"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -4,26 +4,20 @@ export interface CliIO {
|
|
|
4
4
|
out: (line: string) => void;
|
|
5
5
|
err: (line: string) => void;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
/** What the CLI itself accepts: four options, no verbs (D4). */
|
|
7
|
+
/** What the CLI itself accepts: three options, no verbs (D4). */
|
|
9
8
|
export interface CliArgs {
|
|
10
9
|
help: boolean;
|
|
11
10
|
version: boolean;
|
|
12
11
|
/** `--port <n>`: the port the dashboard binds. Default {@link DEFAULT_DAEMON_PORT}; `0` is ephemeral. */
|
|
13
12
|
port?: number;
|
|
14
|
-
/**
|
|
15
|
-
* `--host <addr>` (#1051): the dashboard's bind address. Default loopback; a non-loopback
|
|
16
|
-
* address exposes it to the network and gates every route behind the generated shared token.
|
|
17
|
-
*/
|
|
18
|
-
host?: string;
|
|
19
13
|
error?: string;
|
|
20
14
|
}
|
|
21
15
|
/**
|
|
22
16
|
* Parse argv (without the node/script prefix). Pure and testable.
|
|
23
17
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
18
|
+
* Three options and nothing else: `--port` because it is the one thing a browser cannot be asked
|
|
19
|
+
* and a dashboard cannot serve about itself; `--help` and `--version` because a command with
|
|
20
|
+
* options owes the user both. The command runs no agent (#1774): a run is started
|
|
27
21
|
* from the dashboard, by the project's own start hook.
|
|
28
22
|
*/
|
|
29
23
|
export declare function parseArgs(argv: string[]): CliArgs;
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0D,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAK/G,gEAAgE;AAChE,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3B,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAC5B;AAwBD,iEAAiE;AACjE,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;IAChB,yGAAyG;IACzG,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAyBjD;AAED,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,GAAE,KAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBnF;AA6BD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,GAAE;IAAE,WAAW,CAAC,EAAE,cAAc,CAAA;CAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAaxG"}
|
package/dist/cli.js
CHANGED
|
@@ -1,36 +1,11 @@
|
|
|
1
|
-
import { readFileSync } from 'node:fs';
|
|
2
|
-
import { dirname, join } from 'node:path';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
4
1
|
import { checkForUpdate, formatUpdateStatus, nodeVersionFetcher } from './update-check.js';
|
|
5
|
-
import {
|
|
6
|
-
import { ensureDaemonToken } from './registry.js';
|
|
2
|
+
import { runDaemon, DEFAULT_DAEMON_PORT } from './daemon.js';
|
|
7
3
|
import { errorMessage } from './error-message.js';
|
|
4
|
+
import { openagentVersion } from './version.js';
|
|
8
5
|
const defaultIO = {
|
|
9
6
|
out: line => process.stdout.write(line + '\n'),
|
|
10
7
|
err: line => process.stderr.write(line + '\n'),
|
|
11
8
|
};
|
|
12
|
-
/**
|
|
13
|
-
* The CLI version, read from the package's own `package.json` at runtime (#312).
|
|
14
|
-
* The compiled entry lives one level under the package root (`dist/` or
|
|
15
|
-
* `dist-test/`), so its `package.json` is always `../package.json`. Cached after
|
|
16
|
-
* the first read; falls back to `unknown` if the file is somehow unreadable.
|
|
17
|
-
*/
|
|
18
|
-
let cachedVersion;
|
|
19
|
-
export function openagentVersion() {
|
|
20
|
-
if (cachedVersion !== undefined)
|
|
21
|
-
return cachedVersion;
|
|
22
|
-
try {
|
|
23
|
-
const pkgPath = join(dirname(fileURLToPath(import.meta.url)), '..', 'package.json');
|
|
24
|
-
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
|
|
25
|
-
// `unknown`, not `0.0.0`: the packages are unreleased and legitimately versioned `0.0.0`, so a
|
|
26
|
-
// numeric fallback would make a failed read indistinguishable from a correct one (#312).
|
|
27
|
-
cachedVersion = pkg.version ?? 'unknown';
|
|
28
|
-
}
|
|
29
|
-
catch {
|
|
30
|
-
cachedVersion = 'unknown';
|
|
31
|
-
}
|
|
32
|
-
return cachedVersion;
|
|
33
|
-
}
|
|
34
9
|
const HELP = `OpenAgent — turnkey AI orchestration that wraps a coding agent (Claude Code or Codex).
|
|
35
10
|
|
|
36
11
|
Usage:
|
|
@@ -39,22 +14,20 @@ Usage:
|
|
|
39
14
|
|
|
40
15
|
Options:
|
|
41
16
|
--port <n> Dashboard port (default: 4200).
|
|
42
|
-
--host <addr> Bind address (default: 127.0.0.1, localhost only). A non-loopback
|
|
43
|
-
address (e.g. 0.0.0.0) exposes the dashboard to your network and
|
|
44
|
-
generates a shared token; the printed URL carries it, and any request
|
|
45
|
-
without it gets 401. Exposing a process spawner to the network is a
|
|
46
|
-
security decision (#806).
|
|
47
17
|
-h, --help Show this help.
|
|
48
18
|
-v, --version Print the version.
|
|
49
19
|
|
|
20
|
+
The dashboard listens on this computer only. A phone, or another computer's OpenAgent, gets in
|
|
21
|
+
from its Settings page: Devices.
|
|
22
|
+
|
|
50
23
|
Everything else is the dashboard: it shows a project's runs from their files, and starts one
|
|
51
24
|
through the project's own start hook (.openagent/hooks.yml), which names the tool that runs it.`;
|
|
52
25
|
/**
|
|
53
26
|
* Parse argv (without the node/script prefix). Pure and testable.
|
|
54
27
|
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
28
|
+
* Three options and nothing else: `--port` because it is the one thing a browser cannot be asked
|
|
29
|
+
* and a dashboard cannot serve about itself; `--help` and `--version` because a command with
|
|
30
|
+
* options owes the user both. The command runs no agent (#1774): a run is started
|
|
58
31
|
* from the dashboard, by the project's own start hook.
|
|
59
32
|
*/
|
|
60
33
|
export function parseArgs(argv) {
|
|
@@ -75,19 +48,12 @@ export function parseArgs(argv) {
|
|
|
75
48
|
if (Number.isInteger(n) && n >= 0)
|
|
76
49
|
opts.port = n;
|
|
77
50
|
else
|
|
78
|
-
opts.error
|
|
79
|
-
break;
|
|
80
|
-
}
|
|
81
|
-
case '--host': {
|
|
82
|
-
const value = argv[++i];
|
|
83
|
-
if (value === undefined)
|
|
84
|
-
opts.error = 'invalid --host: missing address';
|
|
85
|
-
else
|
|
86
|
-
opts.host = value;
|
|
51
|
+
opts.error ??= 'invalid --port: must be a non-negative integer';
|
|
87
52
|
break;
|
|
88
53
|
}
|
|
89
54
|
default:
|
|
90
|
-
|
|
55
|
+
// The first thing that could not be read is the one told: what follows an unknown option is its value, not a command.
|
|
56
|
+
opts.error ??= arg.startsWith('-') ? `unknown option: ${arg}` : `unknown command: ${arg}`;
|
|
91
57
|
}
|
|
92
58
|
}
|
|
93
59
|
return opts;
|
|
@@ -118,19 +84,11 @@ export async function runCli(argv, io = defaultIO) {
|
|
|
118
84
|
async function runForegroundDaemonCmd(args, io) {
|
|
119
85
|
const cwd = process.cwd();
|
|
120
86
|
const port = args.port ?? DEFAULT_DAEMON_PORT;
|
|
121
|
-
const host = args.host;
|
|
122
|
-
// #1051: pre-generate the shared token for a non-loopback bind so onListening (sync) can print
|
|
123
|
-
// the reachable URL; runDaemon reuses the same persisted token.
|
|
124
|
-
const token = host !== undefined && !isLoopbackHost(host) ? await ensureDaemonToken() : undefined;
|
|
125
87
|
try {
|
|
126
88
|
await runDaemon(cwd, {
|
|
127
89
|
port,
|
|
128
|
-
...(host !== undefined ? { host } : {}),
|
|
129
90
|
onListening: state => {
|
|
130
91
|
io.out(`◆ dashboard running: ${state.url}`);
|
|
131
|
-
if (!isLoopbackHost(state.host ?? DEFAULT_DAEMON_HOST)) {
|
|
132
|
-
printNonLoopbackAccess(io, state.host ?? DEFAULT_DAEMON_HOST, state.url, token);
|
|
133
|
-
}
|
|
134
92
|
io.out(' Ctrl+C to stop the dashboard. Server logs stream below.');
|
|
135
93
|
// #312 asks bare `openagent` to print the commands + version too. onListening is sync and
|
|
136
94
|
// runDaemon then blocks until signalled, so this is fire-and-forget by necessity: the
|
|
@@ -145,20 +103,6 @@ async function runForegroundDaemonCmd(args, io) {
|
|
|
145
103
|
}
|
|
146
104
|
return 0;
|
|
147
105
|
}
|
|
148
|
-
/**
|
|
149
|
-
* The loud one-line warning and the token-bearing URL printed on any non-loopback daemon bind
|
|
150
|
-
* (#1051). A daemon that spawns processes is code execution for anyone who reaches the port, and
|
|
151
|
-
* the shared token is the only guard, so this says so before the daemon is left running. The bound
|
|
152
|
-
* host is a bind-all like `0.0.0.0`, so the user swaps it for the machine's actual reachable
|
|
153
|
-
* address (a Tailscale/LAN hostname); the token rides the URL for the first hop, then the cookie.
|
|
154
|
-
*/
|
|
155
|
-
function printNonLoopbackAccess(io, host, url, token) {
|
|
156
|
-
io.err(`⚠ SECURITY: bound to ${host} (non-loopback). This exposes code execution to your network; the shared token is the only guard (#1051).`);
|
|
157
|
-
if (!token)
|
|
158
|
-
return;
|
|
159
|
-
io.out(` Open with the token (swap ${host} for this machine's reachable address, e.g. a Tailscale hostname):`);
|
|
160
|
-
io.out(` ${url}/?token=${token}`);
|
|
161
|
-
}
|
|
162
106
|
/**
|
|
163
107
|
* The startup footer every dashboard path prints (#312): where prompts come from, the version,
|
|
164
108
|
* and then — once npm answers — whether that version is the latest.
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,kBAAkB,EAAuB,MAAM,mBAAmB,CAAA;AAC/G,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,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DAA2D;gBAC3D,KAAK,kBAAkB,CAAC,EAAE,CAAC,CAAA;YAC7B,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,EAAE,CAAC,GAAG,CAAC,kCAAkC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC/D,OAAO,CAAC,CAAA;IACV,CAAC;IACD,OAAO,CAAC,CAAA;AACV,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,EAAS,EAAE,IAAI,GAAqC,EAAE;IACvF,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAA;IAClC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IACV,EAAE,CAAC,GAAG,CAAC,2DAA2D,CAAC,CAAA;IACnE,EAAE,CAAC,GAAG,CAAC,6CAA6C,CAAC,CAAA;IACrD,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IACV,EAAE,CAAC,GAAG,CAAC,cAAc,OAAO,EAAE,CAAC,CAAA;IAC/B,OAAO,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,IAAI,kBAAkB,EAAE,CAAC;SACrE,IAAI,CAAC,MAAM,CAAC,EAAE;QACb,MAAM,IAAI,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAA;QACvC,IAAI,IAAI;YAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IACxB,CAAC,CAAC;SACD,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;AACpB,CAAC"}
|
package/dist/client.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { DRIVERS, DRIVER_LABELS, isDriverName, driverFromImpl, type DriverName } from './driver-names.js';
|
|
2
2
|
export { PUBLISH_LABELS, isPublishPick, offeredPublishPicks, publishPickIn, type PublishPick } from './publish-levels.js';
|
|
3
3
|
export { formatOpenAgentEvent } from './terminal.js';
|
|
4
|
+
export { foldScreenRows } from './screens.js';
|
|
4
5
|
export { formatBytes } from './format-bytes.js';
|
|
5
6
|
export { errorMessage } from './error-message.js';
|
|
6
7
|
export { pickedIds } from './events.js';
|
|
@@ -10,7 +11,7 @@ export { interventionKey, activityKey } from './dashboard/keys.js';
|
|
|
10
11
|
export { SeenTracker } from './dashboard/keyed-watcher.js';
|
|
11
12
|
export type { ProjectionRead } from './dashboard/projects.js';
|
|
12
13
|
export { NOTIFICATION_DEFAULTS, MAX_SPEND_OFFSET, notifies, browserNotifyEnabled, notifyCategoryEnabled, type NotifyCategory } from './preference-defaults.js';
|
|
13
|
-
export {
|
|
14
|
+
export { parseMachineLink } from './machine-link.js';
|
|
14
15
|
export { bridgeChoiceRequest } from './dashboard/bridge-question.js';
|
|
15
16
|
export { cloudRunState, cloudRunActive, CLOUD_SESSION_WINDOW_MS, type CloudRunState } from './cloud-run-state.js';
|
|
16
17
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACzG,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACzH,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EACL,WAAW,EACX,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,UAAU,GAChB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EA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Q,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAE9J,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AAEpE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,uBAAuB,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAA"}
|
package/dist/client.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
export { DRIVERS, DRIVER_LABELS, isDriverName, driverFromImpl } from './driver-names.js';
|
|
6
6
|
export { PUBLISH_LABELS, isPublishPick, offeredPublishPicks, publishPickIn } from './publish-levels.js';
|
|
7
7
|
export { formatOpenAgentEvent } from './terminal.js';
|
|
8
|
+
export { foldScreenRows } from './screens.js';
|
|
8
9
|
export { formatBytes } from './format-bytes.js';
|
|
9
10
|
export { errorMessage } from './error-message.js';
|
|
10
11
|
export { pickedIds } from './events.js';
|
|
@@ -19,10 +20,8 @@ export { interventionKey, activityKey } from './dashboard/keys.js';
|
|
|
19
20
|
// git host reach take an empty backlog for a real one. Pure, and its only import is a type.
|
|
20
21
|
export { SeenTracker } from './dashboard/keyed-watcher.js';
|
|
21
22
|
export { NOTIFICATION_DEFAULTS, MAX_SPEND_OFFSET, notifies, browserNotifyEnabled, notifyCategoryEnabled } from './preference-defaults.js';
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
// kept its own looser copy, which answered `false` for every 127.0.0.0/8 address but the first.
|
|
25
|
-
export { isLoopbackHost } from './loopback-host.js';
|
|
23
|
+
// How a pasted machine link is read, so the dialog and the daemon read a paste the same way.
|
|
24
|
+
export { parseMachineLink } from './machine-link.js';
|
|
26
25
|
// A bridged question as the gate panel renders it (#1554): pure, so the client projects it itself.
|
|
27
26
|
export { bridgeChoiceRequest } from './dashboard/bridge-question.js';
|
|
28
27
|
// What a web run's cloud side is doing, from its record (#1668): pure, so every surface derives the same word.
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,wFAAwF;AACxF,oFAAoF;AACpF,qFAAqF;AACrF,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAmB,MAAM,mBAAmB,CAAA;AACzG,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,aAAa,EAAoB,MAAM,qBAAqB,CAAA;AACzH,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EACL,WAAW,EACX,WAAW,GAGZ,MAAM,iBAAiB,CAAA;AACxB,8FAA8F;AAC9F,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,+FAA+F;AAC/F,8DAA8D;AAC9D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAClE,oGAAoG;AACpG,qGAAqG;AACrG,4FAA4F;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAE1D,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,oBAAoB,EAAE,qBAAqB,EAAuB,MAAM,0BAA0B,CAAA;AAC9J
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,wFAAwF;AACxF,oFAAoF;AACpF,qFAAqF;AACrF,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAmB,MAAM,mBAAmB,CAAA;AACzG,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,aAAa,EAAoB,MAAM,qBAAqB,CAAA;AACzH,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EACL,WAAW,EACX,WAAW,GAGZ,MAAM,iBAAiB,CAAA;AACxB,8FAA8F;AAC9F,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,+FAA+F;AAC/F,8DAA8D;AAC9D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAClE,oGAAoG;AACpG,qGAAqG;AACrG,4FAA4F;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAE1D,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,oBAAoB,EAAE,qBAAqB,EAAuB,MAAM,0BAA0B,CAAA;AAC9J,6FAA6F;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACpD,mGAAmG;AACnG,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AACpE,+GAA+G;AAC/G,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,uBAAuB,EAAsB,MAAM,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A project added by its repository's address, for a computer that does not have its folder: a
|
|
3
|
+
* server that was just connected has no screen to pick a folder on and no folder to pick. The
|
|
4
|
+
* repository is cloned into `~/projects/<its name>`, in the home of the user OpenAgent runs as,
|
|
5
|
+
* and that folder is then added like any other. Nothing is asked about where: the page says
|
|
6
|
+
* where it went.
|
|
7
|
+
*
|
|
8
|
+
* git clones with the logins this computer has (its credential helper, its SSH keys) and is
|
|
9
|
+
* never let ask a person for one: a repository it cannot read is refused in words.
|
|
10
|
+
*/
|
|
11
|
+
/** Where a repository is cloned from and to. */
|
|
12
|
+
export interface CloneTarget {
|
|
13
|
+
/** What git is given. */
|
|
14
|
+
url: string;
|
|
15
|
+
/** The repository's one name on every machine: see `addressOfRemote`. */
|
|
16
|
+
address: string;
|
|
17
|
+
/** The folder it is cloned into. */
|
|
18
|
+
path: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Read what a person typed as a repository's address: `github.com/you/shop`, the same with
|
|
22
|
+
* `https://` before it, `ssh://git@github.com/you/shop.git`, or `git@github.com:you/shop.git`.
|
|
23
|
+
* Undefined for anything else: a folder on this disk, another kind of address, a name that could
|
|
24
|
+
* be read as an option or lead out of the folder projects are cloned into.
|
|
25
|
+
*/
|
|
26
|
+
export declare function cloneTarget(typed: string, home?: string): CloneTarget | undefined;
|
|
27
|
+
/** How a clone went: the folder the project is in, and whether it was cloned now or was already there. */
|
|
28
|
+
export type Cloned = {
|
|
29
|
+
ok: true;
|
|
30
|
+
path: string;
|
|
31
|
+
cloned: boolean;
|
|
32
|
+
} | {
|
|
33
|
+
ok: false;
|
|
34
|
+
error: string;
|
|
35
|
+
};
|
|
36
|
+
/** Run git and answer how it ended, with what it said on its error side. */
|
|
37
|
+
export type CloneRunner = (args: readonly string[], env: NodeJS.ProcessEnv, timeoutMs: number) => Promise<{
|
|
38
|
+
ok: true;
|
|
39
|
+
} | {
|
|
40
|
+
ok: false;
|
|
41
|
+
said: string;
|
|
42
|
+
timedOut: boolean;
|
|
43
|
+
}>;
|
|
44
|
+
/** Where what a person typed would be cloned to, before anything is cloned: what the page shows to be confirmed. */
|
|
45
|
+
export declare function cloneTargetOf(typed: string, home?: string): {
|
|
46
|
+
ok: true;
|
|
47
|
+
address: string;
|
|
48
|
+
path: string;
|
|
49
|
+
} | {
|
|
50
|
+
ok: false;
|
|
51
|
+
error: string;
|
|
52
|
+
};
|
|
53
|
+
export interface CloneOptions {
|
|
54
|
+
home?: string;
|
|
55
|
+
run?: CloneRunner;
|
|
56
|
+
env?: NodeJS.ProcessEnv;
|
|
57
|
+
timeoutMs?: number;
|
|
58
|
+
/** The person's own way to SSH for git, when they set one; read off git's settings when unsaid. */
|
|
59
|
+
sshCommand?: (env: NodeJS.ProcessEnv) => Promise<string | undefined>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Clone the repository a person typed the address of into `~/projects/<its name>`. A folder that
|
|
63
|
+
* is already there and holds this very repository is taken as it is; one that holds anything
|
|
64
|
+
* else is never written over, and is refused. The clone is made beside that folder and moved
|
|
65
|
+
* there once it is whole: a clone that fails leaves nothing behind, and one on its way is no
|
|
66
|
+
* folder a second ask could take for the project.
|
|
67
|
+
*/
|
|
68
|
+
export declare function cloneProject(typed: string, opts?: CloneOptions): Promise<Cloned>;
|
|
69
|
+
//# sourceMappingURL=clone-project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clone-project.d.ts","sourceRoot":"","sources":["../src/clone-project.ts"],"names":[],"mappings":"AAMA;;;;;;;;;GASG;AAEH,gDAAgD;AAChD,MAAM,WAAW,WAAW;IAC1B,yBAAyB;IACzB,GAAG,EAAE,MAAM,CAAA;IACX,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAA;IACf,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAA;CACb;AAMD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,MAAkB,GAAG,WAAW,GAAG,SAAS,CAkB5F;AAED,0GAA0G;AAC1G,MAAM,MAAM,MAAM,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IA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