lagora-cli 1.1.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.
Files changed (52) hide show
  1. package/README.md +138 -0
  2. package/dist/help.txt +70 -0
  3. package/dist/lagora.js +342 -0
  4. package/dist/report-help.txt +5 -0
  5. package/dist/scripts/agora_playground_harness.py +263 -0
  6. package/dist/scripts/announce.js +41 -0
  7. package/dist/scripts/check-kernel-submission.py +90 -0
  8. package/dist/scripts/chunk-2EAJVB5D.js +100 -0
  9. package/dist/scripts/chunk-2KTLCUFI.js +29 -0
  10. package/dist/scripts/chunk-AZ3EEBVD.js +137 -0
  11. package/dist/scripts/chunk-NBJMYAOA.js +2128 -0
  12. package/dist/scripts/chunk-NCJMUBTG.js +125 -0
  13. package/dist/scripts/chunk-QJPQHKIO.js +23 -0
  14. package/dist/scripts/chunk-RIR5KGHC.js +33 -0
  15. package/dist/scripts/chunk-TJZVQYBL.js +8 -0
  16. package/dist/scripts/chunk-UHJXD4TG.js +18 -0
  17. package/dist/scripts/chunk-UQ6I6VTY.js +117 -0
  18. package/dist/scripts/cli-auth.js +348 -0
  19. package/dist/scripts/cli-config-IA7EOSYD.js +7 -0
  20. package/dist/scripts/install-skill.js +199 -0
  21. package/dist/scripts/issue-local-client-DZUXZOKY.js +22 -0
  22. package/dist/scripts/issue-search.js +1823 -0
  23. package/dist/scripts/issue.js +386 -0
  24. package/dist/scripts/keycloak-provision.js +986 -0
  25. package/dist/scripts/legato-fsim-runner.py +126 -0
  26. package/dist/scripts/legato-lowering-runner.py +156 -0
  27. package/dist/scripts/legato_runner_annotations.py +235 -0
  28. package/dist/scripts/legato_runner_env.py +91 -0
  29. package/dist/scripts/legato_runner_launchers.py +287 -0
  30. package/dist/scripts/legato_runner_script_wrapper.py +193 -0
  31. package/dist/scripts/notifications-EU43SIEV.js +624 -0
  32. package/dist/scripts/playground.js +408 -0
  33. package/dist/scripts/report-bundle-sync-3U7QTP4Z.js +215 -0
  34. package/dist/scripts/report.js +104 -0
  35. package/dist/scripts/resolve-sdk-package-version.py +151 -0
  36. package/dist/scripts/sdk-runtime-JE6H2PB2.js +992 -0
  37. package/dist/scripts/sdk-runtime-kubernetes-job-KOWL4ITV.js +479 -0
  38. package/dist/scripts/sdk-runtime-smoke.py +168 -0
  39. package/dist/scripts/sdk.js +256 -0
  40. package/dist/scripts/site-feedback-CAPE5MPX.js +136 -0
  41. package/dist/scripts/site-feedback-rate-limit-5BU2WSFE.js +86 -0
  42. package/dist/scripts/site-feedback.js +117 -0
  43. package/dist/scripts/storage-234FBH54.js +67 -0
  44. package/dist/scripts/submit-issue.sh +489 -0
  45. package/dist/scripts/verification-3QCY66QW.js +772 -0
  46. package/dist/scripts/verify-issue.js +144 -0
  47. package/dist/skills/legato-agora-cli/SKILL.md +556 -0
  48. package/dist/skills/legato-agora-cli/agents/openai.yaml +7 -0
  49. package/dist/skills/legato-agora-cli/reference/kernel-with-golden.py +84 -0
  50. package/dist/skills/legato-site-feedback/SKILL.md +49 -0
  51. package/dist/skills/legato-site-feedback/agents/openai.yaml +7 -0
  52. package/package.json +16 -0
