@axiom-lattice/client-sdk 7.0.2 → 7.2.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/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/__tests__/runs-task-queue.test.js +24 -0
- package/dist/__tests__/runs-task-queue.test.js.map +1 -1
- package/dist/abstract-client.d.ts +15 -1
- package/dist/abstract-client.d.ts.map +1 -1
- package/dist/abstract-client.js +19 -0
- package/dist/abstract-client.js.map +1 -1
- package/dist/index.d.ts +80 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +70 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +69 -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/dist/types.d.ts +16 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -3109,6 +3109,18 @@ var AbstractClient = class {
|
|
|
3109
3109
|
);
|
|
3110
3110
|
return response.data.runs;
|
|
3111
3111
|
},
|
|
3112
|
+
/**
|
|
3113
|
+
* Lists only `run_api` runs that are pending or running.
|
|
3114
|
+
* @param threadId - Thread id.
|
|
3115
|
+
* @param assistantId - Assistant id override (defaults to the client's).
|
|
3116
|
+
* @returns Active run records in ledger order.
|
|
3117
|
+
*/
|
|
3118
|
+
listActive: async (threadId, assistantId) => {
|
|
3119
|
+
const response = await this.makeRequest(
|
|
3120
|
+
`/api/assistants/${assistantId ?? this.assistantId}/threads/${threadId}/runs?active=true&source=run_api`
|
|
3121
|
+
);
|
|
3122
|
+
return response.data.runs;
|
|
3123
|
+
},
|
|
3112
3124
|
/**
|
|
3113
3125
|
* Reads one run ledger record.
|
|
3114
3126
|
* @param threadId - Thread id.
|
|
@@ -3156,6 +3168,18 @@ var AbstractClient = class {
|
|
|
3156
3168
|
{ method: "POST" }
|
|
3157
3169
|
);
|
|
3158
3170
|
return response;
|
|
3171
|
+
},
|
|
3172
|
+
/**
|
|
3173
|
+
* Cancels every active `run_api` run on a thread.
|
|
3174
|
+
* @param threadId - Thread id.
|
|
3175
|
+
* @param assistantId - Assistant id override (defaults to the client's).
|
|
3176
|
+
* @returns Per-run cancellation outcomes.
|
|
3177
|
+
*/
|
|
3178
|
+
cancelActive: async (threadId, assistantId) => {
|
|
3179
|
+
return this.makeRequest(
|
|
3180
|
+
`/api/assistants/${assistantId ?? this.assistantId}/threads/${threadId}/runs/cancel-active`,
|
|
3181
|
+
{ method: "POST" }
|
|
3182
|
+
);
|
|
3159
3183
|
}
|
|
3160
3184
|
};
|
|
3161
3185
|
/**
|
|
@@ -5972,12 +5996,57 @@ function createSimpleMessageMerger() {
|
|
|
5972
5996
|
reset
|
|
5973
5997
|
};
|
|
5974
5998
|
}
|
|
5999
|
+
|
|
6000
|
+
// src/mcpAppShareRuntimeClient.ts
|
|
6001
|
+
var McpAppShareRuntimeClient = class {
|
|
6002
|
+
constructor(options) {
|
|
6003
|
+
this.baseURL = options.baseURL.replace(/\/$/, "");
|
|
6004
|
+
this.token = options.token;
|
|
6005
|
+
this.config = { baseURL: this.baseURL };
|
|
6006
|
+
this.mcpApps = {
|
|
6007
|
+
getResource: (ref) => this.request("resource", { ref }),
|
|
6008
|
+
rpc: (ref, method, params) => this.request("rpc", { ref, method, params })
|
|
6009
|
+
};
|
|
6010
|
+
}
|
|
6011
|
+
/** Load the app identity and a fresh first tool result. */
|
|
6012
|
+
async bootstrap() {
|
|
6013
|
+
return this.get("bootstrap");
|
|
6014
|
+
}
|
|
6015
|
+
/** Exchange the share password for the unlock cookie. */
|
|
6016
|
+
async unlock(password) {
|
|
6017
|
+
await this.request("unlock", { password });
|
|
6018
|
+
}
|
|
6019
|
+
async get(path) {
|
|
6020
|
+
const response = await fetch(`${this.baseURL}/api/mcp-app-shares/${this.token}/${path}`, {
|
|
6021
|
+
credentials: "include"
|
|
6022
|
+
});
|
|
6023
|
+
return this.parse(response);
|
|
6024
|
+
}
|
|
6025
|
+
async request(path, body) {
|
|
6026
|
+
const response = await fetch(`${this.baseURL}/api/mcp-app-shares/${this.token}/${path}`, {
|
|
6027
|
+
method: "POST",
|
|
6028
|
+
credentials: "include",
|
|
6029
|
+
headers: { "content-type": "application/json" },
|
|
6030
|
+
body: JSON.stringify(body)
|
|
6031
|
+
});
|
|
6032
|
+
return this.parse(response);
|
|
6033
|
+
}
|
|
6034
|
+
async parse(response) {
|
|
6035
|
+
const body = await response.json().catch(() => ({}));
|
|
6036
|
+
if (!response.ok) {
|
|
6037
|
+
const code = typeof body === "object" && body !== null && "error" in body ? String(body.error) : `HTTP_${response.status}`;
|
|
6038
|
+
throw new Error(code);
|
|
6039
|
+
}
|
|
6040
|
+
return body;
|
|
6041
|
+
}
|
|
6042
|
+
};
|
|
5975
6043
|
export {
|
|
5976
6044
|
AbstractClient,
|
|
5977
6045
|
ApiError,
|
|
5978
6046
|
AuthenticationError,
|
|
5979
6047
|
Client,
|
|
5980
6048
|
ExportImportClient,
|
|
6049
|
+
McpAppShareRuntimeClient,
|
|
5981
6050
|
NetworkError,
|
|
5982
6051
|
ProjectRoomClientError,
|
|
5983
6052
|
ProjectRoomsClient,
|