@codyswann/lisa 2.235.0 → 2.236.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/dist/cli/ui-automations-adapters.d.ts +50 -0
- package/dist/cli/ui-automations-adapters.d.ts.map +1 -0
- package/dist/cli/ui-automations-adapters.js +162 -0
- package/dist/cli/ui-automations-adapters.js.map +1 -0
- package/dist/cli/ui-automations.d.ts +89 -0
- package/dist/cli/ui-automations.d.ts.map +1 -0
- package/dist/cli/ui-automations.js +148 -0
- package/dist/cli/ui-automations.js.map +1 -0
- package/dist/cli/ui-cmd.d.ts +5 -0
- package/dist/cli/ui-cmd.d.ts.map +1 -1
- package/dist/cli/ui-cmd.js +17 -0
- package/dist/cli/ui-cmd.js.map +1 -1
- package/dist/cli/ui-deploy-pipeline-model.d.ts +70 -0
- package/dist/cli/ui-deploy-pipeline-model.d.ts.map +1 -0
- package/dist/cli/ui-deploy-pipeline-model.js +127 -0
- package/dist/cli/ui-deploy-pipeline-model.js.map +1 -0
- package/dist/cli/ui-deploy-pipeline.d.ts +25 -0
- package/dist/cli/ui-deploy-pipeline.d.ts.map +1 -0
- package/dist/cli/ui-deploy-pipeline.js +192 -0
- package/dist/cli/ui-deploy-pipeline.js.map +1 -0
- package/dist/cli/ui-detected-stacks.d.ts +20 -0
- package/dist/cli/ui-detected-stacks.d.ts.map +1 -0
- package/dist/cli/ui-detected-stacks.js +28 -0
- package/dist/cli/ui-detected-stacks.js.map +1 -0
- package/dist/cli/ui-enabled-plugins.d.ts +52 -0
- package/dist/cli/ui-enabled-plugins.d.ts.map +1 -0
- package/dist/cli/ui-enabled-plugins.js +253 -0
- package/dist/cli/ui-enabled-plugins.js.map +1 -0
- package/dist/cli/ui-github-repo-expected.d.ts +36 -0
- package/dist/cli/ui-github-repo-expected.d.ts.map +1 -0
- package/dist/cli/ui-github-repo-expected.js +118 -0
- package/dist/cli/ui-github-repo-expected.js.map +1 -0
- package/dist/cli/ui-github-repo-gh.d.ts +36 -0
- package/dist/cli/ui-github-repo-gh.d.ts.map +1 -0
- package/dist/cli/ui-github-repo-gh.js +112 -0
- package/dist/cli/ui-github-repo-gh.js.map +1 -0
- package/dist/cli/ui-github-repo-map.d.ts +25 -0
- package/dist/cli/ui-github-repo-map.d.ts.map +1 -0
- package/dist/cli/ui-github-repo-map.js +150 -0
- package/dist/cli/ui-github-repo-map.js.map +1 -0
- package/dist/cli/ui-github-repo.d.ts +51 -0
- package/dist/cli/ui-github-repo.d.ts.map +1 -0
- package/dist/cli/ui-github-repo.js +117 -0
- package/dist/cli/ui-github-repo.js.map +1 -0
- package/dist/cli/ui-observability-checks.d.ts +23 -0
- package/dist/cli/ui-observability-checks.d.ts.map +1 -0
- package/dist/cli/ui-observability-checks.js +156 -0
- package/dist/cli/ui-observability-checks.js.map +1 -0
- package/dist/cli/ui-observability-providers.d.ts +69 -0
- package/dist/cli/ui-observability-providers.d.ts.map +1 -0
- package/dist/cli/ui-observability-providers.js +99 -0
- package/dist/cli/ui-observability-providers.js.map +1 -0
- package/package.json +1 -1
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/ui/README.md +5 -3
- package/ui/index.html +1097 -432
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live-status probe for the console Plugins & MCP section.
|
|
3
|
+
*
|
|
4
|
+
* Reads project `.claude/settings.json` `enabledPlugins` and joins against
|
|
5
|
+
* marketplace catalogs on disk. READ-ONLY — never fabricates enablement.
|
|
6
|
+
* @module cli/ui-enabled-plugins
|
|
7
|
+
*/
|
|
8
|
+
import { readFile } from "node:fs/promises";
|
|
9
|
+
import { homedir as defaultHomedir } from "node:os";
|
|
10
|
+
import * as path from "node:path";
|
|
11
|
+
const ENABLED_PLUGINS_PROBE_ID = "enabled-plugins";
|
|
12
|
+
const SETTINGS_RELATIVE = path.join(".claude", "settings.json");
|
|
13
|
+
const MARKETPLACE_JSON = path.join(".claude-plugin", "marketplace.json");
|
|
14
|
+
/**
|
|
15
|
+
* Read and parse JSON with a real parser; never hand-roll.
|
|
16
|
+
* @param filePath - Absolute path to a JSON file
|
|
17
|
+
* @returns Parsed value
|
|
18
|
+
*/
|
|
19
|
+
async function readJsonFile(filePath) {
|
|
20
|
+
const content = await readFile(filePath, "utf8");
|
|
21
|
+
return JSON.parse(content);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Extract `plugin@marketplace` → description pairs from one marketplace.json.
|
|
25
|
+
* @param marketplacePath - Absolute path to marketplace.json
|
|
26
|
+
* @param fallbackName - Name used when the file omits `name`
|
|
27
|
+
* @returns Catalog entries (may be empty on read/parse failure)
|
|
28
|
+
*/
|
|
29
|
+
async function readMarketplaceEntries(marketplacePath, fallbackName) {
|
|
30
|
+
try {
|
|
31
|
+
const parsed = await readJsonFile(marketplacePath);
|
|
32
|
+
if (typeof parsed !== "object" || parsed === null) {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
const nameRaw = Reflect.get(parsed, "name");
|
|
36
|
+
const marketplaceName = typeof nameRaw === "string" && nameRaw.trim().length > 0
|
|
37
|
+
? nameRaw.trim()
|
|
38
|
+
: fallbackName;
|
|
39
|
+
const plugins = Reflect.get(parsed, "plugins");
|
|
40
|
+
if (!Array.isArray(plugins)) {
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
return plugins.flatMap(entry => {
|
|
44
|
+
if (typeof entry !== "object" || entry === null) {
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
const pluginName = Reflect.get(entry, "name");
|
|
48
|
+
if (typeof pluginName !== "string" || pluginName.trim().length === 0) {
|
|
49
|
+
return [];
|
|
50
|
+
}
|
|
51
|
+
const descriptionRaw = Reflect.get(entry, "description");
|
|
52
|
+
const description = typeof descriptionRaw === "string" ? descriptionRaw : "";
|
|
53
|
+
return [
|
|
54
|
+
[`${pluginName.trim()}@${marketplaceName}`, description],
|
|
55
|
+
];
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Read install locations from `~/.claude/plugins/known_marketplaces.json`.
|
|
64
|
+
* @param home - Home directory
|
|
65
|
+
* @returns Marketplace name → installLocation pairs
|
|
66
|
+
*/
|
|
67
|
+
async function readKnownMarketplaceInstalls(home) {
|
|
68
|
+
const knownPath = path.join(home, ".claude", "plugins", "known_marketplaces.json");
|
|
69
|
+
try {
|
|
70
|
+
const known = await readJsonFile(knownPath);
|
|
71
|
+
if (typeof known !== "object" || known === null || Array.isArray(known)) {
|
|
72
|
+
return [];
|
|
73
|
+
}
|
|
74
|
+
return Object.entries(known).flatMap(([marketplaceName, entry]) => {
|
|
75
|
+
if (typeof entry !== "object" || entry === null) {
|
|
76
|
+
return [];
|
|
77
|
+
}
|
|
78
|
+
const installLocation = Reflect.get(entry, "installLocation");
|
|
79
|
+
if (typeof installLocation !== "string" || installLocation.length === 0) {
|
|
80
|
+
return [];
|
|
81
|
+
}
|
|
82
|
+
return [[marketplaceName, installLocation]];
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
return [];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Collect plugin id → description from known Claude marketplaces on disk.
|
|
91
|
+
* @param cwd - Project root (checked for a local `.claude-plugin/marketplace.json`)
|
|
92
|
+
* @param home - Home directory containing `~/.claude/plugins`
|
|
93
|
+
* @returns Map of `plugin@marketplace` ids to descriptions
|
|
94
|
+
*/
|
|
95
|
+
export async function listMarketplacePluginsFromDisk(cwd, home) {
|
|
96
|
+
const localEntries = await readMarketplaceEntries(path.join(cwd, MARKETPLACE_JSON), "lisa");
|
|
97
|
+
const installs = await readKnownMarketplaceInstalls(home);
|
|
98
|
+
const knownEntries = (await Promise.all(installs.map(async ([marketplaceName, installLocation]) => readMarketplaceEntries(path.join(installLocation, MARKETPLACE_JSON), marketplaceName)))).flat();
|
|
99
|
+
// Later entries win so the project's local marketplace takes precedence.
|
|
100
|
+
return new Map([...knownEntries, ...localEntries]);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Sort enabled rows before available, then by id.
|
|
104
|
+
* @param left - First row
|
|
105
|
+
* @param right - Second row
|
|
106
|
+
* @returns Comparator result
|
|
107
|
+
*/
|
|
108
|
+
function comparePluginRows(left, right) {
|
|
109
|
+
if (left.status !== right.status) {
|
|
110
|
+
return left.status === "enabled" ? -1 : 1;
|
|
111
|
+
}
|
|
112
|
+
return left.id.localeCompare(right.id);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Build the probe value from settings + marketplace catalog.
|
|
116
|
+
* @param settingsPresent - Whether settings.json existed
|
|
117
|
+
* @param enabledPlugins - Parsed enabledPlugins map (true = enabled)
|
|
118
|
+
* @param marketplace - Plugin id → description catalog
|
|
119
|
+
* @returns Structured probe value
|
|
120
|
+
*/
|
|
121
|
+
export function buildEnabledPluginsValue(settingsPresent, enabledPlugins, marketplace) {
|
|
122
|
+
if (!settingsPresent) {
|
|
123
|
+
return { settingsPresent: false, plugins: [] };
|
|
124
|
+
}
|
|
125
|
+
const enabledRows = Object.entries(enabledPlugins)
|
|
126
|
+
.filter((entry) => typeof entry[0] === "string" &&
|
|
127
|
+
entry[0].trim().length > 0 &&
|
|
128
|
+
entry[1] === true)
|
|
129
|
+
.map(([id]) => ({
|
|
130
|
+
id,
|
|
131
|
+
status: "enabled",
|
|
132
|
+
description: marketplace.get(id) ?? "",
|
|
133
|
+
}));
|
|
134
|
+
const enabledIds = new Set(enabledRows.map(row => row.id));
|
|
135
|
+
const availableRows = [...marketplace.entries()]
|
|
136
|
+
.filter(([id]) => !enabledIds.has(id))
|
|
137
|
+
.map(([id, description]) => ({
|
|
138
|
+
id,
|
|
139
|
+
status: "available",
|
|
140
|
+
description,
|
|
141
|
+
}));
|
|
142
|
+
return {
|
|
143
|
+
settingsPresent: true,
|
|
144
|
+
plugins: [...enabledRows, ...availableRows].sort(comparePluginRows),
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Parse `enabledPlugins` from a settings document.
|
|
149
|
+
* @param settings - Parsed settings.json root
|
|
150
|
+
* @returns Map of plugin id → enabled, or an error reason
|
|
151
|
+
*/
|
|
152
|
+
function parseEnabledPluginsMap(settings) {
|
|
153
|
+
if (typeof settings !== "object" ||
|
|
154
|
+
settings === null ||
|
|
155
|
+
Array.isArray(settings)) {
|
|
156
|
+
return {
|
|
157
|
+
ok: false,
|
|
158
|
+
reason: "invalid-settings",
|
|
159
|
+
message: ".claude/settings.json did not contain a JSON object",
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
if (!Object.hasOwn(settings, "enabledPlugins")) {
|
|
163
|
+
return { ok: true, map: {} };
|
|
164
|
+
}
|
|
165
|
+
const enabledPlugins = Reflect.get(settings, "enabledPlugins");
|
|
166
|
+
if (typeof enabledPlugins !== "object" ||
|
|
167
|
+
enabledPlugins === null ||
|
|
168
|
+
Array.isArray(enabledPlugins)) {
|
|
169
|
+
return {
|
|
170
|
+
ok: false,
|
|
171
|
+
reason: "invalid-enabled-plugins",
|
|
172
|
+
message: "enabledPlugins must be a JSON object map of plugin id → boolean",
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
const map = Object.fromEntries(Object.entries(enabledPlugins).filter((entry) => typeof entry[1] === "boolean"));
|
|
176
|
+
return { ok: true, map };
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Classify a settings.json read failure into empty vs unknown.
|
|
180
|
+
* @param error - Thrown value from read/parse
|
|
181
|
+
* @returns Probe outcome when the file cannot be used
|
|
182
|
+
*/
|
|
183
|
+
function classifySettingsReadError(error) {
|
|
184
|
+
const code = typeof error === "object" &&
|
|
185
|
+
error !== null &&
|
|
186
|
+
"code" in error &&
|
|
187
|
+
typeof Reflect.get(error, "code") === "string"
|
|
188
|
+
? Reflect.get(error, "code")
|
|
189
|
+
: undefined;
|
|
190
|
+
if (code === "ENOENT") {
|
|
191
|
+
return { missing: true };
|
|
192
|
+
}
|
|
193
|
+
if (error instanceof SyntaxError) {
|
|
194
|
+
return {
|
|
195
|
+
state: "unknown",
|
|
196
|
+
reason: "unparseable-settings",
|
|
197
|
+
message: error.message.trim().length > 0
|
|
198
|
+
? error.message
|
|
199
|
+
: ".claude/settings.json could not be parsed as JSON",
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
const message = error instanceof Error && error.message.trim().length > 0
|
|
203
|
+
? error.message
|
|
204
|
+
: "Failed to read .claude/settings.json";
|
|
205
|
+
return {
|
|
206
|
+
state: "unknown",
|
|
207
|
+
reason: "settings-read-failed",
|
|
208
|
+
message,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Create the probe that reports project plugin enablement vs marketplace availability.
|
|
213
|
+
* @param cwd - Project root containing `.claude/settings.json`
|
|
214
|
+
* @param dependencies - Injectable collaborators for focused tests
|
|
215
|
+
* @returns Probe emitting enabled / available-not-enabled rows, or unknown
|
|
216
|
+
*/
|
|
217
|
+
export function createEnabledPluginsProbe(cwd, dependencies = {}) {
|
|
218
|
+
const resolveHome = dependencies.homedir ?? defaultHomedir;
|
|
219
|
+
const listMarketplace = dependencies.listMarketplacePlugins ?? listMarketplacePluginsFromDisk;
|
|
220
|
+
return {
|
|
221
|
+
id: ENABLED_PLUGINS_PROBE_ID,
|
|
222
|
+
timeoutMs: 5_000,
|
|
223
|
+
run: async () => {
|
|
224
|
+
const settingsPath = path.join(cwd, SETTINGS_RELATIVE);
|
|
225
|
+
const loaded = await readJsonFile(settingsPath).then(settings => ({ ok: true, settings }), (error) => ({ ok: false, error }));
|
|
226
|
+
if (!loaded.ok) {
|
|
227
|
+
const classified = classifySettingsReadError(loaded.error);
|
|
228
|
+
if (!("missing" in classified)) {
|
|
229
|
+
return classified;
|
|
230
|
+
}
|
|
231
|
+
const marketplace = await listMarketplace(cwd, resolveHome());
|
|
232
|
+
return {
|
|
233
|
+
state: "value",
|
|
234
|
+
value: buildEnabledPluginsValue(false, {}, marketplace),
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
const parsed = parseEnabledPluginsMap(loaded.settings);
|
|
238
|
+
if (!parsed.ok) {
|
|
239
|
+
return {
|
|
240
|
+
state: "unknown",
|
|
241
|
+
reason: parsed.reason,
|
|
242
|
+
message: parsed.message,
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
const marketplace = await listMarketplace(cwd, resolveHome());
|
|
246
|
+
return {
|
|
247
|
+
state: "value",
|
|
248
|
+
value: buildEnabledPluginsValue(true, parsed.map, marketplace),
|
|
249
|
+
};
|
|
250
|
+
},
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
//# sourceMappingURL=ui-enabled-plugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-enabled-plugins.js","sourceRoot":"","sources":["../../src/cli/ui-enabled-plugins.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAsClC,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;AACnD,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;AAChE,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;AAEzE;;;;GAIG;AACH,KAAK,UAAU,YAAY,CAAC,QAAgB;IAC1C,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAY,CAAC;AACxC,CAAC;AAED;;;;;GAKG;AACH,KAAK,UAAU,sBAAsB,CACnC,eAAuB,EACvB,YAAoB;IAEpB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,eAAe,CAAC,CAAC;QACnD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YAClD,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC5C,MAAM,eAAe,GACnB,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CA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;gBACf,OAAO;oBACL,KAAK,EAAE,SAAS;oBAChB,MAAM,EAAE,MAAM,CAAC,MAAM;oBACrB,OAAO,EAAE,MAAM,CAAC,OAAO;iBACxB,CAAC;YACJ,CAAC;YAED,MAAM,WAAW,GAAG,MAAM,eAAe,CAAC,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC;YAC9D,OAAO;gBACL,KAAK,EAAE,OAAO;gBACd,KAAK,EAAE,wBAAwB,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,EAAE,WAAW,CAAC;aAC/D,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Expected labels and secrets for the GitHub repository live-status panel.
|
|
3
|
+
* @module cli/ui-github-repo-expected
|
|
4
|
+
*/
|
|
5
|
+
import type { JsonObject } from "../sync/json-path.js";
|
|
6
|
+
/** One config-expected lifecycle label. */
|
|
7
|
+
export interface ExpectedLabel {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly role: string;
|
|
10
|
+
}
|
|
11
|
+
/** One workflow-expected repository secret (presence only). */
|
|
12
|
+
export interface ExpectedSecret {
|
|
13
|
+
readonly name: string;
|
|
14
|
+
readonly purpose: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Secrets Lisa creates or expects workflows to consume.
|
|
18
|
+
* Presence is checked via `gh secret list`; values are never read.
|
|
19
|
+
*/
|
|
20
|
+
export declare const EXPECTED_GITHUB_SECRETS: readonly ExpectedSecret[];
|
|
21
|
+
/**
|
|
22
|
+
* Flatten `github.labels` from merged config into expected label rows.
|
|
23
|
+
* @param config - Merged Lisa project config
|
|
24
|
+
* @returns Expected labels with human-readable role paths
|
|
25
|
+
*/
|
|
26
|
+
export declare function expectedLabelsFromConfig(config: JsonObject): readonly ExpectedLabel[];
|
|
27
|
+
/**
|
|
28
|
+
* Read configured github.org / github.repo when both are non-empty strings.
|
|
29
|
+
* @param config - Merged Lisa project config
|
|
30
|
+
* @returns Owner and repo, or undefined when either is missing
|
|
31
|
+
*/
|
|
32
|
+
export declare function configuredGithubRepo(config: JsonObject): {
|
|
33
|
+
readonly owner: string;
|
|
34
|
+
readonly repo: string;
|
|
35
|
+
} | undefined;
|
|
36
|
+
//# sourceMappingURL=ui-github-repo-expected.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-github-repo-expected.d.ts","sourceRoot":"","sources":["../../src/cli/ui-github-repo-expected.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,sBAAsB,CAAC;AAElE,2CAA2C;AAC3C,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,+DAA+D;AAC/D,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,cAAc,EAgE5D,CAAC;AAuBF;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,UAAU,GACjB,SAAS,aAAa,EAAE,CAU1B;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,UAAU,GACjB;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAgB/D"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Secrets Lisa creates or expects workflows to consume.
|
|
3
|
+
* Presence is checked via `gh secret list`; values are never read.
|
|
4
|
+
*/
|
|
5
|
+
export const EXPECTED_GITHUB_SECRETS = [
|
|
6
|
+
{
|
|
7
|
+
name: "DEPLOY_KEY",
|
|
8
|
+
purpose: "Write deploy key so CI can push version bumps through ruleset bypass",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: "CLAUDE_CODE_OAUTH_TOKEN",
|
|
12
|
+
purpose: "Claude Code Action workflows (nightly, review response, auto-fix)",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: "AWS_ACCOUNT_ID_DEV",
|
|
16
|
+
purpose: "Per-environment AWS account for dev deploys",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "AWS_ACCOUNT_ID_STAGING",
|
|
20
|
+
purpose: "Per-environment AWS account for staging deploys",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "AWS_ACCOUNT_ID_PRODUCTION",
|
|
24
|
+
purpose: "Per-environment AWS account for production deploys",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "GITGUARDIAN_API_KEY",
|
|
28
|
+
purpose: "Secret scanning check",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "SONAR_TOKEN",
|
|
32
|
+
purpose: "SonarCloud SAST",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "SNYK_TOKEN",
|
|
36
|
+
purpose: "Snyk dependency scan",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "FOSSA_API_KEY",
|
|
40
|
+
purpose: "License compliance",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "SENTRY_AUTH_TOKEN",
|
|
44
|
+
purpose: "Sentry releases and sourcemaps",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "SENTRY_ORG",
|
|
48
|
+
purpose: "Sentry organization slug",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "SENTRY_PROJECT",
|
|
52
|
+
purpose: "Sentry project slug",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "EXPO_TOKEN",
|
|
56
|
+
purpose: "EAS builds",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "MAESTRO_API_KEY",
|
|
60
|
+
purpose: "Maestro Cloud mobile E2E",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "MAESTRO_SECRET_ENV",
|
|
64
|
+
purpose: "Native Maestro e2e — newline-separated KEY=VALUE secrets forwarded to flows",
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
/**
|
|
68
|
+
* Walk a nested labels object into role-path entries.
|
|
69
|
+
* @param value - Nested label map or leaf string
|
|
70
|
+
* @param pathParts - Role segments accumulated so far
|
|
71
|
+
* @returns Flattened labels under this node
|
|
72
|
+
*/
|
|
73
|
+
function walkLabels(value, pathParts) {
|
|
74
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
75
|
+
return [{ name: value, role: pathParts.join(" · ") }];
|
|
76
|
+
}
|
|
77
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
78
|
+
return [];
|
|
79
|
+
}
|
|
80
|
+
return Object.entries(value).flatMap(([key, child]) => walkLabels(child, [...pathParts, key]));
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Flatten `github.labels` from merged config into expected label rows.
|
|
84
|
+
* @param config - Merged Lisa project config
|
|
85
|
+
* @returns Expected labels with human-readable role paths
|
|
86
|
+
*/
|
|
87
|
+
export function expectedLabelsFromConfig(config) {
|
|
88
|
+
const github = config.github;
|
|
89
|
+
if (github === null || typeof github !== "object" || Array.isArray(github)) {
|
|
90
|
+
return [];
|
|
91
|
+
}
|
|
92
|
+
const labels = Reflect.get(github, "labels");
|
|
93
|
+
if (labels === null || typeof labels !== "object" || Array.isArray(labels)) {
|
|
94
|
+
return [];
|
|
95
|
+
}
|
|
96
|
+
return walkLabels(labels, []);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Read configured github.org / github.repo when both are non-empty strings.
|
|
100
|
+
* @param config - Merged Lisa project config
|
|
101
|
+
* @returns Owner and repo, or undefined when either is missing
|
|
102
|
+
*/
|
|
103
|
+
export function configuredGithubRepo(config) {
|
|
104
|
+
const github = config.github;
|
|
105
|
+
if (github === null || typeof github !== "object" || Array.isArray(github)) {
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
const owner = Reflect.get(github, "org");
|
|
109
|
+
const repo = Reflect.get(github, "repo");
|
|
110
|
+
if (typeof owner !== "string" ||
|
|
111
|
+
owner.trim().length === 0 ||
|
|
112
|
+
typeof repo !== "string" ||
|
|
113
|
+
repo.trim().length === 0) {
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
return { owner: owner.trim(), repo: repo.trim() };
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=ui-github-repo-expected.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-github-repo-expected.js","sourceRoot":"","sources":["../../src/cli/ui-github-repo-expected.ts"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAA8B;IAChE;QACE,IAAI,EAAE,YAAY;QAClB,OAAO,EACL,sEAAsE;KACzE;IACD;QACE,IAAI,EAAE,yBAAyB;QAC/B,OAAO,EACL,mEAAmE;KACtE;IACD;QACE,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,6CAA6C;KACvD;IACD;QACE,IAAI,EAAE,wBAAwB;QAC9B,OAAO,EAAE,iDAAiD;KAC3D;IACD;QACE,IAAI,EAAE,2BAA2B;QACjC,OAAO,EAAE,oDAAoD;KAC9D;IACD;QACE,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EAAE,uBAAuB;KACjC;IACD;QACE,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,iBAAiB;KAC3B;IACD;QACE,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,sBAAsB;KAChC;IACD;QACE,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,oBAAoB;KAC9B;IACD;QACE,IAAI,EAAE,mBAAmB;QACz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AAE,CAAC;IACZ,CAAC;IACD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC7C,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3E,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,UAAU,CAAC,MAAmB,EAAE,EAAE,CAAC,CAAC;AAC7C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAkB;IAElB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAC7B,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3E,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACzC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;QACzB,OAAO,IAAI,KAAK,QAAQ;QACxB,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EACxB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Live repository settings surfaced in the console panel. */
|
|
2
|
+
export interface GithubRepoSettings {
|
|
3
|
+
readonly allow_merge_commit: boolean;
|
|
4
|
+
readonly allow_squash_merge: boolean;
|
|
5
|
+
readonly allow_rebase_merge: boolean;
|
|
6
|
+
readonly allow_auto_merge: boolean;
|
|
7
|
+
readonly allow_update_branch: boolean;
|
|
8
|
+
readonly delete_branch_on_merge: boolean;
|
|
9
|
+
readonly merge_commit_title: string;
|
|
10
|
+
readonly has_issues: boolean;
|
|
11
|
+
readonly has_wiki: boolean;
|
|
12
|
+
readonly secret_scanning: boolean;
|
|
13
|
+
readonly default_branch: string;
|
|
14
|
+
}
|
|
15
|
+
/** One ruleset row for the panel. */
|
|
16
|
+
export interface GithubRulesetRow {
|
|
17
|
+
readonly name: string;
|
|
18
|
+
readonly appliesTo: string;
|
|
19
|
+
readonly enforces: string;
|
|
20
|
+
readonly active: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** One label present on the remote repository. */
|
|
23
|
+
export interface GithubRemoteLabel {
|
|
24
|
+
readonly name: string;
|
|
25
|
+
readonly color: string;
|
|
26
|
+
}
|
|
27
|
+
/** Injectable collaborators used by the github-repo probe. */
|
|
28
|
+
export interface GithubRepoGhReads {
|
|
29
|
+
readonly readSettings: (owner: string, repo: string, cwd: string, timeoutMs: number, signal: AbortSignal) => Promise<GithubRepoSettings>;
|
|
30
|
+
readonly listRulesets: (owner: string, repo: string, cwd: string, timeoutMs: number, signal: AbortSignal) => Promise<readonly GithubRulesetRow[]>;
|
|
31
|
+
readonly listLabels: (owner: string, repo: string, cwd: string, timeoutMs: number, signal: AbortSignal) => Promise<readonly GithubRemoteLabel[]>;
|
|
32
|
+
readonly listSecretNames: (owner: string, repo: string, cwd: string, timeoutMs: number, signal: AbortSignal) => Promise<readonly string[]>;
|
|
33
|
+
}
|
|
34
|
+
/** Default `gh` implementations used by `lisa ui`. */
|
|
35
|
+
export declare const defaultGithubRepoGhReads: GithubRepoGhReads;
|
|
36
|
+
//# sourceMappingURL=ui-github-repo-gh.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-github-repo-gh.d.ts","sourceRoot":"","sources":["../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AI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,WAAW,KAChB,OAAO,CAAC,SAAS,gBAAgB,EAAE,CAAC,CAAC;IAC1C,QAAQ,CAAC,UAAU,EAAE,CACnB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,WAAW,KAChB,OAAO,CAAC,SAAS,iBAAiB,EAAE,CAAC,CAAC;IAC3C,QAAQ,CAAC,eAAe,EAAE,CACxB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,WAAW,KAChB,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;CACjC;AAoFD,sDAAsD;AACtD,eAAO,MAAM,wBAAwB,EAAE,iBA0EtC,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Injectable `gh` reads for the GitHub repository live-status panel.
|
|
3
|
+
* @module cli/ui-github-repo-gh
|
|
4
|
+
*/
|
|
5
|
+
import { execFile } from "node:child_process";
|
|
6
|
+
import { mapRepoSettings, mapRulesetRow, requireNamedString, } from "./ui-github-repo-map.js";
|
|
7
|
+
/**
|
|
8
|
+
* Run `gh` without a shell and return stdout.
|
|
9
|
+
* @param args - gh argv after the executable
|
|
10
|
+
* @param cwd - Working directory
|
|
11
|
+
* @param timeoutMs - Child-process timeout
|
|
12
|
+
* @param signal - Probe cancellation signal
|
|
13
|
+
* @returns Trimmed stdout
|
|
14
|
+
*/
|
|
15
|
+
function runGh(args, cwd, timeoutMs, signal) {
|
|
16
|
+
return new Promise((resolve, reject) => {
|
|
17
|
+
const ghExecutable = "gh";
|
|
18
|
+
execFile(
|
|
19
|
+
// eslint-disable-next-line sonarjs/no-os-command-from-path -- fixed user-installed gh executable
|
|
20
|
+
ghExecutable, [...args], { cwd, signal, timeout: timeoutMs, encoding: "utf8" }, (error, stdout) => {
|
|
21
|
+
if (error !== null) {
|
|
22
|
+
reject(error);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
resolve(stdout.trim());
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Parse JSON from a gh command, rejecting non-JSON payloads.
|
|
31
|
+
* @param stdout - Command stdout
|
|
32
|
+
* @returns Parsed JSON value
|
|
33
|
+
*/
|
|
34
|
+
function parseJson(stdout) {
|
|
35
|
+
return JSON.parse(stdout);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Load detailed ruleset rows for every ruleset id in the list response.
|
|
39
|
+
* @param owner - Repository owner
|
|
40
|
+
* @param repo - Repository name
|
|
41
|
+
* @param listed - Parsed rulesets list payload
|
|
42
|
+
* @param cwd - Working directory
|
|
43
|
+
* @param timeoutMs - Child-process timeout
|
|
44
|
+
* @param signal - Probe cancellation signal
|
|
45
|
+
* @returns Panel ruleset rows
|
|
46
|
+
*/
|
|
47
|
+
async function loadRulesetDetails(owner, repo, listed, cwd, timeoutMs, signal) {
|
|
48
|
+
if (!Array.isArray(listed)) {
|
|
49
|
+
throw new TypeError("Rulesets list was not an array");
|
|
50
|
+
}
|
|
51
|
+
return await Promise.all(listed.map(async (entry) => {
|
|
52
|
+
if (entry === null || typeof entry !== "object") {
|
|
53
|
+
throw new TypeError("Ruleset list entry was not an object");
|
|
54
|
+
}
|
|
55
|
+
const id = Reflect.get(entry, "id");
|
|
56
|
+
if (typeof id !== "number") {
|
|
57
|
+
throw new TypeError("Ruleset list entry omitted numeric id");
|
|
58
|
+
}
|
|
59
|
+
const detailStdout = await runGh(["api", `repos/${owner}/${repo}/rulesets/${String(id)}`], cwd, timeoutMs, signal);
|
|
60
|
+
return mapRulesetRow(parseJson(detailStdout));
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
/** Default `gh` implementations used by `lisa ui`. */
|
|
64
|
+
export const defaultGithubRepoGhReads = {
|
|
65
|
+
readSettings: async (owner, repo, cwd, timeoutMs, signal) => {
|
|
66
|
+
const stdout = await runGh(["api", `repos/${owner}/${repo}`], cwd, timeoutMs, signal);
|
|
67
|
+
return mapRepoSettings(parseJson(stdout));
|
|
68
|
+
},
|
|
69
|
+
listRulesets: async (owner, repo, cwd, timeoutMs, signal) => {
|
|
70
|
+
const listStdout = await runGh(["api", `repos/${owner}/${repo}/rulesets`], cwd, timeoutMs, signal);
|
|
71
|
+
return loadRulesetDetails(owner, repo, parseJson(listStdout), cwd, timeoutMs, signal);
|
|
72
|
+
},
|
|
73
|
+
listLabels: async (owner, repo, cwd, timeoutMs, signal) => {
|
|
74
|
+
const stdout = await runGh([
|
|
75
|
+
"label",
|
|
76
|
+
"list",
|
|
77
|
+
"--repo",
|
|
78
|
+
`${owner}/${repo}`,
|
|
79
|
+
"--limit",
|
|
80
|
+
"200",
|
|
81
|
+
"--json",
|
|
82
|
+
"name,color",
|
|
83
|
+
], cwd, timeoutMs, signal);
|
|
84
|
+
const parsed = parseJson(stdout);
|
|
85
|
+
if (!Array.isArray(parsed)) {
|
|
86
|
+
throw new TypeError("Label list was not an array");
|
|
87
|
+
}
|
|
88
|
+
return parsed.map(entry => {
|
|
89
|
+
if (entry === null || typeof entry !== "object") {
|
|
90
|
+
throw new TypeError("Label entry was not an object");
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
name: requireNamedString(entry, "name"),
|
|
94
|
+
color: requireNamedString(entry, "color"),
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
},
|
|
98
|
+
listSecretNames: async (owner, repo, cwd, timeoutMs, signal) => {
|
|
99
|
+
const stdout = await runGh(["secret", "list", "--repo", `${owner}/${repo}`, "--json", "name"], cwd, timeoutMs, signal);
|
|
100
|
+
const parsed = parseJson(stdout);
|
|
101
|
+
if (!Array.isArray(parsed)) {
|
|
102
|
+
throw new TypeError("Secret list was not an array");
|
|
103
|
+
}
|
|
104
|
+
return parsed.map(entry => {
|
|
105
|
+
if (entry === null || typeof entry !== "object") {
|
|
106
|
+
throw new TypeError("Secret entry was not an object");
|
|
107
|
+
}
|
|
108
|
+
return requireNamedString(entry, "name");
|
|
109
|
+
});
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=ui-github-repo-gh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-github-repo-gh.js","sourceRoot":"","sources":["../../src/cli/ui-github-repo-gh.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EACL,eAAe,EACf,aAAa,EACb,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AA+DjC;;;;;;;GAOG;AACH,SAAS,KAAK,CACZ,IAAuB,EACvB,GAAW,EACX,SAAiB,EACjB,MAAmB;IAEnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,YAAY,GAAG,IAAI,CAAC;QAC1B,QAAQ;QACN,iGAAiG;QACjG,YAAY,EACZ,CAAC,GAAG,IAAI,CAAC,EACT,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EACrD,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YAChB,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;gBACnB,MAAM,CAAC,KAAK,CAAC,CAAC;gBACd,OAAO;YACT,CAAC;YACD,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QACzB,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,SAAS,SAAS,CAAC,MAAc;IAC/B,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAY,CAAC;AACvC,CAAC;AA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AAC;aAC1C,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IACD,eAAe,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;QAC7D,MAAM,MAAM,GAAG,MAAM,KAAK,CACxB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,IAAI,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,EAClE,GAAG,EACH,SAAS,EACT,MAAM,CACP,CAAC;QACF,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;QACjC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,SAAS,CAAC,8BAA8B,CAAC,CAAC;QACtD,CAAC;QACD,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YACxB,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAChD,MAAM,IAAI,SAAS,CAAC,gCAAgC,CAAC,CAAC;YACxD,CAAC;YACD,OAAO,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure mappers from GitHub API JSON onto repository panel rows.
|
|
3
|
+
* @module cli/ui-github-repo-map
|
|
4
|
+
*/
|
|
5
|
+
import type { GithubRepoSettings, GithubRulesetRow } from "./ui-github-repo-gh.js";
|
|
6
|
+
/**
|
|
7
|
+
* Map repository JSON into the panel settings shape.
|
|
8
|
+
* @param raw - Parsed `gh api repos/{owner}/{repo}` payload
|
|
9
|
+
* @returns Settings for the console
|
|
10
|
+
*/
|
|
11
|
+
export declare function mapRepoSettings(raw: unknown): GithubRepoSettings;
|
|
12
|
+
/**
|
|
13
|
+
* Map a detailed ruleset payload into a panel row.
|
|
14
|
+
* @param raw - One ruleset object from gh api
|
|
15
|
+
* @returns Panel row
|
|
16
|
+
*/
|
|
17
|
+
export declare function mapRulesetRow(raw: unknown): GithubRulesetRow;
|
|
18
|
+
/**
|
|
19
|
+
* Require a non-empty string field (shared by label/secret list parsers).
|
|
20
|
+
* @param record - Source object
|
|
21
|
+
* @param key - Property name
|
|
22
|
+
* @returns String value
|
|
23
|
+
*/
|
|
24
|
+
export declare function requireNamedString(record: object, key: string): string;
|
|
25
|
+
//# sourceMappingURL=ui-github-repo-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-github-repo-map.d.ts","sourceRoot":"","sources":["../../src/cli/ui-github-repo-map.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AA+ChC;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,kBAAkB,CAiBhE;AAqED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB,CAW5D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEtE"}
|