@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.
Files changed (107) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +201 -0
  3. package/dist/cli/discover.d.ts +65 -0
  4. package/dist/cli/discover.d.ts.map +1 -0
  5. package/dist/cli/discover.js +184 -0
  6. package/dist/cli/discover.js.map +1 -0
  7. package/dist/cli/error-codes.d.ts +49 -0
  8. package/dist/cli/error-codes.d.ts.map +1 -0
  9. package/dist/cli/error-codes.js +61 -0
  10. package/dist/cli/error-codes.js.map +1 -0
  11. package/dist/cli/files.d.ts +67 -0
  12. package/dist/cli/files.d.ts.map +1 -0
  13. package/dist/cli/files.js +80 -0
  14. package/dist/cli/files.js.map +1 -0
  15. package/dist/cli/index.d.ts +95 -0
  16. package/dist/cli/index.d.ts.map +1 -0
  17. package/dist/cli/index.js +456 -0
  18. package/dist/cli/index.js.map +1 -0
  19. package/dist/cli/json.d.ts +38 -0
  20. package/dist/cli/json.d.ts.map +1 -0
  21. package/dist/cli/json.js +18 -0
  22. package/dist/cli/json.js.map +1 -0
  23. package/dist/cli/new.d.ts +105 -0
  24. package/dist/cli/new.d.ts.map +1 -0
  25. package/dist/cli/new.js +322 -0
  26. package/dist/cli/new.js.map +1 -0
  27. package/dist/cli/observability-probe.d.ts +28 -0
  28. package/dist/cli/observability-probe.d.ts.map +1 -0
  29. package/dist/cli/observability-probe.js +44 -0
  30. package/dist/cli/observability-probe.js.map +1 -0
  31. package/dist/cli/render-doctor.d.ts +26 -0
  32. package/dist/cli/render-doctor.d.ts.map +1 -0
  33. package/dist/cli/render-doctor.js +183 -0
  34. package/dist/cli/render-doctor.js.map +1 -0
  35. package/dist/cli/render-explain.d.ts +43 -0
  36. package/dist/cli/render-explain.d.ts.map +1 -0
  37. package/dist/cli/render-explain.js +127 -0
  38. package/dist/cli/render-explain.js.map +1 -0
  39. package/dist/define-app.d.ts +125 -0
  40. package/dist/define-app.d.ts.map +1 -0
  41. package/dist/define-app.js +126 -0
  42. package/dist/define-app.js.map +1 -0
  43. package/dist/dependency-graph.d.ts +25 -0
  44. package/dist/dependency-graph.d.ts.map +1 -0
  45. package/dist/dependency-graph.js +86 -0
  46. package/dist/dependency-graph.js.map +1 -0
  47. package/dist/diagnostics.d.ts +83 -0
  48. package/dist/diagnostics.d.ts.map +1 -0
  49. package/dist/diagnostics.js +14 -0
  50. package/dist/diagnostics.js.map +1 -0
  51. package/dist/index.d.ts +24 -0
  52. package/dist/index.d.ts.map +1 -0
  53. package/dist/index.js +17 -0
  54. package/dist/index.js.map +1 -0
  55. package/dist/kernel/app-instance.d.ts +62 -0
  56. package/dist/kernel/app-instance.d.ts.map +1 -0
  57. package/dist/kernel/app-instance.js +1040 -0
  58. package/dist/kernel/app-instance.js.map +1 -0
  59. package/dist/kernel/otel.d.ts +105 -0
  60. package/dist/kernel/otel.d.ts.map +1 -0
  61. package/dist/kernel/otel.js +218 -0
  62. package/dist/kernel/otel.js.map +1 -0
  63. package/dist/lifecycle-observer.d.ts +95 -0
  64. package/dist/lifecycle-observer.d.ts.map +1 -0
  65. package/dist/lifecycle-observer.js +19 -0
  66. package/dist/lifecycle-observer.js.map +1 -0
  67. package/dist/lifecycle.d.ts +94 -0
  68. package/dist/lifecycle.d.ts.map +1 -0
  69. package/dist/lifecycle.js +78 -0
  70. package/dist/lifecycle.js.map +1 -0
  71. package/dist/manifest.d.ts +75 -0
  72. package/dist/manifest.d.ts.map +1 -0
  73. package/dist/manifest.js +14 -0
  74. package/dist/manifest.js.map +1 -0
  75. package/dist/pip-contract.d.ts +219 -0
  76. package/dist/pip-contract.d.ts.map +1 -0
  77. package/dist/pip-contract.js +90 -0
  78. package/dist/pip-contract.js.map +1 -0
  79. package/dist/pip.d.ts +33 -0
  80. package/dist/pip.d.ts.map +1 -0
  81. package/dist/pip.js +25 -0
  82. package/dist/pip.js.map +1 -0
  83. package/dist/plugin-contract.d.ts +175 -0
  84. package/dist/plugin-contract.d.ts.map +1 -0
  85. package/dist/plugin-contract.js +45 -0
  86. package/dist/plugin-contract.js.map +1 -0
  87. package/dist/plugin.d.ts +30 -0
  88. package/dist/plugin.d.ts.map +1 -0
  89. package/dist/plugin.js +24 -0
  90. package/dist/plugin.js.map +1 -0
  91. package/dist/test-harness.d.ts +42 -0
  92. package/dist/test-harness.d.ts.map +1 -0
  93. package/dist/test-harness.js +46 -0
  94. package/dist/test-harness.js.map +1 -0
  95. package/dist/timeline.d.ts +43 -0
  96. package/dist/timeline.d.ts.map +1 -0
  97. package/dist/timeline.js +121 -0
  98. package/dist/timeline.js.map +1 -0
  99. package/package.json +68 -0
  100. package/templates/app-minimal/.gitignore.tmpl +6 -0
  101. package/templates/app-minimal/AGENTS.md.tmpl +66 -0
  102. package/templates/app-minimal/README.md.tmpl +24 -0
  103. package/templates/app-minimal/package.json.tmpl +21 -0
  104. package/templates/app-minimal/src/app.ts.tmpl +20 -0
  105. package/templates/app-minimal/src/env.ts.tmpl +12 -0
  106. package/templates/app-minimal/tests/boot.test.ts.tmpl +25 -0
  107. package/templates/app-minimal/tsconfig.json.tmpl +22 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ARKI Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,201 @@
