@zonko-ai/harbor 0.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.
- package/README.md +15 -0
- package/dist/api.d.ts +53 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +842 -0
- package/dist/api.js.map +1 -0
- package/dist/capabilities.d.ts +5 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +308 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/constants.d.ts +4 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +4 -0
- package/dist/constants.js.map +1 -0
- package/dist/dev.d.ts +14 -0
- package/dist/dev.d.ts.map +1 -0
- package/dist/dev.js +203 -0
- package/dist/dev.js.map +1 -0
- package/dist/foreground.d.ts +13 -0
- package/dist/foreground.d.ts.map +1 -0
- package/dist/foreground.js +54 -0
- package/dist/foreground.js.map +1 -0
- package/dist/import-openapi.d.ts +12 -0
- package/dist/import-openapi.d.ts.map +1 -0
- package/dist/import-openapi.js +488 -0
- package/dist/import-openapi.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +941 -0
- package/dist/index.js.map +1 -0
- package/dist/local-config.d.ts +12 -0
- package/dist/local-config.d.ts.map +1 -0
- package/dist/local-config.js +93 -0
- package/dist/local-config.js.map +1 -0
- package/dist/local-daemon-entry.d.ts +2 -0
- package/dist/local-daemon-entry.d.ts.map +1 -0
- package/dist/local-daemon-entry.js +545 -0
- package/dist/local-daemon-entry.js.map +1 -0
- package/dist/local-daemon.d.ts +58 -0
- package/dist/local-daemon.d.ts.map +1 -0
- package/dist/local-daemon.js +385 -0
- package/dist/local-daemon.js.map +1 -0
- package/dist/mcp/api-client.d.ts +72 -0
- package/dist/mcp/api-client.d.ts.map +1 -0
- package/dist/mcp/api-client.js +210 -0
- package/dist/mcp/api-client.js.map +1 -0
- package/dist/mcp/index.d.ts +4 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +18 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/schema.d.ts +3 -0
- package/dist/mcp/schema.d.ts.map +1 -0
- package/dist/mcp/schema.js +95 -0
- package/dist/mcp/schema.js.map +1 -0
- package/dist/mcp/server.d.ts +5 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +57 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.d.ts +12 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +54 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/output-download.d.ts +8 -0
- package/dist/output-download.d.ts.map +1 -0
- package/dist/output-download.js +210 -0
- package/dist/output-download.js.map +1 -0
- package/dist/output.d.ts +124 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +752 -0
- package/dist/output.js.map +1 -0
- package/dist/passthrough.d.ts +15 -0
- package/dist/passthrough.d.ts.map +1 -0
- package/dist/passthrough.js +68 -0
- package/dist/passthrough.js.map +1 -0
- package/dist/runtime-attribution.d.ts +5 -0
- package/dist/runtime-attribution.d.ts.map +1 -0
- package/dist/runtime-attribution.js +86 -0
- package/dist/runtime-attribution.js.map +1 -0
- package/dist/state.d.ts +56 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +374 -0
- package/dist/state.js.map +1 -0
- package/dist/types.d.ts +284 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +35 -0
package/dist/state.js
ADDED
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { chmodSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { homedir, hostname, tmpdir, userInfo } from 'node:os';
|
|
4
|
+
import { dirname, join, parse, resolve } from 'node:path';
|
|
5
|
+
const DEFAULT_PROFILE_SLUG = 'local';
|
|
6
|
+
const PROFILE_SLUG_PATTERN = /^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,62}[A-Za-z0-9])?$/;
|
|
7
|
+
const DEFAULT_PROFILE = {
|
|
8
|
+
profile_slug: DEFAULT_PROFILE_SLUG,
|
|
9
|
+
api_url: null,
|
|
10
|
+
auth_url: null,
|
|
11
|
+
agent_id: null,
|
|
12
|
+
owner_scope_id: null,
|
|
13
|
+
owner: null,
|
|
14
|
+
owner_display_name: null,
|
|
15
|
+
owner_token: null,
|
|
16
|
+
owner_token_expires_at: null,
|
|
17
|
+
agent_token: null,
|
|
18
|
+
token_expires_at: null,
|
|
19
|
+
pending_claim_display_name: null,
|
|
20
|
+
pending_claim_approval_id: null,
|
|
21
|
+
};
|
|
22
|
+
const readJson = (path) => {
|
|
23
|
+
if (!existsSync(path)) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
return JSON.parse(readFileSync(path, 'utf8'));
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const writeJson = (path, value) => {
|
|
34
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
35
|
+
writeFileSync(path, `${JSON.stringify(value, null, 2)}\n`);
|
|
36
|
+
};
|
|
37
|
+
export const writeSecureJson = (path, value) => {
|
|
38
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
39
|
+
writeFileSync(path, `${JSON.stringify(value, null, 2)}\n`, { mode: 0o600 });
|
|
40
|
+
chmodSync(path, 0o600);
|
|
41
|
+
};
|
|
42
|
+
export const normalizeProfileSlug = (value) => {
|
|
43
|
+
if (typeof value !== 'string') {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const slug = value.trim();
|
|
47
|
+
if (!slug || !PROFILE_SLUG_PATTERN.test(slug)) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
return slug;
|
|
51
|
+
};
|
|
52
|
+
const resolveHarborHome = () => resolve(process.env.HARBOR_HOME ?? join(homedir(), '.harbor'));
|
|
53
|
+
const profileOverrideFromArgv = (argv = process.argv.slice(2)) => {
|
|
54
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
55
|
+
const arg = argv[index];
|
|
56
|
+
if (arg === '--profile') {
|
|
57
|
+
const value = argv[index + 1];
|
|
58
|
+
return typeof value === 'string' && !value.startsWith('-') ? value : null;
|
|
59
|
+
}
|
|
60
|
+
if (arg.startsWith('--profile=')) {
|
|
61
|
+
return arg.slice('--profile='.length);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
};
|
|
66
|
+
const resolveProfileSlug = (value) => normalizeProfileSlug(value) ?? DEFAULT_PROFILE_SLUG;
|
|
67
|
+
const buildDaemonSocketFile = (harborHome, profileSlug) => {
|
|
68
|
+
const digest = createHash('sha256').update(`${harborHome}:${profileSlug}`).digest('hex').slice(0, 16);
|
|
69
|
+
return join(tmpdir(), `harbor-${profileSlug}-${digest}.sock`);
|
|
70
|
+
};
|
|
71
|
+
const buildPaths = (profileSlug = DEFAULT_PROFILE_SLUG) => {
|
|
72
|
+
const home = resolveHarborHome();
|
|
73
|
+
const normalizedProfileSlug = resolveProfileSlug(profileSlug);
|
|
74
|
+
const configFile = join(home, 'config.json');
|
|
75
|
+
const legacyProfileFile = join(home, 'profile.json');
|
|
76
|
+
const legacyCatalogFile = join(home, 'catalog.json');
|
|
77
|
+
const profilesDir = join(home, 'profiles');
|
|
78
|
+
const catalogsDir = join(home, 'catalogs');
|
|
79
|
+
const logDir = join(home, 'logs');
|
|
80
|
+
const profileDir = join(profilesDir, normalizedProfileSlug);
|
|
81
|
+
const runDir = join(profileDir, 'run');
|
|
82
|
+
const localLogDir = join(profileDir, 'logs');
|
|
83
|
+
return {
|
|
84
|
+
home,
|
|
85
|
+
configFile,
|
|
86
|
+
legacyProfileFile,
|
|
87
|
+
legacyCatalogFile,
|
|
88
|
+
profilesDir,
|
|
89
|
+
catalogsDir,
|
|
90
|
+
logDir,
|
|
91
|
+
profileDir,
|
|
92
|
+
runDir,
|
|
93
|
+
localLogDir,
|
|
94
|
+
profileSlug: normalizedProfileSlug,
|
|
95
|
+
profileFile: join(profilesDir, `${normalizedProfileSlug}.json`),
|
|
96
|
+
catalogFile: join(catalogsDir, `${normalizedProfileSlug}.json`),
|
|
97
|
+
localStateFile: join(profileDir, 'state.json'),
|
|
98
|
+
manifestCacheFile: join(profileDir, 'manifest-cache.json'),
|
|
99
|
+
migrationFile: join(profileDir, 'migration.json'),
|
|
100
|
+
daemonSocketFile: buildDaemonSocketFile(home, normalizedProfileSlug),
|
|
101
|
+
daemonPidFile: join(runDir, 'daemon.pid'),
|
|
102
|
+
daemonLockFile: join(runDir, 'daemon.lock'),
|
|
103
|
+
apiPidFile: join(runDir, 'api.pid'),
|
|
104
|
+
runnerPidFile: join(runDir, 'runner.pid'),
|
|
105
|
+
updateIntentFile: join(runDir, 'update.intent.json'),
|
|
106
|
+
daemonLogFile: join(localLogDir, 'daemon.log'),
|
|
107
|
+
apiLogFile: join(localLogDir, 'api.log'),
|
|
108
|
+
runnerLogFile: join(localLogDir, 'runner.log'),
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
const readConfig = () => readJson(buildPaths().configFile);
|
|
112
|
+
const readLegacyProfile = () => readJson(buildPaths().legacyProfileFile);
|
|
113
|
+
const readLegacyProfileSlug = () => normalizeProfileSlug(readLegacyProfile()?.profile_slug);
|
|
114
|
+
const readDaemonState = (profileSlug) => {
|
|
115
|
+
const normalizedProfileSlug = resolveProfileSlug(profileSlug);
|
|
116
|
+
return readJson(buildPaths(normalizedProfileSlug).localStateFile);
|
|
117
|
+
};
|
|
118
|
+
const readStoredProfile = (profileSlug) => {
|
|
119
|
+
const normalizedProfileSlug = resolveProfileSlug(profileSlug);
|
|
120
|
+
const profile = readJson(buildPaths(normalizedProfileSlug).profileFile);
|
|
121
|
+
if (profile) {
|
|
122
|
+
return profile;
|
|
123
|
+
}
|
|
124
|
+
if (normalizedProfileSlug === DEFAULT_PROFILE_SLUG) {
|
|
125
|
+
const daemonState = readDaemonState(normalizedProfileSlug);
|
|
126
|
+
if (daemonState) {
|
|
127
|
+
return daemonState;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const legacyProfile = readLegacyProfile();
|
|
131
|
+
if (legacyProfile && resolveProfileSlug(legacyProfile.profile_slug) === normalizedProfileSlug) {
|
|
132
|
+
return legacyProfile;
|
|
133
|
+
}
|
|
134
|
+
return null;
|
|
135
|
+
};
|
|
136
|
+
const readStoredCatalog = (profileSlug) => {
|
|
137
|
+
const normalizedProfileSlug = resolveProfileSlug(profileSlug);
|
|
138
|
+
const catalog = readJson(buildPaths(normalizedProfileSlug).catalogFile);
|
|
139
|
+
if (catalog) {
|
|
140
|
+
return catalog;
|
|
141
|
+
}
|
|
142
|
+
const legacyCatalog = readJson(buildPaths().legacyCatalogFile);
|
|
143
|
+
if (legacyCatalog && readLegacyProfileSlug() === normalizedProfileSlug) {
|
|
144
|
+
return legacyCatalog;
|
|
145
|
+
}
|
|
146
|
+
return null;
|
|
147
|
+
};
|
|
148
|
+
const syncLegacyMirror = (profileSlug) => {
|
|
149
|
+
const normalizedProfileSlug = resolveProfileSlug(profileSlug);
|
|
150
|
+
const paths = buildPaths(normalizedProfileSlug);
|
|
151
|
+
const profile = readStoredProfile(normalizedProfileSlug) ?? { ...DEFAULT_PROFILE, profile_slug: normalizedProfileSlug };
|
|
152
|
+
const catalog = readStoredCatalog(normalizedProfileSlug) ?? {
|
|
153
|
+
updated_at: new Date().toISOString(),
|
|
154
|
+
etag: null,
|
|
155
|
+
capabilities: [],
|
|
156
|
+
};
|
|
157
|
+
writeSecureJson(paths.legacyProfileFile, { ...profile, profile_slug: normalizedProfileSlug });
|
|
158
|
+
writeJson(paths.legacyCatalogFile, catalog);
|
|
159
|
+
};
|
|
160
|
+
export const ensureHarborHome = () => {
|
|
161
|
+
const paths = buildPaths();
|
|
162
|
+
mkdirSync(paths.home, { recursive: true });
|
|
163
|
+
mkdirSync(paths.logDir, { recursive: true });
|
|
164
|
+
mkdirSync(paths.profilesDir, { recursive: true });
|
|
165
|
+
mkdirSync(paths.catalogsDir, { recursive: true });
|
|
166
|
+
};
|
|
167
|
+
export const getActiveProfileSlug = () => {
|
|
168
|
+
ensureHarborHome();
|
|
169
|
+
return normalizeProfileSlug(readConfig()?.active_profile_slug) ?? readLegacyProfileSlug() ?? DEFAULT_PROFILE_SLUG;
|
|
170
|
+
};
|
|
171
|
+
const getSelectedProfileSlug = () => {
|
|
172
|
+
const argProfile = normalizeProfileSlug(profileOverrideFromArgv());
|
|
173
|
+
if (argProfile) {
|
|
174
|
+
return argProfile;
|
|
175
|
+
}
|
|
176
|
+
const envProfile = normalizeProfileSlug(process.env.HARBOR_PROFILE);
|
|
177
|
+
if (envProfile) {
|
|
178
|
+
return envProfile;
|
|
179
|
+
}
|
|
180
|
+
return getActiveProfileSlug();
|
|
181
|
+
};
|
|
182
|
+
export const setActiveProfile = (profileSlug) => {
|
|
183
|
+
const normalizedProfileSlug = resolveProfileSlug(profileSlug);
|
|
184
|
+
ensureHarborHome();
|
|
185
|
+
const currentConfig = readConfig() ?? {};
|
|
186
|
+
writeSecureJson(buildPaths(normalizedProfileSlug).configFile, {
|
|
187
|
+
...currentConfig,
|
|
188
|
+
active_profile_slug: normalizedProfileSlug,
|
|
189
|
+
});
|
|
190
|
+
syncLegacyMirror(normalizedProfileSlug);
|
|
191
|
+
};
|
|
192
|
+
export const getHarborPaths = (profileSlug = getSelectedProfileSlug()) => buildPaths(profileSlug);
|
|
193
|
+
export const profileExists = (profileSlug) => {
|
|
194
|
+
const normalizedProfileSlug = resolveProfileSlug(profileSlug);
|
|
195
|
+
return readStoredProfile(normalizedProfileSlug) !== null;
|
|
196
|
+
};
|
|
197
|
+
export const listProfiles = (selectedProfileSlug = getSelectedProfileSlug()) => {
|
|
198
|
+
ensureHarborHome();
|
|
199
|
+
const activeProfileSlug = getActiveProfileSlug();
|
|
200
|
+
const normalizedSelectedProfileSlug = resolveProfileSlug(selectedProfileSlug);
|
|
201
|
+
const paths = buildPaths();
|
|
202
|
+
const profileSlugs = new Set();
|
|
203
|
+
for (const entry of readdirSync(paths.profilesDir, { withFileTypes: true })) {
|
|
204
|
+
if (!entry.isFile() || !entry.name.endsWith('.json')) {
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
const slug = normalizeProfileSlug(parse(entry.name).name);
|
|
208
|
+
if (slug) {
|
|
209
|
+
profileSlugs.add(slug);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
const legacyProfileSlug = readLegacyProfileSlug();
|
|
213
|
+
if (legacyProfileSlug) {
|
|
214
|
+
profileSlugs.add(legacyProfileSlug);
|
|
215
|
+
}
|
|
216
|
+
profileSlugs.add(activeProfileSlug);
|
|
217
|
+
profileSlugs.add(normalizedSelectedProfileSlug);
|
|
218
|
+
return [...profileSlugs]
|
|
219
|
+
.sort((left, right) => left.localeCompare(right))
|
|
220
|
+
.map((profileSlug) => {
|
|
221
|
+
const profile = getProfile(profileSlug);
|
|
222
|
+
return {
|
|
223
|
+
profile_slug: profileSlug,
|
|
224
|
+
active: profileSlug === activeProfileSlug,
|
|
225
|
+
selected: profileSlug === normalizedSelectedProfileSlug,
|
|
226
|
+
api_url: profile.api_url,
|
|
227
|
+
agent_id: profile.agent_id,
|
|
228
|
+
owner: profile.owner,
|
|
229
|
+
};
|
|
230
|
+
});
|
|
231
|
+
};
|
|
232
|
+
export const getProfile = (profileSlug = getSelectedProfileSlug()) => {
|
|
233
|
+
ensureHarborHome();
|
|
234
|
+
const normalizedProfileSlug = resolveProfileSlug(profileSlug);
|
|
235
|
+
const fileProfile = readStoredProfile(normalizedProfileSlug);
|
|
236
|
+
const daemonState = normalizedProfileSlug === DEFAULT_PROFILE_SLUG ? readDaemonState(normalizedProfileSlug) : null;
|
|
237
|
+
const profile = fileProfile
|
|
238
|
+
? { ...DEFAULT_PROFILE, ...fileProfile, profile_slug: normalizedProfileSlug }
|
|
239
|
+
: { ...DEFAULT_PROFILE, profile_slug: normalizedProfileSlug };
|
|
240
|
+
if (daemonState) {
|
|
241
|
+
const readDaemonString = (key) => Object.prototype.hasOwnProperty.call(daemonState, key)
|
|
242
|
+
? (typeof daemonState[key] === 'string' ? daemonState[key] : null)
|
|
243
|
+
: undefined;
|
|
244
|
+
const applyDaemonString = (key, daemonKey) => {
|
|
245
|
+
const value = readDaemonString(daemonKey ?? String(key));
|
|
246
|
+
if (value !== undefined) {
|
|
247
|
+
profile[key] = value;
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
applyDaemonString('api_url');
|
|
251
|
+
applyDaemonString('auth_url');
|
|
252
|
+
applyDaemonString('owner_scope_id');
|
|
253
|
+
applyDaemonString('agent_id');
|
|
254
|
+
applyDaemonString('owner');
|
|
255
|
+
applyDaemonString('owner_display_name');
|
|
256
|
+
applyDaemonString('owner_token');
|
|
257
|
+
applyDaemonString('owner_token_expires_at');
|
|
258
|
+
applyDaemonString('agent_token');
|
|
259
|
+
applyDaemonString('token_expires_at', 'agent_token_expires_at');
|
|
260
|
+
}
|
|
261
|
+
if (process.env.HARBOR_API_URL) {
|
|
262
|
+
profile.api_url = process.env.HARBOR_API_URL;
|
|
263
|
+
}
|
|
264
|
+
if (process.env.HARBOR_AUTH_URL) {
|
|
265
|
+
profile.auth_url = process.env.HARBOR_AUTH_URL;
|
|
266
|
+
}
|
|
267
|
+
return profile;
|
|
268
|
+
};
|
|
269
|
+
export const saveProfile = (updates, profileSlug = getSelectedProfileSlug()) => {
|
|
270
|
+
const normalizedProfileSlug = resolveProfileSlug(profileSlug);
|
|
271
|
+
const current = getProfile(normalizedProfileSlug);
|
|
272
|
+
writeSecureJson(buildPaths(normalizedProfileSlug).profileFile, {
|
|
273
|
+
...current,
|
|
274
|
+
...updates,
|
|
275
|
+
profile_slug: normalizedProfileSlug,
|
|
276
|
+
});
|
|
277
|
+
if (normalizedProfileSlug === getActiveProfileSlug()) {
|
|
278
|
+
syncLegacyMirror(normalizedProfileSlug);
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
export const saveCatalog = (capabilities, etag, profileSlug = getSelectedProfileSlug()) => {
|
|
282
|
+
const normalizedProfileSlug = resolveProfileSlug(profileSlug);
|
|
283
|
+
writeJson(buildPaths(normalizedProfileSlug).catalogFile, {
|
|
284
|
+
updated_at: new Date().toISOString(),
|
|
285
|
+
etag: etag ?? null,
|
|
286
|
+
capabilities,
|
|
287
|
+
});
|
|
288
|
+
if (normalizedProfileSlug === getActiveProfileSlug()) {
|
|
289
|
+
syncLegacyMirror(normalizedProfileSlug);
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
export const getCatalog = (profileSlug = getSelectedProfileSlug()) => {
|
|
293
|
+
const normalizedProfileSlug = resolveProfileSlug(profileSlug);
|
|
294
|
+
return readStoredCatalog(normalizedProfileSlug);
|
|
295
|
+
};
|
|
296
|
+
export const clearProfileSession = (profileSlug = getSelectedProfileSlug()) => {
|
|
297
|
+
const normalizedProfileSlug = resolveProfileSlug(profileSlug);
|
|
298
|
+
saveProfile({
|
|
299
|
+
owner_scope_id: null,
|
|
300
|
+
owner: null,
|
|
301
|
+
owner_display_name: null,
|
|
302
|
+
owner_token: null,
|
|
303
|
+
owner_token_expires_at: null,
|
|
304
|
+
agent_id: null,
|
|
305
|
+
agent_token: null,
|
|
306
|
+
token_expires_at: null,
|
|
307
|
+
pending_claim_display_name: null,
|
|
308
|
+
pending_claim_approval_id: null,
|
|
309
|
+
}, normalizedProfileSlug);
|
|
310
|
+
};
|
|
311
|
+
export const deleteProfile = (profileSlug) => {
|
|
312
|
+
const normalizedProfileSlug = resolveProfileSlug(profileSlug);
|
|
313
|
+
const paths = buildPaths(normalizedProfileSlug);
|
|
314
|
+
rmSync(paths.profileFile, { force: true });
|
|
315
|
+
rmSync(paths.catalogFile, { force: true });
|
|
316
|
+
rmSync(paths.profileDir, { recursive: true, force: true });
|
|
317
|
+
if (normalizedProfileSlug === getActiveProfileSlug()) {
|
|
318
|
+
writeSecureJson(paths.configFile, {
|
|
319
|
+
...(readConfig() ?? {}),
|
|
320
|
+
active_profile_slug: DEFAULT_PROFILE_SLUG,
|
|
321
|
+
});
|
|
322
|
+
syncLegacyMirror(DEFAULT_PROFILE_SLUG);
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
export const isDaemonManagedProfileSlug = (profileSlug) => resolveProfileSlug(profileSlug) === DEFAULT_PROFILE_SLUG;
|
|
326
|
+
export const isDaemonManagedProfile = (profile) => isDaemonManagedProfileSlug(profile.profile_slug);
|
|
327
|
+
export const isLocalProfile = (profile) => {
|
|
328
|
+
const record = profile;
|
|
329
|
+
if (record.environment === 'local') {
|
|
330
|
+
return true;
|
|
331
|
+
}
|
|
332
|
+
if (typeof profile.api_url === 'string' && profile.api_url.length > 0) {
|
|
333
|
+
try {
|
|
334
|
+
const { hostname: apiHostname } = new URL(profile.api_url);
|
|
335
|
+
return apiHostname === '127.0.0.1' || apiHostname === 'localhost' || apiHostname === '::1';
|
|
336
|
+
}
|
|
337
|
+
catch {
|
|
338
|
+
return false;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
return false;
|
|
342
|
+
};
|
|
343
|
+
export const buildFingerprint = () => {
|
|
344
|
+
const seed = [
|
|
345
|
+
hostname(),
|
|
346
|
+
userInfo().username,
|
|
347
|
+
homedir(),
|
|
348
|
+
process.platform,
|
|
349
|
+
process.arch,
|
|
350
|
+
].join(':');
|
|
351
|
+
return createHash('sha256').update(seed).digest('hex');
|
|
352
|
+
};
|
|
353
|
+
export const findWorkspaceRoot = (startDir = process.cwd()) => {
|
|
354
|
+
let current = resolve(startDir);
|
|
355
|
+
for (;;) {
|
|
356
|
+
if (existsSync(join(current, 'pnpm-workspace.yaml')) || existsSync(join(current, '.git'))) {
|
|
357
|
+
return current;
|
|
358
|
+
}
|
|
359
|
+
const parent = dirname(current);
|
|
360
|
+
if (parent === current) {
|
|
361
|
+
return resolve(startDir);
|
|
362
|
+
}
|
|
363
|
+
current = parent;
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
export const fileMtimeMs = (path) => {
|
|
367
|
+
try {
|
|
368
|
+
return statSync(path).mtimeMs;
|
|
369
|
+
}
|
|
370
|
+
catch {
|
|
371
|
+
return 0;
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACtH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAC7D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAGzD,MAAM,oBAAoB,GAAG,OAAO,CAAA;AACpC,MAAM,oBAAoB,GAAG,mDAAmD,CAAA;AAiBhF,MAAM,eAAe,GAAiB;IACpC,YAAY,EAAE,oBAAoB;IAClC,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;IACd,cAAc,EAAE,IAAI;IACpB,KAAK,EAAE,IAAI;IACX,kBAAkB,EAAE,IAAI;IACxB,WAAW,EAAE,IAAI;IACjB,sBAAsB,EAAE,IAAI;IAC5B,WAAW,EAAE,IAAI;IACjB,gBAAgB,EAAE,IAAI;IACtB,0BAA0B,EAAE,IAAI;IAChC,yBAAyB,EAAE,IAAI;CAChC,CAAA;AAED,MAAM,QAAQ,GAAG,CAAI,IAAY,EAAY,EAAE;I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IAAC,MAAM,CAAC;QACP,OAAO,CAAC,CAAA;IACV,CAAC;AACH,CAAC,CAAA"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
export type OutputMode = 'human' | 'plain' | 'json';
|
|
2
|
+
export type Platform = 'cli' | 'openclaw' | 'hermes' | 'other';
|
|
3
|
+
export interface ClaudeCodeRuntimeAttribution {
|
|
4
|
+
active: true;
|
|
5
|
+
team_name?: string;
|
|
6
|
+
task_list_id?: string;
|
|
7
|
+
model?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface OpenClawRuntimeAttribution {
|
|
10
|
+
shell: 'exec' | 'acp' | 'acp-client' | 'tui-local';
|
|
11
|
+
}
|
|
12
|
+
export interface CodexRuntimeAttribution {
|
|
13
|
+
thread_id: string;
|
|
14
|
+
sandbox?: string;
|
|
15
|
+
sandbox_network_disabled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface HermesRuntimeAttribution {
|
|
18
|
+
session_platform: string;
|
|
19
|
+
session_thread_id?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface RuntimeAttributionEnvelope {
|
|
22
|
+
claude_code?: ClaudeCodeRuntimeAttribution;
|
|
23
|
+
openclaw?: OpenClawRuntimeAttribution;
|
|
24
|
+
codex?: CodexRuntimeAttribution;
|
|
25
|
+
hermes?: HermesRuntimeAttribution;
|
|
26
|
+
}
|
|
27
|
+
export interface ProfileState {
|
|
28
|
+
profile_slug: string;
|
|
29
|
+
api_url: string | null;
|
|
30
|
+
auth_url: string | null;
|
|
31
|
+
agent_id: string | null;
|
|
32
|
+
owner_scope_id: string | null;
|
|
33
|
+
owner: string | null;
|
|
34
|
+
owner_display_name: string | null;
|
|
35
|
+
owner_token: string | null;
|
|
36
|
+
owner_token_expires_at: string | null;
|
|
37
|
+
agent_token: string | null;
|
|
38
|
+
token_expires_at: string | null;
|
|
39
|
+
pending_claim_display_name: string | null;
|
|
40
|
+
pending_claim_approval_id: string | null;
|
|
41
|
+
}
|
|
42
|
+
export interface CliArgDefinition {
|
|
43
|
+
name: string;
|
|
44
|
+
type?: string;
|
|
45
|
+
required?: boolean;
|
|
46
|
+
positional?: boolean;
|
|
47
|
+
description?: string;
|
|
48
|
+
}
|
|
49
|
+
export type RuntimeInjectionRequirementKind = 'owner_identity' | 'agent_identity' | 'execution_context' | 'service_connection' | 'service_lookup' | 'service_route';
|
|
50
|
+
export type RuntimeInjectionRouteFallback = 'agent' | 'owner' | 'single_active_account';
|
|
51
|
+
export interface RuntimeInjectionRequirement {
|
|
52
|
+
name: string;
|
|
53
|
+
kind: RuntimeInjectionRequirementKind;
|
|
54
|
+
required?: boolean;
|
|
55
|
+
service?: string;
|
|
56
|
+
lookup?: string;
|
|
57
|
+
input_path?: string;
|
|
58
|
+
selector_template?: Record<string, unknown>;
|
|
59
|
+
compatibility_template?: Record<string, unknown>;
|
|
60
|
+
fallback_order?: RuntimeInjectionRouteFallback[];
|
|
61
|
+
secret_refs?: string[];
|
|
62
|
+
}
|
|
63
|
+
export interface RuntimeInjectionConfig {
|
|
64
|
+
requirements: RuntimeInjectionRequirement[];
|
|
65
|
+
exports?: Record<string, string>;
|
|
66
|
+
audit?: {
|
|
67
|
+
context_keys?: string[];
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export interface PublishedSnapshot {
|
|
71
|
+
snapshot_id?: string;
|
|
72
|
+
version_id?: string;
|
|
73
|
+
capability: {
|
|
74
|
+
slug: string;
|
|
75
|
+
title?: string;
|
|
76
|
+
description?: string;
|
|
77
|
+
category?: string;
|
|
78
|
+
};
|
|
79
|
+
contract?: {
|
|
80
|
+
input_schema?: JsonSchema;
|
|
81
|
+
output_schema?: JsonSchema;
|
|
82
|
+
execution_mode?: string;
|
|
83
|
+
};
|
|
84
|
+
binding?: {
|
|
85
|
+
adapter_type?: string;
|
|
86
|
+
adapter_operation?: string;
|
|
87
|
+
provider_ref?: string;
|
|
88
|
+
config?: Record<string, unknown>;
|
|
89
|
+
};
|
|
90
|
+
policy?: {
|
|
91
|
+
grant_required?: boolean;
|
|
92
|
+
approval_mode?: string;
|
|
93
|
+
authorization?: {
|
|
94
|
+
mode?: string;
|
|
95
|
+
subject?: string;
|
|
96
|
+
owner_scope_field?: string | null;
|
|
97
|
+
agent_field?: string | null;
|
|
98
|
+
};
|
|
99
|
+
constraint_shape?: Record<string, unknown>;
|
|
100
|
+
};
|
|
101
|
+
secrets?: {
|
|
102
|
+
required_refs?: Array<{
|
|
103
|
+
name: string;
|
|
104
|
+
kind: string;
|
|
105
|
+
purpose: string;
|
|
106
|
+
}>;
|
|
107
|
+
};
|
|
108
|
+
runtime_injection?: RuntimeInjectionConfig;
|
|
109
|
+
surface?: {
|
|
110
|
+
cli?: {
|
|
111
|
+
display_name?: string;
|
|
112
|
+
summary?: string;
|
|
113
|
+
args?: CliArgDefinition[];
|
|
114
|
+
examples?: string[];
|
|
115
|
+
plain_output_keys?: string[];
|
|
116
|
+
foreground?: boolean;
|
|
117
|
+
};
|
|
118
|
+
mcp?: Record<string, unknown>;
|
|
119
|
+
ui?: Record<string, unknown>;
|
|
120
|
+
};
|
|
121
|
+
published_at?: string;
|
|
122
|
+
}
|
|
123
|
+
export interface CapabilitySummary {
|
|
124
|
+
slug: string;
|
|
125
|
+
state: string;
|
|
126
|
+
summary: string;
|
|
127
|
+
granted?: boolean | null;
|
|
128
|
+
missing_secret_refs?: string[];
|
|
129
|
+
service_state?: 'linked' | 'unlinked' | null;
|
|
130
|
+
snapshot: PublishedSnapshot | null;
|
|
131
|
+
}
|
|
132
|
+
export interface CatalogCache {
|
|
133
|
+
updated_at: string;
|
|
134
|
+
etag?: string | null;
|
|
135
|
+
capabilities: CapabilitySummary[];
|
|
136
|
+
}
|
|
137
|
+
export interface ClaimResult {
|
|
138
|
+
result: 'claimed' | 'restored' | 'approval_required';
|
|
139
|
+
owner_scope_id: string | null;
|
|
140
|
+
agent_id: string | null;
|
|
141
|
+
agent_display_name?: string | null;
|
|
142
|
+
approval_id: string | null;
|
|
143
|
+
approval_url?: string | null;
|
|
144
|
+
owner?: string | null;
|
|
145
|
+
profile_slug?: string | null;
|
|
146
|
+
agent_token: string | null;
|
|
147
|
+
expires_at: string | null;
|
|
148
|
+
}
|
|
149
|
+
export interface WhoAmIResult {
|
|
150
|
+
principal: 'owner' | 'agent' | null;
|
|
151
|
+
profile_slug: string | null;
|
|
152
|
+
owner_scope_id: string | null;
|
|
153
|
+
owner: string | null;
|
|
154
|
+
owner_display_name: string | null;
|
|
155
|
+
agent_id: string | null;
|
|
156
|
+
agent_display_name: string | null;
|
|
157
|
+
}
|
|
158
|
+
export interface OwnerSessionResult {
|
|
159
|
+
owner_scope_id: string | null;
|
|
160
|
+
owner: string | null;
|
|
161
|
+
owner_display_name: string | null;
|
|
162
|
+
owner_token: string | null;
|
|
163
|
+
expires_at: string | null;
|
|
164
|
+
}
|
|
165
|
+
export interface ComposioLinkSessionResult {
|
|
166
|
+
link_session_id: string;
|
|
167
|
+
owner_scope_id?: string | null;
|
|
168
|
+
subject_kind?: 'owner' | 'agent';
|
|
169
|
+
subject_id?: string | null;
|
|
170
|
+
toolkit_slug?: string | null;
|
|
171
|
+
auth_config_id?: string | null;
|
|
172
|
+
connected_account_id?: string | null;
|
|
173
|
+
redirect_url?: string | null;
|
|
174
|
+
status: string;
|
|
175
|
+
expires_at?: string | null;
|
|
176
|
+
completed_at?: string | null;
|
|
177
|
+
}
|
|
178
|
+
export interface ComposioRouteResult {
|
|
179
|
+
route_id: string;
|
|
180
|
+
owner_scope_id?: string | null;
|
|
181
|
+
subject_kind: 'owner' | 'agent';
|
|
182
|
+
subject_id: string;
|
|
183
|
+
toolkit_slug: string;
|
|
184
|
+
auth_config_id: string;
|
|
185
|
+
connected_account_id: string;
|
|
186
|
+
status: string;
|
|
187
|
+
created_at?: string | null;
|
|
188
|
+
updated_at?: string | null;
|
|
189
|
+
}
|
|
190
|
+
export interface ProfileCleanupResult {
|
|
191
|
+
profile: string;
|
|
192
|
+
deleted: boolean;
|
|
193
|
+
cleared_session: boolean;
|
|
194
|
+
active_profile: string;
|
|
195
|
+
}
|
|
196
|
+
export interface ComposioServiceResult {
|
|
197
|
+
principal: {
|
|
198
|
+
principal_id: string;
|
|
199
|
+
owner_scope_id: string;
|
|
200
|
+
composio_user_id: string;
|
|
201
|
+
status: string;
|
|
202
|
+
created_at?: string | null;
|
|
203
|
+
updated_at?: string | null;
|
|
204
|
+
} | null;
|
|
205
|
+
routes: ComposioRouteResult[];
|
|
206
|
+
link_sessions: ComposioLinkSessionResult[];
|
|
207
|
+
}
|
|
208
|
+
export interface HealthResult {
|
|
209
|
+
reachable: boolean;
|
|
210
|
+
status: string;
|
|
211
|
+
api_url?: string | null;
|
|
212
|
+
auth_url?: string | null;
|
|
213
|
+
published_capabilities?: number | null;
|
|
214
|
+
queued_executions?: number | null;
|
|
215
|
+
pending_approvals?: number | null;
|
|
216
|
+
recent_executions?: number | null;
|
|
217
|
+
}
|
|
218
|
+
export interface ExecutionStartResult {
|
|
219
|
+
status: string;
|
|
220
|
+
execution_id: string | null;
|
|
221
|
+
capability: string | null;
|
|
222
|
+
state: string | null;
|
|
223
|
+
approval_id?: string | null;
|
|
224
|
+
approval_url?: string | null;
|
|
225
|
+
reason?: string | null;
|
|
226
|
+
}
|
|
227
|
+
export interface SecretReference {
|
|
228
|
+
secret_ref_id?: string;
|
|
229
|
+
name: string;
|
|
230
|
+
display_name: string;
|
|
231
|
+
kind: string;
|
|
232
|
+
resolver_kind: string;
|
|
233
|
+
status: string;
|
|
234
|
+
backend_locator: Record<string, unknown>;
|
|
235
|
+
managed_by: string;
|
|
236
|
+
rotated_at: string | null;
|
|
237
|
+
created_at: string;
|
|
238
|
+
updated_at: string;
|
|
239
|
+
stored_material_present?: boolean;
|
|
240
|
+
}
|
|
241
|
+
export interface ExecutionStatusResult {
|
|
242
|
+
execution_id: string;
|
|
243
|
+
capability: string | null;
|
|
244
|
+
state: string | null;
|
|
245
|
+
duration_sec?: number | null;
|
|
246
|
+
exit_code?: number | null;
|
|
247
|
+
started_at?: string | null;
|
|
248
|
+
completed_at?: string | null;
|
|
249
|
+
error_code?: string | null;
|
|
250
|
+
error_message?: string | null;
|
|
251
|
+
}
|
|
252
|
+
export interface LogEvent {
|
|
253
|
+
sequence?: number;
|
|
254
|
+
kind?: string;
|
|
255
|
+
message: string;
|
|
256
|
+
payload_json?: unknown;
|
|
257
|
+
occurred_at?: string;
|
|
258
|
+
}
|
|
259
|
+
export interface ExecutionLogsResult {
|
|
260
|
+
execution_id: string;
|
|
261
|
+
state?: string | null;
|
|
262
|
+
exit_code?: number | null;
|
|
263
|
+
started_at?: string | null;
|
|
264
|
+
completed_at?: string | null;
|
|
265
|
+
error_code?: string | null;
|
|
266
|
+
error_message?: string | null;
|
|
267
|
+
events: LogEvent[];
|
|
268
|
+
}
|
|
269
|
+
export interface JsonSchema {
|
|
270
|
+
type?: string | string[];
|
|
271
|
+
title?: string;
|
|
272
|
+
description?: string;
|
|
273
|
+
default?: unknown;
|
|
274
|
+
enum?: unknown[];
|
|
275
|
+
anyOf?: JsonSchema[];
|
|
276
|
+
oneOf?: JsonSchema[];
|
|
277
|
+
items?: JsonSchema;
|
|
278
|
+
properties?: Record<string, JsonSchema>;
|
|
279
|
+
required?: string[];
|
|
280
|
+
additionalProperties?: boolean | JsonSchema;
|
|
281
|
+
minimum?: number;
|
|
282
|
+
maximum?: number;
|
|
283
|
+
}
|
|
284
|
+
//# sourceMappingURL=types.d.ts.map
|