@lionden/core 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 (51) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +23 -0
  3. package/dist/arg-names.d.ts +11 -0
  4. package/dist/arg-names.d.ts.map +1 -0
  5. package/dist/arg-names.js +39 -0
  6. package/dist/arg-names.js.map +1 -0
  7. package/dist/config-resolution.d.ts +20 -0
  8. package/dist/config-resolution.d.ts.map +1 -0
  9. package/dist/config-resolution.js +570 -0
  10. package/dist/config-resolution.js.map +1 -0
  11. package/dist/hook-system.d.ts +51 -0
  12. package/dist/hook-system.d.ts.map +1 -0
  13. package/dist/hook-system.js +144 -0
  14. package/dist/hook-system.js.map +1 -0
  15. package/dist/index.d.ts +17 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +21 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/key-artifacts.d.ts +75 -0
  20. package/dist/key-artifacts.d.ts.map +1 -0
  21. package/dist/key-artifacts.js +258 -0
  22. package/dist/key-artifacts.js.map +1 -0
  23. package/dist/leo-preflight.d.ts +11 -0
  24. package/dist/leo-preflight.d.ts.map +1 -0
  25. package/dist/leo-preflight.js +93 -0
  26. package/dist/leo-preflight.js.map +1 -0
  27. package/dist/log-style.d.ts +22 -0
  28. package/dist/log-style.d.ts.map +1 -0
  29. package/dist/log-style.js +67 -0
  30. package/dist/log-style.js.map +1 -0
  31. package/dist/lre.d.ts +14 -0
  32. package/dist/lre.d.ts.map +1 -0
  33. package/dist/lre.js +113 -0
  34. package/dist/lre.js.map +1 -0
  35. package/dist/plugin-loader.d.ts +20 -0
  36. package/dist/plugin-loader.d.ts.map +1 -0
  37. package/dist/plugin-loader.js +91 -0
  38. package/dist/plugin-loader.js.map +1 -0
  39. package/dist/task-builder.d.ts +49 -0
  40. package/dist/task-builder.d.ts.map +1 -0
  41. package/dist/task-builder.js +123 -0
  42. package/dist/task-builder.js.map +1 -0
  43. package/dist/task-runner.d.ts +78 -0
  44. package/dist/task-runner.d.ts.map +1 -0
  45. package/dist/task-runner.js +247 -0
  46. package/dist/task-runner.js.map +1 -0
  47. package/dist/types.d.ts +186 -0
  48. package/dist/types.d.ts.map +1 -0
  49. package/dist/types.js +20 -0
  50. package/dist/types.js.map +1 -0
  51. package/package.json +33 -0
