@astralform/js 8.3.0 → 8.4.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/README.md +1 -0
- package/dist/index.cjs +31 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +54 -1
- package/dist/index.d.ts +54 -1
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -320,6 +320,7 @@ const conversations = await client.getConversations();
|
|
|
320
320
|
const messages = await client.getMessages("conversation-id");
|
|
321
321
|
const agents = await client.getAgents();
|
|
322
322
|
const skills = await client.getSkills();
|
|
323
|
+
const commands = await client.listSkillCommands();
|
|
323
324
|
|
|
324
325
|
// Job-based streaming
|
|
325
326
|
const job = await client.createJob({ message: "Hello" });
|
package/dist/index.cjs
CHANGED
|
@@ -855,6 +855,37 @@ var AstralformClient = class {
|
|
|
855
855
|
const raw = await this.get("/v1/skills");
|
|
856
856
|
return raw.map((s) => camelizeKeys(s));
|
|
857
857
|
}
|
|
858
|
+
/**
|
|
859
|
+
* List the slash commands the active agent offers — the system commands
|
|
860
|
+
* followed by its enabled skills. Backs the composer's "/" menu.
|
|
861
|
+
*
|
|
862
|
+
* @param surface Who will execute them. Omit for the server's default,
|
|
863
|
+
* `"web"`: what `POST /v1/jobs` runs itself. `"telegram"` returns the
|
|
864
|
+
* bot's commands under Telegram-valid names; `"all"` returns every
|
|
865
|
+
* command, including those the other surfaces filter out — `surfaces` is
|
|
866
|
+
* set on every row either way, and is what tells them apart here.
|
|
867
|
+
*
|
|
868
|
+
* The default surface is not sent as a query parameter. The server already
|
|
869
|
+
* defaults to `web`, so omitting it keeps the request byte-identical to
|
|
870
|
+
* what clients that call the raw path send today — same reasoning as
|
|
871
|
+
* {@link getConversationEvents}'s `toolOutputs`.
|
|
872
|
+
*/
|
|
873
|
+
async listSkillCommands(surface) {
|
|
874
|
+
const query = surface && surface !== "web" ? `?surface=${surface}` : "";
|
|
875
|
+
const raw = await this.get(
|
|
876
|
+
`/v1/skills/commands${query}`
|
|
877
|
+
);
|
|
878
|
+
return raw.map((c) => {
|
|
879
|
+
const command = camelizeKeys(c);
|
|
880
|
+
return {
|
|
881
|
+
...command,
|
|
882
|
+
displayName: command.displayName ?? "",
|
|
883
|
+
description: command.description ?? "",
|
|
884
|
+
argsHint: command.argsHint ?? "",
|
|
885
|
+
surfaces: command.surfaces ?? []
|
|
886
|
+
};
|
|
887
|
+
});
|
|
888
|
+
}
|
|
858
889
|
async getConversationEvents(conversationId, jobId, options) {
|
|
859
890
|
const params = new URLSearchParams();
|
|
860
891
|
if (jobId) params.set("job_id", jobId);
|