leglas 0.1.1 → 0.3.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.
@@ -0,0 +1,19 @@
1
+ import { type Renames } from "@leglas/server";
2
+ export type Resolved = {
3
+ ok: true;
4
+ title: string;
5
+ } | {
6
+ ok: false;
7
+ error: string;
8
+ };
9
+ /**
10
+ * Resolve a name a command was given, and say something useful when it cannot.
11
+ *
12
+ * The message matters more than usual here. A direction renamed in the rail is
13
+ * only renamed on this machine, so the name a user says is often not the name
14
+ * the config spells; that gap is covered by resolving through the rename map.
15
+ * What is left is a name nothing answers to, where the old message ("run
16
+ * leglas list") sent an agent to a listing that would not contain the name
17
+ * either, and the second miss reads as "the direction is gone".
18
+ */
19
+ export declare function resolveOrExplain(input: string, titles: readonly string[], renames: Renames): Resolved;
@@ -2,16 +2,17 @@ export type ExploreDeps = {
2
2
  log(line: string): void;
3
3
  };
4
4
  /**
5
- * Hand an agent several genuinely different angles at once.
5
+ * Brief an agent's exploration.
6
6
  *
7
- * Leglas runs no model, so orchestration here means divergence pressure rather
8
- * than inference: the value added over "give me six variants" is that the six
9
- * are told to disagree, and told which obvious reading would make them
10
- * converge.
7
+ * Leglas runs no model, and it hands out no taste either: the agent has the
8
+ * product, the surface and the design system in context, which is where taste
9
+ * comes from. This prints the part the agent cannot know: how a set registers
10
+ * and displays here, what the set is for, and how sets fail.
11
11
  */
12
12
  export declare function runExplore(options: {
13
13
  surface: string;
14
14
  count: number;
15
+ basedOn: string | null;
15
16
  json: boolean;
16
17
  }, deps: ExploreDeps): {
17
18
  exitCode: number;
@@ -0,0 +1,18 @@
1
+ export type ShowDeps = {
2
+ log(line: string): void;
3
+ error(line: string): void;
4
+ };
5
+ /**
6
+ * Answer for one direction, for whoever was handed its reference block.
7
+ *
8
+ * Addressing is by config title, which is what every other command takes and
9
+ * what the block quotes, so a renamed direction is still reachable by the name
10
+ * the project knows it by.
11
+ */
12
+ export declare function runShow(options: {
13
+ title: string;
14
+ json: boolean;
15
+ cwd: string;
16
+ }, deps: ShowDeps): Promise<{
17
+ exitCode: number;
18
+ }>;
@@ -0,0 +1,23 @@
1
+ export type WatchDeps = {
2
+ log(line: string): void;
3
+ error(line: string): void;
4
+ };
5
+ /**
6
+ * Hand change requests to the user's own agent as they arrive.
7
+ *
8
+ * This is the whole live loop: the interface writes a request, watch picks it
9
+ * up, the user's agent does the work with the user's keys and the user's model.
10
+ * Leglas still runs no model of its own. What it adds is locality, so asking
11
+ * for a change no longer means leaving the comparison for a terminal.
12
+ *
13
+ * Resolves when the watcher stops, which is what a signal does, so the caller
14
+ * stays the same shape as every other command.
15
+ */
16
+ export declare function runWatch(options: {
17
+ run: string | undefined;
18
+ port: number | undefined;
19
+ cwd: string;
20
+ signal?: AbortSignal;
21
+ }, deps: WatchDeps): Promise<{
22
+ exitCode: number;
23
+ }>;