@siglume/api-sdk 0.7.5 → 0.8.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/README.md +34 -3
- package/dist/bin/siglume.cjs +442 -44
- package/dist/bin/siglume.cjs.map +1 -1
- package/dist/bin/siglume.js +442 -44
- package/dist/bin/siglume.js.map +1 -1
- package/dist/cli/index.cjs +442 -44
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +11 -0
- package/dist/cli/index.d.ts +11 -0
- package/dist/cli/index.js +442 -44
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +40 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.js +40 -26
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -206,6 +206,8 @@ interface AppManifest {
|
|
|
206
206
|
short_description?: string;
|
|
207
207
|
docs_url?: string;
|
|
208
208
|
support_contact?: string;
|
|
209
|
+
seller_homepage_url?: string;
|
|
210
|
+
seller_social_url?: string;
|
|
209
211
|
compatibility_tags?: string[];
|
|
210
212
|
example_prompts?: string[];
|
|
211
213
|
latency_tier?: string;
|
|
@@ -366,6 +368,9 @@ interface AppListingRecord {
|
|
|
366
368
|
short_description?: string | null;
|
|
367
369
|
docs_url?: string | null;
|
|
368
370
|
support_contact?: string | null;
|
|
371
|
+
seller_display_name?: string | null;
|
|
372
|
+
seller_homepage_url?: string | null;
|
|
373
|
+
seller_social_url?: string | null;
|
|
369
374
|
review_status?: string | null;
|
|
370
375
|
review_note?: string | null;
|
|
371
376
|
submission_blockers: string[];
|
|
@@ -431,9 +436,12 @@ interface BundleListingRecord {
|
|
|
431
436
|
interface AutoRegistrationReceipt {
|
|
432
437
|
listing_id: string;
|
|
433
438
|
status: string;
|
|
439
|
+
registration_mode?: string | null;
|
|
440
|
+
listing_status?: string | null;
|
|
434
441
|
auto_manifest: Record<string, unknown>;
|
|
435
442
|
confidence: Record<string, unknown>;
|
|
436
443
|
validation_report?: Record<string, unknown>;
|
|
444
|
+
oauth_status?: Record<string, unknown>;
|
|
437
445
|
review_url?: string | null;
|
|
438
446
|
trace_id?: string | null;
|
|
439
447
|
request_id?: string | null;
|
|
@@ -448,6 +456,8 @@ interface RegistrationQuality {
|
|
|
448
456
|
interface RegistrationConfirmation {
|
|
449
457
|
listing_id: string;
|
|
450
458
|
status: string;
|
|
459
|
+
message?: string | null;
|
|
460
|
+
checklist?: Record<string, boolean>;
|
|
451
461
|
release: Record<string, unknown>;
|
|
452
462
|
quality: RegistrationQuality;
|
|
453
463
|
trace_id?: string | null;
|
|
@@ -1611,7 +1621,7 @@ declare function buildOperationMetadata(payload: Record<string, unknown>, option
|
|
|
1611
1621
|
declare const DEFAULT_SIGLUME_API_BASE = "https://siglume.com/v1";
|
|
1612
1622
|
type FetchLike$1 = typeof fetch;
|
|
1613
1623
|
interface SiglumeClientOptions {
|
|
1614
|
-
api_key
|
|
1624
|
+
api_key?: string;
|
|
1615
1625
|
agent_key?: string;
|
|
1616
1626
|
base_url?: string;
|
|
1617
1627
|
timeout_ms?: number;
|
|
@@ -1623,6 +1633,7 @@ interface SiglumeClientShape {
|
|
|
1623
1633
|
source_code?: string;
|
|
1624
1634
|
source_url?: string;
|
|
1625
1635
|
runtime_validation?: Record<string, unknown>;
|
|
1636
|
+
oauth_credentials?: Record<string, unknown> | unknown[];
|
|
1626
1637
|
metadata?: Record<string, unknown>;
|
|
1627
1638
|
source_context?: Record<string, unknown>;
|
|
1628
1639
|
input_form_spec?: Record<string, unknown>;
|
|
@@ -2177,12 +2188,13 @@ declare class SiglumeClient implements SiglumeClientShape {
|
|
|
2177
2188
|
readonly max_retries: number;
|
|
2178
2189
|
private readonly fetchImpl;
|
|
2179
2190
|
private readonly pendingConfirmations;
|
|
2180
|
-
constructor(options
|
|
2191
|
+
constructor(options?: SiglumeClientOptions);
|
|
2181
2192
|
close(): void;
|
|
2182
2193
|
auto_register(manifest: AppManifest | Record<string, unknown>, tool_manual: ToolManual | Record<string, unknown>, options?: {
|
|
2183
2194
|
source_code?: string;
|
|
2184
2195
|
source_url?: string;
|
|
2185
2196
|
runtime_validation?: Record<string, unknown>;
|
|
2197
|
+
oauth_credentials?: Record<string, unknown> | unknown[];
|
|
2186
2198
|
metadata?: Record<string, unknown>;
|
|
2187
2199
|
source_context?: Record<string, unknown>;
|
|
2188
2200
|
input_form_spec?: Record<string, unknown>;
|
package/dist/index.d.ts
CHANGED
|
@@ -206,6 +206,8 @@ interface AppManifest {
|
|
|
206
206
|
short_description?: string;
|
|
207
207
|
docs_url?: string;
|
|
208
208
|
support_contact?: string;
|
|
209
|
+
seller_homepage_url?: string;
|
|
210
|
+
seller_social_url?: string;
|
|
209
211
|
compatibility_tags?: string[];
|
|
210
212
|
example_prompts?: string[];
|
|
211
213
|
latency_tier?: string;
|
|
@@ -366,6 +368,9 @@ interface AppListingRecord {
|
|
|
366
368
|
short_description?: string | null;
|
|
367
369
|
docs_url?: string | null;
|
|
368
370
|
support_contact?: string | null;
|
|
371
|
+
seller_display_name?: string | null;
|
|
372
|
+
seller_homepage_url?: string | null;
|
|
373
|
+
seller_social_url?: string | null;
|
|
369
374
|
review_status?: string | null;
|
|
370
375
|
review_note?: string | null;
|
|
371
376
|
submission_blockers: string[];
|
|
@@ -431,9 +436,12 @@ interface BundleListingRecord {
|
|
|
431
436
|
interface AutoRegistrationReceipt {
|
|
432
437
|
listing_id: string;
|
|
433
438
|
status: string;
|
|
439
|
+
registration_mode?: string | null;
|
|
440
|
+
listing_status?: string | null;
|
|
434
441
|
auto_manifest: Record<string, unknown>;
|
|
435
442
|
confidence: Record<string, unknown>;
|
|
436
443
|
validation_report?: Record<string, unknown>;
|
|
444
|
+
oauth_status?: Record<string, unknown>;
|
|
437
445
|
review_url?: string | null;
|
|
438
446
|
trace_id?: string | null;
|
|
439
447
|
request_id?: string | null;
|
|
@@ -448,6 +456,8 @@ interface RegistrationQuality {
|
|
|
448
456
|
interface RegistrationConfirmation {
|
|
449
457
|
listing_id: string;
|
|
450
458
|
status: string;
|
|
459
|
+
message?: string | null;
|
|
460
|
+
checklist?: Record<string, boolean>;
|
|
451
461
|
release: Record<string, unknown>;
|
|
452
462
|
quality: RegistrationQuality;
|
|
453
463
|
trace_id?: string | null;
|
|
@@ -1611,7 +1621,7 @@ declare function buildOperationMetadata(payload: Record<string, unknown>, option
|
|
|
1611
1621
|
declare const DEFAULT_SIGLUME_API_BASE = "https://siglume.com/v1";
|
|
1612
1622
|
type FetchLike$1 = typeof fetch;
|
|
1613
1623
|
interface SiglumeClientOptions {
|
|
1614
|
-
api_key
|
|
1624
|
+
api_key?: string;
|
|
1615
1625
|
agent_key?: string;
|
|
1616
1626
|
base_url?: string;
|
|
1617
1627
|
timeout_ms?: number;
|
|
@@ -1623,6 +1633,7 @@ interface SiglumeClientShape {
|
|
|
1623
1633
|
source_code?: string;
|
|
1624
1634
|
source_url?: string;
|
|
1625
1635
|
runtime_validation?: Record<string, unknown>;
|
|
1636
|
+
oauth_credentials?: Record<string, unknown> | unknown[];
|
|
1626
1637
|
metadata?: Record<string, unknown>;
|
|
1627
1638
|
source_context?: Record<string, unknown>;
|
|
1628
1639
|
input_form_spec?: Record<string, unknown>;
|
|
@@ -2177,12 +2188,13 @@ declare class SiglumeClient implements SiglumeClientShape {
|
|
|
2177
2188
|
readonly max_retries: number;
|
|
2178
2189
|
private readonly fetchImpl;
|
|
2179
2190
|
private readonly pendingConfirmations;
|
|
2180
|
-
constructor(options
|
|
2191
|
+
constructor(options?: SiglumeClientOptions);
|
|
2181
2192
|
close(): void;
|
|
2182
2193
|
auto_register(manifest: AppManifest | Record<string, unknown>, tool_manual: ToolManual | Record<string, unknown>, options?: {
|
|
2183
2194
|
source_code?: string;
|
|
2184
2195
|
source_url?: string;
|
|
2185
2196
|
runtime_validation?: Record<string, unknown>;
|
|
2197
|
+
oauth_credentials?: Record<string, unknown> | unknown[];
|
|
2186
2198
|
metadata?: Record<string, unknown>;
|
|
2187
2199
|
source_context?: Record<string, unknown>;
|
|
2188
2200
|
input_form_spec?: Record<string, unknown>;
|
package/dist/index.js
CHANGED
|
@@ -1641,6 +1641,9 @@ function parseListing(data) {
|
|
|
1641
1641
|
short_description: stringOrNull2(data.short_description),
|
|
1642
1642
|
docs_url: stringOrNull2(data.docs_url),
|
|
1643
1643
|
support_contact: stringOrNull2(data.support_contact),
|
|
1644
|
+
seller_display_name: stringOrNull2(data.seller_display_name),
|
|
1645
|
+
seller_homepage_url: stringOrNull2(data.seller_homepage_url),
|
|
1646
|
+
seller_social_url: stringOrNull2(data.seller_social_url),
|
|
1644
1647
|
review_status: stringOrNull2(data.review_status),
|
|
1645
1648
|
review_note: stringOrNull2(data.review_note),
|
|
1646
1649
|
submission_blockers: Array.isArray(data.submission_blockers) ? data.submission_blockers.filter((item) => typeof item === "string") : [],
|
|
@@ -2822,11 +2825,15 @@ var init_client = __esm({
|
|
|
2822
2825
|
max_retries;
|
|
2823
2826
|
fetchImpl;
|
|
2824
2827
|
pendingConfirmations = /* @__PURE__ */ new Map();
|
|
2825
|
-
constructor(options) {
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
+
constructor(options = {}) {
|
|
2829
|
+
const envApiKey = typeof process !== "undefined" ? process.env?.SIGLUME_API_KEY : void 0;
|
|
2830
|
+
const resolvedApiKey = (options.api_key ?? envApiKey ?? "").trim();
|
|
2831
|
+
if (!resolvedApiKey) {
|
|
2832
|
+
throw new SiglumeClientError(
|
|
2833
|
+
"SIGLUME_API_KEY is required. Pass it as the api_key option or set the SIGLUME_API_KEY env var."
|
|
2834
|
+
);
|
|
2828
2835
|
}
|
|
2829
|
-
this.api_key =
|
|
2836
|
+
this.api_key = resolvedApiKey;
|
|
2830
2837
|
this.agent_key = options.agent_key?.trim() || void 0;
|
|
2831
2838
|
this.base_url = (options.base_url ?? DEFAULT_SIGLUME_API_BASE).replace(/\/+$/, "");
|
|
2832
2839
|
this.timeout_ms = Math.max(1, options.timeout_ms ?? 15e3);
|
|
@@ -2853,6 +2860,13 @@ var init_client = __esm({
|
|
|
2853
2860
|
if (options.runtime_validation) {
|
|
2854
2861
|
payload.runtime_validation = coerceMapping(options.runtime_validation, "runtime_validation");
|
|
2855
2862
|
}
|
|
2863
|
+
if (options.oauth_credentials) {
|
|
2864
|
+
payload.oauth_credentials = Array.isArray(options.oauth_credentials) ? {
|
|
2865
|
+
items: options.oauth_credentials.map(
|
|
2866
|
+
(item, index) => coerceMapping(item, `oauth_credentials[${index}]`)
|
|
2867
|
+
)
|
|
2868
|
+
} : coerceMapping(options.oauth_credentials, "oauth_credentials");
|
|
2869
|
+
}
|
|
2856
2870
|
if (options.metadata) {
|
|
2857
2871
|
payload.metadata = coerceMapping(options.metadata, "metadata");
|
|
2858
2872
|
}
|
|
@@ -2871,6 +2885,8 @@ var init_client = __esm({
|
|
|
2871
2885
|
"docs_url",
|
|
2872
2886
|
"documentation_url",
|
|
2873
2887
|
"support_contact",
|
|
2888
|
+
"seller_homepage_url",
|
|
2889
|
+
"seller_social_url",
|
|
2874
2890
|
"jurisdiction",
|
|
2875
2891
|
"price_model",
|
|
2876
2892
|
"price_value_minor",
|
|
@@ -2886,10 +2902,14 @@ var init_client = __esm({
|
|
|
2886
2902
|
}
|
|
2887
2903
|
const docsUrl = String(manifestPayload.docs_url ?? manifestPayload.documentation_url ?? "").trim();
|
|
2888
2904
|
const supportContact = String(manifestPayload.support_contact ?? "").trim();
|
|
2889
|
-
|
|
2905
|
+
const sellerHomepageUrl = String(manifestPayload.seller_homepage_url ?? "").trim();
|
|
2906
|
+
const sellerSocialUrl = String(manifestPayload.seller_social_url ?? "").trim();
|
|
2907
|
+
if (docsUrl || supportContact || sellerHomepageUrl || sellerSocialUrl) {
|
|
2890
2908
|
const publisherIdentity = {
|
|
2891
2909
|
documentation_url: docsUrl || null,
|
|
2892
|
-
support_contact: supportContact || null
|
|
2910
|
+
support_contact: supportContact || null,
|
|
2911
|
+
seller_homepage_url: sellerHomepageUrl || null,
|
|
2912
|
+
seller_social_url: sellerSocialUrl || null
|
|
2893
2913
|
};
|
|
2894
2914
|
payload.publisher_identity = publisherIdentity;
|
|
2895
2915
|
payload.legal = { publisher_identity: publisherIdentity };
|
|
@@ -2903,36 +2923,30 @@ var init_client = __esm({
|
|
|
2903
2923
|
return {
|
|
2904
2924
|
listing_id,
|
|
2905
2925
|
status: String(data.status ?? "draft"),
|
|
2926
|
+
registration_mode: stringOrNull2(data.registration_mode),
|
|
2927
|
+
listing_status: stringOrNull2(data.listing_status),
|
|
2906
2928
|
auto_manifest: toRecord2(data.auto_manifest),
|
|
2907
2929
|
confidence: toRecord2(data.confidence),
|
|
2908
2930
|
validation_report: toRecord2(data.validation_report),
|
|
2931
|
+
oauth_status: toRecord2(data.oauth_status),
|
|
2909
2932
|
review_url: stringOrNull2(data.review_url),
|
|
2910
2933
|
trace_id: meta.trace_id,
|
|
2911
2934
|
request_id: meta.request_id
|
|
2912
2935
|
};
|
|
2913
2936
|
}
|
|
2914
2937
|
async confirm_registration(listing_id, options = {}) {
|
|
2915
|
-
|
|
2916
|
-
const manifestPayload = options.manifest ? coerceMapping(options.manifest, "manifest") : pending?.manifest ?? {};
|
|
2917
|
-
const toolManualPayload = options.tool_manual ? coerceMapping(options.tool_manual, "tool_manual") : pending?.tool_manual ?? {};
|
|
2918
|
-
const overrides = {};
|
|
2919
|
-
for (const fieldName of ["name", "job_to_be_done"]) {
|
|
2920
|
-
if (manifestPayload[fieldName]) {
|
|
2921
|
-
overrides[fieldName] = manifestPayload[fieldName];
|
|
2922
|
-
}
|
|
2923
|
-
}
|
|
2924
|
-
if (Object.keys(toolManualPayload).length > 0) {
|
|
2925
|
-
overrides.tool_manual = toolManualPayload;
|
|
2926
|
-
}
|
|
2938
|
+
void options;
|
|
2927
2939
|
const payload = { approved: true };
|
|
2928
|
-
if (Object.keys(overrides).length > 0) {
|
|
2929
|
-
payload.overrides = overrides;
|
|
2930
|
-
}
|
|
2931
2940
|
const [data, meta] = await this.request("POST", `/market/capabilities/${listing_id}/confirm-auto-register`, { json_body: payload });
|
|
2932
2941
|
this.pendingConfirmations.delete(listing_id);
|
|
2942
|
+
const checklist = isRecord2(data.checklist) ? Object.fromEntries(
|
|
2943
|
+
Object.entries(data.checklist).map(([key, value]) => [key, Boolean(value)])
|
|
2944
|
+
) : {};
|
|
2933
2945
|
return {
|
|
2934
2946
|
listing_id: String(data.listing_id ?? listing_id),
|
|
2935
2947
|
status: String(data.status ?? ""),
|
|
2948
|
+
message: stringOrNull2(data.message),
|
|
2949
|
+
checklist,
|
|
2936
2950
|
release: toRecord2(data.release),
|
|
2937
2951
|
quality: parseRegistrationQuality(toRecord2(data.quality)),
|
|
2938
2952
|
trace_id: meta.trace_id,
|
|
@@ -4889,7 +4903,7 @@ ${details}` : summary;
|
|
|
4889
4903
|
const headers = new Headers({
|
|
4890
4904
|
Authorization: `Bearer ${this.api_key}`,
|
|
4891
4905
|
Accept: "application/json",
|
|
4892
|
-
"User-Agent": "siglume-api-sdk-ts/0.6
|
|
4906
|
+
"User-Agent": "siglume-api-sdk-ts/0.7.6"
|
|
4893
4907
|
});
|
|
4894
4908
|
if (options.headers) {
|
|
4895
4909
|
for (const [key, value] of Object.entries(options.headers)) {
|
|
@@ -5091,7 +5105,7 @@ var init_metering = __esm({
|
|
|
5091
5105
|
fetchImpl;
|
|
5092
5106
|
constructor(options) {
|
|
5093
5107
|
this.client = new SiglumeClient(options);
|
|
5094
|
-
this.api_key =
|
|
5108
|
+
this.api_key = this.client.api_key;
|
|
5095
5109
|
this.base_url = (options.base_url ?? DEFAULT_SIGLUME_API_BASE).replace(/\/+$/, "");
|
|
5096
5110
|
this.timeout_ms = Math.max(1, options.timeout_ms ?? 15e3);
|
|
5097
5111
|
this.max_retries = Math.max(1, Math.trunc(options.max_retries ?? 3));
|
|
@@ -5137,7 +5151,7 @@ var init_metering = __esm({
|
|
|
5137
5151
|
const headers = new Headers({
|
|
5138
5152
|
Authorization: `Bearer ${this.api_key}`,
|
|
5139
5153
|
Accept: "application/json",
|
|
5140
|
-
"User-Agent": "siglume-api-sdk-ts/0.6
|
|
5154
|
+
"User-Agent": "siglume-api-sdk-ts/0.7.6"
|
|
5141
5155
|
});
|
|
5142
5156
|
let body;
|
|
5143
5157
|
if (options.json_body) {
|
|
@@ -5243,7 +5257,7 @@ var SiglumeBuyerClient = class {
|
|
|
5243
5257
|
warnedFeatures = /* @__PURE__ */ new Set();
|
|
5244
5258
|
constructor(options) {
|
|
5245
5259
|
this.client = new SiglumeClient(options);
|
|
5246
|
-
this.api_key =
|
|
5260
|
+
this.api_key = this.client.api_key;
|
|
5247
5261
|
this.base_url = (options.base_url ?? DEFAULT_SIGLUME_API_BASE).replace(/\/+$/, "");
|
|
5248
5262
|
this.timeout_ms = Math.max(1, options.timeout_ms ?? 15e3);
|
|
5249
5263
|
this.max_retries = Math.max(1, Math.trunc(options.max_retries ?? 3));
|
|
@@ -5420,7 +5434,7 @@ var SiglumeBuyerClient = class {
|
|
|
5420
5434
|
const headers = new Headers({
|
|
5421
5435
|
Authorization: `Bearer ${this.api_key}`,
|
|
5422
5436
|
Accept: "application/json",
|
|
5423
|
-
"User-Agent": "siglume-api-sdk-ts/0.6
|
|
5437
|
+
"User-Agent": "siglume-api-sdk-ts/0.7.6"
|
|
5424
5438
|
});
|
|
5425
5439
|
let body;
|
|
5426
5440
|
if (options.json_body) {
|