@corenel/tools-node 0.2.1 → 0.2.2
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/LICENSE +93 -0
- package/dist/auth.d.ts +9 -2
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +20 -4
- package/dist/auth.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/migrateHome.d.ts +15 -0
- package/dist/migrateHome.d.ts.map +1 -0
- package/dist/migrateHome.js +139 -0
- package/dist/migrateHome.js.map +1 -0
- package/dist/promptHost.d.ts +1 -1
- package/dist/promptHost.d.ts.map +1 -1
- package/dist/promptHost.js +6 -1
- package/dist/promptHost.js.map +1 -1
- package/package.json +4 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Elastic License 2.0
|
|
2
|
+
|
|
3
|
+
URL: https://www.elastic.co/licensing/elastic-license
|
|
4
|
+
|
|
5
|
+
## Acceptance
|
|
6
|
+
|
|
7
|
+
By using the software, you agree to all of the terms and conditions below.
|
|
8
|
+
|
|
9
|
+
## Copyright License
|
|
10
|
+
|
|
11
|
+
The licensor grants you a non-exclusive, royalty-free, worldwide,
|
|
12
|
+
non-sublicensable, non-transferable license to use, copy, distribute, make
|
|
13
|
+
available, and prepare derivative works of the software, in each case subject to
|
|
14
|
+
the limitations and conditions below.
|
|
15
|
+
|
|
16
|
+
## Limitations
|
|
17
|
+
|
|
18
|
+
You may not provide the software to third parties as a hosted or managed
|
|
19
|
+
service, where the service provides users with access to any substantial set of
|
|
20
|
+
the features or functionality of the software.
|
|
21
|
+
|
|
22
|
+
You may not move, change, disable, or circumvent the license key functionality
|
|
23
|
+
in the software, and you may not remove or obscure any functionality in the
|
|
24
|
+
software that is protected by the license key.
|
|
25
|
+
|
|
26
|
+
You may not alter, remove, or obscure any licensing, copyright, or other notices
|
|
27
|
+
of the licensor in the software. Any use of the licensor's trademarks is subject
|
|
28
|
+
to applicable law.
|
|
29
|
+
|
|
30
|
+
## Patents
|
|
31
|
+
|
|
32
|
+
The licensor grants you a license, under any patent claims the licensor can
|
|
33
|
+
license, or becomes able to license, to make, have made, use, sell, offer for
|
|
34
|
+
sale, import and have imported the software, in each case subject to the
|
|
35
|
+
limitations and conditions in this license. This license does not cover any
|
|
36
|
+
patent claims that you cause to be infringed by modifications or additions to
|
|
37
|
+
the software. If you or your company make any written claim that the software
|
|
38
|
+
infringes or contributes to infringement of any patent, your patent license for
|
|
39
|
+
the software granted under these terms ends immediately. If your company makes
|
|
40
|
+
such a claim, your patent license ends immediately for work on behalf of your
|
|
41
|
+
company.
|
|
42
|
+
|
|
43
|
+
## Notices
|
|
44
|
+
|
|
45
|
+
You must ensure that anyone who gets a copy of any part of the software from you
|
|
46
|
+
also gets a copy of these terms.
|
|
47
|
+
|
|
48
|
+
If you modify the software, you must include in any modified copies of the
|
|
49
|
+
software prominent notices stating that you have modified the software.
|
|
50
|
+
|
|
51
|
+
## No Other Rights
|
|
52
|
+
|
|
53
|
+
These terms do not imply any licenses other than those expressly granted in
|
|
54
|
+
these terms.
|
|
55
|
+
|
|
56
|
+
## Termination
|
|
57
|
+
|
|
58
|
+
If you use the software in violation of these terms, such use is not licensed,
|
|
59
|
+
and your licenses will automatically terminate. If the licensor provides you
|
|
60
|
+
with a notice of your violation, and you cease all violation of this license no
|
|
61
|
+
later than 30 days after you receive that notice, your licenses will be
|
|
62
|
+
reinstated retroactively. However, if you violate these terms after such
|
|
63
|
+
reinstatement, any additional violation of these terms will cause your licenses
|
|
64
|
+
to terminate automatically and permanently.
|
|
65
|
+
|
|
66
|
+
## No Liability
|
|
67
|
+
|
|
68
|
+
*As far as the law allows, the software comes as is, without any warranty or
|
|
69
|
+
condition, and the licensor will not be liable to you for any damages arising out
|
|
70
|
+
of these terms or the use or nature of the software, under any kind of legal
|
|
71
|
+
claim.*
|
|
72
|
+
|
|
73
|
+
## Definitions
|
|
74
|
+
|
|
75
|
+
The **licensor** is the entity offering these terms, and the **software** is the
|
|
76
|
+
software the licensor makes available under these terms, including any portion of
|
|
77
|
+
it.
|
|
78
|
+
|
|
79
|
+
**you** refers to the individual or entity agreeing to these terms.
|
|
80
|
+
|
|
81
|
+
**your company** is any legal entity, sole proprietorship, or other kind of
|
|
82
|
+
organization that you work for, plus all organizations that have control over, are
|
|
83
|
+
under the control of, or are under common control with that organization.
|
|
84
|
+
**control** means ownership of substantially all the assets of an entity, or the
|
|
85
|
+
power to direct its management and policies by vote, contract, or otherwise.
|
|
86
|
+
Control can be direct or indirect.
|
|
87
|
+
|
|
88
|
+
**your licenses** are all the licenses granted to you for the software under these
|
|
89
|
+
terms.
|
|
90
|
+
|
|
91
|
+
**use** means anything you do with the software requiring one of your licenses.
|
|
92
|
+
|
|
93
|
+
**trademark** means trademarks, service marks, and similar rights.
|
package/dist/auth.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { IAuthTokenProvider } from '@corenel/protocol';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/** The state dir: `<home>/.corenel`. ALSO the global crew root -- global agents
|
|
3
|
+
* resolve as `<stateDir>/crew` -- so this never moves. */
|
|
4
|
+
export declare function corenelDir(base?: string): string;
|
|
5
|
+
/** Where the daemon keeps its OWN files: identity, pairing token, TLS material,
|
|
6
|
+
* host mirrors. A subdirectory of the state dir, never a replacement for it. */
|
|
7
|
+
export declare function sidecarDir(base?: string): string;
|
|
8
|
+
/** The ACCOUNT token from the device flow. Top level, and staying there: it is
|
|
9
|
+
* not the daemon's, and moving it would sign the user out on upgrade. */
|
|
10
|
+
export declare function authTokenPath(base?: string): string;
|
|
4
11
|
export declare function writeAuthToken(token: string): Promise<void>;
|
|
5
12
|
export declare function readAuthToken(): Promise<string | null>;
|
|
6
13
|
export declare function clearAuthToken(): Promise<void>;
|
package/dist/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../auth.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../auth.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAW5D;2DAC2D;AAC3D,wBAAgB,UAAU,CAAC,IAAI,GAAE,MAAkB,GAAG,MAAM,CAE3D;AAED;iFACiF;AACjF,wBAAgB,UAAU,CAAC,IAAI,GAAE,MAAkB,GAAG,MAAM,CAE3D;AAED;0EAC0E;AAC1E,wBAAgB,aAAa,CAAC,IAAI,GAAE,MAAkB,GAAG,MAAM,CAE9D;AAED,wBAAsB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAcjE;AAED,wBAAsB,aAAa,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAO5D;AAED,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAEpD;AAED,uFAAuF;AACvF,wBAAgB,aAAa,IAAI,kBAAkB,CAElD"}
|
package/dist/auth.js
CHANGED
|
@@ -7,11 +7,27 @@ import { promises as fs } from 'node:fs';
|
|
|
7
7
|
import { homedir } from 'node:os';
|
|
8
8
|
import { join } from 'node:path';
|
|
9
9
|
import { stateDirName } from '@corenel/protocol';
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/* Every path helper takes an explicit base, defaulting to the real home.
|
|
11
|
+
*
|
|
12
|
+
* Not a convenience. The layout migration built on these MOVES files, and a
|
|
13
|
+
* helper that can only resolve homedir() would force every test of it to run
|
|
14
|
+
* against the developer's own ~/.corenel -- the one holding their edited
|
|
15
|
+
* personas. Taking a base makes that mistake impossible rather than
|
|
16
|
+
* discouraged. */
|
|
17
|
+
/** The state dir: `<home>/.corenel`. ALSO the global crew root -- global agents
|
|
18
|
+
* resolve as `<stateDir>/crew` -- so this never moves. */
|
|
19
|
+
export function corenelDir(base = homedir()) {
|
|
20
|
+
return join(base, stateDirName());
|
|
12
21
|
}
|
|
13
|
-
|
|
14
|
-
|
|
22
|
+
/** Where the daemon keeps its OWN files: identity, pairing token, TLS material,
|
|
23
|
+
* host mirrors. A subdirectory of the state dir, never a replacement for it. */
|
|
24
|
+
export function sidecarDir(base = homedir()) {
|
|
25
|
+
return join(corenelDir(base), 'sidecar');
|
|
26
|
+
}
|
|
27
|
+
/** The ACCOUNT token from the device flow. Top level, and staying there: it is
|
|
28
|
+
* not the daemon's, and moving it would sign the user out on upgrade. */
|
|
29
|
+
export function authTokenPath(base = homedir()) {
|
|
30
|
+
return join(corenelDir(base), 'token');
|
|
15
31
|
}
|
|
16
32
|
export async function writeAuthToken(token) {
|
|
17
33
|
/* 0o700 on the DIRECTORY, not just 0o600 on the file. Without a mode, mkdir
|
package/dist/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../auth.ts"],"names":[],"mappings":"AAAA;;;;yEAIyE;AACzE,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,UAAU,UAAU;
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../auth.ts"],"names":[],"mappings":"AAAA;;;;yEAIyE;AACzE,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,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,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC9D,OAAO,CAAC,IAAI,IAAI,CAAC;IACnB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,IAAI,CAAC;QAAC,MAAM,EAAE,CAAC,EAAE,CAAC,aAAa,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC,CAAC,kBAAkB,CAAC,CAAC;AACrF,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,aAAa;IAC3B,OAAO,EAAE,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,aAAa,EAAE,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,IAAI,EAAE,CAAC;AAChG,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { NodeFileService } from './fileService';
|
|
2
|
-
export { corenelDir, authTokenPath, writeAuthToken, readAuthToken, clearAuthToken, nodeAuthToken, } from './auth';
|
|
2
|
+
export { corenelDir, sidecarDir, authTokenPath, writeAuthToken, readAuthToken, clearAuthToken, nodeAuthToken, } from './auth';
|
|
3
3
|
export { nodePromptHost } from './promptHost';
|
|
4
|
+
export { migrateHomeLayout, type MigrationReport } from './migrateHome';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACL,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACL,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,GACpG,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* @corenel/tools-node — node capabilities (the tools-web twin). */
|
|
2
2
|
export { NodeFileService } from './fileService';
|
|
3
|
-
export { corenelDir, authTokenPath, writeAuthToken, readAuthToken, clearAuthToken, nodeAuthToken, } from './auth';
|
|
3
|
+
export { corenelDir, sidecarDir, authTokenPath, writeAuthToken, readAuthToken, clearAuthToken, nodeAuthToken, } from './auth';
|
|
4
4
|
export { nodePromptHost } from './promptHost';
|
|
5
|
+
export { migrateHomeLayout } from './migrateHome';
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACL,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACL,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,GACpG,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAwB,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface MigrationReport {
|
|
2
|
+
/** Destination paths that now hold something they did not before. */
|
|
3
|
+
moved: string[];
|
|
4
|
+
/** Sources deliberately left in place, with the reason. */
|
|
5
|
+
skipped: {
|
|
6
|
+
path: string;
|
|
7
|
+
reason: string;
|
|
8
|
+
}[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Bring `<base>/.corenel` to the current layout. Safe to call on every start:
|
|
12
|
+
* with nothing to do it is a stat and a return.
|
|
13
|
+
*/
|
|
14
|
+
export declare function migrateHomeLayout(base?: string): Promise<MigrationReport>;
|
|
15
|
+
//# sourceMappingURL=migrateHome.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrateHome.d.ts","sourceRoot":"","sources":["../migrateHome.ts"],"names":[],"mappings":"AA+BA,MAAM,WAAW,eAAe;IAC9B,qEAAqE;IACrE,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,2DAA2D;IAC3D,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC7C;AAiFD;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,GAAE,MAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,CAwB1F"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/* One-time move from the old `~/.corenel` layout to the current one.
|
|
2
|
+
*
|
|
3
|
+
* Two moves. `config/*` comes up a level, because that directory existed only
|
|
4
|
+
* because the CLI happened to append it. The daemon's private files go down
|
|
5
|
+
* into `sidecar/`, because they were sitting at the top level where the user's
|
|
6
|
+
* own material belongs.
|
|
7
|
+
*
|
|
8
|
+
* WHAT DOES NOT MOVE, and why each would hurt:
|
|
9
|
+
* - `crew/` global agents resolve as `<stateDir>/crew`; moving it
|
|
10
|
+
* orphans every installed one
|
|
11
|
+
* - `token` the ACCOUNT token; moving it signs the user out on upgrade
|
|
12
|
+
* - `policy.yaml` the user's default policy; moving it silently drops it
|
|
13
|
+
*
|
|
14
|
+
* NEVER CLOBBERS. A destination that already exists wins: the source is left
|
|
15
|
+
* alone and reported. That one rule buys three properties at once — a partial
|
|
16
|
+
* migration is safe to finish, a complete one is safe to repeat, and two
|
|
17
|
+
* processes racing at startup are safe by construction, because `rename`
|
|
18
|
+
* failing with EEXIST is precisely the outcome we wanted.
|
|
19
|
+
*
|
|
20
|
+
* NEVER DELETES BEFORE IT HAS WRITTEN. Across filesystems, where `rename` can't
|
|
21
|
+
* work, it copies and then removes — in that order, so an interruption leaves
|
|
22
|
+
* two copies of a file rather than none.
|
|
23
|
+
*
|
|
24
|
+
* Takes an explicit base so a test cannot be pointed at a real home directory.
|
|
25
|
+
* This function moves the user's edited personas; that guarantee is the point.
|
|
26
|
+
*/
|
|
27
|
+
import { promises as fs } from 'node:fs';
|
|
28
|
+
import { homedir } from 'node:os';
|
|
29
|
+
import { join, dirname } from 'node:path';
|
|
30
|
+
import { corenelDir, sidecarDir } from './auth';
|
|
31
|
+
/** Files the daemon owns. */
|
|
32
|
+
const SIDECAR_FILES = [
|
|
33
|
+
'daemon.id',
|
|
34
|
+
'daemon.token',
|
|
35
|
+
'hosts.json',
|
|
36
|
+
'sidecar.crt',
|
|
37
|
+
'sidecar.key',
|
|
38
|
+
'sidecar.sans.json',
|
|
39
|
+
];
|
|
40
|
+
/** Directories the daemon owns. `hosts/` holds mirrored client trees. */
|
|
41
|
+
const SIDECAR_DIRS = ['hosts'];
|
|
42
|
+
async function isDir(p) {
|
|
43
|
+
return fs.stat(p).then((s) => s.isDirectory()).catch(() => false);
|
|
44
|
+
}
|
|
45
|
+
async function present(p) {
|
|
46
|
+
return fs.stat(p).then(() => true).catch(() => false);
|
|
47
|
+
}
|
|
48
|
+
function code(e) {
|
|
49
|
+
return e?.code;
|
|
50
|
+
}
|
|
51
|
+
/** Move one file or directory, refusing to overwrite anything. */
|
|
52
|
+
async function moveEntry(from, to, report) {
|
|
53
|
+
if (!(await present(from)))
|
|
54
|
+
return;
|
|
55
|
+
if (await present(to)) {
|
|
56
|
+
report.skipped.push({ path: to, reason: 'destination already exists' });
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
await fs.mkdir(dirname(to), { recursive: true });
|
|
60
|
+
try {
|
|
61
|
+
await fs.rename(from, to);
|
|
62
|
+
report.moved.push(to);
|
|
63
|
+
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
const c = code(e);
|
|
66
|
+
if (c === 'EEXIST' || c === 'ENOTEMPTY') {
|
|
67
|
+
// Another process got there first. That is the result we wanted.
|
|
68
|
+
report.skipped.push({ path: to, reason: 'moved concurrently' });
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (c === 'ENOENT') {
|
|
72
|
+
// Another process moved the SOURCE out from under us, same reasoning.
|
|
73
|
+
report.skipped.push({ path: to, reason: 'moved concurrently' });
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (c === 'EXDEV') {
|
|
77
|
+
// Different filesystems. Copy first, remove second — never the reverse.
|
|
78
|
+
await fs.cp(from, to, { recursive: true });
|
|
79
|
+
await fs.rm(from, { recursive: true, force: true });
|
|
80
|
+
report.moved.push(to);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
throw e;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Move a directory's CONTENTS into `to`, merging with whatever is already
|
|
88
|
+
* there rather than replacing it.
|
|
89
|
+
*
|
|
90
|
+
* The merge matters for exactly one case today: a tree with a `config/crew/`
|
|
91
|
+
* would otherwise land on the real global crew root and take it out.
|
|
92
|
+
*/
|
|
93
|
+
async function mergeDir(from, to, report) {
|
|
94
|
+
const entries = await fs.readdir(from, { withFileTypes: true }).catch(() => []);
|
|
95
|
+
for (const e of entries) {
|
|
96
|
+
const src = join(from, e.name);
|
|
97
|
+
const dst = join(to, e.name);
|
|
98
|
+
if (e.isDirectory() && (await isDir(dst)))
|
|
99
|
+
await mergeDir(src, dst, report);
|
|
100
|
+
else
|
|
101
|
+
await moveEntry(src, dst, report);
|
|
102
|
+
}
|
|
103
|
+
// Succeeds only when nothing was skipped inside; a refused file keeps its
|
|
104
|
+
// parent alive, which is what makes the leftovers findable.
|
|
105
|
+
await fs.rmdir(from).catch(() => { });
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Bring `<base>/.corenel` to the current layout. Safe to call on every start:
|
|
109
|
+
* with nothing to do it is a stat and a return.
|
|
110
|
+
*/
|
|
111
|
+
export async function migrateHomeLayout(base = homedir()) {
|
|
112
|
+
const report = { moved: [], skipped: [] };
|
|
113
|
+
const home = corenelDir(base);
|
|
114
|
+
if (!(await present(home)))
|
|
115
|
+
return report;
|
|
116
|
+
const config = join(home, 'config');
|
|
117
|
+
if (await isDir(config))
|
|
118
|
+
await mergeDir(config, home, report);
|
|
119
|
+
const side = sidecarDir(base);
|
|
120
|
+
for (const name of SIDECAR_FILES) {
|
|
121
|
+
await moveEntry(join(home, name), join(side, name), report);
|
|
122
|
+
}
|
|
123
|
+
for (const name of SIDECAR_DIRS) {
|
|
124
|
+
const src = join(home, name);
|
|
125
|
+
if (!(await isDir(src)))
|
|
126
|
+
continue;
|
|
127
|
+
const dst = join(side, name);
|
|
128
|
+
if (await isDir(dst))
|
|
129
|
+
await mergeDir(src, dst, report);
|
|
130
|
+
else
|
|
131
|
+
await moveEntry(src, dst, report);
|
|
132
|
+
}
|
|
133
|
+
// The home dir holds tokens; keep it owner-only. Best-effort — a non-POSIX
|
|
134
|
+
// filesystem rejecting this must not fail a migration that already worked.
|
|
135
|
+
if (report.moved.length)
|
|
136
|
+
await fs.chmod(home, 0o700).catch(() => { });
|
|
137
|
+
return report;
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=migrateHome.js.map
|
|
@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,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACpC,IAAI,MAAM,KAAK,CAAC,MAAM,CAAC;QAAE,MAAM,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAE9D,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9B,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;QACjC,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE,CAAC;QAChC,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7B,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;YAAE,SAAS;QAClC,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7B,IAAI,MAAM,KAAK,CAAC,GAAG,CAAC;YAAE,MAAM,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;;YAClD,MAAM,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IACzC,CAAC;IAED,2EAA2E;IAC3E,2EAA2E;IAC3E,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM;QAAE,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACrE,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/promptHost.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import type { FileService } from '@corenel/protocol';
|
|
|
2
2
|
import type { PromptHost } from '@corenel/harness/prompts/host';
|
|
3
3
|
/** A node PromptHost over a FileService workspace. setPromptHost(nodePromptHost(ws))
|
|
4
4
|
* then makes the harness prompt subsystem (composeAgentSystem) run in node. */
|
|
5
|
-
export declare function nodePromptHost(workspace: FileService): PromptHost;
|
|
5
|
+
export declare function nodePromptHost(workspace: FileService, project?: FileService): PromptHost;
|
|
6
6
|
//# sourceMappingURL=promptHost.d.ts.map
|
package/dist/promptHost.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promptHost.d.ts","sourceRoot":"","sources":["../promptHost.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,UAAU,EAAiB,MAAM,+BAA+B,CAAC;AAuC/E;+EAC+E;AAC/E,wBAAgB,cAAc,CAAC,SAAS,EAAE,WAAW,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"promptHost.d.ts","sourceRoot":"","sources":["../promptHost.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,UAAU,EAAiB,MAAM,+BAA+B,CAAC;AAuC/E;+EAC+E;AAC/E,wBAAgB,cAAc,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,UAAU,CAuBxF"}
|
package/dist/promptHost.js
CHANGED
|
@@ -49,9 +49,14 @@ async function compile(src, values, fileSystem, mainPath) {
|
|
|
49
49
|
}
|
|
50
50
|
/** A node PromptHost over a FileService workspace. setPromptHost(nodePromptHost(ws))
|
|
51
51
|
* then makes the harness prompt subsystem (composeAgentSystem) run in node. */
|
|
52
|
-
export function nodePromptHost(workspace) {
|
|
52
|
+
export function nodePromptHost(workspace, project) {
|
|
53
53
|
return {
|
|
54
54
|
workspace,
|
|
55
|
+
/* The user's PROJECT files, when the caller has them, so skills installed
|
|
56
|
+
* into `.prompd/skills/` are visible. Omitted rather than faked when there
|
|
57
|
+
* is none: a CLI invoked outside a project genuinely has no installed
|
|
58
|
+
* skills, and saying so beats inventing an empty directory. */
|
|
59
|
+
...(project ? { projectWorkspace: () => project } : {}),
|
|
55
60
|
seed: async (defaults) => {
|
|
56
61
|
for (const [p, content] of Object.entries(defaults)) {
|
|
57
62
|
if (!(await workspace.stat(p)))
|
package/dist/promptHost.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promptHost.js","sourceRoot":"","sources":["../promptHost.ts"],"names":[],"mappings":"AAAA;;;;;qEAKqE;AACrE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhG,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGpE,MAAM,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;AAClC,MAAM,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC;AAEtC,mFAAmF;AACnF,SAAS,OAAO,CAAC,GAAgB;IAC/B,OAAO;QACL,KAAK,CAAC,QAAQ,CAAC,CAAS;YACtB,IAAI,CAAC;gBAAC,OAAO,MAAM,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC;gBAAC,OAAO,IAAI,CAAC;YAAC,CAAC;QAC7E,CAAC;QACD,KAAK,CAAC,WAAW,CAAC,CAAS;YACzB,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,KAAK,WAAW,CAAC;QACtE,CAAC;QACD,KAAK,CAAC,OAAO,CAAC,CAAS;YACrB,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACnE,CAAC;KACF,CAAC;AACJ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gBACpD,IAAI,CAAC,CAAC,MAAM,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;oBAAE,MAAM,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YACpE,CAAC;QACH,CAAC;QACD,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAuC,EAAE,CAAC;QACjH,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC;QACxD,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;YAC/C,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,CAAC;YACzC,MAAM,CAAC,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;YAClC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,mDAAmD;YACzE,OAAO,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;QACzF,CAAC;QACD,SAAS,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,wDAAwD;KAC9E,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corenel/tools-node",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"license": "Elastic-2.0",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"description": "Corenel node capabilities — the tools-web twin. A disk-backed FileService (the harness file tools + node PromptHost workspace) over node:fs, confined to a root. Shell/secrets/~/.corenel to follow.",
|
|
6
7
|
"exports": {
|
|
@@ -15,8 +16,8 @@
|
|
|
15
16
|
},
|
|
16
17
|
"dependencies": {
|
|
17
18
|
"@prompd/core": "0.5.0-beta.10",
|
|
18
|
-
"@corenel/
|
|
19
|
-
"@corenel/
|
|
19
|
+
"@corenel/harness": "0.4.1",
|
|
20
|
+
"@corenel/protocol": "0.4.1"
|
|
20
21
|
},
|
|
21
22
|
"devDependencies": {
|
|
22
23
|
"@types/node": "^24.13.1",
|