@alva-ai/toolkit 0.9.4 → 0.9.5
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/browser.global.js +1 -1
- package/dist/browser.global.js.map +1 -1
- package/dist/cli.js +62 -4
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +30 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +30 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -9730,6 +9730,11 @@ var FeedResource = class {
|
|
|
9730
9730
|
};
|
|
9731
9731
|
|
|
9732
9732
|
// src/resources/playbooks.ts
|
|
9733
|
+
var PLAYBOOK_VISIBILITIES = [
|
|
9734
|
+
"public",
|
|
9735
|
+
"private",
|
|
9736
|
+
"paid"
|
|
9737
|
+
];
|
|
9733
9738
|
var PlaybooksResource = class {
|
|
9734
9739
|
constructor(client) {
|
|
9735
9740
|
this.client = client;
|
|
@@ -9763,6 +9768,30 @@ var PlaybooksResource = class {
|
|
|
9763
9768
|
has_next: raw.has_next ?? false
|
|
9764
9769
|
};
|
|
9765
9770
|
}
|
|
9771
|
+
/**
|
|
9772
|
+
* Set a playbook's visibility. Requires authentication; the owner is
|
|
9773
|
+
* resolved server-side from the authenticated user, so only the playbook
|
|
9774
|
+
* `name` is needed.
|
|
9775
|
+
*
|
|
9776
|
+
* Note: `private` and `paid` are paid-tier capabilities. A free-tier user
|
|
9777
|
+
* receives a `PERMISSION_DENIED` error from the gateway, which is surfaced
|
|
9778
|
+
* here unchanged.
|
|
9779
|
+
*/
|
|
9780
|
+
async setVisibility(params) {
|
|
9781
|
+
if (!PLAYBOOK_VISIBILITIES.includes(params.visibility)) {
|
|
9782
|
+
throw new AlvaError(
|
|
9783
|
+
"INVALID_ARGUMENT",
|
|
9784
|
+
`Invalid visibility "${params.visibility}". Expected one of: ${PLAYBOOK_VISIBILITIES.join(", ")}.`,
|
|
9785
|
+
400
|
|
9786
|
+
);
|
|
9787
|
+
}
|
|
9788
|
+
this.client._requireAuth();
|
|
9789
|
+
return await this.client._request(
|
|
9790
|
+
"POST",
|
|
9791
|
+
`/api/v1/playbook/${encodeURIComponent(params.name)}/visibility`,
|
|
9792
|
+
{ body: { visibility: params.visibility } }
|
|
9793
|
+
);
|
|
9794
|
+
}
|
|
9766
9795
|
};
|
|
9767
9796
|
function toAgentPlaybook(raw) {
|
|
9768
9797
|
const username = raw.creator?.name ?? "";
|
|
@@ -12486,7 +12515,7 @@ function formatPlaybookSkillFile(file) {
|
|
|
12486
12515
|
import * as fs2 from "fs";
|
|
12487
12516
|
import * as os2 from "os";
|
|
12488
12517
|
import * as fsPromises2 from "fs/promises";
|
|
12489
|
-
var CLI_VERSION = true ? "0.9.
|
|
12518
|
+
var CLI_VERSION = true ? "0.9.5" : "dev";
|
|
12490
12519
|
function isVersionOlderThan(a, b) {
|
|
12491
12520
|
const parse4 = (v) => {
|
|
12492
12521
|
if (!v) return null;
|
|
@@ -12516,7 +12545,7 @@ Commands:
|
|
|
12516
12545
|
release Feed and playbook releases (feed, playbook-draft, playbook)
|
|
12517
12546
|
lint Design-system lint (playbook)
|
|
12518
12547
|
feed Feed lifecycle management (delete)
|
|
12519
|
-
playbooks Playbook discovery (trending)
|
|
12548
|
+
playbooks Playbook discovery (trending) and visibility
|
|
12520
12549
|
secrets Secret management (create, list, get, update, delete)
|
|
12521
12550
|
sdk SDK documentation (doc, partitions, partition-summary)
|
|
12522
12551
|
skillhub Playbook skills (list, tags, get, file)
|
|
@@ -12838,7 +12867,8 @@ Examples:
|
|
|
12838
12867
|
Find public playbooks with an agent-friendly response shape.
|
|
12839
12868
|
|
|
12840
12869
|
Subcommands:
|
|
12841
|
-
trending
|
|
12870
|
+
trending List trending playbooks
|
|
12871
|
+
set-visibility Set a playbook's visibility (requires auth)
|
|
12842
12872
|
|
|
12843
12873
|
Trending flags:
|
|
12844
12874
|
--keyword <text> Search text
|
|
@@ -12849,6 +12879,10 @@ Trending flags:
|
|
|
12849
12879
|
--cursor <cursor> Pagination cursor from previous response
|
|
12850
12880
|
--current <cursor> Backward-compatible cursor alias
|
|
12851
12881
|
|
|
12882
|
+
Set-visibility flags:
|
|
12883
|
+
--name <name> Playbook name (required; owner derived from auth)
|
|
12884
|
+
--visibility <v> public, private, or paid (required, case-insensitive)
|
|
12885
|
+
|
|
12852
12886
|
Response fields:
|
|
12853
12887
|
playbooks[].ref "username/name" identifier for agents
|
|
12854
12888
|
playbooks[].url_path Web path: /username/playbooks/name
|
|
@@ -12857,10 +12891,17 @@ Response fields:
|
|
|
12857
12891
|
playbooks[].follow_count Social proof signal
|
|
12858
12892
|
playbooks[].cursor Cursor for pagination
|
|
12859
12893
|
has_next Whether another page exists
|
|
12894
|
+
playbook_path "<owner>/<name>" echoed by set-visibility
|
|
12895
|
+
|
|
12896
|
+
Notes:
|
|
12897
|
+
private and paid are paid-tier features; free-tier accounts get a
|
|
12898
|
+
PERMISSION_DENIED error from the gateway.
|
|
12860
12899
|
|
|
12861
12900
|
Examples:
|
|
12862
12901
|
alva playbooks trending --keyword scanner --tags macro,ai --sort recent --limit 5
|
|
12863
|
-
alva playbooks trending --tag btc --cursor abc
|
|
12902
|
+
alva playbooks trending --tag btc --cursor abc
|
|
12903
|
+
alva playbooks set-visibility --name my-scanner --visibility private
|
|
12904
|
+
alva playbooks set-visibility --name my-scanner --visibility public`,
|
|
12864
12905
|
release: `Usage: alva release <subcommand> [options]
|
|
12865
12906
|
|
|
12866
12907
|
Publish feeds and playbooks to the Alva platform. The typical workflow:
|
|
@@ -13460,6 +13501,16 @@ function trendingPlaybooksSort(val) {
|
|
|
13460
13501
|
"playbooks"
|
|
13461
13502
|
);
|
|
13462
13503
|
}
|
|
13504
|
+
function playbookVisibility(val) {
|
|
13505
|
+
const normalized = val.trim().toLowerCase();
|
|
13506
|
+
if (PLAYBOOK_VISIBILITIES.includes(normalized)) {
|
|
13507
|
+
return normalized;
|
|
13508
|
+
}
|
|
13509
|
+
throw new CliUsageError(
|
|
13510
|
+
`--visibility must be one of ${PLAYBOOK_VISIBILITIES.join(", ")} for 'playbooks set-visibility', got '${val}'`,
|
|
13511
|
+
"playbooks"
|
|
13512
|
+
);
|
|
13513
|
+
}
|
|
13463
13514
|
function jsonParse(val) {
|
|
13464
13515
|
if (val === void 0) return void 0;
|
|
13465
13516
|
try {
|
|
@@ -13736,6 +13787,13 @@ async function dispatch(client, args, meta) {
|
|
|
13736
13787
|
cursor: flags["cursor"],
|
|
13737
13788
|
current: flags["current"]
|
|
13738
13789
|
});
|
|
13790
|
+
case "set-visibility":
|
|
13791
|
+
return client.playbooks.setVisibility({
|
|
13792
|
+
name: requireFlag(flags, "name", "playbooks set-visibility"),
|
|
13793
|
+
visibility: playbookVisibility(
|
|
13794
|
+
requireFlag(flags, "visibility", "playbooks set-visibility")
|
|
13795
|
+
)
|
|
13796
|
+
});
|
|
13739
13797
|
default:
|
|
13740
13798
|
throw new CliUsageError(
|
|
13741
13799
|
`Unknown subcommand: playbooks ${subcommand}`,
|