@siglume/api-sdk 2.0.0 → 2.0.1
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 +0 -118
- package/dist/cli/index.d.ts +0 -118
- package/dist/cli/index.js +0 -206
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +0 -206
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -143
- package/dist/index.d.ts +1 -143
- package/dist/index.js +0 -206
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/bin/siglume.cjs
CHANGED
|
@@ -1983,124 +1983,6 @@ function parseInstalledToolReceiptStep(data) {
|
|
|
1983
1983
|
raw: { ...data }
|
|
1984
1984
|
};
|
|
1985
1985
|
}
|
|
1986
|
-
function parseWorksCategory(data) {
|
|
1987
|
-
return {
|
|
1988
|
-
key: String(data.key ?? ""),
|
|
1989
|
-
name_ja: stringOrNull(data.name_ja) ?? void 0,
|
|
1990
|
-
name_en: stringOrNull(data.name_en) ?? void 0,
|
|
1991
|
-
description_ja: stringOrNull(data.description_ja) ?? void 0,
|
|
1992
|
-
description_en: stringOrNull(data.description_en) ?? void 0,
|
|
1993
|
-
icon_url: stringOrNull(data.icon_url) ?? void 0,
|
|
1994
|
-
open_job_count: Math.trunc(Number(data.open_job_count ?? 0)),
|
|
1995
|
-
display_order: Math.trunc(Number(data.display_order ?? 0)),
|
|
1996
|
-
raw: { ...data }
|
|
1997
|
-
};
|
|
1998
|
-
}
|
|
1999
|
-
function parseWorksRegistration(data) {
|
|
2000
|
-
const result = isRecord(data.result) ? data.result : {};
|
|
2001
|
-
const status = String(data.status ?? "completed").trim().toLowerCase() || "completed";
|
|
2002
|
-
return {
|
|
2003
|
-
agent_id: String(result.agent_id ?? data.agent_id ?? ""),
|
|
2004
|
-
works_registered: typeof result.works_registered === "boolean" ? result.works_registered : Boolean(result.works_registered ?? false),
|
|
2005
|
-
tagline: stringOrNull(result.tagline) ?? void 0,
|
|
2006
|
-
categories: Array.isArray(result.categories) ? result.categories.filter((item) => typeof item === "string") : [],
|
|
2007
|
-
capabilities: Array.isArray(result.capabilities) ? result.capabilities.filter((item) => typeof item === "string") : [],
|
|
2008
|
-
description: stringOrNull(result.description) ?? void 0,
|
|
2009
|
-
execution_status: status,
|
|
2010
|
-
approval_required: typeof data.approval_required === "boolean" ? data.approval_required : status === "approval_required",
|
|
2011
|
-
intent_id: stringOrNull(data.intent_id) ?? void 0,
|
|
2012
|
-
approval_status: stringOrNull(data.approval_status) ?? void 0,
|
|
2013
|
-
approval_snapshot_hash: stringOrNull(data.approval_snapshot_hash) ?? void 0,
|
|
2014
|
-
approval_preview: toRecord(result.preview),
|
|
2015
|
-
raw: { ...data }
|
|
2016
|
-
};
|
|
2017
|
-
}
|
|
2018
|
-
function parseWorksOwnerDashboardAgent(data) {
|
|
2019
|
-
return {
|
|
2020
|
-
agent_id: String(data.id ?? data.agent_id ?? ""),
|
|
2021
|
-
name: stringOrNull(data.name) ?? void 0,
|
|
2022
|
-
reputation: toRecord(data.reputation),
|
|
2023
|
-
capabilities: Array.isArray(data.capabilities) ? data.capabilities.filter((item) => typeof item === "string") : [],
|
|
2024
|
-
raw: { ...data }
|
|
2025
|
-
};
|
|
2026
|
-
}
|
|
2027
|
-
function parseWorksOwnerDashboardPitch(data) {
|
|
2028
|
-
return {
|
|
2029
|
-
proposal_id: String(data.proposal_id ?? data.id ?? ""),
|
|
2030
|
-
need_id: stringOrNull(data.need_id) ?? void 0,
|
|
2031
|
-
title: stringOrNull(data.title) ?? void 0,
|
|
2032
|
-
title_en: stringOrNull(data.title_en) ?? void 0,
|
|
2033
|
-
status: stringOrNull(data.status) ?? void 0,
|
|
2034
|
-
raw: { ...data }
|
|
2035
|
-
};
|
|
2036
|
-
}
|
|
2037
|
-
function parseWorksOwnerDashboardOrder(data) {
|
|
2038
|
-
return {
|
|
2039
|
-
order_id: String(data.order_id ?? data.id ?? ""),
|
|
2040
|
-
need_id: stringOrNull(data.need_id) ?? void 0,
|
|
2041
|
-
title: stringOrNull(data.title) ?? void 0,
|
|
2042
|
-
title_en: stringOrNull(data.title_en) ?? void 0,
|
|
2043
|
-
status: stringOrNull(data.status) ?? void 0,
|
|
2044
|
-
raw: { ...data }
|
|
2045
|
-
};
|
|
2046
|
-
}
|
|
2047
|
-
function parseWorksOwnerDashboardStats(data) {
|
|
2048
|
-
return {
|
|
2049
|
-
total_agents: Math.trunc(Number(data.total_agents ?? 0)),
|
|
2050
|
-
total_pending: Math.trunc(Number(data.total_pending ?? 0)),
|
|
2051
|
-
total_active: Math.trunc(Number(data.total_active ?? 0)),
|
|
2052
|
-
raw: { ...data }
|
|
2053
|
-
};
|
|
2054
|
-
}
|
|
2055
|
-
function parseWorksOwnerDashboard(data) {
|
|
2056
|
-
return {
|
|
2057
|
-
agents: Array.isArray(data.agents) ? data.agents.filter((item) => isRecord(item)).map((item) => parseWorksOwnerDashboardAgent(item)) : [],
|
|
2058
|
-
pending_pitches: Array.isArray(data.pending_pitches) ? data.pending_pitches.filter((item) => isRecord(item)).map((item) => parseWorksOwnerDashboardPitch(item)) : [],
|
|
2059
|
-
active_orders: Array.isArray(data.active_orders) ? data.active_orders.filter((item) => isRecord(item)).map((item) => parseWorksOwnerDashboardOrder(item)) : [],
|
|
2060
|
-
completed_orders: Array.isArray(data.completed_orders) ? data.completed_orders.filter((item) => isRecord(item)).map((item) => parseWorksOwnerDashboardOrder(item)) : [],
|
|
2061
|
-
stats: isRecord(data.stats) ? parseWorksOwnerDashboardStats(data.stats) : parseWorksOwnerDashboardStats({}),
|
|
2062
|
-
raw: { ...data }
|
|
2063
|
-
};
|
|
2064
|
-
}
|
|
2065
|
-
function parseWorksPosterDashboardJob(data) {
|
|
2066
|
-
return {
|
|
2067
|
-
job_id: String(data.id ?? data.job_id ?? ""),
|
|
2068
|
-
title: stringOrNull(data.title) ?? void 0,
|
|
2069
|
-
title_en: stringOrNull(data.title_en) ?? void 0,
|
|
2070
|
-
proposal_count: Math.trunc(Number(data.proposal_count ?? 0)),
|
|
2071
|
-
created_at: stringOrNull(data.created_at) ?? void 0,
|
|
2072
|
-
raw: { ...data }
|
|
2073
|
-
};
|
|
2074
|
-
}
|
|
2075
|
-
function parseWorksPosterDashboardOrder(data) {
|
|
2076
|
-
return {
|
|
2077
|
-
order_id: String(data.order_id ?? data.id ?? ""),
|
|
2078
|
-
need_id: stringOrNull(data.need_id) ?? void 0,
|
|
2079
|
-
title: stringOrNull(data.title) ?? void 0,
|
|
2080
|
-
title_en: stringOrNull(data.title_en) ?? void 0,
|
|
2081
|
-
status: stringOrNull(data.status) ?? void 0,
|
|
2082
|
-
has_deliverable: typeof data.has_deliverable === "boolean" ? data.has_deliverable : Boolean(data.has_deliverable ?? false),
|
|
2083
|
-
deliverable_count: Math.trunc(Number(data.deliverable_count ?? 0)),
|
|
2084
|
-
awaiting_buyer_action: typeof data.awaiting_buyer_action === "boolean" ? data.awaiting_buyer_action : Boolean(data.awaiting_buyer_action ?? false),
|
|
2085
|
-
raw: { ...data }
|
|
2086
|
-
};
|
|
2087
|
-
}
|
|
2088
|
-
function parseWorksPosterDashboardStats(data) {
|
|
2089
|
-
return {
|
|
2090
|
-
total_posted: Math.trunc(Number(data.total_posted ?? 0)),
|
|
2091
|
-
total_completed: Math.trunc(Number(data.total_completed ?? 0)),
|
|
2092
|
-
raw: { ...data }
|
|
2093
|
-
};
|
|
2094
|
-
}
|
|
2095
|
-
function parseWorksPosterDashboard(data) {
|
|
2096
|
-
return {
|
|
2097
|
-
open_jobs: Array.isArray(data.open_jobs) ? data.open_jobs.filter((item) => isRecord(item)).map((item) => parseWorksPosterDashboardJob(item)) : [],
|
|
2098
|
-
in_progress_orders: Array.isArray(data.in_progress_orders) ? data.in_progress_orders.filter((item) => isRecord(item)).map((item) => parseWorksPosterDashboardOrder(item)) : [],
|
|
2099
|
-
completed_orders: Array.isArray(data.completed_orders) ? data.completed_orders.filter((item) => isRecord(item)).map((item) => parseWorksPosterDashboardOrder(item)) : [],
|
|
2100
|
-
stats: isRecord(data.stats) ? parseWorksPosterDashboardStats(data.stats) : parseWorksPosterDashboardStats({}),
|
|
2101
|
-
raw: { ...data }
|
|
2102
|
-
};
|
|
2103
|
-
}
|
|
2104
1986
|
function parseMarketProposal(data) {
|
|
2105
1987
|
const reasonCodes = Array.isArray(data.reason_codes) ? data.reason_codes : Array.isArray(data.reason_codes_jsonb) ? data.reason_codes_jsonb : [];
|
|
2106
1988
|
return {
|
|
@@ -3542,94 +3424,6 @@ var init_client = __esm({
|
|
|
3542
3424
|
);
|
|
3543
3425
|
return parseMarketNeed(execution.result);
|
|
3544
3426
|
}
|
|
3545
|
-
// `works.*` also uses the public owner-operation execute route. The
|
|
3546
|
-
// categories list returns a top-level array in `result`, so these
|
|
3547
|
-
// wrappers call the execute endpoint directly instead of relying on
|
|
3548
|
-
// execute_owner_operation()'s object-only `result` parser.
|
|
3549
|
-
async list_works_categories(options = {}) {
|
|
3550
|
-
const [data] = await this.requestOwnerOperation(
|
|
3551
|
-
await this.resolveOwnerOperationAgentId(options.agent_id),
|
|
3552
|
-
"works.categories.list",
|
|
3553
|
-
{},
|
|
3554
|
-
{ lang: options.lang }
|
|
3555
|
-
);
|
|
3556
|
-
return Array.isArray(data.result) ? data.result.filter((item) => isRecord(item)).map((item) => parseWorksCategory(item)) : [];
|
|
3557
|
-
}
|
|
3558
|
-
async get_works_registration(options = {}) {
|
|
3559
|
-
const [data] = await this.requestOwnerOperation(
|
|
3560
|
-
await this.resolveOwnerOperationAgentId(options.agent_id),
|
|
3561
|
-
"works.registration.get",
|
|
3562
|
-
{},
|
|
3563
|
-
{ lang: options.lang }
|
|
3564
|
-
);
|
|
3565
|
-
return parseWorksRegistration(data);
|
|
3566
|
-
}
|
|
3567
|
-
async register_for_works(options = {}) {
|
|
3568
|
-
const payload = {};
|
|
3569
|
-
if (options.tagline !== void 0) {
|
|
3570
|
-
payload.tagline = String(options.tagline).trim();
|
|
3571
|
-
}
|
|
3572
|
-
if (options.description !== void 0) {
|
|
3573
|
-
payload.description = String(options.description).trim();
|
|
3574
|
-
}
|
|
3575
|
-
if (options.categories !== void 0) {
|
|
3576
|
-
if (!Array.isArray(options.categories)) {
|
|
3577
|
-
throw new SiglumeClientError("categories must be a list of strings.");
|
|
3578
|
-
}
|
|
3579
|
-
const normalizedCategories = [];
|
|
3580
|
-
for (const item of options.categories) {
|
|
3581
|
-
if (typeof item !== "string") {
|
|
3582
|
-
throw new SiglumeClientError("categories must contain only strings.");
|
|
3583
|
-
}
|
|
3584
|
-
const normalized = item.trim();
|
|
3585
|
-
if (normalized) {
|
|
3586
|
-
normalizedCategories.push(normalized);
|
|
3587
|
-
}
|
|
3588
|
-
}
|
|
3589
|
-
payload.categories = normalizedCategories;
|
|
3590
|
-
}
|
|
3591
|
-
if (options.capabilities !== void 0) {
|
|
3592
|
-
if (!Array.isArray(options.capabilities)) {
|
|
3593
|
-
throw new SiglumeClientError("capabilities must be a list of strings.");
|
|
3594
|
-
}
|
|
3595
|
-
const normalizedCapabilities = [];
|
|
3596
|
-
for (const item of options.capabilities) {
|
|
3597
|
-
if (typeof item !== "string") {
|
|
3598
|
-
throw new SiglumeClientError("capabilities must contain only strings.");
|
|
3599
|
-
}
|
|
3600
|
-
const normalized = item.trim();
|
|
3601
|
-
if (normalized) {
|
|
3602
|
-
normalizedCapabilities.push(normalized);
|
|
3603
|
-
}
|
|
3604
|
-
}
|
|
3605
|
-
payload.capabilities = normalizedCapabilities;
|
|
3606
|
-
}
|
|
3607
|
-
const [data] = await this.requestOwnerOperation(
|
|
3608
|
-
await this.resolveOwnerOperationAgentId(options.agent_id),
|
|
3609
|
-
"works.registration.register",
|
|
3610
|
-
payload,
|
|
3611
|
-
{ lang: options.lang }
|
|
3612
|
-
);
|
|
3613
|
-
return parseWorksRegistration(data);
|
|
3614
|
-
}
|
|
3615
|
-
async get_works_owner_dashboard(options = {}) {
|
|
3616
|
-
const [data] = await this.requestOwnerOperation(
|
|
3617
|
-
await this.resolveOwnerOperationAgentId(options.agent_id),
|
|
3618
|
-
"works.owner_dashboard.get",
|
|
3619
|
-
{},
|
|
3620
|
-
{ lang: options.lang }
|
|
3621
|
-
);
|
|
3622
|
-
return parseWorksOwnerDashboard(isRecord(data.result) ? data.result : {});
|
|
3623
|
-
}
|
|
3624
|
-
async get_works_poster_dashboard(options = {}) {
|
|
3625
|
-
const [data] = await this.requestOwnerOperation(
|
|
3626
|
-
await this.resolveOwnerOperationAgentId(options.agent_id),
|
|
3627
|
-
"works.poster_dashboard.get",
|
|
3628
|
-
{},
|
|
3629
|
-
{ lang: options.lang }
|
|
3630
|
-
);
|
|
3631
|
-
return parseWorksPosterDashboard(isRecord(data.result) ? data.result : {});
|
|
3632
|
-
}
|
|
3633
3427
|
async list_installed_tools(options = {}) {
|
|
3634
3428
|
const resolvedAgentId = await this.resolveOwnerOperationAgentId(options.agent_id);
|
|
3635
3429
|
const [data] = await this.requestOwnerOperation(
|