@toon-protocol/rig 4.0.0 → 4.1.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 +0 -1
- package/dist/{chunk-ZZBA5VVL.js → chunk-7VCVR4GK.js} +2 -2
- package/dist/{chunk-2KJJ7LSO.js → chunk-NCEMQUPA.js} +40 -2
- package/dist/chunk-NCEMQUPA.js.map +1 -0
- package/dist/cli/rig.js +340 -44
- package/dist/cli/rig.js.map +1 -1
- package/dist/index.d.ts +10 -3
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/{publisher-CcL96ugq.d.ts → publisher-DMJ06cuL.d.ts} +41 -2
- package/dist/standalone/index.d.ts +1 -1
- package/dist/{standalone-mode-LEAC4A2L.js → standalone-mode-KTYRTUS6.js} +2 -2
- package/package.json +3 -2
- package/dist/chunk-2KJJ7LSO.js.map +0 -1
- /package/dist/{chunk-ZZBA5VVL.js.map → chunk-7VCVR4GK.js.map} +0 -0
- /package/dist/{standalone-mode-LEAC4A2L.js.map → standalone-mode-KTYRTUS6.js.map} +0 -0
package/dist/cli/rig.js
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
setHeadSymref,
|
|
19
19
|
updateRef,
|
|
20
20
|
writeGitObjects
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-7VCVR4GK.js";
|
|
22
22
|
import {
|
|
23
23
|
DEFAULT_KEYSTORE_PASSWORD,
|
|
24
24
|
MissingIdentityError,
|
|
@@ -39,9 +39,10 @@ import {
|
|
|
39
39
|
buildRepoAnnouncement,
|
|
40
40
|
buildStatus,
|
|
41
41
|
fetchRemoteState,
|
|
42
|
+
isValidEvmPayoutAddress,
|
|
42
43
|
parseMaintainers,
|
|
43
44
|
queryRelay
|
|
44
|
-
} from "../chunk-
|
|
45
|
+
} from "../chunk-NCEMQUPA.js";
|
|
45
46
|
import {
|
|
46
47
|
ChannelMapStore,
|
|
47
48
|
RIG_STANDALONE_ENV,
|
|
@@ -1110,7 +1111,7 @@ function loadPaidSession(deps, relayUrl) {
|
|
|
1110
1111
|
});
|
|
1111
1112
|
}
|
|
1112
1113
|
var defaultLoadStandalone = async (options) => {
|
|
1113
|
-
const mod = await import("../standalone-mode-
|
|
1114
|
+
const mod = await import("../standalone-mode-KTYRTUS6.js");
|
|
1114
1115
|
return mod.createStandaloneContext(options);
|
|
1115
1116
|
};
|
|
1116
1117
|
function identityReport(ctx) {
|
|
@@ -5498,33 +5499,10 @@ async function runInit(args, deps) {
|
|
|
5498
5499
|
|
|
5499
5500
|
// src/cli/maintainers.ts
|
|
5500
5501
|
import { parseArgs as parseArgs14 } from "util";
|
|
5501
|
-
var HEX64_RE3 = /^[0-9a-f]{64}$/;
|
|
5502
|
-
var WS_URL_RE4 = /^wss?:\/\//i;
|
|
5503
|
-
var MAINTAINERS_USAGE = `Usage: rig maintainers <list|add|remove> [<pubkey>] [options]
|
|
5504
|
-
|
|
5505
|
-
Manage a repo's declared maintainers (#287). Status authority is consumer-side:
|
|
5506
|
-
rig and rig-web honor an issue/PR status (kind:1630-1633) ONLY when its author
|
|
5507
|
-
is the repo owner or a declared maintainer. The owner is always an implicit
|
|
5508
|
-
maintainer; this command edits the explicit set on the kind:30617 announcement.
|
|
5509
|
-
|
|
5510
|
-
Subcommands:
|
|
5511
|
-
list show the owner + declared maintainers \u2014 FREE (relay read)
|
|
5512
|
-
add <pubkey> add a maintainer (npub or 64-char hex) \u2014 PAID: republishes
|
|
5513
|
-
the kind:30617 (permanent, non-refundable)
|
|
5514
|
-
remove <pubkey> remove a maintainer \u2014 PAID: republishes the kind:30617
|
|
5515
|
-
|
|
5516
|
-
add/remove must run under the repo OWNER's identity (only the owner's
|
|
5517
|
-
announcement is authoritative).
|
|
5518
5502
|
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
--remote <name> publish/read via this configured git remote (default: origin)
|
|
5523
|
-
--relay <url> ad-hoc relay override (exactly one for add/remove)
|
|
5524
|
-
--yes skip the fee confirmation (required when not a TTY)
|
|
5525
|
-
--json machine-readable envelope
|
|
5526
|
-
-h, --help show this help`;
|
|
5527
|
-
var MAINT_OPTIONS = {
|
|
5503
|
+
// src/cli/repo-command.ts
|
|
5504
|
+
var WS_URL_RE4 = /^wss?:\/\//i;
|
|
5505
|
+
var REPO_COMMAND_OPTIONS = {
|
|
5528
5506
|
json: { type: "boolean", default: false },
|
|
5529
5507
|
yes: { type: "boolean", default: false },
|
|
5530
5508
|
relay: { type: "string", multiple: true },
|
|
@@ -5533,7 +5511,7 @@ var MAINT_OPTIONS = {
|
|
|
5533
5511
|
owner: { type: "string" },
|
|
5534
5512
|
help: { type: "boolean", short: "h", default: false }
|
|
5535
5513
|
};
|
|
5536
|
-
function
|
|
5514
|
+
function pickRepoCommandFlags(values) {
|
|
5537
5515
|
const flags = {
|
|
5538
5516
|
json: values["json"] === true,
|
|
5539
5517
|
yes: values["yes"] === true,
|
|
@@ -5546,7 +5524,7 @@ function pickFlags(values) {
|
|
|
5546
5524
|
flags.owner = ownerToHex(values["owner"]);
|
|
5547
5525
|
return flags;
|
|
5548
5526
|
}
|
|
5549
|
-
async function
|
|
5527
|
+
async function resolveRepoContext(flags, deps) {
|
|
5550
5528
|
let repoRoot;
|
|
5551
5529
|
let toonConfig = {
|
|
5552
5530
|
relays: []
|
|
@@ -5575,6 +5553,33 @@ async function resolveContext(flags, deps) {
|
|
|
5575
5553
|
...repoRoot !== void 0 ? { repoRoot } : {}
|
|
5576
5554
|
};
|
|
5577
5555
|
}
|
|
5556
|
+
|
|
5557
|
+
// src/cli/maintainers.ts
|
|
5558
|
+
var HEX64_RE3 = /^[0-9a-f]{64}$/;
|
|
5559
|
+
var MAINTAINERS_USAGE = `Usage: rig maintainers <list|add|remove> [<pubkey>] [options]
|
|
5560
|
+
|
|
5561
|
+
Manage a repo's declared maintainers (#287). Status authority is consumer-side:
|
|
5562
|
+
rig and rig-web honor an issue/PR status (kind:1630-1633) ONLY when its author
|
|
5563
|
+
is the repo owner or a declared maintainer. The owner is always an implicit
|
|
5564
|
+
maintainer; this command edits the explicit set on the kind:30617 announcement.
|
|
5565
|
+
|
|
5566
|
+
Subcommands:
|
|
5567
|
+
list show the owner + declared maintainers \u2014 FREE (relay read)
|
|
5568
|
+
add <pubkey> add a maintainer (npub or 64-char hex) \u2014 PAID: republishes
|
|
5569
|
+
the kind:30617 (permanent, non-refundable)
|
|
5570
|
+
remove <pubkey> remove a maintainer \u2014 PAID: republishes the kind:30617
|
|
5571
|
+
|
|
5572
|
+
add/remove must run under the repo OWNER's identity (only the owner's
|
|
5573
|
+
announcement is authoritative).
|
|
5574
|
+
|
|
5575
|
+
Options:
|
|
5576
|
+
--repo-id <id> repository id / NIP-34 d-tag (default: git config)
|
|
5577
|
+
--owner <pubkey> repository owner (npub or hex; default: git config)
|
|
5578
|
+
--remote <name> publish/read via this configured git remote (default: origin)
|
|
5579
|
+
--relay <url> ad-hoc relay override (exactly one for add/remove)
|
|
5580
|
+
--yes skip the fee confirmation (required when not a TTY)
|
|
5581
|
+
--json machine-readable envelope
|
|
5582
|
+
-h, --help show this help`;
|
|
5578
5583
|
async function runMaintainers(args, deps) {
|
|
5579
5584
|
const { io: io2 } = deps;
|
|
5580
5585
|
const [sub, ...rest] = args;
|
|
@@ -5604,13 +5609,13 @@ async function runList2(args, deps) {
|
|
|
5604
5609
|
try {
|
|
5605
5610
|
const { values, positionals } = parseArgs14({
|
|
5606
5611
|
args,
|
|
5607
|
-
options:
|
|
5612
|
+
options: REPO_COMMAND_OPTIONS,
|
|
5608
5613
|
allowPositionals: true
|
|
5609
5614
|
});
|
|
5610
5615
|
if (positionals.length > 0) {
|
|
5611
5616
|
throw new Error("rig maintainers list takes no positional arguments");
|
|
5612
5617
|
}
|
|
5613
|
-
flags =
|
|
5618
|
+
flags = pickRepoCommandFlags(values);
|
|
5614
5619
|
} catch (err) {
|
|
5615
5620
|
io2.err(err instanceof Error ? err.message : String(err));
|
|
5616
5621
|
io2.err(MAINTAINERS_USAGE);
|
|
@@ -5621,7 +5626,7 @@ async function runList2(args, deps) {
|
|
|
5621
5626
|
return 0;
|
|
5622
5627
|
}
|
|
5623
5628
|
try {
|
|
5624
|
-
const ctx = await
|
|
5629
|
+
const ctx = await resolveRepoContext(flags, deps);
|
|
5625
5630
|
const wsRelays = ctx.relays.filter((url) => WS_URL_RE4.test(url));
|
|
5626
5631
|
if (wsRelays.length === 0) {
|
|
5627
5632
|
throw new InvalidRelayUrlError(
|
|
@@ -5671,10 +5676,10 @@ async function runMutate(op, args, deps) {
|
|
|
5671
5676
|
try {
|
|
5672
5677
|
const { values, positionals } = parseArgs14({
|
|
5673
5678
|
args,
|
|
5674
|
-
options:
|
|
5679
|
+
options: REPO_COMMAND_OPTIONS,
|
|
5675
5680
|
allowPositionals: true
|
|
5676
5681
|
});
|
|
5677
|
-
flags =
|
|
5682
|
+
flags = pickRepoCommandFlags(values);
|
|
5678
5683
|
if (flags.help) {
|
|
5679
5684
|
io2.out(MAINTAINERS_USAGE);
|
|
5680
5685
|
return 0;
|
|
@@ -5693,7 +5698,7 @@ async function runMutate(op, args, deps) {
|
|
|
5693
5698
|
}
|
|
5694
5699
|
let standaloneCtx;
|
|
5695
5700
|
try {
|
|
5696
|
-
const ctx = await
|
|
5701
|
+
const ctx = await resolveRepoContext(flags, deps);
|
|
5697
5702
|
if (ctx.relays.length > 1) {
|
|
5698
5703
|
io2.err(singleRelayRefusal(ctx.resolved, "Nothing was published or paid."));
|
|
5699
5704
|
return 1;
|
|
@@ -5748,7 +5753,13 @@ async function runMutate(op, args, deps) {
|
|
|
5748
5753
|
const next = op === "add" ? [...current, pubkey] : current.filter((m) => m !== pubkey);
|
|
5749
5754
|
const name = remote.name ?? ctx.repoId;
|
|
5750
5755
|
const description = remote.description ?? "";
|
|
5751
|
-
const event = buildRepoAnnouncement(
|
|
5756
|
+
const event = buildRepoAnnouncement(
|
|
5757
|
+
ctx.repoId,
|
|
5758
|
+
name,
|
|
5759
|
+
description,
|
|
5760
|
+
next,
|
|
5761
|
+
remote.payout
|
|
5762
|
+
);
|
|
5752
5763
|
const fee = (await standaloneCtx.publisher.getFeeRates()).eventFee.toString();
|
|
5753
5764
|
const action = `kind:30617 maintainers ${op} ${pubkey.slice(0, 8)}\u2026`;
|
|
5754
5765
|
if (!flags.json) {
|
|
@@ -6885,8 +6896,285 @@ async function runName(args, deps) {
|
|
|
6885
6896
|
}
|
|
6886
6897
|
}
|
|
6887
6898
|
|
|
6888
|
-
// src/cli/
|
|
6899
|
+
// src/cli/payout.ts
|
|
6889
6900
|
import { parseArgs as parseArgs16 } from "util";
|
|
6901
|
+
import { getAddress } from "viem";
|
|
6902
|
+
var PAYOUT_USAGE = `Usage: rig payout <set|clear|show> [<address>] [options]
|
|
6903
|
+
|
|
6904
|
+
Manage a repo's declared payout pointer (rig#92, part of the payout epic
|
|
6905
|
+
toon-protocol/toon-meta#391). No pointer on the kind:30617 announcement means
|
|
6906
|
+
a serving node keeps 100% of repo-scoped write fees; a pointer opts the repo
|
|
6907
|
+
into that node's declared ownerFeeShare split.
|
|
6908
|
+
|
|
6909
|
+
Subcommands:
|
|
6910
|
+
show show the declared payout pointer \u2014 FREE (relay read)
|
|
6911
|
+
set <address> declare the payout pointer (EVM address, EIP-55
|
|
6912
|
+
checksummed or all-lowercase) \u2014 PAID: republishes the
|
|
6913
|
+
kind:30617 (permanent, non-refundable). v1 accepts evm
|
|
6914
|
+
addresses only.
|
|
6915
|
+
clear remove the payout pointer \u2014 PAID: republishes the
|
|
6916
|
+
kind:30617
|
|
6917
|
+
|
|
6918
|
+
set/clear must run under the repo OWNER's identity (only the owner's
|
|
6919
|
+
announcement is authoritative).
|
|
6920
|
+
|
|
6921
|
+
Options:
|
|
6922
|
+
--repo-id <id> repository id / NIP-34 d-tag (default: git config)
|
|
6923
|
+
--owner <pubkey> repository owner (npub or hex; default: git config)
|
|
6924
|
+
--remote <name> publish/read via this configured git remote (default: origin)
|
|
6925
|
+
--relay <url> ad-hoc relay override (exactly one for set/clear)
|
|
6926
|
+
--yes skip the fee confirmation (required when not a TTY)
|
|
6927
|
+
--json machine-readable envelope
|
|
6928
|
+
-h, --help show this help`;
|
|
6929
|
+
async function runPayout(args, deps) {
|
|
6930
|
+
const { io: io2 } = deps;
|
|
6931
|
+
const [sub, ...rest] = args;
|
|
6932
|
+
switch (sub) {
|
|
6933
|
+
case "show":
|
|
6934
|
+
return runShow2(rest, deps);
|
|
6935
|
+
case "set":
|
|
6936
|
+
return runMutate2("set", rest, deps);
|
|
6937
|
+
case "clear":
|
|
6938
|
+
return runMutate2("clear", rest, deps);
|
|
6939
|
+
case "--help":
|
|
6940
|
+
case "-h":
|
|
6941
|
+
case "help":
|
|
6942
|
+
io2.out(PAYOUT_USAGE);
|
|
6943
|
+
return 0;
|
|
6944
|
+
default:
|
|
6945
|
+
io2.err(
|
|
6946
|
+
sub === void 0 ? "missing subcommand: rig payout <set|clear|show>" : `unknown rig payout subcommand: ${sub}`
|
|
6947
|
+
);
|
|
6948
|
+
io2.err(PAYOUT_USAGE);
|
|
6949
|
+
return 2;
|
|
6950
|
+
}
|
|
6951
|
+
}
|
|
6952
|
+
async function runShow2(args, deps) {
|
|
6953
|
+
const { io: io2 } = deps;
|
|
6954
|
+
let flags;
|
|
6955
|
+
try {
|
|
6956
|
+
const { values, positionals } = parseArgs16({
|
|
6957
|
+
args,
|
|
6958
|
+
options: REPO_COMMAND_OPTIONS,
|
|
6959
|
+
allowPositionals: true
|
|
6960
|
+
});
|
|
6961
|
+
if (positionals.length > 0) {
|
|
6962
|
+
throw new Error("rig payout show takes no positional arguments");
|
|
6963
|
+
}
|
|
6964
|
+
flags = pickRepoCommandFlags(values);
|
|
6965
|
+
} catch (err) {
|
|
6966
|
+
io2.err(err instanceof Error ? err.message : String(err));
|
|
6967
|
+
io2.err(PAYOUT_USAGE);
|
|
6968
|
+
return 2;
|
|
6969
|
+
}
|
|
6970
|
+
if (flags.help) {
|
|
6971
|
+
io2.out(PAYOUT_USAGE);
|
|
6972
|
+
return 0;
|
|
6973
|
+
}
|
|
6974
|
+
try {
|
|
6975
|
+
const ctx = await resolveRepoContext(flags, deps);
|
|
6976
|
+
const wsRelays = ctx.relays.filter((url) => WS_URL_RE4.test(url));
|
|
6977
|
+
if (wsRelays.length === 0) {
|
|
6978
|
+
throw new InvalidRelayUrlError(
|
|
6979
|
+
ctx.relays[0] ?? "",
|
|
6980
|
+
"reads need a ws:// or wss:// relay"
|
|
6981
|
+
);
|
|
6982
|
+
}
|
|
6983
|
+
const remote = await fetchRemoteState({
|
|
6984
|
+
relayUrls: wsRelays,
|
|
6985
|
+
ownerPubkey: ctx.owner,
|
|
6986
|
+
repoId: ctx.repoId,
|
|
6987
|
+
...deps.webSocketFactory ? { webSocketFactory: deps.webSocketFactory } : {}
|
|
6988
|
+
});
|
|
6989
|
+
const payout = remote.payout;
|
|
6990
|
+
if (flags.json) {
|
|
6991
|
+
io2.emitJson({
|
|
6992
|
+
command: "payout show",
|
|
6993
|
+
repoAddr: { ownerPubkey: ctx.owner, repoId: ctx.repoId },
|
|
6994
|
+
announced: remote.announced,
|
|
6995
|
+
payout
|
|
6996
|
+
});
|
|
6997
|
+
return 0;
|
|
6998
|
+
}
|
|
6999
|
+
io2.out(`Repo: 30617:${ctx.owner}:${ctx.repoId}`);
|
|
7000
|
+
if (!remote.announced) {
|
|
7001
|
+
io2.out("No kind:30617 announcement found \u2014 no payout pointer.");
|
|
7002
|
+
return 0;
|
|
7003
|
+
}
|
|
7004
|
+
io2.out(
|
|
7005
|
+
payout === null ? "Payout: none (the serving node keeps 100% of repo-scoped write fees)" : `Payout: ${payout.chain} ${payout.address}`
|
|
7006
|
+
);
|
|
7007
|
+
return 0;
|
|
7008
|
+
} catch (err) {
|
|
7009
|
+
return emitCliError(io2, flags.json, "payout show", err);
|
|
7010
|
+
}
|
|
7011
|
+
}
|
|
7012
|
+
async function runMutate2(op, args, deps) {
|
|
7013
|
+
const { io: io2 } = deps;
|
|
7014
|
+
const command = `payout ${op}`;
|
|
7015
|
+
let flags;
|
|
7016
|
+
let nextPayout = null;
|
|
7017
|
+
try {
|
|
7018
|
+
const { values, positionals } = parseArgs16({
|
|
7019
|
+
args,
|
|
7020
|
+
options: REPO_COMMAND_OPTIONS,
|
|
7021
|
+
allowPositionals: true
|
|
7022
|
+
});
|
|
7023
|
+
flags = pickRepoCommandFlags(values);
|
|
7024
|
+
if (flags.help) {
|
|
7025
|
+
io2.out(PAYOUT_USAGE);
|
|
7026
|
+
return 0;
|
|
7027
|
+
}
|
|
7028
|
+
if (op === "set") {
|
|
7029
|
+
if (positionals.length !== 1) {
|
|
7030
|
+
throw new Error("expected exactly one <address> to set");
|
|
7031
|
+
}
|
|
7032
|
+
const raw = positionals[0];
|
|
7033
|
+
if (!isValidEvmPayoutAddress(raw)) {
|
|
7034
|
+
throw new Error(
|
|
7035
|
+
`<address> must be a valid EVM address (0x + 40 hex chars, correctly EIP-55 checksummed if mixed-case) \u2014 got ${JSON.stringify(raw)}. See toon-meta#391 (payout epic): v1 accepts evm addresses only.`
|
|
7036
|
+
);
|
|
7037
|
+
}
|
|
7038
|
+
nextPayout = { chain: "evm", address: getAddress(raw) };
|
|
7039
|
+
} else if (positionals.length !== 0) {
|
|
7040
|
+
throw new Error("rig payout clear takes no positional arguments");
|
|
7041
|
+
}
|
|
7042
|
+
} catch (err) {
|
|
7043
|
+
io2.err(err instanceof Error ? err.message : String(err));
|
|
7044
|
+
io2.err(PAYOUT_USAGE);
|
|
7045
|
+
return 2;
|
|
7046
|
+
}
|
|
7047
|
+
let standaloneCtx;
|
|
7048
|
+
try {
|
|
7049
|
+
const ctx = await resolveRepoContext(flags, deps);
|
|
7050
|
+
if (ctx.relays.length > 1) {
|
|
7051
|
+
io2.err(singleRelayRefusal(ctx.resolved, "Nothing was published or paid."));
|
|
7052
|
+
return 1;
|
|
7053
|
+
}
|
|
7054
|
+
const relayUrl = ctx.relays[0];
|
|
7055
|
+
if (relayUrl === void 0 || !WS_URL_RE4.test(relayUrl)) {
|
|
7056
|
+
throw new InvalidRelayUrlError(
|
|
7057
|
+
relayUrl ?? "",
|
|
7058
|
+
"a paid publish needs a ws:// or wss:// relay"
|
|
7059
|
+
);
|
|
7060
|
+
}
|
|
7061
|
+
const load = deps.loadStandalone ?? defaultLoadStandalone;
|
|
7062
|
+
standaloneCtx = await load({
|
|
7063
|
+
env: deps.env,
|
|
7064
|
+
cwd: deps.cwd,
|
|
7065
|
+
warn: (line) => io2.err(line),
|
|
7066
|
+
relayUrl
|
|
7067
|
+
});
|
|
7068
|
+
const identity = identityReport(standaloneCtx);
|
|
7069
|
+
if (identity.pubkey.toLowerCase() !== ctx.owner.toLowerCase()) {
|
|
7070
|
+
io2.err(
|
|
7071
|
+
`rig: only the repo owner (${ctx.owner.slice(0, 8)}\u2026) can change the payout pointer \u2014 the active identity is ${identity.pubkey.slice(0, 8)}\u2026. A non-owner republish would write your own (ignored) announcement. Nothing was published or paid.`
|
|
7072
|
+
);
|
|
7073
|
+
return 1;
|
|
7074
|
+
}
|
|
7075
|
+
const remote = await fetchRemoteState({
|
|
7076
|
+
relayUrls: [relayUrl],
|
|
7077
|
+
ownerPubkey: ctx.owner,
|
|
7078
|
+
repoId: ctx.repoId,
|
|
7079
|
+
...deps.webSocketFactory ? { webSocketFactory: deps.webSocketFactory } : {}
|
|
7080
|
+
});
|
|
7081
|
+
if (!remote.announced) {
|
|
7082
|
+
io2.err(
|
|
7083
|
+
`rig: 30617:${ctx.owner.slice(0, 8)}\u2026:${ctx.repoId} has no announcement yet \u2014 run \`rig push\` to publish the repo (with its real name/description) before managing the payout pointer. Nothing was published or paid.`
|
|
7084
|
+
);
|
|
7085
|
+
return 1;
|
|
7086
|
+
}
|
|
7087
|
+
const current = remote.payout;
|
|
7088
|
+
if (nextPayout !== null && current !== null && current.chain === nextPayout.chain && current.address === nextPayout.address) {
|
|
7089
|
+
io2.err(
|
|
7090
|
+
`rig: payout is already set to ${current.chain} ${current.address} \u2014 nothing to do (not published).`
|
|
7091
|
+
);
|
|
7092
|
+
return 0;
|
|
7093
|
+
}
|
|
7094
|
+
if (op === "clear" && current === null) {
|
|
7095
|
+
io2.err("rig: no payout pointer is set \u2014 nothing to do (not published).");
|
|
7096
|
+
return 0;
|
|
7097
|
+
}
|
|
7098
|
+
const name = remote.name ?? ctx.repoId;
|
|
7099
|
+
const description = remote.description ?? "";
|
|
7100
|
+
const event = buildRepoAnnouncement(
|
|
7101
|
+
ctx.repoId,
|
|
7102
|
+
name,
|
|
7103
|
+
description,
|
|
7104
|
+
remote.maintainers,
|
|
7105
|
+
nextPayout
|
|
7106
|
+
);
|
|
7107
|
+
const fee = (await standaloneCtx.publisher.getFeeRates()).eventFee.toString();
|
|
7108
|
+
const action = nextPayout ? `kind:30617 payout set ${nextPayout.chain} ${nextPayout.address}` : "kind:30617 payout clear";
|
|
7109
|
+
if (!flags.json) {
|
|
7110
|
+
io2.out(`Republish ${action}`);
|
|
7111
|
+
io2.out(`Repo: 30617:${ctx.owner}:${ctx.repoId}`);
|
|
7112
|
+
io2.out(
|
|
7113
|
+
`Payout after: ${nextPayout ? `${nextPayout.chain} ${nextPayout.address}` : "(none)"}`
|
|
7114
|
+
);
|
|
7115
|
+
io2.out(`Fee: ${feeLabel(fee)}. Writes are permanent and non-refundable.`);
|
|
7116
|
+
}
|
|
7117
|
+
if (!flags.yes) {
|
|
7118
|
+
if (flags.json) {
|
|
7119
|
+
io2.emitJson({
|
|
7120
|
+
command,
|
|
7121
|
+
repoAddr: { ownerPubkey: ctx.owner, repoId: ctx.repoId },
|
|
7122
|
+
identity,
|
|
7123
|
+
executed: false,
|
|
7124
|
+
feeEstimate: fee,
|
|
7125
|
+
payout: nextPayout,
|
|
7126
|
+
hint: "estimate only \u2014 re-run with --yes to publish (permanent, non-refundable)"
|
|
7127
|
+
});
|
|
7128
|
+
return 0;
|
|
7129
|
+
}
|
|
7130
|
+
if (!io2.isInteractive) {
|
|
7131
|
+
io2.err(
|
|
7132
|
+
"refusing to spend channel funds without confirmation in a non-interactive session \u2014 re-run with --yes (or use --json for an estimate)"
|
|
7133
|
+
);
|
|
7134
|
+
return 1;
|
|
7135
|
+
}
|
|
7136
|
+
const proceed = await io2.confirm(
|
|
7137
|
+
`Proceed with paid republish (${feeLabel(fee)})? [y/N] `
|
|
7138
|
+
);
|
|
7139
|
+
if (!proceed) {
|
|
7140
|
+
io2.err("aborted \u2014 nothing was published.");
|
|
7141
|
+
return 1;
|
|
7142
|
+
}
|
|
7143
|
+
}
|
|
7144
|
+
const receipt = await standaloneCtx.publisher.publishEvent(event, [
|
|
7145
|
+
relayUrl
|
|
7146
|
+
]);
|
|
7147
|
+
const result = serializeEventReceipt(event.kind, receipt);
|
|
7148
|
+
if (flags.json) {
|
|
7149
|
+
io2.emitJson({
|
|
7150
|
+
command,
|
|
7151
|
+
repoAddr: { ownerPubkey: ctx.owner, repoId: ctx.repoId },
|
|
7152
|
+
identity,
|
|
7153
|
+
executed: true,
|
|
7154
|
+
feeEstimate: fee,
|
|
7155
|
+
payout: nextPayout,
|
|
7156
|
+
result
|
|
7157
|
+
});
|
|
7158
|
+
} else {
|
|
7159
|
+
io2.out(
|
|
7160
|
+
`Published ${action}: ${result.eventId} paid ${result.feePaid} base units`
|
|
7161
|
+
);
|
|
7162
|
+
}
|
|
7163
|
+
return 0;
|
|
7164
|
+
} catch (err) {
|
|
7165
|
+
return emitCliError(io2, flags.json, command, err);
|
|
7166
|
+
} finally {
|
|
7167
|
+
if (standaloneCtx) {
|
|
7168
|
+
try {
|
|
7169
|
+
await standaloneCtx.stop();
|
|
7170
|
+
} catch {
|
|
7171
|
+
}
|
|
7172
|
+
}
|
|
7173
|
+
}
|
|
7174
|
+
}
|
|
7175
|
+
|
|
7176
|
+
// src/cli/site.ts
|
|
7177
|
+
import { parseArgs as parseArgs17 } from "util";
|
|
6890
7178
|
|
|
6891
7179
|
// src/arweave-manifest.ts
|
|
6892
7180
|
var DEFAULT_INDEX = "index.html";
|
|
@@ -6977,7 +7265,7 @@ Options (publish):
|
|
|
6977
7265
|
estimate (nothing uploaded)
|
|
6978
7266
|
-h, --help show this help`;
|
|
6979
7267
|
function parseSiteArgs(args) {
|
|
6980
|
-
const { values, positionals } =
|
|
7268
|
+
const { values, positionals } = parseArgs17({
|
|
6981
7269
|
args,
|
|
6982
7270
|
options: {
|
|
6983
7271
|
index: { type: "string" },
|
|
@@ -7389,6 +7677,10 @@ Commands rig owns:
|
|
|
7389
7677
|
maintainers add <pubkey> remove republish the kind:30617 to change who may
|
|
7390
7678
|
maintainers remove <pubkey> author authoritative issue/PR status (owner is
|
|
7391
7679
|
always an implicit maintainer)
|
|
7680
|
+
payout show show the repo's declared payout pointer (free);
|
|
7681
|
+
payout set <address> set/clear republish the kind:30617 \u2014 no pointer
|
|
7682
|
+
payout clear means the serving node keeps 100% of
|
|
7683
|
+
repo-scoped write fees (v1: evm addresses only)
|
|
7392
7684
|
fund drip devnet faucet funds to this identity's
|
|
7393
7685
|
wallet (free); on other networks prints the
|
|
7394
7686
|
address(es) to fund externally
|
|
@@ -7396,10 +7688,11 @@ Commands rig owns:
|
|
|
7396
7688
|
(free \u2014 chain reads and local state only)
|
|
7397
7689
|
chain [set <c>|unset] choose which chain/USDC settles paid writes
|
|
7398
7690
|
(evm|sol|mina); free \u2014 reads/writes local config
|
|
7399
|
-
entry
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7691
|
+
entry <url> | entry clear choose the connector that prices and settles paid
|
|
7692
|
+
writes \u2014 one URL is the whole configuration, since
|
|
7693
|
+
its GET /ilp describes it; --relay <wss-url>
|
|
7694
|
+
records the free-read relay beside it; free \u2014
|
|
7695
|
+
writes local config
|
|
7403
7696
|
name buy <name> ArNS naming (#367): buy points a human name at an
|
|
7404
7697
|
name set <name> <txId> Arweave txId, owned + paid by this identity's
|
|
7405
7698
|
name status <name> Solana key. buy spends mARIO on Solana via the
|
|
@@ -7482,6 +7775,8 @@ async function dispatch(argv2, deps) {
|
|
|
7482
7775
|
return runPr(rest, deps);
|
|
7483
7776
|
case "maintainers":
|
|
7484
7777
|
return runMaintainers(rest, deps);
|
|
7778
|
+
case "payout":
|
|
7779
|
+
return runPayout(rest, deps);
|
|
7485
7780
|
case "channel":
|
|
7486
7781
|
return runChannel(rest, deps);
|
|
7487
7782
|
case "channels":
|
|
@@ -7573,6 +7868,7 @@ var RIG_OWNED_VERBS = /* @__PURE__ */ new Set([
|
|
|
7573
7868
|
"comment",
|
|
7574
7869
|
"pr",
|
|
7575
7870
|
"maintainers",
|
|
7871
|
+
"payout",
|
|
7576
7872
|
"channel",
|
|
7577
7873
|
"channels",
|
|
7578
7874
|
"fund",
|