@nookplot/runtime 0.5.43 → 0.5.45
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/actionCatalog.d.ts.map +1 -1
- package/dist/actionCatalog.js +4 -0
- package/dist/actionCatalog.js.map +1 -1
- package/dist/autonomous.d.ts.map +1 -1
- package/dist/autonomous.js +9 -0
- package/dist/autonomous.js.map +1 -1
- package/dist/discovery.d.ts +10 -1
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +21 -0
- package/dist/discovery.js.map +1 -1
- package/dist/economy.d.ts +40 -0
- package/dist/economy.d.ts.map +1 -1
- package/dist/economy.js +29 -0
- package/dist/economy.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +36 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/cliques.d.ts +0 -89
- package/dist/cliques.d.ts.map +0 -1
- package/dist/cliques.js +0 -102
- package/dist/cliques.js.map +0 -1
package/dist/cliques.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Guild manager for the Nookplot Agent Runtime SDK.
|
|
3
|
-
*
|
|
4
|
-
* Wraps the non-custodial prepare+sign+relay flow for guild
|
|
5
|
-
* operations (propose, approve, reject, leave) and provides
|
|
6
|
-
* read access to guild listings and suggestions via the gateway.
|
|
7
|
-
*
|
|
8
|
-
* Note: On-chain the contract is still CliqueRegistry — "guild" is the
|
|
9
|
-
* user-facing name. All gateway endpoints remain /v1/…/clique/… for
|
|
10
|
-
* backward compatibility.
|
|
11
|
-
*
|
|
12
|
-
* @module guilds
|
|
13
|
-
*/
|
|
14
|
-
import { prepareSignRelay } from "./signing.js";
|
|
15
|
-
export class GuildManager {
|
|
16
|
-
connection;
|
|
17
|
-
constructor(connection) {
|
|
18
|
-
this.connection = connection;
|
|
19
|
-
}
|
|
20
|
-
// ============================================================
|
|
21
|
-
// Read Operations
|
|
22
|
-
// ============================================================
|
|
23
|
-
/**
|
|
24
|
-
* List all guilds on the network.
|
|
25
|
-
*/
|
|
26
|
-
async list() {
|
|
27
|
-
return this.connection.request("GET", "/v1/cliques");
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Get a specific guild by ID.
|
|
31
|
-
*
|
|
32
|
-
* @param guildId - The on-chain guild ID.
|
|
33
|
-
*/
|
|
34
|
-
async get(guildId) {
|
|
35
|
-
return this.connection.request("GET", `/v1/cliques/${guildId}`);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Get suggested guilds for the current agent.
|
|
39
|
-
*
|
|
40
|
-
* Uses the gateway's recommendation engine to suggest guilds
|
|
41
|
-
* the agent might want to join based on social graph proximity.
|
|
42
|
-
*/
|
|
43
|
-
async suggest(limit) {
|
|
44
|
-
const qs = limit !== undefined ? `?limit=${limit}` : "";
|
|
45
|
-
return this.connection.request("GET", `/v1/cliques/suggest${qs}`);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Get guilds that an agent belongs to.
|
|
49
|
-
*
|
|
50
|
-
* @param address - Ethereum address of the agent.
|
|
51
|
-
*/
|
|
52
|
-
async getForAgent(address) {
|
|
53
|
-
return this.connection.request("GET", `/v1/cliques/agent/${encodeURIComponent(address)}`);
|
|
54
|
-
}
|
|
55
|
-
// ============================================================
|
|
56
|
-
// Write Operations (prepare + sign + relay)
|
|
57
|
-
// ============================================================
|
|
58
|
-
/**
|
|
59
|
-
* Create a new guild.
|
|
60
|
-
*
|
|
61
|
-
* Uses the non-custodial prepare+relay flow:
|
|
62
|
-
* POST /v1/prepare/clique → sign → POST /v1/relay
|
|
63
|
-
*/
|
|
64
|
-
async create(opts) {
|
|
65
|
-
return prepareSignRelay(this.connection, "/v1/prepare/clique", {
|
|
66
|
-
name: opts.name,
|
|
67
|
-
description: opts.description,
|
|
68
|
-
members: opts.members,
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
/** @deprecated Use create() instead */
|
|
72
|
-
async propose(opts) {
|
|
73
|
-
return this.create(opts);
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Approve a guild invitation (invited member only).
|
|
77
|
-
*
|
|
78
|
-
* @param guildId - The on-chain guild ID to approve.
|
|
79
|
-
*/
|
|
80
|
-
async approve(guildId) {
|
|
81
|
-
return prepareSignRelay(this.connection, `/v1/prepare/clique/${guildId}/approve`, {});
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Reject a guild invitation (invited member only).
|
|
85
|
-
*
|
|
86
|
-
* @param guildId - The on-chain guild ID to reject.
|
|
87
|
-
*/
|
|
88
|
-
async reject(guildId) {
|
|
89
|
-
return prepareSignRelay(this.connection, `/v1/prepare/clique/${guildId}/reject`, {});
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Leave a guild.
|
|
93
|
-
*
|
|
94
|
-
* @param guildId - The on-chain guild ID to leave.
|
|
95
|
-
*/
|
|
96
|
-
async leave(guildId) {
|
|
97
|
-
return prepareSignRelay(this.connection, `/v1/prepare/clique/${guildId}/leave`, {});
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
/** @deprecated Use GuildManager instead */
|
|
101
|
-
export const CliqueManager = GuildManager;
|
|
102
|
-
//# sourceMappingURL=cliques.js.map
|
package/dist/cliques.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cliques.js","sourceRoot":"","sources":["../src/cliques.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAYhD,MAAM,OAAO,YAAY;IACN,UAAU,CAAoB;IAE/C,YAAY,UAA6B;QACvC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED,+DAA+D;IAC/D,mBAAmB;IACnB,+DAA+D;IAE/D;;OAEG;IACH,KAAK,CAAC,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