anbaric-impl-cloud 1.35.0 → 1.36.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/CloudPromptManager.d.ts +13 -0
- package/dist/CloudPromptManager.d.ts.map +1 -0
- package/dist/CloudPromptManager.js +31 -0
- package/dist/CloudPromptManager.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AppAware, JsonSchema, Prompt, PromptManager } from "anbaric-tsapi";
|
|
2
|
+
declare class CloudPromptManager implements PromptManager, AppAware {
|
|
3
|
+
private client;
|
|
4
|
+
constructor(baseUrl?: string);
|
|
5
|
+
getAppId(): string;
|
|
6
|
+
save(promptId: string, instructions: string, inputSchema?: JsonSchema, outputSchema?: JsonSchema): Promise<Prompt>;
|
|
7
|
+
retrieve(promptId: string, version?: number): Promise<Prompt>;
|
|
8
|
+
list(): Promise<Array<Prompt>>;
|
|
9
|
+
history(promptId: string): Promise<Array<Prompt>>;
|
|
10
|
+
private promptPath;
|
|
11
|
+
}
|
|
12
|
+
export { CloudPromptManager };
|
|
13
|
+
//# sourceMappingURL=CloudPromptManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CloudPromptManager.d.ts","sourceRoot":"","sources":["../src/CloudPromptManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAgB,UAAU,EAAE,MAAM,EAAE,aAAa,EAAC,MAAM,eAAe,CAAC;AAKxF,cAAM,kBAAmB,YAAW,aAAa,EAAE,QAAQ;IAEvD,OAAO,CAAC,MAAM,CAAkB;IAEhC,YAAY,OAAO,GAAG,MAAwC,EAE7D;IAED,QAAQ,IAAK,MAAM,CAElB;IAEK,IAAI,CAAC,QAAQ,EAAG,MAAM,EAAE,YAAY,EAAG,MAAM,EAAE,WAAW,CAAC,EAAG,UAAU,EAAE,YAAY,CAAC,EAAG,UAAU,GAAI,OAAO,CAAC,MAAM,CAAC,CAE5H;IAEK,QAAQ,CAAC,QAAQ,EAAG,MAAM,EAAE,OAAO,CAAC,EAAG,MAAM,GAAI,OAAO,CAAC,MAAM,CAAC,CAGrE;IAEK,IAAI,IAAK,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAEpC;IAEK,OAAO,CAAC,QAAQ,EAAG,MAAM,GAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAExD;IAED,OAAO,CAAC,UAAU;CAIrB;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { currentAppId } from "anbaric-tsapi";
|
|
2
|
+
import { CloudApiClient } from "./CloudApiClient.js";
|
|
3
|
+
/* Prompts are owned by the calling app - the ambient app header the client
|
|
4
|
+
always sends - so no app id appears in any path. */
|
|
5
|
+
class CloudPromptManager {
|
|
6
|
+
client;
|
|
7
|
+
constructor(baseUrl = CloudApiClient.defaultBaseUrl()) {
|
|
8
|
+
this.client = new CloudApiClient(baseUrl);
|
|
9
|
+
}
|
|
10
|
+
getAppId() {
|
|
11
|
+
return currentAppId();
|
|
12
|
+
}
|
|
13
|
+
async save(promptId, instructions, inputSchema, outputSchema) {
|
|
14
|
+
return this.client.request("PUT", this.promptPath(promptId), { instructions, inputSchema, outputSchema });
|
|
15
|
+
}
|
|
16
|
+
async retrieve(promptId, version) {
|
|
17
|
+
const query = version === undefined ? "" : `?version=${encodeURIComponent(version)}`;
|
|
18
|
+
return this.client.request("GET", `${this.promptPath(promptId)}${query}`);
|
|
19
|
+
}
|
|
20
|
+
async list() {
|
|
21
|
+
return this.client.request("GET", "/prompts");
|
|
22
|
+
}
|
|
23
|
+
async history(promptId) {
|
|
24
|
+
return this.client.request("GET", `${this.promptPath(promptId)}/history`);
|
|
25
|
+
}
|
|
26
|
+
promptPath(promptId) {
|
|
27
|
+
return `/prompts/${encodeURIComponent(promptId)}`;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export { CloudPromptManager };
|
|
31
|
+
//# sourceMappingURL=CloudPromptManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CloudPromptManager.js","sourceRoot":"","sources":["../src/CloudPromptManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,YAAY,EAAoC,MAAM,eAAe,CAAC;AACxF,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAEnD;sDACsD;AACtD,MAAM,kBAAkB;IAEZ,MAAM,CAAkB;IAEhC,YAAY,OAAO,GAAY,cAAc,CAAC,cAAc,EAAE;QAC1D,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,QAAQ;QACJ,OAAO,YAAY,EAAE,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,QAAiB,EAAE,YAAqB,EAAE,WAAyB,EAAE,YAA0B;QACtG,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC,CAAC;IAC9G,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,QAAiB,EAAE,OAAiB;QAC/C,MAAM,KAAK,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC;QACrF,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED,KAAK,CAAC,IAAI;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAClD,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,QAAiB;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC9E,CAAC;IAEO,UAAU,CAAC,QAAiB;QAChC,OAAO,YAAY,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC;IACtD,CAAC;CAEJ;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from "./CloudJobPersistence.js";
|
|
|
3
3
|
export * from "./CloudJsonStore.js";
|
|
4
4
|
export * from "./CloudSecretStore.js";
|
|
5
5
|
export * from "./CloudEntitlements.js";
|
|
6
|
+
export * from "./CloudPromptManager.js";
|
|
6
7
|
export * from "./CloudQueue.js";
|
|
7
8
|
export * from "./CloudJobRunSchedulePersistence.js";
|
|
8
9
|
export * from "./CloudNotifier.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qCAAqC,CAAC;AACpD,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qCAAqC,CAAC;AACpD,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export * from "./CloudJobPersistence.js";
|
|
|
3
3
|
export * from "./CloudJsonStore.js";
|
|
4
4
|
export * from "./CloudSecretStore.js";
|
|
5
5
|
export * from "./CloudEntitlements.js";
|
|
6
|
+
export * from "./CloudPromptManager.js";
|
|
6
7
|
export * from "./CloudQueue.js";
|
|
7
8
|
export * from "./CloudJobRunSchedulePersistence.js";
|
|
8
9
|
export * from "./CloudNotifier.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qCAAqC,CAAC;AACpD,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qCAAqC,CAAC;AACpD,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anbaric-impl-cloud",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.36.0",
|
|
4
4
|
"description": "Public client library for the Anbaric Cloud hosting API, providing JobPersistence and Queue implementations backed by the cloud service",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "chris@anbaric.ai",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"prepublishOnly": "npm run build"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"anbaric-tsapi": "^1.
|
|
23
|
+
"anbaric-tsapi": "^1.36.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^26.2.0",
|