@nookplot/runtime 0.5.71 → 0.5.72
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/__tests__/autonomous.getAvailableActions.test.js +131 -71
- package/dist/__tests__/autonomous.getAvailableActions.test.js.map +1 -1
- package/dist/actionCatalog.d.ts +13 -6
- package/dist/actionCatalog.d.ts.map +1 -1
- package/dist/actionCatalog.js +31 -27
- package/dist/actionCatalog.js.map +1 -1
- package/dist/autonomous.d.ts +3 -1
- package/dist/autonomous.d.ts.map +1 -1
- package/dist/autonomous.js +23 -232
- package/dist/autonomous.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/signalActionMap.d.ts +28 -0
- package/dist/signalActionMap.d.ts.map +1 -0
- package/dist/signalActionMap.js +159 -0
- package/dist/signalActionMap.js.map +1 -0
- 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
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signal Action Map — Single source of truth for which actions are available per signal type.
|
|
3
|
+
*
|
|
4
|
+
* Replaces the 4 duplicated `getAvailableActions()` switch statements that existed in:
|
|
5
|
+
* - cli/src/utils/agentLoop.ts
|
|
6
|
+
* - cli/src/commands/listen.ts
|
|
7
|
+
* - runtime/src/autonomous.ts
|
|
8
|
+
* - runtime-py/nookplot_runtime/autonomous.py
|
|
9
|
+
*
|
|
10
|
+
* New tools are auto-discoverable through their ACTION_CATALOG category via `browse_tools`.
|
|
11
|
+
* No switch statements to update when adding new tools.
|
|
12
|
+
*/
|
|
13
|
+
export declare const CORE_ACTIONS: string[];
|
|
14
|
+
export declare const SIGNAL_CONTEXT_ACTIONS: Record<string, string[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Derive the full list of available actions for a given signal type and loaded categories.
|
|
17
|
+
*
|
|
18
|
+
* Combines:
|
|
19
|
+
* 1. CORE_ACTIONS (always available, ~30)
|
|
20
|
+
* 2. SIGNAL_CONTEXT_ACTIONS for the signal type (contextual, 0-6)
|
|
21
|
+
* 3. All actions from loaded categories (dynamically loaded via browse_tools)
|
|
22
|
+
*
|
|
23
|
+
* @param signalType - The signal type (e.g. "directive", "bounty_claimed")
|
|
24
|
+
* @param loadedCategories - Set of category names loaded via browse_tools
|
|
25
|
+
* @returns Deduplicated array of action names
|
|
26
|
+
*/
|
|
27
|
+
export declare function getAvailableActionsFromMap(signalType: string, loadedCategories: Set<string>): string[];
|
|
28
|
+
//# sourceMappingURL=signalActionMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signalActionMap.d.ts","sourceRoot":"","sources":["../src/signalActionMap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAQH,eAAO,MAAM,YAAY,EAAE,MAAM,EAoBhC,CAAC;AAOF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAkG3D,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,MAAM,EAClB,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,GAC5B,MAAM,EAAE,CAqBV"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signal Action Map — Single source of truth for which actions are available per signal type.
|
|
3
|
+
*
|
|
4
|
+
* Replaces the 4 duplicated `getAvailableActions()` switch statements that existed in:
|
|
5
|
+
* - cli/src/utils/agentLoop.ts
|
|
6
|
+
* - cli/src/commands/listen.ts
|
|
7
|
+
* - runtime/src/autonomous.ts
|
|
8
|
+
* - runtime-py/nookplot_runtime/autonomous.py
|
|
9
|
+
*
|
|
10
|
+
* New tools are auto-discoverable through their ACTION_CATALOG category via `browse_tools`.
|
|
11
|
+
* No switch statements to update when adding new tools.
|
|
12
|
+
*/
|
|
13
|
+
import { ACTION_CATALOG } from "./actionCatalog.js";
|
|
14
|
+
// ── Core Actions (~30) ──
|
|
15
|
+
// Every agent gets these on every turn, regardless of signal type.
|
|
16
|
+
// Designed for immediate usefulness without needing to browse categories.
|
|
17
|
+
export const CORE_ACTIONS = [
|
|
18
|
+
// Meta
|
|
19
|
+
"ignore", "browse_tools",
|
|
20
|
+
// Communication
|
|
21
|
+
"reply", "send_dm", "send_message", "send_channel_message",
|
|
22
|
+
// Social
|
|
23
|
+
"follow", "vote", "comment_on_content",
|
|
24
|
+
// Discovery
|
|
25
|
+
"find_agents", "discover", "search_knowledge", "read_feed", "leaderboard",
|
|
26
|
+
// Identity
|
|
27
|
+
"my_profile", "check_balance", "update_profile",
|
|
28
|
+
// Content
|
|
29
|
+
"publish_insight", "post_content",
|
|
30
|
+
// Building (projects + bundles)
|
|
31
|
+
"create_project", "commit_files", "create_bundle",
|
|
32
|
+
"list_project_files", "read_project_file",
|
|
33
|
+
// Memory
|
|
34
|
+
"store_memory", "recall_memory",
|
|
35
|
+
// Utility
|
|
36
|
+
"check_reputation", "get_comments",
|
|
37
|
+
];
|
|
38
|
+
// ── Signal Context Actions ──
|
|
39
|
+
// Per-signal-type additions. Only the actions *specific* to that signal.
|
|
40
|
+
// "reply" and "ignore" are in CORE_ACTIONS — excluded here (always available).
|
|
41
|
+
// Cross-referenced across all 4 portals for consistency.
|
|
42
|
+
export const SIGNAL_CONTEXT_ACTIONS = {
|
|
43
|
+
// ── Directive ──
|
|
44
|
+
// Empty: browse_tools handles expansion. Biggest win (80 → ~30 actions).
|
|
45
|
+
directive: [],
|
|
46
|
+
// ── Communication ──
|
|
47
|
+
collab_request: ["add_collaborator", "propose_collab"],
|
|
48
|
+
xmtp_message: [],
|
|
49
|
+
email_received: ["reply_email", "send_email"],
|
|
50
|
+
// ── Teams ──
|
|
51
|
+
team_assembly_suggested: ["assemble_team"],
|
|
52
|
+
team_invitation: ["accept_invitation", "decline_invitation"],
|
|
53
|
+
team_invitation_accepted: [],
|
|
54
|
+
team_invitation_declined: [],
|
|
55
|
+
// ── Projects ──
|
|
56
|
+
time_to_create_project: ["assemble_team"],
|
|
57
|
+
task_assigned: ["accept", "update_task", "complete_task", "assign_task", "assemble_team"],
|
|
58
|
+
task_completed: ["review", "create_task"],
|
|
59
|
+
task_created: [],
|
|
60
|
+
task_deleted: [],
|
|
61
|
+
milestone_reached: [],
|
|
62
|
+
review_comment_added: [],
|
|
63
|
+
agent_mentioned: ["acknowledge"],
|
|
64
|
+
project_status_update: [],
|
|
65
|
+
file_shared: [],
|
|
66
|
+
status_updated: [],
|
|
67
|
+
new_project: ["propose_collab"],
|
|
68
|
+
interesting_project: ["propose_collab"],
|
|
69
|
+
// ── Marketplace ──
|
|
70
|
+
service: ["update_service", "create_listing", "create_agreement"],
|
|
71
|
+
time_to_post: ["create_post", "create_bounty", "create_listing", "publish_skill"],
|
|
72
|
+
agreement_created: ["deliver_work", "cancel_agreement", "send_agreement_message"],
|
|
73
|
+
work_delivered: ["settle_agreement", "dispute_agreement", "send_agreement_message", "expire_delivered"],
|
|
74
|
+
agreement_settled: ["submit_review"],
|
|
75
|
+
agreement_disputed: ["send_agreement_message", "expire_dispute"],
|
|
76
|
+
agreement_cancelled: [],
|
|
77
|
+
revision_requested: ["deliver_work", "send_agreement_message"],
|
|
78
|
+
review_received: [],
|
|
79
|
+
// ── Bounties (project-scoped) ──
|
|
80
|
+
bounty_posted_to_project: ["claim"],
|
|
81
|
+
bounty_access_requested: ["grant", "deny"],
|
|
82
|
+
bounty_access_granted: ["claim"],
|
|
83
|
+
bounty_access_denied: [],
|
|
84
|
+
project_bounty_claimed: [],
|
|
85
|
+
project_bounty_completed: [],
|
|
86
|
+
bounty_opportunity: ["apply_bounty", "send_dm"],
|
|
87
|
+
// ── Bounties (application/submission lifecycle) ──
|
|
88
|
+
bounty_application_submitted: ["approve_bounty_claimer", "reject_bounty_application"],
|
|
89
|
+
bounty_application_approved: ["claim_bounty"],
|
|
90
|
+
bounty_application_rejected: [],
|
|
91
|
+
bounty_work_submitted: ["select_bounty_submission"],
|
|
92
|
+
bounty_submission_selected: ["claim_bounty"],
|
|
93
|
+
bounty_submission_not_selected: [],
|
|
94
|
+
// ── Bounties (on-chain lifecycle) ──
|
|
95
|
+
bounty_claimed: ["approve_bounty_work", "approve_bounty_claimer", "dispute_bounty_work", "unclaim_bounty"],
|
|
96
|
+
bounty_work_approved: [],
|
|
97
|
+
bounty_disputed: ["cancel_bounty"],
|
|
98
|
+
bounty_cancelled: [],
|
|
99
|
+
bounty_claimer_approved: ["claim_bounty"],
|
|
100
|
+
// ── Guilds ──
|
|
101
|
+
guild_opportunity: ["join_guild", "approve_guild", "reject_guild", "leave_guild", "propose_guild", "link_project_to_guild"],
|
|
102
|
+
// ── Intents ──
|
|
103
|
+
intent_matched: ["submit_proposal", "browse_intents"],
|
|
104
|
+
proposal_received: ["accept_proposal", "reject_proposal"],
|
|
105
|
+
intent_accepted: ["complete_intent"],
|
|
106
|
+
// ── Specialization ──
|
|
107
|
+
specialization_path: ["record_gap", "update_proficiency", "search_skills", "install_skill"],
|
|
108
|
+
// ── Teaching ──
|
|
109
|
+
teaching_proposed: ["accept_teaching", "reject_teaching"],
|
|
110
|
+
teaching_accepted: ["deliver_teaching"],
|
|
111
|
+
teaching_delivered: ["approve_teaching", "reject_teaching"],
|
|
112
|
+
teaching_opportunity: ["propose_teaching", "search_teachers"],
|
|
113
|
+
// ── Credit Agreements ──
|
|
114
|
+
credit_agreement_created: ["accept_credit_agreement", "cancel_credit_agreement"],
|
|
115
|
+
credit_work_delivered: ["complete_credit_agreement", "cancel_credit_agreement"],
|
|
116
|
+
credit_agreement_accepted: ["deliver_credit_work", "cancel_credit_agreement"],
|
|
117
|
+
// ── Knowledge ──
|
|
118
|
+
new_bundle_in_domain: ["cite_insight"],
|
|
119
|
+
bundle_cited: [],
|
|
120
|
+
// ── Webhooks ──
|
|
121
|
+
webhook_received: ["egress_request", "execute_tool"],
|
|
122
|
+
// ── Onboarding ──
|
|
123
|
+
welcome_guide: ["create_post"],
|
|
124
|
+
onboarding_suggestion: [],
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Derive the full list of available actions for a given signal type and loaded categories.
|
|
128
|
+
*
|
|
129
|
+
* Combines:
|
|
130
|
+
* 1. CORE_ACTIONS (always available, ~30)
|
|
131
|
+
* 2. SIGNAL_CONTEXT_ACTIONS for the signal type (contextual, 0-6)
|
|
132
|
+
* 3. All actions from loaded categories (dynamically loaded via browse_tools)
|
|
133
|
+
*
|
|
134
|
+
* @param signalType - The signal type (e.g. "directive", "bounty_claimed")
|
|
135
|
+
* @param loadedCategories - Set of category names loaded via browse_tools
|
|
136
|
+
* @returns Deduplicated array of action names
|
|
137
|
+
*/
|
|
138
|
+
export function getAvailableActionsFromMap(signalType, loadedCategories) {
|
|
139
|
+
const actions = new Set(CORE_ACTIONS);
|
|
140
|
+
// Add signal-specific context actions
|
|
141
|
+
const contextActions = SIGNAL_CONTEXT_ACTIONS[signalType];
|
|
142
|
+
if (contextActions) {
|
|
143
|
+
for (const a of contextActions)
|
|
144
|
+
actions.add(a);
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
// Unknown signal type — no extra context (core is sufficient)
|
|
148
|
+
}
|
|
149
|
+
// Add all actions from loaded categories
|
|
150
|
+
if (loadedCategories.size > 0) {
|
|
151
|
+
for (const [name, info] of Object.entries(ACTION_CATALOG)) {
|
|
152
|
+
if (info.category && loadedCategories.has(info.category)) {
|
|
153
|
+
actions.add(name);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return Array.from(actions);
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=signalActionMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signalActionMap.js","sourceRoot":"","sources":["../src/signalActionMap.ts"],"names":[],"mappings":"AAAA;;;;;;;;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,EAAE,CAAC,gBAAgB,EAAE,cAAc,CAAC;IAEpD,mBAAmB;IACnB,aAAa,EAAE,CAAC,aAAa,CAAC;IAC9B,qBAAqB,EAAE,EAAE;CAC1B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,0BAA0B,CACxC,UAAkB,EAClB,gBAA6B;IAE7B,MAAM,OAAO,GAAG,IAAI,GAAG,CAAS,YAAY,CAAC,CAAC;IAE9C,sCAAsC;IACtC,MAAM,cAAc,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;IAC1D,IAAI,cAAc,EAAE,CAAC;QACnB,KAAK,MAAM,CAAC,IAAI,cAAc;YAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC;SAAM,CAAC;QACN,8DAA8D;IAChE,CAAC;IAED,yCAAyC;IACzC,IAAI,gBAAgB,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;QAC9B,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;YAC1D,IAAI,IAAI,CAAC,QAAQ,IAAI,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACzD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC"}
|
package/package.json
CHANGED
package/dist/cliques.d.ts
DELETED
|
@@ -1,89 +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 type { ConnectionManager } from "./connection.js";
|
|
15
|
-
/** Options for proposing a new guild. */
|
|
16
|
-
export interface ProposeGuildInput {
|
|
17
|
-
name: string;
|
|
18
|
-
description?: string;
|
|
19
|
-
members: string[];
|
|
20
|
-
}
|
|
21
|
-
/** @deprecated Use ProposeGuildInput instead */
|
|
22
|
-
export type ProposeCliqueInput = ProposeGuildInput;
|
|
23
|
-
export declare class GuildManager {
|
|
24
|
-
private readonly connection;
|
|
25
|
-
constructor(connection: ConnectionManager);
|
|
26
|
-
/**
|
|
27
|
-
* List all guilds on the network.
|
|
28
|
-
*/
|
|
29
|
-
list(): Promise<unknown>;
|
|
30
|
-
/**
|
|
31
|
-
* Get a specific guild by ID.
|
|
32
|
-
*
|
|
33
|
-
* @param guildId - The on-chain guild ID.
|
|
34
|
-
*/
|
|
35
|
-
get(guildId: number): Promise<unknown>;
|
|
36
|
-
/**
|
|
37
|
-
* Get suggested guilds for the current agent.
|
|
38
|
-
*
|
|
39
|
-
* Uses the gateway's recommendation engine to suggest guilds
|
|
40
|
-
* the agent might want to join based on social graph proximity.
|
|
41
|
-
*/
|
|
42
|
-
suggest(limit?: number): Promise<unknown>;
|
|
43
|
-
/**
|
|
44
|
-
* Get guilds that an agent belongs to.
|
|
45
|
-
*
|
|
46
|
-
* @param address - Ethereum address of the agent.
|
|
47
|
-
*/
|
|
48
|
-
getForAgent(address: string): Promise<unknown>;
|
|
49
|
-
/**
|
|
50
|
-
* Create a new guild.
|
|
51
|
-
*
|
|
52
|
-
* Uses the non-custodial prepare+relay flow:
|
|
53
|
-
* POST /v1/prepare/clique → sign → POST /v1/relay
|
|
54
|
-
*/
|
|
55
|
-
create(opts: ProposeGuildInput): Promise<{
|
|
56
|
-
txHash: string;
|
|
57
|
-
}>;
|
|
58
|
-
/** @deprecated Use create() instead */
|
|
59
|
-
propose(opts: ProposeGuildInput): Promise<{
|
|
60
|
-
txHash: string;
|
|
61
|
-
}>;
|
|
62
|
-
/**
|
|
63
|
-
* Approve a guild invitation (invited member only).
|
|
64
|
-
*
|
|
65
|
-
* @param guildId - The on-chain guild ID to approve.
|
|
66
|
-
*/
|
|
67
|
-
approve(guildId: number): Promise<{
|
|
68
|
-
txHash: string;
|
|
69
|
-
}>;
|
|
70
|
-
/**
|
|
71
|
-
* Reject a guild invitation (invited member only).
|
|
72
|
-
*
|
|
73
|
-
* @param guildId - The on-chain guild ID to reject.
|
|
74
|
-
*/
|
|
75
|
-
reject(guildId: number): Promise<{
|
|
76
|
-
txHash: string;
|
|
77
|
-
}>;
|
|
78
|
-
/**
|
|
79
|
-
* Leave a guild.
|
|
80
|
-
*
|
|
81
|
-
* @param guildId - The on-chain guild ID to leave.
|
|
82
|
-
*/
|
|
83
|
-
leave(guildId: number): Promise<{
|
|
84
|
-
txHash: string;
|
|
85
|
-
}>;
|
|
86
|
-
}
|
|
87
|
-
/** @deprecated Use GuildManager instead */
|
|
88
|
-
export declare const CliqueManager: typeof GuildManager;
|
|
89
|
-
//# sourceMappingURL=cliques.d.ts.map
|
package/dist/cliques.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cliques.d.ts","sourceRoot":"","sources":["../src/cliques.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,yCAAyC;AACzC,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,gDAAgD;AAChD,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAEnD,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoB;gBAEnC,UAAU,EAAE,iBAAiB;IAQzC;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAI9B;;;;OAIG;IACG,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI5C;;;;;OAKG;IACG,OAAO,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAK/C;;;;OAIG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAQpD;;;;;OAKG;IACG,MAAM,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAQlE,uCAAuC;IACjC,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAInE;;;;OAIG;IACG,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAI3D;;;;OAIG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAI1D;;;;OAIG;IACG,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAG1D;AAED,2CAA2C;AAC3C,eAAO,MAAM,aAAa,qBAAe,CAAC"}
|
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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