@lmctl-ai/lmctl 0.2.25 → 0.2.27

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.
@@ -0,0 +1,16 @@
1
+ import type { CliIo } from './common.js';
2
+ /** Lazy readline setup: complete inputs never open/consume stdin. */
3
+ export declare class IntentInput {
4
+ private io;
5
+ private override?;
6
+ private rl?;
7
+ private queue;
8
+ private waiters;
9
+ private ended;
10
+ constructor(io: CliIo, override?: ((question: string) => Promise<string | null>) | undefined);
11
+ get interactive(): boolean;
12
+ ask(question: string): Promise<string>;
13
+ confirm(question: string): Promise<boolean>;
14
+ choose(question: string, options: string[], requireChoice?: boolean): Promise<string>;
15
+ close(): void;
16
+ }
@@ -0,0 +1,26 @@
1
+ export declare function isSentence(value: string): boolean;
2
+ export type InputShape = {
3
+ kind: 'team';
4
+ file: string;
5
+ alias?: string;
6
+ prompt?: string;
7
+ pendingPrompt?: string;
8
+ } | {
9
+ kind: 'batch';
10
+ file: string;
11
+ rest: string[];
12
+ } | {
13
+ kind: 'session';
14
+ id: string;
15
+ prompt?: string;
16
+ pendingPrompt?: string;
17
+ } | {
18
+ kind: 'models';
19
+ query: string;
20
+ prompt?: string;
21
+ pendingPrompt?: string;
22
+ };
23
+ /** Arguments after the target are data. No spelling distance or AI guessing. */
24
+ export declare function classifyPartialInput(args: string[]): InputShape | null;
25
+ /** Exact spelling (case-insensitive) wins over deterministic prefixes. */
26
+ export declare function matchNames(query: string, names: string[]): string[];
@@ -0,0 +1,24 @@
1
+ import { type MemberConfig } from '../providers/config/team-config.js';
2
+ import { type CliIo } from './common.js';
3
+ export interface SessionRef {
4
+ file: string;
5
+ member: MemberConfig;
6
+ }
7
+ export interface SessionRow {
8
+ file?: string;
9
+ alias?: string;
10
+ sessiondir?: string;
11
+ sessionid: string | null;
12
+ provider: string;
13
+ model: string | null;
14
+ running: string;
15
+ ageMs: number | null;
16
+ context: number | null;
17
+ }
18
+ export declare function registeredSessions(id: string, io: CliIo): Promise<SessionRef[]>;
19
+ export declare function summarizeSession(provider: string, id: string): Promise<SessionRow>;
20
+ export declare function teamSessionRows(file: string, io: CliIo, alias?: string): Promise<SessionRow[]>;
21
+ export declare function printSessionRows(rows: SessionRow[], io: CliIo): void;
22
+ export declare function refreshCandidate(row: SessionRow): boolean;
23
+ /** Called only after interactive confirmation. The normal lease excludes prompts. */
24
+ export declare function replaceSession(file: string, alias: string, sessionid: string, io: CliIo): Promise<number>;
@@ -0,0 +1,17 @@
1
+ import { knownModelNames } from './model.js';
2
+ import { runLint, runSeed } from './teamfile-compat.js';
3
+ import { type CliIo } from './common.js';
4
+ import { IntentInput } from './intent-input.js';
5
+ export declare const PROVIDER_NAMES: string[];
6
+ export declare function field(line: string, key: string): string | undefined;
7
+ export declare function setField(line: string, key: string, value: string): string;
8
+ export interface TeamIntentDeps {
9
+ models?: typeof knownModelNames;
10
+ lint?: typeof runLint;
11
+ seed?: typeof runSeed;
12
+ }
13
+ export declare function completeTeamfile(file: string, input: IntentInput, io: CliIo, deps?: TeamIntentDeps, initialAlias?: string): Promise<void>;
14
+ export declare function prepareTeam(file: string, input: IntentInput, io: CliIo, deps?: TeamIntentDeps, initialAlias?: string): Promise<number>;
15
+ export declare function chooseTeamfile(input: IntentInput, cwd: string): Promise<string>;
16
+ export declare function chooseMember(file: string, requested: string | undefined, input: IntentInput): Promise<string>;
17
+ export declare function adoptSession(id: string, provider: string, model: string | null, cwd: string, input: IntentInput, io: CliIo, sessiondir?: string): Promise<void>;
@@ -0,0 +1,24 @@
1
+ import type { CliIo } from './common.js';
2
+ import { runModel } from './model.js';
3
+ import { runChat } from './chat.js';
4
+ import { runBatch } from './batch.js';
5
+ import { runScriptEngine } from '../script/adapter.js';
6
+ import { findSessionProviders } from '../providers/resume.js';
7
+ import { type TeamIntentDeps } from './intent-team.js';
8
+ import { registeredSessions, teamSessionRows, summarizeSession, replaceSession } from './intent-sessions.js';
9
+ export interface IntentDeps extends TeamIntentDeps {
10
+ ask?: (question: string) => Promise<string | null>;
11
+ chat?: typeof runChat;
12
+ batch?: typeof runBatch;
13
+ model?: typeof runModel;
14
+ script?: typeof runScriptEngine;
15
+ registrations?: typeof registeredSessions;
16
+ findProviders?: typeof findSessionProviders;
17
+ rows?: typeof teamSessionRows;
18
+ summary?: typeof summarizeSession;
19
+ refresh?: typeof replaceSession;
20
+ }
21
+ export declare function sendInferredPrompt(target: string[], prompt: string, io: CliIo, deps?: IntentDeps): Promise<number>;
22
+ export declare function runInferredBatch(file: string, rest: string[], io: CliIo, deps?: IntentDeps): Promise<number>;
23
+ /** null leaves an unrecognized word to the original unknown-command diagnostic. */
24
+ export declare function runInferred(args: string[], io: CliIo, deps?: IntentDeps): Promise<number | null>;
@@ -1,7 +1,7 @@
1
1
  import { type CliIo } from './common.js';
