@spader/dotllm 1.1.0 → 1.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spader/dotllm",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "A simple CLI to clone, manage, and link repositories for LLM reference",
5
5
  "type": "module",
6
6
  "repository": {
@@ -4,8 +4,9 @@ import fs from "fs";
4
4
  import path from "path";
5
5
  import * as prompts from "@clack/prompts";
6
6
  import { z } from "zod";
7
- import { add, Config } from "@spader/dotllm/core";
7
+ import { add, Config, sync } from "@spader/dotllm/core";
8
8
  import { defaultTheme as t } from "@spader/dotllm/cli/theme";
9
+ import { Prompt } from "@spader/dotllm/cli/prompt";
9
10
  var RepoShape = z.object({
10
11
  description: z.string().nullable().optional()
11
12
  });
@@ -126,7 +127,7 @@ function autoLink(name) {
126
127
  if (!repo)
127
128
  return;
128
129
  Config.Local.write(Config.Local.add(local, repo));
129
- prompts.log.step(`linked ${t.primary(name)}`);
130
+ Prompt.sync(sync());
130
131
  }
131
132
  async function run(uri, name, description) {
132
133
  const spinner2 = prompts.spinner();
@@ -3,18 +3,7 @@
3
3
  import * as prompts from "@clack/prompts";
4
4
  import { Config, link, unlink, sync } from "@spader/dotllm/core";
5
5
  import { defaultTheme as t } from "@spader/dotllm/cli/theme";
6
- function printResult(result) {
7
- const parts = [];
8
- if (result.linked.length > 0)
9
- parts.push(`${result.linked.length} added`);
10
- if (result.removed.length > 0)
11
- parts.push(`${result.removed.length} removed`);
12
- if (result.unchanged.length > 0)
13
- parts.push(`${result.unchanged.length} unchanged`);
14
- if (parts.length === 0)
15
- return;
16
- prompts.log.step(parts.join(", "));
17
- }
6
+ import { Prompt } from "@spader/dotllm/cli/prompt";
18
7
  var command = {
19
8
  description: "Interactively pick repos to link into .llm/reference/, or add/remove one by name",
20
9
  summary: "Link references",
@@ -55,7 +44,7 @@ var command = {
55
44
  }
56
45
  const local2 = Config.Local.read();
57
46
  Config.Local.write(Config.Local.add(local2, repo));
58
- printResult(sync());
47
+ Prompt.sync(sync());
59
48
  return;
60
49
  }
61
50
  const global = Config.Global.read();
@@ -81,7 +70,7 @@ var command = {
81
70
  return;
82
71
  }
83
72
  const names = Array.isArray(selected) ? selected.filter((value) => typeof value === "string") : [];
84
- printResult(link(names));
73
+ Prompt.sync(link(names));
85
74
  }
86
75
  };
87
76
  export {
@@ -3,6 +3,7 @@
3
3
  import * as prompts from "@clack/prompts";
4
4
  import { pull, sync } from "@spader/dotllm/core";
5
5
  import { defaultTheme as t } from "@spader/dotllm/cli/theme";
6
+ import { Prompt } from "@spader/dotllm/cli/prompt";
6
7
  var command = {
7
8
  description: "Re-create symlinks from .llm/dotllm.json",
8
9
  summary: "Sync symlinks from local config",
@@ -14,17 +15,7 @@ var command = {
14
15
  console.log(t.dim("use `dotllm link` to select repos"));
15
16
  return;
16
17
  }
17
- const parts = [];
18
- if (result.linked.length > 0)
19
- parts.push(`${result.linked.length} added`);
20
- if (result.removed.length > 0)
21
- parts.push(`${result.removed.length} removed`);
22
- if (result.unchanged.length > 0)
23
- parts.push(`${result.unchanged.length} unchanged`);
24
- if (result.missing.length > 0)
25
- parts.push(`${result.missing.length} missing`);
26
- if (parts.length > 0)
27
- prompts.log.step(parts.join(", "));
18
+ Prompt.sync(result);
28
19
  const refs = [...new Set([...result.unchanged, ...result.linked])];
29
20
  if (refs.length === 0) {
30
21
  return;
@@ -0,0 +1,23 @@
1
+ // @bun
2
+ // src/cli/prompt.ts
3
+ import * as prompts from "@clack/prompts";
4
+ var Prompt;
5
+ ((Prompt) => {
6
+ function sync(result) {
7
+ const parts = [];
8
+ if (result.linked.length > 0)
9
+ parts.push(`${result.linked.length} added`);
10
+ if (result.removed.length > 0)
11
+ parts.push(`${result.removed.length} removed`);
12
+ if (result.unchanged.length > 0)
13
+ parts.push(`${result.unchanged.length} unchanged`);
14
+ if (result.missing.length > 0)
15
+ parts.push(`${result.missing.length} missing`);
16
+ if (parts.length > 0)
17
+ prompts.log.step(parts.join(", "));
18
+ }
19
+ Prompt.sync = sync;
20
+ })(Prompt ||= {});
21
+ export {
22
+ Prompt
23
+ };