@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,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diagnostics types for the DOT kernel.
|
|
3
|
+
*
|
|
4
|
+
* Where the manifest describes the static shape of an app, a
|
|
5
|
+
* `DotDiagnosticsSnapshot` is a point-in-time observability record: the
|
|
6
|
+
* lifecycle state of the app and every pip, plus structured issues with
|
|
7
|
+
* remediation guidance.
|
|
8
|
+
*
|
|
9
|
+
* CONTRACT: `DotDiagnosticsSnapshot` always exposes the same five arrays
|
|
10
|
+
* (`pips`, `routes`, `services`, `lifecycle`, `issues`). Consumers must
|
|
11
|
+
* never see an omitted array — empty is empty, but never missing.
|
|
12
|
+
* This is the "5 arrays" contract referenced by the kernel spec.
|
|
13
|
+
*/
|
|
14
|
+
//# sourceMappingURL=diagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../src/diagnostics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @arki/dot — TypeScript-first application composition framework
|
|
3
|
+
*
|
|
4
|
+
* Public surface:
|
|
5
|
+
* - `defineApp(name)` — the modern entry point for composing applications.
|
|
6
|
+
* - `defineDotPip(config)` — define lifecycle-aware pips.
|
|
7
|
+
* - Lifecycle / manifest / diagnostics types.
|
|
8
|
+
* - `testApp` / `bootTestApp` — test harnesses for pip authors.
|
|
9
|
+
*/
|
|
10
|
+
export { defineApp } from './define-app.js';
|
|
11
|
+
export type { DotApp, DotAppBuilder, DotAppConfigured } from './define-app.js';
|
|
12
|
+
export { defineDotPip, DotPipError } from './pip-contract.js';
|
|
13
|
+
export type { DotPip, DotBootContext, DotBootResult, DotConfigureContext, DotDisposeContext, DotManifestContext, DotManifestContribution, DotStartContext, DotStopContext, } from './pip-contract.js';
|
|
14
|
+
export { DotLifecycleError, DotLifecycleErrorCode, DOT_LIFECYCLE_HOOKS, } from './lifecycle.js';
|
|
15
|
+
export type { DotLifecycleHook, DotLifecycleState, DotLifecyclePipFailure, DotLifecycleErrorCodeValue, } from './lifecycle.js';
|
|
16
|
+
export type { DotAppManifest, PipManifest, RouteManifest, ServiceManifest, LifecycleManifest, DependencyEdge, DependencyEdgeKind, ServiceKind, RouteTransport, } from './manifest.js';
|
|
17
|
+
export type { DotDiagnosticsSnapshot, PipDiagnostic, RouteDiagnostic, ServiceDiagnostic, LifecycleDiagnostic, DiagnosticIssue, DiagnosticSeverity, DiagnosticStatus, } from './diagnostics.js';
|
|
18
|
+
export type { DotLifecycleEvent, DotLifecycleEventStatus, DotLifecycleObserver, DotPhaseLifecycleEvent, DotPipHookLifecycleEvent, } from './lifecycle-observer.js';
|
|
19
|
+
export { renderTimeline } from './timeline.js';
|
|
20
|
+
export type { RenderTimelineOptions } from './timeline.js';
|
|
21
|
+
export { testApp, bootTestApp } from './test-harness.js';
|
|
22
|
+
export type { TestAppOptions } from './test-harness.js';
|
|
23
|
+
export type { DotCliEnvelope, DotCliEnvelopeStatus } from './cli/render-explain.js';
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["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B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @arki/dot — TypeScript-first application composition framework
|
|
3
|
+
*
|
|
4
|
+
* Public surface:
|
|
5
|
+
* - `defineApp(name)` — the modern entry point for composing applications.
|
|
6
|
+
* - `defineDotPip(config)` — define lifecycle-aware pips.
|
|
7
|
+
* - Lifecycle / manifest / diagnostics types.
|
|
8
|
+
* - `testApp` / `bootTestApp` — test harnesses for pip authors.
|
|
9
|
+
*/
|
|
10
|
+
// #region New kernel — public surface (Task 9a)
|
|
11
|
+
export { defineApp } from './define-app.js';
|
|
12
|
+
export { defineDotPip, DotPipError } from './pip-contract.js';
|
|
13
|
+
export { DotLifecycleError, DotLifecycleErrorCode, DOT_LIFECYCLE_HOOKS, } from './lifecycle.js';
|
|
14
|
+
export { renderTimeline } from './timeline.js';
|
|
15
|
+
export { testApp, bootTestApp } from './test-harness.js';
|
|
16
|
+
// #endregion
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,gDAAgD;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAa9D,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AAuCxB,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAMzD,aAAa"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal DotApp implementation — the kernel's lifecycle scheduler.
|
|
3
|
+
*
|
|
4
|
+
* Not exported from the public surface. Tests reach it only through
|
|
5
|
+
* `defineApp(...)` and its returned `DotApp` interface.
|
|
6
|
+
*/
|
|
7
|
+
import type { DotDiagnosticsSnapshot } from '../diagnostics.js';
|
|
8
|
+
import type { DotLifecycleObserver } from '../lifecycle-observer.js';
|
|
9
|
+
import type { DotLifecycleState } from '../lifecycle.js';
|
|
10
|
+
import type { DotAppManifest } from '../manifest.js';
|
|
11
|
+
import type { AnyDotPip } from '../pip-contract.js';
|
|
12
|
+
export type DotAppInternalConfig = {
|
|
13
|
+
appName: string;
|
|
14
|
+
appVersion?: string;
|
|
15
|
+
pips: readonly AnyDotPip[];
|
|
16
|
+
/** Runtime config bag passed to every `boot` hook. */
|
|
17
|
+
config?: Readonly<Record<string, unknown>>;
|
|
18
|
+
/**
|
|
19
|
+
* Observers registered at construction time, before any phase fires.
|
|
20
|
+
* Required if a consumer wants to see `configure`-phase events — those
|
|
21
|
+
* happen before there's a public seam to call `subscribe()` on.
|
|
22
|
+
*/
|
|
23
|
+
observers?: readonly DotLifecycleObserver[];
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Internal app implementation. Public consumers see the `DotApp` interface
|
|
27
|
+
* from `../define-app.ts`.
|
|
28
|
+
*/
|
|
29
|
+
export declare class DotAppImpl {
|
|
30
|
+
#private;
|
|
31
|
+
constructor(config: DotAppInternalConfig);
|
|
32
|
+
/**
|
|
33
|
+
* Register a lifecycle observer. The returned function unregisters it.
|
|
34
|
+
* Observers added through `subscribe()` see events emitted *after*
|
|
35
|
+
* subscription only — to catch `configure` events, pass observers
|
|
36
|
+
* through `defineApp(name, { observers })` at construction time.
|
|
37
|
+
*/
|
|
38
|
+
subscribe(observer: DotLifecycleObserver): () => void;
|
|
39
|
+
get name(): string;
|
|
40
|
+
get state(): DotLifecycleState;
|
|
41
|
+
get services(): Record<string, unknown>;
|
|
42
|
+
get manifest(): DotAppManifest;
|
|
43
|
+
get diagnostics(): DotDiagnosticsSnapshot;
|
|
44
|
+
/**
|
|
45
|
+
* Run the `configure` phase synchronously. Idempotent.
|
|
46
|
+
*
|
|
47
|
+
* @throws {DotLifecycleError} if any configure hook throws or returns a Promise.
|
|
48
|
+
*/
|
|
49
|
+
runConfigure(): void;
|
|
50
|
+
/** Public boot() — idempotent + concurrent-safe. */
|
|
51
|
+
boot(): Promise<void>;
|
|
52
|
+
/** Public start(). Boots first if needed. Idempotent. */
|
|
53
|
+
start(): Promise<void>;
|
|
54
|
+
/** Public stop(). Idempotent + concurrent-safe. */
|
|
55
|
+
stop(): Promise<void>;
|
|
56
|
+
/** Public dispose(). Idempotent + concurrent-safe. */
|
|
57
|
+
dispose(): Promise<void>;
|
|
58
|
+
}
|
|
59
|
+
/** Re-export `ServiceKind` and `RouteTransport` for the kernel's internal use. */
|
|
60
|
+
export { type RouteTransport, type ServiceKind } from '../manifest.js';
|
|
61
|
+
export { type DotPip } from '../pip-contract.js';
|
|
62
|
+
//# sourceMappingURL=app-instance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-instance.d.ts","sourceRoot":"","sources":["../../src/kernel/app-instance.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAEV,sBAAsB,EAKvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAqB,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,KAAK,EAA4C,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACnG,OAAO,KAAK,EAGV,cAAc,EAKf,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EACV,SAAS,EAOV,MAAM,oBAAoB,CAAC;AA0D5B,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,SAAS,SAAS,EAAE,CAAC;IAC3B,sDAAsD;IACtD,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC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