2
2
  import { type CatalogSnapshot } from '../providers/pricing.js';
3
3
  export declare const MODEL_PROVIDERS: readonly ["codex", "agy", "claude", "kimi"];
4
- type ModelProvider = typeof MODEL_PROVIDERS[number];
4
+ type ModelProvider = string;
5
5
  interface ModelList {
6
6
  available: boolean;
7
7
  models: string[];
@@ -9,7 +9,13 @@ interface ModelList {
9
9
  }
10
10
  interface ModelDeps {
11
11
  loadSnapshot?: () => Promise<CatalogSnapshot>;
12
+ selections?: Array<{
13
+ provider: string;
14
+ models?: string[];
15
+ }>;
12
16
  loadModels?: (provider: ModelProvider, snapshot: CatalogSnapshot) => ModelList | Promise<ModelList>;
13
17
  }
18
+ /** Shared inventory for deterministic target matching; never sends a prompt. */
19
+ export declare function knownModelNames(provider: string): Promise<string[]>;
14
20
  export declare function runModel(args: string[], io: CliIo, deps?: ModelDeps): Promise<number>;
15
21
  export {};
@@ -1,12 +1,3 @@
1
- /**
2
- * `lmctl plan` — flags-first, wizard-fallback teamfile generator.
3
- *
4
- * Every wizard question has a flag; the wizard fires only when no config
5
- * flags are present AND stdin is a TTY (`--wizard` forces it,
6
- * `--non-interactive` suppresses it with a missing-params error). Session
7
- * ids are never generated here — seeding is `lmctl seed`'s job, chained via
8
- * `--seed` (lint first, refuse to seed when lint fails).
9
- */
10
1
  import type { loadModelSuggestions } from '../providers/model-suggestions.js';
11
2
  import type { CliIo } from './common.js';
12
3
  /** Test seams — fetch for --from URLs, model suggestions + editor for the wizard. */