@@ -0,0 +1,199 @@
1
+ // scripts/install-skill.ts
2
+ import { access, copyFile, mkdir, readdir, rm, stat } from "node:fs/promises";
3
+ import { constants } from "node:fs";
4
+ import { homedir } from "node:os";
5
+ import path from "node:path";
6
+ import { fileURLToPath } from "node:url";
7
+ var SKILL_NAMES = ["legato-agora-cli", "legato-site-feedback"];
8
+ var USAGE = "Usage: lagora skill install [--target auto|all|codex|claude] [--dest skills-dir]";
9
+ async function installSkill(input) {
10
+ const args = parseArgs(input.argv);
11
+ for (const skillName of SKILL_NAMES) {
12
+ await assertSkillSource(path.join(input.packageRoot, "skills", skillName));
13
+ }
14
+ const targets = args.dest ? customTargets(path.resolve(input.cwd, args.dest)) : await platformTargets(args.target, input);
15
+ if (targets.length === 0) {
16
+ throw new SkillInstallError("No supported agent platform was detected. Use --target codex|claude or --dest <skills-dir>.");
17
+ }
18
+ for (const target of targets) {
19
+ const source = path.join(input.packageRoot, "skills", target.skillName);
20
+ await copySkill(source, target.destination, target.includeOpenAiMetadata);
21
+ }
22
+ return { installed: targets };
23
+ }
24
+ function parseArgs(argv) {
25
+ const command = argv[0];
26
+ if (command !== "install") {
27
+ throw new SkillInstallError(USAGE);
28
+ }
29
+ let target = "auto";
30
+ let dest;
31
+ for (let index = 1; index < argv.length; index += 1) {
32
+ const token = argv[index];
33
+ const value = argv[index + 1];
34
+ if (token === "--target") {
35
+ if (!value || value.startsWith("--")) throw new SkillInstallError("--target requires a value");
36
+ target = parseTarget(value);
37
+ index += 1;
38
+ continue;
39
+ }
40
+ if (token === "--dest") {
41
+ if (!value || value.startsWith("--")) throw new SkillInstallError("--dest requires a value");
42
+ dest = value;
43
+ index += 1;
44
+ continue;
45
+ }
46
+ if (token === "-h" || token === "--help") {
47
+ throw new SkillInstallError(USAGE);
48
+ }
49
+ throw new SkillInstallError(`Unknown argument: ${token}`);
50
+ }
51
+ return { target, dest };
52
+ }
53
+ function parseTarget(value) {
54
+ switch (value) {
55
+ case "auto":
56
+ case "all":
57
+ case "codex":
58
+ case "claude":
59
+ return value;
60
+ default:
61
+ throw new SkillInstallError(`Unsupported target: ${value}`);
62
+ }
63
+ }
64
+ async function platformTargets(target, input) {
65
+ const targets = [];
66
+ const wantsCodex = target === "auto" || target === "all" || target === "codex";
67
+ const wantsClaude = target === "auto" || target === "all" || target === "claude";
68
+ if (wantsCodex) {
69
+ const codexRoot = await codexSkillsRoot(input, target === "codex");
70
+ if (codexRoot) targets.push(...SKILL_NAMES.map((skillName) => platformTarget("codex", codexRoot, skillName)));
71
+ }
72
+ if (wantsClaude) {
73
+ const roots = await claudeSkillsRoots(input, target === "claude");
74
+ for (const root of roots) targets.push(...SKILL_NAMES.map((skillName) => platformTarget("claude", root, skillName)));
75
+ }
76
+ return uniqueTargets(targets);
77
+ }
78
+ async function codexSkillsRoot(input, explicit) {
79
+ const envRoot = input.env.CODEX_HOME?.trim();
80
+ if (envRoot) return path.join(envRoot, "skills");
81
+ const homeRoot = path.join(input.home, ".codex");
82
+ if (await exists(homeRoot)) return path.join(homeRoot, "skills");
83
+ if (await commandExists("codex", input.env)) return path.join(homeRoot, "skills");
84
+ return explicit ? path.join(homeRoot, "skills") : void 0;
85
+ }
86
+ async function claudeSkillsRoots(input, explicit) {
87
+ const roots = [];
88
+ const projectRoot = path.join(input.cwd, ".claude");
89
+ const homeRoot = path.join(input.home, ".claude");
90
+ if (await exists(projectRoot)) roots.push(path.join(projectRoot, "skills"));
91
+ if (await exists(homeRoot)) roots.push(path.join(homeRoot, "skills"));
92
+ if (roots.length === 0 && await commandExists("claude", input.env)) roots.push(path.join(homeRoot, "skills"));
93
+ if (roots.length === 0 && explicit) roots.push(path.join(projectRoot, "skills"));
94
+ return roots;
95
+ }
96
+ function platformTarget(platform, skillsRoot, skillName) {
97
+ return {
98
+ platform,
99
+ skillName,
100
+ skillsRoot,
101
+ destination: path.join(skillsRoot, skillName),
102
+ includeOpenAiMetadata: platform === "codex"
103
+ };
104
+ }
105
+ function customTarget(skillsRoot, skillName) {
106
+ return {
107
+ platform: "custom",
108
+ skillName,
109
+ skillsRoot,
110
+ destination: path.join(skillsRoot, skillName),
111
+ includeOpenAiMetadata: true
112
+ };
113
+ }
114
+ function customTargets(skillsRoot) {
115
+ return SKILL_NAMES.map((skillName) => customTarget(skillsRoot, skillName));
116
+ }
117
+ function uniqueTargets(targets) {
118
+ const seen = /* @__PURE__ */ new Set();
119
+ return targets.filter((target) => {
120
+ if (seen.has(target.destination)) return false;
121
+ seen.add(target.destination);
122
+ return true;
123
+ });
124
+ }
125
+ async function copySkill(source, destination, includeOpenAiMetadata) {
126
+ await rm(destination, { recursive: true, force: true });
127
+ await mkdir(destination, { recursive: true });
128
+ const entries = await readdir(source, { withFileTypes: true });
129
+ for (const entry of entries) {
130
+ if (!includeOpenAiMetadata && entry.name === "agents") continue;
131
+ const sourcePath = path.join(source, entry.name);
132
+ const destinationPath = path.join(destination, entry.name);
133
+ if (entry.isDirectory()) {
134
+ await copySkill(sourcePath, destinationPath, includeOpenAiMetadata);
135
+ continue;
136
+ }
137
+ if (entry.isFile()) {
138
+ await copyFile(sourcePath, destinationPath);
139
+ }
140
+ }
141
+ }
142
+ async function assertSkillSource(source) {
143
+ const info = await stat(source).catch((error) => {
144
+ if (error instanceof Error) throw new SkillInstallError(`Skill source is missing: ${source}`);
145
+ throw error;
146
+ });
147
+ if (!info.isDirectory()) throw new SkillInstallError(`Skill source is not a directory: ${source}`);
148
+ }
149
+ async function exists(targetPath) {
150
+ try {
151
+ await access(targetPath, constants.F_OK);
152
+ return true;
153
+ } catch (error) {
154
+ if (error instanceof Error) return false;
155
+ throw error;
156
+ }
157
+ }
158
+ async function commandExists(command, env) {
159
+ const searchPath = env.PATH ?? process.env.PATH ?? "";
160
+ const directories = searchPath.split(path.delimiter).filter((item) => item.length > 0);
161
+ for (const directory of directories) {
162
+ if (await exists(path.join(directory, command))) return true;
163
+ }
164
+ return false;
165
+ }
166
+ var SkillInstallError = class extends Error {
167
+ constructor(message) {
168
+ super(message);
169
+ this.name = "SkillInstallError";
170
+ }
171
+ };
172
+ async function main() {
173
+ const argv = process.argv.slice(2);
174
+ if (argv.includes("-h") || argv.includes("--help")) {
175
+ console.log(USAGE);
176
+ return;
177
+ }
178
+ const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
179
+ const result = await installSkill({
180
+ argv,
181
+ cwd: process.cwd(),
182
+ env: process.env,
183
+ home: homedir(),
184
+ packageRoot
185
+ });
186
+ console.log("Installed Lagora skills to:");
187
+ for (const target of result.installed) {
188
+ console.log(`- ${target.skillName}: ${target.destination} (${target.platform})`);
189
+ }
190
+ }
191
+ if (process.argv[1] === fileURLToPath(import.meta.url)) {
192
+ main().catch((error) => {
193
+ console.error(error instanceof Error ? error.message : error);
194
+ process.exit(1);
195
+ });
196
+ }
197
+ export {
198
+ installSkill
199
+ };
@@ -0,0 +1,22 @@
1
+ import {
2
+ addBlockerToStore,
3
+ assignIssueInStore,
4
+ checkoutIssueFromStore,
5
+ fetchIssueFromStore,
6
+ printIssueRecord,
7
+ saveSuggestionToStore,
8
+ syncBlockerInStore,
9
+ updateIssueDescriptionInStore,
10
+ updateIssueStatusInStore
11
+ } from "./chunk-NCJMUBTG.js";
12
+ export {
13
+ addBlockerToStore,
14
+ assignIssueInStore,
15
+ checkoutIssueFromStore,
16
+ fetchIssueFromStore,
17
+ printIssueRecord,
18
+ saveSuggestionToStore,
19
+ syncBlockerInStore,
20
+ updateIssueDescriptionInStore,
21
+ updateIssueStatusInStore
22
+ };