@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/bin/siglume.js
CHANGED
|
@@ -1962,124 +1962,6 @@ function parseInstalledToolReceiptStep(data) {
|
|
|
1962
1962
|
raw: { ...data }
|
|
1963
1963
|
};
|
|
1964
1964
|
}
|
|
1965
|
-
function parseWorksCategory(data) {
|
|
1966
|
-
return {
|
|
1967
|
-
key: String(data.key ?? ""),
|
|
1968
|
-
name_ja: stringOrNull(data.name_ja) ?? void 0,
|
|
1969
|
-
name_en: stringOrNull(data.name_en) ?? void 0,
|
|
1970
|
-
description_ja: stringOrNull(data.description_ja) ?? void 0,
|
|
1971
|
-
description_en: stringOrNull(data.description_en) ?? void 0,
|
|
1972
|
-
icon_url: stringOrNull(data.icon_url) ?? void 0,
|
|
1973
|
-
open_job_count: Math.trunc(Number(data.open_job_count ?? 0)),
|
|
1974
|
-
display_order: Math.trunc(Number(data.display_order ?? 0)),
|
|
1975
|
-
raw: { ...data }
|
|
1976
|
-
};
|
|
1977
|
-
}
|
|
1978
|
-
function parseWorksRegistration(data) {
|
|
1979
|
-
const result = isRecord(data.result) ? data.result : {};
|
|
1980
|
-
const status = String(data.status ?? "completed").trim().toLowerCase() || "completed";
|
|
1981
|
-
return {
|
|
1982
|
-
agent_id: String(result.agent_id ?? data.agent_id ?? ""),
|
|
1983
|
-
works_registered: typeof result.works_registered === "boolean" ? result.works_registered : Boolean(result.works_registered ?? false),
|
|
1984
|
-
tagline: stringOrNull(result.tagline) ?? void 0,
|
|
1985
|
-
categories: Array.isArray(result.categories) ? result.categories.filter((item) => typeof item === "string") : [],
|
|
1986
|
-
capabilities: Array.isArray(result.capabilities) ? result.capabilities.filter((item) => typeof item === "string") : [],
|
|
1987
|
-
description: stringOrNull(result.description) ?? void 0,
|
|
1988
|
-
execution_status: status,
|
|
1989
|
-
approval_required: typeof data.approval_required === "boolean" ? data.approval_required : status === "approval_required",
|
|
1990
|
-
intent_id: stringOrNull(data.intent_id) ?? void 0,
|
|
1991
|
-
approval_status: stringOrNull(data.approval_status) ?? void 0,
|
|
1992
|
-
approval_snapshot_hash: stringOrNull(data.approval_snapshot_hash) ?? void 0,
|
|
1993
|
-
approval_preview: toRecord(result.preview),
|
|
1994
|
-
raw: { ...data }
|
|
1995
|
-
};
|
|
1996
|
-
}
|
|
1997
|
-
function parseWorksOwnerDashboardAgent(data) {
|
|
1998
|
-
return {
|
|
1999
|
-
agent_id: String(data.id ?? data.agent_id ?? ""),
|
|
2000
|
-
name: stringOrNull(data.name) ?? void 0,
|
|
2001
|
-
reputation: toRecord(data.reputation),
|
|
2002
|
-
capabilities: Array.isArray(data.capabilities) ? data.capabilities.filter((item) => typeof item === "string") : [],
|
|
2003
|
-
raw: { ...data }
|
|
2004
|
-
};
|
|
2005
|
-
}
|
|
2006
|
-
function parseWorksOwnerDashboardPitch(data) {
|
|
2007
|
-
return {
|
|
2008
|
-
proposal_id: String(data.proposal_id ?? data.id ?? ""),
|
|
2009
|
-
need_id: stringOrNull(data.need_id) ?? void 0,
|
|
2010
|
-
title: stringOrNull(data.title) ?? void 0,
|
|
2011
|
-
title_en: stringOrNull(data.title_en) ?? void 0,
|
|
2012
|
-
status: stringOrNull(data.status) ?? void 0,
|
|
2013
|
-
raw: { ...data }
|
|
2014
|
-
};
|
|
2015
|
-
}
|
|
2016
|
-
function parseWorksOwnerDashboardOrder(data) {
|
|
2017
|
-
return {
|
|
2018
|
-
order_id: String(data.order_id ?? data.id ?? ""),
|
|
2019
|
-
need_id: stringOrNull(data.need_id) ?? void 0,
|
|
2020
|
-
title: stringOrNull(data.title) ?? void 0,
|
|
2021
|
-
title_en: stringOrNull(data.title_en) ?? void 0,
|
|
2022
|
-
status: stringOrNull(data.status) ?? void 0,
|
|
2023
|
-
raw: { ...data }
|
|
2024
|
-
};
|
|
2025
|
-
}
|
|
2026
|
-
function parseWorksOwnerDashboardStats(data) {
|
|
2027
|
-
return {
|
|
2028
|
-
total_agents: Math.trunc(Number(data.total_agents ?? 0)),
|
|
2029
|
-
total_pending: Math.trunc(Number(data.total_pending ?? 0)),
|
|
2030
|
-
total_active: Math.trunc(Number(data.total_active ?? 0)),
|
|
2031
|
-
raw: { ...data }
|
|
2032
|
-
};
|
|
2033
|
-
}
|
|
2034
|
-
function parseWorksOwnerDashboard(data) {
|
|
2035
|
-
return {
|
|
2036
|
-
agents: Array.isArray(data.agents) ? data.agents.filter((item) => isRecord(item)).map((item) => parseWorksOwnerDashboardAgent(item)) : [],
|
|
2037
|
-
pending_pitches: Array.isArray(data.pending_pitches) ? data.pending_pitches.filter((item) => isRecord(item)).map((item) => parseWorksOwnerDashboardPitch(item)) : [],
|
|
2038
|
-
active_orders: Array.isArray(data.active_orders) ? data.active_orders.filter((item) => isRecord(item)).map((item) => parseWorksOwnerDashboardOrder(item)) : [],
|
|
2039
|
-
completed_orders: Array.isArray(data.completed_orders) ? data.completed_orders.filter((item) => isRecord(item)).map((item) => parseWorksOwnerDashboardOrder(item)) : [],
|
|
2040
|
-
stats: isRecord(data.stats) ? parseWorksOwnerDashboardStats(data.stats) : parseWorksOwnerDashboardStats({}),
|
|
2041
|
-
raw: { ...data }
|
|
2042
|
-
};
|
|
2043
|
-
}
|
|
2044
|
-
function parseWorksPosterDashboardJob(data) {
|
|
2045
|
-
return {
|
|
2046
|
-
job_id: String(data.id ?? data.job_id ?? ""),
|
|
2047
|
-
title: stringOrNull(data.title) ?? void 0,
|
|
2048
|
-
title_en: stringOrNull(data.title_en) ?? void 0,
|
|
2049
|
-
proposal_count: Math.trunc(Number(data.proposal_count ?? 0)),
|
|
2050
|
-
created_at: stringOrNull(data.created_at) ?? void 0,
|
|
2051
|
-
raw: { ...data }
|
|
2052
|
-
};
|
|
2053
|
-
}
|
|
2054
|
-
function parseWorksPosterDashboardOrder(data) {
|
|
2055
|
-
return {
|
|
2056
|
-
order_id: String(data.order_id ?? data.id ?? ""),
|
|
2057
|
-
need_id: stringOrNull(data.need_id) ?? void 0,
|
|
2058
|
-
title: stringOrNull(data.title) ?? void 0,
|
|
2059
|
-
title_en: stringOrNull(data.title_en) ?? void 0,
|
|
2060
|
-
status: stringOrNull(data.status) ?? void 0,
|
|
2061
|
-
has_deliverable: typeof data.has_deliverable === "boolean" ? data.has_deliverable : Boolean(data.has_deliverable ?? false),
|
|
2062
|
-
deliverable_count: Math.trunc(Number(data.deliverable_count ?? 0)),
|
|
2063
|
-
awaiting_buyer_action: typeof data.awaiting_buyer_action === "boolean" ? data.awaiting_buyer_action : Boolean(data.awaiting_buyer_action ?? false),
|
|
2064
|
-
raw: { ...data }
|
|
2065
|
-
};
|
|
2066
|
-
}
|
|
2067
|
-
function parseWorksPosterDashboardStats(data) {
|
|
2068
|
-
return {
|
|
2069
|
-
total_posted: Math.trunc(Number(data.total_posted ?? 0)),
|
|
2070
|
-
total_completed: Math.trunc(Number(data.total_completed ?? 0)),
|
|
2071
|
-
raw: { ...data }
|
|
2072
|
-
};
|
|
2073
|
-
}
|
|
2074
|
-
function parseWorksPosterDashboard(data) {
|
|
2075
|
-
return {
|
|
2076
|
-
open_jobs: Array.isArray(data.open_jobs) ? data.open_jobs.filter((item) => isRecord(item)).map((item) => parseWorksPosterDashboardJob(item)) : [],
|
|
2077
|
-
in_progress_orders: Array.isArray(data.in_progress_orders) ? data.in_progress_orders.filter((item) => isRecord(item)).map((item) => parseWorksPosterDashboardOrder(item)) : [],
|
|
2078
|
-
completed_orders: Array.isArray(data.completed_orders) ? data.completed_orders.filter((item) => isRecord(item)).map((item) => parseWorksPosterDashboardOrder(item)) : [],
|
|
2079
|
-
stats: isRecord(data.stats) ? parseWorksPosterDashboardStats(data.stats) : parseWorksPosterDashboardStats({}),
|
|
2080
|
-
raw: { ...data }
|
|
2081
|
-
};
|
|
2082
|
-
}
|
|
2083
1965
|
function parseMarketProposal(data) {
|
|
2084
1966
|
const reasonCodes = Array.isArray(data.reason_codes) ? data.reason_codes : Array.isArray(data.reason_codes_jsonb) ? data.reason_codes_jsonb : [];
|
|
2085
1967
|
return {
|
|
@@ -3521,94 +3403,6 @@ var init_client = __esm({
|
|
|
3521
3403
|
);
|
|
3522
3404
|
return parseMarketNeed(execution.result);
|
|
3523
3405
|
}
|
|
3524
|
-
// `works.*` also uses the public owner-operation execute route. The
|
|
3525
|
-
// categories list returns a top-level array in `result`, so these
|
|
3526
|
-
// wrappers call the execute endpoint directly instead of relying on
|
|
3527
|
-
// execute_owner_operation()'s object-only `result` parser.
|
|
3528
|
-
async list_works_categories(options = {}) {
|
|
3529
|
-
const [data] = await this.requestOwnerOperation(
|
|
3530
|
-
await this.resolveOwnerOperationAgentId(options.agent_id),
|
|
3531
|
-
"works.categories.list",
|
|
3532
|
-
{},
|
|
3533
|
-
{ lang: options.lang }
|
|
3534
|
-
);
|
|
3535
|
-
return Array.isArray(data.result) ? data.result.filter((item) => isRecord(item)).map((item) => parseWorksCategory(item)) : [];
|
|
3536
|
-
}
|
|
3537
|
-
async get_works_registration(options = {}) {
|
|
3538
|
-
const [data] = await this.requestOwnerOperation(
|
|
3539
|
-
await this.resolveOwnerOperationAgentId(options.agent_id),
|
|
3540
|
-
"works.registration.get",
|
|
3541
|
-
{},
|
|
3542
|
-
{ lang: options.lang }
|
|
3543
|
-
);
|
|
3544
|
-
return parseWorksRegistration(data);
|
|
3545
|
-
}
|
|
3546
|
-
async register_for_works(options = {}) {
|
|
3547
|
-
const payload = {};
|
|
3548
|
-
if (options.tagline !== void 0) {
|
|
3549
|
-
payload.tagline = String(options.tagline).trim();
|
|
3550
|
-
}
|
|
3551
|
-
if (options.description !== void 0) {
|
|
3552
|
-
payload.description = String(options.description).trim();
|
|
3553
|
-
}
|
|
3554
|
-
if (options.categories !== void 0) {
|
|
3555
|
-
if (!Array.isArray(options.categories)) {
|
|
3556
|
-
throw new SiglumeClientError("categories must be a list of strings.");
|
|
3557
|
-
}
|
|
3558
|
-
const normalizedCategories = [];
|
|
3559
|
-
for (const item of options.categories) {
|
|
3560
|
-
if (typeof item !== "string") {
|
|
3561
|
-
throw new SiglumeClientError("categories must contain only strings.");
|
|
3562
|
-
}
|
|
3563
|
-
const normalized = item.trim();
|
|
3564
|
-
if (normalized) {
|
|
3565
|
-
normalizedCategories.push(normalized);
|
|
3566
|
-
}
|
|
3567
|
-
}
|
|
3568
|
-
payload.categories = normalizedCategories;
|
|
3569
|
-
}
|
|
3570
|
-
if (options.capabilities !== void 0) {
|
|
3571
|
-
if (!Array.isArray(options.capabilities)) {
|
|
3572
|
-
throw new SiglumeClientError("capabilities must be a list of strings.");
|
|
3573
|
-
}
|
|
3574
|
-
const normalizedCapabilities = [];
|
|
3575
|
-
for (const item of options.capabilities) {
|
|
3576
|
-
if (typeof item !== "string") {
|
|
3577
|
-
throw new SiglumeClientError("capabilities must contain only strings.");
|
|
3578
|
-
}
|
|
3579
|
-
const normalized = item.trim();
|
|
3580
|
-
if (normalized) {
|
|
3581
|
-
normalizedCapabilities.push(normalized);
|
|
3582
|
-
}
|
|
3583
|
-
}
|
|
3584
|
-
payload.capabilities = normalizedCapabilities;
|
|
3585
|
-
}
|
|
3586
|
-
const [data] = await this.requestOwnerOperation(
|
|
3587
|
-
await this.resolveOwnerOperationAgentId(options.agent_id),
|
|
3588
|
-
"works.registration.register",
|
|
3589
|
-
payload,
|
|
3590
|
-
{ lang: options.lang }
|
|
3591
|
-
);
|
|
3592
|
-
return parseWorksRegistration(data);
|
|
3593
|
-
}
|
|
3594
|
-
async get_works_owner_dashboard(options = {}) {
|
|
3595
|
-
const [data] = await this.requestOwnerOperation(
|
|
3596
|
-
await this.resolveOwnerOperationAgentId(options.agent_id),
|
|
3597
|
-
"works.owner_dashboard.get",
|
|
3598
|
-
{},
|
|
3599
|
-
{ lang: options.lang }
|
|
3600
|
-
);
|
|
3601
|
-
return parseWorksOwnerDashboard(isRecord(data.result) ? data.result : {});
|
|
3602
|
-
}
|
|
3603
|
-
async get_works_poster_dashboard(options = {}) {
|
|
3604
|
-
const [data] = await this.requestOwnerOperation(
|
|
3605
|
-
await this.resolveOwnerOperationAgentId(options.agent_id),
|
|
3606
|
-
"works.poster_dashboard.get",
|
|
3607
|
-
{},
|
|
3608
|
-
{ lang: options.lang }
|
|
3609
|
-
);
|
|
3610
|
-
return parseWorksPosterDashboard(isRecord(data.result) ? data.result : {});
|
|
3611
|
-
}
|
|
3612
3406
|
async list_installed_tools(options = {}) {
|
|
3613
3407
|
const resolvedAgentId = await this.resolveOwnerOperationAgentId(options.agent_id);
|
|
3614
3408
|
const [data] = await this.requestOwnerOperation(
|