1
+ # @arki/dot
2
+
3
+ > TypeScript-first application composition framework for the ARKI package family.
4
+
5
+ `@arki/dot` is the kernel that wires **pips**, lifecycle hooks, dependency
6
+ graphs, and diagnostics into a deterministic application boot. It gives library
7
+ authors a stable contract for declaring how their package participates in an
8
+ app, and gives app developers a single place to wire those packages together.
9
+
10
+ ## What is a pip?
11
+
12
+ A **pip** is the unit a DOT app is built from — one self-describing,
13
+ lifecycle-aware piece of an application. Each pip:
14
+
15
+ - declares a **name**, **version**, and the kinds of **services it provides**;
16
+ - runs a **5-hook lifecycle** — `configure` → `boot` → `start` → `stop` → `dispose`;
17
+ - **publishes typed services** to a shared, type-safe registry that later pips
18
+ can read from;
19
+ - **composes deterministically** — pips boot in declaration order and dispose
20
+ in reverse.
21
+
22
+ The name comes from the small dots on dice, dominoes, and music notation:
23
+ each pip is one small mark, and the *combination* of pips is what gives the app
24
+ its value. Two pips on a die make a value of two; six pips make six. The pips
25
+ **are** the app — not optional add-ons to a hidden core.
26
+
27
+ ```ts
28
+ import { defineApp } from '@arki/dot';
29
+ import { env } from '@arki/env/dot'; // env pip
30
+ import { db } from '@arki/db/dot'; // db pip
31
+ import { kv } from '@arki/kv/dot'; // kv pip
32
+
33
+ const app = await defineApp('orders')
34
+ .use(env({ schema: { /* ... */ } })) // 1st pip — provides services.env
35
+ .use(db({ relations })) // 2nd pip — provides services.db
36
+ .use(kv({ url: process.env.KV_URL! })) // 3rd pip — provides services.kv
37
+ .boot(); // pips boot in declaration order
38
+
39
+ await app.services.db.query(/* ... */);
40
+ await app.dispose(); // pips dispose in REVERSE order
41
+ ```
42
+
43
+ Each `/dot` subpath exports a **pip** for that package. The subpath names
44
+ the framework the adapter targets (DOT), not the unit (which is a pip).
45
+
46
+ > **Why not "plugin"?** Plugins suggest *optional add-ons* to a core. DOT's
47
+ > reality is the opposite: there is no hidden core — the pips *are* the app.
48
+ > "Pip" names that truth, and ties the framework to the DOT name etymologically
49
+ > (a dot, a pip, a small mark that gains meaning by combining with others).
50
+
51
+ ## Installation
52
+
53
+ ```bash
54
+ npm install @arki/dot
55
+ # or
56
+ bun add @arki/dot
57
+ ```
58
+
59
+ ## Quick start
60
+
61
+ ```ts
62
+ import { defineApp, defineDotPip } from '@arki/dot';
63
+
64
+ const billingPip = defineDotPip({
65
+ name: 'billing',
66
+ version: '1.0.0',
67
+ configure(ctx) {
68
+ // Validate config, register schemas, no I/O.
69
+ },
70
+ async boot(ctx) {
71
+ // Open connections, register providers.
72
+ return { stripe: makeStripeClient() };
73
+ },
74
+ async start(ctx) {
75
+ // Begin processing — workers, subscriptions, schedulers.
76
+ },
77
+ async stop() {
78
+ // Stop processing — drain workers, unsubscribe.
79
+ },
80
+ async dispose() {
81
+ // Close connections, free resources.
82
+ },
83
+ });
84
+
85
+ const app = defineApp('acme')
86
+ .use(billingPip);
87
+
88
+ await app.configure();
89
+ await app.boot();
90
+ await app.start();
91
+
92
+ // app.manifest, app.diagnostics — agent-friendly envelopes.
93
+
94
+ await app.stop();
95
+ await app.dispose();
96
+ ```
97
+
98
+ ## Pip authoring
99
+
100
+ `defineDotPip(config)` accepts five lifecycle hooks. Each receives a
101
+ phase-specific context with services contributed by earlier pips:
102
+
103
+ | Hook | Purpose |
104
+ | ----------- | ---------------------------------------------------------------- |
105
+ | `configure` | Validate static config; declare schemas, routes, services. No I/O. |
106
+ | `boot` | Open connections; register providers; return a typed kit. |
107
+ | `start` | Begin processing (workers, subscribers, schedulers). |
108
+ | `stop` | Stop processing in reverse dependency order. |
109
+ | `dispose` | Free resources after `stop`. |
110
+
111
+ Pips can declare dependencies on others by name. The kernel computes a
112
+ topological order and runs hooks deterministically — same input, same order,
113
+ every time.
114
+
115
+ ## Lifecycle
116
+
117
+ `defineApp(name)` returns a builder. Calling `.use(pip)` accumulates
118
+ pips. The lifecycle then flows:
119
+
120
+ ```
121
+ defined ──configure()──▶ configured ──boot()──▶ booted ──start()──▶ started
122
+
123
+ disposed ◀──dispose()── stopped ◀──stop()───────┘
124
+ ```
125
+
126
+ `boot()` runs `configure()` implicitly if you skipped it. `start()` runs
127
+ `boot()` implicitly. `stop()` and `dispose()` always run in reverse dependency
128
+ order, even when an earlier hook failed — failure isolation is part of the
129
+ contract.
130
+
131
+ ## CLI
132
+
133
+ `@arki/dot` ships a small CLI for scaffolding and inspecting apps:
134
+
135
+ ```bash
136
+ # Scaffold a minimal DOT app (package.json, tsconfig, app entrypoint,
137
+ # env schema, AGENTS.md, README, gitignore, vitest boot test).
138
+ dot new my-app
139
+
140
+ # Preview the file operations without writing anything.
141
+ dot new my-app --dry-run --json | jq '.operations'
142
+
143
+ # Print the app manifest as a structured envelope.
144
+ dot explain --app ./my-app.ts
145
+
146
+ # Run boot-time diagnostics; non-zero exit if any check fails.
147
+ dot doctor --app ./my-app.ts
148
+
149
+ # Every command supports --json for agent-friendly output.
150
+ dot explain --app ./my-app.ts --json | jq '.data.pips'
151
+ ```
152
+
153
+ The CLI emits the same envelope shape as the in-process diagnostics snapshot
154
+ (`app.diagnostics`), so the same downstream tools can consume either.
155
+
156
+ ### `dot new <app-name>`
157
+
158
+ Scaffolds a minimal DOT app under `<app-name>/` (override with `--target`).
159
+ The scaffold ships a `defineApp(...)` entrypoint wired to `@arki/env/dot`,
160
+ a vitest that boots the app and asserts the manifest shape, and an
161
+ `AGENTS.md` documenting verification commands and the public/private
162
+ boundary for agents working in the generated tree. Pass `--dry-run --json`
163
+ to inspect the exact file operations (path, action, contentHash,
164
+ contentBytes, reason) before committing them to disk; `--force`
165
+ overwrites pre-existing files in the target directory.
166
+
167
+ Templates live at [`templates/app-minimal/`](./templates/app-minimal) and
168
+ ship with the published tarball.
169
+
170
+ ## Architecture
171
+
172
+ `@arki/dot` is intentionally small: it defines the contracts (pip shape,
173
+ lifecycle hooks, manifest schema, diagnostics envelope) and runs them. Adapters
174
+ that bridge databases, queues, auth providers, and HTTP routers live in their
175
+ own packages and consume `@arki/dot` as a peer dependency.
176
+
177
+ This keeps the kernel free of optional dependencies and lets each adapter
178
+ ship at its own cadence.
179
+
180
+ ## Documentation
181
+
182
+ The full docs live in [`docs/`](./docs):
183
+
184
+ - [Principles](./docs/principles.md) — **read first.** The five rules every
185
+ API, error, and PR is measured against. Slightly playful, very precise.
186
+ - [Quickstart](./docs/quickstart.md) — boot your first app in five minutes.
187
+ - [Pip authoring](./docs/pip-authoring.md) — write your own `DotPip`.
188
+ - [Lifecycle](./docs/lifecycle.md) — the 5-hook contract.
189
+ - [Diagnostics](./docs/diagnostics.md) — `app.manifest`, `app.diagnostics`,
190
+ `dot explain`, `dot doctor`.
191
+ - [Adapter authoring](./docs/adapter-authoring.md) — expose your package as
192
+ a DOT pip.
193
+ - [Agent guide](./docs/agent-guide.md) — how coding agents inspect, modify,
194
+ and verify DOT apps.
195
+ - [Release policy](./docs/release-policy.md) — SemVer and deprecation.
196
+
197
+ Agent-discoverable index: [`llms.txt`](./llms.txt).
198
+
199
+ ## License
200
+
201
+ MIT — see [LICENSE](./LICENSE).
@@ -0,0 +1,65 @@
1
+ /**
2
+ * App-file discovery + dynamic import for the DOT CLI.
3
+ *
4
+ * The CLI inspects a user's DOT app at the command line. Apps live in source
5
+ * files like `dot.config.ts` or `src/app.ts`; this module resolves the right
6
+ * file, imports it, unwraps the default export, and returns either a
7
+ * `DotApp` or `DotAppBuilder`.
8
+ *
9
+ * The CLI commands (`explain`, `doctor`) then decide whether to call
10
+ * `.configure()` / `.boot()` on the result.
11
+ */
12
+ import type { DotApp, DotAppBuilder, DotAppConfigured } from '../define-app.js';
13
+ export type DiscoveredApp = DotApp<Record<string, unknown>> | DotAppBuilder<Record<string, unknown>> | DotAppConfigured<Record<string, unknown>>;
14
+ export type DiscoveryOptions = {
15
+ /** Explicit app file path. When set, takes precedence over the search list. */
16
+ appPath?: string;
17
+ /** Working directory for discovery. Defaults to `process.cwd()`. */
18
+ cwd?: string;
19
+ };
20
+ export type DiscoveryResult = {
21
+ /** Absolute path of the resolved app file. */
22
+ filePath: string;
23
+ /** Discovered app (builder, configured, or booted). */
24
+ app: DiscoveredApp;
25
+ };
26
+ /**
27
+ * Resolve which app file to load.
28
+ *
29
+ * If `appPath` is set, return its absolute path (without checking existence —
30
+ * the caller's `import` will throw with a clearer error if missing).
31
+ * Otherwise, walk the default file list and return the first that exists.
32
+ *
33
+ * Returns `null` when nothing was found.
34
+ */
35
+ export declare function resolveAppFile(options?: DiscoveryOptions): Promise<string | null>;
36
+ /**
37
+ * Heuristic guard: detect whether the default export looks like a `DotApp` or
38
+ * `DotAppBuilder` / `DotAppConfigured`. We avoid `instanceof` because the
39
+ * surface types are structural; instead we duck-type the key methods.
40
+ */
41
+ declare function isDotAppBuilder(value: unknown): value is DotAppBuilder<Record<string, unknown>>;
42
+ declare function isDotAppConfigured(value: unknown): value is DotAppConfigured<Record<string, unknown>>;
43
+ declare function isDotApp(value: unknown): value is DotApp<Record<string, unknown>>;
44
+ /**
45
+ * Dynamic-import the app file and unwrap its default export into a
46
+ * `DotApp` / `DotAppBuilder`. Functions returning either are awaited.
47
+ *
48
+ * Throws `DotCliError` on any failure path.
49
+ */
50
+ export declare function loadAppFromFile(filePath: string): Promise<DiscoveredApp>;
51
+ /**
52
+ * Combined: resolve the file and load the app. Throws `DotCliError` when no
53
+ * file was found or the import/export shape is invalid.
54
+ */
55
+ export declare function discoverApp(options?: DiscoveryOptions): Promise<DiscoveryResult>;
56
+ /**
57
+ * Type guards re-exported for test and renderer consumers.
58
+ */
59
+ export declare const guards: {
60
+ isDotApp: typeof isDotApp;
61
+ isDotAppBuilder: typeof isDotAppBuilder;
62
+ isDotAppConfigured: typeof isDotAppConfigured;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AAC,CAY1E;AASD;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAgD9E;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC,CAgB1F;AAED;;GAEG;AACH,eAAO,MAAM,MAAM;;;;CAIlB,CAAC"}
@@ -0,0 +1,184 @@
1
+ /**
2
+ * App-file discovery + dynamic import for the DOT CLI.
3
+ *
4
+ * The CLI inspects a user's DOT app at the command line. Apps live in source
5
+ * files like `dot.config.ts` or `src/app.ts`; this module resolves the right
6
+ * file, imports it, unwraps the default export, and returns either a
7
+ * `DotApp` or `DotAppBuilder`.
8
+ *
9
+ * The CLI commands (`explain`, `doctor`) then decide whether to call
10
+ * `.configure()` / `.boot()` on the result.
11
+ */
12
+ import { stat } from 'node:fs/promises';
13
+ import { isAbsolute, resolve } from 'node:path';
14
+ import { pathToFileURL } from 'node:url';
15
+ import { createDebugLogger } from '@arki/log/debug';
16
+ import { DotCliError, DotCliErrorCode } from './error-codes.js';
17
+ const debugDiscover = createDebugLogger('arki:dot:cli:discover');
18
+ /**
19
+ * Default file names probed at cwd, in priority order.
20
+ * Each entry is tried with each of the supported file extensions below.
21
+ */
22
+ const DEFAULT_APP_PATHS = ['dot.config', 'src/app', 'app'];
23
+ /**
24
+ * Supported file extensions. `.ts` is preferred because the CLI runs under
25
+ * Bun, which executes TypeScript natively. `.js` and `.mjs` are accepted for
26
+ * apps that prefer JS sources or pre-compiled output.
27
+ */
28
+ const SUPPORTED_EXTENSIONS = ['.ts', '.mts', '.mjs', '.js'];
29
+ async function fileExists(filePath) {
30
+ try {
31
+ const result = await stat(filePath);
32
+ return result.isFile();
33
+ }
34
+ catch {
35
+ return false;
36
+ }
37
+ }
38
+ /**
39
+ * Resolve which app file to load.
40
+ *
41
+ * If `appPath` is set, return its absolute path (without checking existence —
42
+ * the caller's `import` will throw with a clearer error if missing).
43
+ * Otherwise, walk the default file list and return the first that exists.
44
+ *
45
+ * Returns `null` when nothing was found.
46
+ */
47
+ export async function resolveAppFile(options = {}) {
48
+ const cwd = options.cwd ?? process.cwd();
49
+ if (options.appPath) {
50
+ const absolute = isAbsolute(options.appPath) ? options.appPath : resolve(cwd, options.appPath);
51
+ debugDiscover('explicit app path: %s', absolute);
52
+ return absolute;
53
+ }
54
+ for (const base of DEFAULT_APP_PATHS) {
55
+ for (const ext of SUPPORTED_EXTENSIONS) {
56
+ const candidate = resolve(cwd, `${base}${ext}`);
57
+ if (await fileExists(candidate)) {
58
+ debugDiscover('discovered app file: %s', candidate);
59
+ return candidate;
60
+ }
61
+ }
62
+ }
63
+ debugDiscover('no app file found at %s', cwd);
64
+ return null;
65
+ }
66
+ /**
67
+ * Heuristic guard: detect whether the default export looks like a `DotApp` or
68
+ * `DotAppBuilder` / `DotAppConfigured`. We avoid `instanceof` because the
69
+ * surface types are structural; instead we duck-type the key methods.
70
+ */
71
+ function isDotAppBuilder(value) {
72
+ if (typeof value !== 'object' || value === null)
73
+ return false;
74
+ const v = value;
75
+ return typeof v.use === 'function' && typeof v.configure === 'function' && typeof v.boot === 'function';
76
+ }
77
+ function isDotAppConfigured(value) {
78
+ if (typeof value !== 'object' || value === null)
79
+ return false;
80
+ const v = value;
81
+ return (typeof v.name === 'string' &&
82
+ typeof v.boot === 'function' &&
83
+ 'manifest' in v &&
84
+ 'diagnostics' in v &&
85
+ typeof v.use !== 'function');
86
+ }
87
+ function isDotApp(value) {
88
+ if (typeof value !== 'object' || value === null)
89
+ return false;
90
+ const v = value;
91
+ return (typeof v.name === 'string' &&
92
+ typeof v.dispose === 'function' &&
93
+ typeof v.start === 'function' &&
94
+ typeof v.stop === 'function' &&
95
+ 'manifest' in v &&
96
+ 'diagnostics' in v &&
97
+ 'services' in v);
98
+ }
99
+ function unwrapDefaultExport(mod) {
100
+ if (typeof mod !== 'object' || mod === null)
101
+ return mod;
102
+ const record = mod;
103
+ if ('default' in record)
104
+ return record.default;
105
+ return mod;
106
+ }
107
+ /**
108
+ * Dynamic-import the app file and unwrap its default export into a
109
+ * `DotApp` / `DotAppBuilder`. Functions returning either are awaited.
110
+ *
111
+ * Throws `DotCliError` on any failure path.
112
+ */
113
+ export async function loadAppFromFile(filePath) {
114
+ let mod;
115
+ try {
116
+ // Use `pathToFileURL` so dynamic import accepts absolute paths on Windows.
117
+ mod = await import(pathToFileURL(filePath).href);
118
+ }
119
+ catch (err) {
120
+ throw new DotCliError({
121
+ code: DotCliErrorCode.AppImportFailed,
122
+ message: `Failed to import app file at ${filePath}: ${err instanceof Error ? err.message : String(err)}`,
123
+ remediation: 'Verify the file path is correct and that the module loads without errors. Run the file directly with `bun <path>` to reproduce.',
124
+ metadata: { filePath },
125
+ cause: err,
126
+ });
127
+ }
128
+ let candidate = unwrapDefaultExport(mod);
129
+ // If the default export is a function, call it (it may return the
130
+ // builder/app, or a Promise of one). This supports lazy/async setup.
131
+ if (typeof candidate === 'function') {
132
+ try {
133
+ const fn = candidate;
134
+ const result = fn();
135
+ candidate = result instanceof Promise ? await result : result;
136
+ }
137
+ catch (err) {
138
+ throw new DotCliError({
139
+ code: DotCliErrorCode.AppImportFailed,
140
+ message: `Default export function in ${filePath} threw: ${err instanceof Error ? err.message : String(err)}`,
141
+ remediation: 'Make the default-exported factory return a DotApp or DotAppBuilder. Check for setup errors.',
142
+ metadata: { filePath },
143
+ cause: err,
144
+ });
145
+ }
146
+ }
147
+ if (isDotApp(candidate) || isDotAppBuilder(candidate) || isDotAppConfigured(candidate)) {
148
+ debugDiscover('loaded app from %s', filePath);
149
+ return candidate;
150
+ }
151
+ throw new DotCliError({
152
+ code: DotCliErrorCode.AppInvalidExport,
153
+ message: `Default export from ${filePath} is not a DotApp or DotAppBuilder.`,
154
+ remediation: 'Export a DotApp or DotAppBuilder as the default. Example: `export default defineApp("my-app").use(pip);`',
155
+ metadata: { filePath },
156
+ });
157
+ }
158
+ /**
159
+ * Combined: resolve the file and load the app. Throws `DotCliError` when no
160
+ * file was found or the import/export shape is invalid.
161
+ */
162
+ export async function discoverApp(options = {}) {
163
+ const filePath = await resolveAppFile(options);
164
+ if (!filePath) {
165
+ const cwd = options.cwd ?? process.cwd();
166
+ throw new DotCliError({
167
+ code: DotCliErrorCode.AppNotFound,
168
+ message: `No DOT app file found in ${cwd}.`,
169
+ remediation: 'Create `dot.config.ts` exporting your app (e.g. `export default defineApp("my-app").use(pip)`), or pass `--app <path>` to point at an existing file.',
170
+ metadata: { cwd, searched: DEFAULT_APP_PATHS },
171
+ });
172
+ }
173
+ const app = await loadAppFromFile(filePath);
174
+ return { filePath, app };
175
+ }
176
+ /**
177
+ * Type guards re-exported for test and renderer consumers.
178
+ */
179
+ export const guards = {
180
+ isDotApp,
181
+ isDotAppBuilder,
182
+ isDotAppConfigured,
183
+ };
184
+ //# sourceMappingURL=discover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discover.js","sourceRoot":"","sources":["../../src/cli/discover.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGpD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEhE,MAAM,aAAa,GAAG,iBAAiB,CAAC,uBAAuB,CAAC,CAAC;AAEjE;;;GAGG;AACH,MAAM,iBAAiB,GAAsB,CAAC,YAAY,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;AAE9E;;;;GAIG;AACH,MAAM,oBAAoB,GAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAkB/E,KAAK,UAAU,UAAU,CAAC,QAAgB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starts with `DOT_CLI_E` so it can be visually distinguished from
5
+ * lifecycle errors (`DOT_LIFECYCLE_E*`). Codes are part of the public contract
6
+ * — agents grep on them to branch behaviour. Do not renumber.
7
+ */
8
+ export declare const DotCliErrorCode: {
9
+ /** No app file could be discovered at the cwd and `--app` was not provided. */
10
+ readonly AppNotFound: "DOT_CLI_E001";
11
+ /** App file was located but its default export is not a DotApp/DotAppBuilder. */
12
+ readonly AppInvalidExport: "DOT_CLI_E002";
13
+ /** Importing the app file threw an exception. */
14
+ readonly AppImportFailed: "DOT_CLI_E003";
15
+ /** Unknown CLI command. */
16
+ readonly UnknownCommand: "DOT_CLI_E004";
17
+ /** CLI args were malformed. */
18
+ readonly InvalidArgs: "DOT_CLI_E005";
19
+ /** Configure or boot threw while preparing the app for inspection. */
20
+ readonly AppLifecycleFailed: "DOT_CLI_E006";
21
+ /** `dot doctor --observability` ran but no OTel SDK is registered. */
22
+ readonly ObservabilityNoSdk: "DOT_CLI_E007";
23
+ };
24
+ export type DotCliErrorCodeValue = (typeof DotCliErrorCode)[keyof typeof DotCliErrorCode];
25
+ /**
26
+ * Anchors on the CLI docs page. Kept here so both the renderers and tests can
27
+ * reference the same URL without drift.
28
+ */
29
+ export declare const DotCliDocsAnchor: Record<DotCliErrorCodeValue, string>;
30
+ export declare function dotCliDocsUrl(code: DotCliErrorCodeValue): string;
31
+ /**
32
+ * Structured CLI error. Carries enough metadata to be rendered as a JSON
33
+ * envelope or a human-readable diagnostic line.
34
+ */
35
+ export declare class DotCliError extends Error {
36
+ readonly code: DotCliErrorCodeValue;
37
+ readonly remediation: string;
38
+ readonly docsUrl: string;
39
+ readonly metadata?: Record<string, unknown>;
40
+ readonly cause?: unknown;
41
+ constructor(args: {
42
+ code: DotCliErrorCodeValue;
43
+ message: string;
44
+ remediation: string;
45
+ metadata?: Record<string, unknown>;
46
+ cause?: unknown;
47
+ });
48
+ }
49
+ //# sourceMappingURL=error-codes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/cli/error-codes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,eAAe;IAC1B,+EAA+E;;IAE/E,iFAAiF;;IAEjF,iDAAiD;;IAEjD,2BAA2B;;IAE3B,+BAA+B;;IAE/B,sEAAsE;;IAEtE,sEAAsE;;CAE9D,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAI1F;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAQjE,CAAC;AAEF,wBAAgB,aAAa,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAEhE;AAED;;;GAGG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;IACpC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,SAAkB,KAAK,CAAC,EAAE,OAAO,CAAC;gBAEtB,IAAI,EAAE;QAChB,IAAI,EAAE,oBAAoB,CAAC;QAC3B,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACnC,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB;CASF"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Stable error codes used by the DOT CLI.
3
+ *
4
+ * Every code starts with `DOT_CLI_E` so it can be visually distinguished from
5
+ * lifecycle errors (`DOT_LIFECYCLE_E*`). Codes are part of the public contract
6
+ * — agents grep on them to branch behaviour. Do not renumber.
7
+ */
8
+ export const DotCliErrorCode = {
9
+ /** No app file could be discovered at the cwd and `--app` was not provided. */
10
+ AppNotFound: 'DOT_CLI_E001',
11
+ /** App file was located but its default export is not a DotApp/DotAppBuilder. */
12
+ AppInvalidExport: 'DOT_CLI_E002',
13
+ /** Importing the app file threw an exception. */
14
+ AppImportFailed: 'DOT_CLI_E003',
15
+ /** Unknown CLI command. */
16
+ UnknownCommand: 'DOT_CLI_E004',
17
+ /** CLI args were malformed. */
18
+ InvalidArgs: 'DOT_CLI_E005',
19
+ /** Configure or boot threw while preparing the app for inspection. */
20
+ AppLifecycleFailed: 'DOT_CLI_E006',
21
+ /** `dot doctor --observability` ran but no OTel SDK is registered. */
22
+ ObservabilityNoSdk: 'DOT_CLI_E007',
23
+ };
24
+ const DOCS_BASE = 'https://docs.arki.dev/dot/cli';
25
+ /**
26
+ * Anchors on the CLI docs page. Kept here so both the renderers and tests can
27
+ * reference the same URL without drift.
28
+ */
29
+ export const DotCliDocsAnchor = {
30
+ [DotCliErrorCode.AppNotFound]: 'app-not-found',
31
+ [DotCliErrorCode.AppInvalidExport]: 'app-invalid-export',
32
+ [DotCliErrorCode.AppImportFailed]: 'app-import-failed',
33
+ [DotCliErrorCode.UnknownCommand]: 'unknown-command',
34
+ [DotCliErrorCode.InvalidArgs]: 'invalid-args',
35
+ [DotCliErrorCode.AppLifecycleFailed]: 'app-lifecycle-failed',
36
+ [DotCliErrorCode.ObservabilityNoSdk]: 'observability-no-sdk',
37
+ };
38
+ export function dotCliDocsUrl(code) {
39
+ return `${DOCS_BASE}#${DotCliDocsAnchor[code]}`;
40
+ }
41
+ /**
42
+ * Structured CLI error. Carries enough metadata to be rendered as a JSON
43
+ * envelope or a human-readable diagnostic line.
44
+ */
45
+ export class DotCliError extends Error {
46
+ code;
47
+ remediation;
48
+ docsUrl;
49
+ metadata;
50
+ cause;
51
+ constructor(args) {
52
+ super(args.message);
53
+ this.name = 'DotCliError';
54
+ this.code = args.code;
55
+ this.remediation = args.remediation;
56
+ this.docsUrl = dotCliDocsUrl(args.code);
57
+ this.metadata = args.metadata;
58
+ this.cause = args.cause;
59
+ }
60
+ }
61
+ //# sourceMappingURL=error-codes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-codes.js","sourceRoot":"","sources":["../../src/cli/error-codes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,+EAA+E;IAC/E,WAAW,EAAE,cAAc;IAC3B,iFAAiF;IACjF,gBAAgB,EAAE,cAAc;IAChC,iDAAiD;IACjD,eAAe,EAAE,cAAc;IAC/B,2BAA2B;IAC3B,cAAc,EAAE,cAAc;IAC9B,+BAA+B;IAC/B,WAAW,EAAE,cAAc;IAC3B,sEAAsE;IACtE,kBAAkB,EAAE,cAAc;IAClC,sEAAsE;IACtE,kBAAkB,EAAE,cAAc;CAC1B,CAAC;AAIX,MAAM,SAAS,GAAG,+BAA+B,CAAC;AAElD;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAyC;IACpE,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,eAAe;IAC9C,CAAC,eAAe,CAAC,gBAAgB,CAAC,EAAE,oBAAoB;IACxD,CAAC,eAAe,CAAC,eAAe,CAAC,EAAE,mBAAmB;IACtD,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE,iBAAiB;IACnD,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,cAAc;IAC7C,CAAC,eAAe,CAAC,kBAAkB,CAAC,EAAE,sBAAsB;IAC5D,CAAC,eAAe,CAAC,kBAAkB,CAAC,EAAE,sBAAsB;CAC7D,CAAC;AAEF,MAAM,UAAU,aAAa,CAAC,IAA0B;IACtD,OAAO,GAAG,SAAS,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;AAClD,CAAC;AAED;;;GAGG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IAC3B,IAAI,CAAuB;IAC3B,WAAW,CAAS;IACpB,OAAO,CAAS;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