@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/cli/index.d.cts
CHANGED
|
@@ -232,6 +232,13 @@ interface ToolManual {
|
|
|
232
232
|
usage_hints: string[];
|
|
233
233
|
result_hints: string[];
|
|
234
234
|
error_hints: string[];
|
|
235
|
+
/**
|
|
236
|
+
* Optional structured capability flags (flat boolean/number/string values,
|
|
237
|
+
* e.g. `{ reply_thread: false, scheduled_one_time: true, images_max: 4 }`)
|
|
238
|
+
* surfaced verbatim on the API Store discovery responses so an agent can
|
|
239
|
+
* judge what a capability can/can't do before binding it.
|
|
240
|
+
*/
|
|
241
|
+
supports?: Record<string, boolean | number | string>;
|
|
235
242
|
approval_summary_template?: string;
|
|
236
243
|
preview_schema?: Record<string, unknown>;
|
|
237
244
|
idempotency_support?: boolean;
|
|
@@ -764,100 +771,6 @@ interface InstalledToolReceiptStepRecord {
|
|
|
764
771
|
created_at?: string | null;
|
|
765
772
|
raw: Record<string, unknown>;
|
|
766
773
|
}
|
|
767
|
-
interface WorksCategoryRecord {
|
|
768
|
-
key: string;
|
|
769
|
-
name_ja?: string | null;
|
|
770
|
-
name_en?: string | null;
|
|
771
|
-
description_ja?: string | null;
|
|
772
|
-
description_en?: string | null;
|
|
773
|
-
icon_url?: string | null;
|
|
774
|
-
open_job_count: number;
|
|
775
|
-
display_order: number;
|
|
776
|
-
raw: Record<string, unknown>;
|
|
777
|
-
}
|
|
778
|
-
interface WorksRegistrationRecord {
|
|
779
|
-
agent_id: string;
|
|
780
|
-
works_registered: boolean;
|
|
781
|
-
tagline?: string | null;
|
|
782
|
-
categories: string[];
|
|
783
|
-
capabilities: string[];
|
|
784
|
-
description?: string | null;
|
|
785
|
-
execution_status: string;
|
|
786
|
-
approval_required: boolean;
|
|
787
|
-
intent_id?: string | null;
|
|
788
|
-
approval_status?: string | null;
|
|
789
|
-
approval_snapshot_hash?: string | null;
|
|
790
|
-
approval_preview: Record<string, unknown>;
|
|
791
|
-
raw: Record<string, unknown>;
|
|
792
|
-
}
|
|
793
|
-
interface WorksOwnerDashboardAgent {
|
|
794
|
-
agent_id: string;
|
|
795
|
-
name?: string | null;
|
|
796
|
-
reputation: Record<string, unknown>;
|
|
797
|
-
capabilities: string[];
|
|
798
|
-
raw: Record<string, unknown>;
|
|
799
|
-
}
|
|
800
|
-
interface WorksOwnerDashboardPitch {
|
|
801
|
-
proposal_id: string;
|
|
802
|
-
need_id?: string | null;
|
|
803
|
-
title?: string | null;
|
|
804
|
-
title_en?: string | null;
|
|
805
|
-
status?: string | null;
|
|
806
|
-
raw: Record<string, unknown>;
|
|
807
|
-
}
|
|
808
|
-
interface WorksOwnerDashboardOrder {
|
|
809
|
-
order_id: string;
|
|
810
|
-
need_id?: string | null;
|
|
811
|
-
title?: string | null;
|
|
812
|
-
title_en?: string | null;
|
|
813
|
-
status?: string | null;
|
|
814
|
-
raw: Record<string, unknown>;
|
|
815
|
-
}
|
|
816
|
-
interface WorksOwnerDashboardStats {
|
|
817
|
-
total_agents: number;
|
|
818
|
-
total_pending: number;
|
|
819
|
-
total_active: number;
|
|
820
|
-
raw: Record<string, unknown>;
|
|
821
|
-
}
|
|
822
|
-
interface WorksOwnerDashboard {
|
|
823
|
-
agents: WorksOwnerDashboardAgent[];
|
|
824
|
-
pending_pitches: WorksOwnerDashboardPitch[];
|
|
825
|
-
active_orders: WorksOwnerDashboardOrder[];
|
|
826
|
-
completed_orders: WorksOwnerDashboardOrder[];
|
|
827
|
-
stats: WorksOwnerDashboardStats;
|
|
828
|
-
raw: Record<string, unknown>;
|
|
829
|
-
}
|
|
830
|
-
interface WorksPosterDashboardJob {
|
|
831
|
-
job_id: string;
|
|
832
|
-
title?: string | null;
|
|
833
|
-
title_en?: string | null;
|
|
834
|
-
proposal_count: number;
|
|
835
|
-
created_at?: string | null;
|
|
836
|
-
raw: Record<string, unknown>;
|
|
837
|
-
}
|
|
838
|
-
interface WorksPosterDashboardOrder {
|
|
839
|
-
order_id: string;
|
|
840
|
-
need_id?: string | null;
|
|
841
|
-
title?: string | null;
|
|
842
|
-
title_en?: string | null;
|
|
843
|
-
status?: string | null;
|
|
844
|
-
has_deliverable: boolean;
|
|
845
|
-
deliverable_count: number;
|
|
846
|
-
awaiting_buyer_action: boolean;
|
|
847
|
-
raw: Record<string, unknown>;
|
|
848
|
-
}
|
|
849
|
-
interface WorksPosterDashboardStats {
|
|
850
|
-
total_posted: number;
|
|
851
|
-
total_completed: number;
|
|
852
|
-
raw: Record<string, unknown>;
|
|
853
|
-
}
|
|
854
|
-
interface WorksPosterDashboard {
|
|
855
|
-
open_jobs: WorksPosterDashboardJob[];
|
|
856
|
-
in_progress_orders: WorksPosterDashboardOrder[];
|
|
857
|
-
completed_orders: WorksPosterDashboardOrder[];
|
|
858
|
-
stats: WorksPosterDashboardStats;
|
|
859
|
-
raw: Record<string, unknown>;
|
|
860
|
-
}
|
|
861
774
|
interface MarketProposalRecord {
|
|
862
775
|
proposal_id: string;
|
|
863
776
|
parent_proposal_id?: string | null;
|
|
@@ -1531,30 +1444,6 @@ interface SiglumeClientShape {
|
|
|
1531
1444
|
status?: string;
|
|
1532
1445
|
lang?: string;
|
|
1533
1446
|
}): Promise<MarketNeedRecord>;
|
|
1534
|
-
list_works_categories(options?: {
|
|
1535
|
-
agent_id?: string;
|
|
1536
|
-
lang?: string;
|
|
1537
|
-
}): Promise<WorksCategoryRecord[]>;
|
|
1538
|
-
get_works_registration(options?: {
|
|
1539
|
-
agent_id?: string;
|
|
1540
|
-
lang?: string;
|
|
1541
|
-
}): Promise<WorksRegistrationRecord>;
|
|
1542
|
-
register_for_works(options?: {
|
|
1543
|
-
agent_id?: string;
|
|
1544
|
-
tagline?: string;
|
|
1545
|
-
description?: string;
|
|
1546
|
-
categories?: string[];
|
|
1547
|
-
capabilities?: string[];
|
|
1548
|
-
lang?: string;
|
|
1549
|
-
}): Promise<WorksRegistrationRecord>;
|
|
1550
|
-
get_works_owner_dashboard(options?: {
|
|
1551
|
-
agent_id?: string;
|
|
1552
|
-
lang?: string;
|
|
1553
|
-
}): Promise<WorksOwnerDashboard>;
|
|
1554
|
-
get_works_poster_dashboard(options?: {
|
|
1555
|
-
agent_id?: string;
|
|
1556
|
-
lang?: string;
|
|
1557
|
-
}): Promise<WorksPosterDashboard>;
|
|
1558
1447
|
list_market_proposals(options?: {
|
|
1559
1448
|
agent_id?: string;
|
|
1560
1449
|
status?: string;
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -232,6 +232,13 @@ interface ToolManual {
|
|
|
232
232
|
usage_hints: string[];
|
|
233
233
|
result_hints: string[];
|
|
234
234
|
error_hints: string[];
|
|
235
|
+
/**
|
|
236
|
+
* Optional structured capability flags (flat boolean/number/string values,
|
|
237
|
+
* e.g. `{ reply_thread: false, scheduled_one_time: true, images_max: 4 }`)
|
|
238
|
+
* surfaced verbatim on the API Store discovery responses so an agent can
|
|
239
|
+
* judge what a capability can/can't do before binding it.
|
|
240
|
+
*/
|
|
241
|
+
supports?: Record<string, boolean | number | string>;
|
|
235
242
|
approval_summary_template?: string;
|
|
236
243
|
preview_schema?: Record<string, unknown>;
|
|
237
244
|
idempotency_support?: boolean;
|
|
@@ -764,100 +771,6 @@ interface InstalledToolReceiptStepRecord {
|
|
|
764
771
|
created_at?: string | null;
|
|
765
772
|
raw: Record<string, unknown>;
|
|
766
773
|
}
|
|
767
|
-
interface WorksCategoryRecord {
|
|
768
|
-
key: string;
|
|
769
|
-
name_ja?: string | null;
|
|
770
|
-
name_en?: string | null;
|
|
771
|
-
description_ja?: string | null;
|
|
772
|
-
description_en?: string | null;
|
|
773
|
-
icon_url?: string | null;
|
|
774
|
-
open_job_count: number;
|
|
775
|
-
display_order: number;
|
|
776
|
-
raw: Record<string, unknown>;
|
|
777
|
-
}
|
|
778
|
-
interface WorksRegistrationRecord {
|
|
779
|
-
agent_id: string;
|
|
780
|
-
works_registered: boolean;
|
|
781
|
-
tagline?: string | null;
|
|
782
|
-
categories: string[];
|
|
783
|
-
capabilities: string[];
|
|
784
|
-
description?: string | null;
|
|
785
|
-
execution_status: string;
|
|
786
|
-
approval_required: boolean;
|
|
787
|
-
intent_id?: string | null;
|
|
788
|
-
approval_status?: string | null;
|
|
789
|
-
approval_snapshot_hash?: string | null;
|
|
790
|
-
approval_preview: Record<string, unknown>;
|
|
791
|
-
raw: Record<string, unknown>;
|
|
792
|
-
}
|
|
793
|
-
interface WorksOwnerDashboardAgent {
|
|
794
|
-
agent_id: string;
|
|
795
|
-
name?: string | null;
|
|
796
|
-
reputation: Record<string, unknown>;
|
|
797
|
-
capabilities: string[];
|
|
798
|
-
raw: Record<string, unknown>;
|
|
799
|
-
}
|
|
800
|
-
interface WorksOwnerDashboardPitch {
|
|
801
|
-
proposal_id: string;
|
|
802
|
-
need_id?: string | null;
|
|
803
|
-
title?: string | null;
|
|
804
|
-
title_en?: string | null;
|
|
805
|
-
status?: string | null;
|
|
806
|
-
raw: Record<string, unknown>;
|
|
807
|
-
}
|
|
808
|
-
interface WorksOwnerDashboardOrder {
|
|
809
|
-
order_id: string;
|
|
810
|
-
need_id?: string | null;
|
|
811
|
-
title?: string | null;
|
|
812
|
-
title_en?: string | null;
|
|
813
|
-
status?: string | null;
|
|
814
|
-
raw: Record<string, unknown>;
|
|
815
|
-
}
|
|
816
|
-
interface WorksOwnerDashboardStats {
|
|
817
|
-
total_agents: number;
|
|
818
|
-
total_pending: number;
|
|
819
|
-
total_active: number;
|
|
820
|
-
raw: Record<string, unknown>;
|
|
821
|
-
}
|
|
822
|
-
interface WorksOwnerDashboard {
|
|
823
|
-
agents: WorksOwnerDashboardAgent[];
|
|
824
|
-
pending_pitches: WorksOwnerDashboardPitch[];
|
|
825
|
-
active_orders: WorksOwnerDashboardOrder[];
|
|
826
|
-
completed_orders: WorksOwnerDashboardOrder[];
|
|
827
|
-
stats: WorksOwnerDashboardStats;
|
|
828
|
-
raw: Record<string, unknown>;
|
|
829
|
-
}
|
|
830
|
-
interface WorksPosterDashboardJob {
|
|
831
|
-
job_id: string;
|
|
832
|
-
title?: string | null;
|
|
833
|
-
title_en?: string | null;
|
|
834
|
-
proposal_count: number;
|
|
835
|
-
created_at?: string | null;
|
|
836
|
-
raw: Record<string, unknown>;
|
|
837
|
-
}
|
|
838
|
-
interface WorksPosterDashboardOrder {
|
|
839
|
-
order_id: string;
|
|
840
|
-
need_id?: string | null;
|
|
841
|
-
title?: string | null;
|
|
842
|
-
title_en?: string | null;
|
|
843
|
-
status?: string | null;
|
|
844
|
-
has_deliverable: boolean;
|
|
845
|
-
deliverable_count: number;
|
|
846
|
-
awaiting_buyer_action: boolean;
|
|
847
|
-
raw: Record<string, unknown>;
|
|
848
|
-
}
|
|
849
|
-
interface WorksPosterDashboardStats {
|
|
850
|
-
total_posted: number;
|
|
851
|
-
total_completed: number;
|
|
852
|
-
raw: Record<string, unknown>;
|
|
853
|
-
}
|
|
854
|
-
interface WorksPosterDashboard {
|
|
855
|
-
open_jobs: WorksPosterDashboardJob[];
|
|
856
|
-
in_progress_orders: WorksPosterDashboardOrder[];
|
|
857
|
-
completed_orders: WorksPosterDashboardOrder[];
|
|
858
|
-
stats: WorksPosterDashboardStats;
|
|
859
|
-
raw: Record<string, unknown>;
|
|
860
|
-
}
|
|
861
774
|
interface MarketProposalRecord {
|
|
862
775
|
proposal_id: string;
|
|
863
776
|
parent_proposal_id?: string | null;
|
|
@@ -1531,30 +1444,6 @@ interface SiglumeClientShape {
|
|
|
1531
1444
|
status?: string;
|
|
1532
1445
|
lang?: string;
|
|
1533
1446
|
}): Promise<MarketNeedRecord>;
|
|
1534
|
-
list_works_categories(options?: {
|
|
1535
|
-
agent_id?: string;
|
|
1536
|
-
lang?: string;
|
|
1537
|
-
}): Promise<WorksCategoryRecord[]>;
|
|
1538
|
-
get_works_registration(options?: {
|
|
1539
|
-
agent_id?: string;
|
|
1540
|
-
lang?: string;
|
|
1541
|
-
}): Promise<WorksRegistrationRecord>;
|
|
1542
|
-
register_for_works(options?: {
|
|
1543
|
-
agent_id?: string;
|
|
1544
|
-
tagline?: string;
|
|
1545
|
-
description?: string;
|
|
1546
|
-
categories?: string[];
|
|
1547
|
-
capabilities?: string[];
|
|
1548
|
-
lang?: string;
|
|
1549
|
-
}): Promise<WorksRegistrationRecord>;
|
|
1550
|
-
get_works_owner_dashboard(options?: {
|
|
1551
|
-
agent_id?: string;
|
|
1552
|
-
lang?: string;
|
|
1553
|
-
}): Promise<WorksOwnerDashboard>;
|
|
1554
|
-
get_works_poster_dashboard(options?: {
|
|
1555
|
-
agent_id?: string;
|
|
1556
|
-
lang?: string;
|
|
1557
|
-
}): Promise<WorksPosterDashboard>;
|
|
1558
1447
|
list_market_proposals(options?: {
|
|
1559
1448
|
agent_id?: string;
|
|
1560
1449
|
status?: string;
|
package/dist/cli/index.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(
|