@galaxy-stack/ai-coder-core 0.3.2 → 0.3.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/CHANGELOG.d/2026-09-30-galaxy-credentials.md +15 -0
- package/CHANGELOG.md +10 -0
- package/dist/adapters/node/config/galaxy-credentials.d.ts +58 -0
- package/dist/adapters/node/config/galaxy-credentials.d.ts.map +1 -0
- package/dist/adapters/node/config/galaxy-credentials.js +216 -0
- package/dist/adapters/node/config/galaxy-credentials.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# 2026-09-30 — Tài liệu credential dùng chung cho mọi Galaxy host
|
|
2
|
+
|
|
3
|
+
Vùng: adapters/node/config
|
|
4
|
+
|
|
5
|
+
## Thêm
|
|
6
|
+
- `galaxy-credentials`: một tài liệu YAML chỉ chủ sở hữu đọc được
|
|
7
|
+
(`~/.galaxy/credentials.yaml`, shape `version: 1`, `refs: <ref> -> <secret>`) để desktop app,
|
|
8
|
+
CLI, extension VS Code và web GUI cùng đọc/ghi một nguồn secret. Module sửa theo dòng thay vì
|
|
9
|
+
parse/ghi lại YAML để không phá comment/định dạng của writer khác.
|
|
10
|
+
- Test `test/galaxy-credentials.test.ts`.
|
|
11
|
+
|
|
12
|
+
## Vì sao cần phát hành
|
|
13
|
+
- CLI 2.0.3 (đã lên npm) import `@galaxy-stack/ai-coder-core/adapters/node/config/galaxy-credentials`;
|
|
14
|
+
core 0.3.2 chưa có module này nên bản CLI đó crash lúc khởi động
|
|
15
|
+
(`ERR_MODULE_NOT_FOUND`). 0.3.3 đưa module vào bản phát hành, và CLI 2.0.4 pin core 0.3.3.
|
package/CHANGELOG.md
CHANGED
|
@@ -16,6 +16,16 @@ Times are recorded in Asia/Ho_Chi_Minh (+07:00). Per-fix fragments are filed in
|
|
|
16
16
|
- Agent tự quyết timeout của lệnh, host chỉ giữ backstop suy ra từ lựa chọn đó.
|
|
17
17
|
- Timeout của run_command theo đúng cơ chế DeepSeek Harness.
|
|
18
18
|
|
|
19
|
+
## [0.3.3] - 2026-09-30 18:07 +0700
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- Baseline review chỉ tính file nguồn, không chết vì install/build chạy nền.
|
|
24
|
+
- Tài liệu credential dùng chung cho mọi Galaxy host.
|
|
25
|
+
- Shell persistent cho run_command, giống DeepSeek Harness.
|
|
26
|
+
- Agent tự quyết timeout của lệnh, host chỉ giữ backstop suy ra từ lựa chọn đó.
|
|
27
|
+
- Timeout của run_command theo đúng cơ chế DeepSeek Harness.
|
|
28
|
+
|
|
19
29
|
## [0.3.1] - 2026-09-29 05:25 +07:00
|
|
20
30
|
|
|
21
31
|
### Fixed
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Galaxy keeps every provider secret in one owner-only YAML document,
|
|
3
|
+
* `~/.galaxy/credentials.yaml`, written in the shape the DeepSeek Harness
|
|
4
|
+
* credential store reads (`version: 1`, `refs: <ref> -> <secret>`). Pointing DSH
|
|
5
|
+
* at this file is a one-row profile patch, so the desktop app, the CLI, the VS
|
|
6
|
+
* Code extension and the web GUI all read and write the same secrets.
|
|
7
|
+
*
|
|
8
|
+
* The editor works on lines instead of round-tripping YAML on purpose: the file
|
|
9
|
+
* is shared with another writer that preserves comments and formatting, and a
|
|
10
|
+
* full parse/render would silently reformat or drop entries this module does not
|
|
11
|
+
* own (including DSH's `records` block).
|
|
12
|
+
*/
|
|
13
|
+
/** File name inside the Galaxy home. */
|
|
14
|
+
export declare const GALAXY_CREDENTIALS_FILENAME = "credentials.yaml";
|
|
15
|
+
/** Document version this module writes; DSH refuses an unversioned document. */
|
|
16
|
+
export declare const GALAXY_CREDENTIALS_VERSION = 1;
|
|
17
|
+
/** Absent or unreadable documents read as empty rather than throwing. */
|
|
18
|
+
export interface GalaxyCredentialsDocument {
|
|
19
|
+
readonly refs: Readonly<Record<string, string>>;
|
|
20
|
+
readonly version: number | undefined;
|
|
21
|
+
}
|
|
22
|
+
/** Absolute path of the shared credential document. */
|
|
23
|
+
export declare function galaxyCredentialsPath(home?: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Reference name for one provider id: `galaxy` → `GBH_GALAXY_API_KEY`,
|
|
26
|
+
* `my-gateway` → `GBH_MY_GATEWAY_API_KEY`. DSH resolves a route's `apiKeyEnv`
|
|
27
|
+
* against these names, so the mapping has to be derivable, never hand-kept.
|
|
28
|
+
*/
|
|
29
|
+
export declare function galaxyRefName(providerId: string): string;
|
|
30
|
+
/** Quote a scalar the way the shared document expects, only when it must. */
|
|
31
|
+
export declare function renderRefValue(value: string): string;
|
|
32
|
+
/** Parse the document's refs and version. A flat pre-version file still reads. */
|
|
33
|
+
export declare function parseGalaxyCredentials(text: string): GalaxyCredentialsDocument;
|
|
34
|
+
/** Read the document; a missing file is an empty document, never an error. */
|
|
35
|
+
export declare function readGalaxyCredentials(path?: string): GalaxyCredentialsDocument;
|
|
36
|
+
/** One reference value, or undefined when it is absent or empty. */
|
|
37
|
+
export declare function readGalaxyCredential(ref: string, path?: string): string | undefined;
|
|
38
|
+
/** Owner-only mode and the refs present, for `config doctor`. */
|
|
39
|
+
export interface GalaxyCredentialsHealth {
|
|
40
|
+
readonly exists: boolean;
|
|
41
|
+
readonly mode: string | undefined;
|
|
42
|
+
readonly ownerOnly: boolean;
|
|
43
|
+
readonly refs: readonly string[];
|
|
44
|
+
readonly version: number | undefined;
|
|
45
|
+
}
|
|
46
|
+
export declare function galaxyCredentialsHealth(path?: string): GalaxyCredentialsHealth;
|
|
47
|
+
/**
|
|
48
|
+
* Insert, replace, or remove one reference while leaving every other byte of the
|
|
49
|
+
* document — comments, formatting, and DSH's own `records` block — untouched.
|
|
50
|
+
*
|
|
51
|
+
* @param ref - reference name to write.
|
|
52
|
+
* @param value - secret value; an empty string removes the reference.
|
|
53
|
+
* @param path - document path, defaulting to the shared Galaxy home.
|
|
54
|
+
*/
|
|
55
|
+
export declare function upsertGalaxyCredential(ref: string, value: string, path?: string): void;
|
|
56
|
+
/** Write several references in one locked pass. */
|
|
57
|
+
export declare function upsertGalaxyCredentials(entries: Readonly<Record<string, string>>, path?: string): void;
|
|
58
|
+
//# sourceMappingURL=galaxy-credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"galaxy-credentials.d.ts","sourceRoot":"","sources":["../../../../src/adapters/node/config/galaxy-credentials.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;GAWG;AAEH,wCAAwC;AACxC,eAAO,MAAM,2BAA2B,qBAAqB,CAAC;AAC9D,gFAAgF;AAChF,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C,yEAAyE;AACzE,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAChD,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED,uDAAuD;AACvD,wBAAgB,qBAAqB,CAAC,IAAI,GAAE,MAAkB,GAAG,MAAM,CAEtE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAGxD;AAaD,6EAA6E;AAC7E,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEpD;AAyBD,kFAAkF;AAClF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,yBAAyB,CAoB9E;AAED,8EAA8E;AAC9E,wBAAgB,qBAAqB,CAAC,IAAI,GAAE,MAAgC,GAAG,yBAAyB,CAMvG;AAED,oEAAoE;AACpE,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,MAAgC,GAAG,MAAM,GAAG,SAAS,CAG5G;AAED,iEAAiE;AACjE,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED,wBAAgB,uBAAuB,CAAC,IAAI,GAAE,MAAgC,GAAG,uBAAuB,CAcvG;AAsCD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,MAAgC,GAAG,IAAI,CAgC/G;AAED,mDAAmD;AACnD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,IAAI,GAAE,MAAgC,GAAG,IAAI,CAE/H"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Bùi Trọng Hiếu
|
|
3
|
+
* @email kevinbui210191@gmail.com
|
|
4
|
+
* @create date 2026-09-29
|
|
5
|
+
* @desc The Galaxy credential document — one secrets file for every Galaxy host.
|
|
6
|
+
*/
|
|
7
|
+
import { closeSync, existsSync, mkdirSync, openSync, readFileSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
8
|
+
import { homedir } from "node:os";
|
|
9
|
+
import { dirname, join } from "node:path";
|
|
10
|
+
/**
|
|
11
|
+
* Galaxy keeps every provider secret in one owner-only YAML document,
|
|
12
|
+
* `~/.galaxy/credentials.yaml`, written in the shape the DeepSeek Harness
|
|
13
|
+
* credential store reads (`version: 1`, `refs: <ref> -> <secret>`). Pointing DSH
|
|
14
|
+
* at this file is a one-row profile patch, so the desktop app, the CLI, the VS
|
|
15
|
+
* Code extension and the web GUI all read and write the same secrets.
|
|
16
|
+
*
|
|
17
|
+
* The editor works on lines instead of round-tripping YAML on purpose: the file
|
|
18
|
+
* is shared with another writer that preserves comments and formatting, and a
|
|
19
|
+
* full parse/render would silently reformat or drop entries this module does not
|
|
20
|
+
* own (including DSH's `records` block).
|
|
21
|
+
*/
|
|
22
|
+
/** File name inside the Galaxy home. */
|
|
23
|
+
export const GALAXY_CREDENTIALS_FILENAME = "credentials.yaml";
|
|
24
|
+
/** Document version this module writes; DSH refuses an unversioned document. */
|
|
25
|
+
export const GALAXY_CREDENTIALS_VERSION = 1;
|
|
26
|
+
/** Absolute path of the shared credential document. */
|
|
27
|
+
export function galaxyCredentialsPath(home = homedir()) {
|
|
28
|
+
return join(home, ".galaxy", GALAXY_CREDENTIALS_FILENAME);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Reference name for one provider id: `galaxy` → `GBH_GALAXY_API_KEY`,
|
|
32
|
+
* `my-gateway` → `GBH_MY_GATEWAY_API_KEY`. DSH resolves a route's `apiKeyEnv`
|
|
33
|
+
* against these names, so the mapping has to be derivable, never hand-kept.
|
|
34
|
+
*/
|
|
35
|
+
export function galaxyRefName(providerId) {
|
|
36
|
+
const normalized = providerId.trim().replace(/[^A-Za-z0-9]+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
|
|
37
|
+
return `GBH_${normalized.length === 0 ? "PROVIDER" : normalized}_API_KEY`;
|
|
38
|
+
}
|
|
39
|
+
function unquote(raw) {
|
|
40
|
+
const value = raw.trim();
|
|
41
|
+
if (value.length >= 2 && value.startsWith('"') && value.endsWith('"')) {
|
|
42
|
+
return value.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, "\\");
|
|
43
|
+
}
|
|
44
|
+
if (value.length >= 2 && value.startsWith("'") && value.endsWith("'"))
|
|
45
|
+
return value.slice(1, -1).replace(/''/g, "'");
|
|
46
|
+
/* A plain scalar ends at an inline comment. */
|
|
47
|
+
const comment = value.search(/\s#/);
|
|
48
|
+
return (comment === -1 ? value : value.slice(0, comment)).trim();
|
|
49
|
+
}
|
|
50
|
+
/** Quote a scalar the way the shared document expects, only when it must. */
|
|
51
|
+
export function renderRefValue(value) {
|
|
52
|
+
return /^[A-Za-z0-9._@/+:-]+$/.test(value) ? value : `"${value.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
53
|
+
}
|
|
54
|
+
/** Locate the top-level `refs:` block and the entries inside it. */
|
|
55
|
+
function findRefsBlock(lines) {
|
|
56
|
+
for (let index = 0; index < lines.length; index += 1) {
|
|
57
|
+
if (!/^refs:\s*(#.*)?$/.test(lines[index] ?? ""))
|
|
58
|
+
continue;
|
|
59
|
+
const entries = [];
|
|
60
|
+
for (let scan = index + 1; scan < lines.length; scan += 1) {
|
|
61
|
+
const line = lines[scan] ?? "";
|
|
62
|
+
if (line.trim().length === 0 || line.trimStart().startsWith("#"))
|
|
63
|
+
continue;
|
|
64
|
+
const match = /^(\s+)([^\s#][^:]*):\s*(.*)$/.exec(line);
|
|
65
|
+
if (match === null)
|
|
66
|
+
break;
|
|
67
|
+
entries.push({ indent: match[1] ?? " ", key: unquote(match[2] ?? ""), line: scan });
|
|
68
|
+
}
|
|
69
|
+
return { header: index, entries };
|
|
70
|
+
}
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
/** Parse the document's refs and version. A flat pre-version file still reads. */
|
|
74
|
+
export function parseGalaxyCredentials(text) {
|
|
75
|
+
const lines = text.split(/\r?\n/);
|
|
76
|
+
const versionLine = lines.find(line => /^version:\s*\d+\s*$/.test(line));
|
|
77
|
+
const version = versionLine === undefined ? undefined : Number(versionLine.split(":")[1]?.trim());
|
|
78
|
+
const refs = {};
|
|
79
|
+
const block = findRefsBlock(lines);
|
|
80
|
+
if (block !== undefined) {
|
|
81
|
+
for (const entry of block.entries) {
|
|
82
|
+
const raw = lines[entry.line] ?? "";
|
|
83
|
+
refs[entry.key] = unquote(raw.slice(raw.indexOf(":") + 1));
|
|
84
|
+
}
|
|
85
|
+
return Object.freeze({ refs: Object.freeze(refs), version });
|
|
86
|
+
}
|
|
87
|
+
/* Pre-release flat layout: every top-level scalar is a reference. */
|
|
88
|
+
for (const line of lines) {
|
|
89
|
+
const match = /^([A-Za-z_][A-Za-z0-9_]*):\s*(\S.*)$/.exec(line);
|
|
90
|
+
if (match === null || match[1] === "version")
|
|
91
|
+
continue;
|
|
92
|
+
refs[match[1]] = unquote(match[2] ?? "");
|
|
93
|
+
}
|
|
94
|
+
return Object.freeze({ refs: Object.freeze(refs), version });
|
|
95
|
+
}
|
|
96
|
+
/** Read the document; a missing file is an empty document, never an error. */
|
|
97
|
+
export function readGalaxyCredentials(path = galaxyCredentialsPath()) {
|
|
98
|
+
try {
|
|
99
|
+
return parseGalaxyCredentials(readFileSync(path, "utf8"));
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
return Object.freeze({ refs: Object.freeze({}), version: undefined });
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/** One reference value, or undefined when it is absent or empty. */
|
|
106
|
+
export function readGalaxyCredential(ref, path = galaxyCredentialsPath()) {
|
|
107
|
+
const value = readGalaxyCredentials(path).refs[ref];
|
|
108
|
+
return value !== undefined && value.length > 0 ? value : undefined;
|
|
109
|
+
}
|
|
110
|
+
export function galaxyCredentialsHealth(path = galaxyCredentialsPath()) {
|
|
111
|
+
try {
|
|
112
|
+
const info = statSync(path);
|
|
113
|
+
const document = readGalaxyCredentials(path);
|
|
114
|
+
return Object.freeze({
|
|
115
|
+
exists: true,
|
|
116
|
+
mode: (info.mode & 0o777).toString(8),
|
|
117
|
+
ownerOnly: (info.mode & 0o077) === 0,
|
|
118
|
+
refs: Object.freeze(Object.keys(document.refs).sort()),
|
|
119
|
+
version: document.version,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
return Object.freeze({ exists: false, mode: undefined, ownerOnly: true, refs: Object.freeze([]), version: undefined });
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function sleepSync(ms) {
|
|
127
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
|
|
128
|
+
}
|
|
129
|
+
/** Cross-process writer lock beside the document, so two hosts never interleave. */
|
|
130
|
+
function withLock(path, run) {
|
|
131
|
+
const lock = path + ".lock";
|
|
132
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
133
|
+
for (let attempt = 0; attempt < 40; attempt += 1) {
|
|
134
|
+
try {
|
|
135
|
+
const handle = openSync(lock, "wx", 0o600);
|
|
136
|
+
closeSync(handle);
|
|
137
|
+
try {
|
|
138
|
+
return run();
|
|
139
|
+
}
|
|
140
|
+
finally {
|
|
141
|
+
try {
|
|
142
|
+
unlinkSync(lock);
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
/* a peer already released it */
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
const code = error.code;
|
|
151
|
+
if (code !== "EEXIST")
|
|
152
|
+
throw error;
|
|
153
|
+
/* Break a stale lock left by a crashed writer. */
|
|
154
|
+
try {
|
|
155
|
+
if (Date.now() - statSync(lock).mtimeMs > 10_000)
|
|
156
|
+
unlinkSync(lock);
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
/* the lock disappeared meanwhile */
|
|
160
|
+
}
|
|
161
|
+
sleepSync(50);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
throw new Error(`credentials: could not acquire ${lock}`);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Insert, replace, or remove one reference while leaving every other byte of the
|
|
168
|
+
* document — comments, formatting, and DSH's own `records` block — untouched.
|
|
169
|
+
*
|
|
170
|
+
* @param ref - reference name to write.
|
|
171
|
+
* @param value - secret value; an empty string removes the reference.
|
|
172
|
+
* @param path - document path, defaulting to the shared Galaxy home.
|
|
173
|
+
*/
|
|
174
|
+
export function upsertGalaxyCredential(ref, value, path = galaxyCredentialsPath()) {
|
|
175
|
+
withLock(path, () => {
|
|
176
|
+
const exists = existsSync(path);
|
|
177
|
+
const text = exists ? readFileSync(path, "utf8") : "";
|
|
178
|
+
const trailingNewline = text.length === 0 || text.endsWith("\n");
|
|
179
|
+
const lines = text.replace(/\r\n/g, "\n").split("\n");
|
|
180
|
+
if (lines.length > 0 && lines[lines.length - 1] === "")
|
|
181
|
+
lines.pop();
|
|
182
|
+
const block = findRefsBlock(lines);
|
|
183
|
+
const encoded = value.length === 0 ? undefined : renderRefValue(value);
|
|
184
|
+
if (block === undefined) {
|
|
185
|
+
if (!lines.some(line => /^version:\s*\d+\s*$/.test(line)))
|
|
186
|
+
lines.unshift(`version: ${GALAXY_CREDENTIALS_VERSION}`);
|
|
187
|
+
lines.push("refs:");
|
|
188
|
+
if (encoded !== undefined)
|
|
189
|
+
lines.push(` ${ref}: ${encoded}`);
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
const existing = block.entries.find(entry => entry.key === ref);
|
|
193
|
+
if (existing !== undefined) {
|
|
194
|
+
if (encoded === undefined)
|
|
195
|
+
lines.splice(existing.line, 1);
|
|
196
|
+
else
|
|
197
|
+
lines[existing.line] = `${existing.indent}${ref}: ${encoded}`;
|
|
198
|
+
}
|
|
199
|
+
else if (encoded !== undefined) {
|
|
200
|
+
const indent = block.entries[0]?.indent ?? " ";
|
|
201
|
+
const lastLine = block.entries.length === 0 ? block.header : block.entries[block.entries.length - 1].line;
|
|
202
|
+
lines.splice(lastLine + 1, 0, `${indent}${ref}: ${encoded}`);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
const rendered = lines.join("\n") + (trailingNewline ? "\n" : "");
|
|
206
|
+
const temporary = `${path}.${process.pid.toString(36)}.tmp`;
|
|
207
|
+
writeFileSync(temporary, rendered, { encoding: "utf8", mode: 0o600 });
|
|
208
|
+
renameSync(temporary, path);
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
/** Write several references in one locked pass. */
|
|
212
|
+
export function upsertGalaxyCredentials(entries, path = galaxyCredentialsPath()) {
|
|
213
|
+
for (const [ref, value] of Object.entries(entries))
|
|
214
|
+
upsertGalaxyCredential(ref, value, path);
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=galaxy-credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"galaxy-credentials.js","sourceRoot":"","sources":["../../../../src/adapters/node/config/galaxy-credentials.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACpI,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C;;;;;;;;;;;GAWG;AAEH,wCAAwC;AACxC,MAAM,CAAC,MAAM,2BAA2B,GAAG,kBAAkB,CAAC;AAC9D,gFAAgF;AAChF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAQ5C,uDAAuD;AACvD,MAAM,UAAU,qBAAqB,CAAC,OAAe,OAAO,EAAE;IAC5D,OAAO,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,2BAA2B,CAAC,CAAC;AAC5D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,UAAkB;IAC9C,MAAM,UAAU,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAC1G,OAAO,OAAO,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,UAAU,CAAC;AAC5E,CAAC;AAED,SAAS,OAAO,CAAC,GAAW;IAC1B,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE,C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,CAAC;QAClE,MAAM,SAAS,GAAG,GAAG,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC;QAC5D,aAAa,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QACtE,UAAU,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,uBAAuB,CAAC,OAAyC,EAAE,OAAe,qBAAqB,EAAE;IACvH,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,sBAAsB,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AAC/F,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galaxy-stack/ai-coder-core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Platform-neutral runtime for the Galaxy AI Coder single agent. Core exception under @galaxy-stack, versioned by the galaxy-blackhole organization. Consumed by galaxy-code (Blackhole CLI), galaxy-vscode-extension, and galaxy-desktop.",
|
|
6
6
|
"license": "MIT",
|