@arki/dot 0.1.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/LICENSE +21 -0
- package/README.md +201 -0
- package/dist/cli/discover.d.ts +65 -0
- package/dist/cli/discover.d.ts.map +1 -0
- package/dist/cli/discover.js +184 -0
- package/dist/cli/discover.js.map +1 -0
- package/dist/cli/error-codes.d.ts +49 -0
- package/dist/cli/error-codes.d.ts.map +1 -0
- package/dist/cli/error-codes.js +61 -0
- package/dist/cli/error-codes.js.map +1 -0
- package/dist/cli/files.d.ts +67 -0
- package/dist/cli/files.d.ts.map +1 -0
- package/dist/cli/files.js +80 -0
- package/dist/cli/files.js.map +1 -0
- package/dist/cli/index.d.ts +95 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +456 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/json.d.ts +38 -0
- package/dist/cli/json.d.ts.map +1 -0
- package/dist/cli/json.js +18 -0
- package/dist/cli/json.js.map +1 -0
- package/dist/cli/new.d.ts +105 -0
- package/dist/cli/new.d.ts.map +1 -0
- package/dist/cli/new.js +322 -0
- package/dist/cli/new.js.map +1 -0
- package/dist/cli/observability-probe.d.ts +28 -0
- package/dist/cli/observability-probe.d.ts.map +1 -0
- package/dist/cli/observability-probe.js +44 -0
- package/dist/cli/observability-probe.js.map +1 -0
- package/dist/cli/render-doctor.d.ts +26 -0
- package/dist/cli/render-doctor.d.ts.map +1 -0
- package/dist/cli/render-doctor.js +183 -0
- package/dist/cli/render-doctor.js.map +1 -0
- package/dist/cli/render-explain.d.ts +43 -0
- package/dist/cli/render-explain.d.ts.map +1 -0
- package/dist/cli/render-explain.js +127 -0
- package/dist/cli/render-explain.js.map +1 -0
- package/dist/define-app.d.ts +125 -0
- package/dist/define-app.d.ts.map +1 -0
- package/dist/define-app.js +126 -0
- package/dist/define-app.js.map +1 -0
- package/dist/dependency-graph.d.ts +25 -0
- package/dist/dependency-graph.d.ts.map +1 -0
- package/dist/dependency-graph.js +86 -0
- package/dist/dependency-graph.js.map +1 -0
- package/dist/diagnostics.d.ts +83 -0
- package/dist/diagnostics.d.ts.map +1 -0
- package/dist/diagnostics.js +14 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/kernel/app-instance.d.ts +62 -0
- package/dist/kernel/app-instance.d.ts.map +1 -0
- package/dist/kernel/app-instance.js +1040 -0
- package/dist/kernel/app-instance.js.map +1 -0
- package/dist/kernel/otel.d.ts +105 -0
- package/dist/kernel/otel.d.ts.map +1 -0
- package/dist/kernel/otel.js +218 -0
- package/dist/kernel/otel.js.map +1 -0
- package/dist/lifecycle-observer.d.ts +95 -0
- package/dist/lifecycle-observer.d.ts.map +1 -0
- package/dist/lifecycle-observer.js +19 -0
- package/dist/lifecycle-observer.js.map +1 -0
- package/dist/lifecycle.d.ts +94 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle.js +78 -0
- package/dist/lifecycle.js.map +1 -0
- package/dist/manifest.d.ts +75 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +14 -0
- package/dist/manifest.js.map +1 -0
- package/dist/pip-contract.d.ts +219 -0
- package/dist/pip-contract.d.ts.map +1 -0
- package/dist/pip-contract.js +90 -0
- package/dist/pip-contract.js.map +1 -0
- package/dist/pip.d.ts +33 -0
- package/dist/pip.d.ts.map +1 -0
- package/dist/pip.js +25 -0
- package/dist/pip.js.map +1 -0
- package/dist/plugin-contract.d.ts +175 -0
- package/dist/plugin-contract.d.ts.map +1 -0
- package/dist/plugin-contract.js +45 -0
- package/dist/plugin-contract.js.map +1 -0
- package/dist/plugin.d.ts +30 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +24 -0
- package/dist/plugin.js.map +1 -0
- package/dist/test-harness.d.ts +42 -0
- package/dist/test-harness.d.ts.map +1 -0
- package/dist/test-harness.js +46 -0
- package/dist/test-harness.js.map +1 -0
- package/dist/timeline.d.ts +43 -0
- package/dist/timeline.d.ts.map +1 -0
- package/dist/timeline.js +121 -0
- package/dist/timeline.js.map +1 -0
- package/package.json +68 -0
- package/templates/app-minimal/.gitignore.tmpl +6 -0
- package/templates/app-minimal/AGENTS.md.tmpl +66 -0
- package/templates/app-minimal/README.md.tmpl +24 -0
- package/templates/app-minimal/package.json.tmpl +21 -0
- package/templates/app-minimal/src/app.ts.tmpl +20 -0
- package/templates/app-minimal/src/env.ts.tmpl +12 -0
- package/templates/app-minimal/tests/boot.test.ts.tmpl +25 -0
- package/templates/app-minimal/tsconfig.json.tmpl +22 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filesystem helpers for the `dot new` scaffold.
|
|
3
|
+
*
|
|
4
|
+
* Kept deliberately small and dependency-free so the scaffolding code path
|
|
5
|
+
* stays auditable. The scaffold first builds an in-memory list of
|
|
6
|
+
* {@link FileOperation} entries describing every file it WOULD write, then
|
|
7
|
+
* either prints them (`--dry-run`) or commits them to disk.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Action the generator will take for a particular file.
|
|
11
|
+
*
|
|
12
|
+
* - `create` — file does not yet exist at the target path.
|
|
13
|
+
* - `overwrite` — file exists; the generator will replace it (only when
|
|
14
|
+
* `--force` was passed).
|
|
15
|
+
* - `skip` — file exists and the generator refuses to overwrite without
|
|
16
|
+
* `--force`. Surfaced in dry-run output and converted to a failure on
|
|
17
|
+
* real runs.
|
|
18
|
+
*/
|
|
19
|
+
export type FileOperationAction = 'create' | 'overwrite' | 'skip';
|
|
20
|
+
/**
|
|
21
|
+
* Description of a single file the scaffold plans to emit.
|
|
22
|
+
*
|
|
23
|
+
* `path` is always relative to the target directory so the envelope is
|
|
24
|
+
* portable across machines. `contentHash` is sha256 of the rendered bytes
|
|
25
|
+
* — agents can use it to confirm the file we wrote matches the file we
|
|
26
|
+
* planned.
|
|
27
|
+
*/
|
|
28
|
+
export type FileOperation = {
|
|
29
|
+
readonly path: string;
|
|
30
|
+
readonly action: FileOperationAction;
|
|
31
|
+
readonly contentHash: string;
|
|
32
|
+
readonly contentBytes: number;
|
|
33
|
+
readonly reason: string;
|
|
34
|
+
/**
|
|
35
|
+
* Rendered file contents. Internal to the generator — NOT emitted in the
|
|
36
|
+
* JSON envelope. Kept on the in-memory plan so a non-dry-run can write
|
|
37
|
+
* the same bytes that produced `contentHash`.
|
|
38
|
+
*/
|
|
39
|
+
readonly content: string;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Walk a template directory and return the relative paths of every file.
|
|
43
|
+
*
|
|
44
|
+
* Subdirectories are descended into; symlinks and non-regular files are
|
|
45
|
+
* ignored. Paths are returned without a leading separator and are sorted
|
|
46
|
+
* lexicographically for deterministic output.
|
|
47
|
+
*/
|
|
48
|
+
export declare function collectTemplateFiles(root: string): Promise<string[]>;
|
|
49
|
+
/** Compute the sha256 hex digest of a string payload (utf-8 encoded). */
|
|
50
|
+
export declare function sha256(content: string): string;
|
|
51
|
+
/** Byte length of a utf-8 string. Wrapper exists so the call site is obvious. */
|
|
52
|
+
export declare function utf8ByteLength(content: string): number;
|
|
53
|
+
/** Return `true` when a regular file exists at the given path. */
|
|
54
|
+
export declare function fileExists(filePath: string): Promise<boolean>;
|
|
55
|
+
/** Return `true` when a directory exists and contains at least one entry. */
|
|
56
|
+
export declare function directoryIsNonEmpty(dirPath: string): Promise<boolean>;
|
|
57
|
+
/**
|
|
58
|
+
* Write a single file, creating parent directories as needed.
|
|
59
|
+
*/
|
|
60
|
+
export declare function writeFileEnsuringDir(filePath: string, content: string): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Read a template file from disk. Trivially thin wrapper around
|
|
63
|
+
* `fs.readFile`, but exists so the scaffold imports stay symmetric with
|
|
64
|
+
* its helpers.
|
|
65
|
+
*/
|
|
66
|
+
export declare function readTemplate(filePath: string): Promise<string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,OAAO,CAAC,MAAM,CAAC,CAEpE"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filesystem helpers for the `dot new` scaffold.
|
|
3
|
+
*
|
|
4
|
+
* Kept deliberately small and dependency-free so the scaffolding code path
|
|
5
|
+
* stays auditable. The scaffold first builds an in-memory list of
|
|
6
|
+
* {@link FileOperation} entries describing every file it WOULD write, then
|
|
7
|
+
* either prints them (`--dry-run`) or commits them to disk.
|
|
8
|
+
*/
|
|
9
|
+
import { createHash } from 'node:crypto';
|
|
10
|
+
import { mkdir, readdir, readFile, stat, writeFile } from 'node:fs/promises';
|
|
11
|
+
import path from 'node:path';
|
|
12
|
+
/**
|
|
13
|
+
* Walk a template directory and return the relative paths of every file.
|
|
14
|
+
*
|
|
15
|
+
* Subdirectories are descended into; symlinks and non-regular files are
|
|
16
|
+
* ignored. Paths are returned without a leading separator and are sorted
|
|
17
|
+
* lexicographically for deterministic output.
|
|
18
|
+
*/
|
|
19
|
+
export async function collectTemplateFiles(root) {
|
|
20
|
+
const out = [];
|
|
21
|
+
async function walk(dir) {
|
|
22
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
23
|
+
for (const entry of entries) {
|
|
24
|
+
const full = path.join(dir, entry.name);
|
|
25
|
+
if (entry.isDirectory()) {
|
|
26
|
+
await walk(full);
|
|
27
|
+
}
|
|
28
|
+
else if (entry.isFile()) {
|
|
29
|
+
out.push(path.relative(root, full));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
await walk(root);
|
|
34
|
+
out.sort();
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
/** Compute the sha256 hex digest of a string payload (utf-8 encoded). */
|
|
38
|
+
export function sha256(content) {
|
|
39
|
+
return createHash('sha256').update(content, 'utf8').digest('hex');
|
|
40
|
+
}
|
|
41
|
+
/** Byte length of a utf-8 string. Wrapper exists so the call site is obvious. */
|
|
42
|
+
export function utf8ByteLength(content) {
|
|
43
|
+
return Buffer.byteLength(content, 'utf8');
|
|
44
|
+
}
|
|
45
|
+
/** Return `true` when a regular file exists at the given path. */
|
|
46
|
+
export async function fileExists(filePath) {
|
|
47
|
+
try {
|
|
48
|
+
const result = await stat(filePath);
|
|
49
|
+
return result.isFile();
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/** Return `true` when a directory exists and contains at least one entry. */
|
|
56
|
+
export async function directoryIsNonEmpty(dirPath) {
|
|
57
|
+
try {
|
|
58
|
+
const entries = await readdir(dirPath);
|
|
59
|
+
return entries.length > 0;
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Write a single file, creating parent directories as needed.
|
|
67
|
+
*/
|
|
68
|
+
export async function writeFileEnsuringDir(filePath, content) {
|
|
69
|
+
await mkdir(path.dirname(filePath), { recursive: true });
|
|
70
|
+
await writeFile(filePath, content, 'utf8');
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Read a template file from disk. Trivially thin wrapper around
|
|
74
|
+
* `fs.readFile`, but exists so the scaffold imports stay symmetric with
|
|
75
|
+
* its helpers.
|
|
76
|
+
*/
|
|
77
|
+
export async function readTemplate(filePath) {
|
|
78
|
+
return readFile(filePath, 'utf8');
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/cli/files.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,IAAI,MAAM,WAAW,CAAC;AAoC7B;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AAC,MAAM,EAAE,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,6EAA6E;AAC7E,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAAe;IACvD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;QACvC,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,QAAgB,EAAE,OAAe;IAC1E,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACzD,MAAM,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAC7C,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,QAAgB;IACjD,OAAO,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `dot` CLI entry point.
|
|
4
|
+
*
|
|
5
|
+
* Two commands are wired today (more land in v1.1):
|
|
6
|
+
* - `dot explain` — print the static app graph (manifest)
|
|
7
|
+
* - `dot doctor` — boot the app and print runtime diagnostics
|
|
8
|
+
*
|
|
9
|
+
* Common options:
|
|
10
|
+
* --json Emit JSON envelope instead of human-readable text
|
|
11
|
+
* --app <p> Path to the app file (overrides auto-discovery)
|
|
12
|
+
* --cwd <p> Working directory (default: process.cwd())
|
|
13
|
+
* --help Show help
|
|
14
|
+
* --version Print version
|
|
15
|
+
*
|
|
16
|
+
* Exit codes: `0` on success/warning envelopes (doctor warnings still mean the
|
|
17
|
+
* app booted), `1` on `failure` envelopes and on every structured CLI error.
|
|
18
|
+
*/
|
|
19
|
+
import type { DiscoveredApp } from './discover.js';
|
|
20
|
+
import type { DotCliEnvelope } from './render-explain.js';
|
|
21
|
+
import { DotCliError, DotCliErrorCode, dotCliDocsUrl } from './error-codes.js';
|
|
22
|
+
export type CliCommand = 'explain' | 'doctor' | 'new' | 'help' | 'version';
|
|
23
|
+
export type CliArgs = {
|
|
24
|
+
command: CliCommand;
|
|
25
|
+
json: boolean;
|
|
26
|
+
appPath?: string;
|
|
27
|
+
cwd?: string;
|
|
28
|
+
/** Positional after the command (used by `new` for the app name). */
|
|
29
|
+
positional?: string;
|
|
30
|
+
/** `--target` (only honored by `new`). */
|
|
31
|
+
target?: string;
|
|
32
|
+
/** `--pm` (only honored by `new`). */
|
|
33
|
+
pm?: 'npm' | 'pnpm' | 'bun';
|
|
34
|
+
/** `--dry-run` (only honored by `new`). */
|
|
35
|
+
dryRun?: boolean;
|
|
36
|
+
/** `--force` (only honored by `new`). */
|
|
37
|
+
force?: boolean;
|
|
38
|
+
/** `--observability` (only honored by `doctor`). */
|
|
39
|
+
observability?: boolean;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Parse argv into a typed shape. Exported so tests can exercise it without
|
|
43
|
+
* spawning the binary.
|
|
44
|
+
*/
|
|
45
|
+
export declare function parseArgs(argv: readonly string[]): CliArgs;
|
|
46
|
+
/**
|
|
47
|
+
* Run `explain` on a discovered app.
|
|
48
|
+
* Pure dependency on a `DiscoveredApp` so tests can pass synthetic values.
|
|
49
|
+
*/
|
|
50
|
+
export declare function runExplain(discovered: DiscoveredApp, opts: {
|
|
51
|
+
json: boolean;
|
|
52
|
+
out?: (line: string) => void;
|
|
53
|
+
now?: () => Date;
|
|
54
|
+
}): Promise<DotCliEnvelope<unknown>>;
|
|
55
|
+
type DoctorRunOptions = {
|
|
56
|
+
json: boolean;
|
|
57
|
+
out?: (line: string) => void;
|
|
58
|
+
now?: () => Date;
|
|
59
|
+
/**
|
|
60
|
+
* When `true`, probes for a registered OpenTelemetry SDK and injects
|
|
61
|
+
* a warning-severity issue into the diagnostics envelope when none is
|
|
62
|
+
* present. Default `false`.
|
|
63
|
+
*/
|
|
64
|
+
observability?: boolean;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Run `doctor` on a discovered app. The CLI owns boot+dispose only when it
|
|
68
|
+
* receives a builder. If the caller passed an already-booted app, we leave
|
|
69
|
+
* lifecycle to them.
|
|
70
|
+
*
|
|
71
|
+
* If `boot()` throws, doctor's job is still to surface diagnostics — so we
|
|
72
|
+
* pre-configure the builder, then re-read the configured seam's diagnostics
|
|
73
|
+
* even after a boot throw. This is the whole point of `doctor`: failure
|
|
74
|
+
* should be observable, not opaque.
|
|
75
|
+
*/
|
|
76
|
+
export declare function runDoctor(discovered: DiscoveredApp, opts: DoctorRunOptions): Promise<DotCliEnvelope<unknown>>;
|
|
77
|
+
type MainOptions = {
|
|
78
|
+
argv: readonly string[];
|
|
79
|
+
stdout?: (line: string) => void;
|
|
80
|
+
stderr?: (line: string) => void;
|
|
81
|
+
now?: () => Date;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Run the CLI. Returns the exit code so tests can assert without calling
|
|
85
|
+
* `process.exit`. Real entry point at the bottom of the file calls `exit()`.
|
|
86
|
+
*/
|
|
87
|
+
export declare function main(options: MainOptions): Promise<number>;
|
|
88
|
+
/**
|
|
89
|
+
* Re-exports for test consumers and adapter packages.
|
|
90
|
+
*/
|
|
91
|
+
export { DotCliError, DotCliErrorCode, dotCliDocsUrl };
|
|
92
|
+
export type { DotCliEnvelope, DotCliEnvelopeStatus } from './render-explain.js';
|
|
93
|
+
export { runNew } from './new.js';
|
|
94
|
+
export type { DotNewEnvelope, DotNewOperation } from './json.js';
|
|
95
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.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