@bordrless/shared 0.9.0 → 0.10.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/api.d.ts +91 -10
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/keeper.d.ts +139 -0
- package/dist/keeper.js +399 -0
- package/dist/policy.d.ts +108 -1
- package/dist/policy.js +235 -1
- package/dist/programs.d.ts +79 -0
- package/dist/programs.js +84 -0
- package/dist/rules.d.ts +353 -0
- package/dist/rules.js +949 -0
- package/dist/studio.d.ts +3 -1
- package/dist/studio.js +3 -1
- package/dist/workshop.d.ts +34 -6
- package/dist/workshop.js +8 -1
- package/package.json +1 -1
package/dist/studio.d.ts
CHANGED
|
@@ -532,7 +532,9 @@ export declare const MAX_AUTHOR_SHARE_BPS = 5000;
|
|
|
532
532
|
* The only share Studio lists with: a listed config's author gets half the creator fee of every
|
|
533
533
|
* launch someone else makes from it (nothing when the config has no creator fee). It is not the
|
|
534
534
|
* author's to choose. A config listed straight through the SDK may carry less, so the marketplace
|
|
535
|
-
* always shows the share that is on chain.
|
|
535
|
+
* always shows the share that is on chain. A Workshop builder may take nothing instead
|
|
536
|
+
* (`WORKSHOP_AUTHOR_SHARES_BPS`): its config is then made with `create_config` (author share 0) and
|
|
537
|
+
* still shown on the marketplace, with 0% to its builder.
|
|
536
538
|
*/
|
|
537
539
|
export declare const AUTHOR_SHARE_BPS = 5000;
|
|
538
540
|
/**
|
package/dist/studio.js
CHANGED
|
@@ -62,7 +62,9 @@ export const MAX_AUTHOR_SHARE_BPS = 5_000;
|
|
|
62
62
|
* The only share Studio lists with: a listed config's author gets half the creator fee of every
|
|
63
63
|
* launch someone else makes from it (nothing when the config has no creator fee). It is not the
|
|
64
64
|
* author's to choose. A config listed straight through the SDK may carry less, so the marketplace
|
|
65
|
-
* always shows the share that is on chain.
|
|
65
|
+
* always shows the share that is on chain. A Workshop builder may take nothing instead
|
|
66
|
+
* (`WORKSHOP_AUTHOR_SHARES_BPS`): its config is then made with `create_config` (author share 0) and
|
|
67
|
+
* still shown on the marketplace, with 0% to its builder.
|
|
66
68
|
*/
|
|
67
69
|
export const AUTHOR_SHARE_BPS = 5_000;
|
|
68
70
|
/**
|
package/dist/workshop.d.ts
CHANGED
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
* Bordrless's upgrade key. The builder never holds the upgrade authority.
|
|
13
13
|
* 4. **Credit**: a hook's builder makes its launch config, listed, and earns `AUTHOR_SHARE_BPS` (half)
|
|
14
14
|
* of the creator fee of every launch someone else makes with it, fixed on chain. A companion's
|
|
15
|
-
* builder is paid the same half by the companion program.
|
|
15
|
+
* builder is paid the same half by the companion program. A builder may take nothing instead
|
|
16
|
+
* (`authorShareBps` 0, the owner, 2026-10-13): a hook's config is then made unlisted on chain
|
|
17
|
+
* (`create_config`, no author share) and still shown on the shelves and the marketplace as theirs;
|
|
18
|
+
* a companion's (or a pair's) script is approved on chain naming no author (the default key).
|
|
16
19
|
*
|
|
17
20
|
* Built on Studio's backend pipeline (studio_projects: review, build, trading test, deploy,
|
|
18
21
|
* config); Studio's own pages are gone. Companions wait in a queue until the companion program's
|
|
@@ -37,16 +40,18 @@
|
|
|
37
40
|
* no author share, nothing on the Workshop's shelves; the item's page is public once matched.
|
|
38
41
|
*/
|
|
39
42
|
import type { Address, PreparedTx } from './api.ts';
|
|
40
|
-
import type
|
|
43
|
+
import { type StudioFile } from './studio.ts';
|
|
41
44
|
export type WorkshopKind = 'hook' | 'companion' | 'pair';
|
|
42
45
|
export declare const WORKSHOP_KINDS: readonly WorkshopKind[];
|
|
43
46
|
/**
|
|
44
47
|
* Which lane an item is in: `workshop` (Bordrless checks, approves and deploys it under its own key)
|
|
45
48
|
* or `reading` (the builder deployed it themselves; Bordrless reads and checks the source and, when
|
|
46
|
-
* the build matches the program on chain, its words show wherever the program is used)
|
|
47
|
-
*
|
|
49
|
+
* the build matches the program on chain, its words show wherever the program is used) or `rules`
|
|
50
|
+
* (docs/rules-lane.md §4: a composed hook, listed by its config; its program is the rules engine,
|
|
51
|
+
* its words are read from the rule set bound to the config, approved at once with no checks, no
|
|
52
|
+
* build, no trading test and no fee). Absent from older servers: read as `workshop`.
|
|
48
53
|
*/
|
|
49
|
-
export type WorkshopLane = 'workshop' | 'reading';
|
|
54
|
+
export type WorkshopLane = 'workshop' | 'reading' | 'rules';
|
|
50
55
|
export declare const WORKSHOP_LANES: readonly WorkshopLane[];
|
|
51
56
|
/**
|
|
52
57
|
* Where a submission stands: `unpaid` (taken; nothing runs until its builder pays the submission
|
|
@@ -190,7 +195,7 @@ export interface WorkshopItem {
|
|
|
190
195
|
* Null for a hook; absent from older servers.
|
|
191
196
|
*/
|
|
192
197
|
scriptApproved?: boolean | null;
|
|
193
|
-
/** Its lane (`WorkshopLane`); absent from older servers: `workshop`. A reading-lane item's `program` is the builder's own, from the start. */
|
|
198
|
+
/** Its lane (`WorkshopLane`); absent from older servers: `workshop`. A reading-lane item's `program` is the builder's own, from the start; a rules-lane item's is the rules engine and its `config` the composed config it was listed by. */
|
|
194
199
|
lane?: WorkshopLane;
|
|
195
200
|
/**
|
|
196
201
|
* A reading-lane item: whether its build's executable hash equals the code on chain (true:
|
|
@@ -198,6 +203,14 @@ export interface WorkshopItem {
|
|
|
198
203
|
* Null for a Workshop-lane item; absent from older servers.
|
|
199
204
|
*/
|
|
200
205
|
matched?: boolean | null;
|
|
206
|
+
/**
|
|
207
|
+
* What its builder takes of the creator fee of every launch someone else makes with it, bps of the
|
|
208
|
+
* fee (`WORKSHOP_AUTHOR_SHARES_BPS`): `AUTHOR_SHARE_BPS` (half), or 0 when they chose to take
|
|
209
|
+
* nothing (a hook's config made unlisted on chain, a script approved naming no author). Recorded at
|
|
210
|
+
* the submission; a hook's is chosen again at its config step, until the config is made. 0 for a
|
|
211
|
+
* reading-lane item (it pays nobody). Absent from older servers: `AUTHOR_SHARE_BPS`.
|
|
212
|
+
*/
|
|
213
|
+
authorShareBps?: number;
|
|
201
214
|
}
|
|
202
215
|
/** What a reading-lane item's match compared, and who can change the program (`WorkshopDetail.match`). */
|
|
203
216
|
export interface WorkshopMatch {
|
|
@@ -297,6 +310,8 @@ export interface WorkshopSubmitRequest {
|
|
|
297
310
|
scriptFiles?: StudioFile[];
|
|
298
311
|
/** The program's address when the builder deployed it themselves (the reading lane). */
|
|
299
312
|
program?: Address;
|
|
313
|
+
/** What its builder takes (`WORKSHOP_AUTHOR_SHARES_BPS`): `AUTHOR_SHARE_BPS` when absent, 0 to take nothing. A companion's or a pair's script is approved on chain with it; a hook's is its config step's first choice. */
|
|
314
|
+
authorShareBps?: number;
|
|
300
315
|
}
|
|
301
316
|
/**
|
|
302
317
|
* `POST /v1/workshop/:id/files`: a fix of a submission not approved yet (its checks run again). A
|
|
@@ -337,9 +352,22 @@ export interface WorkshopDeployRequest {
|
|
|
337
352
|
}
|
|
338
353
|
/** The creator fees a hook's builder may list its config with (they earn `AUTHOR_SHARE_BPS` of it). */
|
|
339
354
|
export declare const WORKSHOP_CONFIG_FEES_BPS: readonly number[];
|
|
355
|
+
/**
|
|
356
|
+
* What a Workshop builder may take of the creator fee of others' launches (the owner, 2026-10-13):
|
|
357
|
+
* `AUTHOR_SHARE_BPS` (half, the default), or nothing. Nothing in between: the shelves read "50%" or
|
|
358
|
+
* "0%" to the builder, and the backend refuses any other share (`author_share`).
|
|
359
|
+
*/
|
|
360
|
+
export declare const WORKSHOP_AUTHOR_SHARES_BPS: readonly number[];
|
|
340
361
|
/** `POST /v1/workshop/:id/config/prepare`: the builder's listed launch config on their deployed hook (a pair's: on its hook, requiring its script). */
|
|
341
362
|
export interface WorkshopConfigPrepareRequest {
|
|
342
363
|
creatorFeeBps: number;
|
|
364
|
+
/**
|
|
365
|
+
* A hook's: what its builder takes (`WORKSHOP_AUTHOR_SHARES_BPS`); the item's recorded choice when
|
|
366
|
+
* absent. 0 makes the config with `create_config` (no author share), still on the shelves and the
|
|
367
|
+
* marketplace. A pair's config never pays an author (its builder is paid by its script's approval):
|
|
368
|
+
* a pair refuses a share other than the one it was submitted with (`author_share_fixed`).
|
|
369
|
+
*/
|
|
370
|
+
authorShareBps?: number;
|
|
343
371
|
/** The address of a keypair the browser made; it signs after the wallet. */
|
|
344
372
|
config: Address;
|
|
345
373
|
}
|
package/dist/workshop.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { AUTHOR_SHARE_BPS } from "./studio.js";
|
|
1
2
|
export const WORKSHOP_KINDS = ['hook', 'companion', 'pair'];
|
|
2
|
-
export const WORKSHOP_LANES = ['workshop', 'reading'];
|
|
3
|
+
export const WORKSHOP_LANES = ['workshop', 'reading', 'rules'];
|
|
3
4
|
/** What a submission may hold: the Rust sources of Bordrless's template (its Cargo.toml and crates are Bordrless's). */
|
|
4
5
|
export const WORKSHOP_LIMITS = {
|
|
5
6
|
/** Source files, and their bytes in all (the builder's limits). */
|
|
@@ -19,3 +20,9 @@ export const workshopPathOk = (path) => WORKSHOP_PATH.test(path);
|
|
|
19
20
|
export const WORKSHOP_READING_LIMITS = { title: 48, does: 160, totalText: 80, description: 600, watch: 5, watchText: 140 };
|
|
20
21
|
/** The creator fees a hook's builder may list its config with (they earn `AUTHOR_SHARE_BPS` of it). */
|
|
21
22
|
export const WORKSHOP_CONFIG_FEES_BPS = [50, 100, 200];
|
|
23
|
+
/**
|
|
24
|
+
* What a Workshop builder may take of the creator fee of others' launches (the owner, 2026-10-13):
|
|
25
|
+
* `AUTHOR_SHARE_BPS` (half, the default), or nothing. Nothing in between: the shelves read "50%" or
|
|
26
|
+
* "0%" to the builder, and the backend refuses any other share (`author_share`).
|
|
27
|
+
*/
|
|
28
|
+
export const WORKSHOP_AUTHOR_SHARES_BPS = [AUTHOR_SHARE_BPS, 0];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bordrless/shared",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Bordrless policy (the same math as crates/bordrless-core), program addresses and the API types shared by the server and the site. No Solana dependencies.",
|
|
6
6
|
"license": "Apache-2.0",
|