@@ -0,0 +1,78 @@
1
+ import type { LionDenRuntimeEnvironment, TaskDefinition, TaskRunner } from "./types.js";
2
+ export declare class TaskNotFoundError extends Error {
3
+ constructor(taskId: string);
4
+ }
5
+ /**
6
+ * Manages task registration and execution with support for overrides
7
+ */
8
+ export declare class TaskRunnerImpl implements TaskRunner {
9
+ private readonly tasks;
10
+ private lre;
11
+ private hasStartedTask;
12
+ /** Bind the LRE (called once during LRE construction) */
13
+ setLre(lre: LionDenRuntimeEnvironment): void;
14
+ /**
15
+ * Register tasks from plugins (in load order) and config-level tasks.
16
+ * Override tasks stack on top of existing ones.
17
+ */
18
+ registerTasks(definitions: readonly TaskDefinition[]): void;
19
+ run(taskId: string, args?: Record<string, unknown>): Promise<unknown>;
20
+ has(taskId: string): boolean;
21
+ getTaskIds(): string[];
22
+ getTaskDefinition(taskId: string): TaskDefinition | undefined;
23
+ private logTaskStart;
24
+ private buildRunSuper;
25
+ /**
26
+ * Prepare task args for an action: normalize CLI spellings (kebab-case →
27
+ * camelCase, string → number coercion), fill default values for
28
+ * options/flags, enforce required options, then bind positional arguments.
29
+ *
30
+ * Shared by {@link run} and the runSuper chain so override actions receive
31
+ * the same fully-prepared args as the top-level action. The pipeline is
32
+ * idempotent on already-prepared args: normalize maps canonical names to
33
+ * themselves and only coerces strings, mergeDefaults only fills missing
34
+ * names, enforcement only throws on a missing required option, and positional
35
+ * binding only fills names not already present.
36
+ */
37
+ private prepareArgs;
38
+ /**
39
+ * Normalize CLI-parsed args to match the task definition's option, flag, and
40
+ * positional names.
41
+ *
42
+ * The CLI parser stores raw flag names (e.g., "no-compile") and string values
43
+ * (e.g., "5000" for --timeout 5000). This method:
44
+ * 1. Maps kebab-case keys to their camelCase equivalents
45
+ * 2. Coerces string values to the declared option type (number, boolean)
46
+ *
47
+ * Positionals are included so a positional supplied on the CLI by its public
48
+ * name (e.g. `--script-path` for a `scriptPath` positional, which the parser
49
+ * stores under the kebab key) is canonicalized to the name the action and the
50
+ * required-positional check read — the validator already allow-lists these
51
+ * public spellings, so without this they would pass validation but never bind.
52
+ */
53
+ private normalizeArgs;
54
+ private mergeDefaults;
55
+ /**
56
+ * Enforce `required: true` on value options, mirroring the required-positional
57
+ * check in {@link applyPositionalArguments}. Runs after defaults are merged, so
58
+ * an option with both `required` and a `defaultValue` is satisfied by the
59
+ * default. This covers every task dispatched through the runner (CLI and
60
+ * programmatic `lre.tasks.run`); actions that are imported and invoked directly
61
+ * keep their own guards for that separate entry point.
62
+ */
63
+ private enforceRequiredOptions;
64
+ /**
65
+ * Bind positional arguments to their declared names.
66
+ *
67
+ * The CLI parser stores raw positional values in `args._positional` (kept
68
+ * populated for back-compat with hand-extraction in plugins). Bare values
69
+ * fill the positionals not already supplied by name, left-to-right, so an
70
+ * earlier named positional does not misalign the bare ones; a variadic
71
+ * positional (declared last) collects every remaining bare value into an
72
+ * array under its name. Finally it enforces `required` positionals — throwing
73
+ * a clear error when a required positional was supplied neither by name nor
74
+ * positionally.
75
+ */
76
+ private applyPositionalArguments;
77
+ }
78
+ //# sourceMappingURL=task-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-runner.d.ts","sourceRoot":"","sources":["../src/task-runner.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,yBAAyB,EAGzB,cAAc,EACd,UAAU,EACX,MAAM,YAAY,CAAC;AAEpB,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,MAAM,EAAE,MAAM;CAI3B;AAQD;;GAEG;AACH,qBAAa,cAAe,YAAW,UAAU;IAC/C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqC;IAC3D,OAAO,CAAC,GAAG,CAA0C;IACrD,OAAO,CAAC,cAAc,CAAS;IAE/B,yDAAyD;IACzD,MAAM,CAAC,GAAG,EAAE,yBAAyB,GAAG,IAAI;IAI5C;;;OAGG;IACH,aAAa,CAAC,WAAW,EAAE,SAAS,cAAc,EAAE,GAAG,IAAI;IA8BrD,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IA8B/E,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAI5B,UAAU,IAAI,MAAM,EAAE;IAItB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAI7D,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,aAAa;IAmBrB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,WAAW;IAUnB;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,aAAa;IA8CrB,OAAO,CAAC,aAAa;IAqBrB;;;;;;;OAOG;IACH,OAAO,CAAC,sBAAsB;IAU9B;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,wBAAwB;CAwCjC"}
@@ -0,0 +1,247 @@
1
+ import { argumentFlagName, getPublicArgumentNames } from "./arg-names.js";
2
+ import { logAction, logDivider, shouldRenderDivider } from "./log-style.js";
3
+ export class TaskNotFoundError extends Error {
4
+ constructor(taskId) {
5
+ super(`Task "${taskId}" not found`);
6
+ this.name = "TaskNotFoundError";
7
+ }
8
+ }
9
+ /**
10
+ * Manages task registration and execution with support for overrides
11
+ */
12
+ export class TaskRunnerImpl {
13
+ tasks = new Map();
14
+ lre = null;
15
+ hasStartedTask = false;
16
+ /** Bind the LRE (called once during LRE construction) */
17
+ setLre(lre) {
18
+ this.lre = lre;
19
+ }
20
+ /**
21
+ * Register tasks from plugins (in load order) and config-level tasks.
22
+ * Override tasks stack on top of existing ones.
23
+ */
24
+ registerTasks(definitions) {
25
+ for (const def of definitions) {
26
+ if (def.overrides) {
27
+ // This is an override — stack on top
28
+ const existing = this.tasks.get(def.overrides);
29
+ if (!existing) {
30
+ throw new Error(`Cannot override task "${def.overrides}": no such task registered`);
31
+ }
32
+ // Push the current action into the override chain
33
+ existing.overrideChain.unshift(existing.definition.action);
34
+ existing.definition = {
35
+ ...existing.definition,
36
+ action: def.action,
37
+ description: def.description || existing.definition.description,
38
+ };
39
+ }
40
+ else {
41
+ // New task
42
+ if (this.tasks.has(def.id)) {
43
+ throw new Error(`Task "${def.id}" is already registered. Use overrideTask() to extend it.`);
44
+ }
45
+ this.tasks.set(def.id, {
46
+ definition: def,
47
+ overrideChain: [],
48
+ });
49
+ }
50
+ }
51
+ }
52
+ async run(taskId, args = {}) {
53
+ const registered = this.tasks.get(taskId);
54
+ if (!registered) {
55
+ throw new TaskNotFoundError(taskId);
56
+ }
57
+ if (!this.lre) {
58
+ throw new Error("TaskRunner: LRE not initialized");
59
+ }
60
+ const action = registered.definition.action;
61
+ const finalArgs = this.prepareArgs(registered.definition, args);
62
+ this.logTaskStart(taskId);
63
+ // If there are overrides, create the runSuper chain
64
+ if (registered.overrideChain.length > 0) {
65
+ const runSuper = this.buildRunSuper(registered.overrideChain, 0, this.lre, registered.definition);
66
+ // Override actions receive runSuper as third argument
67
+ return action(finalArgs, this.lre, runSuper);
68
+ }
69
+ return action(finalArgs, this.lre);
70
+ }
71
+ has(taskId) {
72
+ return this.tasks.has(taskId);
73
+ }
74
+ getTaskIds() {
75
+ return [...this.tasks.keys()];
76
+ }
77
+ getTaskDefinition(taskId) {
78
+ return this.tasks.get(taskId)?.definition;
79
+ }
80
+ logTaskStart(taskId) {
81
+ if (this.hasStartedTask && shouldRenderDivider()) {
82
+ console.log(logDivider());
83
+ }
84
+ console.log(logAction("Running task") + ` "${taskId}"`);
85
+ this.hasStartedTask = true;
86
+ }
87
+ buildRunSuper(chain, index, lre, definition) {
88
+ return async (args) => {
89
+ const action = chain[index];
90
+ const preparedArgs = this.prepareArgs(definition, args);
91
+ if (index + 1 < chain.length) {
92
+ const nextSuper = this.buildRunSuper(chain, index + 1, lre, definition);
93
+ return action(preparedArgs, lre, nextSuper);
94
+ }
95
+ return action(preparedArgs, lre);
96
+ };
97
+ }
98
+ /**
99
+ * Prepare task args for an action: normalize CLI spellings (kebab-case →
100
+ * camelCase, string → number coercion), fill default values for
101
+ * options/flags, enforce required options, then bind positional arguments.
102
+ *
103
+ * Shared by {@link run} and the runSuper chain so override actions receive
104
+ * the same fully-prepared args as the top-level action. The pipeline is
105
+ * idempotent on already-prepared args: normalize maps canonical names to
106
+ * themselves and only coerces strings, mergeDefaults only fills missing
107
+ * names, enforcement only throws on a missing required option, and positional
108
+ * binding only fills names not already present.
109
+ */
110
+ prepareArgs(definition, args) {
111
+ const normalized = this.normalizeArgs(definition, args);
112
+ const merged = this.mergeDefaults(definition, normalized);
113
+ this.enforceRequiredOptions(definition, merged);
114
+ return this.applyPositionalArguments(definition, merged);
115
+ }
116
+ /**
117
+ * Normalize CLI-parsed args to match the task definition's option, flag, and
118
+ * positional names.
119
+ *
120
+ * The CLI parser stores raw flag names (e.g., "no-compile") and string values
121
+ * (e.g., "5000" for --timeout 5000). This method:
122
+ * 1. Maps kebab-case keys to their camelCase equivalents
123
+ * 2. Coerces string values to the declared option type (number, boolean)
124
+ *
125
+ * Positionals are included so a positional supplied on the CLI by its public
126
+ * name (e.g. `--script-path` for a `scriptPath` positional, which the parser
127
+ * stores under the kebab key) is canonicalized to the name the action and the
128
+ * required-positional check read — the validator already allow-lists these
129
+ * public spellings, so without this they would pass validation but never bind.
130
+ */
131
+ normalizeArgs(definition, args) {
132
+ // Build canonical name lookup: kebab-case → camelCase
133
+ const canonicalMap = new Map();
134
+ for (const opt of definition.options ?? []) {
135
+ for (const publicName of getPublicArgumentNames(opt.name)) {
136
+ canonicalMap.set(publicName, { name: opt.name, type: opt.type });
137
+ }
138
+ }
139
+ for (const flag of definition.flags ?? []) {
140
+ for (const publicName of getPublicArgumentNames(flag.name)) {
141
+ canonicalMap.set(publicName, { name: flag.name, type: "boolean" });
142
+ }
143
+ }
144
+ for (const positional of definition.positionalArguments ?? []) {
145
+ for (const publicName of getPublicArgumentNames(positional.name)) {
146
+ // A real option/flag spelling wins over a positional alias on a clash
147
+ // (a config bug), so only fill names not already claimed above.
148
+ if (!canonicalMap.has(publicName)) {
149
+ canonicalMap.set(publicName, { name: positional.name });
150
+ }
151
+ }
152
+ }
153
+ const normalized = {};
154
+ for (const [key, value] of Object.entries(args)) {
155
+ const canonical = canonicalMap.get(key);
156
+ if (canonical) {
157
+ // Coerce string values to declared type
158
+ if (typeof value === "string" && canonical.type === "number") {
159
+ const num = Number(value);
160
+ normalized[canonical.name] = Number.isNaN(num) ? value : num;
161
+ }
162
+ else {
163
+ normalized[canonical.name] = value;
164
+ }
165
+ }
166
+ else {
167
+ // Pass through unrecognized args (e.g., _positional)
168
+ normalized[key] = value;
169
+ }
170
+ }
171
+ return normalized;
172
+ }
173
+ mergeDefaults(definition, args) {
174
+ const merged = { ...args };
175
+ for (const opt of definition.options ?? []) {
176
+ if (!(opt.name in merged) && opt.defaultValue !== undefined) {
177
+ merged[opt.name] = opt.defaultValue;
178
+ }
179
+ }
180
+ for (const flag of definition.flags ?? []) {
181
+ if (!(flag.name in merged)) {
182
+ merged[flag.name] = false;
183
+ }
184
+ }
185
+ return merged;
186
+ }
187
+ /**
188
+ * Enforce `required: true` on value options, mirroring the required-positional
189
+ * check in {@link applyPositionalArguments}. Runs after defaults are merged, so
190
+ * an option with both `required` and a `defaultValue` is satisfied by the
191
+ * default. This covers every task dispatched through the runner (CLI and
192
+ * programmatic `lre.tasks.run`); actions that are imported and invoked directly
193
+ * keep their own guards for that separate entry point.
194
+ */
195
+ enforceRequiredOptions(definition, args) {
196
+ for (const opt of definition.options ?? []) {
197
+ if (opt.required && args[opt.name] === undefined) {
198
+ throw new Error(`Task "${definition.id}" is missing required option "${argumentFlagName(opt.name)}".`);
199
+ }
200
+ }
201
+ }
202
+ /**
203
+ * Bind positional arguments to their declared names.
204
+ *
205
+ * The CLI parser stores raw positional values in `args._positional` (kept
206
+ * populated for back-compat with hand-extraction in plugins). Bare values
207
+ * fill the positionals not already supplied by name, left-to-right, so an
208
+ * earlier named positional does not misalign the bare ones; a variadic
209
+ * positional (declared last) collects every remaining bare value into an
210
+ * array under its name. Finally it enforces `required` positionals — throwing
211
+ * a clear error when a required positional was supplied neither by name nor
212
+ * positionally.
213
+ */
214
+ applyPositionalArguments(definition, args) {
215
+ const positionalDefs = definition.positionalArguments;
216
+ if (!positionalDefs || positionalDefs.length === 0) {
217
+ return args;
218
+ }
219
+ const result = { ...args };
220
+ const positionalValues = Array.isArray(result["_positional"])
221
+ ? result["_positional"]
222
+ : [];
223
+ // Bare values fill only the positionals NOT already supplied by name,
224
+ // consumed left-to-right via a cursor. Advancing this cursor (rather than
225
+ // indexing `_positional` by the declaration index) keeps the remaining bare
226
+ // values aligned when an earlier positional was given by name — e.g. a named
227
+ // `scriptPath` must not shift the bare args that fill a later positional.
228
+ let cursor = 0;
229
+ for (const def of positionalDefs) {
230
+ // An explicitly-named value (a programmatic run({ script }) or a CLI
231
+ // `--name` spelling canonicalized in normalizeArgs) wins over the bare
232
+ // array and does not consume a bare slot. A variadic positional (always
233
+ // declared last) takes every remaining bare value as an array, so an
234
+ // action can read the whole tail by name instead of re-extracting from
235
+ // `_positional`.
236
+ if (!(def.name in result) && cursor < positionalValues.length) {
237
+ result[def.name] = def.variadic ? positionalValues.slice(cursor) : positionalValues[cursor];
238
+ cursor = def.variadic ? positionalValues.length : cursor + 1;
239
+ }
240
+ if (def.required && result[def.name] === undefined) {
241
+ throw new Error(`Task "${definition.id}" is missing required positional argument "${def.name}".`);
242
+ }
243
+ }
244
+ return result;
245
+ }
246
+ }
247
+ //# sourceMappingURL=task-runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-runner.js","sourceRoot":"","sources":["../src/task-runner.ts"],"names":[],"mappings":"AAAA,OAAO,E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CAAE,MAAM,CAAC,aAAa,CAAe;YACtC,CAAC,CAAC,EAAE,CAAC;QAEP,sEAAsE;QACtE,0EAA0E;QAC1E,4EAA4E;QAC5E,6EAA6E;QAC7E,0EAA0E;QAC1E,IAAI,MAAM,GAAG,CAAC,CAAC;QACf,KAAK,MAAM,GAAG,IAAI,cAAc,EAAE,CAAC;YACjC,qEAAqE;YACrE,uEAAuE;YACvE,wEAAwE;YACxE,qEAAqE;YACrE,uEAAuE;YACvE,iBAAiB;YACjB,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,MAAM,GAAG,gBAAgB,CAAC,MAAM,EAAE,CAAC;gBAC9D,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;gBAC5F,MAAM,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;YAC/D,CAAC;YACD,IAAI,GAAG,CAAC,QAAQ,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;gBACnD,MAAM,IAAI,KAAK,CACb,SAAS,UAAU,CAAC,EAAE,8CAA8C,GAAG,CAAC,IAAI,IAAI,CACjF,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -0,0 +1,186 @@
1
+ import type { ConfigVariable, LionDenResolvedConfig, LionDenUserConfig, NamedAccounts } from "@lionden/config";
2
+ export interface ConfigValidationError {
3
+ /** Dotted path to the offending field, e.g. "networks.testnet.endpoint" */
4
+ readonly path: string;
5
+ /** Human-readable error description */
6
+ readonly message: string;
7
+ }
8
+ export interface ConfigHookHandlers {
9
+ /** Mutate user config during loading (inject defaults, add networks, etc.) */
10
+ extendUserConfig?(config: LionDenUserConfig): Promise<LionDenUserConfig> | LionDenUserConfig;
11
+ /** Validate user config — return errors for plugin-specific fields */
12
+ validateUserConfig?(config: LionDenUserConfig): Promise<ConfigValidationError[]> | ConfigValidationError[];
13
+ /** Transform UserConfig → partial ResolvedConfig for plugin-owned settings */
14
+ resolveConfig?(userConfig: LionDenUserConfig, resolveConfigurationVariable: (v: ConfigVariable) => Promise<string>): Promise<Partial<LionDenResolvedConfig>> | Partial<LionDenResolvedConfig>;
15
+ /** Final validation on the fully resolved config (cross-field checks) */
16
+ validateResolvedConfig?(config: LionDenResolvedConfig): Promise<ConfigValidationError[]> | ConfigValidationError[];
17
+ }
18
+ export interface TestingHookHandlers {
19
+ /** Before test suite begins (devnode lifecycle). */
20
+ suiteSetup?(context: unknown): Promise<void> | void;
21
+ /**
22
+ * After the test suite completes. May run after partial or failed suite setup;
23
+ * handlers must tolerate uninitialized state.
24
+ */
25
+ suiteTeardown?(context: unknown): Promise<void> | void;
26
+ /** Before each test (snapshot). */
27
+ testSetup?(context: unknown): Promise<void> | void;
28
+ /** After each test (revert). */
29
+ testTeardown?(context: unknown): Promise<void> | void;
30
+ }
31
+ export interface ProgramDeployedContext {
32
+ readonly programId: string;
33
+ readonly txId: string;
34
+ readonly blockHeight: number;
35
+ readonly network: string;
36
+ }
37
+ export type ProgramUpgradedContext = ProgramDeployedContext;
38
+ export interface DeploymentHookHandlers {
39
+ /** Called after a program is successfully deployed on-chain. */
40
+ programDeployed?(ctx: ProgramDeployedContext): Promise<void> | void;
41
+ /** Called after a program is successfully upgraded on-chain. */
42
+ programUpgraded?(ctx: ProgramUpgradedContext): Promise<void> | void;
43
+ }
44
+ export type HookCategory = "config" | "testing" | "deployment";
45
+ export type HookHandlerMap = {
46
+ config: ConfigHookHandlers;
47
+ testing: TestingHookHandlers;
48
+ deployment: DeploymentHookHandlers;
49
+ };
50
+ type HookHandlersFor<C extends HookCategory> = HookHandlerMap[C];
51
+ export type HookHandlerProvider<C extends HookCategory> = (() => Promise<HookHandlersFor<C>>) | HookHandlersFor<C>;
52
+ export declare enum ArgumentType {
53
+ STRING = "STRING",
54
+ INT = "INT",
55
+ BOOLEAN = "BOOLEAN",
56
+ BIGINT = "BIGINT",
57
+ FILE = "FILE"
58
+ }
59
+ export interface GlobalOptionDefinition {
60
+ readonly name: string;
61
+ readonly description: string;
62
+ readonly type: ArgumentType;
63
+ readonly defaultValue?: unknown;
64
+ }
65
+ export interface TaskOption {
66
+ readonly name: string;
67
+ readonly description: string;
68
+ readonly type: "string" | "number";
69
+ readonly defaultValue?: unknown;
70
+ readonly required?: boolean;
71
+ }
72
+ export interface TaskFlag {
73
+ readonly name: string;
74
+ readonly description: string;
75
+ }
76
+ export interface TaskPositionalArgument {
77
+ readonly name: string;
78
+ readonly type: ArgumentType;
79
+ readonly description?: string;
80
+ readonly required?: boolean;
81
+ readonly variadic?: boolean;
82
+ }
83
+ export type TaskAction = (args: Record<string, unknown>, lre: LionDenRuntimeEnvironment) => Promise<unknown>;
84
+ export type TaskActionWithSuper = (args: Record<string, unknown>, lre: LionDenRuntimeEnvironment, runSuper: (args: Record<string, unknown>) => Promise<unknown>) => Promise<unknown>;
85
+ export interface TaskDefinition {
86
+ readonly id: string;
87
+ readonly description: string;
88
+ readonly action: TaskAction;
89
+ readonly options?: readonly TaskOption[];
90
+ readonly flags?: readonly TaskFlag[];
91
+ readonly positionalArguments?: readonly TaskPositionalArgument[];
92
+ /** If set, this task overrides a task with this id */
93
+ readonly overrides?: string;
94
+ }
95
+ export interface LionDenPlugin {
96
+ /** Unique identifier, e.g. "@lionden/plugin-leo" */
97
+ readonly id: string;
98
+ /** Human-readable name for error messages and logs */
99
+ readonly name?: string;
100
+ /** Plugins that MUST be loaded before this one */
101
+ readonly dependencies?: readonly LionDenPlugin[];
102
+ /** Hook handlers by category — lazy-loaded via () => import() or eager objects */
103
+ readonly hookHandlers?: Partial<{
104
+ [C in HookCategory]: HookHandlerProvider<C>;
105
+ }>;
106
+ /** Tasks registered by this plugin */
107
+ readonly tasks?: readonly TaskDefinition[];
108
+ /** Global CLI options added by this plugin */
109
+ readonly globalOptions?: readonly GlobalOptionDefinition[];
110
+ /**
111
+ * Called after LRE construction. Allows plugins to inject services
112
+ * (e.g., network manager) into the runtime environment.
113
+ */
114
+ readonly extendLre?: (lre: LionDenRuntimeEnvironment) => void;
115
+ }
116
+ export interface ArtifactStore {
117
+ /** Get the ABI JSON for a compiled program */
118
+ getAbi(programId: string): unknown | undefined;
119
+ /** Get the compiled .aleo source for a program */
120
+ getAleoSource(programId: string): string | undefined;
121
+ /** Get all compiled program IDs */
122
+ getProgramIds(): string[];
123
+ /** Store the ABI JSON for a compiled program */
124
+ setAbi(programId: string, abi: unknown): void;
125
+ /** Store the compiled .aleo source for a program */
126
+ setAleoSource(programId: string, source: string): void;
127
+ }
128
+ export interface LionDenRuntimeEnvironment {
129
+ /** Resolved configuration */
130
+ readonly config: LionDenResolvedConfig;
131
+ /** Network manager — create connections, manage devnode lifecycle */
132
+ readonly network: unknown;
133
+ /** Deployment manager — track and query deployment state */
134
+ readonly deployments: unknown;
135
+ /** Task runner — execute tasks programmatically */
136
+ readonly tasks: TaskRunner;
137
+ /** Hook dispatcher — invoke hooks programmatically */
138
+ readonly hooks: HookDispatcher;
139
+ /** Compilation artifacts (populated after compile task) */
140
+ readonly artifacts: ArtifactStore;
141
+ /** Loaded plugins */
142
+ readonly plugins: readonly LionDenPlugin[];
143
+ /** Global option values */
144
+ readonly globalOptions: Record<string, unknown>;
145
+ /**
146
+ * Resolved named accounts for the currently active network.
147
+ * Populated by @lionden/plugin-network after connect().
148
+ * Empty object ({}) when no namedAccounts are configured or before connect().
149
+ */
150
+ readonly namedAccounts: NamedAccounts;
151
+ }
152
+ export interface TaskRunner {
153
+ /** Run a task by ID with the given arguments */
154
+ run(taskId: string, args?: Record<string, unknown>): Promise<unknown>;
155
+ /** Check if a task is registered */
156
+ has(taskId: string): boolean;
157
+ /** Get all registered task IDs */
158
+ getTaskIds(): string[];
159
+ /** Get the registered task definition, if any */
160
+ getTaskDefinition(taskId: string): TaskDefinition | undefined;
161
+ }
162
+ export type HookDispatchMode = "serial" | "waterfall" | "collect";
163
+ export interface HookDispatcher {
164
+ /** Dispatch a hook in serial mode — handlers execute sequentially */
165
+ serial<TContext>(category: HookCategory, hookName: string, context: TContext): Promise<void>;
166
+ /** Dispatch a hook in waterfall mode — each handler transforms previous result */
167
+ waterfall<TValue>(category: HookCategory, hookName: string, initialValue: TValue, ...extraArgs: unknown[]): Promise<TValue>;
168
+ /** Dispatch a hook in collect mode — gather each handler's return value in plugin order */
169
+ collect<TResult>(category: HookCategory, hookName: string, context: unknown, ...extraArgs: unknown[]): Promise<TResult[]>;
170
+ }
171
+ /**
172
+ * A program to deploy: either a bare program name / `.aleo` id, or any object
173
+ * carrying a `programId` (e.g. a generated contract wrapper). Shared so that
174
+ * `DeploymentContext.deploy` and `TestContext.deploy` stay structurally
175
+ * identical by construction.
176
+ */
177
+ export type ProgramDeploymentTarget = string | {
178
+ readonly programId: string;
179
+ readonly sourceProgramId?: string;
180
+ };
181
+ /** Resolve a {@link ProgramDeploymentTarget} to its program name/id string. */
182
+ export declare function programNameFromTarget(program: ProgramDeploymentTarget): string;
183
+ /** Resolve a {@link ProgramDeploymentTarget} to its local source program id, when available. */
184
+ export declare function sourceProgramNameFromTarget(program: ProgramDeploymentTarget): string;
185
+ export {};
186
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACd,MAAM,iBAAiB,CAAC;AAMzB,MAAM,WAAW,qBAAqB;IACpC,2EAA2E;IAC3E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,QAAQ,CAAC,OAAO,EAAE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,CAAC;IAE7F,kFAAkF;IAClF,SAAS,CAAC,MAAM,EACd,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,GAAG,SAAS,EAAE,OAAO,EAAE,GACtB,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnB,2FAA2F;IAC3F,OAAO,CAAC,OAAO,EACb,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,OAAO,EAChB,GAAG,SAAS,EAAE,OAAO,EAAE,GACtB,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;CACvB;AAMD;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,GAC/B,MAAM,GACN;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE,+EAA+E;AAC/E,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,CAE9E;AAED,gGAAgG;AAChG,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,CAEpF"}
package/dist/types.js ADDED
@@ -0,0 +1,20 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Arguments
3
+ // ---------------------------------------------------------------------------
4
+ export var ArgumentType;
5
+ (function (ArgumentType) {
6
+ ArgumentType["STRING"] = "STRING";
7
+ ArgumentType["INT"] = "INT";
8
+ ArgumentType["BOOLEAN"] = "BOOLEAN";
9
+ ArgumentType["BIGINT"] = "BIGINT";
10
+ ArgumentType["FILE"] = "FILE";
11
+ })(ArgumentType || (ArgumentType = {}));
12
+ /** Resolve a {@link ProgramDeploymentTarget} to its program name/id string. */
13
+ export function programNameFromTarget(program) {
14
+ return typeof program === "string" ? program : program.programId;
15
+ }
16
+ /** Resolve a {@link ProgramDeploymentTarget} to its local source program id, when available. */
17
+ export function sourceProgramNameFromTarget(program) {
18
+ return typeof program === "string" ? program : (program.sourceProgramId ?? program.programId);
19
+ }
20
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAkGA,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E,MAAM,CAAN,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,2BAAW,CAAA;IACX,mCAAmB,CAAA;IACnB,iCAAiB,CAAA;IACjB,6BAAa,CAAA;AACf,CAAC,EANW,YAAY,KAAZ,YAAY,QAMvB;AA0LD,+EAA+E;AAC/E,MAAM,UAAU,qBAAqB,CAAC,OAAgC;IACpE,OAAO,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AACnE,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,2BAA2B,CAAC,OAAgC;IAC1E,OAAO,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC;AAChG,CAAC"}
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@lionden/core",
3
+ "version": "0.1.0",
4
+ "license": "Apache-2.0",
5
+ "type": "module",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/sealance-io/lionden.git",
9
+ "directory": "packages/core"
10
+ },
11
+ "engines": {
12
+ "node": "^20.19.0 || >=22.12.0"
13
+ },
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "default": "./dist/index.js"
18
+ }
19
+ },
20
+ "files": [
21
+ "dist",
22
+ "!dist/**/*.test.*"
23
+ ],
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "scripts": {
28
+ "build": "tsc --build"
29
+ },
30
+ "dependencies": {
31
+ "@lionden/config": "^0.1.0"
32
+ }
33
+ }