@lmctl-ai/lmctl 0.1.342 → 0.2.3
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/CHANGELOG.md +116 -0
- package/README.md +11 -51
- package/data/price-aliases.json +1 -0
- package/data/price-data.json +1 -1
- package/dist/cli/batch.d.ts +2 -0
- package/dist/cli/busy-evidence.d.ts +27 -0
- package/dist/cli/chat-cycle.d.ts +59 -0
- package/dist/cli/chat-exec.d.ts +83 -0
- package/dist/cli/chat-policy.d.ts +22 -0
- package/dist/cli/chat.d.ts +23 -0
- package/dist/cli/code-resolver.d.ts +8 -0
- package/dist/cli/common.d.ts +54 -0
- package/dist/cli/context.d.ts +12 -0
- package/dist/cli/cost.d.ts +2 -0
- package/dist/cli/export.d.ts +2 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.js +1062 -1400
- package/dist/cli/infra.d.ts +78 -0
- package/dist/cli/ls.d.ts +2 -0
- package/dist/cli/mailbox-cli.d.ts +6 -0
- package/dist/cli/managed.d.ts +62 -0
- package/dist/cli/mcp-install.d.ts +23 -0
- package/dist/cli/mcp.d.ts +2 -0
- package/dist/cli/paths.d.ts +50 -0
- package/dist/cli/plan-wizard.d.ts +42 -0
- package/dist/cli/plan.d.ts +20 -0
- package/dist/cli/queue-delivery.d.ts +107 -0
- package/dist/cli/ratelimit.d.ts +3 -0
- package/dist/cli/remote-fetch.d.ts +7 -0
- package/dist/cli/run-queries.d.ts +82 -0
- package/dist/cli/running.d.ts +5 -0
- package/dist/cli/schema.sql +20 -1
- package/dist/cli/script.d.ts +6 -0
- package/dist/cli/script.js +2097 -0
- package/dist/cli/self-identity.d.ts +25 -0
- package/dist/cli/session-idle.d.ts +118 -0
- package/dist/cli/status.d.ts +22 -0
- package/dist/cli/tail.d.ts +18 -0
- package/dist/cli/target-resolver.d.ts +139 -0
- package/dist/cli/team-status.d.ts +91 -0
- package/dist/cli/teamfile-compat.d.ts +71 -0
- package/dist/cli/teamfile-store.d.ts +18 -0
- package/dist/cli/teamfile-template.d.ts +40 -0
- package/dist/cli/template-env.d.ts +25 -0
- package/dist/cli/terminal-lock.d.ts +25 -0
- package/dist/cli/terminal.d.ts +23 -0
- package/dist/cli/time-filter.d.ts +10 -0
- package/dist/cli/update-notifier.d.ts +11 -0
- package/dist/cli/version-util.d.ts +2 -0
- package/dist/config/seed_templates.d.ts +1 -0
- package/dist/db/backfill-event-log.d.ts +26 -0
- package/dist/db/delegation.d.ts +37 -0
- package/dist/db/escalation_vocab.d.ts +45 -0
- package/dist/db/event-log.d.ts +40 -0
- package/dist/db/index.d.ts +1213 -0
- package/dist/db/inflight-acquire.d.ts +70 -0
- package/dist/db/invocation-event-projections.d.ts +65 -0
- package/dist/db/ledger-identity.test.d.ts +1 -0
- package/dist/db/live-event-projections.d.ts +92 -0
- package/dist/db/migrate.d.ts +51 -0
- package/dist/db/open-readonly.d.ts +2 -0
- package/dist/db/process-liveness.d.ts +37 -0
- package/dist/db/sqlite.d.ts +47 -0
- package/dist/db/sqlite.test.d.ts +1 -0
- package/dist/db/terminal-lock.d.ts +14 -0
- package/dist/db/tracked-invocation-reconcile.d.ts +52 -0
- package/dist/db/tracked-invocation.d.ts +116 -0
- package/dist/mcp/dispatch.d.ts +45 -0
- package/dist/mcp/mediation.d.ts +128 -0
- package/dist/mcp/path-warning.d.ts +7 -0
- package/dist/mcp/server.d.ts +63 -0
- package/dist/mcp/tools.d.ts +24 -0
- package/dist/providers/adapter.d.ts +265 -0
- package/dist/providers/adapters/agy-adapter.d.ts +17 -0
- package/dist/providers/adapters/claude-adapter.d.ts +20 -0
- package/dist/providers/adapters/codex-adapter.d.ts +22 -0
- package/dist/providers/adapters/copilot-adapter.d.ts +16 -0
- package/dist/providers/adapters/dsh-adapter.d.ts +89 -0
- package/dist/providers/adapters/gemini-adapter.d.ts +44 -0
- package/dist/providers/adapters/hermes-adapter.d.ts +71 -0
- package/dist/providers/adapters/index.d.ts +35 -0
- package/dist/providers/adapters/kimi-adapter.d.ts +16 -0
- package/dist/providers/adapters/lmplayer-adapter.d.ts +14 -0
- package/dist/providers/adapters/opencode-adapter.d.ts +11 -0
- package/dist/providers/adapters/pi-adapter.d.ts +17 -0
- package/dist/providers/adapters/print-turn.d.ts +29 -0
- package/dist/providers/adapters/qwen-adapter.d.ts +11 -0
- package/dist/providers/agy.d.ts +32 -0
- package/dist/providers/base-adapter.d.ts +107 -0
- package/dist/providers/base.d.ts +12 -0
- package/dist/providers/binary-check.d.ts +102 -0
- package/dist/providers/bundle.d.ts +118 -0
- package/dist/providers/claude-mock.d.ts +90 -0
- package/dist/providers/claude.d.ts +21 -0
- package/dist/providers/codex-config.d.ts +15 -0
- package/dist/providers/codex.d.ts +25 -0
- package/dist/providers/config/model-selection-lint.d.ts +45 -0
- package/dist/providers/config/team-config.d.ts +183 -0
- package/dist/providers/config/types.d.ts +146 -0
- package/dist/providers/config/user-config.d.ts +88 -0
- package/dist/providers/copilot.d.ts +21 -0
- package/dist/providers/debug.d.ts +128 -0
- package/dist/providers/dsh-sidecar.d.ts +65 -0
- package/dist/providers/dsh-zstd.d.ts +27 -0
- package/dist/providers/dsh.d.ts +37 -0
- package/dist/providers/frontmatter.d.ts +46 -0
- package/dist/providers/gemini-session-reader.d.ts +151 -0
- package/dist/providers/gemini.d.ts +39 -0
- package/dist/providers/hermes.d.ts +90 -0
- package/dist/providers/index.d.ts +421 -0
- package/dist/providers/kimi.d.ts +37 -0
- package/dist/providers/model-catalog.d.ts +141 -0
- package/dist/providers/one-shot-timeout.d.ts +1 -0
- package/dist/providers/opencode-config.d.ts +62 -0
- package/dist/providers/opencode.d.ts +40 -0
- package/dist/providers/parsers/acp.d.ts +47 -0
- package/dist/providers/parsers/codex-app-server.d.ts +60 -0
- package/dist/providers/parsers/stream-json.d.ts +57 -0
- package/dist/providers/passive-readers/agy.d.ts +155 -0
- package/dist/providers/passive-readers/copilot.d.ts +173 -0
- package/dist/providers/passive-readers/dsh.d.ts +34 -0
- package/dist/providers/passive-readers/kimi.d.ts +44 -0
- package/dist/providers/passive-readers/opencode.d.ts +89 -0
- package/dist/providers/passive-readers/qwen.d.ts +151 -0
- package/dist/providers/passive-readers/shared.d.ts +138 -0
- package/dist/providers/passive-session-reader.d.ts +188 -0
- package/dist/providers/path-utils.d.ts +1 -0
- package/dist/providers/pi.d.ts +32 -0
- package/dist/providers/pricing.d.ts +107 -0
- package/dist/providers/qwen.d.ts +22 -0
- package/dist/providers/ratelimit-readings.d.ts +32 -0
- package/dist/providers/registry.d.ts +31 -0
- package/dist/providers/resume.d.ts +43 -0
- package/dist/providers/seed-instruction.d.ts +3 -0
- package/dist/providers/self-session-env.d.ts +21 -0
- package/dist/providers/session-limit.d.ts +9 -0
- package/dist/providers/strip-ansi.d.ts +5 -0
- package/dist/providers/transport-errors.d.ts +94 -0
- package/dist/providers/transport-lifecycle.d.ts +63 -0
- package/dist/providers/transport-wrappers.d.ts +110 -0
- package/dist/providers/transports/acp-profiles/config-option-step.d.ts +24 -0
- package/dist/providers/transports/acp-profiles/copilot.d.ts +12 -0
- package/dist/providers/transports/acp-profiles/gemini.d.ts +22 -0
- package/dist/providers/transports/acp-profiles/hermes.d.ts +27 -0
- package/dist/providers/transports/acp-profiles/index.d.ts +19 -0
- package/dist/providers/transports/acp-profiles/kimi.d.ts +24 -0
- package/dist/providers/transports/acp-profiles/opencode.d.ts +26 -0
- package/dist/providers/transports/acp-profiles/types.d.ts +258 -0
- package/dist/providers/transports/acp-rpc.d.ts +18 -0
- package/dist/providers/transports/acp.d.ts +215 -0
- package/dist/providers/transports/codex-app-server.d.ts +190 -0
- package/dist/providers/transports/hold-open.d.ts +120 -0
- package/dist/providers/transports/manager.d.ts +21 -0
- package/dist/providers/transports/stream-json.d.ts +162 -0
- package/dist/providers/transports/types.d.ts +56 -0
- package/dist/providers/types.d.ts +154 -0
- package/dist/providers/yolo-contract.d.ts +131 -0
- package/dist/script/adapter.d.ts +101 -0
- package/dist/script/batch-script.d.ts +7 -0
- package/dist/script/index.d.ts +3 -0
- package/dist/script/lmscript.d.ts +550 -0
- package/dist/shared/policy.d.ts +74 -0
- package/dist/shared-lib/db.d.ts +25 -0
- package/dist/shared-lib/passive-session-reader.d.ts +2 -0
- package/dist/shared-lib/provider-parse.d.ts +6 -0
- package/dist/templates/basedir.d.ts +52 -0
- package/dist/uri/lmctl_uri.d.ts +38 -0
- package/durable-memory/model_selection.md +122 -25
- package/examples/README.md +103 -0
- package/examples/anonymous-panel.lms +3 -0
- package/examples/batch-prompts.txt +9 -0
- package/examples/batchscript.lms +67 -0
- package/examples/n8n/agent-lib.lms +56 -0
- package/examples/n8n/git-lib.lms +93 -0
- package/examples/n8n/mock-support.db +0 -0
- package/examples/n8n/multi-agent-review.lms +107 -0
- package/examples/n8n/news-digest.lms +159 -0
- package/examples/n8n/rag-search.lms +163 -0
- package/examples/n8n/support-agent.lms +88 -0
- package/examples/n8n/ticket-triage.lms +156 -0
- package/package.json +13 -17
- package/dist/cli/side_effect_classifier.json +0 -19
|
@@ -0,0 +1,550 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LMScript - A lightweight prototype scripting language implemented in TypeScript.
|
|
3
|
+
*
|
|
4
|
+
* Requirements Met:
|
|
5
|
+
* 1. Single file: Self-contained implementation (Lexer, Parser, Static Checker, Interpreter, Host API) with zero dependencies.
|
|
6
|
+
* 2. Scan all and check before execution: In-memory AST validation upfront. Zero intermediate files generated.
|
|
7
|
+
* 3. Language features: Top-level functions, flow control (if/else, while, for, break, continue, return), tuple & destructuring assignment: (a, b) = [1, 2], dot notation (data.key), object literals { key: val }, and negative indexing arr[-1].
|
|
8
|
+
* 4. Predefined functions implemented in TypeScript:
|
|
9
|
+
* - File I/O: read_file, write_file, append_file, read_lines, read_json, write_json, read_csv, write_csv, file_exists, delete_file.
|
|
10
|
+
* - Data structures:
|
|
11
|
+
* * List/Array: list, len, push, pop, shift, unshift, insert, remove_at, slice, concat, reverse, sort, contains, index_of, join, unique, flatten, first, last, is_empty, sum, avg.
|
|
12
|
+
* * Hash/Map: map, keys, values, entries, from_entries, has_key, get, set, delete_key, merge, clone, clear, size.
|
|
13
|
+
* - JSON processing: data = json(out), json_parse, json_parse_safe, json_stringify, pluck, filter_by, find_by.
|
|
14
|
+
* - System & Process: system() returning SystemResult, prompt_human() for attended terminal pause/handoff.
|
|
15
|
+
* - Comprehensive string operations (split, lines, words, join, trim, upper, lower, contains, replace, slice, etc.).
|
|
16
|
+
* 5. Register new functions: API allowing host TypeScript functions to be registered and checked statically.
|
|
17
|
+
*
|
|
18
|
+
* Security & Authority Model:
|
|
19
|
+
* LMScript executes with full operator authority (no sandbox). File I/O operations (read_file,
|
|
20
|
+
* write_file, etc.) and shell processes (system()) execute with the local permissions and environment
|
|
21
|
+
* of the invoking user. Scripts should only be accepted and run from trusted operator sources.
|
|
22
|
+
*/
|
|
23
|
+
export interface SourceLocation {
|
|
24
|
+
line: number;
|
|
25
|
+
column: number;
|
|
26
|
+
file?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface Diagnostic {
|
|
29
|
+
message: string;
|
|
30
|
+
line: number;
|
|
31
|
+
column: number;
|
|
32
|
+
severity: "error" | "warning";
|
|
33
|
+
file?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare class LMScriptError extends Error {
|
|
36
|
+
readonly message: string;
|
|
37
|
+
readonly line: number;
|
|
38
|
+
readonly column: number;
|
|
39
|
+
readonly stage: "LEXER" | "PARSER" | "CHECKER" | "RUNTIME";
|
|
40
|
+
readonly file?: string;
|
|
41
|
+
constructor(message: string, line: number, column: number, stage: "LEXER" | "PARSER" | "CHECKER" | "RUNTIME", file?: string);
|
|
42
|
+
}
|
|
43
|
+
export declare class LMScriptExit extends Error {
|
|
44
|
+
readonly isControlFlow = true;
|
|
45
|
+
readonly exitCode: number;
|
|
46
|
+
constructor(exitCode?: number);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Formats a diagnostic with a visual code snippet and caret pointer.
|
|
50
|
+
*/
|
|
51
|
+
export declare function formatDiagnostic(diag: Diagnostic, source?: string): string;
|
|
52
|
+
/**
|
|
53
|
+
* Result record returned by `system()`.
|
|
54
|
+
*
|
|
55
|
+
* Invariants & Contract Guarantees:
|
|
56
|
+
* 1. Strict Completion: `system()` is strictly a completion primitive and always awaits
|
|
57
|
+
* process exit. It does not return running or detached processes.
|
|
58
|
+
* 2. Null-No-Overload: `code: null` strictly denotes abnormal termination (killed by signal
|
|
59
|
+
* or timed out). `code: null` NEVER means "still running" or "detached".
|
|
60
|
+
* 3. Future Background Decoupling: Any future non-blocking background handle will be a separate
|
|
61
|
+
* discriminated record (`{ kind: 'process', pid, started_at }`) with dedicated wait/poll
|
|
62
|
+
* primitives, rather than overloading `SystemResult` with nullable fields. Handles carry
|
|
63
|
+
* `started_at` timestamp to protect against PID recycling.
|
|
64
|
+
*/
|
|
65
|
+
export interface SystemResult {
|
|
66
|
+
stdout: string;
|
|
67
|
+
stderr: string;
|
|
68
|
+
code: number | null;
|
|
69
|
+
signal: string | null;
|
|
70
|
+
timed_out: boolean;
|
|
71
|
+
duration_ms: number;
|
|
72
|
+
pid: number | null;
|
|
73
|
+
}
|
|
74
|
+
export declare function createSystemResult(stdout: string, stderr: string, code: number | null, signal?: string | null, timedOut?: boolean, durationMs?: number, pid?: number | null): SystemResult;
|
|
75
|
+
export declare function shellQuote(value: any): string;
|
|
76
|
+
export declare function systemSync(cmd: string | any[], timeoutMs?: number): SystemResult;
|
|
77
|
+
/**
|
|
78
|
+
* Safely parses JSON string with preamble and markdown fence recovery.
|
|
79
|
+
* Returns `fallback` (defaulting to null) on parse failure rather than throwing.
|
|
80
|
+
*/
|
|
81
|
+
export declare function safeParseJson(raw: any, fallback?: any): any;
|
|
82
|
+
/**
|
|
83
|
+
* Synchronous operator prompt on terminal stdin.
|
|
84
|
+
* Returns the entered string (with trailing newline stripped), or null if stdin is closed/non-interactive.
|
|
85
|
+
*/
|
|
86
|
+
export declare function promptHumanSync(question?: any): string | null;
|
|
87
|
+
/**
|
|
88
|
+
* Asynchronous operator prompt on terminal or provided input/output stream.
|
|
89
|
+
* Returns the entered string, or null if stdin is closed or non-interactive without pending data.
|
|
90
|
+
*/
|
|
91
|
+
export declare function promptHumanAsync(question?: any, inStream?: any, outStream?: any): Promise<string | null>;
|
|
92
|
+
export declare function parseCsv(text: string, hasHeader?: boolean, delimiter?: string): any[];
|
|
93
|
+
export declare function stringifyCsv(data: any[], delimiter?: string): string;
|
|
94
|
+
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";
|
|
95
|
+
export interface Token {
|
|
96
|
+
type: TokenType;
|
|
97
|
+
value: string;
|
|
98
|
+
literal?: any;
|
|
99
|
+
line: number;
|
|
100
|
+
column: number;
|
|
101
|
+
}
|
|
102
|
+
export declare class Lexer {
|
|
103
|
+
private readonly source;
|
|
104
|
+
private readonly length;
|
|
105
|
+
private readonly file?;
|
|
106
|
+
private pos;
|
|
107
|
+
private line;
|
|
108
|
+
private column;
|
|
109
|
+
constructor(source: string, file?: string);
|
|
110
|
+
tokenize(): Token[];
|
|
111
|
+
private peek;
|
|
112
|
+
private peekNext;
|
|
113
|
+
private advance;
|
|
114
|
+
private match;
|
|
115
|
+
private isDigit;
|
|
116
|
+
private isAlpha;
|
|
117
|
+
private isAlphaNumeric;
|
|
118
|
+
private skipWhitespaceAndComments;
|
|
119
|
+
private readNumber;
|
|
120
|
+
private readString;
|
|
121
|
+
private tryReadHeredoc;
|
|
122
|
+
private readIdentifier;
|
|
123
|
+
}
|
|
124
|
+
export type BinaryOp = "+" | "-" | "*" | "/" | "%" | "==" | "!=" | "<" | "<=" | ">" | ">=" | "&&" | "||";
|
|
125
|
+
export type UnaryOp = "!" | "-";
|
|
126
|
+
export interface NodeBase {
|
|
127
|
+
line: number;
|
|
128
|
+
column: number;
|
|
129
|
+
file?: string;
|
|
130
|
+
}
|
|
131
|
+
export type Expr = LiteralExpr | IdentifierExpr | AssignExpr | IndexAssignExpr | TupleAssignExpr | UnaryExpr | BinaryExpr | CallExpr | ArrayExpr | IndexExpr | GroupingExpr | TupleExpr | ObjectExpr | ParallelExpr;
|
|
132
|
+
export interface ParallelExpr extends NodeBase {
|
|
133
|
+
kind: "ParallelExpr";
|
|
134
|
+
tasks: CallExpr[];
|
|
135
|
+
}
|
|
136
|
+
export interface LiteralExpr extends NodeBase {
|
|
137
|
+
kind: "LiteralExpr";
|
|
138
|
+
value: any;
|
|
139
|
+
}
|
|
140
|
+
export interface IdentifierExpr extends NodeBase {
|
|
141
|
+
kind: "IdentifierExpr";
|
|
142
|
+
name: string;
|
|
143
|
+
}
|
|
144
|
+
export interface AssignExpr extends NodeBase {
|
|
145
|
+
kind: "AssignExpr";
|
|
146
|
+
target: string;
|
|
147
|
+
value: Expr;
|
|
148
|
+
}
|
|
149
|
+
export interface IndexAssignExpr extends NodeBase {
|
|
150
|
+
kind: "IndexAssignExpr";
|
|
151
|
+
target: Expr;
|
|
152
|
+
index: Expr;
|
|
153
|
+
value: Expr;
|
|
154
|
+
}
|
|
155
|
+
export interface TupleAssignExpr extends NodeBase {
|
|
156
|
+
kind: "TupleAssignExpr";
|
|
157
|
+
targets: string[];
|
|
158
|
+
value: Expr;
|
|
159
|
+
}
|
|
160
|
+
export interface UnaryExpr extends NodeBase {
|
|
161
|
+
kind: "UnaryExpr";
|
|
162
|
+
operator: UnaryOp;
|
|
163
|
+
operand: Expr;
|
|
164
|
+
}
|
|
165
|
+
export interface BinaryExpr extends NodeBase {
|
|
166
|
+
kind: "BinaryExpr";
|
|
167
|
+
operator: BinaryOp;
|
|
168
|
+
left: Expr;
|
|
169
|
+
right: Expr;
|
|
170
|
+
}
|
|
171
|
+
export interface CallExpr extends NodeBase {
|
|
172
|
+
kind: "CallExpr";
|
|
173
|
+
callee: string;
|
|
174
|
+
args: Expr[];
|
|
175
|
+
}
|
|
176
|
+
export interface ArrayExpr extends NodeBase {
|
|
177
|
+
kind: "ArrayExpr";
|
|
178
|
+
elements: Expr[];
|
|
179
|
+
}
|
|
180
|
+
export interface IndexExpr extends NodeBase {
|
|
181
|
+
kind: "IndexExpr";
|
|
182
|
+
target: Expr;
|
|
183
|
+
index: Expr;
|
|
184
|
+
}
|
|
185
|
+
export interface GroupingExpr extends NodeBase {
|
|
186
|
+
kind: "GroupingExpr";
|
|
187
|
+
expression: Expr;
|
|
188
|
+
}
|
|
189
|
+
export interface TupleExpr extends NodeBase {
|
|
190
|
+
kind: "TupleExpr";
|
|
191
|
+
elements: Expr[];
|
|
192
|
+
}
|
|
193
|
+
export interface ObjectProperty {
|
|
194
|
+
key: string;
|
|
195
|
+
value: Expr;
|
|
196
|
+
}
|
|
197
|
+
export interface ObjectExpr extends NodeBase {
|
|
198
|
+
kind: "ObjectExpr";
|
|
199
|
+
properties: ObjectProperty[];
|
|
200
|
+
}
|
|
201
|
+
export type Stmt = ImportStmt | FunctionDeclStmt | VarDeclStmt | TupleVarDeclStmt | IfStmt | WhileStmt | ForStmt | ReturnStmt | BreakStmt | ContinueStmt | SyncAssignStmt | SyncIndexAssignStmt | SyncCallStmt | ExprStmt | BlockStmt;
|
|
202
|
+
export interface ImportStmt extends NodeBase {
|
|
203
|
+
kind: "ImportStmt";
|
|
204
|
+
path: string;
|
|
205
|
+
}
|
|
206
|
+
export interface SyncAssignStmt extends NodeBase {
|
|
207
|
+
kind: "SyncAssignStmt";
|
|
208
|
+
target: string;
|
|
209
|
+
value: Expr;
|
|
210
|
+
}
|
|
211
|
+
export interface SyncIndexAssignStmt extends NodeBase {
|
|
212
|
+
kind: "SyncIndexAssignStmt";
|
|
213
|
+
target: Expr;
|
|
214
|
+
index: Expr;
|
|
215
|
+
value: Expr;
|
|
216
|
+
}
|
|
217
|
+
export interface SyncCallStmt extends NodeBase {
|
|
218
|
+
kind: "SyncCallStmt";
|
|
219
|
+
call: CallExpr;
|
|
220
|
+
}
|
|
221
|
+
export interface FunctionDeclStmt extends NodeBase {
|
|
222
|
+
kind: "FunctionDeclStmt";
|
|
223
|
+
name: string;
|
|
224
|
+
params: string[];
|
|
225
|
+
body: BlockStmt;
|
|
226
|
+
}
|
|
227
|
+
export interface VarDeclStmt extends NodeBase {
|
|
228
|
+
kind: "VarDeclStmt";
|
|
229
|
+
name: string;
|
|
230
|
+
initializer?: Expr;
|
|
231
|
+
}
|
|
232
|
+
export interface TupleVarDeclStmt extends NodeBase {
|
|
233
|
+
kind: "TupleVarDeclStmt";
|
|
234
|
+
names: string[];
|
|
235
|
+
initializer: Expr;
|
|
236
|
+
}
|
|
237
|
+
export interface IfStmt extends NodeBase {
|
|
238
|
+
kind: "IfStmt";
|
|
239
|
+
condition: Expr;
|
|
240
|
+
thenBranch: Stmt;
|
|
241
|
+
elseBranch?: Stmt;
|
|
242
|
+
}
|
|
243
|
+
export interface WhileStmt extends NodeBase {
|
|
244
|
+
kind: "WhileStmt";
|
|
245
|
+
condition: Expr;
|
|
246
|
+
body: Stmt;
|
|
247
|
+
}
|
|
248
|
+
export interface ForStmt extends NodeBase {
|
|
249
|
+
kind: "ForStmt";
|
|
250
|
+
init?: Stmt;
|
|
251
|
+
condition?: Expr;
|
|
252
|
+
update?: Expr;
|
|
253
|
+
body: Stmt;
|
|
254
|
+
}
|
|
255
|
+
export interface ReturnStmt extends NodeBase {
|
|
256
|
+
kind: "ReturnStmt";
|
|
257
|
+
value?: Expr;
|
|
258
|
+
}
|
|
259
|
+
export interface BreakStmt extends NodeBase {
|
|
260
|
+
kind: "BreakStmt";
|
|
261
|
+
}
|
|
262
|
+
export interface ContinueStmt extends NodeBase {
|
|
263
|
+
kind: "ContinueStmt";
|
|
264
|
+
}
|
|
265
|
+
export interface ExprStmt extends NodeBase {
|
|
266
|
+
kind: "ExprStmt";
|
|
267
|
+
expr: Expr;
|
|
268
|
+
}
|
|
269
|
+
export interface BlockStmt extends NodeBase {
|
|
270
|
+
kind: "BlockStmt";
|
|
271
|
+
statements: Stmt[];
|
|
272
|
+
}
|
|
273
|
+
export interface Program extends NodeBase {
|
|
274
|
+
kind: "Program";
|
|
275
|
+
statements: Stmt[];
|
|
276
|
+
}
|
|
277
|
+
export declare function attachSourceFile(node: any, file: string): void;
|
|
278
|
+
export declare class Parser {
|
|
279
|
+
private readonly tokens;
|
|
280
|
+
private current;
|
|
281
|
+
private readonly file?;
|
|
282
|
+
constructor(tokens: Token[], file?: string);
|
|
283
|
+
parse(): Program;
|
|
284
|
+
private parseDeclaration;
|
|
285
|
+
private parseImportStmt;
|
|
286
|
+
private parseFunctionDecl;
|
|
287
|
+
private parseVarDecl;
|
|
288
|
+
private parseStatement;
|
|
289
|
+
private parseSyncStatement;
|
|
290
|
+
private parseIfStatement;
|
|
291
|
+
private parseWhileStatement;
|
|
292
|
+
private parseForStatement;
|
|
293
|
+
private parseReturnStatement;
|
|
294
|
+
private parseBreakStatement;
|
|
295
|
+
private parseContinueStatement;
|
|
296
|
+
private parseBlockBody;
|
|
297
|
+
private parseExpressionStatement;
|
|
298
|
+
parseExpression(): Expr;
|
|
299
|
+
private parseAssignment;
|
|
300
|
+
private parseLogicalOr;
|
|
301
|
+
private parseLogicalAnd;
|
|
302
|
+
private parseEquality;
|
|
303
|
+
private parseRelational;
|
|
304
|
+
private parseAdditive;
|
|
305
|
+
private parseMultiplicative;
|
|
306
|
+
private parseUnary;
|
|
307
|
+
private parseCallAndIndex;
|
|
308
|
+
private parsePrimary;
|
|
309
|
+
private match;
|
|
310
|
+
private check;
|
|
311
|
+
private advance;
|
|
312
|
+
private isAtEnd;
|
|
313
|
+
private peek;
|
|
314
|
+
private previous;
|
|
315
|
+
private consume;
|
|
316
|
+
private consumeOptionalSemicolon;
|
|
317
|
+
}
|
|
318
|
+
export declare const STDLIB_SOURCE = "# LMScript Standard Library (std.lms)\n\n# String Utilities\nfn is_blank(s) {\n if (s == null) {\n return true;\n }\n return len(trim(s)) == 0;\n}\n\n# Array Utilities\nfn chunk(arr, size) {\n if (size <= 0) {\n return [];\n }\n res = [];\n current = [];\n for (i = 0; i < len(arr); i = i + 1) {\n push(current, arr[i]);\n if (len(current) == size) {\n push(res, current);\n current = [];\n }\n }\n if (len(current) > 0) {\n push(res, current);\n }\n return res;\n}\n\nfn compact(arr) {\n res = [];\n for (i = 0; i < len(arr); i = i + 1) {\n item = arr[i];\n if (item != null) {\n push(res, item);\n }\n }\n return res;\n}\n\nfn zip(arr1, arr2) {\n res = [];\n limit = len(arr1);\n if (len(arr2) < limit) {\n limit = len(arr2);\n }\n for (i = 0; i < limit; i = i + 1) {\n push(res, [arr1[i], arr2[i]]);\n }\n return res;\n}\n\nfn take(arr, n) {\n res = [];\n limit = n;\n if (limit > len(arr)) {\n limit = len(arr);\n }\n for (i = 0; i < limit; i = i + 1) {\n push(res, arr[i]);\n }\n return res;\n}\n\nfn drop(arr, n) {\n res = [];\n start = n;\n if (start < 0) {\n start = 0;\n }\n for (i = start; i < len(arr); i = i + 1) {\n push(res, arr[i]);\n }\n return res;\n}\n\n# Math Utilities\nfn clamp(val, low, high) {\n if (val < low) {\n return low;\n }\n if (val > high) {\n return high;\n }\n return val;\n}\n";
|
|
319
|
+
export declare function getStdlibProgram(): Program;
|
|
320
|
+
export interface CheckOptions {
|
|
321
|
+
/** Inspect literal built-in read paths against the current filesystem. No script evaluation. */
|
|
322
|
+
checkFiles?: boolean;
|
|
323
|
+
/** Pre-defined global variable names available without declaration (e.g. args, ARGV) */
|
|
324
|
+
globals?: string[];
|
|
325
|
+
/** File path of the script being checked/executed */
|
|
326
|
+
file?: string;
|
|
327
|
+
/** Base directory for resolving relative imports (defaults to process.cwd() or path.dirname(file)) */
|
|
328
|
+
baseDir?: string;
|
|
329
|
+
/** Disable implicit standard library inclusion */
|
|
330
|
+
noStdlib?: boolean;
|
|
331
|
+
/** Custom module resolver for virtual files / test isolation */
|
|
332
|
+
moduleResolver?: (specifier: string, fromFile?: string) => {
|
|
333
|
+
path: string;
|
|
334
|
+
source: string;
|
|
335
|
+
};
|
|
336
|
+
/** Custom stderr output writer for runtime error logs */
|
|
337
|
+
stderr?: (text: string) => void;
|
|
338
|
+
}
|
|
339
|
+
export type CompileOptions = CheckOptions;
|
|
340
|
+
export declare function compileProgram(source: string, options?: CompileOptions): {
|
|
341
|
+
program: Program;
|
|
342
|
+
loadedFiles: string[];
|
|
343
|
+
};
|
|
344
|
+
export interface FunctionSignature {
|
|
345
|
+
name: string;
|
|
346
|
+
paramCount: number;
|
|
347
|
+
params: string[];
|
|
348
|
+
isHost: boolean;
|
|
349
|
+
isStdlib?: boolean;
|
|
350
|
+
file?: string;
|
|
351
|
+
line: number;
|
|
352
|
+
column: number;
|
|
353
|
+
}
|
|
354
|
+
export type HostFunctionArity = number | {
|
|
355
|
+
min: number;
|
|
356
|
+
max?: number;
|
|
357
|
+
};
|
|
358
|
+
type CheckableHostFunction = {
|
|
359
|
+
arity?: HostFunctionArity;
|
|
360
|
+
readsFile?: boolean;
|
|
361
|
+
isContainerMutation?: boolean;
|
|
362
|
+
};
|
|
363
|
+
export declare class StaticChecker {
|
|
364
|
+
private diagnostics;
|
|
365
|
+
private readonly hostFunctions;
|
|
366
|
+
private readonly options;
|
|
367
|
+
private readonly functions;
|
|
368
|
+
private currentScope;
|
|
369
|
+
private loopDepth;
|
|
370
|
+
private inFunction;
|
|
371
|
+
hasConcurrency: boolean;
|
|
372
|
+
constructor(hostFunctions: Map<string, CheckableHostFunction>, options?: CheckOptions);
|
|
373
|
+
check(program: Program): Diagnostic[];
|
|
374
|
+
private addError;
|
|
375
|
+
private collectFunction;
|
|
376
|
+
private checkStmt;
|
|
377
|
+
private checkReadPath;
|
|
378
|
+
private checkExpr;
|
|
379
|
+
}
|
|
380
|
+
export declare class ReturnSignal {
|
|
381
|
+
readonly value: any;
|
|
382
|
+
constructor(value: any);
|
|
383
|
+
}
|
|
384
|
+
export declare class BreakSignal {
|
|
385
|
+
}
|
|
386
|
+
export declare class ContinueSignal {
|
|
387
|
+
}
|
|
388
|
+
export declare class Environment {
|
|
389
|
+
private static nextId;
|
|
390
|
+
readonly id: number;
|
|
391
|
+
private readonly values;
|
|
392
|
+
readonly parent?: Environment;
|
|
393
|
+
constructor(parent?: Environment);
|
|
394
|
+
resolveBinding(name: string): {
|
|
395
|
+
env: Environment;
|
|
396
|
+
name: string;
|
|
397
|
+
} | undefined;
|
|
398
|
+
define(name: string, value: any): void;
|
|
399
|
+
get(name: string): any;
|
|
400
|
+
has(name: string): boolean;
|
|
401
|
+
set(name: string, value: any): void;
|
|
402
|
+
}
|
|
403
|
+
export declare class AsyncLock {
|
|
404
|
+
private holderTaskId?;
|
|
405
|
+
private depth;
|
|
406
|
+
private readonly waiters;
|
|
407
|
+
acquire(taskId?: number, timeoutMs?: number): Promise<void>;
|
|
408
|
+
release(): void;
|
|
409
|
+
withLock<T>(action: () => Promise<T>, taskId?: number, timeoutMs?: number): Promise<T>;
|
|
410
|
+
}
|
|
411
|
+
export declare class AsyncLockManager {
|
|
412
|
+
private readonly bindingLocks;
|
|
413
|
+
private readonly objectLocks;
|
|
414
|
+
getBindingLock(bindingKey: string): AsyncLock;
|
|
415
|
+
getObjectLock(target: object): AsyncLock;
|
|
416
|
+
}
|
|
417
|
+
export type HostFunction = (...args: any[]) => any;
|
|
418
|
+
export interface FunctionDoc {
|
|
419
|
+
name: string;
|
|
420
|
+
category: string;
|
|
421
|
+
module?: string;
|
|
422
|
+
signature: string;
|
|
423
|
+
description: string;
|
|
424
|
+
parameters?: Array<{
|
|
425
|
+
name: string;
|
|
426
|
+
type: string;
|
|
427
|
+
description: string;
|
|
428
|
+
}>;
|
|
429
|
+
returns?: {
|
|
430
|
+
type: string;
|
|
431
|
+
description: string;
|
|
432
|
+
};
|
|
433
|
+
example?: string;
|
|
434
|
+
}
|
|
435
|
+
export interface ScriptModule {
|
|
436
|
+
name: string;
|
|
437
|
+
description?: string;
|
|
438
|
+
docs?: FunctionDoc[];
|
|
439
|
+
register?: (engine: LMScript, context?: any) => void;
|
|
440
|
+
}
|
|
441
|
+
export interface HostFunctionMeta {
|
|
442
|
+
fn: HostFunction;
|
|
443
|
+
arity?: HostFunctionArity;
|
|
444
|
+
description?: string;
|
|
445
|
+
readsFile?: boolean;
|
|
446
|
+
isDefault?: boolean;
|
|
447
|
+
isContainerMutation?: boolean;
|
|
448
|
+
doc?: FunctionDoc;
|
|
449
|
+
}
|
|
450
|
+
export declare class Interpreter {
|
|
451
|
+
private globalEnv;
|
|
452
|
+
private readonly userFunctions;
|
|
453
|
+
private readonly hostFunctions;
|
|
454
|
+
private readonly stdout;
|
|
455
|
+
private readonly stderr?;
|
|
456
|
+
private readonly lockManager;
|
|
457
|
+
private readonly isAsync;
|
|
458
|
+
private nextTaskId;
|
|
459
|
+
private readonly initialGlobals?;
|
|
460
|
+
private callDepth;
|
|
461
|
+
private readonly asyncCallDepth;
|
|
462
|
+
private readonly recordedErrors;
|
|
463
|
+
constructor(hostFunctions: Map<string, HostFunctionMeta>, stdout?: (text: string) => void, isAsync?: boolean, initialGlobals?: Map<string, any>, stderr?: (text: string) => void);
|
|
464
|
+
evaluateProgram(program: Program): any;
|
|
465
|
+
private execStmt;
|
|
466
|
+
private evalExpr;
|
|
467
|
+
private isTruthy;
|
|
468
|
+
evaluateProgramAsync(program: Program): Promise<any>;
|
|
469
|
+
private execStmtAsync;
|
|
470
|
+
private evalExprAsync;
|
|
471
|
+
private invokeCallAsync;
|
|
472
|
+
getRecordedErrors(): string[];
|
|
473
|
+
}
|
|
474
|
+
export interface ExecutionResult {
|
|
475
|
+
success: boolean;
|
|
476
|
+
value?: any;
|
|
477
|
+
exitCode?: number;
|
|
478
|
+
diagnostics: Diagnostic[];
|
|
479
|
+
output: string[];
|
|
480
|
+
errors?: string[];
|
|
481
|
+
}
|
|
482
|
+
export declare const LANGUAGE_DOCS: FunctionDoc[];
|
|
483
|
+
export declare const BUILTIN_FUNCTION_DOCS: FunctionDoc[];
|
|
484
|
+
export declare const STDLIB_FUNCTION_DOCS: FunctionDoc[];
|
|
485
|
+
export declare class LMScript {
|
|
486
|
+
private readonly hostFunctions;
|
|
487
|
+
private readonly functionDocs;
|
|
488
|
+
private readonly registeredModules;
|
|
489
|
+
private readonly functionOriginModule;
|
|
490
|
+
private currentRegisteringModule;
|
|
491
|
+
private outputLogs;
|
|
492
|
+
isAsyncMode: boolean;
|
|
493
|
+
constructor();
|
|
494
|
+
private registerDefaultDocs;
|
|
495
|
+
registerFunctionDoc(doc: FunctionDoc): this;
|
|
496
|
+
registerModule(module: ScriptModule, context?: any): this;
|
|
497
|
+
getModules(): ScriptModule[];
|
|
498
|
+
getModule(name: string): ScriptModule | undefined;
|
|
499
|
+
getFunctionsByModule(moduleName: string): FunctionDoc[];
|
|
500
|
+
getFunctionDocs(): FunctionDoc[];
|
|
501
|
+
getFunctionDoc(name: string): FunctionDoc | undefined;
|
|
502
|
+
getFunctionCategories(): string[];
|
|
503
|
+
getFunctionsByCategory(category: string): FunctionDoc[];
|
|
504
|
+
/**
|
|
505
|
+
* Requirement 4: Predefined functions implemented in TypeScript.
|
|
506
|
+
* Includes File I/O, Lists/Arrays, Hashes/Maps, JSON, Shell, and Strings.
|
|
507
|
+
*/
|
|
508
|
+
private registerPredefinedFunctions;
|
|
509
|
+
/**
|
|
510
|
+
* Requirement 5: Register new TypeScript functions into the runtime.
|
|
511
|
+
*/
|
|
512
|
+
registerFunction(name: string, fn: HostFunction, arity?: HostFunctionArity, descriptionOrOptions?: string | {
|
|
513
|
+
description?: string;
|
|
514
|
+
isDefault?: boolean;
|
|
515
|
+
isContainerMutation?: boolean;
|
|
516
|
+
doc?: FunctionDoc;
|
|
517
|
+
allowOverwrite?: boolean;
|
|
518
|
+
module?: string;
|
|
519
|
+
}, isDefault?: boolean, isContainerMutation?: boolean): this;
|
|
520
|
+
getFunctionOriginModule(name: string): string | undefined;
|
|
521
|
+
private readonly initialGlobals;
|
|
522
|
+
setGlobal(name: string, value: any): this;
|
|
523
|
+
getGlobal(name: string): any;
|
|
524
|
+
/**
|
|
525
|
+
* Requirement 2: Scan all and check before execution without generating intermediate files.
|
|
526
|
+
*/
|
|
527
|
+
scanAndCheck(source: string, options?: CompileOptions): {
|
|
528
|
+
ast: Program | null;
|
|
529
|
+
diagnostics: Diagnostic[];
|
|
530
|
+
hasConcurrency: boolean;
|
|
531
|
+
};
|
|
532
|
+
/**
|
|
533
|
+
* Complete execution pipeline:
|
|
534
|
+
* 1. Scans and parses source.
|
|
535
|
+
* 2. Runs static checker upfront.
|
|
536
|
+
* 3. If any static errors are found, aborts immediately WITHOUT executing.
|
|
537
|
+
* 4. If checks pass, executes AST in-memory.
|
|
538
|
+
*/
|
|
539
|
+
run(source: string, options?: CompileOptions): ExecutionResult;
|
|
540
|
+
/**
|
|
541
|
+
* Asynchronous execution pipeline supporting parallel tasks and sync statements.
|
|
542
|
+
*/
|
|
543
|
+
runAsync(source: string, options?: CompileOptions): Promise<ExecutionResult>;
|
|
544
|
+
private lastRecordedErrors;
|
|
545
|
+
getRecordedErrors(): string[];
|
|
546
|
+
hasFunction(name: string): boolean;
|
|
547
|
+
getRegisteredFunctions(): string[];
|
|
548
|
+
}
|
|
549
|
+
export declare function runDemoSuite(): Promise<boolean>;
|
|
550
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export type SubscriptionTier = "free" | "premium" | "admin";
|
|
2
|
+
export interface LocalwebPolicy {
|
|
3
|
+
schema: "localweb.policy.v1";
|
|
4
|
+
policyId: string;
|
|
5
|
+
tier: SubscriptionTier;
|
|
6
|
+
version: number;
|
|
7
|
+
leases: {
|
|
8
|
+
mailboxUrlTtlMs: number;
|
|
9
|
+
refreshBeforeExpiryMs: number;
|
|
10
|
+
};
|
|
11
|
+
polling: {
|
|
12
|
+
notLoggedInMs: number;
|
|
13
|
+
idleForegroundMs: number;
|
|
14
|
+
idleBackgroundMs: number;
|
|
15
|
+
busyMs: number;
|
|
16
|
+
jitterRatio: number;
|
|
17
|
+
};
|
|
18
|
+
heartbeats: {
|
|
19
|
+
browserMs: number;
|
|
20
|
+
appMs: number;
|
|
21
|
+
ttlMs: number;
|
|
22
|
+
};
|
|
23
|
+
limits: {
|
|
24
|
+
enforced: boolean;
|
|
25
|
+
appsPerUser: number;
|
|
26
|
+
activeMinutesPerDay: number;
|
|
27
|
+
activityBucketMs: number;
|
|
28
|
+
maxMailboxGetsPerDay: number;
|
|
29
|
+
maxMailboxPutsPerDay: number;
|
|
30
|
+
maxControlRequestsPerDay: number;
|
|
31
|
+
maxMessagesPerMailbox: number;
|
|
32
|
+
maxMailboxBytes: number;
|
|
33
|
+
maxMessageBytes: number;
|
|
34
|
+
maxProgressPutMs: number;
|
|
35
|
+
};
|
|
36
|
+
overLimit: {
|
|
37
|
+
mode: "slowdown" | "deny_url_refresh" | "deny_requests";
|
|
38
|
+
pollMs: number;
|
|
39
|
+
denyUrlRefresh: boolean;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export interface UsageCounters {
|
|
43
|
+
active: boolean;
|
|
44
|
+
mailboxGets: number;
|
|
45
|
+
mailboxPuts: number;
|
|
46
|
+
controlRequests: number;
|
|
47
|
+
busyMs: number;
|
|
48
|
+
bytesIn: number;
|
|
49
|
+
bytesOut: number;
|
|
50
|
+
}
|
|
51
|
+
export interface UsageSummary {
|
|
52
|
+
date: string;
|
|
53
|
+
activeMinutesToday: number;
|
|
54
|
+
mailboxGetsToday: number;
|
|
55
|
+
mailboxPutsToday: number;
|
|
56
|
+
controlRequestsToday: number;
|
|
57
|
+
busyMsToday: number;
|
|
58
|
+
bytesInToday: number;
|
|
59
|
+
bytesOutToday: number;
|
|
60
|
+
activeMinutesLimit: number;
|
|
61
|
+
mailboxGetsLimit: number;
|
|
62
|
+
mailboxPutsLimit: number;
|
|
63
|
+
controlRequestsLimit: number;
|
|
64
|
+
overLimit: boolean;
|
|
65
|
+
overLimitReasons: string[];
|
|
66
|
+
}
|
|
67
|
+
export interface EffectivePolicy {
|
|
68
|
+
policy: LocalwebPolicy;
|
|
69
|
+
usage: UsageSummary;
|
|
70
|
+
}
|
|
71
|
+
export declare const DEFAULT_USAGE_COUNTERS: UsageCounters;
|
|
72
|
+
export declare function emptyUsageSummary(date: string, policy: LocalwebPolicy): UsageSummary;
|
|
73
|
+
export declare function evaluateUsageLimits(summary: UsageSummary, policy: LocalwebPolicy): UsageSummary;
|
|
74
|
+
export declare function effectiveRetryAfterMs(effective: EffectivePolicy, fallbackMs: number): number;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createDal, Dal } from '../db/index.js';
|
|
2
|
+
export { createDal, Dal, };
|
|
3
|
+
export type { AgentInflightAcquireOptions, AgentInflightAcquireResult, AgentInflightInput, AgentInflightObservedHolder, AgentInflightRow, TerminalLockRecord, TrackedInvocationFinishPatch, TrackedInvocationInput, TrackedInvocationKind, TrackedInvocationListFilter, TrackedInvocationOrigin, TrackedInvocationRow, TrackedInvocationStatus, TrackedInvocationTerminalClaimFilter, WorkflowRow, WorkflowVersionRow, TriggerInstanceRow, TeamRow, TeamMemberRow, ProjectRow, JobRow, RunRow, StepRow, AttentionRow, } from '../db/index.js';
|
|
4
|
+
export interface OpenLmctlStateDbOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Explicit state.db path. When omitted, uses the same resolver as the CLI:
|
|
7
|
+
* db flag equivalent -> LMCTL_DB -> active workspace -> legacy/default db.
|
|
8
|
+
*/
|
|
9
|
+
path?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Open the existing DB read-only and set PRAGMA query_only=ON.
|
|
12
|
+
* Write mode uses the normal migration-backed createDal path.
|
|
13
|
+
*/
|
|
14
|
+
readonly?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface LmctlStateDbHandle {
|
|
17
|
+
path: string;
|
|
18
|
+
readonly: boolean;
|
|
19
|
+
dal: Dal;
|
|
20
|
+
close(): void;
|
|
21
|
+
}
|
|
22
|
+
export declare function resolveLmctlStateDbPath(path?: string): string;
|
|
23
|
+
export declare function openLmctlStateDb(options?: OpenLmctlStateDbOptions): LmctlStateDbHandle;
|
|
24
|
+
export declare function openReadonlyLmctlStateDb(path?: string): LmctlStateDbHandle;
|
|
25
|
+
export declare function createReadonlyDal(path: string): Dal;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { NativePassiveSessionReader, createPassiveSessionReader, } from '../providers/passive-session-reader.js';
|
|
2
|
+
export type { Source, ReadLimits, SourceState, NativeResponseMetadata, Discovery, Snapshot, PassiveSessionReader, PassiveSessionReaderOptions, } from '../providers/passive-session-reader.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { aggregateResultEvents, createStreamJsonProcessor, joinResultTurns, supportsStreamJson, } from '../providers/parsers/stream-json.js';
|
|
2
|
+
export type { AggregatedResultEvents, StreamJsonProcessor, StreamJsonResult, } from '../providers/parsers/stream-json.js';
|
|
3
|
+
export { acpSessionIdFromResponse, acpStopReasonFromResponse, createAcpOutputProcessor, isolateGeminiLatestAgentMessage, supportsAcp, } from '../providers/parsers/acp.js';
|
|
4
|
+
export type { AcpOutputProcessor, AcpOutputProcessorResult, AcpResult, } from '../providers/parsers/acp.js';
|
|
5
|
+
export { buildCodexThreadResumeParams, buildCodexThreadStartParams, buildInitializePayload, classifyCodexErrorDisposition, createCodexAgentAccumulator, createCodexTurnState, flushCodexAgentAccumulator, processCodexAgentNotification, recordCodexErrorNotification, resolveCodexTurnCompletion, } from '../providers/parsers/codex-app-server.js';
|
|
6
|
+
export type { AgentMessageItemState, AgentMessagePhase, CodexAgentAccumulatorState, CodexInitializePayload, CodexItemMismatchInfo, CodexTurnState, } from '../providers/parsers/codex-app-server.js';
|