@telora/daemon-core 0.2.29 → 0.2.33
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/env-config.d.ts +116 -0
- package/dist/env-config.d.ts.map +1 -0
- package/dist/env-config.js +230 -0
- package/dist/env-config.js.map +1 -0
- package/dist/execution-status.d.ts +45 -0
- package/dist/execution-status.d.ts.map +1 -1
- package/dist/execution-status.js +57 -0
- package/dist/execution-status.js.map +1 -1
- package/dist/focus-stage.d.ts +43 -0
- package/dist/focus-stage.d.ts.map +1 -0
- package/dist/focus-stage.js +62 -0
- package/dist/focus-stage.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/vocabulary.d.ts +5 -0
- package/dist/vocabulary.d.ts.map +1 -0
- package/dist/vocabulary.js +25 -0
- package/dist/vocabulary.js.map +1 -0
- package/package.json +5 -1
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed, validated daemon environment configuration -- the ONE discoverable
|
|
3
|
+
* index of every operational knob the daemon reads from the environment.
|
|
4
|
+
*
|
|
5
|
+
* Why this module exists:
|
|
6
|
+
* Before this, operational knobs were scattered as ad-hoc `process.env.TELORA_*`
|
|
7
|
+
* reads across the daemon. They were undiscoverable (no single list), and a
|
|
8
|
+
* typo'd or out-of-range value failed silently at runtime (NaN, wrong branch)
|
|
9
|
+
* instead of loudly at startup. This module declares EVERY knob in one place
|
|
10
|
+
* with a Zod type, a default, and a one-line description, and validates them
|
|
11
|
+
* once at startup -- so invalid config fails loudly, naming the offending var.
|
|
12
|
+
*
|
|
13
|
+
* What lives here:
|
|
14
|
+
* - Operational knobs only (loop gates, intervals, limits, ports, paths,
|
|
15
|
+
* branch names, registry URL, telemetry tuning). Connection identity
|
|
16
|
+
* (TELORA_TRACKER_ID / _ORGANIZATION_ID / _PRODUCT_ID / _URL / _REPO_PATH,
|
|
17
|
+
* CLAUDE_CODE_PATH, TELORA_LOG_DIR, SESSION_TIMEOUT_MS) stays in
|
|
18
|
+
* `config.ts`'s BASE_ENV_MAP -- that is the established home for connection
|
|
19
|
+
* fields and the multi-product normalization. This module does not
|
|
20
|
+
* duplicate them.
|
|
21
|
+
* - Secrets (ANTHROPIC_API_KEY, OPENAI_API_KEY, ...) are intentionally OUT of
|
|
22
|
+
* scope: they are read by spawned processes, not the daemon's own config.
|
|
23
|
+
*
|
|
24
|
+
* Loop-gate semantics:
|
|
25
|
+
* The opt-out loop gates (TELORA_FOCUS_LOOP, ...) MUST reproduce
|
|
26
|
+
* `shouldRunLoop` EXACTLY: unset -> true, '' -> true, '0' -> false,
|
|
27
|
+
* anything else -> true. `loopGate()` below is the canonical preprocessor.
|
|
28
|
+
*
|
|
29
|
+
* Discoverability:
|
|
30
|
+
* `ENV_VAR_METADATA` is the machine-readable index (name + description +
|
|
31
|
+
* default + kind) of all declared knobs. `formatEnvVarTable()` renders it
|
|
32
|
+
* for docs / `--help`.
|
|
33
|
+
*/
|
|
34
|
+
import { z } from 'zod';
|
|
35
|
+
/**
|
|
36
|
+
* Reproduce the canonical opt-out loop-gate semantics as a boolean:
|
|
37
|
+
* undefined -> true (unset: loop fires)
|
|
38
|
+
* '' -> true (treated like unset)
|
|
39
|
+
* '0' -> false (explicit opt-out)
|
|
40
|
+
* anything -> true ('1', 'true', 'yes', etc.)
|
|
41
|
+
*
|
|
42
|
+
* Keep this in lockstep with `shouldRunLoop` in
|
|
43
|
+
* `packages/daemon/src/focus-engine.ts`.
|
|
44
|
+
*/
|
|
45
|
+
export declare function loopGateEnabled(raw: string | undefined): boolean;
|
|
46
|
+
export type EnvVarKind = 'loop-gate' | 'int' | 'float' | 'port' | 'bool' | 'string' | 'enum';
|
|
47
|
+
export interface EnvVarMeta {
|
|
48
|
+
/** The process.env variable name (e.g. TELORA_FOCUS_LOOP). */
|
|
49
|
+
name: string;
|
|
50
|
+
/** The typed-config field name this var populates. */
|
|
51
|
+
field: keyof EnvConfig;
|
|
52
|
+
/** Coarse kind, for rendering / docs. */
|
|
53
|
+
kind: EnvVarKind;
|
|
54
|
+
/** Default applied when the var is unset or empty. */
|
|
55
|
+
default: string | number | boolean | undefined;
|
|
56
|
+
/** One-line human description of what the knob does. */
|
|
57
|
+
description: string;
|
|
58
|
+
}
|
|
59
|
+
declare const EnvConfigSchema: z.ZodObject<{
|
|
60
|
+
TELORA_FOCUS_LOOP: z.ZodType<boolean, unknown, z.core.$ZodTypeInternals<boolean, unknown>>;
|
|
61
|
+
TELORA_VERIFICATION_LOOP: z.ZodType<boolean, unknown, z.core.$ZodTypeInternals<boolean, unknown>>;
|
|
62
|
+
TELORA_MERGE_BACK_LOOP: z.ZodType<boolean, unknown, z.core.$ZodTypeInternals<boolean, unknown>>;
|
|
63
|
+
TELORA_FRT_PROSE_LOOP: z.ZodType<boolean, unknown, z.core.$ZodTypeInternals<boolean, unknown>>;
|
|
64
|
+
TELORA_PRD_LOOP: z.ZodType<boolean, unknown, z.core.$ZodTypeInternals<boolean, unknown>>;
|
|
65
|
+
TELORA_DRIFT_EVAL_LOOP: z.ZodType<boolean, unknown, z.core.$ZodTypeInternals<boolean, unknown>>;
|
|
66
|
+
TELORA_SECURITY_SCAN_LOOP: z.ZodType<boolean, unknown, z.core.$ZodTypeInternals<boolean, unknown>>;
|
|
67
|
+
TELORA_SECURITY_SCAN_INTERVAL_HOURS: z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>;
|
|
68
|
+
TELORA_STUCK_BRANCH_THRESHOLD_HOURS: z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>;
|
|
69
|
+
TELORA_REVIEW_REMEDIATION_LIMIT: z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>;
|
|
70
|
+
TELORA_SCOPE_COVERAGE_NO_PROGRESS_LIMIT: z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>;
|
|
71
|
+
TELORA_WORKTREE_DIR: z.ZodType<string | undefined, unknown, z.core.$ZodTypeInternals<string | undefined, unknown>>;
|
|
72
|
+
TELORA_INTEGRATION_BRANCH: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
73
|
+
TELORA_POLICY_FAILURE_MODE: z.ZodPipe<z.ZodTransform<string, unknown>, z.ZodEnum<{
|
|
74
|
+
[x: string]: string;
|
|
75
|
+
}>>;
|
|
76
|
+
TELORA_REGISTRY_URL: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
77
|
+
TELORA_TELEMETRY_ENABLED: z.ZodType<boolean, unknown, z.core.$ZodTypeInternals<boolean, unknown>>;
|
|
78
|
+
TELORA_TELEMETRY_PORT: z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>;
|
|
79
|
+
TELORA_TELEMETRY_FLUSH_INTERVAL_MS: z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>;
|
|
80
|
+
TELORA_TELEMETRY_RETENTION_DAYS: z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>;
|
|
81
|
+
MAX_TOTAL_SESSIONS: z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>;
|
|
82
|
+
TOKEN_LIMIT: z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>;
|
|
83
|
+
COST_LIMIT: z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>;
|
|
84
|
+
MERGE_LOCK_TIMEOUT_MS: z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>;
|
|
85
|
+
MERGE_LOCK_CONTENTION_WARNING_MS: z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>;
|
|
86
|
+
LOG_MAX_AGE_DAYS: z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>;
|
|
87
|
+
LOG_MAX_TOTAL_BYTES: z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>;
|
|
88
|
+
LOG_MAX_FILES: z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
/** Fully typed, validated, frozen operational config. */
|
|
91
|
+
export type EnvConfig = z.infer<typeof EnvConfigSchema>;
|
|
92
|
+
/**
|
|
93
|
+
* Machine-readable index of every declared knob -- the discoverability surface.
|
|
94
|
+
* Order mirrors the schema declaration above.
|
|
95
|
+
*/
|
|
96
|
+
export declare const ENV_VAR_METADATA: readonly EnvVarMeta[];
|
|
97
|
+
/**
|
|
98
|
+
* Parse + validate the operational env config ONCE and return a typed, frozen
|
|
99
|
+
* object. On invalid input, throws a CLEAR, ACTIONABLE error naming each
|
|
100
|
+
* offending variable and what was expected -- so a typo'd MERGE_LOCK_TIMEOUT_MS
|
|
101
|
+
* or a non-numeric TELORA_TELEMETRY_PORT fails loudly at startup rather than
|
|
102
|
+
* silently at runtime.
|
|
103
|
+
*
|
|
104
|
+
* @param env Env source (defaults to process.env). When omitted, the result is
|
|
105
|
+
* memoized; pass an explicit env (e.g. in tests) to bypass the cache.
|
|
106
|
+
*/
|
|
107
|
+
export declare function loadEnvConfig(env?: NodeJS.ProcessEnv): EnvConfig;
|
|
108
|
+
/** Test-only: clear the memoized config so a later load re-reads process.env. */
|
|
109
|
+
export declare function resetEnvConfigCache(): void;
|
|
110
|
+
/**
|
|
111
|
+
* Render the knob index as a human-readable table (for docs / --help output).
|
|
112
|
+
* This is the discoverable list of every operational env var.
|
|
113
|
+
*/
|
|
114
|
+
export declare function formatEnvVarTable(): string;
|
|
115
|
+
export {};
|
|
116
|
+
//# sourceMappingURL=env-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-config.d.ts","sourceRoot":"","sources":["../src/env-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAIhE;AAsED,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE7F,MAAM,WAAW,UAAU;IACzB,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,KAAK,EAAE,MAAM,SAAS,CAAC;IACvB,yCAAyC;IACzC,IAAI,EAAE,UAAU,CAAC;IACjB,sDAAsD;IACtD,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;IAC/C,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;CACrB;AAiDD,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAwB,CAAC;AAE9C,yDAAyD;AACzD,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,UAAU,EAiChD,CAAC;AAQH;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,GAAG,SAAS,CA6BhE;AAED,iFAAiF;AACjF,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAM1C"}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed, validated daemon environment configuration -- the ONE discoverable
|
|
3
|
+
* index of every operational knob the daemon reads from the environment.
|
|
4
|
+
*
|
|
5
|
+
* Why this module exists:
|
|
6
|
+
* Before this, operational knobs were scattered as ad-hoc `process.env.TELORA_*`
|
|
7
|
+
* reads across the daemon. They were undiscoverable (no single list), and a
|
|
8
|
+
* typo'd or out-of-range value failed silently at runtime (NaN, wrong branch)
|
|
9
|
+
* instead of loudly at startup. This module declares EVERY knob in one place
|
|
10
|
+
* with a Zod type, a default, and a one-line description, and validates them
|
|
11
|
+
* once at startup -- so invalid config fails loudly, naming the offending var.
|
|
12
|
+
*
|
|
13
|
+
* What lives here:
|
|
14
|
+
* - Operational knobs only (loop gates, intervals, limits, ports, paths,
|
|
15
|
+
* branch names, registry URL, telemetry tuning). Connection identity
|
|
16
|
+
* (TELORA_TRACKER_ID / _ORGANIZATION_ID / _PRODUCT_ID / _URL / _REPO_PATH,
|
|
17
|
+
* CLAUDE_CODE_PATH, TELORA_LOG_DIR, SESSION_TIMEOUT_MS) stays in
|
|
18
|
+
* `config.ts`'s BASE_ENV_MAP -- that is the established home for connection
|
|
19
|
+
* fields and the multi-product normalization. This module does not
|
|
20
|
+
* duplicate them.
|
|
21
|
+
* - Secrets (ANTHROPIC_API_KEY, OPENAI_API_KEY, ...) are intentionally OUT of
|
|
22
|
+
* scope: they are read by spawned processes, not the daemon's own config.
|
|
23
|
+
*
|
|
24
|
+
* Loop-gate semantics:
|
|
25
|
+
* The opt-out loop gates (TELORA_FOCUS_LOOP, ...) MUST reproduce
|
|
26
|
+
* `shouldRunLoop` EXACTLY: unset -> true, '' -> true, '0' -> false,
|
|
27
|
+
* anything else -> true. `loopGate()` below is the canonical preprocessor.
|
|
28
|
+
*
|
|
29
|
+
* Discoverability:
|
|
30
|
+
* `ENV_VAR_METADATA` is the machine-readable index (name + description +
|
|
31
|
+
* default + kind) of all declared knobs. `formatEnvVarTable()` renders it
|
|
32
|
+
* for docs / `--help`.
|
|
33
|
+
*/
|
|
34
|
+
import { z } from 'zod';
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
// Loop-gate semantics (must match focus-engine.shouldRunLoop EXACTLY)
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
/**
|
|
39
|
+
* Reproduce the canonical opt-out loop-gate semantics as a boolean:
|
|
40
|
+
* undefined -> true (unset: loop fires)
|
|
41
|
+
* '' -> true (treated like unset)
|
|
42
|
+
* '0' -> false (explicit opt-out)
|
|
43
|
+
* anything -> true ('1', 'true', 'yes', etc.)
|
|
44
|
+
*
|
|
45
|
+
* Keep this in lockstep with `shouldRunLoop` in
|
|
46
|
+
* `packages/daemon/src/focus-engine.ts`.
|
|
47
|
+
*/
|
|
48
|
+
export function loopGateEnabled(raw) {
|
|
49
|
+
if (raw === undefined)
|
|
50
|
+
return true;
|
|
51
|
+
if (raw === '')
|
|
52
|
+
return true;
|
|
53
|
+
return raw !== '0';
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A Zod schema that parses a raw env string into a loop-gate boolean using
|
|
57
|
+
* the exact opt-out semantics above. Used for every loop-gate knob.
|
|
58
|
+
*/
|
|
59
|
+
const loopGate = () => z.preprocess((v) => loopGateEnabled(v === undefined ? undefined : String(v)), z.boolean());
|
|
60
|
+
// ---------------------------------------------------------------------------
|
|
61
|
+
// Numeric coercion helpers
|
|
62
|
+
//
|
|
63
|
+
// We hand-write the preprocess so an invalid value produces a CLEAR, ACTIONABLE
|
|
64
|
+
// error that names the offending var (the field key is included by Zod). An
|
|
65
|
+
// empty/unset value falls through to the declared default.
|
|
66
|
+
// ---------------------------------------------------------------------------
|
|
67
|
+
/** Positive integer (> 0). Unset/'' -> default. Non-numeric -> loud error. */
|
|
68
|
+
const positiveInt = (def) => z.preprocess((v) => {
|
|
69
|
+
if (v === undefined || v === '')
|
|
70
|
+
return def;
|
|
71
|
+
const n = Number(v);
|
|
72
|
+
return n;
|
|
73
|
+
}, z.number({ message: 'must be a number' }).int('must be an integer').positive('must be > 0'));
|
|
74
|
+
/** Positive float (> 0). Unset/'' -> default. Non-numeric -> loud error. */
|
|
75
|
+
const positiveFloat = (def) => z.preprocess((v) => {
|
|
76
|
+
if (v === undefined || v === '')
|
|
77
|
+
return def;
|
|
78
|
+
return Number(v);
|
|
79
|
+
}, z.number({ message: 'must be a number' }).positive('must be > 0'));
|
|
80
|
+
/** TCP port (1..65535). Unset/'' -> default. */
|
|
81
|
+
const port = (def) => z.preprocess((v) => {
|
|
82
|
+
if (v === undefined || v === '')
|
|
83
|
+
return def;
|
|
84
|
+
return Number(v);
|
|
85
|
+
}, z.number({ message: 'must be a number' }).int('must be an integer').min(1, 'must be >= 1').max(65535, 'must be <= 65535'));
|
|
86
|
+
/** Boolean with true/false/1/0 semantics. Unset/'' -> default. */
|
|
87
|
+
const boolEnabled = (def) => z.preprocess((v) => {
|
|
88
|
+
if (v === undefined || v === '')
|
|
89
|
+
return def;
|
|
90
|
+
const s = String(v).toLowerCase();
|
|
91
|
+
if (s === '0' || s === 'false' || s === 'no')
|
|
92
|
+
return false;
|
|
93
|
+
return true;
|
|
94
|
+
}, z.boolean());
|
|
95
|
+
/** Optional string (undefined when unset/''); never errors. */
|
|
96
|
+
const optionalString = () => z.preprocess((v) => (v === undefined || v === '' ? undefined : String(v)), z.string().optional());
|
|
97
|
+
/** String with a default when unset/''. */
|
|
98
|
+
const stringDefault = (def) => z.preprocess((v) => (v === undefined || v === '' ? def : String(v)), z.string());
|
|
99
|
+
/** Enum string with a default. Inference preserves the literal union. */
|
|
100
|
+
const enumDefault = (values, def) => z.preprocess((v) => (v === undefined || v === '' ? def : String(v)), z.enum(values));
|
|
101
|
+
// ---------------------------------------------------------------------------
|
|
102
|
+
// Schema + metadata, declared together so they cannot drift.
|
|
103
|
+
//
|
|
104
|
+
// Loop gates -- opt-out (unset/''/other -> on, '0' -> off):
|
|
105
|
+
// ---------------------------------------------------------------------------
|
|
106
|
+
const schemaShape = {
|
|
107
|
+
// ── Loop gates (opt-out: '0' disables, everything else enables) ──
|
|
108
|
+
TELORA_FOCUS_LOOP: loopGate(),
|
|
109
|
+
TELORA_VERIFICATION_LOOP: loopGate(),
|
|
110
|
+
TELORA_MERGE_BACK_LOOP: loopGate(),
|
|
111
|
+
TELORA_FRT_PROSE_LOOP: loopGate(),
|
|
112
|
+
TELORA_PRD_LOOP: loopGate(),
|
|
113
|
+
TELORA_DRIFT_EVAL_LOOP: loopGate(),
|
|
114
|
+
TELORA_SECURITY_SCAN_LOOP: loopGate(),
|
|
115
|
+
// ── Loop / scan cadence + bounds ──
|
|
116
|
+
TELORA_SECURITY_SCAN_INTERVAL_HOURS: positiveFloat(24),
|
|
117
|
+
TELORA_STUCK_BRANCH_THRESHOLD_HOURS: positiveFloat(24),
|
|
118
|
+
TELORA_REVIEW_REMEDIATION_LIMIT: positiveInt(3),
|
|
119
|
+
TELORA_SCOPE_COVERAGE_NO_PROGRESS_LIMIT: positiveInt(3),
|
|
120
|
+
// ── Branch / path / registry ──
|
|
121
|
+
TELORA_WORKTREE_DIR: optionalString(),
|
|
122
|
+
TELORA_INTEGRATION_BRANCH: stringDefault('integration'),
|
|
123
|
+
TELORA_POLICY_FAILURE_MODE: enumDefault(['fail-open', 'fail-closed'], 'fail-open'),
|
|
124
|
+
TELORA_REGISTRY_URL: stringDefault('https://registry.npmjs.org/'),
|
|
125
|
+
// ── Telemetry / OTLP receiver ──
|
|
126
|
+
TELORA_TELEMETRY_ENABLED: boolEnabled(true),
|
|
127
|
+
TELORA_TELEMETRY_PORT: port(4318),
|
|
128
|
+
TELORA_TELEMETRY_FLUSH_INTERVAL_MS: positiveInt(5000),
|
|
129
|
+
TELORA_TELEMETRY_RETENTION_DAYS: positiveInt(30),
|
|
130
|
+
// ── Session / cost limits (non-prefixed operational vars) ──
|
|
131
|
+
MAX_TOTAL_SESSIONS: positiveInt(5),
|
|
132
|
+
TOKEN_LIMIT: positiveInt(200000),
|
|
133
|
+
COST_LIMIT: positiveFloat(10.0),
|
|
134
|
+
MERGE_LOCK_TIMEOUT_MS: positiveInt(300000),
|
|
135
|
+
MERGE_LOCK_CONTENTION_WARNING_MS: positiveInt(30000),
|
|
136
|
+
// ── Log retention ──
|
|
137
|
+
LOG_MAX_AGE_DAYS: positiveInt(7),
|
|
138
|
+
LOG_MAX_TOTAL_BYTES: positiveInt(1073741824),
|
|
139
|
+
LOG_MAX_FILES: positiveInt(500),
|
|
140
|
+
};
|
|
141
|
+
const EnvConfigSchema = z.object(schemaShape);
|
|
142
|
+
/**
|
|
143
|
+
* Machine-readable index of every declared knob -- the discoverability surface.
|
|
144
|
+
* Order mirrors the schema declaration above.
|
|
145
|
+
*/
|
|
146
|
+
export const ENV_VAR_METADATA = Object.freeze([
|
|
147
|
+
{ name: 'TELORA_FOCUS_LOOP', field: 'TELORA_FOCUS_LOOP', kind: 'loop-gate', default: true, description: 'Differential focus loop tick (opt-out: 0 disables).' },
|
|
148
|
+
{ name: 'TELORA_VERIFICATION_LOOP', field: 'TELORA_VERIFICATION_LOOP', kind: 'loop-gate', default: true, description: 'Pluggable per-delivery verification tick (opt-out: 0 disables).' },
|
|
149
|
+
{ name: 'TELORA_MERGE_BACK_LOOP', field: 'TELORA_MERGE_BACK_LOOP', kind: 'loop-gate', default: true, description: 'Continuous merge-back recovery tick (opt-out: 0 disables).' },
|
|
150
|
+
{ name: 'TELORA_FRT_PROSE_LOOP', field: 'TELORA_FRT_PROSE_LOOP', kind: 'loop-gate', default: true, description: 'Eager FRT cascade-prose reconciliation tick (opt-out: 0 disables).' },
|
|
151
|
+
{ name: 'TELORA_PRD_LOOP', field: 'TELORA_PRD_LOOP', kind: 'loop-gate', default: true, description: 'PRD-lifecycle controller tick; arms PRT frontier foci (opt-out: 0 disables).' },
|
|
152
|
+
{ name: 'TELORA_DRIFT_EVAL_LOOP', field: 'TELORA_DRIFT_EVAL_LOOP', kind: 'loop-gate', default: true, description: 'Reality-tree drift evaluation tick (opt-out: 0 disables).' },
|
|
153
|
+
{ name: 'TELORA_SECURITY_SCAN_LOOP', field: 'TELORA_SECURITY_SCAN_LOOP', kind: 'loop-gate', default: true, description: 'Pluggable security scanner engine tick (opt-out: 0 disables).' },
|
|
154
|
+
{ name: 'TELORA_SECURITY_SCAN_INTERVAL_HOURS', field: 'TELORA_SECURITY_SCAN_INTERVAL_HOURS', kind: 'float', default: 24, description: 'Cadence (hours) of the security scan loop.' },
|
|
155
|
+
{ name: 'TELORA_STUCK_BRANCH_THRESHOLD_HOURS', field: 'TELORA_STUCK_BRANCH_THRESHOLD_HOURS', kind: 'float', default: 24, description: 'Hours a focus branch may lead integration before a stuck_focus_branch escalation.' },
|
|
156
|
+
{ name: 'TELORA_REVIEW_REMEDIATION_LIMIT', field: 'TELORA_REVIEW_REMEDIATION_LIMIT', kind: 'int', default: 3, description: 'Cap on review remediation cycles before escalation.' },
|
|
157
|
+
{ name: 'TELORA_SCOPE_COVERAGE_NO_PROGRESS_LIMIT', field: 'TELORA_SCOPE_COVERAGE_NO_PROGRESS_LIMIT', kind: 'int', default: 3, description: 'Cap on consecutive no-progress re-engagement cycles before scope-coverage escalation.' },
|
|
158
|
+
{ name: 'TELORA_WORKTREE_DIR', field: 'TELORA_WORKTREE_DIR', kind: 'string', default: undefined, description: 'Override directory for parallel agent worktrees (default: <repo>/.telora/worktrees).' },
|
|
159
|
+
{ name: 'TELORA_INTEGRATION_BRANCH', field: 'TELORA_INTEGRATION_BRANCH', kind: 'string', default: 'integration', description: 'Branch agents merge into on success before human promotion to main.' },
|
|
160
|
+
{ name: 'TELORA_POLICY_FAILURE_MODE', field: 'TELORA_POLICY_FAILURE_MODE', kind: 'enum', default: 'fail-open', description: 'Guard failure mode: fail-open (default) or fail-closed.' },
|
|
161
|
+
{ name: 'TELORA_REGISTRY_URL', field: 'TELORA_REGISTRY_URL', kind: 'string', default: 'https://registry.npmjs.org/', description: 'npm registry the update check targets (LAN/dev override).' },
|
|
162
|
+
{ name: 'TELORA_TELEMETRY_ENABLED', field: 'TELORA_TELEMETRY_ENABLED', kind: 'bool', default: true, description: 'Enable the OTLP telemetry receiver (false/0 disables).' },
|
|
163
|
+
{ name: 'TELORA_TELEMETRY_PORT', field: 'TELORA_TELEMETRY_PORT', kind: 'port', default: 4318, description: 'TCP port for the OTLP telemetry receiver.' },
|
|
164
|
+
{ name: 'TELORA_TELEMETRY_FLUSH_INTERVAL_MS', field: 'TELORA_TELEMETRY_FLUSH_INTERVAL_MS', kind: 'int', default: 5000, description: 'Telemetry buffer flush interval (ms).' },
|
|
165
|
+
{ name: 'TELORA_TELEMETRY_RETENTION_DAYS', field: 'TELORA_TELEMETRY_RETENTION_DAYS', kind: 'int', default: 30, description: 'Telemetry retention window (days).' },
|
|
166
|
+
{ name: 'MAX_TOTAL_SESSIONS', field: 'MAX_TOTAL_SESSIONS', kind: 'int', default: 5, description: 'Max concurrent focus agent sessions.' },
|
|
167
|
+
{ name: 'TOKEN_LIMIT', field: 'TOKEN_LIMIT', kind: 'int', default: 200000, description: 'Per-session token budget.' },
|
|
168
|
+
{ name: 'COST_LIMIT', field: 'COST_LIMIT', kind: 'float', default: 10.0, description: 'Per-session cost budget (USD).' },
|
|
169
|
+
{ name: 'MERGE_LOCK_TIMEOUT_MS', field: 'MERGE_LOCK_TIMEOUT_MS', kind: 'int', default: 300000, description: 'Max wait (ms) to acquire the merge lock.' },
|
|
170
|
+
{ name: 'MERGE_LOCK_CONTENTION_WARNING_MS', field: 'MERGE_LOCK_CONTENTION_WARNING_MS', kind: 'int', default: 30000, description: 'Warn threshold (ms) when contending for the merge lock.' },
|
|
171
|
+
{ name: 'LOG_MAX_AGE_DAYS', field: 'LOG_MAX_AGE_DAYS', kind: 'int', default: 7, description: 'Max age (days) of retained agent logs.' },
|
|
172
|
+
{ name: 'LOG_MAX_TOTAL_BYTES', field: 'LOG_MAX_TOTAL_BYTES', kind: 'int', default: 1073741824, description: 'Max total bytes of retained agent logs.' },
|
|
173
|
+
{ name: 'LOG_MAX_FILES', field: 'LOG_MAX_FILES', kind: 'int', default: 500, description: 'Max number of retained agent log files.' },
|
|
174
|
+
]);
|
|
175
|
+
// ---------------------------------------------------------------------------
|
|
176
|
+
// Loader
|
|
177
|
+
// ---------------------------------------------------------------------------
|
|
178
|
+
let cached = null;
|
|
179
|
+
/**
|
|
180
|
+
* Parse + validate the operational env config ONCE and return a typed, frozen
|
|
181
|
+
* object. On invalid input, throws a CLEAR, ACTIONABLE error naming each
|
|
182
|
+
* offending variable and what was expected -- so a typo'd MERGE_LOCK_TIMEOUT_MS
|
|
183
|
+
* or a non-numeric TELORA_TELEMETRY_PORT fails loudly at startup rather than
|
|
184
|
+
* silently at runtime.
|
|
185
|
+
*
|
|
186
|
+
* @param env Env source (defaults to process.env). When omitted, the result is
|
|
187
|
+
* memoized; pass an explicit env (e.g. in tests) to bypass the cache.
|
|
188
|
+
*/
|
|
189
|
+
export function loadEnvConfig(env) {
|
|
190
|
+
const useCache = env === undefined;
|
|
191
|
+
if (useCache && cached)
|
|
192
|
+
return cached;
|
|
193
|
+
const source = env ?? process.env;
|
|
194
|
+
// Pick only the declared keys so unrelated env vars cannot interfere.
|
|
195
|
+
const input = {};
|
|
196
|
+
for (const meta of ENV_VAR_METADATA) {
|
|
197
|
+
input[meta.name] = source[meta.name];
|
|
198
|
+
}
|
|
199
|
+
const result = EnvConfigSchema.safeParse(input);
|
|
200
|
+
if (!result.success) {
|
|
201
|
+
const lines = result.error.issues.map((issue) => {
|
|
202
|
+
const varName = String(issue.path[0] ?? '(unknown)');
|
|
203
|
+
const got = source[varName];
|
|
204
|
+
return ` - ${varName}: ${issue.message} (got: ${JSON.stringify(got)})`;
|
|
205
|
+
});
|
|
206
|
+
throw new Error(`Invalid daemon environment configuration (${result.error.issues.length} error(s)):\n` +
|
|
207
|
+
lines.join('\n') +
|
|
208
|
+
'\nRun the daemon with corrected values, or unset the variable to use its default.');
|
|
209
|
+
}
|
|
210
|
+
const frozen = Object.freeze(result.data);
|
|
211
|
+
if (useCache)
|
|
212
|
+
cached = frozen;
|
|
213
|
+
return frozen;
|
|
214
|
+
}
|
|
215
|
+
/** Test-only: clear the memoized config so a later load re-reads process.env. */
|
|
216
|
+
export function resetEnvConfigCache() {
|
|
217
|
+
cached = null;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Render the knob index as a human-readable table (for docs / --help output).
|
|
221
|
+
* This is the discoverable list of every operational env var.
|
|
222
|
+
*/
|
|
223
|
+
export function formatEnvVarTable() {
|
|
224
|
+
const rows = ENV_VAR_METADATA.map((m) => {
|
|
225
|
+
const def = m.default === undefined ? '(none)' : String(m.default);
|
|
226
|
+
return `${m.name}\t[${m.kind}, default ${def}]\t${m.description}`;
|
|
227
|
+
});
|
|
228
|
+
return ['Operational environment variables:', ...rows].join('\n');
|
|
229
|
+
}
|
|
230
|
+
//# sourceMappingURL=env-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-config.js","sourceRoot":"","sources":["../src/env-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,sEAAsE;AACtE,8EAA8E;AAE9E;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAAC,GAAuB;IACrD,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACnC,IAAI,GAAG,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IAC5B,OAAO,GAAG,KAAK,GAAG,CAAC;AACrB,CAAC;AAED;;;GAGG;AACH,MAAM,QAAQ,GAAG,GAAuB,EAAE,CACxC,CAAC,CAAC,UAAU,CACV,CAAC,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAC/D,CAAC,CAAC,OAAO,EAAE,CACqB,CAAC;AAErC,8EAA8E;AAC9E,2BAA2B;AAC3B,EAAE;AACF,gFAAgF;AAChF,4EAA4E;AAC5E,2DAA2D;AAC3D,8EAA8E;AAE9E,8EAA8E;AAC9E,MAAM,WAAW,GAAG,CAAC,GAAW,EAAqB,EAAE,CACrD,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,IAA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C;YAC5B,OAAO,OAAO,OAAO,KAAK,KAAK,CAAC,OAAO,UAAU,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC;QAC1E,CAAC,CAAC,CAAC;QACH,MAAM,IAAI,KAAK,CACb,6CAA6C,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,eAAe;YACtF,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;YAChB,mFAAmF,CACpF,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,QAAQ;QAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,mBAAmB;IACjC,MAAM,GAAG,IAAI,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,IAAI,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACtC,MAAM,GAAG,GAAG,CAAC,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QACnE,OAAO,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,IAAI,aAAa,GAAG,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;IACpE,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,oCAAoC,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -16,5 +16,50 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export declare const EXECUTION_STATUSES: readonly ["draft", "planning", "queued", "coding", "verify", "verify_failed", "done", "paused", "cancelled"];
|
|
18
18
|
export type ExecutionStatus = (typeof EXECUTION_STATUSES)[number];
|
|
19
|
+
/**
|
|
20
|
+
* Named constants for each delivery execution-status value.
|
|
21
|
+
*
|
|
22
|
+
* Consumers (daemon, frontend, MCP) compare against these instead of writing
|
|
23
|
+
* bare string literals like `=== 'verify'`. This is what makes the vocabulary
|
|
24
|
+
* a SINGLE source of truth at the USE site, not just the definition site, and
|
|
25
|
+
* it is what `scripts/lint-vocabulary.mjs` enforces: a bare status literal in a
|
|
26
|
+
* comparison outside this module is a drift risk; `DELIVERY_STATUS.VERIFY` is
|
|
27
|
+
* not. A typo (`DELIVERY_STATUS.VERFY`) fails to compile.
|
|
28
|
+
*/
|
|
29
|
+
export declare const DELIVERY_STATUS: {
|
|
30
|
+
readonly DRAFT: "draft";
|
|
31
|
+
readonly PLANNING: "planning";
|
|
32
|
+
readonly QUEUED: "queued";
|
|
33
|
+
readonly CODING: "coding";
|
|
34
|
+
readonly VERIFY: "verify";
|
|
35
|
+
readonly VERIFY_FAILED: "verify_failed";
|
|
36
|
+
readonly DONE: "done";
|
|
37
|
+
readonly PAUSED: "paused";
|
|
38
|
+
readonly CANCELLED: "cancelled";
|
|
39
|
+
};
|
|
19
40
|
export declare function isExecutionStatus(value: unknown): value is ExecutionStatus;
|
|
41
|
+
/**
|
|
42
|
+
* Machine-readable delivery execution-status state machine.
|
|
43
|
+
*
|
|
44
|
+
* This is the canonical, single-source map of the LIFECYCLE transitions the
|
|
45
|
+
* daemon drives (root CLAUDE.md "Delivery Lifecycle"):
|
|
46
|
+
* - main path: queued -> coding -> verify -> done
|
|
47
|
+
* - re-iteration: verify -> verify_failed -> queued (-> coding -> verify)
|
|
48
|
+
* - exits: active states -> paused / cancelled
|
|
49
|
+
* - revival: paused -> queued/coding, cancelled -> draft/queued
|
|
50
|
+
* - planning entry: draft -> planning -> queued
|
|
51
|
+
*
|
|
52
|
+
* NOTE: this is distinct from the frontend's DELIVERY_STATUS_TRANSITIONS, which
|
|
53
|
+
* is a MANUAL UI-affordance map (which transitions a human may click in the UI)
|
|
54
|
+
* -- it deliberately omits automatic transitions like queued -> coding (driven
|
|
55
|
+
* by a DB trigger, not a human). That manual map is a presentation concern and
|
|
56
|
+
* stays local to the frontend. This map is the actual state machine, the thing
|
|
57
|
+
* an AI must be able to read to reason about the lifecycle holistically.
|
|
58
|
+
*/
|
|
59
|
+
export declare const EXECUTION_STATUS_TRANSITIONS: Record<ExecutionStatus, readonly ExecutionStatus[]>;
|
|
60
|
+
/**
|
|
61
|
+
* True iff `to` is a permitted next state from `from` per the canonical
|
|
62
|
+
* delivery state machine.
|
|
63
|
+
*/
|
|
64
|
+
export declare function isValidTransition(from: ExecutionStatus, to: ExecutionStatus): boolean;
|
|
20
65
|
//# sourceMappingURL=execution-status.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-status.d.ts","sourceRoot":"","sources":["../src/execution-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,eAAO,MAAM,kBAAkB,8GAUrB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAK1E"}
|
|
1
|
+
{"version":3,"file":"execution-status.d.ts","sourceRoot":"","sources":["../src/execution-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,eAAO,MAAM,kBAAkB,8GAUrB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;CAUwB,CAAC;AAErD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAK1E;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAC/C,eAAe,EACf,SAAS,eAAe,EAAE,CAW3B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,eAAe,EACrB,EAAE,EAAE,eAAe,GAClB,OAAO,CAET"}
|
package/dist/execution-status.js
CHANGED
|
@@ -25,8 +25,65 @@ export const EXECUTION_STATUSES = [
|
|
|
25
25
|
'paused',
|
|
26
26
|
'cancelled',
|
|
27
27
|
];
|
|
28
|
+
/**
|
|
29
|
+
* Named constants for each delivery execution-status value.
|
|
30
|
+
*
|
|
31
|
+
* Consumers (daemon, frontend, MCP) compare against these instead of writing
|
|
32
|
+
* bare string literals like `=== 'verify'`. This is what makes the vocabulary
|
|
33
|
+
* a SINGLE source of truth at the USE site, not just the definition site, and
|
|
34
|
+
* it is what `scripts/lint-vocabulary.mjs` enforces: a bare status literal in a
|
|
35
|
+
* comparison outside this module is a drift risk; `DELIVERY_STATUS.VERIFY` is
|
|
36
|
+
* not. A typo (`DELIVERY_STATUS.VERFY`) fails to compile.
|
|
37
|
+
*/
|
|
38
|
+
export const DELIVERY_STATUS = {
|
|
39
|
+
DRAFT: 'draft',
|
|
40
|
+
PLANNING: 'planning',
|
|
41
|
+
QUEUED: 'queued',
|
|
42
|
+
CODING: 'coding',
|
|
43
|
+
VERIFY: 'verify',
|
|
44
|
+
VERIFY_FAILED: 'verify_failed',
|
|
45
|
+
DONE: 'done',
|
|
46
|
+
PAUSED: 'paused',
|
|
47
|
+
CANCELLED: 'cancelled',
|
|
48
|
+
};
|
|
28
49
|
export function isExecutionStatus(value) {
|
|
29
50
|
return (typeof value === 'string' &&
|
|
30
51
|
EXECUTION_STATUSES.includes(value));
|
|
31
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Machine-readable delivery execution-status state machine.
|
|
55
|
+
*
|
|
56
|
+
* This is the canonical, single-source map of the LIFECYCLE transitions the
|
|
57
|
+
* daemon drives (root CLAUDE.md "Delivery Lifecycle"):
|
|
58
|
+
* - main path: queued -> coding -> verify -> done
|
|
59
|
+
* - re-iteration: verify -> verify_failed -> queued (-> coding -> verify)
|
|
60
|
+
* - exits: active states -> paused / cancelled
|
|
61
|
+
* - revival: paused -> queued/coding, cancelled -> draft/queued
|
|
62
|
+
* - planning entry: draft -> planning -> queued
|
|
63
|
+
*
|
|
64
|
+
* NOTE: this is distinct from the frontend's DELIVERY_STATUS_TRANSITIONS, which
|
|
65
|
+
* is a MANUAL UI-affordance map (which transitions a human may click in the UI)
|
|
66
|
+
* -- it deliberately omits automatic transitions like queued -> coding (driven
|
|
67
|
+
* by a DB trigger, not a human). That manual map is a presentation concern and
|
|
68
|
+
* stays local to the frontend. This map is the actual state machine, the thing
|
|
69
|
+
* an AI must be able to read to reason about the lifecycle holistically.
|
|
70
|
+
*/
|
|
71
|
+
export const EXECUTION_STATUS_TRANSITIONS = {
|
|
72
|
+
draft: ['planning', 'queued', 'cancelled'],
|
|
73
|
+
planning: ['queued', 'cancelled'],
|
|
74
|
+
queued: ['coding', 'paused', 'cancelled'],
|
|
75
|
+
coding: ['verify', 'paused', 'cancelled'],
|
|
76
|
+
verify: ['done', 'verify_failed', 'paused', 'cancelled'],
|
|
77
|
+
verify_failed: ['queued', 'coding', 'cancelled'],
|
|
78
|
+
done: ['verify_failed', 'verify'],
|
|
79
|
+
paused: ['queued', 'coding', 'cancelled'],
|
|
80
|
+
cancelled: ['draft', 'queued'],
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* True iff `to` is a permitted next state from `from` per the canonical
|
|
84
|
+
* delivery state machine.
|
|
85
|
+
*/
|
|
86
|
+
export function isValidTransition(from, to) {
|
|
87
|
+
return EXECUTION_STATUS_TRANSITIONS[from]?.includes(to) ?? false;
|
|
88
|
+
}
|
|
32
89
|
//# sourceMappingURL=execution-status.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-status.js","sourceRoot":"","sources":["../src/execution-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG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AE,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAC;IACzC,MAAM,EAAE,CAAC,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,WAAW,CAAC;IACxD,aAAa,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAC;IAChD,IAAI,EAAE,CAAC,eAAe,EAAE,QAAQ,CAAC;IACjC,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAC;IACzC,SAAS,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;CAC/B,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAAqB,EACrB,EAAmB;IAEnB,OAAO,4BAA4B,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical focus-stage vocabulary for product_focuses.stage.
|
|
3
|
+
*
|
|
4
|
+
* Distinct from focus STATUS (focus-status.ts): status is the human-set intent
|
|
5
|
+
* lifecycle (proposed -> active -> complete | cancelled), while STAGE is the
|
|
6
|
+
* workflow-execution axis the daemon derives from a focus's delivery aggregate
|
|
7
|
+
* (planning -> queued -> in_progress -> verify -> review -> close_loop -> done,
|
|
8
|
+
* plus the blocked exit). Backed by the `product_focuses.stage` text column.
|
|
9
|
+
*
|
|
10
|
+
* Source of truth shared by @telora/daemon, @telora/mcp-products, and the
|
|
11
|
+
* frontend (src/types/focus.ts) so the runtimes cannot drift on what stages
|
|
12
|
+
* exist or which of them count as "past planning".
|
|
13
|
+
*/
|
|
14
|
+
export declare const FOCUS_STAGES: readonly ["planning", "queued", "in_progress", "verify", "review", "close_loop", "done", "blocked"];
|
|
15
|
+
export type FocusStage = (typeof FOCUS_STAGES)[number];
|
|
16
|
+
/**
|
|
17
|
+
* Named constants for each focus-stage value. Consumers compare against these
|
|
18
|
+
* instead of bare literals (`focus.stage === 'close_loop'`) so the use site
|
|
19
|
+
* references the single source of truth and a typo fails to compile. Enforced
|
|
20
|
+
* by scripts/lint-vocabulary.mjs.
|
|
21
|
+
*/
|
|
22
|
+
export declare const FOCUS_STAGE: {
|
|
23
|
+
readonly PLANNING: "planning";
|
|
24
|
+
readonly QUEUED: "queued";
|
|
25
|
+
readonly IN_PROGRESS: "in_progress";
|
|
26
|
+
readonly VERIFY: "verify";
|
|
27
|
+
readonly REVIEW: "review";
|
|
28
|
+
readonly CLOSE_LOOP: "close_loop";
|
|
29
|
+
readonly DONE: "done";
|
|
30
|
+
readonly BLOCKED: "blocked";
|
|
31
|
+
};
|
|
32
|
+
export declare function isFocusStage(value: unknown): value is FocusStage;
|
|
33
|
+
/**
|
|
34
|
+
* Focus stages past the planning phase. When a delivery is created on a focus
|
|
35
|
+
* already in one of these stages, the daemon's poll loop expects new work to
|
|
36
|
+
* land in 'queued' so a team can pick it up -- defaulting to 'planning' would
|
|
37
|
+
* leave the row invisible. Canonical home for the set previously hardcoded in
|
|
38
|
+
* mcp/telora-products/src/handlers/deliveryHandlers.ts.
|
|
39
|
+
*/
|
|
40
|
+
export declare const POST_PLANNING_FOCUS_STAGES: ReadonlySet<FocusStage>;
|
|
41
|
+
/** True iff `stage` is a focus stage past the planning phase. */
|
|
42
|
+
export declare function isPostPlanning(stage: unknown): boolean;
|
|
43
|
+
//# sourceMappingURL=focus-stage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focus-stage.d.ts","sourceRoot":"","sources":["../src/focus-stage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,YAAY,qGASf,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;;;;;;;;CASuB,CAAC;AAEhD,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAKhE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,EAAE,WAAW,CAAC,UAAU,CAM7D,CAAC;AAEH,iEAAiE;AACjE,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEtD"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical focus-stage vocabulary for product_focuses.stage.
|
|
3
|
+
*
|
|
4
|
+
* Distinct from focus STATUS (focus-status.ts): status is the human-set intent
|
|
5
|
+
* lifecycle (proposed -> active -> complete | cancelled), while STAGE is the
|
|
6
|
+
* workflow-execution axis the daemon derives from a focus's delivery aggregate
|
|
7
|
+
* (planning -> queued -> in_progress -> verify -> review -> close_loop -> done,
|
|
8
|
+
* plus the blocked exit). Backed by the `product_focuses.stage` text column.
|
|
9
|
+
*
|
|
10
|
+
* Source of truth shared by @telora/daemon, @telora/mcp-products, and the
|
|
11
|
+
* frontend (src/types/focus.ts) so the runtimes cannot drift on what stages
|
|
12
|
+
* exist or which of them count as "past planning".
|
|
13
|
+
*/
|
|
14
|
+
export const FOCUS_STAGES = [
|
|
15
|
+
'planning',
|
|
16
|
+
'queued',
|
|
17
|
+
'in_progress',
|
|
18
|
+
'verify',
|
|
19
|
+
'review',
|
|
20
|
+
'close_loop',
|
|
21
|
+
'done',
|
|
22
|
+
'blocked',
|
|
23
|
+
];
|
|
24
|
+
/**
|
|
25
|
+
* Named constants for each focus-stage value. Consumers compare against these
|
|
26
|
+
* instead of bare literals (`focus.stage === 'close_loop'`) so the use site
|
|
27
|
+
* references the single source of truth and a typo fails to compile. Enforced
|
|
28
|
+
* by scripts/lint-vocabulary.mjs.
|
|
29
|
+
*/
|
|
30
|
+
export const FOCUS_STAGE = {
|
|
31
|
+
PLANNING: 'planning',
|
|
32
|
+
QUEUED: 'queued',
|
|
33
|
+
IN_PROGRESS: 'in_progress',
|
|
34
|
+
VERIFY: 'verify',
|
|
35
|
+
REVIEW: 'review',
|
|
36
|
+
CLOSE_LOOP: 'close_loop',
|
|
37
|
+
DONE: 'done',
|
|
38
|
+
BLOCKED: 'blocked',
|
|
39
|
+
};
|
|
40
|
+
export function isFocusStage(value) {
|
|
41
|
+
return (typeof value === 'string' &&
|
|
42
|
+
FOCUS_STAGES.includes(value));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Focus stages past the planning phase. When a delivery is created on a focus
|
|
46
|
+
* already in one of these stages, the daemon's poll loop expects new work to
|
|
47
|
+
* land in 'queued' so a team can pick it up -- defaulting to 'planning' would
|
|
48
|
+
* leave the row invisible. Canonical home for the set previously hardcoded in
|
|
49
|
+
* mcp/telora-products/src/handlers/deliveryHandlers.ts.
|
|
50
|
+
*/
|
|
51
|
+
export const POST_PLANNING_FOCUS_STAGES = new Set([
|
|
52
|
+
'queued',
|
|
53
|
+
'in_progress',
|
|
54
|
+
'verify',
|
|
55
|
+
'review',
|
|
56
|
+
'close_loop',
|
|
57
|
+
]);
|
|
58
|
+
/** True iff `stage` is a focus stage past the planning phase. */
|
|
59
|
+
export function isPostPlanning(stage) {
|
|
60
|
+
return isFocusStage(stage) && POST_PLANNING_FOCUS_STAGES.has(stage);
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=focus-stage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focus-stage.js","sourceRoot":"","sources":["../src/focus-stage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,UAAU;IACV,QAAQ;IACR,aAAa;IACb,QAAQ;IACR,QAAQ;IACR,YAAY;IACZ,MAAM;IACN,SAAS;CACD,CAAC;AAIX;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,aAAa;IAC1B,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;IACxB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;CAC2B,CAAC;AAEhD,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACxB,YAAkC,CAAC,QAAQ,CAAC,KAAK,CAAC,CACpD,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAA4B,IAAI,GAAG,CAAa;IACrF,QAAQ;IACR,aAAa;IACb,QAAQ;IACR,QAAQ;IACR,YAAY;CACb,CAAC,CAAC;AAEH,iEAAiE;AACjE,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,OAAO,YAAY,CAAC,KAAK,CAAC,IAAI,0BAA0B,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACtE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { type AgentEvent, type AgentEventParser, type AgentSessionStartedEvent,
|
|
|
7
7
|
export { ClaudeAgentParser, extractFilePath, } from './claude-agent-parser.js';
|
|
8
8
|
export { CodexAgentParser, } from './codex-agent-parser.js';
|
|
9
9
|
export { UUID_REGEX, loadConfigFile, productLabel, resolveBaseConfig, validateBaseConfig, type BaseConfig, type ProductEntry, } from './config.js';
|
|
10
|
+
export { ENV_VAR_METADATA, formatEnvVarTable, loadEnvConfig, loopGateEnabled, resetEnvConfigCache, type EnvConfig, type EnvVarKind, type EnvVarMeta, } from './env-config.js';
|
|
10
11
|
export { PidLockError, ShutdownController, acquirePidLock, isProcessRunning, releasePidLock, setupSignalHandlers, type ShutdownHandler, } from './lifecycle.js';
|
|
11
12
|
export { DEFAULT_GIT_TIMEOUT_MS, branchExists, runGit, type GitResult, } from './git.js';
|
|
12
13
|
export { commitWip, createWorktreeBase, pruneWorktrees, removeWorktreeBase, worktreeExistsForBranch, type CreateWorktreeResult, } from './worktree.js';
|
|
@@ -18,8 +19,9 @@ export { formatEventForLog, } from './event-logger.js';
|
|
|
18
19
|
export { ActivityTracker, type ActivitySnapshot, } from './activity-tracker.js';
|
|
19
20
|
export { buildOtelEnv, type BuildOtelEnvOptions, } from './otel-env.js';
|
|
20
21
|
export { ESCALATION_REASONS, ESCALATION_KINDS, type EscalationReasonType, type EscalationKind, } from './escalation-types.js';
|
|
21
|
-
export { EXECUTION_STATUSES, isExecutionStatus, type ExecutionStatus, } from './execution-status.js';
|
|
22
|
+
export { DELIVERY_STATUS, EXECUTION_STATUSES, EXECUTION_STATUS_TRANSITIONS, isExecutionStatus, isValidTransition, type ExecutionStatus, } from './execution-status.js';
|
|
22
23
|
export { FOCUS_STATUSES, isFocusStatus, type FocusStatus, } from './focus-status.js';
|
|
24
|
+
export { FOCUS_STAGE, FOCUS_STAGES, isFocusStage, isPostPlanning, POST_PLANNING_FOCUS_STAGES, type FocusStage, } from './focus-stage.js';
|
|
23
25
|
export { PRODUCT_STATUSES, isProductStatus, type ProductStatus, } from './product-status.js';
|
|
24
26
|
export { extractSessionKey, pruneOldLogs, scanLogDirectory, type LogFileInfo, type LogManagerDeps, type LogRetentionConfig, type PruneResult, } from './log-manager.js';
|
|
25
27
|
export { buildMcpConfig, isLegacyMcpConfigShape, resolveMcpServerPath, writeMcpConfigFile, MCP_PRODUCTS_PACKAGE, MCP_PRODUCTS_BIN, type McpConfigOptions, } from './mcp-resolution.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,yBAAyB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,kBAAkB,EAClB,4BAA4B,EAC5B,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,KAAK,mBAAm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EACZ,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,KAAK,eAAe,GACrB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,MAAM,EACN,KAAK,SAAS,GACf,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,uBAAuB,EACvB,KAAK,oBAAoB,GAC1B,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,GACrB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,aAAa,GACnB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,gBAAgB,EAChB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,GACzB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,eAAe,EACf,KAAK,gBAAgB,GACtB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,YAAY,EACZ,KAAK,mBAAmB,GACzB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,oBAAoB,EACzB,KAAK,cAAc,GACpB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,yBAAyB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,YAAY,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B,EACzB,KAAK,cAAc,GACpB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,4BAA4B,EAC5B,iBAAiB,EACjB,iBAAiB,EACjB,KAAK,eAAe,GACrB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,cAAc,EACd,aAAa,EACb,KAAK,WAAW,GACjB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,0BAA0B,EAC1B,KAAK,UAAU,GAChB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,KAAK,aAAa,GACnB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,WAAW,GACjB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,cAAc,GACpB,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,8 @@ export { ClaudeAgentParser, extractFilePath, } from './claude-agent-parser.js';
|
|
|
15
15
|
export { CodexAgentParser, } from './codex-agent-parser.js';
|
|
16
16
|
// Shared config infrastructure (BaseConfig, loaders, validators)
|
|
17
17
|
export { UUID_REGEX, loadConfigFile, productLabel, resolveBaseConfig, validateBaseConfig, } from './config.js';
|
|
18
|
+
// Typed operational env config (the discoverable index of every daemon knob)
|
|
19
|
+
export { ENV_VAR_METADATA, formatEnvVarTable, loadEnvConfig, loopGateEnabled, resetEnvConfigCache, } from './env-config.js';
|
|
18
20
|
// Process lifecycle (PID locking, signal handling, shutdown coordination)
|
|
19
21
|
export { PidLockError, ShutdownController, acquirePidLock, isProcessRunning, releasePidLock, setupSignalHandlers, } from './lifecycle.js';
|
|
20
22
|
// Git utilities (synchronous git runner, branch helpers)
|
|
@@ -35,10 +37,13 @@ export { ActivityTracker, } from './activity-tracker.js';
|
|
|
35
37
|
export { buildOtelEnv, } from './otel-env.js';
|
|
36
38
|
// Escalation reason types (shared enum/constants for agent_escalations.reason_type)
|
|
37
39
|
export { ESCALATION_REASONS, ESCALATION_KINDS, } from './escalation-types.js';
|
|
38
|
-
// Execution status enum (shared source of truth for
|
|
39
|
-
|
|
40
|
+
// Execution status enum + transition map (shared source of truth for
|
|
41
|
+
// product_deliveries.execution_status and its state machine)
|
|
42
|
+
export { DELIVERY_STATUS, EXECUTION_STATUSES, EXECUTION_STATUS_TRANSITIONS, isExecutionStatus, isValidTransition, } from './execution-status.js';
|
|
40
43
|
// Focus status enum (shared source of truth for product_focuses.status)
|
|
41
44
|
export { FOCUS_STATUSES, isFocusStatus, } from './focus-status.js';
|
|
45
|
+
// Focus stage vocabulary (shared source of truth for product_focuses.stage)
|
|
46
|
+
export { FOCUS_STAGE, FOCUS_STAGES, isFocusStage, isPostPlanning, POST_PLANNING_FOCUS_STAGES, } from './focus-stage.js';
|
|
42
47
|
// Product status enum (shared source of truth for products.status)
|
|
43
48
|
export { PRODUCT_STATUSES, isProductStatus, } from './product-status.js';
|
|
44
49
|
// Log manager (retention policy and pruning for agent log files)
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,4EAA4E;AAE5E,OAAO,EACL,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,yBAAyB,EAIzB,kBAAkB,EAClB,4BAA4B,EAC5B,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,SAAS,GAEV,MAAM,iBAAiB,CAAC;AAEzB,2DAA2D;AAC3D,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,cAAc,GAGf,MAAM,iBAAiB,CAAC;AAEzB,6DAA6D;AAC7D,OAAO,EACL,eAAe,EACf,cAAc,GACf,MAAM,iBAAiB,CAAC;AAEzB,qDAAqD;AACrD,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,aAAa,GAEd,MAAM,kBAAkB,CAAC;AAE1B,iFAAiF;AACjF,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,GAqBZ,MAAM,kBAAkB,CAAC;AAc1B,wDAAwD;AACxD,OAAO,EACL,iBAAiB,EACjB,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAElC,8DAA8D;AAC9D,OAAO,EACL,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AAEjC,iEAAiE;AACjE,OAAO,EACL,UAAU,EACV,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,GAGnB,MAAM,aAAa,CAAC;AAErB,0EAA0E;AAC1E,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,mBAAmB,GAEpB,MAAM,gBAAgB,CAAC;AAExB,yDAAyD;AACzD,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,MAAM,GAEP,MAAM,UAAU,CAAC;AAElB,0DAA0D;AAC1D,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,cAAc,EACd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BAAuB,CAAC;AAE/B,qEAAqE;AACrE,6DAA6D;AAC7D,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,4BAA4B,EAC5B,iBAAiB,EACjB,iBAAiB,GAElB,MAAM,uBAAuB,CAAC;AAE/B,wEAAwE;AACxE,OAAO,EACL,cAAc,EACd,aAAa,GAEd,MAAM,mBAAmB,CAAC;AAE3B,4EAA4E;AAC5E,OAAO,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,0BAA0B,GAE3B,MAAM,kBAAkB,CAAC;AAE1B,mEAAmE;AACnE,OAAO,EACL,gBAAgB,EAChB,eAAe,GAEhB,MAAM,qBAAqB,CAAC;AAE7B,iEAAiE;AACjE,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,GAKjB,MAAM,kBAAkB,CAAC;AAE1B,8CAA8C;AAC9C,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,GAEjB,MAAM,qBAAqB,CAAC;AAE7B,oEAAoE;AACpE,OAAO,EACL,iBAAiB,EACjB,YAAY,GAGb,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { DELIVERY_STATUS, EXECUTION_STATUSES, EXECUTION_STATUS_TRANSITIONS, isExecutionStatus, isValidTransition, type ExecutionStatus, } from './execution-status.js';
|
|
2
|
+
export { FOCUS_STAGE, FOCUS_STAGES, isFocusStage, isPostPlanning, POST_PLANNING_FOCUS_STAGES, type FocusStage, } from './focus-stage.js';
|
|
3
|
+
export { FOCUS_STATUSES, isFocusStatus, type FocusStatus, } from './focus-status.js';
|
|
4
|
+
export { PRODUCT_STATUSES, isProductStatus, type ProductStatus, } from './product-status.js';
|
|
5
|
+
//# sourceMappingURL=vocabulary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocabulary.d.ts","sourceRoot":"","sources":["../src/vocabulary.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,4BAA4B,EAC5B,iBAAiB,EACjB,iBAAiB,EACjB,KAAK,eAAe,GACrB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,0BAA0B,EAC1B,KAAK,UAAU,GAChB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,cAAc,EACd,aAAa,EACb,KAAK,WAAW,GACjB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,KAAK,aAAa,GACnB,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// @telora/daemon-core/vocabulary -- browser-safe canonical domain vocabulary.
|
|
2
|
+
//
|
|
3
|
+
// This is a PURE re-export barrel of the four domain-vocabulary modules. Unlike
|
|
4
|
+
// the package barrel (index.ts), it pulls in NONE of the Node-only
|
|
5
|
+
// infrastructure (token-usage -> node:stream, git -> node:child_process,
|
|
6
|
+
// worktree/config/log-manager -> node:fs/path/os/module). Its entire transitive
|
|
7
|
+
// import graph is the four modules below, each of which is plain TypeScript with
|
|
8
|
+
// zero `node:` imports -- safe to bundle into the browser frontend.
|
|
9
|
+
//
|
|
10
|
+
// Consumers that run in the browser (the React frontend) import vocabulary from
|
|
11
|
+
// '@telora/daemon-core/vocabulary'. Node consumers (daemon, MCP) keep importing
|
|
12
|
+
// from the package barrel ('@telora/daemon-core'), which re-exports these same
|
|
13
|
+
// symbols alongside the Node infrastructure.
|
|
14
|
+
//
|
|
15
|
+
// If you add a new pure domain-vocabulary module to daemon-core, re-export it
|
|
16
|
+
// here too so the browser-safe surface stays complete.
|
|
17
|
+
// Execution status enum + transition map (product_deliveries.execution_status).
|
|
18
|
+
export { DELIVERY_STATUS, EXECUTION_STATUSES, EXECUTION_STATUS_TRANSITIONS, isExecutionStatus, isValidTransition, } from './execution-status.js';
|
|
19
|
+
// Focus stage vocabulary (product_focuses.stage).
|
|
20
|
+
export { FOCUS_STAGE, FOCUS_STAGES, isFocusStage, isPostPlanning, POST_PLANNING_FOCUS_STAGES, } from './focus-stage.js';
|
|
21
|
+
// Focus status enum (product_focuses.status).
|
|
22
|
+
export { FOCUS_STATUSES, isFocusStatus, } from './focus-status.js';
|
|
23
|
+
// Product status enum (products.status).
|
|
24
|
+
export { PRODUCT_STATUSES, isProductStatus, } from './product-status.js';
|
|
25
|
+
//# sourceMappingURL=vocabulary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocabulary.js","sourceRoot":"","sources":["../src/vocabulary.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,EAAE;AACF,gFAAgF;AAChF,mEAAmE;AACnE,yEAAyE;AACzE,gFAAgF;AAChF,iFAAiF;AACjF,oEAAoE;AACpE,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,+EAA+E;AAC/E,6CAA6C;AAC7C,EAAE;AACF,8EAA8E;AAC9E,uDAAuD;AAEvD,gFAAgF;AAChF,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,4BAA4B,EAC5B,iBAAiB,EACjB,iBAAiB,GAElB,MAAM,uBAAuB,CAAC;AAE/B,kDAAkD;AAClD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,0BAA0B,GAE3B,MAAM,kBAAkB,CAAC;AAE1B,8CAA8C;AAC9C,OAAO,EACL,cAAc,EACd,aAAa,GAEd,MAAM,mBAAmB,CAAC;AAE3B,yCAAyC;AACzC,OAAO,EACL,gBAAgB,EAChB,eAAe,GAEhB,MAAM,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telora/daemon-core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.33",
|
|
4
4
|
"description": "Shared core infrastructure for Telora daemon and factory - resilience, API client, config, git operations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"import": "./dist/index.js",
|
|
11
11
|
"types": "./dist/index.d.ts"
|
|
12
|
+
},
|
|
13
|
+
"./vocabulary": {
|
|
14
|
+
"import": "./dist/vocabulary.js",
|
|
15
|
+
"types": "./dist/vocabulary.d.ts"
|
|
12
16
|
}
|
|
13
17
|
},
|
|
14
18
|
"files": [
|