@stigmer/sdk 0.5.0 → 1.0.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/gen/agentexecution.d.ts +2 -1
- package/gen/agentexecution.d.ts.map +1 -1
- package/gen/agentexecution.js +8 -0
- package/gen/agentexecution.js.map +1 -1
- package/gen/artifact.d.ts +36 -0
- package/gen/artifact.d.ts.map +1 -0
- package/gen/artifact.js +94 -0
- package/gen/artifact.js.map +1 -0
- package/gen/authorization-config.d.ts.map +1 -1
- package/gen/authorization-config.js +1 -0
- package/gen/authorization-config.js.map +1 -1
- package/gen/client.d.ts +5 -1
- package/gen/client.d.ts.map +1 -1
- package/gen/client.js +4 -0
- package/gen/client.js.map +1 -1
- package/gen/workflow.d.ts +17 -2
- package/gen/workflow.d.ts.map +1 -1
- package/gen/workflow.js +55 -1
- package/gen/workflow.js.map +1 -1
- package/gen/workflowexecution.d.ts +7 -1
- package/gen/workflowexecution.d.ts.map +1 -1
- package/gen/workflowexecution.js +42 -0
- package/gen/workflowexecution.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +2 -0
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/platform.d.ts +33 -0
- package/platform.d.ts.map +1 -0
- package/platform.js +39 -0
- package/platform.js.map +1 -0
- package/src/gen/agentexecution.ts +7 -1
- package/src/gen/artifact.ts +113 -0
- package/src/gen/authorization-config.ts +1 -0
- package/src/gen/client.ts +6 -1
- package/src/gen/workflow.ts +63 -3
- package/src/gen/workflowexecution.ts +34 -1
- package/src/index.ts +6 -0
- package/src/platform.ts +58 -0
- package/src/stigmer.ts +3 -0
- package/stigmer.d.ts +2 -0
- package/stigmer.d.ts.map +1 -1
- package/stigmer.js +3 -0
- package/stigmer.js.map +1 -1
package/src/platform.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
2
|
+
import { create } from "@bufbuild/protobuf";
|
|
3
|
+
import {
|
|
4
|
+
GetServerInfoInputSchema,
|
|
5
|
+
PlatformQueryController,
|
|
6
|
+
ServerEdition,
|
|
7
|
+
} from "@stigmer/protos/ai/stigmer/platform/v1/server_info_pb";
|
|
8
|
+
import type { GetServerInfoOutput } from "@stigmer/protos/ai/stigmer/platform/v1/server_info_pb";
|
|
9
|
+
import { wrapError } from "./gen/errors";
|
|
10
|
+
import type { DeploymentMode } from "./resource-availability";
|
|
11
|
+
|
|
12
|
+
/** Server identity information returned by {@link PlatformClient.getServerInfo}. */
|
|
13
|
+
export interface ServerInfo {
|
|
14
|
+
/** Server edition mapped to a {@link DeploymentMode}. */
|
|
15
|
+
readonly deploymentMode: DeploymentMode;
|
|
16
|
+
/** Raw server edition enum value. */
|
|
17
|
+
readonly edition: ServerEdition;
|
|
18
|
+
/** Semantic version of the server binary. */
|
|
19
|
+
readonly version: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Client for platform-level queries (server info, capabilities).
|
|
24
|
+
*
|
|
25
|
+
* The {@link getServerInfo} method is the authoritative source for
|
|
26
|
+
* deployment mode detection. It replaces URL-based hostname guessing
|
|
27
|
+
* with a server-reported value.
|
|
28
|
+
*/
|
|
29
|
+
export class PlatformClient {
|
|
30
|
+
private readonly platform: Client<typeof PlatformQueryController>;
|
|
31
|
+
|
|
32
|
+
constructor(transport: Transport) {
|
|
33
|
+
this.platform = createClient(PlatformQueryController, transport);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Retrieve the connected server's edition and version.
|
|
38
|
+
*
|
|
39
|
+
* Maps the proto {@link ServerEdition} to a {@link DeploymentMode}:
|
|
40
|
+
* - `oss` -> `"local"`
|
|
41
|
+
* - `cloud` -> `"cloud"`
|
|
42
|
+
* - unspecified/unknown -> `"cloud"` (safe default)
|
|
43
|
+
*/
|
|
44
|
+
async getServerInfo(): Promise<ServerInfo> {
|
|
45
|
+
try {
|
|
46
|
+
const resp: GetServerInfoOutput = await this.platform.getServerInfo(
|
|
47
|
+
create(GetServerInfoInputSchema, {}),
|
|
48
|
+
);
|
|
49
|
+
return {
|
|
50
|
+
deploymentMode: resp.edition === ServerEdition.oss ? "local" : "cloud",
|
|
51
|
+
edition: resp.edition,
|
|
52
|
+
version: resp.version,
|
|
53
|
+
};
|
|
54
|
+
} catch (e) {
|
|
55
|
+
throw wrapError(e);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
package/src/stigmer.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BillingClient } from "./billing";
|
|
2
2
|
import { GeneratedClient } from "./gen/client";
|
|
3
3
|
import { GitHubClient } from "./github";
|
|
4
|
+
import { PlatformClient } from "./platform";
|
|
4
5
|
import { SearchClient } from "./search";
|
|
5
6
|
import { createStigmerTransport } from "./transport";
|
|
6
7
|
import {
|
|
@@ -55,6 +56,7 @@ export class Stigmer extends GeneratedClient {
|
|
|
55
56
|
readonly fetch: typeof globalThis.fetch | undefined;
|
|
56
57
|
|
|
57
58
|
readonly billing: BillingClient;
|
|
59
|
+
readonly platform: PlatformClient;
|
|
58
60
|
readonly search: SearchClient;
|
|
59
61
|
readonly github: GitHubClient;
|
|
60
62
|
|
|
@@ -73,6 +75,7 @@ export class Stigmer extends GeneratedClient {
|
|
|
73
75
|
: config.getAccessToken ?? (() => null);
|
|
74
76
|
|
|
75
77
|
this.billing = new BillingClient(transport);
|
|
78
|
+
this.platform = new PlatformClient(transport);
|
|
76
79
|
this.search = new SearchClient(transport);
|
|
77
80
|
this.github = new GitHubClient(transport);
|
|
78
81
|
}
|
package/stigmer.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BillingClient } from "./billing";
|
|
2
2
|
import { GeneratedClient } from "./gen/client";
|
|
3
3
|
import { GitHubClient } from "./github";
|
|
4
|
+
import { PlatformClient } from "./platform";
|
|
4
5
|
import { SearchClient } from "./search";
|
|
5
6
|
import { type StigmerConfig } from "./config";
|
|
6
7
|
/**
|
|
@@ -47,6 +48,7 @@ export declare class Stigmer extends GeneratedClient {
|
|
|
47
48
|
*/
|
|
48
49
|
readonly fetch: typeof globalThis.fetch | undefined;
|
|
49
50
|
readonly billing: BillingClient;
|
|
51
|
+
readonly platform: PlatformClient;
|
|
50
52
|
readonly search: SearchClient;
|
|
51
53
|
readonly github: GitHubClient;
|
|
52
54
|
private readonly _tokenProvider;
|
package/stigmer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stigmer.d.ts","sourceRoot":"","sources":["../src/stigmer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAEL,KAAK,aAAa,EAEnB,MAAM,UAAU,CAAC;AAElB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,OAAQ,SAAQ,eAAe;IAC1C;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;;;;;;;OAQG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,UAAU,CAAC,KAAK,GAAG,SAAS,CAAC;IAEpD,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAE9B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAgB;gBAEnC,MAAM,EAAE,aAAa;
|
|
1
|
+
{"version":3,"file":"stigmer.d.ts","sourceRoot":"","sources":["../src/stigmer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAEL,KAAK,aAAa,EAEnB,MAAM,UAAU,CAAC;AAElB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,OAAQ,SAAQ,eAAe;IAC1C;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;;;;;;;OAQG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,UAAU,CAAC,KAAK,GAAG,SAAS,CAAC;IAEpD,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAE9B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAgB;gBAEnC,MAAM,EAAE,aAAa;IAkBjC;;;;;;;;;OASG;IACG,iBAAiB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAGlD"}
|
package/stigmer.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BillingClient } from "./billing";
|
|
2
2
|
import { GeneratedClient } from "./gen/client";
|
|
3
3
|
import { GitHubClient } from "./github";
|
|
4
|
+
import { PlatformClient } from "./platform";
|
|
4
5
|
import { SearchClient } from "./search";
|
|
5
6
|
import { createStigmerTransport } from "./transport";
|
|
6
7
|
import { validateConfig, } from "./config";
|
|
@@ -48,6 +49,7 @@ export class Stigmer extends GeneratedClient {
|
|
|
48
49
|
*/
|
|
49
50
|
fetch;
|
|
50
51
|
billing;
|
|
52
|
+
platform;
|
|
51
53
|
search;
|
|
52
54
|
github;
|
|
53
55
|
_tokenProvider;
|
|
@@ -61,6 +63,7 @@ export class Stigmer extends GeneratedClient {
|
|
|
61
63
|
? () => config.apiKey
|
|
62
64
|
: config.getAccessToken ?? (() => null);
|
|
63
65
|
this.billing = new BillingClient(transport);
|
|
66
|
+
this.platform = new PlatformClient(transport);
|
|
64
67
|
this.search = new SearchClient(transport);
|
|
65
68
|
this.github = new GitHubClient(transport);
|
|
66
69
|
}
|
package/stigmer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stigmer.js","sourceRoot":"","sources":["../src/stigmer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EACL,cAAc,GAGf,MAAM,UAAU,CAAC;AAElB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,OAAO,OAAQ,SAAQ,eAAe;IAC1C;;;;;;OAMG;IACM,OAAO,CAAS;IAEzB;;;;;;;;OAQG;IACM,KAAK,CAAsC;IAE3C,OAAO,CAAgB;IACvB,MAAM,CAAe;IACrB,MAAM,CAAe;IAEb,cAAc,CAAgB;IAE/C,YAAY,MAAqB;QAC/B,cAAc,CAAC,MAAM,CAAC,CAAC;QAEvB,MAAM,SAAS,GAAG,MAAM,CAAC,eAAe,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC;QAC3E,KAAK,CAAC,SAAS,CAAC,CAAC;QAEjB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,MA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