gnosys 5.9.1 → 5.9.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/dist/cli.js +311 -143
- package/dist/cli.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/archive.d.ts.map +1 -1
- package/dist/lib/archive.js.map +1 -1
- package/dist/lib/bootstrap.d.ts.map +1 -1
- package/dist/lib/chat/index.d.ts.map +1 -1
- package/dist/lib/chat/index.js +5 -0
- package/dist/lib/chat/index.js.map +1 -1
- package/dist/lib/cleanup.d.ts +52 -0
- package/dist/lib/cleanup.d.ts.map +1 -0
- package/dist/lib/cleanup.js +168 -0
- package/dist/lib/cleanup.js.map +1 -0
- package/dist/lib/config.d.ts +7 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +7 -1
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/dashboard.d.ts.map +1 -1
- package/dist/lib/dashboard.js.map +1 -1
- package/dist/lib/db.d.ts +0 -13
- package/dist/lib/db.d.ts.map +1 -1
- package/dist/lib/db.js +0 -31
- package/dist/lib/db.js.map +1 -1
- package/dist/lib/dbSearch.d.ts.map +1 -1
- package/dist/lib/dbSearch.js +0 -1
- package/dist/lib/dbSearch.js.map +1 -1
- package/dist/lib/dream.d.ts.map +1 -1
- package/dist/lib/dream.js +1 -1
- package/dist/lib/dream.js.map +1 -1
- package/dist/lib/export.d.ts.map +1 -1
- package/dist/lib/federated.d.ts.map +1 -1
- package/dist/lib/federated.js +23 -65
- package/dist/lib/federated.js.map +1 -1
- package/dist/lib/hybridSearch.d.ts.map +1 -1
- package/dist/lib/hybridSearch.js.map +1 -1
- package/dist/lib/import.d.ts.map +1 -1
- package/dist/lib/import.js +2 -1
- package/dist/lib/import.js.map +1 -1
- package/dist/lib/lensing.d.ts +0 -9
- package/dist/lib/lensing.d.ts.map +1 -1
- package/dist/lib/lensing.js +0 -15
- package/dist/lib/lensing.js.map +1 -1
- package/dist/lib/maintenance.d.ts.map +1 -1
- package/dist/lib/maintenance.js +0 -39
- package/dist/lib/maintenance.js.map +1 -1
- package/dist/lib/migrate.js.map +1 -1
- package/dist/lib/paths.d.ts +8 -2
- package/dist/lib/paths.d.ts.map +1 -1
- package/dist/lib/paths.js +15 -4
- package/dist/lib/paths.js.map +1 -1
- package/dist/lib/portfolio.d.ts.map +1 -1
- package/dist/lib/portfolio.js +0 -23
- package/dist/lib/portfolio.js.map +1 -1
- package/dist/lib/projectIdentity.d.ts +9 -5
- package/dist/lib/projectIdentity.d.ts.map +1 -1
- package/dist/lib/projectIdentity.js +19 -22
- package/dist/lib/projectIdentity.js.map +1 -1
- package/dist/lib/remoteWizard.d.ts.map +1 -1
- package/dist/lib/remoteWizard.js +112 -52
- package/dist/lib/remoteWizard.js.map +1 -1
- package/dist/lib/rulesGen.d.ts +1 -4
- package/dist/lib/rulesGen.d.ts.map +1 -1
- package/dist/lib/rulesGen.js +2 -10
- package/dist/lib/rulesGen.js.map +1 -1
- package/dist/lib/search.d.ts.map +1 -1
- package/dist/lib/setup/coldStart.d.ts +71 -0
- package/dist/lib/setup/coldStart.d.ts.map +1 -0
- package/dist/lib/setup/coldStart.js +122 -0
- package/dist/lib/setup/coldStart.js.map +1 -0
- package/dist/lib/setup/configSetRender.d.ts +26 -0
- package/dist/lib/setup/configSetRender.d.ts.map +1 -0
- package/dist/lib/setup/configSetRender.js +103 -0
- package/dist/lib/setup/configSetRender.js.map +1 -0
- package/dist/lib/setup/dreamRender.d.ts +44 -0
- package/dist/lib/setup/dreamRender.d.ts.map +1 -0
- package/dist/lib/setup/dreamRender.js +55 -0
- package/dist/lib/setup/dreamRender.js.map +1 -0
- package/dist/lib/setup/modelsRender.d.ts +25 -0
- package/dist/lib/setup/modelsRender.d.ts.map +1 -0
- package/dist/lib/setup/modelsRender.js +33 -0
- package/dist/lib/setup/modelsRender.js.map +1 -0
- package/dist/lib/setup/remoteRender.d.ts +43 -0
- package/dist/lib/setup/remoteRender.d.ts.map +1 -0
- package/dist/lib/setup/remoteRender.js +65 -0
- package/dist/lib/setup/remoteRender.js.map +1 -0
- package/dist/lib/setup/routingRender.d.ts +44 -0
- package/dist/lib/setup/routingRender.d.ts.map +1 -0
- package/dist/lib/setup/routingRender.js +97 -0
- package/dist/lib/setup/routingRender.js.map +1 -0
- package/dist/lib/setup/sections/ides.d.ts +8 -0
- package/dist/lib/setup/sections/ides.d.ts.map +1 -1
- package/dist/lib/setup/sections/ides.js +49 -27
- package/dist/lib/setup/sections/ides.js.map +1 -1
- package/dist/lib/setup/sections/preferences.d.ts +8 -0
- package/dist/lib/setup/sections/preferences.d.ts.map +1 -1
- package/dist/lib/setup/sections/preferences.js +40 -19
- package/dist/lib/setup/sections/preferences.js.map +1 -1
- package/dist/lib/setup/sections/routing.d.ts +0 -1
- package/dist/lib/setup/sections/routing.d.ts.map +1 -1
- package/dist/lib/setup/sections/routing.js +49 -29
- package/dist/lib/setup/sections/routing.js.map +1 -1
- package/dist/lib/setup/summary.d.ts +33 -19
- package/dist/lib/setup/summary.d.ts.map +1 -1
- package/dist/lib/setup/summary.js +135 -105
- package/dist/lib/setup/summary.js.map +1 -1
- package/dist/lib/setup/syncProjectsRender.d.ts +56 -0
- package/dist/lib/setup/syncProjectsRender.d.ts.map +1 -0
- package/dist/lib/setup/syncProjectsRender.js +168 -0
- package/dist/lib/setup/syncProjectsRender.js.map +1 -0
- package/dist/lib/setup/ui/diff.d.ts +19 -0
- package/dist/lib/setup/ui/diff.d.ts.map +1 -0
- package/dist/lib/setup/ui/diff.js +34 -0
- package/dist/lib/setup/ui/diff.js.map +1 -0
- package/dist/lib/setup/ui/footer.d.ts +11 -0
- package/dist/lib/setup/ui/footer.d.ts.map +1 -0
- package/dist/lib/setup/ui/footer.js +21 -0
- package/dist/lib/setup/ui/footer.js.map +1 -0
- package/dist/lib/setup/ui/header.d.ts +24 -0
- package/dist/lib/setup/ui/header.d.ts.map +1 -0
- package/dist/lib/setup/ui/header.js +49 -0
- package/dist/lib/setup/ui/header.js.map +1 -0
- package/dist/lib/setup/ui/index.d.ts +26 -0
- package/dist/lib/setup/ui/index.d.ts.map +1 -0
- package/dist/lib/setup/ui/index.js +18 -0
- package/dist/lib/setup/ui/index.js.map +1 -0
- package/dist/lib/setup/ui/menu.d.ts +27 -0
- package/dist/lib/setup/ui/menu.d.ts.map +1 -0
- package/dist/lib/setup/ui/menu.js +75 -0
- package/dist/lib/setup/ui/menu.js.map +1 -0
- package/dist/lib/setup/ui/panel.d.ts +23 -0
- package/dist/lib/setup/ui/panel.d.ts.map +1 -0
- package/dist/lib/setup/ui/panel.js +53 -0
- package/dist/lib/setup/ui/panel.js.map +1 -0
- package/dist/lib/setup/ui/prompt.d.ts +27 -0
- package/dist/lib/setup/ui/prompt.d.ts.map +1 -0
- package/dist/lib/setup/ui/prompt.js +38 -0
- package/dist/lib/setup/ui/prompt.js.map +1 -0
- package/dist/lib/setup/ui/safePrompt.d.ts +24 -0
- package/dist/lib/setup/ui/safePrompt.d.ts.map +1 -0
- package/dist/lib/setup/ui/safePrompt.js +71 -0
- package/dist/lib/setup/ui/safePrompt.js.map +1 -0
- package/dist/lib/setup/ui/spinner.d.ts +28 -0
- package/dist/lib/setup/ui/spinner.d.ts.map +1 -0
- package/dist/lib/setup/ui/spinner.js +87 -0
- package/dist/lib/setup/ui/spinner.js.map +1 -0
- package/dist/lib/setup/ui/status.d.ts +21 -0
- package/dist/lib/setup/ui/status.d.ts.map +1 -0
- package/dist/lib/setup/ui/status.js +49 -0
- package/dist/lib/setup/ui/status.js.map +1 -0
- package/dist/lib/setup/ui/title.d.ts +14 -0
- package/dist/lib/setup/ui/title.d.ts.map +1 -0
- package/dist/lib/setup/ui/title.js +24 -0
- package/dist/lib/setup/ui/title.js.map +1 -0
- package/dist/lib/setup/ui/tokens.d.ts +66 -0
- package/dist/lib/setup/ui/tokens.d.ts.map +1 -0
- package/dist/lib/setup/ui/tokens.js +87 -0
- package/dist/lib/setup/ui/tokens.js.map +1 -0
- package/dist/lib/setup.d.ts +7 -0
- package/dist/lib/setup.d.ts.map +1 -1
- package/dist/lib/setup.js +204 -230
- package/dist/lib/setup.js.map +1 -1
- package/dist/lib/store.d.ts +0 -4
- package/dist/lib/store.d.ts.map +1 -1
- package/dist/lib/store.js +0 -6
- package/dist/lib/store.js.map +1 -1
- package/dist/lib/tags.d.ts +0 -2
- package/dist/lib/tags.d.ts.map +1 -1
- package/dist/lib/tags.js +0 -10
- package/dist/lib/tags.js.map +1 -1
- package/dist/lib/trace.d.ts.map +1 -1
- package/dist/lib/webIngest.d.ts.map +1 -1
- package/dist/lib/webIngest.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cold-start (linear wizard) rendering helpers — v5.9.3 redesign.
|
|
3
|
+
*
|
|
4
|
+
* These pure render functions replace the bespoke banner/box drawing
|
|
5
|
+
* inside `runSetup()` with the new atom-based layout. They produce
|
|
6
|
+
* strings (no I/O) so they're snapshot-testable.
|
|
7
|
+
*
|
|
8
|
+
* Screens 1.1 (provider), 1.2 (model), 1.3 (key) get their headers
|
|
9
|
+
* here. The actual provider/model pickers stay in `setup.ts` —
|
|
10
|
+
* pickProvider / pickModel are called from multiple paths and were
|
|
11
|
+
* intentionally left untouched per the v5.9.3 brief; the cold-start
|
|
12
|
+
* sub-screen functions wrap the picker invocations with the header
|
|
13
|
+
* chrome.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Splash screen body (Screen 1.0 in the design handoff). The caller
|
|
17
|
+
* follows up with the "press enter to begin" prompt.
|
|
18
|
+
*/
|
|
19
|
+
export declare function renderColdStartSplash(version: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Step header — used as the banner of each cold-start sub-screen
|
|
22
|
+
* (1.1 provider, 1.2 model, 1.3 key, 1.5 done). Renders the breadcrumb
|
|
23
|
+
* with the version on the right plus the "step N of M" mid-line.
|
|
24
|
+
*/
|
|
25
|
+
export declare function renderStepHeader(crumbs: string[], step: number, total: number, version: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Body rows for the "ready" panel on screen 1.5. Exported so the wizard
|
|
28
|
+
* can hand them to Panel() and snapshot tests can verify the rows
|
|
29
|
+
* independently.
|
|
30
|
+
*/
|
|
31
|
+
export declare function renderDonePanelRows(summary: {
|
|
32
|
+
provider: string;
|
|
33
|
+
model: string;
|
|
34
|
+
keySource: string;
|
|
35
|
+
ides: string[];
|
|
36
|
+
dreamEnabled: boolean;
|
|
37
|
+
}): string[];
|
|
38
|
+
/**
|
|
39
|
+
* Screen 1.1 — provider sub-screen header. Renders the breadcrumb +
|
|
40
|
+
* step counter + Title + intro line. The caller follows up with the
|
|
41
|
+
* existing pickProvider() call to print the actual numbered menu.
|
|
42
|
+
*/
|
|
43
|
+
export declare function renderProviderStepHeader(version: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* Screen 1.2 — model sub-screen header. Includes the provider name in
|
|
46
|
+
* the breadcrumb so the user knows which catalog they're picking from.
|
|
47
|
+
*/
|
|
48
|
+
export declare function renderModelStepHeader(provider: string, version: string): string;
|
|
49
|
+
/**
|
|
50
|
+
* Screen 1.3 — API key sub-screen header. Shows the provider name and
|
|
51
|
+
* a one-line subtitle reminding the user that we validate the key
|
|
52
|
+
* before saving.
|
|
53
|
+
*/
|
|
54
|
+
export declare function renderKeyStepHeader(provider: string, version: string): string;
|
|
55
|
+
/**
|
|
56
|
+
* Render the key-source picker rows. Each row has a number, a label, a
|
|
57
|
+
* meta column, and an optional `◂ found` tag when the env var is
|
|
58
|
+
* actually set. Returns the array of lines so the caller can
|
|
59
|
+
* concatenate them around its own prompt.
|
|
60
|
+
*/
|
|
61
|
+
export interface KeySourceRow {
|
|
62
|
+
/** "environment variable" / "macos keychain" / "paste inline" / "skip for now". */
|
|
63
|
+
label: string;
|
|
64
|
+
/** Right-side meta (env var name, "(will store securely)", etc.). */
|
|
65
|
+
meta: string;
|
|
66
|
+
/** When true, append the `◂ found` tag in `ok` color. */
|
|
67
|
+
found?: boolean;
|
|
68
|
+
}
|
|
69
|
+
export declare function renderKeySourceRows(rows: KeySourceRow[]): string[];
|
|
70
|
+
export declare function renderKeyStepFooter(): string;
|
|
71
|
+
//# sourceMappingURL=coldStart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coldStart.d.ts","sourceRoot":"","sources":["../../../src/lib/setup/coldStart.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAiB7D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EAAE,EAChB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GACd,MAAM,CAGR;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;CACvB,GAAG,MAAM,EAAE,CAYX;AAQD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAMhE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAM/E;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAM7E;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,mFAAmF;IACnF,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,MAAM,EAAE,CAWlE;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cold-start (linear wizard) rendering helpers — v5.9.3 redesign.
|
|
3
|
+
*
|
|
4
|
+
* These pure render functions replace the bespoke banner/box drawing
|
|
5
|
+
* inside `runSetup()` with the new atom-based layout. They produce
|
|
6
|
+
* strings (no I/O) so they're snapshot-testable.
|
|
7
|
+
*
|
|
8
|
+
* Screens 1.1 (provider), 1.2 (model), 1.3 (key) get their headers
|
|
9
|
+
* here. The actual provider/model pickers stay in `setup.ts` —
|
|
10
|
+
* pickProvider / pickModel are called from multiple paths and were
|
|
11
|
+
* intentionally left untouched per the v5.9.3 brief; the cold-start
|
|
12
|
+
* sub-screen functions wrap the picker invocations with the header
|
|
13
|
+
* chrome.
|
|
14
|
+
*/
|
|
15
|
+
import { Header } from "./ui/header.js";
|
|
16
|
+
import { Title } from "./ui/title.js";
|
|
17
|
+
import { Footer } from "./ui/footer.js";
|
|
18
|
+
import { c, color, glyph } from "./ui/tokens.js";
|
|
19
|
+
/**
|
|
20
|
+
* Splash screen body (Screen 1.0 in the design handoff). The caller
|
|
21
|
+
* follows up with the "press enter to begin" prompt.
|
|
22
|
+
*/
|
|
23
|
+
export function renderColdStartSplash(version) {
|
|
24
|
+
const v = version.startsWith("v") ? version : `v${version}`;
|
|
25
|
+
const lines = [];
|
|
26
|
+
lines.push(Header(["gnosys", "setup"], { version: v }));
|
|
27
|
+
lines.push("");
|
|
28
|
+
lines.push(Title("Welcome."));
|
|
29
|
+
lines.push("");
|
|
30
|
+
lines.push(" gnosys gives your AI agents persistent memory — a centralized brain");
|
|
31
|
+
lines.push(" they keep across sessions. This wizard takes about 90 seconds.");
|
|
32
|
+
lines.push("");
|
|
33
|
+
lines.push(" step 1 pick a default LLM provider");
|
|
34
|
+
lines.push(" step 2 validate the API key");
|
|
35
|
+
lines.push(" step 3 wire up MCP for detected IDEs");
|
|
36
|
+
lines.push(" step 4 (optional) task routing & dream mode");
|
|
37
|
+
lines.push("");
|
|
38
|
+
lines.push(Footer("^C exits cleanly at any time"));
|
|
39
|
+
return lines.join("\n");
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Step header — used as the banner of each cold-start sub-screen
|
|
43
|
+
* (1.1 provider, 1.2 model, 1.3 key, 1.5 done). Renders the breadcrumb
|
|
44
|
+
* with the version on the right plus the "step N of M" mid-line.
|
|
45
|
+
*/
|
|
46
|
+
export function renderStepHeader(crumbs, step, total, version) {
|
|
47
|
+
const v = version.startsWith("v") ? version : `v${version}`;
|
|
48
|
+
return Header([...crumbs], { version: `step ${step} of ${total} ${v}` });
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Body rows for the "ready" panel on screen 1.5. Exported so the wizard
|
|
52
|
+
* can hand them to Panel() and snapshot tests can verify the rows
|
|
53
|
+
* independently.
|
|
54
|
+
*/
|
|
55
|
+
export function renderDonePanelRows(summary) {
|
|
56
|
+
const idesStr = summary.ides.length === 0 ? "(none)" : summary.ides.join(", ");
|
|
57
|
+
const dreamStr = summary.dreamEnabled
|
|
58
|
+
? "enabled"
|
|
59
|
+
: "disabled · enable later with `gnosys setup`";
|
|
60
|
+
return [
|
|
61
|
+
pad("provider", summary.provider),
|
|
62
|
+
pad("model", summary.model),
|
|
63
|
+
pad("api key", summary.keySource),
|
|
64
|
+
pad("ides", idesStr),
|
|
65
|
+
pad("dream mode", dreamStr),
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
function pad(label, value) {
|
|
69
|
+
return `${label.padEnd(18)}${value}`;
|
|
70
|
+
}
|
|
71
|
+
// ─── Screens 1.1 / 1.2 / 1.3 — sub-screen headers ────────────────────────
|
|
72
|
+
/**
|
|
73
|
+
* Screen 1.1 — provider sub-screen header. Renders the breadcrumb +
|
|
74
|
+
* step counter + Title + intro line. The caller follows up with the
|
|
75
|
+
* existing pickProvider() call to print the actual numbered menu.
|
|
76
|
+
*/
|
|
77
|
+
export function renderProviderStepHeader(version) {
|
|
78
|
+
const lines = [];
|
|
79
|
+
lines.push(renderStepHeader(["gnosys", "setup", "provider"], 1, 4, version));
|
|
80
|
+
lines.push("");
|
|
81
|
+
lines.push(Title("Choose your LLM provider", "prices are per-1M-tokens (input – output)"));
|
|
82
|
+
return lines.join("\n");
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Screen 1.2 — model sub-screen header. Includes the provider name in
|
|
86
|
+
* the breadcrumb so the user knows which catalog they're picking from.
|
|
87
|
+
*/
|
|
88
|
+
export function renderModelStepHeader(provider, version) {
|
|
89
|
+
const lines = [];
|
|
90
|
+
lines.push(renderStepHeader(["gnosys", "setup", "provider", "model"], 2, 4, version));
|
|
91
|
+
lines.push("");
|
|
92
|
+
lines.push(Title(`Choose a model for ${provider}`));
|
|
93
|
+
return lines.join("\n");
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Screen 1.3 — API key sub-screen header. Shows the provider name and
|
|
97
|
+
* a one-line subtitle reminding the user that we validate the key
|
|
98
|
+
* before saving.
|
|
99
|
+
*/
|
|
100
|
+
export function renderKeyStepHeader(provider, version) {
|
|
101
|
+
const lines = [];
|
|
102
|
+
lines.push(renderStepHeader(["gnosys", "setup", "key"], 3, 4, version));
|
|
103
|
+
lines.push("");
|
|
104
|
+
lines.push(Title(`API key for ${provider}`, "we'll validate it before saving anything"));
|
|
105
|
+
return lines.join("\n");
|
|
106
|
+
}
|
|
107
|
+
export function renderKeySourceRows(rows) {
|
|
108
|
+
const labelW = Math.max(...rows.map((r) => r.label.length)) + 2;
|
|
109
|
+
const out = [];
|
|
110
|
+
rows.forEach((r, i) => {
|
|
111
|
+
const num = color(c.textDim, String(i + 1).padStart(2, " "));
|
|
112
|
+
const label = color(c.text, r.label.padEnd(labelW));
|
|
113
|
+
const meta = color(c.textDim, r.meta);
|
|
114
|
+
const tag = r.found ? ` ${color(c.ok, `${glyph.tag} found`)}` : "";
|
|
115
|
+
out.push(` ${num} ${label}${meta}${tag}`);
|
|
116
|
+
});
|
|
117
|
+
return out;
|
|
118
|
+
}
|
|
119
|
+
export function renderKeyStepFooter() {
|
|
120
|
+
return Footer("1–4 · pick b · back");
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=coldStart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coldStart.js","sourceRoot":"","sources":["../../../src/lib/setup/coldStart.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAe;IACnD,MAAM,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,EAAE,CAAC;IAC5D,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACxD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IAC9B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,sEAAsE,CAAC,CAAC;IACnF,KAAK,CAAC,IAAI,CAAC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C,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrE,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,MAAM,KAAK,GAAG,IAAI,GAAG,GAAG,EAAE,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,OAAO,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Known top-level keys accepted by `gnosys config set`. Mirrors the switch
|
|
3
|
+
* cases in cli.ts; keep these in sync when a new branch is added.
|
|
4
|
+
*/
|
|
5
|
+
export declare const KNOWN_CONFIG_KEYS: readonly string[];
|
|
6
|
+
/**
|
|
7
|
+
* Validate a user-supplied config key. Returns the closest known key
|
|
8
|
+
* (by edit distance) when the input doesn't match exactly. The caller
|
|
9
|
+
* uses the suggestion to render a `did you mean X?` hint.
|
|
10
|
+
*/
|
|
11
|
+
export declare function suggestConfigKey(input: string): string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Classify a store path as `project` or `global`. Used to label both the
|
|
14
|
+
* Diff row and the "saved" status line so the user always knows which
|
|
15
|
+
* store was touched.
|
|
16
|
+
*
|
|
17
|
+
* The convention: store paths under `~/.gnosys` (the central user store)
|
|
18
|
+
* count as global; everything else is project-scoped.
|
|
19
|
+
*/
|
|
20
|
+
export declare function classifyStore(storePath: string, homeDir: string): "project" | "global";
|
|
21
|
+
/**
|
|
22
|
+
* Compute the Levenshtein edit distance between two strings. Small inputs
|
|
23
|
+
* only — config keys are at most ~20 chars.
|
|
24
|
+
*/
|
|
25
|
+
export declare function levenshtein(a: string, b: string): number;
|
|
26
|
+
//# sourceMappingURL=configSetRender.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configSetRender.d.ts","sourceRoot":"","sources":["../../../src/lib/setup/configSetRender.ts"],"names":[],"mappings":"AAcA;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAkB9C,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAc7D;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAMtF;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAsBxD"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render helpers for `gnosys config set` (Screen 13).
|
|
3
|
+
*
|
|
4
|
+
* Provides:
|
|
5
|
+
* - Schema/key validation against a known set of config keys
|
|
6
|
+
* - Levenshtein-based "did you mean?" suggestion on typo
|
|
7
|
+
* - Helpers to label the active store as `(project)` or `(global)`
|
|
8
|
+
*
|
|
9
|
+
* Output rendering is deferred to the cli.ts action so we don't drag the
|
|
10
|
+
* full config schema into this module — but the validator and the
|
|
11
|
+
* suggestion logic are pure and snapshot-testable.
|
|
12
|
+
*/
|
|
13
|
+
import path from "path";
|
|
14
|
+
/**
|
|
15
|
+
* Known top-level keys accepted by `gnosys config set`. Mirrors the switch
|
|
16
|
+
* cases in cli.ts; keep these in sync when a new branch is added.
|
|
17
|
+
*/
|
|
18
|
+
export const KNOWN_CONFIG_KEYS = [
|
|
19
|
+
"provider",
|
|
20
|
+
"model",
|
|
21
|
+
"task",
|
|
22
|
+
"ollama-url",
|
|
23
|
+
"ollama-model",
|
|
24
|
+
"anthropic-model",
|
|
25
|
+
"groq-model",
|
|
26
|
+
"openai-model",
|
|
27
|
+
"openai-url",
|
|
28
|
+
"lmstudio-url",
|
|
29
|
+
"lmstudio-model",
|
|
30
|
+
"xai-model",
|
|
31
|
+
"mistral-model",
|
|
32
|
+
"custom-url",
|
|
33
|
+
"custom-model",
|
|
34
|
+
"custom-key",
|
|
35
|
+
"recall",
|
|
36
|
+
];
|
|
37
|
+
/**
|
|
38
|
+
* Validate a user-supplied config key. Returns the closest known key
|
|
39
|
+
* (by edit distance) when the input doesn't match exactly. The caller
|
|
40
|
+
* uses the suggestion to render a `did you mean X?` hint.
|
|
41
|
+
*/
|
|
42
|
+
export function suggestConfigKey(input) {
|
|
43
|
+
if (KNOWN_CONFIG_KEYS.includes(input))
|
|
44
|
+
return null;
|
|
45
|
+
let best = null;
|
|
46
|
+
let bestDist = Infinity;
|
|
47
|
+
for (const candidate of KNOWN_CONFIG_KEYS) {
|
|
48
|
+
const d = levenshtein(input, candidate);
|
|
49
|
+
if (d < bestDist) {
|
|
50
|
+
bestDist = d;
|
|
51
|
+
best = candidate;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// Only suggest when the edit distance is small enough to be plausibly
|
|
55
|
+
// a typo. Anything > 3 is a wild miss — don't suggest.
|
|
56
|
+
return bestDist <= 3 ? best : null;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Classify a store path as `project` or `global`. Used to label both the
|
|
60
|
+
* Diff row and the "saved" status line so the user always knows which
|
|
61
|
+
* store was touched.
|
|
62
|
+
*
|
|
63
|
+
* The convention: store paths under `~/.gnosys` (the central user store)
|
|
64
|
+
* count as global; everything else is project-scoped.
|
|
65
|
+
*/
|
|
66
|
+
export function classifyStore(storePath, homeDir) {
|
|
67
|
+
const globalPath = path.join(homeDir, ".gnosys");
|
|
68
|
+
// Normalize both sides for the comparison so symlinks / trailing slashes
|
|
69
|
+
// don't trip a false negative.
|
|
70
|
+
const norm = path.resolve(storePath);
|
|
71
|
+
return norm === path.resolve(globalPath) ? "global" : "project";
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Compute the Levenshtein edit distance between two strings. Small inputs
|
|
75
|
+
* only — config keys are at most ~20 chars.
|
|
76
|
+
*/
|
|
77
|
+
export function levenshtein(a, b) {
|
|
78
|
+
if (a === b)
|
|
79
|
+
return 0;
|
|
80
|
+
if (a.length === 0)
|
|
81
|
+
return b.length;
|
|
82
|
+
if (b.length === 0)
|
|
83
|
+
return a.length;
|
|
84
|
+
const m = a.length;
|
|
85
|
+
const n = b.length;
|
|
86
|
+
const prev = new Array(n + 1);
|
|
87
|
+
const curr = new Array(n + 1);
|
|
88
|
+
for (let j = 0; j <= n; j++)
|
|
89
|
+
prev[j] = j;
|
|
90
|
+
for (let i = 1; i <= m; i++) {
|
|
91
|
+
curr[0] = i;
|
|
92
|
+
for (let j = 1; j <= n; j++) {
|
|
93
|
+
const cost = a.charCodeAt(i - 1) === b.charCodeAt(j - 1) ? 0 : 1;
|
|
94
|
+
curr[j] = Math.min(curr[j - 1] + 1, // insertion
|
|
95
|
+
prev[j] + 1, // deletion
|
|
96
|
+
prev[j - 1] + cost);
|
|
97
|
+
}
|
|
98
|
+
for (let j = 0; j <= n; j++)
|
|
99
|
+
prev[j] = curr[j];
|
|
100
|
+
}
|
|
101
|
+
return prev[n];
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=configSetRender.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configSetRender.js","sourceRoot":"","sources":["../../../src/lib/setup/configSetRender.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAsB;IAClD,UAAU;IACV,OAAO;IACP,MAAM;IACN,YAAY;IACZ,cAAc;IACd,iBAAiB;IACjB,YAAY;IACZ,cAAc;IACd,YAAY;IACZ,cAAc;IACd,gBAAgB;IAChB,WAAW;IACX,eAAe;IACf,YAAY;IACZ,cAAc;IACd,YAAY;IACZ,QAAQ;CACT,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,IAAI,iBAAiB,CAAC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
|
|
3
|
+
*
|
|
4
|
+
* The wizard runs inside `runDreamSetup` (in `setup.ts`); this module
|
|
5
|
+
* owns only the pure helpers that are easy to snapshot-test:
|
|
6
|
+
*
|
|
7
|
+
* - buildDreamDiffRows: the 4-row before/after summary printed at the
|
|
8
|
+
* end of the three-step flow
|
|
9
|
+
* - renderThresholdsBlock: the static "thresholds + sub-tasks" panel
|
|
10
|
+
* rendered on screen 7.2 with default values inside fake `[N ]`
|
|
11
|
+
* fields
|
|
12
|
+
*/
|
|
13
|
+
export interface DreamDiffRow {
|
|
14
|
+
label: string;
|
|
15
|
+
from: string;
|
|
16
|
+
to: string;
|
|
17
|
+
}
|
|
18
|
+
export interface DreamSettings {
|
|
19
|
+
provider: string;
|
|
20
|
+
model?: string;
|
|
21
|
+
machine: string;
|
|
22
|
+
idleMinutes: number;
|
|
23
|
+
maxRuntimeMinutes: number;
|
|
24
|
+
selfCritique: boolean;
|
|
25
|
+
generateSummaries: boolean;
|
|
26
|
+
discoverRelationships: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Build the four canonical rows for the post-save Diff block. Always
|
|
30
|
+
* emits the same four labels so users have a consistent footprint
|
|
31
|
+
* across machines.
|
|
32
|
+
*/
|
|
33
|
+
export declare function buildDreamDiffRows(prev: Partial<DreamSettings> | null, next: DreamSettings): DreamDiffRow[];
|
|
34
|
+
/**
|
|
35
|
+
* Render the static thresholds/sub-tasks block from screen 7.2. Returns
|
|
36
|
+
* an array of lines (no trailing newline). The wizard prints these
|
|
37
|
+
* before asking for `enter | e`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function renderThresholdsBlock(idleMinutes: number, maxRuntimeMinutes: number, minMemories: number, subs: {
|
|
40
|
+
selfCritique: boolean;
|
|
41
|
+
generateSummaries: boolean;
|
|
42
|
+
discoverRelationships: boolean;
|
|
43
|
+
}): string[];
|
|
44
|
+
//# sourceMappingURL=dreamRender.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dreamRender.d.ts","sourceRoot":"","sources":["../../../src/lib/setup/dreamRender.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI,EAAE,IAAI,EAAE,aAAa,GAAG,YAAY,EAAE,CAiB3G;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,EACnB,iBAAiB,EAAE,MAAM,EACzB,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE;IAAE,YAAY,EAAE,OAAO,CAAC;IAAC,iBAAiB,EAAE,OAAO,CAAC;IAAC,qBAAqB,EAAE,OAAO,CAAA;CAAE,GAC1F,MAAM,EAAE,CAaV"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render helpers for `gnosys setup dream` (Screen 7).
|
|
3
|
+
*
|
|
4
|
+
* The wizard runs inside `runDreamSetup` (in `setup.ts`); this module
|
|
5
|
+
* owns only the pure helpers that are easy to snapshot-test:
|
|
6
|
+
*
|
|
7
|
+
* - buildDreamDiffRows: the 4-row before/after summary printed at the
|
|
8
|
+
* end of the three-step flow
|
|
9
|
+
* - renderThresholdsBlock: the static "thresholds + sub-tasks" panel
|
|
10
|
+
* rendered on screen 7.2 with default values inside fake `[N ]`
|
|
11
|
+
* fields
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Build the four canonical rows for the post-save Diff block. Always
|
|
15
|
+
* emits the same four labels so users have a consistent footprint
|
|
16
|
+
* across machines.
|
|
17
|
+
*/
|
|
18
|
+
export function buildDreamDiffRows(prev, next) {
|
|
19
|
+
const prevProvider = prev?.provider ? `${prev.provider}${prev.model ? " / " + prev.model : ""}` : "—";
|
|
20
|
+
const nextProvider = `${next.provider}${next.model ? " / " + next.model : ""}`;
|
|
21
|
+
return [
|
|
22
|
+
{ label: "provider", from: prevProvider, to: nextProvider },
|
|
23
|
+
{ label: "machine", from: prev?.machine ?? "—", to: next.machine },
|
|
24
|
+
{
|
|
25
|
+
label: "idle threshold",
|
|
26
|
+
from: prev?.idleMinutes !== undefined ? `${prev.idleMinutes} min` : "—",
|
|
27
|
+
to: `${next.idleMinutes} min`,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: "max runtime",
|
|
31
|
+
from: prev?.maxRuntimeMinutes !== undefined ? `${prev.maxRuntimeMinutes} min` : "—",
|
|
32
|
+
to: `${next.maxRuntimeMinutes} min`,
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Render the static thresholds/sub-tasks block from screen 7.2. Returns
|
|
38
|
+
* an array of lines (no trailing newline). The wizard prints these
|
|
39
|
+
* before asking for `enter | e`.
|
|
40
|
+
*/
|
|
41
|
+
export function renderThresholdsBlock(idleMinutes, maxRuntimeMinutes, minMemories, subs) {
|
|
42
|
+
const fmt = (n) => String(n).padEnd(3);
|
|
43
|
+
return [
|
|
44
|
+
` when to run`,
|
|
45
|
+
` idle threshold [${fmt(idleMinutes)}] minutes wait this long before starting`,
|
|
46
|
+
` max runtime [${fmt(maxRuntimeMinutes)}] minutes cap each cycle to avoid runaway`,
|
|
47
|
+
` min memories [${fmt(minMemories)}] only run if there's enough new material`,
|
|
48
|
+
"",
|
|
49
|
+
` what to do`,
|
|
50
|
+
` ${subs.selfCritique ? "✓" : "○"} self-critique review and re-rank existing memories`,
|
|
51
|
+
` ${subs.generateSummaries ? "✓" : "○"} generate summaries produce a "what changed today" digest`,
|
|
52
|
+
` ${subs.discoverRelationships ? "✓" : "○"} discover relationships link related memories explicitly`,
|
|
53
|
+
];
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=dreamRender.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dreamRender.js","sourceRoot":"","sources":["../../../src/lib/setup/dreamRender.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAmBH;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAmC,EAAE,IAAmB;IACzF,MAAM,YAAY,GAAG,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IACtG,MAAM,YAAY,GAAG,GAAG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAC/E,OAAO;QACL,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,YAAY,EAAE;QAC3D,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,IAAI,GAAG,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE;QAClE;YACE,KAAK,EAAE,gBAAgB;YACvB,IAAI,EAAE,IAAI,EAAE,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,WAAW,MAAM,CAAC,CAAC,CAAC,GAAG;YACvE,EAAE,EAAE,GAAG,IAAI,CAAC,WAAW,MAAM;SAC9B;QACD;YACE,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,IAAI,EAAE,iBAAiB,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,iBAAiB,MAAM,CAAC,CAAC,CAAC,GAAG;YACnF,EAAE,EAAE,GAAG,IAAI,CAAC,iBAAiB,MAAM;SACpC;KACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CACnC,WAAmB,EACnB,iBAAyB,EACzB,WAAmB,EACnB,IAA2F;IAE3F,MAAM,GAAG,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACvD,OAAO;QACL,gBAAgB;QAChB,2BAA2B,GAAG,CAAC,WAAW,CAAC,+CAA+C;QAC1F,2BAA2B,GAAG,CAAC,iBAAiB,CAAC,gDAAgD;QACjG,2BAA2B,GAAG,CAAC,WAAW,CAAC,wDAAwD;QACnG,EAAE;QACF,eAAe;QACf,QAAQ,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,8DAA8D;QACnG,QAAQ,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,+DAA+D;QACzG,QAAQ,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,4DAA4D;KAC3G,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render helpers for `gnosys setup models` (Screen 3).
|
|
3
|
+
*
|
|
4
|
+
* Currently only owns the small pre-save diff-row builder. The rest of
|
|
5
|
+
* the screen's chrome (Header, Title, Spinner, Diff, Status) lives in
|
|
6
|
+
* `runModelsSetup` and is composed inline so we don't drag the entire
|
|
7
|
+
* provider/model picker through a render layer it doesn't need.
|
|
8
|
+
*/
|
|
9
|
+
export interface ModelDiffRow {
|
|
10
|
+
label: string;
|
|
11
|
+
from: string;
|
|
12
|
+
to: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Build the Diff rows for the pre-save block. Always returns at least
|
|
16
|
+
* two rows (`provider` + `model`) so the user can see what landed in
|
|
17
|
+
* gnosys.json, even when nothing actually changed.
|
|
18
|
+
*
|
|
19
|
+
* - If the new provider differs from the current one, emit the row.
|
|
20
|
+
* - If the new model differs from the current one, emit the row.
|
|
21
|
+
* - When neither changed, emit two rows showing the (unchanged) values
|
|
22
|
+
* so the diff block isn't empty.
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildModelsDiffRows(currentProvider: string | undefined, currentModel: string | undefined, newProvider: string, newModel: string): ModelDiffRow[];
|
|
25
|
+
//# sourceMappingURL=modelsRender.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modelsRender.d.ts","sourceRoot":"","sources":["../../../src/lib/setup/modelsRender.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,eAAe,EAAE,MAAM,GAAG,SAAS,EACnC,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,GACf,YAAY,EAAE,CAahB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render helpers for `gnosys setup models` (Screen 3).
|
|
3
|
+
*
|
|
4
|
+
* Currently only owns the small pre-save diff-row builder. The rest of
|
|
5
|
+
* the screen's chrome (Header, Title, Spinner, Diff, Status) lives in
|
|
6
|
+
* `runModelsSetup` and is composed inline so we don't drag the entire
|
|
7
|
+
* provider/model picker through a render layer it doesn't need.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Build the Diff rows for the pre-save block. Always returns at least
|
|
11
|
+
* two rows (`provider` + `model`) so the user can see what landed in
|
|
12
|
+
* gnosys.json, even when nothing actually changed.
|
|
13
|
+
*
|
|
14
|
+
* - If the new provider differs from the current one, emit the row.
|
|
15
|
+
* - If the new model differs from the current one, emit the row.
|
|
16
|
+
* - When neither changed, emit two rows showing the (unchanged) values
|
|
17
|
+
* so the diff block isn't empty.
|
|
18
|
+
*/
|
|
19
|
+
export function buildModelsDiffRows(currentProvider, currentModel, newProvider, newModel) {
|
|
20
|
+
const rows = [];
|
|
21
|
+
if (currentProvider && currentProvider !== newProvider) {
|
|
22
|
+
rows.push({ label: "provider", from: currentProvider, to: newProvider });
|
|
23
|
+
}
|
|
24
|
+
if (currentModel && currentModel !== newModel) {
|
|
25
|
+
rows.push({ label: "model", from: currentModel, to: newModel });
|
|
26
|
+
}
|
|
27
|
+
if (rows.length === 0) {
|
|
28
|
+
rows.push({ label: "provider", from: currentProvider ?? "(unset)", to: newProvider });
|
|
29
|
+
rows.push({ label: "model", from: currentModel ?? "(unset)", to: newModel });
|
|
30
|
+
}
|
|
31
|
+
return rows;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=modelsRender.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modelsRender.js","sourceRoot":"","sources":["../../../src/lib/setup/modelsRender.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CACjC,eAAmC,EACnC,YAAgC,EAChC,WAAmB,EACnB,QAAgB;IAEhB,MAAM,IAAI,GAAmB,EAAE,CAAC;IAChC,IAAI,eAAe,IAAI,eAAe,KAAK,WAAW,EAAE,CAAC;QACvD,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,eAAe,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,YAAY,IAAI,YAAY,KAAK,QAAQ,EAAE,CAAC;QAC9C,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IACD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,eAAe,IAAI,SAAS,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;QACtF,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,IAAI,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC/E,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sync mode picked in the hierarchical mode menu. Persisted to the
|
|
3
|
+
* `remote_mode` meta key so other tooling can read it back.
|
|
4
|
+
*/
|
|
5
|
+
export type SyncMode = "read-write" | "pull-only" | "push-only";
|
|
6
|
+
/** Description for each mode — shown as the meta column in the picker. */
|
|
7
|
+
export declare const SYNC_MODE_LABELS: Record<SyncMode, string>;
|
|
8
|
+
/**
|
|
9
|
+
* Render the validation summary as a bullet list of `✓`/`✗` rows.
|
|
10
|
+
*
|
|
11
|
+
* Replaces `showValidationSummary` in the wizard. Each check is one
|
|
12
|
+
* Status() line — easier to scan than the old col-aligned text dump.
|
|
13
|
+
*/
|
|
14
|
+
export interface ValidationSummaryInput {
|
|
15
|
+
pathExists: boolean;
|
|
16
|
+
writable: boolean;
|
|
17
|
+
sqliteCompatible: boolean;
|
|
18
|
+
latencyMs: number | null;
|
|
19
|
+
existing?: {
|
|
20
|
+
found: boolean;
|
|
21
|
+
memoryCount: number | null;
|
|
22
|
+
lastModified: string | null;
|
|
23
|
+
};
|
|
24
|
+
warnings: string[];
|
|
25
|
+
errors: string[];
|
|
26
|
+
}
|
|
27
|
+
export declare function renderValidationSummary(v: ValidationSummaryInput): string;
|
|
28
|
+
/**
|
|
29
|
+
* Render the leading Header + current-status line for the remote wizard.
|
|
30
|
+
* Returns a multi-line string the wizard can print as-is.
|
|
31
|
+
*/
|
|
32
|
+
export declare function renderRemoteIntro(localActive: number, localArchived: number, currentRemote: string | null): string;
|
|
33
|
+
/**
|
|
34
|
+
* Render the final Diff block summarizing what changed at the end of
|
|
35
|
+
* the wizard run.
|
|
36
|
+
*/
|
|
37
|
+
export interface RemoteDiffInput {
|
|
38
|
+
previousRemote: string | null;
|
|
39
|
+
newRemote: string;
|
|
40
|
+
mode: SyncMode;
|
|
41
|
+
}
|
|
42
|
+
export declare function renderRemoteDiff(d: RemoteDiffInput): string;
|
|
43
|
+
//# sourceMappingURL=remoteRender.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remoteRender.d.ts","sourceRoot":"","sources":["../../../src/lib/setup/remoteRender.ts"],"names":[],"mappings":"AAYA;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,WAAW,GAAG,WAAW,CAAC;AAEhE,0EAA0E;AAC1E,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAIrD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,CAAC,EAAE;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IACvF,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,sBAAsB,GAAG,MAAM,CAgBzE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,GAAG,IAAI,GAC3B,MAAM,CAWR;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,eAAe,GAAG,MAAM,CAW3D"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render helpers for `gnosys setup remote` (Screen 6).
|
|
3
|
+
*
|
|
4
|
+
* The wizard's flow is in `lib/remoteWizard.ts`; this module owns only
|
|
5
|
+
* the pure render functions and the sync-mode picker payload so the
|
|
6
|
+
* layout can be snapshot-tested without spinning up an interactive
|
|
7
|
+
* readline.
|
|
8
|
+
*/
|
|
9
|
+
import { c, color, glyph } from "./ui/tokens.js";
|
|
10
|
+
import { Header } from "./ui/header.js";
|
|
11
|
+
import { Status } from "./ui/status.js";
|
|
12
|
+
/** Description for each mode — shown as the meta column in the picker. */
|
|
13
|
+
export const SYNC_MODE_LABELS = {
|
|
14
|
+
"read-write": "this machine reads and writes",
|
|
15
|
+
"pull-only": "read remote, never write",
|
|
16
|
+
"push-only": "write to remote, never read locally",
|
|
17
|
+
};
|
|
18
|
+
export function renderValidationSummary(v) {
|
|
19
|
+
const lines = [];
|
|
20
|
+
lines.push(Status(v.pathExists ? "ok" : "fail", "path exists"));
|
|
21
|
+
lines.push(Status(v.writable ? "ok" : "fail", "writable"));
|
|
22
|
+
lines.push(Status(v.sqliteCompatible ? "ok" : "fail", "sqlite compatible"));
|
|
23
|
+
if (v.latencyMs !== null) {
|
|
24
|
+
lines.push(Status("ok", "latency", `${v.latencyMs} ms`));
|
|
25
|
+
}
|
|
26
|
+
if (v.existing?.found) {
|
|
27
|
+
const date = v.existing.lastModified ? v.existing.lastModified.split("T")[0] : "unknown";
|
|
28
|
+
const count = v.existing.memoryCount ?? "?";
|
|
29
|
+
lines.push(Status("ok", "found existing remote", `${count} memories · last write ${date}`));
|
|
30
|
+
}
|
|
31
|
+
for (const w of v.warnings)
|
|
32
|
+
lines.push(Status("warn", w));
|
|
33
|
+
for (const e of v.errors)
|
|
34
|
+
lines.push(Status("fail", e));
|
|
35
|
+
return lines.join("\n");
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Render the leading Header + current-status line for the remote wizard.
|
|
39
|
+
* Returns a multi-line string the wizard can print as-is.
|
|
40
|
+
*/
|
|
41
|
+
export function renderRemoteIntro(localActive, localArchived, currentRemote) {
|
|
42
|
+
const lines = [];
|
|
43
|
+
lines.push(Header(["gnosys", "setup", "remote"]));
|
|
44
|
+
lines.push("");
|
|
45
|
+
lines.push(` ${color(c.text, "Multi-machine sync")}`);
|
|
46
|
+
lines.push(` ${color(c.textDim, "share your memory store across machines via a path on a NAS, iCloud, Dropbox, etc.")}`);
|
|
47
|
+
lines.push("");
|
|
48
|
+
const remoteTxt = currentRemote ?? "not configured";
|
|
49
|
+
lines.push(` ${color(c.textDim, "local DB")} ${color(c.text, `~/.gnosys/gnosys.db (${localActive} active, ${localArchived} archived)`)}`);
|
|
50
|
+
lines.push(` ${color(c.textDim, "current")} ${color(c.text, remoteTxt)}`);
|
|
51
|
+
return lines.join("\n");
|
|
52
|
+
}
|
|
53
|
+
export function renderRemoteDiff(d) {
|
|
54
|
+
const lines = [];
|
|
55
|
+
const indent = " ";
|
|
56
|
+
const arrow = color(c.textGhost, glyph.arrow);
|
|
57
|
+
const fromR = color(c.textMid, (d.previousRemote ?? "not configured").padEnd(20));
|
|
58
|
+
const labelR = color(c.textDim, "remote".padEnd(8));
|
|
59
|
+
lines.push(`${indent}${labelR} ${fromR} ${arrow} ${color(c.accentHi, d.newRemote)}`);
|
|
60
|
+
const labelM = color(c.textDim, "mode".padEnd(8));
|
|
61
|
+
const fromM = color(c.textMid, "—".padEnd(20));
|
|
62
|
+
lines.push(`${indent}${labelM} ${fromM} ${arrow} ${color(c.accentHi, d.mode)}`);
|
|
63
|
+
return lines.join("\n");
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=remoteRender.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remoteRender.js","sourceRoot":"","sources":["../../../src/lib/setup/remoteRender.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAQxC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,gBAAgB,GAA6B;IACxD,YAAY,EAAE,+BAA+B;IAC7C,WAAW,EAAE,0BAA0B;IACvC,WAAW,EAAE,qCAAqC;CACnD,CAAC;AAkBF,MAAM,UAAU,uBAAuB,CAAC,CAAyB;IAC/D,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC;IAChE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;IAC3D,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC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