@corenel/tools-node 0.1.0 → 0.2.1
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/auth.d.ts.map +1 -1
- package/dist/auth.js +21 -6
- package/dist/auth.js.map +1 -1
- package/dist/fileService.d.ts +13 -0
- package/dist/fileService.d.ts.map +1 -1
- package/dist/fileService.js +111 -6
- package/dist/fileService.js.map +1 -1
- package/package.json +21 -25
package/dist/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../auth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../auth.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG5D,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AACD,wBAAgB,aAAa,IAAI,MAAM,CAEtC;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
|
@@ -1,23 +1,38 @@
|
|
|
1
|
-
/* Node auth token store — ~/.corenel/token
|
|
2
|
-
* via the device flow; the CLI's token guard + gateway
|
|
3
|
-
* IAuthTokenProvider port (falling back to the
|
|
4
|
-
* the sidecar's
|
|
1
|
+
/* Node auth token store — ~/<state dir>/token (default ~/.corenel/token, owner-only).
|
|
2
|
+
* `corenel login` writes it via the device flow; the CLI's token guard + gateway
|
|
3
|
+
* client read it through the IAuthTokenProvider port (falling back to the
|
|
4
|
+
* CORENEL_TOKEN env). Separate from the sidecar's ~/<state dir>/daemon.token
|
|
5
|
+
* (default ~/.corenel/daemon.token — that's the local pairing token). */
|
|
5
6
|
import { promises as fs } from 'node:fs';
|
|
6
7
|
import { homedir } from 'node:os';
|
|
7
8
|
import { join } from 'node:path';
|
|
9
|
+
import { stateDirName } from '@corenel/protocol';
|
|
8
10
|
export function corenelDir() {
|
|
9
|
-
return join(homedir(),
|
|
11
|
+
return join(homedir(), stateDirName());
|
|
10
12
|
}
|
|
11
13
|
export function authTokenPath() {
|
|
12
14
|
return join(corenelDir(), 'token');
|
|
13
15
|
}
|
|
14
16
|
export async function writeAuthToken(token) {
|
|
15
|
-
|
|
17
|
+
/* 0o700 on the DIRECTORY, not just 0o600 on the file. Without a mode, mkdir
|
|
18
|
+
* lands on the process umask -- typically 0o755, so the directory holding a
|
|
19
|
+
* bearer token is world-listable. The file's own contents stay protected
|
|
20
|
+
* either way, but the listing tells anyone on a shared machine that this user
|
|
21
|
+
* has a Corenel token and when they last refreshed it. `recursive: true`
|
|
22
|
+
* applies the mode only to directories it actually CREATES, so this never
|
|
23
|
+
* tightens a pre-existing ~/.corenel a user set up deliberately. */
|
|
24
|
+
await fs.mkdir(corenelDir(), { recursive: true, mode: 0o700 });
|
|
16
25
|
await fs.writeFile(authTokenPath(), token.trim() + '\n', { mode: 0o600 });
|
|
26
|
+
// Both chmods are best-effort: non-POSIX filesystems reject them, and a
|
|
27
|
+
// failure here must not lose a token that is already written correctly.
|
|
17
28
|
try {
|
|
18
29
|
await fs.chmod(authTokenPath(), 0o600);
|
|
19
30
|
}
|
|
20
31
|
catch { /* non-POSIX */ }
|
|
32
|
+
try {
|
|
33
|
+
await fs.chmod(corenelDir(), 0o700);
|
|
34
|
+
}
|
|
35
|
+
catch { /* non-POSIX */ }
|
|
21
36
|
}
|
|
22
37
|
export async function readAuthToken() {
|
|
23
38
|
try {
|
package/dist/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources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CAAC;QACH,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,aAAa,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/fileService.d.ts
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import type { FileService, FileNode, FileStat, FileServiceKind } from '@corenel/protocol';
|
|
2
|
+
/** True when a `path.relative(root, x)` result denotes an escape from root:
|
|
3
|
+
* ordinary `..` traversal, OR a target on a different Windows drive/UNC share
|
|
4
|
+
* than root — a case `path.relative` cannot express as a `..`-prefixed
|
|
5
|
+
* relative path, so it returns the target's ABSOLUTE (or drive-relative) form
|
|
6
|
+
* instead. Both `within()` and `assertReal()` route through this single check
|
|
7
|
+
* so the two confinement gates cannot drift apart.
|
|
8
|
+
*
|
|
9
|
+
* `platformSep` defaults to the real, current-OS `path.sep` and should never
|
|
10
|
+
* be overridden at a call site in this file — the parameter exists purely so
|
|
11
|
+
* a test can exercise the win32-only branch's gating without needing an
|
|
12
|
+
* actual second OS. */
|
|
13
|
+
export declare function escapesRoot(rel: string, platformSep?: string): boolean;
|
|
2
14
|
export declare class NodeFileService implements FileService {
|
|
3
15
|
readonly kind: FileServiceKind;
|
|
4
16
|
readonly label: string;
|
|
@@ -23,6 +35,7 @@ export declare class NodeFileService implements FileService {
|
|
|
23
35
|
read(path: string): Promise<string>;
|
|
24
36
|
stat(path: string): Promise<FileStat | null>;
|
|
25
37
|
write(path: string, content: string): Promise<void>;
|
|
38
|
+
writeBytes(path: string, bytes: Uint8Array): Promise<void>;
|
|
26
39
|
create(path: string, content?: string): Promise<void>;
|
|
27
40
|
remove(path: string): Promise<void>;
|
|
28
41
|
rename(from: string, to: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileService.d.ts","sourceRoot":"","sources":["../fileService.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"fileService.d.ts","sourceRoot":"","sources":["../fileService.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAsE1F;;;;;;;;;;uBAUuB;AACvB,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,GAAE,MAAY,GAAG,OAAO,CAgB3E;AAED,qBAAa,eAAgB,YAAW,WAAW;IACjD,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAe;IAC7C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,QAAQ;IAC5B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;gBAElB,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAO;IAM3D,yEAAyE;IACzE,OAAO,CAAC,MAAM;IAId;sFACkF;IAClF,OAAO,CAAC,GAAG;IAMX;;uFAEmF;YACrE,UAAU;IAoBxB,mFAAmF;YACrE,OAAO;IAMf,IAAI,CAAC,GAAG,SAAK,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAuBnC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAInC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAS5C,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOnD,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAO1D,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,SAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IAYjD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAInC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO/C,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAU9C,QAAQ,IAAI,MAAM,IAAI;CAGvB"}
|
package/dist/fileService.js
CHANGED
|
@@ -4,10 +4,106 @@
|
|
|
4
4
|
* PromptHost workspace work in node, with no path escaping the root. Paths are
|
|
5
5
|
* POSIX, folder-relative (no leading slash). */
|
|
6
6
|
import { promises as fs } from 'node:fs';
|
|
7
|
-
import { join, resolve, relative, dirname, sep, basename } from 'node:path';
|
|
7
|
+
import { join, resolve, relative, dirname, sep, basename, isAbsolute } from 'node:path';
|
|
8
8
|
import { normalizeFilePath, extOf, flattenFiles } from '@corenel/protocol';
|
|
9
|
-
/** Dirs skipped from listing/search
|
|
10
|
-
|
|
9
|
+
/** Dirs skipped from listing/search BY BARE NAME, at ANY depth — reserved for
|
|
10
|
+
* names that are, as close to universally as this can judge, never a
|
|
11
|
+
* meaningful project source directory: package-manager/VCS/editor caches and
|
|
12
|
+
* build output. `dist-corenel` — a second Vite build output dir (this repo
|
|
13
|
+
* builds two apps; `dist` alone missed the sibling), `test-results` and
|
|
14
|
+
* `playwright-report` — generated e2e artifacts (screenshots, traces, HTML
|
|
15
|
+
* reports).
|
|
16
|
+
*
|
|
17
|
+
* `coverage` is deliberately NOT here — see `looksLikeGeneratedCoverage`
|
|
18
|
+
* below for why a bare-name (or even a root-relative-path) rule isn't safe
|
|
19
|
+
* for it.
|
|
20
|
+
*
|
|
21
|
+
* Deliberately NOT added: `.corenel` / `.prompd`. Those are workspace STATE
|
|
22
|
+
* (sessions, config, installed packages) a user may legitimately want to read
|
|
23
|
+
* or point the agent at — skipping them would hide exactly the kind of thing
|
|
24
|
+
* `list_files` exists to surface. Build output and generated reports are never
|
|
25
|
+
* worth listing; a workspace's own state directories are a different kind of
|
|
26
|
+
* thing entirely and stay visible. */
|
|
27
|
+
const SKIP = new Set([
|
|
28
|
+
'node_modules', '.git', 'dist', 'build', '.next', '.cache', '.turbo',
|
|
29
|
+
'dist-corenel', 'test-results', 'playwright-report',
|
|
30
|
+
]);
|
|
31
|
+
/** Skipped by full relative path rather than bare name — for directory names
|
|
32
|
+
* that are only noise in ONE particular location, not every occurrence
|
|
33
|
+
* anywhere in a tree. `.claude/skills`: vendored skill bundles, not project
|
|
34
|
+
* source. (`coverage` used to live here too, root-relative-only — replaced
|
|
35
|
+
* by `looksLikeGeneratedCoverage` below: "root-relative" turned out to still
|
|
36
|
+
* mean "wherever `corenel` happens to be launched from", so a real
|
|
37
|
+
* `src/coverage/` got hidden the moment someone ran it from inside `src/`,
|
|
38
|
+
* the exact silent-real-source-loss failure this mechanism exists to
|
|
39
|
+
* prevent.) */
|
|
40
|
+
const SKIP_PATHS = new Set(['.claude/skills']);
|
|
41
|
+
/** Files that, found INSIDE a directory literally named `coverage`, mean the
|
|
42
|
+
* directory almost certainly IS a generated test-coverage report rather than
|
|
43
|
+
* someone's real source: the istanbul/nyc/vitest/jest HTML+JSON/LCOV output
|
|
44
|
+
* shapes. A directory named `coverage` that contains none of these (an
|
|
45
|
+
* insurance or telecom codebase's actual coverage data, say) is left alone —
|
|
46
|
+
* silently hiding real source is worse than showing an extra generated dir,
|
|
47
|
+
* so the check only fires on positive evidence, never on the name alone.
|
|
48
|
+
*
|
|
49
|
+
* `prettify.js` covers an istanbul run configured `reporter: ['html']` --
|
|
50
|
+
* that leaves only HTML output (`index.html`, `base.css`, ...), none of the
|
|
51
|
+
* JSON/LCOV markers above. `index.html` alone would be too generic a signal
|
|
52
|
+
* (plenty of ordinary directories have one for unrelated reasons);
|
|
53
|
+
* `prettify.js` is istanbul's own html-reporter asset name specifically, so
|
|
54
|
+
* it stays on the "positive evidence, not a guess" side of the same
|
|
55
|
+
* direction-of-harm this whole check follows. */
|
|
56
|
+
const COVERAGE_REPORT_MARKERS = new Set([
|
|
57
|
+
'coverage-final.json', 'lcov.info', 'clover.xml', 'coverage-summary.json',
|
|
58
|
+
'prettify.js',
|
|
59
|
+
]);
|
|
60
|
+
/** True when `absDir` (already known to be named `coverage`) contains at
|
|
61
|
+
* least one marker a generated report would leave and hand-written source
|
|
62
|
+
* would not. Errors (permission, race) fail safe to `false` — visible, not
|
|
63
|
+
* silently dropped. */
|
|
64
|
+
async function looksLikeGeneratedCoverage(absDir) {
|
|
65
|
+
try {
|
|
66
|
+
const names = await fs.readdir(absDir);
|
|
67
|
+
return names.some((n) => COVERAGE_REPORT_MARKERS.has(n));
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/** True when a `path.relative(root, x)` result denotes an escape from root:
|
|
74
|
+
* ordinary `..` traversal, OR a target on a different Windows drive/UNC share
|
|
75
|
+
* than root — a case `path.relative` cannot express as a `..`-prefixed
|
|
76
|
+
* relative path, so it returns the target's ABSOLUTE (or drive-relative) form
|
|
77
|
+
* instead. Both `within()` and `assertReal()` route through this single check
|
|
78
|
+
* so the two confinement gates cannot drift apart.
|
|
79
|
+
*
|
|
80
|
+
* `platformSep` defaults to the real, current-OS `path.sep` and should never
|
|
81
|
+
* be overridden at a call site in this file — the parameter exists purely so
|
|
82
|
+
* a test can exercise the win32-only branch's gating without needing an
|
|
83
|
+
* actual second OS. */
|
|
84
|
+
export function escapesRoot(rel, platformSep = sep) {
|
|
85
|
+
if (rel === '')
|
|
86
|
+
return false;
|
|
87
|
+
if (rel === '..' || rel.startsWith('..' + platformSep))
|
|
88
|
+
return true;
|
|
89
|
+
if (rel.split(platformSep)[0] === '..')
|
|
90
|
+
return true;
|
|
91
|
+
// Cross-drive / UNC: path.relative falls back to an absolute or
|
|
92
|
+
// drive-relative path. isAbsolute() alone misses "c:evil.txt" (drive-
|
|
93
|
+
// relative, no leading slash) on win32, so check both — but ONLY on
|
|
94
|
+
// win32: on POSIX a colon is an ordinary filename character (a file
|
|
95
|
+
// literally named "c:notes.md" is legal), and "//" is not a UNC marker,
|
|
96
|
+
// so firing this branch there is a false-positive regression, not a fix.
|
|
97
|
+
if (isAbsolute(rel))
|
|
98
|
+
return true;
|
|
99
|
+
if (platformSep === '\\') {
|
|
100
|
+
if (/^[a-zA-Z]:/.test(rel))
|
|
101
|
+
return true; // drive-relative, e.g. "c:evil.txt"
|
|
102
|
+
if (rel.startsWith('\\\\'))
|
|
103
|
+
return true; // UNC share
|
|
104
|
+
}
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
11
107
|
export class NodeFileService {
|
|
12
108
|
constructor(root, opts = {}) {
|
|
13
109
|
Object.defineProperty(this, "kind", {
|
|
@@ -46,8 +142,7 @@ export class NodeFileService {
|
|
|
46
142
|
}
|
|
47
143
|
/** True if `a` is lexically within the root (the root itself counts). */
|
|
48
144
|
within(a) {
|
|
49
|
-
|
|
50
|
-
return rel === '' || (rel !== '..' && !rel.startsWith('..' + sep) && rel.split(sep)[0] !== '..');
|
|
145
|
+
return !escapesRoot(relative(this.root, a));
|
|
51
146
|
}
|
|
52
147
|
/** Absolute path for a folder-relative one, rejecting anything that escapes root
|
|
53
148
|
* LEXICALLY (../, absolute). Symlink escapes are caught by assertReal/realAbs. */
|
|
@@ -67,7 +162,7 @@ export class NodeFileService {
|
|
|
67
162
|
try {
|
|
68
163
|
const real = await fs.realpath(probe);
|
|
69
164
|
const rel = relative(realRoot, real);
|
|
70
|
-
if (
|
|
165
|
+
if (escapesRoot(rel)) {
|
|
71
166
|
throw new Error(`path escapes the workspace root via symlink: ${a}`);
|
|
72
167
|
}
|
|
73
168
|
return;
|
|
@@ -103,6 +198,10 @@ export class NodeFileService {
|
|
|
103
198
|
continue;
|
|
104
199
|
const absChild = join(absDir, e.name);
|
|
105
200
|
const path = normalizeFilePath(relative(this.root, absChild));
|
|
201
|
+
if (e.isDirectory() && SKIP_PATHS.has(path))
|
|
202
|
+
continue;
|
|
203
|
+
if (e.isDirectory() && e.name === 'coverage' && await looksLikeGeneratedCoverage(absChild))
|
|
204
|
+
continue;
|
|
106
205
|
if (e.isDirectory()) {
|
|
107
206
|
out.push({ name: e.name, path, kind: 'directory', children: await walk(absChild) });
|
|
108
207
|
}
|
|
@@ -133,6 +232,12 @@ export class NodeFileService {
|
|
|
133
232
|
await this.assertReal(a);
|
|
134
233
|
await fs.writeFile(a, content, 'utf8');
|
|
135
234
|
}
|
|
235
|
+
async writeBytes(path, bytes) {
|
|
236
|
+
const a = this.abs(path);
|
|
237
|
+
await fs.mkdir(dirname(a), { recursive: true });
|
|
238
|
+
await this.assertReal(a);
|
|
239
|
+
await fs.writeFile(a, bytes);
|
|
240
|
+
}
|
|
136
241
|
async create(path, content = '') {
|
|
137
242
|
const a = this.abs(path);
|
|
138
243
|
await fs.mkdir(dirname(a), { recursive: true });
|
package/dist/fileService.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileService.js","sourceRoot":"","sources":["../fileService.ts"],"names":[],"mappings":"AAAA;;;;gDAIgD;AAChD,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"fileService.js","sourceRoot":"","sources":["../fileService.ts"],"names":[],"mappings":"AAAA;;;;gDAIgD;AAChD,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAExF,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE3E;;;;;;;;;;;;;;;;;sCAiBsC;AACtC,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC;IACnB,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;IACpE,cAAc,EAAE,cAAc,EAAE,mBAAmB;CACpD,CAAC,CAAC;AAEH;;;;;;;;eAQe;AACf,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAE/C;;;;;;;;;;;;;;iDAciD;AACjD,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC;IACtC,qBAAqB,EAAE,WAAW,EAAE,YAAY,EAAE,uBAAuB;IACzE,aAAa;CACd,CAAC,CAAC;AAEH;;;uBAGuB;AACvB,KAAK,UAAU,0BAA0B,CAAC,MAAc;IACtD,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,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,WAAW,EAAE,CAAC;QAC9B,MAAM,GAAG,GAAa,EAAE,CAAC;QACzB,KAAK,MAAM,CAAC,IAAI,YAAY,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;YAChD,IAAI,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;gBAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;gBAAC,SAAS;YAAC,CAAC;YACrE,IAAI,CAAC;gBAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;oBAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAC,uBAAuB,CAAC,CAAC;QACtH,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAED,QAAQ;QACN,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC,gEAAgE;IACnF,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corenel/tools-node",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"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
6
|
"exports": {
|
|
7
|
-
".":
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"default": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"./*": {
|
|
12
|
+
"types": "./dist/*.d.ts",
|
|
13
|
+
"default": "./dist/*.js"
|
|
14
|
+
}
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@
|
|
18
|
-
"@corenel/
|
|
19
|
-
"@
|
|
17
|
+
"@prompd/core": "0.5.0-beta.10",
|
|
18
|
+
"@corenel/protocol": "0.4.0",
|
|
19
|
+
"@corenel/harness": "0.4.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/node": "^24.13.1",
|
|
@@ -24,19 +24,15 @@
|
|
|
24
24
|
"typescript": "^5.9.3"
|
|
25
25
|
},
|
|
26
26
|
"publishConfig": {
|
|
27
|
-
"access": "public"
|
|
28
|
-
"exports": {
|
|
29
|
-
".": {
|
|
30
|
-
"types": "./dist/index.d.ts",
|
|
31
|
-
"default": "./dist/index.js"
|
|
32
|
-
},
|
|
33
|
-
"./*": {
|
|
34
|
-
"types": "./dist/*.d.ts",
|
|
35
|
-
"default": "./dist/*.js"
|
|
36
|
-
}
|
|
37
|
-
}
|
|
27
|
+
"access": "public"
|
|
38
28
|
},
|
|
39
29
|
"files": [
|
|
40
30
|
"dist"
|
|
41
|
-
]
|
|
42
|
-
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"typecheck": "tsc --noEmit",
|
|
34
|
+
"preverify": "pnpm --filter @corenel/protocol build && pnpm --filter @corenel/harness build",
|
|
35
|
+
"verify": "tsx verify.ts",
|
|
36
|
+
"build": "tsc -p tsconfig.build.json"
|
|
37
|
+
}
|
|
38
|
+
}
|