@axiom-lattice/client-sdk 7.1.0 → 7.2.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/dist/__tests__/mcpAppShareRuntimeClient.test.d.ts +2 -0
- package/dist/__tests__/mcpAppShareRuntimeClient.test.d.ts.map +1 -0
- package/dist/__tests__/mcpAppShareRuntimeClient.test.js +39 -0
- package/dist/__tests__/mcpAppShareRuntimeClient.test.js.map +1 -0
- package/dist/index.d.ts +50 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +45 -0
- package/dist/index.mjs.map +1 -1
- package/dist/mcpAppShareRuntimeClient.d.ts +48 -0
- package/dist/mcpAppShareRuntimeClient.d.ts.map +1 -0
- package/dist/mcpAppShareRuntimeClient.js +55 -0
- package/dist/mcpAppShareRuntimeClient.js.map +1 -0
- package/dist/resources-client.d.ts +2 -2
- package/dist/resources-client.d.ts.map +1 -1
- package/dist/resources-client.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpAppShareRuntimeClient.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/mcpAppShareRuntimeClient.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { McpAppShareRuntimeClient } from "../mcpAppShareRuntimeClient";
|
|
2
|
+
const ref = {
|
|
3
|
+
kind: "plugin",
|
|
4
|
+
pluginType: "demo",
|
|
5
|
+
resource: "ui/app.html",
|
|
6
|
+
displayMode: "inline",
|
|
7
|
+
};
|
|
8
|
+
describe("McpAppShareRuntimeClient", () => {
|
|
9
|
+
const originalFetch = global.fetch;
|
|
10
|
+
afterEach(() => {
|
|
11
|
+
global.fetch = originalFetch;
|
|
12
|
+
jest.restoreAllMocks();
|
|
13
|
+
});
|
|
14
|
+
it("loads bootstrap from the share token route", async () => {
|
|
15
|
+
global.fetch = jest.fn(async () => ({
|
|
16
|
+
ok: true,
|
|
17
|
+
json: async () => ({ title: "Demo", visibility: "public", app: {} }),
|
|
18
|
+
}));
|
|
19
|
+
const client = new McpAppShareRuntimeClient({ baseURL: "https://gw.test", token: "t1" });
|
|
20
|
+
await client.bootstrap();
|
|
21
|
+
expect(global.fetch).toHaveBeenCalledWith("https://gw.test/api/mcp-app-shares/t1/bootstrap", { credentials: "include" });
|
|
22
|
+
});
|
|
23
|
+
it("posts rpc and surfaces the error code", async () => {
|
|
24
|
+
global.fetch = jest.fn(async () => ({
|
|
25
|
+
ok: false,
|
|
26
|
+
status: 401,
|
|
27
|
+
json: async () => ({ error: "SHARE_PASSWORD_REQUIRED" }),
|
|
28
|
+
}));
|
|
29
|
+
const client = new McpAppShareRuntimeClient({ baseURL: "https://gw.test", token: "t1" });
|
|
30
|
+
await expect(client.mcpApps.rpc(ref, "tools/call", { name: "render" }))
|
|
31
|
+
.rejects.toThrow("SHARE_PASSWORD_REQUIRED");
|
|
32
|
+
expect(global.fetch).toHaveBeenCalledWith("https://gw.test/api/mcp-app-shares/t1/rpc", expect.objectContaining({
|
|
33
|
+
method: "POST",
|
|
34
|
+
credentials: "include",
|
|
35
|
+
body: JSON.stringify({ ref, method: "tools/call", params: { name: "render" } }),
|
|
36
|
+
}));
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=mcpAppShareRuntimeClient.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpAppShareRuntimeClient.test.js","sourceRoot":"","sources":["../../src/__tests__/mcpAppShareRuntimeClient.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAEvE,MAAM,GAAG,GAAG;IACV,IAAI,EAAE,QAAiB;IACvB,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,aAAa;IACvB,WAAW,EAAE,QAAiB;CAC/B,CAAC;AAEF,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC;IAEnC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,CAAC,KAAK,GAAG,aAAa,CAAC;QAC7B,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4CAA4C,EAAE,KAAK,IAAI,EAAE;QAC1D,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;YAClC,EAAE,EAAE,IAAI;YACR,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;SACrE,CAAC,CAAU,CAAC;QACb,MAAM,MAAM,GAAG,IAAI,wBAAwB,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACzF,MAAM,MAAM,CAAC,SAAS,EAAE,CAAC;QACzB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,oBAAoB,CACvC,iDAAiD,EACjD,EAAE,WAAW,EAAE,SAAS,EAAE,CAC3B,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE,KAAK,IAAI,EAAE;QACrD,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;YAClC,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,GAAG;YACX,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,yBAAyB,EAAE,CAAC;SACzD,CAAC,CAAU,CAAC;QACb,MAAM,MAAM,GAAG,IAAI,wBAAwB,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACzF,MAAM,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;aACpE,OAAO,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;QAC9C,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,oBAAoB,CACvC,2CAA2C,EAC3C,MAAM,CAAC,gBAAgB,CAAC;YACtB,MAAM,EAAE,MAAM;YACd,WAAW,EAAE,SAAS;YACtB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC;SAChF,CAAC,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _axiom_lattice_protocols from '@axiom-lattice/protocols';
|
|
2
|
-
import { McpUiResourcePayload, CapabilityBundle, CapabilityPreview, AgentWebApp, AgentInterrupt, Message, MessageChunk, DatabaseConfigEntry, MetricsServerConfigEntry, DataSource, McpServerConfigEntry, McpTool, LocalA2ATemplateDefinition, OpenGrant, TaskItem, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, ModelProviderPublicEntry, CreateModelProviderRequest, UpdateModelProviderRequest, ModelProviderProbeRequest, ModelProviderProbeResult, ModelSelection, ModelDiscoveryResult, TenantModelCatalog, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, ConnectionEntry, CreateTaskRequest, UpdateTaskRequest, TaskWorkItem, ThreadCheckpointStorage, LocalA2AProviderState, OpenCatalog, McpUiRef, CreateCapabilityBundleInput, UpdateCapabilityBundleInput, CreateAgentWebAppInput, UpdateAgentWebAppInput, Skill, CreateSkillRequest, CreateShareRequest, ShareResult, ShareRecord, ProjectRoom, ProjectRoomPublicMessage, ProjectMembership, ProjectBotMembership, ProjectRoomPublicMembership, ProjectRoomPublicBotMembership, ProjectRoomMention, ProjectHumanRole, ProjectBotRole, Project as Project$1, ProjectRoomEventScope, ToolCallUi } from '@axiom-lattice/protocols';
|
|
2
|
+
import { McpUiResourcePayload, CapabilityBundle, CapabilityPreview, AgentWebApp, AgentInterrupt, Message, MessageChunk, DatabaseConfigEntry, MetricsServerConfigEntry, DataSource, McpServerConfigEntry, McpTool, LocalA2ATemplateDefinition, OpenGrant, TaskItem, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, ModelProviderPublicEntry, CreateModelProviderRequest, UpdateModelProviderRequest, ModelProviderProbeRequest, ModelProviderProbeResult, ModelSelection, ModelDiscoveryResult, TenantModelCatalog, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, ConnectionEntry, CreateTaskRequest, UpdateTaskRequest, TaskWorkItem, ThreadCheckpointStorage, LocalA2AProviderState, OpenCatalog, McpUiRef, CreateCapabilityBundleInput, UpdateCapabilityBundleInput, CreateAgentWebAppInput, UpdateAgentWebAppInput, Skill, CreateSkillRequest, CreateShareRequest, ShareResult, ShareRecordPatch, ShareRecord, ProjectRoom, ProjectRoomPublicMessage, ProjectMembership, ProjectBotMembership, ProjectRoomPublicMembership, ProjectRoomPublicBotMembership, ProjectRoomMention, ProjectHumanRole, ProjectBotRole, Project as Project$1, ProjectRoomEventScope, ToolCallUi, McpAppShareBootstrap } from '@axiom-lattice/protocols';
|
|
3
3
|
export { AgentInterrupt, AgentWebApp, AgentWebAppAppearance, AgentWebAppFeatures, AgentWebAppQuickPrompt, AgentWebAppScope, AgentWebAppStatus, CapabilityBundle, CapabilityPreview, CreateAgentWebAppInput, CreateCapabilityBundleInput, LocalA2AProviderId, LocalA2AProviderState, LocalA2AProviderStatus, LocalA2ATemplateDefinition, LocalRuntimeConfig, ThreadCheckpointStorage, UpdateAgentWebAppInput, UpdateCapabilityBundleInput } from '@axiom-lattice/protocols';
|
|
4
4
|
|
|
5
5
|
/** Resolved MCP App UI resource plus its ready-to-use CSP policy string. */
|
|
@@ -2461,7 +2461,7 @@ declare class ResourcesClient {
|
|
|
2461
2461
|
constructor(baseURL: string, getHeaders: () => Record<string, string>);
|
|
2462
2462
|
share(request: CreateShareRequest): Promise<ShareResult>;
|
|
2463
2463
|
unshare(token: string): Promise<void>;
|
|
2464
|
-
updateShare(token: string, patch:
|
|
2464
|
+
updateShare(token: string, patch: ShareRecordPatch): Promise<void>;
|
|
2465
2465
|
listShares(): Promise<ShareRecord[]>;
|
|
2466
2466
|
}
|
|
2467
2467
|
|
|
@@ -3285,4 +3285,51 @@ declare function normalizeToolResult(message: {
|
|
|
3285
3285
|
artifact?: unknown;
|
|
3286
3286
|
}): NormalizedToolResult;
|
|
3287
3287
|
|
|
3288
|
-
|
|
3288
|
+
/**
|
|
3289
|
+
* Runtime client for a shared MCP App.
|
|
3290
|
+
*
|
|
3291
|
+
* The share token is the only credential. This client deliberately exposes the
|
|
3292
|
+
* same `mcpApps` surface as {@link Client} so the MCP App sandbox can be reused
|
|
3293
|
+
* without the console session or tenant headers.
|
|
3294
|
+
*/
|
|
3295
|
+
|
|
3296
|
+
/** Options for {@link McpAppShareRuntimeClient}. */
|
|
3297
|
+
interface McpAppShareRuntimeClientOptions {
|
|
3298
|
+
/** Gateway origin that serves the share routes. */
|
|
3299
|
+
baseURL: string;
|
|
3300
|
+
/** Opaque share token from `/s/:token`. */
|
|
3301
|
+
token: string;
|
|
3302
|
+
}
|
|
3303
|
+
/** Minimal MCP App host client surface used by `McpAppSandbox`. */
|
|
3304
|
+
interface McpAppShareRuntimeClientApi {
|
|
3305
|
+
config: {
|
|
3306
|
+
baseURL: string;
|
|
3307
|
+
};
|
|
3308
|
+
mcpApps: {
|
|
3309
|
+
getResource(ref: McpUiRef): Promise<McpUiResourceResponse>;
|
|
3310
|
+
rpc(ref: McpUiRef, method: string, params: Record<string, unknown>): Promise<unknown>;
|
|
3311
|
+
};
|
|
3312
|
+
bootstrap(): Promise<McpAppShareBootstrap>;
|
|
3313
|
+
unlock(password: string): Promise<void>;
|
|
3314
|
+
}
|
|
3315
|
+
/**
|
|
3316
|
+
* Client for `/api/mcp-app-shares/:token/*`.
|
|
3317
|
+
*/
|
|
3318
|
+
declare class McpAppShareRuntimeClient implements McpAppShareRuntimeClientApi {
|
|
3319
|
+
readonly config: {
|
|
3320
|
+
baseURL: string;
|
|
3321
|
+
};
|
|
3322
|
+
readonly mcpApps: McpAppShareRuntimeClientApi["mcpApps"];
|
|
3323
|
+
private readonly baseURL;
|
|
3324
|
+
private readonly token;
|
|
3325
|
+
constructor(options: McpAppShareRuntimeClientOptions);
|
|
3326
|
+
/** Load the app identity and a fresh first tool result. */
|
|
3327
|
+
bootstrap(): Promise<McpAppShareBootstrap>;
|
|
3328
|
+
/** Exchange the share password for the unlock cookie. */
|
|
3329
|
+
unlock(password: string): Promise<void>;
|
|
3330
|
+
private get;
|
|
3331
|
+
private request;
|
|
3332
|
+
private parse;
|
|
3333
|
+
}
|
|
3334
|
+
|
|
3335
|
+
export { A2AKeyListItem, A2AKeysListResponse, AbortAgentParams, AbstractClient, AddProjectBotMembershipInput, AddProjectMembershipInput, AgentCron, AgentGraphTree, AgentRunStatus, AgentState, AgentWebAppsListResponse, ApiError, ArchiveInput, Assistant, AssistantListResponse, AssistantResponse, AuthenticationError, CapabilityBundleListResponse, ChatResponse, ChatSendOptions, ChatStreamOptions, Client, ClientConfig, CommandInputRespondArgs, CommandInputRespondResult, CommandRunStartArgs, CommandRunStartInput, CommandRunStartResult, CompleteTaskInput, CompleteTaskResponse, CopiedThread, CreateA2AKeyInput, CreateAssistantOptions, CreateCronInput, CreateProjectRequest, CreateStatelessCronInput, CreateThreadCronInput, CreateThreadOptions, CreateWorkspaceRequest, CronCountFilters, CronMultitaskStrategy, CronOnRunCompleted, CronSearchFilters, DatabaseConfigResponse, DatabaseConfigsListResponse, DatasourcesListResponse, ExportBundle, ExportConfigResult, ExportConfirmationRequired, ExportDownload, ExportEntityIds, ExportEntityPreview, ExportEntityPreviewMap, ExportImportClient, ExportableEntity, ExportableTypeInfo, FileItem, GatewayInfo, GetMessagesOptions, GetScheduledTasksOptions, ImportApplyResult, ImportConflict, ImportEntityResult, ImportInsertion, ImportPreviewError, ImportPreviewResult, ImportResolution, ImportResolutions, ImportSource, InvalidCapabilityBundleSummary, KeyExposure, ListAgentWebAppsParams, ListProjectRoomMessagesOptions, ListThreadsOptions, LocalA2ATemplatesListResponse, McpAppShareRuntimeClient, McpAppShareRuntimeClientApi, McpAppShareRuntimeClientOptions, McpServerResponse, McpServersListResponse, McpUiResourceResponse, MetricsConfigResponse, MetricsConfigsListResponse, MutationExpectedUpdatedAt, NetworkError, NormalizedToolResult, OpenAuditLogRecord, PendingMessage, Project, ProjectCapabilitiesResponse, ProjectKind, ProjectRecord, ProjectRoomBotRecord, ProjectRoomClientError, ProjectRoomDispatchErrorCode, ProjectRoomDispatchResult, ProjectRoomInterruptAnswerInput, ProjectRoomMembershipRecord, ProjectRoomMessageRecord, ProjectRoomPublicBotRecord, ProjectRoomPublicMembershipRecord, ProjectRoomRecord, ProjectRoomSendResult, ProjectRoomsClient, PruneThreadInput, PruneThreadResult, RegisterToolOptions, RemovePendingMessageOptions, ResourcesClient, ResumeProjectRoomInterruptInput, ResumeStreamOptions, RetryConfig, RoomEventScopeRecord, RoomEventsClient, RunCancelActiveResult, RunCancelOptions, RunCancelResult, RunCreateInput, RunCreateOptions, RunCreateResult, RunOptions, RunRecord, RuntimeAxiomClient, RuntimeAxiomIdentity, ScheduleExecutionType, ScheduledTask, ScheduledTaskStatus, ScheduledTasksListResponse, SendProjectRoomMessageInput, StorageType, StoreItem, StorePutInput, StoreSearchInput, StreamCallbacks, StreamEvent, SystemMetrics, SystemMetricsChunk, SystemMetricsWorker, TaskCommandInput, TaskCommandResponse, TaskLifecycleWarning, TaskResponse, TasksListResponse, TestConnectionResponse, TestMcpServerResponse, Thread, ThreadEvent, ThreadEventStreamError, ThreadEventStreamOptions, ThreadHistoryPage, ThreadListResponse, ThreadResponse, ThreadStatusInfo, ThreadSuperstepInput, Tool, ToolResponse, ToolsListResponse, Transport, UpdateAgentCronInput, UpdateAssistantOptions, UpdateProjectBotMembershipInput, UpdateProjectMembershipInput, UpdateProjectRequest, UpdateThreadOptions, UpdateWorkspaceRequest, WeChatClient, Workspace, WorkspaceClient, WorkspaceMemberRecord, WorkspaceMembersClient, WorkspaceRoomBusinessEvent, WorkspaceRoomControlEvent, WorkspaceRoomEntryRecord, WorkspaceRoomEventConnection, WorkspaceRoomEventFrame, WorkspaceRoomKnownBusinessEvent, WorkspaceRoomUnknownBusinessEvent, WorkspaceRoomsClient, createSimpleMessageMerger, normalizeToolResult };
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,cAAc,wBAAwB,CAAC;AAEvC,cAAc,4BAA4B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1833,6 +1833,7 @@ __export(src_exports, {
|
|
|
1833
1833
|
AuthenticationError: () => AuthenticationError,
|
|
1834
1834
|
Client: () => Client,
|
|
1835
1835
|
ExportImportClient: () => ExportImportClient,
|
|
1836
|
+
McpAppShareRuntimeClient: () => McpAppShareRuntimeClient,
|
|
1836
1837
|
NetworkError: () => NetworkError,
|
|
1837
1838
|
ProjectRoomClientError: () => ProjectRoomClientError,
|
|
1838
1839
|
ProjectRoomsClient: () => ProjectRoomsClient,
|
|
@@ -6027,6 +6028,50 @@ function createSimpleMessageMerger() {
|
|
|
6027
6028
|
reset
|
|
6028
6029
|
};
|
|
6029
6030
|
}
|
|
6031
|
+
|
|
6032
|
+
// src/mcpAppShareRuntimeClient.ts
|
|
6033
|
+
var McpAppShareRuntimeClient = class {
|
|
6034
|
+
constructor(options) {
|
|
6035
|
+
this.baseURL = options.baseURL.replace(/\/$/, "");
|
|
6036
|
+
this.token = options.token;
|
|
6037
|
+
this.config = { baseURL: this.baseURL };
|
|
6038
|
+
this.mcpApps = {
|
|
6039
|
+
getResource: (ref) => this.request("resource", { ref }),
|
|
6040
|
+
rpc: (ref, method, params) => this.request("rpc", { ref, method, params })
|
|
6041
|
+
};
|
|
6042
|
+
}
|
|
6043
|
+
/** Load the app identity and a fresh first tool result. */
|
|
6044
|
+
async bootstrap() {
|
|
6045
|
+
return this.get("bootstrap");
|
|
6046
|
+
}
|
|
6047
|
+
/** Exchange the share password for the unlock cookie. */
|
|
6048
|
+
async unlock(password) {
|
|
6049
|
+
await this.request("unlock", { password });
|
|
6050
|
+
}
|
|
6051
|
+
async get(path) {
|
|
6052
|
+
const response = await fetch(`${this.baseURL}/api/mcp-app-shares/${this.token}/${path}`, {
|
|
6053
|
+
credentials: "include"
|
|
6054
|
+
});
|
|
6055
|
+
return this.parse(response);
|
|
6056
|
+
}
|
|
6057
|
+
async request(path, body) {
|
|
6058
|
+
const response = await fetch(`${this.baseURL}/api/mcp-app-shares/${this.token}/${path}`, {
|
|
6059
|
+
method: "POST",
|
|
6060
|
+
credentials: "include",
|
|
6061
|
+
headers: { "content-type": "application/json" },
|
|
6062
|
+
body: JSON.stringify(body)
|
|
6063
|
+
});
|
|
6064
|
+
return this.parse(response);
|
|
6065
|
+
}
|
|
6066
|
+
async parse(response) {
|
|
6067
|
+
const body = await response.json().catch(() => ({}));
|
|
6068
|
+
if (!response.ok) {
|
|
6069
|
+
const code = typeof body === "object" && body !== null && "error" in body ? String(body.error) : `HTTP_${response.status}`;
|
|
6070
|
+
throw new Error(code);
|
|
6071
|
+
}
|
|
6072
|
+
return body;
|
|
6073
|
+
}
|
|
6074
|
+
};
|
|
6030
6075
|
// Annotate the CommonJS export names for ESM import in node:
|
|
6031
6076
|
0 && (module.exports = {
|
|
6032
6077
|
AbstractClient,
|
|
@@ -6034,6 +6079,7 @@ function createSimpleMessageMerger() {
|
|
|
6034
6079
|
AuthenticationError,
|
|
6035
6080
|
Client,
|
|
6036
6081
|
ExportImportClient,
|
|
6082
|
+
McpAppShareRuntimeClient,
|
|
6037
6083
|
NetworkError,
|
|
6038
6084
|
ProjectRoomClientError,
|
|
6039
6085
|
ProjectRoomsClient,
|