glimmervoid 0.38.2 → 0.40.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/README.md +1 -1
- package/dist/bin/glimmervoid.js +33 -42
- package/dist/chunks/{adapters-CAHxZYT3.js → adapters-B6tbX3Aj.js} +27 -14
- package/dist/chunks/{adapters-DDjC7_vG.js → adapters-CXQfLoyj.js} +1 -1
- package/dist/chunks/agent-api-cli-BBech5lF.js +1 -0
- package/dist/chunks/{agent-api-cli-B5Tm0wXO.js → agent-api-cli-BNHJTmNW.js} +44 -77
- package/dist/chunks/agent-api-core-DDrJQEdE.js +304 -0
- package/dist/chunks/{agent-setup-cli-DmMfCw5O.js → agent-setup-cli-CeBBwKuL.js} +2 -2
- package/dist/chunks/config-store-BZpN2djp.js +1 -0
- package/dist/chunks/{config-store-BUNZs4j7.js → config-store-DqMScSdg.js} +82 -268
- package/dist/chunks/contracts-CloExMlS.js +680 -0
- package/dist/chunks/{contracts-HVCEJfxs.js → control-messages-DpBaniJi.js} +1275 -1021
- package/dist/chunks/{git-version-rWZjF2Px.js → git-version-CJQMfxtZ.js} +2 -2
- package/dist/chunks/{grok-B6bsCgdd.js → grok-BLzhApwT.js} +7 -8
- package/dist/chunks/{guardrails-deps-Cb-ki4EU.js → guardrails-deps-CLxK4J-g.js} +1 -1
- package/dist/chunks/{json-file-CIJf0Cel.js → json-file-DFCTvPjj.js} +3 -7
- package/dist/chunks/{main-BNSbP-Yk.js → main-DDU8IvFD.js} +28791 -31978
- package/dist/chunks/{pair-cli-DNp8i5L4.js → pair-cli-CsOVTQGJ.js} +2 -2
- package/dist/chunks/{remote-config-C_s2pnLC.js → remote-config-HlABuLTp.js} +2 -2
- package/dist/chunks/{session-BlT68ppa.js → session-BwB43SCa.js} +119 -71
- package/dist/chunks/{session-routes-CT1JrjoT.js → session-routes-DNJzsckH.js} +25 -10
- package/dist/chunks/{settings-cli-BbzxCyG5.js → settings-cli-DkkbK-dj.js} +30 -156
- package/dist/chunks/settings-readout-core-DrXT4aWm.js +201 -0
- package/dist/chunks/{ssh-sign-cli-C74BGTQS.js → ssh-sign-cli-CYeKRevK.js} +2 -2
- package/dist/client/assets/index-BK9jLR47.js +148 -0
- package/dist/client/assets/index-CU_uqJmi.css +2 -0
- package/dist/client/assets/xterm-kR64YvZ-.js +79 -0
- package/dist/client/assets/zod-BRLv4KqJ.js +55 -0
- package/dist/client/index.html +7 -3
- package/dist/scripts/postinstall-path-check.js +21 -3
- package/dist/server/index.js +1 -1
- package/package.json +3 -4
- package/dist/chunks/agent-api-cli-BDu1CxZf.js +0 -1
- package/dist/chunks/agent-api-core-B_mUSenR.js +0 -341
- package/dist/chunks/browser-config-BrBT8269.js +0 -762
- package/dist/chunks/config-CjawSOBk.js +0 -219
- package/dist/chunks/config-store-MAVQhGMh.js +0 -1
- package/dist/chunks/factory-D7ryES9n.js +0 -240
- package/dist/chunks/knowledge-graph-cli-ByUJoKw_.js +0 -1354
- package/dist/client/assets/index-B5uVtedd.css +0 -1
- package/dist/client/assets/index-b13-NGGS.js +0 -275
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { l as AgentSettingsRequest } from "./session-BwB43SCa.js";
|
|
2
|
+
import { t as renderTable } from "./ascii-figure-core-pDAwtlKO.js";
|
|
3
|
+
import { A as settingsOf, M as FILE_ONLY_GROUPS, N as SETTINGS_REGISTRY, S as cloneValue, T as hasScaledUnit, X as readEnvSecrets, j as valueAtPath, k as settingsGroupOf, w as displayText, x as SETTINGS_INDEX } from "./config-store-DqMScSdg.js";
|
|
4
|
+
import { parseArgs } from "node:util";
|
|
5
|
+
//#region server/core/settings-readout-core.ts
|
|
6
|
+
var VALUE_COLUMN_WIDTH = 40;
|
|
7
|
+
var SECTION_BY_SETTING_ID = new Map([...SETTINGS_REGISTRY.sections.flatMap((section) => section.settings.map((setting) => [setting.id, {
|
|
8
|
+
id: section.id,
|
|
9
|
+
title: section.title
|
|
10
|
+
}])), ...SETTINGS_REGISTRY.fileOnly.map((setting) => {
|
|
11
|
+
const groupId = setting.group ?? "";
|
|
12
|
+
return [setting.id, {
|
|
13
|
+
id: groupId,
|
|
14
|
+
title: settingsGroupOf(groupId)?.title ?? groupId
|
|
15
|
+
}];
|
|
16
|
+
})]);
|
|
17
|
+
var ALL_SETTINGS = [...settingsOf(SETTINGS_REGISTRY.sections), ...SETTINGS_REGISTRY.fileOnly];
|
|
18
|
+
var SECTION_ORDER = [...SETTINGS_REGISTRY.sections.map((section) => ({
|
|
19
|
+
id: section.id,
|
|
20
|
+
title: section.title
|
|
21
|
+
})), ...Object.entries(FILE_ONLY_GROUPS).map(([id, group]) => ({
|
|
22
|
+
id,
|
|
23
|
+
title: group.title
|
|
24
|
+
}))];
|
|
25
|
+
function fail(message) {
|
|
26
|
+
return {
|
|
27
|
+
ok: false,
|
|
28
|
+
message
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function succeed(value) {
|
|
32
|
+
return {
|
|
33
|
+
ok: true,
|
|
34
|
+
value
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function isConfigFileSetting(setting) {
|
|
38
|
+
return setting.scope === "machine" && setting.control !== "readonly";
|
|
39
|
+
}
|
|
40
|
+
function sectionOf(setting) {
|
|
41
|
+
return SECTION_BY_SETTING_ID.get(setting.id) ?? {
|
|
42
|
+
id: "",
|
|
43
|
+
title: ""
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function describeSetting(setting) {
|
|
47
|
+
const descriptor = {
|
|
48
|
+
id: setting.id,
|
|
49
|
+
path: setting.path,
|
|
50
|
+
title: setting.title,
|
|
51
|
+
description: setting.description,
|
|
52
|
+
type: setting.control,
|
|
53
|
+
scope: setting.scope,
|
|
54
|
+
access: setting.access,
|
|
55
|
+
effect: setting.takesEffect,
|
|
56
|
+
default: cloneValue(setting.defaultValue) ?? null,
|
|
57
|
+
unit: setting.unit?.storedLabel ?? setting.unit?.label ?? null,
|
|
58
|
+
displayUnit: setting.unit?.label ?? null,
|
|
59
|
+
storedPerDisplay: setting.unit?.storedPerDisplay ?? 1,
|
|
60
|
+
section: sectionOf(setting)
|
|
61
|
+
};
|
|
62
|
+
if (setting.options) descriptor.options = setting.options.map((option) => option.value);
|
|
63
|
+
if (setting.range) descriptor.range = setting.range;
|
|
64
|
+
if (setting.fileOnlyReason) descriptor.fileOnlyReason = setting.fileOnlyReason;
|
|
65
|
+
return descriptor;
|
|
66
|
+
}
|
|
67
|
+
function isStoredSecret(value) {
|
|
68
|
+
return typeof value === "string" && value.length > 0;
|
|
69
|
+
}
|
|
70
|
+
function readSetting(setting, view) {
|
|
71
|
+
const stored = valueAtPath(view.config, setting.path);
|
|
72
|
+
const source = view.secretSources[setting.path] ?? (stored !== void 0 ? "config.json" : "default");
|
|
73
|
+
const readout = {
|
|
74
|
+
...describeSetting(setting),
|
|
75
|
+
secret: setting.control === "password",
|
|
76
|
+
source
|
|
77
|
+
};
|
|
78
|
+
if (readout.secret) {
|
|
79
|
+
readout.configured = isStoredSecret(stored);
|
|
80
|
+
return readout;
|
|
81
|
+
}
|
|
82
|
+
readout.value = stored !== void 0 ? cloneValue(stored) : readout.default;
|
|
83
|
+
return readout;
|
|
84
|
+
}
|
|
85
|
+
function fitColumn(text) {
|
|
86
|
+
if (text.length <= VALUE_COLUMN_WIDTH) return text;
|
|
87
|
+
return `${text.slice(0, 37)}...`;
|
|
88
|
+
}
|
|
89
|
+
function storedValueText(setting, value) {
|
|
90
|
+
if (setting.valueKind) return displayText(setting, value);
|
|
91
|
+
const stored = JSON.stringify(value ?? null);
|
|
92
|
+
if (typeof value !== "number" || !hasScaledUnit(setting)) return stored;
|
|
93
|
+
return `${stored} (${displayText(setting, value)})`;
|
|
94
|
+
}
|
|
95
|
+
function valueText(readout, setting) {
|
|
96
|
+
if (readout.secret) return readout.configured ? "configured" : "not configured";
|
|
97
|
+
return storedValueText(setting, readout.value);
|
|
98
|
+
}
|
|
99
|
+
function defaultText(setting) {
|
|
100
|
+
return storedValueText(setting, setting.defaultValue);
|
|
101
|
+
}
|
|
102
|
+
function settingsBySection(settings) {
|
|
103
|
+
return SECTION_ORDER.map((section) => ({
|
|
104
|
+
section,
|
|
105
|
+
settings: settings.filter((setting) => sectionOf(setting).id === section.id)
|
|
106
|
+
})).filter((group) => group.settings.length > 0);
|
|
107
|
+
}
|
|
108
|
+
function renderSectionTables(settings, headers, rowOf) {
|
|
109
|
+
return settingsBySection(settings).map(({ section, settings: grouped }) => renderTable({
|
|
110
|
+
title: section.title,
|
|
111
|
+
headers,
|
|
112
|
+
rows: grouped.map(rowOf),
|
|
113
|
+
align: headers.map(() => "left")
|
|
114
|
+
})).join("\n\n");
|
|
115
|
+
}
|
|
116
|
+
function resolveSetting(argument) {
|
|
117
|
+
return SETTINGS_INDEX.byPath.get(argument) ?? SETTINGS_INDEX.byId.get(argument) ?? null;
|
|
118
|
+
}
|
|
119
|
+
function requireConfigFileSetting(argument, configPath) {
|
|
120
|
+
const setting = resolveSetting(argument);
|
|
121
|
+
if (!setting) return fail(`${argument} is not a setting in the registry, so this command cannot read or change it; edit config.json at ${configPath} by hand`);
|
|
122
|
+
if (setting.scope === "browser") return fail(`${setting.id} is a browser preference saved in each browser, not in config.json; change it in the dashboard under Settings > ${sectionOf(setting).title}`);
|
|
123
|
+
if (setting.control === "readonly") return fail(`${setting.id} is a read-only status row under Settings > ${sectionOf(setting).title}; it has no config.json key`);
|
|
124
|
+
return succeed(setting);
|
|
125
|
+
}
|
|
126
|
+
function configFileViewOf(configPath, config, env) {
|
|
127
|
+
return {
|
|
128
|
+
configPath,
|
|
129
|
+
config,
|
|
130
|
+
secretSources: Object.fromEntries(readEnvSecrets(env).map((secret) => [`${secret.blockName}.${secret.secretKey}`, secret.environmentVariable]))
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
function listSettings(view) {
|
|
134
|
+
const settings = ALL_SETTINGS.filter(isConfigFileSetting);
|
|
135
|
+
const readouts = settings.map((setting) => readSetting(setting, view));
|
|
136
|
+
const readoutById = new Map(readouts.map((readout) => [readout.id, readout]));
|
|
137
|
+
const rowOf = (setting) => {
|
|
138
|
+
const readout = readoutById.get(setting.id);
|
|
139
|
+
if (!readout) return [
|
|
140
|
+
setting.path,
|
|
141
|
+
"",
|
|
142
|
+
""
|
|
143
|
+
];
|
|
144
|
+
return [
|
|
145
|
+
setting.path,
|
|
146
|
+
fitColumn(valueText(readout, setting)),
|
|
147
|
+
readout.source
|
|
148
|
+
];
|
|
149
|
+
};
|
|
150
|
+
return {
|
|
151
|
+
readout: readouts,
|
|
152
|
+
text: renderSectionTables(settings, [
|
|
153
|
+
"Setting",
|
|
154
|
+
"Value",
|
|
155
|
+
"Source"
|
|
156
|
+
], rowOf)
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
function getSetting(view, setting) {
|
|
160
|
+
const readout = readSetting(setting, view);
|
|
161
|
+
const sourceNote = readout.secret && !readout.configured ? "" : ` (${readout.source})`;
|
|
162
|
+
return {
|
|
163
|
+
readout,
|
|
164
|
+
text: `${setting.path} = ${valueText(readout, setting)}${sourceNote}`
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function readSettingsForAgent({ command, path }, view) {
|
|
168
|
+
if (command === "list") return {
|
|
169
|
+
ok: true,
|
|
170
|
+
...listSettings(view)
|
|
171
|
+
};
|
|
172
|
+
if (path === void 0) return {
|
|
173
|
+
ok: false,
|
|
174
|
+
error: "get needs a setting path or id, such as posthog.trafficSpikeEnabled"
|
|
175
|
+
};
|
|
176
|
+
const resolved = requireConfigFileSetting(path, view.configPath);
|
|
177
|
+
if (!resolved.ok) return {
|
|
178
|
+
ok: false,
|
|
179
|
+
error: resolved.message
|
|
180
|
+
};
|
|
181
|
+
return {
|
|
182
|
+
ok: true,
|
|
183
|
+
...getSetting(view, resolved.value)
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
function settingsRequestForServer(commandArguments, env) {
|
|
187
|
+
if (!env["GLIMMERVOID_AGENT_URL"]) return null;
|
|
188
|
+
const { values, positionals } = parseArgs({
|
|
189
|
+
args: [...commandArguments],
|
|
190
|
+
allowPositionals: true,
|
|
191
|
+
strict: false
|
|
192
|
+
});
|
|
193
|
+
if (values.help) return null;
|
|
194
|
+
const parsed = AgentSettingsRequest.safeParse({
|
|
195
|
+
command: positionals[0],
|
|
196
|
+
...positionals[1] === void 0 ? {} : { path: positionals[1] }
|
|
197
|
+
});
|
|
198
|
+
return parsed.success ? parsed.data : null;
|
|
199
|
+
}
|
|
200
|
+
//#endregion
|
|
201
|
+
export { fail as a, listSettings as c, renderSectionTables as d, requireConfigFileSetting as f, valueText as g, succeed as h, describeSetting as i, readSetting as l, settingsRequestForServer as m, configFileViewOf as n, fitColumn as o, sectionOf as p, defaultText as r, getSetting as s, ALL_SETTINGS as t, readSettingsForAgent as u };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as errorMessage } from "./text-DoirglWV.js";
|
|
2
|
-
import {
|
|
2
|
+
import { D as SIGN_URL_ENV, M as SshSignReply } from "./session-BwB43SCa.js";
|
|
3
3
|
import { n as execFileAsync, o as spawn } from "./child-process-safe-CbQnyh7D.js";
|
|
4
4
|
import { a as isLoopbackHostname } from "./hook-relay-core-DA_bz2KA.js";
|
|
5
|
-
import {
|
|
5
|
+
import { n as postToAgentIngress } from "./agent-api-cli-BNHJTmNW.js";
|
|
6
6
|
import { l as parseSshPublicKey } from "./ssh-signing-core-CRhVVWNW.js";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import fsp from "node:fs/promises";
|