@siglume/api-sdk 2.0.0 → 2.0.2
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/bin/siglume.cjs +0 -206
- package/dist/bin/siglume.cjs.map +1 -1
- package/dist/bin/siglume.js +0 -206
- package/dist/bin/siglume.js.map +1 -1
- package/dist/cli/index.cjs +0 -206
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +7 -118
- package/dist/cli/index.d.ts +7 -118
- package/dist/cli/index.js +0 -206
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +4 -208
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -143
- package/dist/index.d.ts +8 -143
- package/dist/index.js +4 -208
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2315,124 +2315,6 @@ function parseInstalledToolReceiptStep(data) {
|
|
|
2315
2315
|
raw: { ...data }
|
|
2316
2316
|
};
|
|
2317
2317
|
}
|
|
2318
|
-
function parseWorksCategory(data) {
|
|
2319
|
-
return {
|
|
2320
|
-
key: String(data.key ?? ""),
|
|
2321
|
-
name_ja: stringOrNull2(data.name_ja) ?? void 0,
|
|
2322
|
-
name_en: stringOrNull2(data.name_en) ?? void 0,
|
|
2323
|
-
description_ja: stringOrNull2(data.description_ja) ?? void 0,
|
|
2324
|
-
description_en: stringOrNull2(data.description_en) ?? void 0,
|
|
2325
|
-
icon_url: stringOrNull2(data.icon_url) ?? void 0,
|
|
2326
|
-
open_job_count: Math.trunc(Number(data.open_job_count ?? 0)),
|
|
2327
|
-
display_order: Math.trunc(Number(data.display_order ?? 0)),
|
|
2328
|
-
raw: { ...data }
|
|
2329
|
-
};
|
|
2330
|
-
}
|
|
2331
|
-
function parseWorksRegistration(data) {
|
|
2332
|
-
const result = isRecord2(data.result) ? data.result : {};
|
|
2333
|
-
const status = String(data.status ?? "completed").trim().toLowerCase() || "completed";
|
|
2334
|
-
return {
|
|
2335
|
-
agent_id: String(result.agent_id ?? data.agent_id ?? ""),
|
|
2336
|
-
works_registered: typeof result.works_registered === "boolean" ? result.works_registered : Boolean(result.works_registered ?? false),
|
|
2337
|
-
tagline: stringOrNull2(result.tagline) ?? void 0,
|
|
2338
|
-
categories: Array.isArray(result.categories) ? result.categories.filter((item) => typeof item === "string") : [],
|
|
2339
|
-
capabilities: Array.isArray(result.capabilities) ? result.capabilities.filter((item) => typeof item === "string") : [],
|
|
2340
|
-
description: stringOrNull2(result.description) ?? void 0,
|
|
2341
|
-
execution_status: status,
|
|
2342
|
-
approval_required: typeof data.approval_required === "boolean" ? data.approval_required : status === "approval_required",
|
|
2343
|
-
intent_id: stringOrNull2(data.intent_id) ?? void 0,
|
|
2344
|
-
approval_status: stringOrNull2(data.approval_status) ?? void 0,
|
|
2345
|
-
approval_snapshot_hash: stringOrNull2(data.approval_snapshot_hash) ?? void 0,
|
|
2346
|
-
approval_preview: toRecord2(result.preview),
|
|
2347
|
-
raw: { ...data }
|
|
2348
|
-
};
|
|
2349
|
-
}
|
|
2350
|
-
function parseWorksOwnerDashboardAgent(data) {
|
|
2351
|
-
return {
|
|
2352
|
-
agent_id: String(data.id ?? data.agent_id ?? ""),
|
|
2353
|
-
name: stringOrNull2(data.name) ?? void 0,
|
|
2354
|
-
reputation: toRecord2(data.reputation),
|
|
2355
|
-
capabilities: Array.isArray(data.capabilities) ? data.capabilities.filter((item) => typeof item === "string") : [],
|
|
2356
|
-
raw: { ...data }
|
|
2357
|
-
};
|
|
2358
|
-
}
|
|
2359
|
-
function parseWorksOwnerDashboardPitch(data) {
|
|
2360
|
-
return {
|
|
2361
|
-
proposal_id: String(data.proposal_id ?? data.id ?? ""),
|
|
2362
|
-
need_id: stringOrNull2(data.need_id) ?? void 0,
|
|
2363
|
-
title: stringOrNull2(data.title) ?? void 0,
|
|
2364
|
-
title_en: stringOrNull2(data.title_en) ?? void 0,
|
|
2365
|
-
status: stringOrNull2(data.status) ?? void 0,
|
|
2366
|
-
raw: { ...data }
|
|
2367
|
-
};
|
|
2368
|
-
}
|
|
2369
|
-
function parseWorksOwnerDashboardOrder(data) {
|
|
2370
|
-
return {
|
|
2371
|
-
order_id: String(data.order_id ?? data.id ?? ""),
|
|
2372
|
-
need_id: stringOrNull2(data.need_id) ?? void 0,
|
|
2373
|
-
title: stringOrNull2(data.title) ?? void 0,
|
|
2374
|
-
title_en: stringOrNull2(data.title_en) ?? void 0,
|
|
2375
|
-
status: stringOrNull2(data.status) ?? void 0,
|
|
2376
|
-
raw: { ...data }
|
|
2377
|
-
};
|
|
2378
|
-
}
|
|
2379
|
-
function parseWorksOwnerDashboardStats(data) {
|
|
2380
|
-
return {
|
|
2381
|
-
total_agents: Math.trunc(Number(data.total_agents ?? 0)),
|
|
2382
|
-
total_pending: Math.trunc(Number(data.total_pending ?? 0)),
|
|
2383
|
-
total_active: Math.trunc(Number(data.total_active ?? 0)),
|
|
2384
|
-
raw: { ...data }
|
|
2385
|
-
};
|
|
2386
|
-
}
|
|
2387
|
-
function parseWorksOwnerDashboard(data) {
|
|
2388
|
-
return {
|
|
2389
|
-
agents: Array.isArray(data.agents) ? data.agents.filter((item) => isRecord2(item)).map((item) => parseWorksOwnerDashboardAgent(item)) : [],
|
|
2390
|
-
pending_pitches: Array.isArray(data.pending_pitches) ? data.pending_pitches.filter((item) => isRecord2(item)).map((item) => parseWorksOwnerDashboardPitch(item)) : [],
|
|
2391
|
-
active_orders: Array.isArray(data.active_orders) ? data.active_orders.filter((item) => isRecord2(item)).map((item) => parseWorksOwnerDashboardOrder(item)) : [],
|
|
2392
|
-
completed_orders: Array.isArray(data.completed_orders) ? data.completed_orders.filter((item) => isRecord2(item)).map((item) => parseWorksOwnerDashboardOrder(item)) : [],
|
|
2393
|
-
stats: isRecord2(data.stats) ? parseWorksOwnerDashboardStats(data.stats) : parseWorksOwnerDashboardStats({}),
|
|
2394
|
-
raw: { ...data }
|
|
2395
|
-
};
|
|
2396
|
-
}
|
|
2397
|
-
function parseWorksPosterDashboardJob(data) {
|
|
2398
|
-
return {
|
|
2399
|
-
job_id: String(data.id ?? data.job_id ?? ""),
|
|
2400
|
-
title: stringOrNull2(data.title) ?? void 0,
|
|
2401
|
-
title_en: stringOrNull2(data.title_en) ?? void 0,
|
|
2402
|
-
proposal_count: Math.trunc(Number(data.proposal_count ?? 0)),
|
|
2403
|
-
created_at: stringOrNull2(data.created_at) ?? void 0,
|
|
2404
|
-
raw: { ...data }
|
|
2405
|
-
};
|
|
2406
|
-
}
|
|
2407
|
-
function parseWorksPosterDashboardOrder(data) {
|
|
2408
|
-
return {
|
|
2409
|
-
order_id: String(data.order_id ?? data.id ?? ""),
|
|
2410
|
-
need_id: stringOrNull2(data.need_id) ?? void 0,
|
|
2411
|
-
title: stringOrNull2(data.title) ?? void 0,
|
|
2412
|
-
title_en: stringOrNull2(data.title_en) ?? void 0,
|
|
2413
|
-
status: stringOrNull2(data.status) ?? void 0,
|
|
2414
|
-
has_deliverable: typeof data.has_deliverable === "boolean" ? data.has_deliverable : Boolean(data.has_deliverable ?? false),
|
|
2415
|
-
deliverable_count: Math.trunc(Number(data.deliverable_count ?? 0)),
|
|
2416
|
-
awaiting_buyer_action: typeof data.awaiting_buyer_action === "boolean" ? data.awaiting_buyer_action : Boolean(data.awaiting_buyer_action ?? false),
|
|
2417
|
-
raw: { ...data }
|
|
2418
|
-
};
|
|
2419
|
-
}
|
|
2420
|
-
function parseWorksPosterDashboardStats(data) {
|
|
2421
|
-
return {
|
|
2422
|
-
total_posted: Math.trunc(Number(data.total_posted ?? 0)),
|
|
2423
|
-
total_completed: Math.trunc(Number(data.total_completed ?? 0)),
|
|
2424
|
-
raw: { ...data }
|
|
2425
|
-
};
|
|
2426
|
-
}
|
|
2427
|
-
function parseWorksPosterDashboard(data) {
|
|
2428
|
-
return {
|
|
2429
|
-
open_jobs: Array.isArray(data.open_jobs) ? data.open_jobs.filter((item) => isRecord2(item)).map((item) => parseWorksPosterDashboardJob(item)) : [],
|
|
2430
|
-
in_progress_orders: Array.isArray(data.in_progress_orders) ? data.in_progress_orders.filter((item) => isRecord2(item)).map((item) => parseWorksPosterDashboardOrder(item)) : [],
|
|
2431
|
-
completed_orders: Array.isArray(data.completed_orders) ? data.completed_orders.filter((item) => isRecord2(item)).map((item) => parseWorksPosterDashboardOrder(item)) : [],
|
|
2432
|
-
stats: isRecord2(data.stats) ? parseWorksPosterDashboardStats(data.stats) : parseWorksPosterDashboardStats({}),
|
|
2433
|
-
raw: { ...data }
|
|
2434
|
-
};
|
|
2435
|
-
}
|
|
2436
2318
|
function parseMarketProposal(data) {
|
|
2437
2319
|
const reasonCodes = Array.isArray(data.reason_codes) ? data.reason_codes : Array.isArray(data.reason_codes_jsonb) ? data.reason_codes_jsonb : [];
|
|
2438
2320
|
return {
|
|
@@ -3874,94 +3756,6 @@ var init_client = __esm({
|
|
|
3874
3756
|
);
|
|
3875
3757
|
return parseMarketNeed(execution.result);
|
|
3876
3758
|
}
|
|
3877
|
-
// `works.*` also uses the public owner-operation execute route. The
|
|
3878
|
-
// categories list returns a top-level array in `result`, so these
|
|
3879
|
-
// wrappers call the execute endpoint directly instead of relying on
|
|
3880
|
-
// execute_owner_operation()'s object-only `result` parser.
|
|
3881
|
-
async list_works_categories(options = {}) {
|
|
3882
|
-
const [data] = await this.requestOwnerOperation(
|
|
3883
|
-
await this.resolveOwnerOperationAgentId(options.agent_id),
|
|
3884
|
-
"works.categories.list",
|
|
3885
|
-
{},
|
|
3886
|
-
{ lang: options.lang }
|
|
3887
|
-
);
|
|
3888
|
-
return Array.isArray(data.result) ? data.result.filter((item) => isRecord2(item)).map((item) => parseWorksCategory(item)) : [];
|
|
3889
|
-
}
|
|
3890
|
-
async get_works_registration(options = {}) {
|
|
3891
|
-
const [data] = await this.requestOwnerOperation(
|
|
3892
|
-
await this.resolveOwnerOperationAgentId(options.agent_id),
|
|
3893
|
-
"works.registration.get",
|
|
3894
|
-
{},
|
|
3895
|
-
{ lang: options.lang }
|
|
3896
|
-
);
|
|
3897
|
-
return parseWorksRegistration(data);
|
|
3898
|
-
}
|
|
3899
|
-
async register_for_works(options = {}) {
|
|
3900
|
-
const payload = {};
|
|
3901
|
-
if (options.tagline !== void 0) {
|
|
3902
|
-
payload.tagline = String(options.tagline).trim();
|
|
3903
|
-
}
|
|
3904
|
-
if (options.description !== void 0) {
|
|
3905
|
-
payload.description = String(options.description).trim();
|
|
3906
|
-
}
|
|
3907
|
-
if (options.categories !== void 0) {
|
|
3908
|
-
if (!Array.isArray(options.categories)) {
|
|
3909
|
-
throw new SiglumeClientError("categories must be a list of strings.");
|
|
3910
|
-
}
|
|
3911
|
-
const normalizedCategories = [];
|
|
3912
|
-
for (const item of options.categories) {
|
|
3913
|
-
if (typeof item !== "string") {
|
|
3914
|
-
throw new SiglumeClientError("categories must contain only strings.");
|
|
3915
|
-
}
|
|
3916
|
-
const normalized = item.trim();
|
|
3917
|
-
if (normalized) {
|
|
3918
|
-
normalizedCategories.push(normalized);
|
|
3919
|
-
}
|
|
3920
|
-
}
|
|
3921
|
-
payload.categories = normalizedCategories;
|
|
3922
|
-
}
|
|
3923
|
-
if (options.capabilities !== void 0) {
|
|
3924
|
-
if (!Array.isArray(options.capabilities)) {
|
|
3925
|
-
throw new SiglumeClientError("capabilities must be a list of strings.");
|
|
3926
|
-
}
|
|
3927
|
-
const normalizedCapabilities = [];
|
|
3928
|
-
for (const item of options.capabilities) {
|
|
3929
|
-
if (typeof item !== "string") {
|
|
3930
|
-
throw new SiglumeClientError("capabilities must contain only strings.");
|
|
3931
|
-
}
|
|
3932
|
-
const normalized = item.trim();
|
|
3933
|
-
if (normalized) {
|
|
3934
|
-
normalizedCapabilities.push(normalized);
|
|
3935
|
-
}
|
|
3936
|
-
}
|
|
3937
|
-
payload.capabilities = normalizedCapabilities;
|
|
3938
|
-
}
|
|
3939
|
-
const [data] = await this.requestOwnerOperation(
|
|
3940
|
-
await this.resolveOwnerOperationAgentId(options.agent_id),
|
|
3941
|
-
"works.registration.register",
|
|
3942
|
-
payload,
|
|
3943
|
-
{ lang: options.lang }
|
|
3944
|
-
);
|
|
3945
|
-
return parseWorksRegistration(data);
|
|
3946
|
-
}
|
|
3947
|
-
async get_works_owner_dashboard(options = {}) {
|
|
3948
|
-
const [data] = await this.requestOwnerOperation(
|
|
3949
|
-
await this.resolveOwnerOperationAgentId(options.agent_id),
|
|
3950
|
-
"works.owner_dashboard.get",
|
|
3951
|
-
{},
|
|
3952
|
-
{ lang: options.lang }
|
|
3953
|
-
);
|
|
3954
|
-
return parseWorksOwnerDashboard(isRecord2(data.result) ? data.result : {});
|
|
3955
|
-
}
|
|
3956
|
-
async get_works_poster_dashboard(options = {}) {
|
|
3957
|
-
const [data] = await this.requestOwnerOperation(
|
|
3958
|
-
await this.resolveOwnerOperationAgentId(options.agent_id),
|
|
3959
|
-
"works.poster_dashboard.get",
|
|
3960
|
-
{},
|
|
3961
|
-
{ lang: options.lang }
|
|
3962
|
-
);
|
|
3963
|
-
return parseWorksPosterDashboard(isRecord2(data.result) ? data.result : {});
|
|
3964
|
-
}
|
|
3965
3759
|
async list_installed_tools(options = {}) {
|
|
3966
3760
|
const resolvedAgentId = await this.resolveOwnerOperationAgentId(options.agent_id);
|
|
3967
3761
|
const [data] = await this.requestOwnerOperation(
|
|
@@ -8205,7 +7999,8 @@ var ALL_TOOL_MANUAL_FIELDS = [
|
|
|
8205
7999
|
"settlement_mode",
|
|
8206
8000
|
"refund_or_cancellation_note",
|
|
8207
8001
|
"jurisdiction",
|
|
8208
|
-
"legal_notes"
|
|
8002
|
+
"legal_notes",
|
|
8003
|
+
"supports"
|
|
8209
8004
|
];
|
|
8210
8005
|
var BASE_REQUIRED_FIELDS = [
|
|
8211
8006
|
"tool_name",
|
|
@@ -8729,7 +8524,8 @@ function buildToolManualSchema(permissionClass, fields) {
|
|
|
8729
8524
|
settlement_mode: { type: "string", enum: [...PAYMENT_SETTLEMENT_MODES] },
|
|
8730
8525
|
refund_or_cancellation_note: { type: "string" },
|
|
8731
8526
|
jurisdiction: { type: "string" },
|
|
8732
|
-
legal_notes: { type: "string" }
|
|
8527
|
+
legal_notes: { type: "string" },
|
|
8528
|
+
supports: { type: "object", additionalProperties: { type: ["boolean", "number", "string"] } }
|
|
8733
8529
|
};
|
|
8734
8530
|
const selectedFields = [...new Set(fields)];
|
|
8735
8531
|
let required = [...selectedFields];
|