@agent-commons/sdk 0.5.0 → 0.6.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/dist/index.cjs +70 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +174 -1
- package/dist/index.d.ts +174 -1
- package/dist/index.mjs +70 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -133,6 +133,15 @@ var CommonsClient = class {
|
|
|
133
133
|
list: (owner) => this.request("GET", `/v1/agents${owner ? `?owner=${owner}` : ""}`),
|
|
134
134
|
get: (agentId) => this.request("GET", `/v1/agents/${agentId}`),
|
|
135
135
|
update: (agentId, params) => this.request("PUT", `/v1/agents/${agentId}`, params),
|
|
136
|
+
/**
|
|
137
|
+
* Generate durable image assets for this agent without routing a
|
|
138
|
+
* deterministic image operation through an LLM tool-selection turn.
|
|
139
|
+
*/
|
|
140
|
+
generateImage: (agentId, params) => this.request(
|
|
141
|
+
"POST",
|
|
142
|
+
`/v1/agents/${encodeURIComponent(agentId)}/assets/images`,
|
|
143
|
+
params
|
|
144
|
+
),
|
|
136
145
|
getRuntime: (agentId) => this.request("GET", `/v1/agents/${agentId}/runtime`),
|
|
137
146
|
configureRuntime: (agentId, params) => this.request("PUT", `/v1/agents/${agentId}/runtime`, params),
|
|
138
147
|
deployRuntime: (agentId) => this.request("POST", `/v1/agents/${agentId}/runtime/deploy`),
|
|
@@ -624,14 +633,71 @@ var CommonsClient = class {
|
|
|
624
633
|
const qs = params.toString();
|
|
625
634
|
return this.request("GET", `/v1/skills${qs ? `?${qs}` : ""}`);
|
|
626
635
|
},
|
|
627
|
-
get: (skillIdOrSlug) => this.request("GET", `/v1/skills/${skillIdOrSlug}`),
|
|
636
|
+
get: (skillIdOrSlug) => this.request("GET", `/v1/skills/${encodeURIComponent(skillIdOrSlug)}`),
|
|
628
637
|
getIndex: (ownerId) => {
|
|
629
638
|
const qs = ownerId ? `?ownerId=${ownerId}` : "";
|
|
630
639
|
return this.request("GET", `/v1/skills/index${qs}`);
|
|
631
640
|
},
|
|
641
|
+
listForAgent: (agentId) => this.request("GET", `/v1/skills/agents/${encodeURIComponent(agentId)}`),
|
|
642
|
+
setAgentAvailability: (skillIdOrSlug, agentId, isEnabled) => this.request(
|
|
643
|
+
"PUT",
|
|
644
|
+
`/v1/skills/${encodeURIComponent(skillIdOrSlug)}/agents/${encodeURIComponent(agentId)}`,
|
|
645
|
+
{ isEnabled }
|
|
646
|
+
),
|
|
632
647
|
create: (params) => this.request("POST", "/v1/skills", params),
|
|
633
|
-
update: (skillIdOrSlug, updates) => this.request(
|
|
634
|
-
|
|
648
|
+
update: (skillIdOrSlug, updates) => this.request(
|
|
649
|
+
"PUT",
|
|
650
|
+
`/v1/skills/${encodeURIComponent(skillIdOrSlug)}`,
|
|
651
|
+
updates
|
|
652
|
+
),
|
|
653
|
+
delete: (skillIdOrSlug) => this.request(
|
|
654
|
+
"DELETE",
|
|
655
|
+
`/v1/skills/${encodeURIComponent(skillIdOrSlug)}`
|
|
656
|
+
),
|
|
657
|
+
import: (file, options) => {
|
|
658
|
+
const body = new FormData();
|
|
659
|
+
body.append("file", file, options?.fileName || "SKILL.md");
|
|
660
|
+
if (options?.agentId) body.set("agentId", options.agentId);
|
|
661
|
+
return this.request("POST", "/v1/skills/import", body);
|
|
662
|
+
}
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
// ── Capability providers ─────────────────────────────────────────────────
|
|
666
|
+
get providers() {
|
|
667
|
+
return {
|
|
668
|
+
list: () => this.request("GET", "/v1/providers"),
|
|
669
|
+
configure: (capability, input) => this.request(
|
|
670
|
+
"PUT",
|
|
671
|
+
`/v1/providers/${encodeURIComponent(capability)}`,
|
|
672
|
+
input
|
|
673
|
+
),
|
|
674
|
+
remove: (capability) => this.request(
|
|
675
|
+
"DELETE",
|
|
676
|
+
`/v1/providers/${encodeURIComponent(capability)}`
|
|
677
|
+
)
|
|
678
|
+
};
|
|
679
|
+
}
|
|
680
|
+
// ── Sandboxed UI plugins ─────────────────────────────────────────────────
|
|
681
|
+
get uiPlugins() {
|
|
682
|
+
return {
|
|
683
|
+
list: (activeOnly = false) => this.request(
|
|
684
|
+
"GET",
|
|
685
|
+
`/v1/ui-plugins${activeOnly ? "?active=true" : ""}`
|
|
686
|
+
),
|
|
687
|
+
getBySlug: (slug) => this.request(
|
|
688
|
+
"GET",
|
|
689
|
+
`/v1/ui-plugins/slug/${encodeURIComponent(slug)}`
|
|
690
|
+
),
|
|
691
|
+
create: (input) => this.request("PUT", "/v1/ui-plugins", input),
|
|
692
|
+
setStatus: (pluginId, status) => this.request(
|
|
693
|
+
"PUT",
|
|
694
|
+
`/v1/ui-plugins/${encodeURIComponent(pluginId)}/status`,
|
|
695
|
+
{ status }
|
|
696
|
+
),
|
|
697
|
+
delete: (pluginId) => this.request(
|
|
698
|
+
"DELETE",
|
|
699
|
+
`/v1/ui-plugins/${encodeURIComponent(pluginId)}`
|
|
700
|
+
)
|
|
635
701
|
};
|
|
636
702
|
}
|
|
637
703
|
// ── Wallets ───────────────────────────────────────────────────────────────
|
|
@@ -1009,6 +1075,7 @@ var CommonsClient = class {
|
|
|
1009
1075
|
if (filter?.favorite !== void 0)
|
|
1010
1076
|
query.set("favorite", String(filter.favorite));
|
|
1011
1077
|
if (filter?.sessionId) query.set("sessionId", filter.sessionId);
|
|
1078
|
+
if (filter?.agentId) query.set("agentId", filter.agentId);
|
|
1012
1079
|
if (filter?.limit !== void 0)
|
|
1013
1080
|
query.set("limit", String(filter.limit));
|
|
1014
1081
|
if (filter?.offset !== void 0)
|