orbit-code-ai 0.1.38 → 0.1.39
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.mjs +325 -35
- package/package.json +1 -1
- package/skills/api-contract/SKILL.md +287 -0
- package/skills/apic-api/SKILL.md +309 -73
package/dist/cli.mjs
CHANGED
|
@@ -83792,7 +83792,7 @@ async function printStartupScreen() {
|
|
|
83792
83792
|
const sLen = ` ● ${sL} Ready — type /help to begin`.length;
|
|
83793
83793
|
out.push(boxRow(sRow, W2, sLen));
|
|
83794
83794
|
out.push(`${rgb(...BORDER)}╚${"═".repeat(W2 - 2)}╝${RESET}`);
|
|
83795
|
-
out.push(` ${DIM}${rgb(...DIMCOL)}orbit-code ${RESET}${rgb(...ACCENT)}v${"0.1.
|
|
83795
|
+
out.push(` ${DIM}${rgb(...DIMCOL)}orbit-code ${RESET}${rgb(...ACCENT)}v${"0.1.39"}${RESET}`);
|
|
83796
83796
|
out.push("");
|
|
83797
83797
|
process.stdout.write(out.join(`
|
|
83798
83798
|
`) + `
|
|
@@ -334299,7 +334299,7 @@ function getAnthropicEnvMetadata() {
|
|
|
334299
334299
|
function getBuildAgeMinutes() {
|
|
334300
334300
|
if (false)
|
|
334301
334301
|
;
|
|
334302
|
-
const buildTime = new Date("2026-07-
|
|
334302
|
+
const buildTime = new Date("2026-07-16T10:32:35.333Z").getTime();
|
|
334303
334303
|
if (isNaN(buildTime))
|
|
334304
334304
|
return;
|
|
334305
334305
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -358716,7 +358716,7 @@ function buildPrimarySection() {
|
|
|
358716
358716
|
}, undefined, false, undefined, this);
|
|
358717
358717
|
return [{
|
|
358718
358718
|
label: "Version",
|
|
358719
|
-
value: "0.1.
|
|
358719
|
+
value: "0.1.39"
|
|
358720
358720
|
}, {
|
|
358721
358721
|
label: "Session name",
|
|
358722
358722
|
value: nameValue
|
|
@@ -471025,7 +471025,7 @@ function WelcomeV2() {
|
|
|
471025
471025
|
dimColor: true,
|
|
471026
471026
|
children: [
|
|
471027
471027
|
"v",
|
|
471028
|
-
"0.1.
|
|
471028
|
+
"0.1.39",
|
|
471029
471029
|
" "
|
|
471030
471030
|
]
|
|
471031
471031
|
}, undefined, true, undefined, this)
|
|
@@ -471225,7 +471225,7 @@ function WelcomeV2() {
|
|
|
471225
471225
|
dimColor: true,
|
|
471226
471226
|
children: [
|
|
471227
471227
|
"v",
|
|
471228
|
-
"0.1.
|
|
471228
|
+
"0.1.39",
|
|
471229
471229
|
" "
|
|
471230
471230
|
]
|
|
471231
471231
|
}, undefined, true, undefined, this)
|
|
@@ -471451,7 +471451,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
471451
471451
|
dimColor: true,
|
|
471452
471452
|
children: [
|
|
471453
471453
|
"v",
|
|
471454
|
-
"0.1.
|
|
471454
|
+
"0.1.39",
|
|
471455
471455
|
" "
|
|
471456
471456
|
]
|
|
471457
471457
|
}, undefined, true, undefined, this);
|
|
@@ -471705,7 +471705,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
471705
471705
|
dimColor: true,
|
|
471706
471706
|
children: [
|
|
471707
471707
|
"v",
|
|
471708
|
-
"0.1.
|
|
471708
|
+
"0.1.39",
|
|
471709
471709
|
" "
|
|
471710
471710
|
]
|
|
471711
471711
|
}, undefined, true, undefined, this);
|
|
@@ -475730,6 +475730,294 @@ var init_aceSkills = __esm(() => {
|
|
|
475730
475730
|
init_bundledSkills();
|
|
475731
475731
|
});
|
|
475732
475732
|
|
|
475733
|
+
// src/utils/docx.ts
|
|
475734
|
+
import { readFileSync as readFileSync10 } from "fs";
|
|
475735
|
+
function escapeReg(s) {
|
|
475736
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
475737
|
+
}
|
|
475738
|
+
function decodeEntities(s) {
|
|
475739
|
+
return s.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/&#x([0-9a-fA-F]+);/g, (_m, h2) => String.fromCodePoint(parseInt(h2, 16))).replace(/&#(\d+);/g, (_m, d) => String.fromCodePoint(parseInt(d, 10))).replace(/&/g, "&");
|
|
475740
|
+
}
|
|
475741
|
+
function firstTag(xml, name, from) {
|
|
475742
|
+
const re = new RegExp(`<${escapeReg(name)}(?=[\\s/>])`, "g");
|
|
475743
|
+
re.lastIndex = from;
|
|
475744
|
+
const m = re.exec(xml);
|
|
475745
|
+
return m ? m.index : -1;
|
|
475746
|
+
}
|
|
475747
|
+
function findElementEnd(xml, openIdx, name) {
|
|
475748
|
+
const openRe = new RegExp(`<${escapeReg(name)}(?=[\\s/>])`, "g");
|
|
475749
|
+
const closeStr = `</${name}>`;
|
|
475750
|
+
let depth = 0;
|
|
475751
|
+
let i3 = openIdx;
|
|
475752
|
+
while (i3 < xml.length) {
|
|
475753
|
+
openRe.lastIndex = i3;
|
|
475754
|
+
const om = openRe.exec(xml);
|
|
475755
|
+
const openPos = om ? om.index : -1;
|
|
475756
|
+
const closePos = xml.indexOf(closeStr, i3);
|
|
475757
|
+
if (closePos === -1)
|
|
475758
|
+
return xml.length;
|
|
475759
|
+
if (openPos !== -1 && openPos < closePos) {
|
|
475760
|
+
const gt2 = xml.indexOf(">", openPos);
|
|
475761
|
+
const selfClosing = gt2 > 0 && xml[gt2 - 1] === "/";
|
|
475762
|
+
if (!selfClosing)
|
|
475763
|
+
depth++;
|
|
475764
|
+
i3 = gt2 + 1;
|
|
475765
|
+
} else {
|
|
475766
|
+
depth--;
|
|
475767
|
+
i3 = closePos + closeStr.length;
|
|
475768
|
+
if (depth === 0)
|
|
475769
|
+
return i3;
|
|
475770
|
+
}
|
|
475771
|
+
}
|
|
475772
|
+
return xml.length;
|
|
475773
|
+
}
|
|
475774
|
+
function runText(xml) {
|
|
475775
|
+
let s = "";
|
|
475776
|
+
const re = /<w:t(?:\s[^>]*)?>([\s\S]*?)<\/w:t>/g;
|
|
475777
|
+
let m;
|
|
475778
|
+
while ((m = re.exec(xml)) !== null)
|
|
475779
|
+
s += m[1];
|
|
475780
|
+
return decodeEntities(s);
|
|
475781
|
+
}
|
|
475782
|
+
function inner(xml, name) {
|
|
475783
|
+
const start = xml.indexOf(">");
|
|
475784
|
+
const end = xml.lastIndexOf(`</${name}>`);
|
|
475785
|
+
return start === -1 || end === -1 ? xml : xml.slice(start + 1, end);
|
|
475786
|
+
}
|
|
475787
|
+
function cellText(tcXml) {
|
|
475788
|
+
const body = inner(tcXml, "w:tc");
|
|
475789
|
+
const parts = [];
|
|
475790
|
+
let i3 = 0;
|
|
475791
|
+
while (i3 < body.length) {
|
|
475792
|
+
const pPos = firstTag(body, "w:p", i3);
|
|
475793
|
+
if (pPos === -1)
|
|
475794
|
+
break;
|
|
475795
|
+
const pEnd = findElementEnd(body, pPos, "w:p");
|
|
475796
|
+
const t = runText(body.slice(pPos, pEnd)).trim();
|
|
475797
|
+
if (t)
|
|
475798
|
+
parts.push(t);
|
|
475799
|
+
i3 = pEnd;
|
|
475800
|
+
}
|
|
475801
|
+
return parts.join(" ").replace(/\s+/g, " ").trim().replace(/\|/g, "\\|");
|
|
475802
|
+
}
|
|
475803
|
+
function rowCells(trXml) {
|
|
475804
|
+
const body = inner(trXml, "w:tr");
|
|
475805
|
+
const cells = [];
|
|
475806
|
+
let i3 = 0;
|
|
475807
|
+
while (i3 < body.length) {
|
|
475808
|
+
const nested = firstTag(body, "w:tbl", i3);
|
|
475809
|
+
const tc = firstTag(body, "w:tc", i3);
|
|
475810
|
+
if (tc === -1)
|
|
475811
|
+
break;
|
|
475812
|
+
if (nested !== -1 && nested < tc) {
|
|
475813
|
+
i3 = findElementEnd(body, nested, "w:tbl");
|
|
475814
|
+
continue;
|
|
475815
|
+
}
|
|
475816
|
+
const tcEnd = findElementEnd(body, tc, "w:tc");
|
|
475817
|
+
cells.push(cellText(body.slice(tc, tcEnd)));
|
|
475818
|
+
i3 = tcEnd;
|
|
475819
|
+
}
|
|
475820
|
+
return cells;
|
|
475821
|
+
}
|
|
475822
|
+
function renderTable(tblXml) {
|
|
475823
|
+
const body = inner(tblXml, "w:tbl");
|
|
475824
|
+
const rows = [];
|
|
475825
|
+
let i3 = 0;
|
|
475826
|
+
while (i3 < body.length) {
|
|
475827
|
+
const nested = firstTag(body, "w:tbl", i3);
|
|
475828
|
+
const tr = firstTag(body, "w:tr", i3);
|
|
475829
|
+
if (tr === -1)
|
|
475830
|
+
break;
|
|
475831
|
+
if (nested !== -1 && nested < tr) {
|
|
475832
|
+
i3 = findElementEnd(body, nested, "w:tbl");
|
|
475833
|
+
continue;
|
|
475834
|
+
}
|
|
475835
|
+
const trEnd = findElementEnd(body, tr, "w:tr");
|
|
475836
|
+
rows.push(rowCells(body.slice(tr, trEnd)));
|
|
475837
|
+
i3 = trEnd;
|
|
475838
|
+
}
|
|
475839
|
+
if (rows.length === 0)
|
|
475840
|
+
return "";
|
|
475841
|
+
const width = Math.max(...rows.map((r) => r.length));
|
|
475842
|
+
const pad = (r) => "| " + Array.from({ length: width }, (_, k) => r[k] ?? "").join(" | ") + " |";
|
|
475843
|
+
const md = [pad(rows[0]), "| " + Array(width).fill("---").join(" | ") + " |"];
|
|
475844
|
+
for (const r of rows.slice(1))
|
|
475845
|
+
md.push(pad(r));
|
|
475846
|
+
return md.join(`
|
|
475847
|
+
`);
|
|
475848
|
+
}
|
|
475849
|
+
function renderBody(bodyXml) {
|
|
475850
|
+
const out = [];
|
|
475851
|
+
let i3 = 0;
|
|
475852
|
+
while (i3 < bodyXml.length) {
|
|
475853
|
+
const p = firstTag(bodyXml, "w:p", i3);
|
|
475854
|
+
const tbl = firstTag(bodyXml, "w:tbl", i3);
|
|
475855
|
+
if (p === -1 && tbl === -1)
|
|
475856
|
+
break;
|
|
475857
|
+
if (tbl !== -1 && (p === -1 || tbl < p)) {
|
|
475858
|
+
const end = findElementEnd(bodyXml, tbl, "w:tbl");
|
|
475859
|
+
const t = renderTable(bodyXml.slice(tbl, end));
|
|
475860
|
+
if (t)
|
|
475861
|
+
out.push(t);
|
|
475862
|
+
i3 = end;
|
|
475863
|
+
} else {
|
|
475864
|
+
const end = findElementEnd(bodyXml, p, "w:p");
|
|
475865
|
+
const t = runText(bodyXml.slice(p, end)).trim();
|
|
475866
|
+
if (t)
|
|
475867
|
+
out.push(t);
|
|
475868
|
+
i3 = end;
|
|
475869
|
+
}
|
|
475870
|
+
}
|
|
475871
|
+
return out.join(`
|
|
475872
|
+
|
|
475873
|
+
`);
|
|
475874
|
+
}
|
|
475875
|
+
async function extractDocxText(filePath, maxChars = 60000) {
|
|
475876
|
+
const { unzipSync: unzipSync2 } = await Promise.resolve().then(() => (init_esm3(), exports_esm));
|
|
475877
|
+
const data = readFileSync10(filePath);
|
|
475878
|
+
let files2;
|
|
475879
|
+
try {
|
|
475880
|
+
files2 = unzipSync2(new Uint8Array(data), {
|
|
475881
|
+
filter: (f) => f.name === "word/document.xml"
|
|
475882
|
+
});
|
|
475883
|
+
} catch (e2) {
|
|
475884
|
+
throw new Error(`Not a readable .docx (unzip failed): ${e2.message}`);
|
|
475885
|
+
}
|
|
475886
|
+
const bytes = files2["word/document.xml"];
|
|
475887
|
+
if (!bytes) {
|
|
475888
|
+
throw new Error("word/document.xml not found — the file is not a valid .docx (a .doc or renamed file?).");
|
|
475889
|
+
}
|
|
475890
|
+
const xml = new TextDecoder("utf-8").decode(bytes);
|
|
475891
|
+
const bodyMatch = xml.match(/<w:body[^>]*>([\s\S]*)<\/w:body>/);
|
|
475892
|
+
const text = renderBody(bodyMatch ? bodyMatch[1] : xml).trim();
|
|
475893
|
+
if (text.length > maxChars) {
|
|
475894
|
+
return `${text.slice(0, maxChars)}
|
|
475895
|
+
|
|
475896
|
+
…[truncated; ${text.length} chars total]…`;
|
|
475897
|
+
}
|
|
475898
|
+
return text;
|
|
475899
|
+
}
|
|
475900
|
+
var init_docx = () => {};
|
|
475901
|
+
|
|
475902
|
+
// src/skills/bundled/lld.ts
|
|
475903
|
+
function textBlock(text) {
|
|
475904
|
+
return [{ type: "text", text }];
|
|
475905
|
+
}
|
|
475906
|
+
function parseArgs(args) {
|
|
475907
|
+
const trimmed = args.trim();
|
|
475908
|
+
let path20 = "";
|
|
475909
|
+
let rest = "";
|
|
475910
|
+
const quoted = trimmed.match(/^["']([^"']+)["']\s*(.*)$/);
|
|
475911
|
+
if (quoted) {
|
|
475912
|
+
path20 = quoted[1];
|
|
475913
|
+
rest = quoted[2];
|
|
475914
|
+
} else {
|
|
475915
|
+
const dotdocx = trimmed.match(/^(.*?\.docx)\s*(.*)$/i);
|
|
475916
|
+
if (dotdocx) {
|
|
475917
|
+
path20 = dotdocx[1].trim();
|
|
475918
|
+
rest = dotdocx[2];
|
|
475919
|
+
} else {
|
|
475920
|
+
rest = trimmed;
|
|
475921
|
+
}
|
|
475922
|
+
}
|
|
475923
|
+
const t = rest.match(/\b(contract|api|both)\b/i)?.[1]?.toLowerCase();
|
|
475924
|
+
const target = t === "contract" || t === "api" ? t : "both";
|
|
475925
|
+
return { path: path20.replace(/[.,;]$/, ""), target };
|
|
475926
|
+
}
|
|
475927
|
+
function buildPrompt(path20, content, target) {
|
|
475928
|
+
const gen = target === "contract" ? "the CONTRACT only (invoke /api-contract)" : target === "api" ? "the GATEWAY API only (invoke /apic-api)" : "BOTH the contract (/api-contract) and the gateway API (/apic-api)";
|
|
475929
|
+
return `You are turning an LLD (Low-Level Design) Word document into APIC artifacts. The full LLD text
|
|
475930
|
+
below was extracted from ${path20} (paragraphs as text, tables as markdown). Requested output: ${gen}.
|
|
475931
|
+
|
|
475932
|
+
════════════════════ EXTRACTED LLD ════════════════════
|
|
475933
|
+
${content}
|
|
475934
|
+
════════════════════ END LLD ════════════════════
|
|
475935
|
+
|
|
475936
|
+
Do this, in order:
|
|
475937
|
+
|
|
475938
|
+
1. EXTRACT the API spec from the LLD above, using this house-template map (sections/tables → fields):
|
|
475939
|
+
- Introduction (Purpose / Scope) → API title + description.
|
|
475940
|
+
- "Integration flow (<op>)" → its "API Gateway endpoint" and "Method" → the operation path + verb.
|
|
475941
|
+
- "<op> Request" table → request model. Columns are typically Field | Type | Occurrence | Length |
|
|
475942
|
+
Description | Validation. Convert: Occurrence M → required; O/C → optional (put the C rule in
|
|
475943
|
+
description); Length N → maxLength; allowed-values → enum; "1..*" → array (minItems 1 when ≥1).
|
|
475944
|
+
- "<op> Response" table + any "<type>" tables (e.g. commodity_type) → response model (nested/arrays).
|
|
475945
|
+
- "Error Codes" table + any sample error bodies → error responses (HTTP codes + error schema).
|
|
475946
|
+
- "Transformation Specifications" tables → how request fields map to the backend + any defaulting.
|
|
475947
|
+
- "Annex / Provider" (endpoints, auth) → the backend/provider endpoint(s) and their auth.
|
|
475948
|
+
- Integration pattern: if the middleware is an existing ACE/webMethods service that already returns
|
|
475949
|
+
the response envelope, it is a **wrapper**; if APIC calls a raw backend and must build the
|
|
475950
|
+
envelope, it is **backend**. State which and why.
|
|
475951
|
+
|
|
475952
|
+
2. ECHO a concise EXTRACTION SUMMARY to the user FIRST (do NOT generate yet): API name, pattern,
|
|
475953
|
+
each operation (verb + path), request/response field lists, error codes, backend endpoint, and the
|
|
475954
|
+
fields you could NOT determine. Then ask for the unguessables only: OpenAPI 2.0 vs 3.0; inbound
|
|
475955
|
+
consumer auth (basic/apikey/oauth2); host; and (for /apic-api) JWT on/off + crypto object and the
|
|
475956
|
+
backend target-url variable. NEVER fabricate hosts, crypto objects, scopes, or business fields — ask
|
|
475957
|
+
or use clearly-marked CHANGEME placeholders and list them.
|
|
475958
|
+
|
|
475959
|
+
3. After the user confirms/corrects, GENERATE ${gen}:
|
|
475960
|
+
- Contract → invoke the /api-contract skill, passing the API name, host, security, and the full
|
|
475961
|
+
request/response/error models you extracted.
|
|
475962
|
+
- Gateway API → invoke the /apic-api skill, passing the operation (name, verb, basePath, explicit
|
|
475963
|
+
path), the chosen --pattern (wrapper vs backend), the backend target-url, and the flags. One
|
|
475964
|
+
/apic-api call per operation.
|
|
475965
|
+
Reuse the values from the extraction summary verbatim — do not re-derive or drop fields.
|
|
475966
|
+
|
|
475967
|
+
Ground everything in the extracted LLD above; if the LLD does not state something, say so rather than
|
|
475968
|
+
inventing it.`;
|
|
475969
|
+
}
|
|
475970
|
+
async function handle(args) {
|
|
475971
|
+
const { path: path20, target } = parseArgs(args);
|
|
475972
|
+
if (!path20)
|
|
475973
|
+
return HELP;
|
|
475974
|
+
let content;
|
|
475975
|
+
try {
|
|
475976
|
+
content = await extractDocxText(path20);
|
|
475977
|
+
} catch (e2) {
|
|
475978
|
+
return `Could not read the LLD at "${path20}": ${e2.message}
|
|
475979
|
+
|
|
475980
|
+
Give the full path to a .docx file, e.g.
|
|
475981
|
+
/lld "C:\\\\path\\\\to\\\\LLD.docx" both`;
|
|
475982
|
+
}
|
|
475983
|
+
if (!content.trim()) {
|
|
475984
|
+
return `The LLD at "${path20}" extracted no text (it may be image-only or empty). I can't generate from it — confirm the file, or paste the request/response models directly.`;
|
|
475985
|
+
}
|
|
475986
|
+
return buildPrompt(path20, content, target);
|
|
475987
|
+
}
|
|
475988
|
+
function registerLldSkill() {
|
|
475989
|
+
registerBundledSkill({
|
|
475990
|
+
name: "lld",
|
|
475991
|
+
description: "Read an LLD (.docx) Word document — paragraphs and tables — extract the API spec against the house template, confirm it, then generate the contract-only OpenAPI (/api-contract) and/or the APIC gateway API (/apic-api) from it.",
|
|
475992
|
+
whenToUse: "When the user points at an LLD .docx and wants the APIC contract and/or gateway API generated from it (LLD → YAML).",
|
|
475993
|
+
argumentHint: '"<path-to-LLD.docx>" [contract|api|both]',
|
|
475994
|
+
userInvocable: true,
|
|
475995
|
+
allowedTools: ["Read", "Glob", "Grep"],
|
|
475996
|
+
async getPromptForCommand(args) {
|
|
475997
|
+
try {
|
|
475998
|
+
return textBlock(await handle(args));
|
|
475999
|
+
} catch (e2) {
|
|
476000
|
+
return textBlock(`/lld error: ${e2.message}`);
|
|
476001
|
+
}
|
|
476002
|
+
}
|
|
476003
|
+
});
|
|
476004
|
+
}
|
|
476005
|
+
var HELP = `# /lld — read an LLD (.docx) and generate the APIC contract and/or gateway API
|
|
476006
|
+
|
|
476007
|
+
Usage:
|
|
476008
|
+
/lld "<path-to-LLD.docx>" [contract|api|both]
|
|
476009
|
+
|
|
476010
|
+
- contract → generate the contract-only OpenAPI via /api-contract
|
|
476011
|
+
- api → generate the gateway implementation via /apic-api
|
|
476012
|
+
- both → generate both (default)
|
|
476013
|
+
|
|
476014
|
+
Reads the Word LLD (paragraphs + tables), extracts the API spec against the house template,
|
|
476015
|
+
shows you an extraction summary to confirm, then hands off to the generator skill(s).`;
|
|
476016
|
+
var init_lld = __esm(() => {
|
|
476017
|
+
init_bundledSkills();
|
|
476018
|
+
init_docx();
|
|
476019
|
+
});
|
|
476020
|
+
|
|
475733
476021
|
// src/skills/bundled/orbitInChrome.ts
|
|
475734
476022
|
function registerOrbitInChromeSkill() {
|
|
475735
476023
|
registerBundledSkill({
|
|
@@ -477312,7 +477600,7 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
477312
477600
|
if (value !== null && value !== undefined) {
|
|
477313
477601
|
if (typeof value !== "object" && typeof value !== "function")
|
|
477314
477602
|
throw new TypeError("Object expected.");
|
|
477315
|
-
var dispose4,
|
|
477603
|
+
var dispose4, inner2;
|
|
477316
477604
|
if (async) {
|
|
477317
477605
|
if (!Symbol.asyncDispose)
|
|
477318
477606
|
throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
@@ -477323,14 +477611,14 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
477323
477611
|
throw new TypeError("Symbol.dispose is not defined.");
|
|
477324
477612
|
dispose4 = value[Symbol.dispose];
|
|
477325
477613
|
if (async)
|
|
477326
|
-
|
|
477614
|
+
inner2 = dispose4;
|
|
477327
477615
|
}
|
|
477328
477616
|
if (typeof dispose4 !== "function")
|
|
477329
477617
|
throw new TypeError("Object not disposable.");
|
|
477330
|
-
if (
|
|
477618
|
+
if (inner2)
|
|
477331
477619
|
dispose4 = function() {
|
|
477332
477620
|
try {
|
|
477333
|
-
|
|
477621
|
+
inner2.call(this);
|
|
477334
477622
|
} catch (e2) {
|
|
477335
477623
|
return Promise.reject(e2);
|
|
477336
477624
|
}
|
|
@@ -510361,7 +510649,7 @@ ${declareVars || " -- (no parameters)"}${resultHandling}`;
|
|
|
510361
510649
|
}
|
|
510362
510650
|
|
|
510363
510651
|
// src/skills/bundled/sql.ts
|
|
510364
|
-
function
|
|
510652
|
+
function textBlock2(text) {
|
|
510365
510653
|
return [{ type: "text", text }];
|
|
510366
510654
|
}
|
|
510367
510655
|
function parseConnectArgs(args) {
|
|
@@ -510600,22 +510888,22 @@ Do this, in order:
|
|
|
510600
510888
|
|
|
510601
510889
|
Data-handling notice (state once): these are REAL values from the connected database and may include personal/production data. Return them as-is; never fabricate. If a SELECT returns no rows, say so plainly — for a happy case it means no qualifying data exists; do not invent a row. If the app calls no stored procedures at all, build the input body from the XSD types alone and clearly mark those values as synthetic (no DB row backs them).`;
|
|
510602
510890
|
}
|
|
510603
|
-
async function
|
|
510891
|
+
async function handle2(args) {
|
|
510604
510892
|
const trimmed = args.trim();
|
|
510605
510893
|
if (!trimmed)
|
|
510606
|
-
return
|
|
510894
|
+
return HELP2;
|
|
510607
510895
|
const firstTok = trimmed.split(/\s+/)[0].toLowerCase();
|
|
510608
510896
|
const restStr = trimmed.slice(trimmed.split(/\s+/)[0].length).trim();
|
|
510609
510897
|
switch (firstTok) {
|
|
510610
510898
|
case "help":
|
|
510611
|
-
return
|
|
510899
|
+
return HELP2;
|
|
510612
510900
|
case "connect": {
|
|
510613
510901
|
const parsed = parseConnectArgs(restStr);
|
|
510614
510902
|
const missing = ["server", "database", "user", "password"].filter((k) => !parsed[k]);
|
|
510615
510903
|
if (missing.length > 0)
|
|
510616
510904
|
return `Missing required field(s): ${missing.join(", ")}.
|
|
510617
510905
|
|
|
510618
|
-
${
|
|
510906
|
+
${HELP2}`;
|
|
510619
510907
|
const conn2 = parsed;
|
|
510620
510908
|
const saved = saveSqlConnection(conn2);
|
|
510621
510909
|
let testMsg;
|
|
@@ -510743,14 +511031,14 @@ function registerSqlSkill() {
|
|
|
510743
511031
|
allowedTools: ["Read", "Glob", "Grep"],
|
|
510744
511032
|
async getPromptForCommand(args) {
|
|
510745
511033
|
try {
|
|
510746
|
-
return
|
|
511034
|
+
return textBlock2(await handle2(args));
|
|
510747
511035
|
} catch (e2) {
|
|
510748
|
-
return
|
|
511036
|
+
return textBlock2(`/sql error: ${e2.message}`);
|
|
510749
511037
|
}
|
|
510750
511038
|
}
|
|
510751
511039
|
});
|
|
510752
511040
|
}
|
|
510753
|
-
var
|
|
511041
|
+
var HELP2, GROUND = `
|
|
510754
511042
|
|
|
510755
511043
|
IMPORTANT: The metadata above is the ONLY database information you have — you cannot query the DB yourself. State only what appears above; never invent, guess, or "fill in" parameters, columns, types, or procedures. If something is not shown, say it is not shown.`, STOPWORDS;
|
|
510756
511044
|
var init_sql = __esm(() => {
|
|
@@ -510758,7 +511046,7 @@ var init_sql = __esm(() => {
|
|
|
510758
511046
|
init_connectionStore();
|
|
510759
511047
|
init_mssqlClient();
|
|
510760
511048
|
init_spMetadata();
|
|
510761
|
-
|
|
511049
|
+
HELP2 = `# /sql — SQL Server helper (native connection)
|
|
510762
511050
|
|
|
510763
511051
|
Subcommands (also understands plain English, e.g. "/sql details of the SP Get_UserInformation"):
|
|
510764
511052
|
- \`/sql connect server=HOST database=DB user=USER password=PASS [port=1433] [encrypt=false]\` — save the connection once (OS secure vault; password never written to disk in plaintext).
|
|
@@ -511321,6 +511609,7 @@ If a hook isn't running:
|
|
|
511321
511609
|
function initBundledSkills() {
|
|
511322
511610
|
registerAceSkills();
|
|
511323
511611
|
registerSqlSkill();
|
|
511612
|
+
registerLldSkill();
|
|
511324
511613
|
registerUpdateConfigSkill();
|
|
511325
511614
|
if (false) {}
|
|
511326
511615
|
if (false) {}
|
|
@@ -511335,6 +511624,7 @@ function initBundledSkills() {
|
|
|
511335
511624
|
var init_bundled = __esm(() => {
|
|
511336
511625
|
init_setup2();
|
|
511337
511626
|
init_aceSkills();
|
|
511627
|
+
init_lld();
|
|
511338
511628
|
init_orbitInChrome();
|
|
511339
511629
|
init_sql();
|
|
511340
511630
|
init_updateConfig();
|
|
@@ -522792,7 +523082,7 @@ ${m.text}
|
|
|
522792
523082
|
let bridgeFailureDetail;
|
|
522793
523083
|
try {
|
|
522794
523084
|
const { initReplBridge: initReplBridge2 } = await Promise.resolve().then(() => (init_initReplBridge(), exports_initReplBridge));
|
|
522795
|
-
const
|
|
523085
|
+
const handle3 = await initReplBridge2({
|
|
522796
523086
|
onInboundMessage(msg) {
|
|
522797
523087
|
const fields = extractInboundMessageFields(msg);
|
|
522798
523088
|
if (!fields)
|
|
@@ -522845,21 +523135,21 @@ ${m.text}
|
|
|
522845
523135
|
},
|
|
522846
523136
|
initialMessages: mutableMessages.length > 0 ? mutableMessages : undefined
|
|
522847
523137
|
});
|
|
522848
|
-
if (!
|
|
523138
|
+
if (!handle3) {
|
|
522849
523139
|
sendControlResponseError(message, bridgeFailureDetail ?? "Remote Control initialization failed");
|
|
522850
523140
|
} else {
|
|
522851
|
-
bridgeHandle =
|
|
523141
|
+
bridgeHandle = handle3;
|
|
522852
523142
|
bridgeLastForwardedIndex = mutableMessages.length;
|
|
522853
523143
|
structuredIO.setOnControlRequestSent((request) => {
|
|
522854
|
-
|
|
523144
|
+
handle3.sendControlRequest(request);
|
|
522855
523145
|
});
|
|
522856
523146
|
structuredIO.setOnControlRequestResolved((requestId) => {
|
|
522857
|
-
|
|
523147
|
+
handle3.sendControlCancelRequest(requestId);
|
|
522858
523148
|
});
|
|
522859
523149
|
sendControlResponseSuccess(message, {
|
|
522860
|
-
session_url: getRemoteSessionUrl(
|
|
522861
|
-
connect_url: buildBridgeConnectUrl(
|
|
522862
|
-
environment_id:
|
|
523150
|
+
session_url: getRemoteSessionUrl(handle3.bridgeSessionId, handle3.sessionIngressUrl),
|
|
523151
|
+
connect_url: buildBridgeConnectUrl(handle3.environmentId, handle3.sessionIngressUrl),
|
|
523152
|
+
environment_id: handle3.environmentId
|
|
522863
523153
|
});
|
|
522864
523154
|
}
|
|
522865
523155
|
} catch (err2) {
|
|
@@ -525467,7 +525757,7 @@ __export(exports_main, {
|
|
|
525467
525757
|
startDeferredPrefetches: () => startDeferredPrefetches,
|
|
525468
525758
|
main: () => main
|
|
525469
525759
|
});
|
|
525470
|
-
import { readFileSync as
|
|
525760
|
+
import { readFileSync as readFileSync11 } from "fs";
|
|
525471
525761
|
import { resolve as resolve40 } from "path";
|
|
525472
525762
|
function logManagedSettings() {
|
|
525473
525763
|
try {
|
|
@@ -525623,7 +525913,7 @@ function loadSettingsFromFlag(settingsFile) {
|
|
|
525623
525913
|
resolvedPath: resolvedSettingsPath
|
|
525624
525914
|
} = safeResolvePath(getFsImplementation(), settingsFile);
|
|
525625
525915
|
try {
|
|
525626
|
-
|
|
525916
|
+
readFileSync11(resolvedSettingsPath, "utf8");
|
|
525627
525917
|
} catch (e2) {
|
|
525628
525918
|
if (isENOENT(e2)) {
|
|
525629
525919
|
process.stderr.write(source_default.red(`Error: Settings file not found: ${resolvedSettingsPath}
|
|
@@ -526026,7 +526316,7 @@ ${getTmuxInstallInstructions2()}
|
|
|
526026
526316
|
}
|
|
526027
526317
|
try {
|
|
526028
526318
|
const filePath = resolve40(options2.systemPromptFile);
|
|
526029
|
-
systemPrompt =
|
|
526319
|
+
systemPrompt = readFileSync11(filePath, "utf8");
|
|
526030
526320
|
} catch (error41) {
|
|
526031
526321
|
const code = getErrnoCode(error41);
|
|
526032
526322
|
if (code === "ENOENT") {
|
|
@@ -526048,7 +526338,7 @@ ${getTmuxInstallInstructions2()}
|
|
|
526048
526338
|
}
|
|
526049
526339
|
try {
|
|
526050
526340
|
const filePath = resolve40(options2.appendSystemPromptFile);
|
|
526051
|
-
appendSystemPrompt =
|
|
526341
|
+
appendSystemPrompt = readFileSync11(filePath, "utf8");
|
|
526052
526342
|
} catch (error41) {
|
|
526053
526343
|
const code = getErrnoCode(error41);
|
|
526054
526344
|
if (code === "ENOENT") {
|
|
@@ -527424,7 +527714,7 @@ Usage: orbit --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
527424
527714
|
pendingHookMessages
|
|
527425
527715
|
}, renderAndRun);
|
|
527426
527716
|
}
|
|
527427
|
-
}).version("0.1.
|
|
527717
|
+
}).version("0.1.39 (Orbit AI)", "-v, --version", "Output the version number");
|
|
527428
527718
|
program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
527429
527719
|
program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
527430
527720
|
if (canUserConfigureAdvisor()) {
|
|
@@ -527946,7 +528236,7 @@ if (false) {}
|
|
|
527946
528236
|
async function main2() {
|
|
527947
528237
|
const args = process.argv.slice(2);
|
|
527948
528238
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
527949
|
-
console.log(`${"0.1.
|
|
528239
|
+
console.log(`${"0.1.39"} (Orbit AI)`);
|
|
527950
528240
|
return;
|
|
527951
528241
|
}
|
|
527952
528242
|
if (args.includes("--provider")) {
|
|
@@ -528054,4 +528344,4 @@ async function main2() {
|
|
|
528054
528344
|
}
|
|
528055
528345
|
main2();
|
|
528056
528346
|
|
|
528057
|
-
//# debugId=
|
|
528347
|
+
//# debugId=3DB19D92C131358564756E2164756E21
|