@harness-nexus/sdk 0.1.0-alpha.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 sinrimin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,354 @@
1
+ /**
2
+ * @harness-nexus/sdk — thin HTTP client for the Harness Nexus REST API.
3
+ *
4
+ * Used by the web SPA, the install CLI (when it talks to a running server),
5
+ * and external scripts. Auth is via a JWT (from login/register) or a PAT
6
+ * (`hnpat_…`), sent as `Authorization: Bearer <token>`.
7
+ */
8
+ import type { Role, User, McpServer, DialSite, McpTransport, Profile, Resource, ResourceKind, AgentTarget, ResourceSource, TrustTier, SkillMeta, SkillBundle, Machine } from '@harness-nexus/core';
9
+ import type { JobView, MarketplaceCatalog, MarketplacePlugin, MarketplaceSource, PluginResourceSource, McpToolInfo, ClientMcpConfig, InventorySnapshot, InventoryDiff } from '@harness-nexus/shared';
10
+ export { SCANNABLE_TARGETS, jobViewSchema, HOOK_EVENTS, HOOK_SUPPORT, resolveTrustTier, resolveDialSite, marketplacePluginToResourceSource, skillMetaToResourceSource, type HookEvent, } from '@harness-nexus/shared';
11
+ export type { JobView, InventorySnapshot, InventoryDiff, MarketplaceCatalog, MarketplacePlugin, MarketplaceSource, PluginResourceSource, McpToolInfo, ClientMcpConfig, };
12
+ export interface SdkOptions {
13
+ baseUrl: string;
14
+ /** Raw JWT or PAT, sent as `Authorization: Bearer <token>`. */
15
+ token?: string;
16
+ fetch?: typeof fetch;
17
+ }
18
+ export interface PublicUser extends Omit<User, 'passwordHash'> {
19
+ }
20
+ export interface PatView {
21
+ id: string;
22
+ userId: string;
23
+ name: string;
24
+ prefix: string;
25
+ scopes: string[];
26
+ expiresAt: string | null;
27
+ lastUsedAt: string | null;
28
+ createdAt: string;
29
+ }
30
+ /** Machine API view (Phase 8) — the domain Machine plus derived presence. */
31
+ export interface MachineView extends Machine {
32
+ online: boolean;
33
+ }
34
+ /** Audit row for one chat channel (GET /api/agent-instances/:id/sessions). */
35
+ export interface AcSessionView {
36
+ id: string;
37
+ agentInstanceId: string;
38
+ machineId: string;
39
+ ownerId: string;
40
+ openedAt: string;
41
+ closedAt: string | null;
42
+ closeReason: string | null;
43
+ }
44
+ /** A deployed agent on a machine (Phase 8 C4) — one per (machine, profile). */
45
+ export interface AgentInstanceView {
46
+ id: string;
47
+ machineId: string;
48
+ ownerId: string;
49
+ target: string;
50
+ profileId: string;
51
+ profileVersion: string | null;
52
+ name: string;
53
+ directory: string;
54
+ jobId: string;
55
+ createdAt: string;
56
+ updatedAt: string;
57
+ }
58
+ /** Response of POST /api/machines/:id/inventory/import (Phase 8 C3). */
59
+ export interface ImportResult {
60
+ profile: Profile;
61
+ created: {
62
+ kind: string;
63
+ name: string;
64
+ id: string;
65
+ key?: string;
66
+ }[];
67
+ reused: {
68
+ kind: string;
69
+ name: string;
70
+ id: string;
71
+ key?: string;
72
+ }[];
73
+ failed: {
74
+ kind: string;
75
+ name: string;
76
+ error: string;
77
+ }[];
78
+ warnings: string[];
79
+ }
80
+ export interface CredentialView {
81
+ id: string;
82
+ name: string;
83
+ secretPreview: string;
84
+ scope: 'global' | 'personal';
85
+ ownerId: string | null;
86
+ /** Phase 8 C2 — may the plaintext reach a client shim (always true for personal). */
87
+ distributable: boolean;
88
+ createdAt: string;
89
+ updatedAt: string;
90
+ }
91
+ /** Live connection state of a proxy-mode upstream MCP server. */
92
+ export interface McpServerStatus {
93
+ id: string;
94
+ name: string;
95
+ status: 'connecting' | 'connected' | 'error' | 'disconnected';
96
+ detail?: string;
97
+ /** Cached tool count for this connection (Phase 2.4; absent on older servers). */
98
+ toolCount?: number;
99
+ }
100
+ /**
101
+ * Input shape for a profile entry — two arms (Phase 3.5):
102
+ * - `{ mcpServerId }` (2.2) — kind is implicitly 'mcp'.
103
+ * - `{ resourceId, kind }` — a Resource reference ('mcp' excluded: MCP
104
+ * servers are managed via /api/mcp-servers and enter via the other arm).
105
+ */
106
+ export type ProfileEntryInput = {
107
+ mcpServerId: string;
108
+ pinnedVersion?: string;
109
+ } | {
110
+ resourceId: string;
111
+ kind: Exclude<ResourceKind, 'mcp'>;
112
+ pinnedVersion?: string;
113
+ installOptions?: Record<string, unknown>;
114
+ };
115
+ export declare class HarnessNexusError extends Error {
116
+ readonly code: string;
117
+ readonly statusCode: number;
118
+ readonly details?: unknown | undefined;
119
+ constructor(message: string, code: string, statusCode: number, details?: unknown | undefined);
120
+ }
121
+ export declare class HarnessNexusClient {
122
+ private token;
123
+ private readonly opts;
124
+ private readonly fetchImpl;
125
+ constructor(opts: SdkOptions);
126
+ /** Update the token after login/register. */
127
+ setToken(token: string | undefined): void;
128
+ getToken(): string | undefined;
129
+ login(username: string, password: string): Promise<{
130
+ token: string;
131
+ user: PublicUser;
132
+ }>;
133
+ register(username: string, password: string, email?: string): Promise<{
134
+ token: string;
135
+ user: PublicUser;
136
+ }>;
137
+ getMe(): Promise<PublicUser>;
138
+ listUsers(): Promise<PublicUser[]>;
139
+ createUser(input: {
140
+ username: string;
141
+ password: string;
142
+ email?: string;
143
+ role?: Role;
144
+ }): Promise<PublicUser>;
145
+ deleteUser(id: string): Promise<void>;
146
+ updateUserRole(id: string, role: Role): Promise<PublicUser>;
147
+ createPat(input: {
148
+ name: string;
149
+ /**
150
+ * Token purpose (Phase 3.5): `api` (default) powers the CLI/REST API;
151
+ * `marketplace` is an emit token that ONLY authenticates the marketplace
152
+ * emitter URL. For `marketplace`, the response additionally carries the
153
+ * ready-to-paste `addCommand` + `marketplaceUrl` (shown once, like the token).
154
+ */
155
+ kind?: 'api' | 'marketplace';
156
+ scopes?: string[];
157
+ expiresAt?: string;
158
+ }): Promise<{
159
+ pat: PatView;
160
+ token: string;
161
+ marketplaceUrl?: string;
162
+ addCommand?: string;
163
+ }>;
164
+ listPats(): Promise<PatView[]>;
165
+ revokePat(id: string): Promise<void>;
166
+ createMachine(input: {
167
+ name: string;
168
+ }): Promise<{
169
+ machine: MachineView;
170
+ token: string;
171
+ }>;
172
+ listMachines(): Promise<MachineView[]>;
173
+ getMachine(id: string): Promise<MachineView>;
174
+ updateMachine(id: string, input: {
175
+ name?: string;
176
+ remoteChatEnabled?: boolean;
177
+ }): Promise<MachineView>;
178
+ deleteMachine(id: string): Promise<void>;
179
+ getMachineInventory(machineId: string): Promise<{
180
+ target: string;
181
+ daemonVersion: string | null;
182
+ reportedAt: string;
183
+ scannedAt: string;
184
+ agents: InventorySnapshot['agents'];
185
+ }[]>;
186
+ scanMachineInventory(machineId: string, targets?: InventorySnapshot['target'][]): Promise<{
187
+ target: string;
188
+ reportedAt: string;
189
+ agents: InventorySnapshot['agents'];
190
+ }[]>;
191
+ diffMachineInventory(machineId: string, profileId: string): Promise<InventoryDiff>;
192
+ importMachineInventory(machineId: string, input: {
193
+ target: InventorySnapshot['target'];
194
+ profileName: string;
195
+ items: {
196
+ kind: 'skill' | 'command' | 'sub_agent' | 'rule' | 'mcp';
197
+ name: string;
198
+ }[];
199
+ }): Promise<ImportResult>;
200
+ createMachineJob(machineId: string, input: {
201
+ profileId: string;
202
+ directory?: string;
203
+ }): Promise<JobView>;
204
+ listMachineJobs(machineId: string): Promise<JobView[]>;
205
+ cancelJob(jobId: string): Promise<JobView>;
206
+ listMachineAgents(machineId: string): Promise<AgentInstanceView[]>;
207
+ /** Chat-channel audit rows for one agent instance (C5). */
208
+ listAgentSessions(agentInstanceId: string): Promise<{
209
+ agent: AgentInstanceView;
210
+ sessions: AcSessionView[];
211
+ }>;
212
+ /** The resolved profile bundle a deploy fetches (machine PAT exception #2). */
213
+ getDeployBundle(profileId: string): Promise<{
214
+ profile: Profile;
215
+ artifacts: unknown[];
216
+ }>;
217
+ getRegistration(): Promise<{
218
+ allowRegistration: boolean;
219
+ }>;
220
+ setRegistration(allowRegistration: boolean): Promise<{
221
+ allowRegistration: boolean;
222
+ }>;
223
+ createCredential(input: {
224
+ name: string;
225
+ secret: string;
226
+ scope: 'global' | 'personal';
227
+ distributable?: boolean;
228
+ }): Promise<{
229
+ credential: CredentialView;
230
+ }>;
231
+ listCredentials(): Promise<CredentialView[]>;
232
+ updateCredential(id: string, input: {
233
+ name?: string;
234
+ secret?: string;
235
+ }): Promise<{
236
+ credential: CredentialView;
237
+ }>;
238
+ deleteCredential(id: string): Promise<void>;
239
+ createMcpServer(input: {
240
+ name: string;
241
+ transport: McpTransport;
242
+ dialSite?: DialSite;
243
+ scope: 'global' | 'personal';
244
+ }): Promise<{
245
+ mcpServer: McpServer;
246
+ }>;
247
+ listMcpServers(): Promise<McpServer[]>;
248
+ updateMcpServer(id: string, input: {
249
+ name?: string;
250
+ transport?: McpTransport;
251
+ dialSite?: DialSite;
252
+ }): Promise<{
253
+ mcpServer: McpServer;
254
+ }>;
255
+ deleteMcpServer(id: string): Promise<void>;
256
+ /**
257
+ * Client config fetch (Phase 8 C2) — the `hnx mcp serve` shim's world model.
258
+ * Accepts an api PAT/JWT or a machine PAT; resolved transports (plaintext
259
+ * included) appear for CLIENT-dialed servers only.
260
+ */
261
+ getClientMcpConfig(profileId: string): Promise<ClientMcpConfig>;
262
+ listMcpServerStatuses(): Promise<McpServerStatus[]>;
263
+ connectMcpServer(id: string): Promise<McpServerStatus>;
264
+ disconnectMcpServer(id: string): Promise<McpServerStatus>;
265
+ /** Cached tool list (original names). Empty when not connected. */
266
+ listMcpServerTools(id: string): Promise<McpToolInfo[]>;
267
+ /** Re-pull the tool list from the upstream. Requires an active connection. */
268
+ refreshMcpServerTools(id: string): Promise<McpToolInfo[]>;
269
+ createProfile(input: {
270
+ name: string;
271
+ description?: string;
272
+ /** Single immutable target this profile is shaped for (Phase 3.2). */
273
+ target: AgentTarget;
274
+ scope: 'global' | 'personal';
275
+ entries?: ProfileEntryInput[];
276
+ }): Promise<{
277
+ profile: Profile;
278
+ }>;
279
+ listProfiles(): Promise<Profile[]>;
280
+ getProfile(id: string): Promise<{
281
+ profile: Profile;
282
+ }>;
283
+ updateProfile(id: string, input: {
284
+ name?: string;
285
+ description?: string;
286
+ entries?: ProfileEntryInput[];
287
+ }): Promise<{
288
+ profile: Profile;
289
+ }>;
290
+ deleteProfile(id: string): Promise<void>;
291
+ createResource(input: {
292
+ key: string;
293
+ kind: ResourceKind;
294
+ name: string;
295
+ description?: string;
296
+ version?: string;
297
+ source: ResourceSource;
298
+ scope: 'global' | 'personal';
299
+ targets?: AgentTarget[];
300
+ labels?: Record<string, string>;
301
+ }): Promise<{
302
+ resource: Resource;
303
+ }>;
304
+ listResources(filter?: {
305
+ kind?: ResourceKind;
306
+ scope?: 'global' | 'personal';
307
+ target?: AgentTarget;
308
+ }): Promise<Resource[]>;
309
+ getResource(id: string): Promise<{
310
+ resource: Resource;
311
+ }>;
312
+ updateResource(id: string, input: {
313
+ key?: string;
314
+ name?: string;
315
+ description?: string;
316
+ version?: string;
317
+ source?: ResourceSource;
318
+ targets?: AgentTarget[];
319
+ labels?: Record<string, string>;
320
+ }): Promise<{
321
+ resource: Resource;
322
+ }>;
323
+ deleteResource(id: string): Promise<void>;
324
+ /** List the configured marketplace allowlist (no fetch). */
325
+ listMarketplaces(): Promise<{
326
+ marketplaces: {
327
+ id: string;
328
+ }[];
329
+ }>;
330
+ /**
331
+ * List a marketplace's plugins (fetched + cached server-side). Optional
332
+ * `category` and free-text `q` filters narrow the result.
333
+ */
334
+ listMarketplacePlugins(id: string, filter?: {
335
+ category?: string;
336
+ q?: string;
337
+ }): Promise<{
338
+ plugins: MarketplacePlugin[];
339
+ }>;
340
+ /**
341
+ * Multi-source skill search (Phase 7.4). Dispatches to all configured
342
+ * SkillSources in parallel, merges, dedupes by identifier, ranks by trust.
343
+ * Returns the `timedOut` / `errored` source ids so the UI can surface a
344
+ * partial-results notice.
345
+ */
346
+ searchSkills(q: string, limit?: number): Promise<{
347
+ results: SkillMeta[];
348
+ timedOut: string[];
349
+ errored: string[];
350
+ }>;
351
+ private request;
352
+ }
353
+ export type { Role, McpServer, DialSite, McpTransport, Profile, Resource, ResourceKind, ResourceSource, AgentTarget, TrustTier, SkillMeta, SkillBundle, };
354
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EACV,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,cAAc,EACd,SAAS,EACT,SAAS,EACT,WAAW,EACX,OAAO,EACR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,OAAO,EACP,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,aAAa,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,iBAAiB,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AE,MAAM,EACT,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC;QAAE,OAAO,EAAE,SAAS,EAAE,CAAC;QAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;YAO7D,OAAO;CA6BtB;AAED,YAAY,EACV,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,WAAW,EAEX,SAAS,EACT,SAAS,EACT,WAAW,GACZ,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,301 @@
1
+ export { SCANNABLE_TARGETS, jobViewSchema, HOOK_EVENTS, HOOK_SUPPORT, resolveTrustTier, resolveDialSite, marketplacePluginToResourceSource, skillMetaToResourceSource, } from '@harness-nexus/shared';
2
+ export class HarnessNexusError extends Error {
3
+ code;
4
+ statusCode;
5
+ details;
6
+ constructor(message, code, statusCode, details) {
7
+ super(message);
8
+ this.code = code;
9
+ this.statusCode = statusCode;
10
+ this.details = details;
11
+ this.name = 'HarnessNexusError';
12
+ }
13
+ }
14
+ export class HarnessNexusClient {
15
+ token;
16
+ opts;
17
+ fetchImpl;
18
+ constructor(opts) {
19
+ this.opts = opts;
20
+ this.token = opts.token;
21
+ // Bind fetch: in the browser `fetch` is a method on `window` and relies on
22
+ // `this === window`. Taking it as a bare reference and calling it later
23
+ // throws "does not implement interface Window". Bind it to globalThis so it
24
+ // can be invoked as a free function. (Node 18+ also exposes fetch on
25
+ // globalThis.)
26
+ const bound = globalThis.fetch?.bind(globalThis);
27
+ this.fetchImpl = opts.fetch ?? bound ?? fetch;
28
+ }
29
+ /** Update the token after login/register. */
30
+ setToken(token) {
31
+ this.token = token;
32
+ }
33
+ getToken() {
34
+ return this.token;
35
+ }
36
+ // ---- auth ----
37
+ async login(username, password) {
38
+ const res = await this.request('POST', '/api/auth/login', { username, password }, true);
39
+ this.token = res.token;
40
+ return res;
41
+ }
42
+ async register(username, password, email) {
43
+ const res = await this.request('POST', '/api/auth/register', { username, password, email }, true);
44
+ this.token = res.token;
45
+ return res;
46
+ }
47
+ async getMe() {
48
+ const res = await this.request('GET', '/api/auth/me');
49
+ return res.user;
50
+ }
51
+ // ---- users (admin) ----
52
+ async listUsers() {
53
+ const res = await this.request('GET', '/api/users');
54
+ return res.users;
55
+ }
56
+ async createUser(input) {
57
+ const res = await this.request('POST', '/api/users', input);
58
+ return res.user;
59
+ }
60
+ async deleteUser(id) {
61
+ await this.request('DELETE', `/api/users/${id}`);
62
+ }
63
+ async updateUserRole(id, role) {
64
+ const res = await this.request('PATCH', `/api/users/${id}/role`, { role });
65
+ return res.user;
66
+ }
67
+ // ---- PATs ----
68
+ async createPat(input) {
69
+ return this.request('POST', '/api/pats', input);
70
+ }
71
+ async listPats() {
72
+ const res = await this.request('GET', '/api/pats');
73
+ return res.pats;
74
+ }
75
+ async revokePat(id) {
76
+ await this.request('DELETE', `/api/pats/${id}`);
77
+ }
78
+ // ---- machines (Phase 8 C1) ----
79
+ async createMachine(input) {
80
+ return this.request('POST', '/api/machines', input);
81
+ }
82
+ async listMachines() {
83
+ const res = await this.request('GET', '/api/machines');
84
+ return res.machines;
85
+ }
86
+ async getMachine(id) {
87
+ const res = await this.request('GET', `/api/machines/${id}`);
88
+ return res.machine;
89
+ }
90
+ async updateMachine(id, input) {
91
+ const res = await this.request('PATCH', `/api/machines/${id}`, input);
92
+ return res.machine;
93
+ }
94
+ async deleteMachine(id) {
95
+ await this.request('DELETE', `/api/machines/${id}`);
96
+ }
97
+ // ---- machine inventory (Phase 8 C3) ----
98
+ async getMachineInventory(machineId) {
99
+ const res = await this.request('GET', `/api/machines/${machineId}/inventory`);
100
+ return res.inventory;
101
+ }
102
+ async scanMachineInventory(machineId, targets) {
103
+ const res = await this.request('POST', `/api/machines/${machineId}/inventory/scan`, {
104
+ ...(targets ? { targets } : {}),
105
+ });
106
+ return res.inventory;
107
+ }
108
+ async diffMachineInventory(machineId, profileId) {
109
+ const res = await this.request('GET', `/api/machines/${machineId}/inventory/diff?profile=${encodeURIComponent(profileId)}`);
110
+ return res.diff;
111
+ }
112
+ async importMachineInventory(machineId, input) {
113
+ return this.request('POST', `/api/machines/${machineId}/inventory/import`, input);
114
+ }
115
+ // ---- jobs + agents (Phase 8 C4) ----
116
+ async createMachineJob(machineId, input) {
117
+ const res = await this.request('POST', `/api/machines/${machineId}/jobs`, input);
118
+ return res.job;
119
+ }
120
+ async listMachineJobs(machineId) {
121
+ const res = await this.request('GET', `/api/machines/${machineId}/jobs`);
122
+ return res.jobs;
123
+ }
124
+ async cancelJob(jobId) {
125
+ const res = await this.request('POST', `/api/jobs/${jobId}/cancel`);
126
+ return res.job;
127
+ }
128
+ async listMachineAgents(machineId) {
129
+ const res = await this.request('GET', `/api/machines/${machineId}/agents`);
130
+ return res.agents;
131
+ }
132
+ /** Chat-channel audit rows for one agent instance (C5). */
133
+ async listAgentSessions(agentInstanceId) {
134
+ return this.request('GET', `/api/agent-instances/${agentInstanceId}/sessions`);
135
+ }
136
+ /** The resolved profile bundle a deploy fetches (machine PAT exception #2). */
137
+ async getDeployBundle(profileId) {
138
+ return this.request('GET', `/api/client/deploy-bundle?profile=${encodeURIComponent(profileId)}`);
139
+ }
140
+ // ---- settings ----
141
+ async getRegistration() {
142
+ return this.request('GET', '/api/settings/registration', undefined, true);
143
+ }
144
+ async setRegistration(allowRegistration) {
145
+ return this.request('PUT', '/api/settings/registration', { allowRegistration });
146
+ }
147
+ // ---- credentials ----
148
+ async createCredential(input) {
149
+ return this.request('POST', '/api/credentials', input);
150
+ }
151
+ async listCredentials() {
152
+ const res = await this.request('GET', '/api/credentials');
153
+ return res.credentials;
154
+ }
155
+ async updateCredential(id, input) {
156
+ return this.request('PATCH', `/api/credentials/${id}`, input);
157
+ }
158
+ async deleteCredential(id) {
159
+ await this.request('DELETE', `/api/credentials/${id}`);
160
+ }
161
+ // ---- mcp servers ----
162
+ async createMcpServer(input) {
163
+ return this.request('POST', '/api/mcp-servers', input);
164
+ }
165
+ async listMcpServers() {
166
+ const res = await this.request('GET', '/api/mcp-servers');
167
+ return res.mcpServers;
168
+ }
169
+ async updateMcpServer(id, input) {
170
+ return this.request('PATCH', `/api/mcp-servers/${id}`, input);
171
+ }
172
+ async deleteMcpServer(id) {
173
+ await this.request('DELETE', `/api/mcp-servers/${id}`);
174
+ }
175
+ /**
176
+ * Client config fetch (Phase 8 C2) — the `hnx mcp serve` shim's world model.
177
+ * Accepts an api PAT/JWT or a machine PAT; resolved transports (plaintext
178
+ * included) appear for CLIENT-dialed servers only.
179
+ */
180
+ async getClientMcpConfig(profileId) {
181
+ return this.request('GET', `/api/client/mcp-config?profile=${encodeURIComponent(profileId)}`);
182
+ }
183
+ // ---- mcp server status (live registry) ----
184
+ async listMcpServerStatuses() {
185
+ const res = await this.request('GET', '/api/mcp-servers/status');
186
+ return res.statuses;
187
+ }
188
+ // ---- mcp server connect/disconnect + tool inspection (Phase 2.4) ----
189
+ // Operator control surface on the proxy registry pool. proxy-only servers.
190
+ async connectMcpServer(id) {
191
+ const res = await this.request('POST', `/api/mcp-servers/${id}/connect`);
192
+ return res.status;
193
+ }
194
+ async disconnectMcpServer(id) {
195
+ const res = await this.request('POST', `/api/mcp-servers/${id}/disconnect`);
196
+ return res.status;
197
+ }
198
+ /** Cached tool list (original names). Empty when not connected. */
199
+ async listMcpServerTools(id) {
200
+ const res = await this.request('GET', `/api/mcp-servers/${id}/tools`);
201
+ return res.tools;
202
+ }
203
+ /** Re-pull the tool list from the upstream. Requires an active connection. */
204
+ async refreshMcpServerTools(id) {
205
+ const res = await this.request('POST', `/api/mcp-servers/${id}/tools/refresh`);
206
+ return res.tools;
207
+ }
208
+ // ---- profiles ----
209
+ async createProfile(input) {
210
+ return this.request('POST', '/api/profiles', input);
211
+ }
212
+ async listProfiles() {
213
+ const res = await this.request('GET', '/api/profiles');
214
+ return res.profiles;
215
+ }
216
+ async getProfile(id) {
217
+ return this.request('GET', `/api/profiles/${id}`);
218
+ }
219
+ async updateProfile(id, input) {
220
+ return this.request('PATCH', `/api/profiles/${id}`, input);
221
+ }
222
+ async deleteProfile(id) {
223
+ await this.request('DELETE', `/api/profiles/${id}`);
224
+ }
225
+ // ---- resources ----
226
+ async createResource(input) {
227
+ return this.request('POST', '/api/resources', input);
228
+ }
229
+ async listResources(filter) {
230
+ const qs = new URLSearchParams();
231
+ if (filter?.kind)
232
+ qs.set('kind', filter.kind);
233
+ if (filter?.scope)
234
+ qs.set('scope', filter.scope);
235
+ if (filter?.target)
236
+ qs.set('target', filter.target);
237
+ const suffix = qs.toString() ? `?${qs.toString()}` : '';
238
+ const res = await this.request('GET', `/api/resources${suffix}`);
239
+ return res.resources;
240
+ }
241
+ async getResource(id) {
242
+ return this.request('GET', `/api/resources/${id}`);
243
+ }
244
+ async updateResource(id, input) {
245
+ return this.request('PATCH', `/api/resources/${id}`, input);
246
+ }
247
+ async deleteResource(id) {
248
+ await this.request('DELETE', `/api/resources/${id}`);
249
+ }
250
+ // ---- skills hub (Phase 7.2) ----
251
+ /** List the configured marketplace allowlist (no fetch). */
252
+ async listMarketplaces() {
253
+ return this.request('GET', '/api/skills/marketplaces');
254
+ }
255
+ /**
256
+ * List a marketplace's plugins (fetched + cached server-side). Optional
257
+ * `category` and free-text `q` filters narrow the result.
258
+ */
259
+ async listMarketplacePlugins(id, filter) {
260
+ const params = new URLSearchParams();
261
+ if (filter?.category)
262
+ params.set('category', filter.category);
263
+ if (filter?.q)
264
+ params.set('q', filter.q);
265
+ const qs = params.toString();
266
+ return this.request('GET', `/api/skills/marketplaces/${id}/plugins${qs ? `?${qs}` : ''}`);
267
+ }
268
+ /**
269
+ * Multi-source skill search (Phase 7.4). Dispatches to all configured
270
+ * SkillSources in parallel, merges, dedupes by identifier, ranks by trust.
271
+ * Returns the `timedOut` / `errored` source ids so the UI can surface a
272
+ * partial-results notice.
273
+ */
274
+ async searchSkills(q, limit) {
275
+ const params = new URLSearchParams({ q });
276
+ if (limit !== undefined)
277
+ params.set('limit', String(limit));
278
+ return this.request('GET', `/api/skills/search?${params.toString()}`);
279
+ }
280
+ // ---- core request helper ----
281
+ async request(method, path, body, isPublic = false) {
282
+ const headers = {};
283
+ if (body !== undefined)
284
+ headers['Content-Type'] = 'application/json';
285
+ if (!isPublic && this.token)
286
+ headers.Authorization = `Bearer ${this.token}`;
287
+ const url = this.opts.baseUrl.replace(/\/$/, '') + path;
288
+ const init = { method, headers };
289
+ if (body !== undefined)
290
+ init.body = JSON.stringify(body);
291
+ const res = await this.fetchImpl(url, init);
292
+ const text = await res.text();
293
+ const parsed = text ? JSON.parse(text) : undefined;
294
+ if (!res.ok) {
295
+ const err = parsed;
296
+ throw new HarnessNexusError(err?.message ?? `request failed: ${res.status}`, err?.error ?? 'REQUEST_FAILED', err?.statusCode ?? res.status, err?.details);
297
+ }
298
+ return parsed;
299
+ }
300
+ }
301
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAkCA,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,iCAAiC,EACjC,yBAAyB,GAE1B,MAAM,uBAAuB,CAAC;AAqH/B,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAG/B;IACA;IACA;IAJX,YACE,OAAe,EACN,IAAY,EACZ,UAAkB,EAClB,OAAiB;QAE1B,KAAK,CAAC,OAAO,CAAC,CAAC;QAJN,SAAI,GAAJ,IAAI,CAAQ;QACZ,eAAU,GAAV,UAAU,CAAQ;QAClB,YAAO,GAAP,OAAO,CAAU;QAG1B,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF;AAED,MAAM,OAAO,kBAAkB;IACrB,KAAK,CAAqB;IACjB,IAAI,CAAa;IACjB,SAAS,CAAe;IAEzC,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI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AO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC;QACxD,MAAM,IAAI,GAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;QAC9C,IAAI,IAAI,KAAK,SAAS;YAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACzD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAE5C,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAa,CAAC,CAAC,CAAC,SAAS,CAAC;QAEhE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,MAAM,GAAG,GAAG,MAAkC,CAAC;YAC/C,MAAM,IAAI,iBAAiB,CACzB,GAAG,EAAE,OAAO,IAAI,mBAAmB,GAAG,CAAC,MAAM,EAAE,EAC/C,GAAG,EAAE,KAAK,IAAI,gBAAgB,EAC9B,GAAG,EAAE,UAAU,IAAI,GAAG,CAAC,MAAM,EAC7B,GAAG,EAAE,OAAO,CACb,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@harness-nexus/sdk",
3
+ "version": "0.1.0-alpha.1",
4
+ "description": "TypeScript client SDK for the Harness Nexus HTTP API.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "dependencies": {
18
+ "@harness-nexus/core": "0.1.0-alpha.1",
19
+ "@harness-nexus/shared": "0.1.0-alpha.1"
20
+ },
21
+ "devDependencies": {
22
+ "@types/node": "^22.8.6",
23
+ "typescript": "^5.6.3"
24
+ },
25
+ "license": "MIT",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/sinrimin/harness-nexus.git",
29
+ "directory": "packages/sdk-ts"
30
+ },
31
+ "engines": {
32
+ "node": ">=20.0.0"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "scripts": {
38
+ "build": "tsc -p tsconfig.json",
39
+ "dev": "tsc -p tsconfig.json --watch --preserveWatchOutput",
40
+ "typecheck": "tsc -p tsconfig.json --noEmit",
41
+ "lint": "echo \"(lint placeholder) add eslint/oxlint config\"",
42
+ "test": "echo \"(test placeholder) add vitest\""
43
+ }
44
+ }