@lmctl-ai/lmctl 0.2.37 → 0.2.38

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.
@@ -1,3 +1,4 @@
1
+ export { loadInitFile, parseInitDocument, resolveInitFilePath, InitFileError } from './init-file.js';
1
2
  export interface InitProviderSlot {
2
3
  provider: string;
3
4
  model1: string;
@@ -33,10 +34,25 @@ export declare function buildInitConfig(detectedProviders: string[]): InitConfig
33
34
  export declare function detectPresentProviders(): string[];
34
35
  export declare function renderInitConfig(config: InitConfig): string;
35
36
  export declare function parseInitConfigText(raw: string): InitConfig | null;
36
- /** Reads the init config, or null if it doesn't exist / doesn't parse into
37
- * all three complete slots. Never throws. */
38
37
  export declare function readInitConfig(filePath?: string): InitConfig | null;
39
38
  export declare function writeInitConfig(config: InitConfig, filePath?: string): void;
39
+ export interface InitMergeChange {
40
+ section: string;
41
+ key: string;
42
+ oldValue: string;
43
+ newValue: string;
44
+ line: number;
45
+ }
46
+ export type InitMergeResult = {
47
+ ok: true;
48
+ text: string;
49
+ changes: InitMergeChange[];
50
+ } | {
51
+ ok: false;
52
+ error: string;
53
+ line?: number;
54
+ };
55
+ export declare function mergeInitConfigText(raw: string, config: InitConfig): InitMergeResult;
40
56
  /** Substitutes ${Provider1..3} and ${Model1..3} in template text from a
41
57
  * resolved InitConfig. Unknown placeholders are left untouched (quickrun
42
58
  * surfaces them separately so a lint failure names the real cause). */
@@ -0,0 +1,3 @@
1
+ import type { InitConfig, InitMergeResult } from './init-config.js';
2
+ export declare function encodeInitString(value: string): string;
3
+ export declare function mergeValidatedInitText(raw: string, config: InitConfig): InitMergeResult;
@@ -0,0 +1,20 @@
1
+ import { type TomlTable } from 'smol-toml';
2
+ import type { InitConfig } from './init-config.js';
3
+ export declare const INIT_SECTIONS: readonly ["Provider1", "Provider2", "Provider3"];
4
+ export declare const INIT_KEYS: readonly ["provider", "model1", "model2", "model3"];
5
+ export interface InitSnapshot {
6
+ raw: string;
7
+ document: TomlTable;
8
+ config: InitConfig;
9
+ path: string;
10
+ }
11
+ export declare function resolveInitFilePath(env?: NodeJS.ProcessEnv, explicit?: string): string;
12
+ export declare class InitFileError extends Error {
13
+ readonly path: string;
14
+ readonly kind: 'missing' | 'read' | 'syntax' | 'schema';
15
+ readonly line: number;
16
+ readonly column: number;
17
+ constructor(path: string, kind: 'missing' | 'read' | 'syntax' | 'schema', problem: string, line?: number, column?: number);
18
+ }
19
+ export declare function parseInitDocument(raw: string, path?: string): InitSnapshot;
20
+ export declare function loadInitFile(path?: string): InitSnapshot;
@@ -0,0 +1,2 @@
1
+ /** Same-directory replace; validate first, retain original backup, refuse stale snapshots. */
2
+ export declare function replaceInitFile(path: string, text: string, original: string | null): void;
@@ -1,3 +1,4 @@
1
+ import { type ScriptEnvironmentOptions } from './init-environment.js';
1
2
  import { LMScript, type FunctionDoc, type ScriptModule } from './lmscript.js';
2
3
  import { type ResolvedMember } from '../cli/target-resolver.js';
3
4
  import type { BundleSession } from '../providers/bundle.js';
@@ -97,8 +98,10 @@ export declare function registerLmctlModule(engine: LMScript, io: CliIo, registr
97
98
  /**
98
99
  * Creates and configures an LMScript engine instance pre-wired with the lmctl module.
99
100
  */
100
- export declare function createLmScriptEngine(io: CliIo, scriptArgs?: string[], registry?: ResourceRegistry, env?: NodeJS.ProcessEnv): LMScript;
101
+ export declare function createLmScriptEngine(io: CliIo, scriptArgs?: string[], registry?: ResourceRegistry, env?: NodeJS.ProcessEnv, options?: ScriptEnvironmentOptions): LMScript;
102
+ /** Documentation discovery composes functions without starting a profile-backed runtime. */
103
+ export declare function createLmScriptDocumentationEngine(io: CliIo, scriptArgs?: string[], registry?: ResourceRegistry, env?: NodeJS.ProcessEnv): LMScript;
101
104
  /**
102
105
  * Executes an LMScript script source with full lifecycle and signal guarantees.
103
106
  */
104
- export declare function runScriptEngine(source: string, scriptArgs: string[], io?: CliIo, env?: NodeJS.ProcessEnv, scriptFile?: string, globals?: Record<string, unknown>): Promise<number>;
107
+ export declare function runScriptEngine(source: string, scriptArgs: string[], io?: CliIo, env?: NodeJS.ProcessEnv, scriptFile?: string, globals?: Record<string, unknown>, options?: ScriptEnvironmentOptions): Promise<number>;
@@ -0,0 +1,8 @@
1
+ import { type CliIo } from '../cli/common.js';
2
+ export interface ScriptEnvironmentOptions {
3
+ initConfigPath?: string;
4
+ }
5
+ export declare const SCRIPT_ENVIRONMENT_HINT = "Environment names (Provider1..3, Model1..3, Directory, NonInteractive) are supplied by ~/.lmctl/init.toml via lmctl init.";
6
+ export declare function scriptDiagnosticMessage(message: string): string;
7
+ /** Read one profile snapshot and initialize runtime and checker bindings together. */
8
+ export declare function buildScriptEnvironment(io: CliIo, env: NodeJS.ProcessEnv, options?: ScriptEnvironmentOptions): Record<string, string | boolean>;
@@ -97,15 +97,28 @@ export declare function promptHumanSync(question?: any): string | null;
97
97
  export declare function promptHumanAsync(question?: any, inStream?: any, outStream?: any): Promise<string | null>;
98
98
  export declare function parseCsv(text: string, hasHeader?: boolean, delimiter?: string): any[];
99
99
  export declare function stringifyCsv(data: any[], delimiter?: string): string;
100
- export type TokenType = "FN" | "LET" | "IF" | "ELSE" | "WHILE" | "FOR" | "RETURN" | "BREAK" | "CONTINUE" | "TRUE" | "FALSE" | "NULL" | "PARALLEL" | "SYNC" | "IMPORT" | "IDENTIFIER" | "NUMBER" | "STRING" | "PLUS" | "MINUS" | "STAR" | "SLASH" | "PERCENT" | "ASSIGN" | "EQUAL" | "NOT_EQUAL" | "LESS" | "LESS_EQUAL" | "GREATER" | "GREATER_EQUAL" | "AND" | "OR" | "NOT" | "DOT" | "COLON" | "LPAREN" | "RPAREN" | "LBRACE" | "RBRACE" | "LBRACKET" | "RBRACKET" | "COMMA" | "SEMICOLON" | "EOF";
100
+ export type TokenType = "FN" | "LET" | "IF" | "ELSE" | "WHILE" | "FOR" | "RETURN" | "BREAK" | "CONTINUE" | "TRUE" | "FALSE" | "NULL" | "PARALLEL" | "SYNC" | "IMPORT" | "IDENTIFIER" | "NUMBER" | "STRING" | "FSTRING_START" | "FSTRING_TEXT" | "FSTRING_FIELD_START" | "FSTRING_FIELD_END" | "FSTRING_END" | "PLUS" | "MINUS" | "STAR" | "SLASH" | "PERCENT" | "ASSIGN" | "EQUAL" | "NOT_EQUAL" | "LESS" | "LESS_EQUAL" | "GREATER" | "GREATER_EQUAL" | "AND" | "OR" | "NOT" | "DOT" | "COLON" | "LPAREN" | "RPAREN" | "LBRACE" | "RBRACE" | "LBRACKET" | "RBRACKET" | "COMMA" | "SEMICOLON" | "EOF";
101
101
  export interface Token {
102
102
  type: TokenType;
103
103
  value: string;
104
104
  literal?: any;
105
105
  line: number;
106
106
  column: number;
107
+ offset?: number;
108
+ endOffset?: number;
109
+ endLine?: number;
110
+ endColumn?: number;
111
+ stringLiteral?: {
112
+ prefix: string;
113
+ raw: boolean;
114
+ triple: boolean;
115
+ formatted: boolean;
116
+ };
107
117
  }
108
118
  export declare class Lexer {
119
+ readonly diagnostics: Diagnostic[];
120
+ private formattedDepth;
121
+ private readonly modes;
109
122
  private readonly source;
110
123
  private readonly length;
111
124
  private readonly file?;
@@ -114,6 +127,10 @@ export declare class Lexer {
114
127
  private column;
115
128
  constructor(source: string, file?: string);
116
129
  tokenize(): Token[];
130
+ private position;
131
+ private spannedToken;
132
+ private scanTokens;
133
+ private readNextToken;
117
134
  private peek;
118
135
  private peekNext;
119
136
  private advance;
@@ -124,7 +141,9 @@ export declare class Lexer {
124
141
  private skipWhitespaceAndComments;
125
142
  private readNumber;
126
143
  private readString;
127
- private tryReadHeredoc;
144
+ private consumeStringNewline;
145
+ private readModernEscape;
146
+ private readModernString;
128
147
  private readIdentifier;
129
148
  }
130
149
  export type BinaryOp = "+" | "-" | "*" | "/" | "%" | "==" | "!=" | "<" | "<=" | ">" | ">=" | "&&" | "||";
@@ -134,7 +153,7 @@ export interface NodeBase {
134
153
  column: number;
135
154
  file?: string;
136
155
  }
137
- export type Expr = LiteralExpr | IdentifierExpr | AssignExpr | IndexAssignExpr | TupleAssignExpr | UnaryExpr | BinaryExpr | CallExpr | ArrayExpr | IndexExpr | GroupingExpr | TupleExpr | ObjectExpr | ParallelExpr;
156
+ export type Expr = LiteralExpr | InterpolatedStringExpr | IdentifierExpr | AssignExpr | IndexAssignExpr | TupleAssignExpr | UnaryExpr | BinaryExpr | CallExpr | ArrayExpr | IndexExpr | GroupingExpr | TupleExpr | ObjectExpr | ParallelExpr;
138
157
  export interface ParallelExpr extends NodeBase {
139
158
  kind: "ParallelExpr";
140
159
  tasks: CallExpr[];
@@ -143,6 +162,15 @@ export interface LiteralExpr extends NodeBase {
143
162
  kind: "LiteralExpr";
144
163
  value: any;
145
164
  }
165
+ export interface InterpolationField extends NodeBase {
166
+ expression: Expr;
167
+ offset?: number;
168
+ endOffset?: number;
169
+ }
170
+ export interface InterpolatedStringExpr extends NodeBase {
171
+ kind: "InterpolatedStringExpr";
172
+ parts: (string | InterpolationField)[];
173
+ }
146
174
  export interface IdentifierExpr extends NodeBase {
147
175
  kind: "IdentifierExpr";
148
176
  name: string;
@@ -312,6 +340,8 @@ export declare class Parser {
312
340
  private parseUnary;
313
341
  private parseCallAndIndex;
314
342
  private parsePrimary;
343
+ private parseFormattedString;
344
+ private validateFieldExpression;
315
345
  private match;
316
346
  private check;
317
347
  private advance;
@@ -346,6 +376,7 @@ export type CompileOptions = CheckOptions;
346
376
  export declare function compileProgram(source: string, options?: CompileOptions): {
347
377
  program: Program;
348
378
  loadedFiles: string[];
379
+ diagnostics: Diagnostic[];
349
380
  };
350
381
  export interface FunctionSignature {
351
382
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lmctl-ai/lmctl",
3
- "version": "0.2.37",
3
+ "version": "0.2.38",
4
4
  "description": "A provider-agnostic control plane for teams of AI coding agents — across providers, with independent review and durable memory.",
5
5
  "type": "module",
6
6
  "homepage": "https://lmctl.com",
@@ -27,6 +27,7 @@
27
27
  "bin/",
28
28
  "package.json",
29
29
  "LICENSE",
30
+ "THIRD_PARTY_NOTICES.md",
30
31
  "README.md",
31
32
  "CHANGELOG.md",
32
33
  "examples/"