@poa-box/agent 0.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/.env.agent.template +20 -0
- package/README.md +46 -0
- package/brain/Config/agent-config.json +14 -0
- package/brain/Config/brain-allowlist.json +20 -0
- package/brain/Identity/goals.template.md +23 -0
- package/brain/Identity/how-i-think.md +406 -0
- package/brain/Identity/who-i-am.template.md +34 -0
- package/brain/Knowledge/BOOTSTRAP.md +66 -0
- package/brain/Knowledge/audit-corpus-index.json +406 -0
- package/brain/Knowledge/discussions.json +245 -0
- package/brain/Knowledge/pop.brain.brainstorms.generated.md +48 -0
- package/brain/Knowledge/pop.brain.brainstorms.genesis.bin +0 -0
- package/brain/Knowledge/pop.brain.heuristics.snapshot.bin +0 -0
- package/brain/Knowledge/pop.brain.projects.generated.md +16 -0
- package/brain/Knowledge/pop.brain.projects.genesis.bin +0 -0
- package/brain/Knowledge/pop.brain.retros.generated.md +91 -0
- package/brain/Knowledge/pop.brain.retros.genesis.bin +0 -0
- package/brain/Knowledge/pop.brain.shared.generated.md +3811 -0
- package/brain/Knowledge/pop.brain.shared.genesis.bin +0 -0
- package/brain/Knowledge/projects.md +181 -0
- package/brain/Knowledge/risk-framework.md +90 -0
- package/brain/Knowledge/shared.md +416 -0
- package/brain/Knowledge/sprint-priorities.md +439 -0
- package/brain/Memory/.gitkeep +0 -0
- package/dist/commands/agent/daily-digest.d.ts +24 -0
- package/dist/commands/agent/daily-digest.js +336 -0
- package/dist/commands/agent/delegate.d.ts +12 -0
- package/dist/commands/agent/delegate.js +91 -0
- package/dist/commands/agent/deploy-to-org.d.ts +20 -0
- package/dist/commands/agent/deploy-to-org.js +154 -0
- package/dist/commands/agent/index.d.ts +2 -0
- package/dist/commands/agent/index.js +27 -0
- package/dist/commands/agent/init.d.ts +19 -0
- package/dist/commands/agent/init.js +303 -0
- package/dist/commands/agent/onboard.d.ts +22 -0
- package/dist/commands/agent/onboard.js +192 -0
- package/dist/commands/agent/paymaster-status.d.ts +14 -0
- package/dist/commands/agent/paymaster-status.js +130 -0
- package/dist/commands/agent/register.d.ts +21 -0
- package/dist/commands/agent/register.js +116 -0
- package/dist/commands/agent/setup-sponsorship.d.ts +22 -0
- package/dist/commands/agent/setup-sponsorship.js +154 -0
- package/dist/commands/agent/status.d.ts +12 -0
- package/dist/commands/agent/status.js +171 -0
- package/dist/commands/agent/triage.d.ts +12 -0
- package/dist/commands/agent/triage.js +503 -0
- package/dist/commands/brain/advance-stage.d.ts +42 -0
- package/dist/commands/brain/advance-stage.js +206 -0
- package/dist/commands/brain/allowlist.d.ts +30 -0
- package/dist/commands/brain/allowlist.js +274 -0
- package/dist/commands/brain/append-lesson.d.ts +55 -0
- package/dist/commands/brain/append-lesson.js +245 -0
- package/dist/commands/brain/brainstorm.d.ts +154 -0
- package/dist/commands/brain/brainstorm.js +573 -0
- package/dist/commands/brain/daemon.d.ts +31 -0
- package/dist/commands/brain/daemon.js +348 -0
- package/dist/commands/brain/doctor.d.ts +27 -0
- package/dist/commands/brain/doctor.js +497 -0
- package/dist/commands/brain/edit-lesson.d.ts +51 -0
- package/dist/commands/brain/edit-lesson.js +248 -0
- package/dist/commands/brain/import-snapshot.d.ts +68 -0
- package/dist/commands/brain/import-snapshot.js +177 -0
- package/dist/commands/brain/index.d.ts +2 -0
- package/dist/commands/brain/index.js +67 -0
- package/dist/commands/brain/list.d.ts +21 -0
- package/dist/commands/brain/list.js +83 -0
- package/dist/commands/brain/migrate-projects.d.ts +44 -0
- package/dist/commands/brain/migrate-projects.js +209 -0
- package/dist/commands/brain/migrate.d.ts +74 -0
- package/dist/commands/brain/migrate.js +306 -0
- package/dist/commands/brain/new-project.d.ts +53 -0
- package/dist/commands/brain/new-project.js +226 -0
- package/dist/commands/brain/read.d.ts +24 -0
- package/dist/commands/brain/read.js +81 -0
- package/dist/commands/brain/remove-lesson.d.ts +47 -0
- package/dist/commands/brain/remove-lesson.js +206 -0
- package/dist/commands/brain/remove-project.d.ts +36 -0
- package/dist/commands/brain/remove-project.js +177 -0
- package/dist/commands/brain/retro-file-tasks.d.ts +84 -0
- package/dist/commands/brain/retro-file-tasks.js +372 -0
- package/dist/commands/brain/retro-list.d.ts +28 -0
- package/dist/commands/brain/retro-list.js +125 -0
- package/dist/commands/brain/retro-mark-change.d.ts +58 -0
- package/dist/commands/brain/retro-mark-change.js +176 -0
- package/dist/commands/brain/retro-remove.d.ts +36 -0
- package/dist/commands/brain/retro-remove.js +142 -0
- package/dist/commands/brain/retro-respond.d.ts +56 -0
- package/dist/commands/brain/retro-respond.js +250 -0
- package/dist/commands/brain/retro-show.d.ts +23 -0
- package/dist/commands/brain/retro-show.js +100 -0
- package/dist/commands/brain/retro-start.d.ts +55 -0
- package/dist/commands/brain/retro-start.js +311 -0
- package/dist/commands/brain/search.d.ts +48 -0
- package/dist/commands/brain/search.js +190 -0
- package/dist/commands/brain/snapshot.d.ts +32 -0
- package/dist/commands/brain/snapshot.js +243 -0
- package/dist/commands/brain/status.d.ts +15 -0
- package/dist/commands/brain/status.js +166 -0
- package/dist/commands/brain/subscribe.d.ts +28 -0
- package/dist/commands/brain/subscribe.js +90 -0
- package/dist/commands/brain/tag.d.ts +46 -0
- package/dist/commands/brain/tag.js +192 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +22 -0
- package/dist/lib/brain-daemon.d.ts +126 -0
- package/dist/lib/brain-daemon.js +811 -0
- package/dist/lib/brain-membership.d.ts +58 -0
- package/dist/lib/brain-membership.js +115 -0
- package/dist/lib/brain-migrate-projects.d.ts +43 -0
- package/dist/lib/brain-migrate-projects.js +247 -0
- package/dist/lib/brain-migrate.d.ts +77 -0
- package/dist/lib/brain-migrate.js +328 -0
- package/dist/lib/brain-ops.d.ts +271 -0
- package/dist/lib/brain-ops.js +571 -0
- package/dist/lib/brain-paths.d.ts +15 -0
- package/dist/lib/brain-paths.js +33 -0
- package/dist/lib/brain-projections.d.ts +216 -0
- package/dist/lib/brain-projections.js +829 -0
- package/dist/lib/brain-schemas.d.ts +36 -0
- package/dist/lib/brain-schemas.js +316 -0
- package/dist/lib/brain-signing.d.ts +103 -0
- package/dist/lib/brain-signing.js +256 -0
- package/dist/lib/brain.d.ts +198 -0
- package/dist/lib/brain.js +1057 -0
- package/dist/pop-agent.d.ts +1 -0
- package/dist/pop-agent.js +18 -0
- package/docs/agent.md +126 -0
- package/docs/agents/brain-anti-entropy.md +127 -0
- package/docs/agents/brain-cross-device-onboarding.md +210 -0
- package/docs/agents/brain-cross-machine-smoke.md +241 -0
- package/docs/agents/brain-layer-setup.md +725 -0
- package/docs/agents/offboarding-protocol.md +188 -0
- package/docs/agents/onboarding-protocol.md +243 -0
- package/docs/agents/running-an-agent.md +200 -0
- package/docs/brain.md +560 -0
- package/package.json +61 -0
- package/scripts/apply.sh +140 -0
- package/scripts/onboard.sh +205 -0
- package/scripts/setup-agent.ts +272 -0
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* pop agent daily-digest — auto-summarize cross-agent activity for operator
|
|
4
|
+
* status checks. Task #405.
|
|
5
|
+
*
|
|
6
|
+
* Answers "what have the agents done today?" without manual git-log / subgraph
|
|
7
|
+
* digging. Pulls from git log (local) + subgraph (remote) and produces a
|
|
8
|
+
* structured summary per agent.
|
|
9
|
+
*/
|
|
10
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}) : (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
o[k2] = m[k];
|
|
20
|
+
}));
|
|
21
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
22
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
23
|
+
}) : function(o, v) {
|
|
24
|
+
o["default"] = v;
|
|
25
|
+
});
|
|
26
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
27
|
+
var ownKeys = function(o) {
|
|
28
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
29
|
+
var ar = [];
|
|
30
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
31
|
+
return ar;
|
|
32
|
+
};
|
|
33
|
+
return ownKeys(o);
|
|
34
|
+
};
|
|
35
|
+
return function (mod) {
|
|
36
|
+
if (mod && mod.__esModule) return mod;
|
|
37
|
+
var result = {};
|
|
38
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
39
|
+
__setModuleDefault(result, mod);
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
42
|
+
})();
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
exports.dailyDigestHandler = void 0;
|
|
45
|
+
const child_process_1 = require("child_process");
|
|
46
|
+
const ethers_1 = require("ethers");
|
|
47
|
+
const subgraph_1 = require("@poa-box/cli/lib/subgraph");
|
|
48
|
+
const resolve_1 = require("@poa-box/cli/lib/resolve");
|
|
49
|
+
const output = __importStar(require("@poa-box/cli/lib/output"));
|
|
50
|
+
function parseSinceDuration(since) {
|
|
51
|
+
const match = since.match(/^(\d+)\s*(h|d|m)$/i);
|
|
52
|
+
if (!match)
|
|
53
|
+
return 24 * 3600;
|
|
54
|
+
const [, numStr, unit] = match;
|
|
55
|
+
const num = parseInt(numStr, 10);
|
|
56
|
+
if (unit === 'h')
|
|
57
|
+
return num * 3600;
|
|
58
|
+
if (unit === 'd')
|
|
59
|
+
return num * 86400;
|
|
60
|
+
if (unit === 'm')
|
|
61
|
+
return num * 60;
|
|
62
|
+
return 24 * 3600;
|
|
63
|
+
}
|
|
64
|
+
const FETCH_DIGEST_DATA = `
|
|
65
|
+
query FetchDigestData($orgId: Bytes!) {
|
|
66
|
+
organization(id: $orgId) {
|
|
67
|
+
name
|
|
68
|
+
participationToken { totalSupply symbol }
|
|
69
|
+
users(first: 100) {
|
|
70
|
+
address
|
|
71
|
+
membershipStatus
|
|
72
|
+
participationTokenBalance
|
|
73
|
+
totalTasksCompleted
|
|
74
|
+
totalVotes
|
|
75
|
+
account { username }
|
|
76
|
+
}
|
|
77
|
+
hybridVoting {
|
|
78
|
+
proposals(first: 100, orderBy: proposalId, orderDirection: desc) {
|
|
79
|
+
proposalId
|
|
80
|
+
title
|
|
81
|
+
status
|
|
82
|
+
votes {
|
|
83
|
+
voter
|
|
84
|
+
voterUsername
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
taskManager {
|
|
89
|
+
projects(where: { deleted: false }, first: 100) {
|
|
90
|
+
title
|
|
91
|
+
tasks(first: 1000) {
|
|
92
|
+
taskId
|
|
93
|
+
title
|
|
94
|
+
status
|
|
95
|
+
payout
|
|
96
|
+
assignee
|
|
97
|
+
assigneeUsername
|
|
98
|
+
completer
|
|
99
|
+
completerUsername
|
|
100
|
+
createdAt
|
|
101
|
+
assignedAt
|
|
102
|
+
submittedAt
|
|
103
|
+
completedAt
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
`;
|
|
110
|
+
function getGitCommits(sinceSec) {
|
|
111
|
+
try {
|
|
112
|
+
const sinceDate = new Date(Date.now() - sinceSec * 1000).toISOString();
|
|
113
|
+
const raw = (0, child_process_1.execSync)(`git log --since="${sinceDate}" --format="%H|%an|%aI|%s" --no-merges 2>/dev/null`, { encoding: 'utf-8', timeout: 10000 }).trim();
|
|
114
|
+
if (!raw)
|
|
115
|
+
return [];
|
|
116
|
+
return raw.split('\n').map((line) => {
|
|
117
|
+
const [hash, author, date, ...msg] = line.split('|');
|
|
118
|
+
return { hash: hash.slice(0, 8), author, date, message: msg.join('|') };
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
return [];
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function getGitPRsMerged(sinceSec) {
|
|
126
|
+
try {
|
|
127
|
+
const sinceDate = new Date(Date.now() - sinceSec * 1000).toISOString();
|
|
128
|
+
const raw = (0, child_process_1.execSync)(`git log --since="${sinceDate}" --merges --format="%s" 2>/dev/null`, { encoding: 'utf-8', timeout: 10000 }).trim();
|
|
129
|
+
return raw ? raw.split('\n').filter((l) => /merge pull request|merge.*pr/i.test(l)).length : 0;
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
return 0;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
exports.dailyDigestHandler = {
|
|
136
|
+
builder: (yargs) => yargs
|
|
137
|
+
.option('since', {
|
|
138
|
+
type: 'string',
|
|
139
|
+
default: '24h',
|
|
140
|
+
describe: 'Time window: 6h, 12h, 24h, 48h, 7d',
|
|
141
|
+
})
|
|
142
|
+
.option('per-agent', {
|
|
143
|
+
type: 'boolean',
|
|
144
|
+
default: false,
|
|
145
|
+
describe: 'Group activity by agent',
|
|
146
|
+
}),
|
|
147
|
+
handler: async (argv) => {
|
|
148
|
+
const spin = output.spinner('Generating daily digest...');
|
|
149
|
+
spin.start();
|
|
150
|
+
try {
|
|
151
|
+
const sinceSec = parseSinceDuration(argv.since || '24h');
|
|
152
|
+
const sinceTs = Math.floor(Date.now() / 1000) - sinceSec;
|
|
153
|
+
const modules = await (0, resolve_1.resolveOrgModules)(argv.org, argv.chain);
|
|
154
|
+
const result = await (0, subgraph_1.query)(FETCH_DIGEST_DATA, { orgId: modules.orgId }, argv.chain);
|
|
155
|
+
const org = result.organization;
|
|
156
|
+
if (!org)
|
|
157
|
+
throw new Error('Organization not found');
|
|
158
|
+
const activeMembers = org.users.filter((u) => u.membershipStatus === 'Active');
|
|
159
|
+
const ptSupply = parseFloat(ethers_1.ethers.utils.formatEther(org.participationToken?.totalSupply || '0'));
|
|
160
|
+
// All tasks flat
|
|
161
|
+
const allTasks = (org.taskManager?.projects || []).flatMap((p) => p.tasks || []);
|
|
162
|
+
// Filter tasks by window
|
|
163
|
+
const tasksCreated = allTasks.filter((t) => parseInt(t.createdAt || '0') >= sinceTs);
|
|
164
|
+
const tasksClaimed = allTasks.filter((t) => parseInt(t.assignedAt || '0') >= sinceTs && t.assignee);
|
|
165
|
+
const tasksSubmitted = allTasks.filter((t) => parseInt(t.submittedAt || '0') >= sinceTs);
|
|
166
|
+
const tasksCompleted = allTasks.filter((t) => parseInt(t.completedAt || '0') >= sinceTs);
|
|
167
|
+
// PT earned in window
|
|
168
|
+
const ptEarnedInWindow = tasksCompleted.reduce((s, t) => s + parseFloat(ethers_1.ethers.utils.formatEther(t.payout || '0')), 0);
|
|
169
|
+
// Proposals — subgraph lacks createdAt on Proposal/Vote, so we show
|
|
170
|
+
// current state (active proposals, total votes) rather than windowed.
|
|
171
|
+
const proposals = org.hybridVoting?.proposals || [];
|
|
172
|
+
const activeProposals = proposals.filter((p) => p.status === 'Active');
|
|
173
|
+
const totalVotesCast = proposals.reduce((s, p) => s + (p.votes || []).length, 0);
|
|
174
|
+
// Pending reviews
|
|
175
|
+
const pendingReviews = allTasks.filter((t) => t.status === 'Submitted');
|
|
176
|
+
// Git activity
|
|
177
|
+
const commits = getGitCommits(sinceSec);
|
|
178
|
+
const prsMerged = getGitPRsMerged(sinceSec);
|
|
179
|
+
// Per-agent breakdown
|
|
180
|
+
const agentMap = {};
|
|
181
|
+
const ensureAgent = (addr, username) => {
|
|
182
|
+
const key = addr.toLowerCase();
|
|
183
|
+
if (!agentMap[key]) {
|
|
184
|
+
agentMap[key] = { username: username || addr.slice(0, 10), commits: 0, tasksCreated: [], tasksClaimed: [], tasksSubmitted: [], tasksCompleted: [], votescast: 0, ptEarned: 0 };
|
|
185
|
+
}
|
|
186
|
+
return agentMap[key];
|
|
187
|
+
};
|
|
188
|
+
// Map git authors to agents (best-effort)
|
|
189
|
+
for (const c of commits) {
|
|
190
|
+
// Try to match git author to an agent. ClawDAOBot is the shared bot.
|
|
191
|
+
const authorLower = c.author.toLowerCase();
|
|
192
|
+
if (authorLower === 'clawdaobot') {
|
|
193
|
+
// Task IDs in commit messages: "Task #NNN"
|
|
194
|
+
const taskMatch = c.message.match(/task\s+#?(\d+)/i);
|
|
195
|
+
if (taskMatch) {
|
|
196
|
+
const tid = taskMatch[1];
|
|
197
|
+
const task = allTasks.find((t) => String(t.taskId) === tid);
|
|
198
|
+
if (task?.assignee) {
|
|
199
|
+
ensureAgent(task.assignee, task.assigneeUsername || '').commits++;
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
// Fallback: attribute to first member matching author name
|
|
205
|
+
const member = activeMembers.find((m) => (m.account?.username || '').toLowerCase() === authorLower);
|
|
206
|
+
if (member) {
|
|
207
|
+
ensureAgent(member.address, member.account?.username || '').commits++;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
for (const t of tasksClaimed) {
|
|
211
|
+
const a = ensureAgent(t.assignee, t.assigneeUsername || '');
|
|
212
|
+
a.tasksClaimed.push(`#${t.taskId} ${t.title}`);
|
|
213
|
+
}
|
|
214
|
+
for (const t of tasksSubmitted) {
|
|
215
|
+
if (t.assignee) {
|
|
216
|
+
const a = ensureAgent(t.assignee, t.assigneeUsername || '');
|
|
217
|
+
a.tasksSubmitted.push(`#${t.taskId} ${t.title}`);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
for (const t of tasksCompleted) {
|
|
221
|
+
if (t.completer) {
|
|
222
|
+
const a = ensureAgent(t.completer, t.completerUsername || '');
|
|
223
|
+
a.tasksCompleted.push(`#${t.taskId} ${t.title}`);
|
|
224
|
+
a.ptEarned += parseFloat(ethers_1.ethers.utils.formatEther(t.payout || '0'));
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
// Attribute votes from active + recent proposals to agents
|
|
228
|
+
for (const p of proposals) {
|
|
229
|
+
for (const v of (p.votes || [])) {
|
|
230
|
+
ensureAgent(v.voter, v.voterUsername || '').votescast++;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
spin.stop();
|
|
234
|
+
const digest = {
|
|
235
|
+
org: org.name,
|
|
236
|
+
window: argv.since || '24h',
|
|
237
|
+
windowStart: new Date(sinceTs * 1000).toISOString(),
|
|
238
|
+
summary: {
|
|
239
|
+
commits: commits.length,
|
|
240
|
+
prsMerged,
|
|
241
|
+
tasksCreated: tasksCreated.length,
|
|
242
|
+
tasksClaimed: tasksClaimed.length,
|
|
243
|
+
tasksSubmitted: tasksSubmitted.length,
|
|
244
|
+
tasksCompleted: tasksCompleted.length,
|
|
245
|
+
ptEarned: Math.round(ptEarnedInWindow * 10) / 10,
|
|
246
|
+
ptSupply: Math.round(ptSupply * 10) / 10,
|
|
247
|
+
totalVotesCast,
|
|
248
|
+
activeProposals: activeProposals.length,
|
|
249
|
+
},
|
|
250
|
+
activeProposals: activeProposals.map((p) => ({
|
|
251
|
+
id: p.proposalId,
|
|
252
|
+
title: p.title,
|
|
253
|
+
status: p.status,
|
|
254
|
+
votes: (p.votes || []).length,
|
|
255
|
+
})),
|
|
256
|
+
pendingReviews: pendingReviews.map((t) => ({
|
|
257
|
+
taskId: t.taskId,
|
|
258
|
+
title: t.title,
|
|
259
|
+
assignee: t.assigneeUsername || t.assignee?.slice(0, 10),
|
|
260
|
+
})),
|
|
261
|
+
perAgent: argv['per-agent'] ? Object.values(agentMap) : undefined,
|
|
262
|
+
blocked: [
|
|
263
|
+
'Content distribution credentials (Twitter/Mirror) — Hudson-gated',
|
|
264
|
+
'Branch protection on main — requires repo admin (task #402)',
|
|
265
|
+
'Cross-org vouching (tasks #230, #277) — Hudson-gated',
|
|
266
|
+
],
|
|
267
|
+
};
|
|
268
|
+
if (output.isJsonMode()) {
|
|
269
|
+
output.json(digest);
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
console.log('');
|
|
273
|
+
console.log(` Daily Digest — ${org.name} (last ${argv.since || '24h'})`);
|
|
274
|
+
console.log(' ══════════════════════════════════════════');
|
|
275
|
+
console.log('');
|
|
276
|
+
console.log(' Activity Summary');
|
|
277
|
+
console.log(' ────────────────');
|
|
278
|
+
console.log(` Commits: ${commits.length}`);
|
|
279
|
+
if (prsMerged > 0)
|
|
280
|
+
console.log(` PRs merged: ${prsMerged}`);
|
|
281
|
+
console.log(` Tasks created: ${tasksCreated.length}`);
|
|
282
|
+
console.log(` Tasks claimed: ${tasksClaimed.length}`);
|
|
283
|
+
console.log(` Tasks submitted: ${tasksSubmitted.length}`);
|
|
284
|
+
console.log(` Tasks completed: ${tasksCompleted.length} (${ptEarnedInWindow.toFixed(1)} PT earned)`);
|
|
285
|
+
console.log(` Total votes (all): ${totalVotesCast}`);
|
|
286
|
+
console.log(` PT supply: ${ptSupply.toFixed(1)}`);
|
|
287
|
+
if (activeProposals.length > 0) {
|
|
288
|
+
console.log('');
|
|
289
|
+
console.log(' Active Proposals');
|
|
290
|
+
console.log(' ────────────────');
|
|
291
|
+
for (const p of activeProposals) {
|
|
292
|
+
console.log(` #${p.proposalId} ${p.title} (${(p.votes || []).length} votes)`);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
if (pendingReviews.length > 0) {
|
|
296
|
+
console.log('');
|
|
297
|
+
console.log(' Pending Reviews');
|
|
298
|
+
console.log(' ───────────────');
|
|
299
|
+
for (const t of pendingReviews) {
|
|
300
|
+
console.log(` #${t.taskId} "${t.title}" by ${t.assigneeUsername || t.assignee?.slice(0, 10)}`);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
if (argv['per-agent']) {
|
|
304
|
+
console.log('');
|
|
305
|
+
console.log(' Per-Agent Breakdown');
|
|
306
|
+
console.log(' ──────────────────');
|
|
307
|
+
for (const a of Object.values(agentMap)) {
|
|
308
|
+
console.log(`\n ${a.username}`);
|
|
309
|
+
console.log(` Commits: ${a.commits} | Votes: ${a.votescast} | PT earned: ${a.ptEarned.toFixed(1)}`);
|
|
310
|
+
if (a.tasksSubmitted.length > 0) {
|
|
311
|
+
console.log(' Submitted:');
|
|
312
|
+
for (const t of a.tasksSubmitted)
|
|
313
|
+
console.log(` ${t}`);
|
|
314
|
+
}
|
|
315
|
+
if (a.tasksCompleted.length > 0) {
|
|
316
|
+
console.log(' Completed (reviewed):');
|
|
317
|
+
for (const t of a.tasksCompleted)
|
|
318
|
+
console.log(` ${t}`);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
console.log('');
|
|
323
|
+
console.log(' Still Blocked');
|
|
324
|
+
console.log(' ─────────────');
|
|
325
|
+
for (const b of digest.blocked) {
|
|
326
|
+
console.log(` • ${b}`);
|
|
327
|
+
}
|
|
328
|
+
console.log('');
|
|
329
|
+
}
|
|
330
|
+
catch (err) {
|
|
331
|
+
spin.stop();
|
|
332
|
+
output.error(err.message);
|
|
333
|
+
process.exit(1);
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Argv, ArgumentsCamelCase } from 'yargs';
|
|
2
|
+
interface DelegateArgs {
|
|
3
|
+
chain?: number;
|
|
4
|
+
rpc?: string;
|
|
5
|
+
'private-key'?: string;
|
|
6
|
+
'dry-run'?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const delegateHandler: {
|
|
9
|
+
builder: (yargs: Argv) => Argv<{}>;
|
|
10
|
+
handler: (argv: ArgumentsCamelCase<DelegateArgs>) => Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.delegateHandler = void 0;
|
|
37
|
+
const accounts_1 = require("viem/accounts");
|
|
38
|
+
const sponsored_1 = require("@poa-box/cli/lib/sponsored");
|
|
39
|
+
const output = __importStar(require("@poa-box/cli/lib/output"));
|
|
40
|
+
exports.delegateHandler = {
|
|
41
|
+
builder: (yargs) => yargs,
|
|
42
|
+
handler: async (argv) => {
|
|
43
|
+
const spin = output.spinner('Setting up EIP-7702 delegation...');
|
|
44
|
+
spin.start();
|
|
45
|
+
try {
|
|
46
|
+
const key = argv.privateKey || process.env.POP_PRIVATE_KEY;
|
|
47
|
+
if (!key)
|
|
48
|
+
throw new Error('No private key configured');
|
|
49
|
+
const account = (0, accounts_1.privateKeyToAccount)(key);
|
|
50
|
+
const rpcUrl = argv.rpc || 'https://rpc.gnosischain.com';
|
|
51
|
+
// Check if already delegated
|
|
52
|
+
spin.text = 'Checking delegation status...';
|
|
53
|
+
const alreadyDelegated = await (0, sponsored_1.isDelegated)(account.address, rpcUrl);
|
|
54
|
+
if (alreadyDelegated) {
|
|
55
|
+
spin.stop();
|
|
56
|
+
if (output.isJsonMode()) {
|
|
57
|
+
output.json({ status: 'already_delegated', address: account.address, delegate: sponsored_1.EOA_DELEGATION });
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
output.info(`Already delegated to EOADelegation (${sponsored_1.EOA_DELEGATION})`);
|
|
61
|
+
}
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (argv.dryRun) {
|
|
65
|
+
spin.stop();
|
|
66
|
+
output.success('Delegation ready (dry-run)', {
|
|
67
|
+
address: account.address,
|
|
68
|
+
delegate: sponsored_1.EOA_DELEGATION,
|
|
69
|
+
action: 'Would sign EIP-7702 authorization and send delegation transaction',
|
|
70
|
+
});
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
// Delegate
|
|
74
|
+
spin.text = 'Signing EIP-7702 authorization...';
|
|
75
|
+
const txHash = await (0, sponsored_1.delegateEOA)(key, rpcUrl);
|
|
76
|
+
spin.stop();
|
|
77
|
+
output.success('EOA delegated to EOADelegation', {
|
|
78
|
+
address: account.address,
|
|
79
|
+
delegate: sponsored_1.EOA_DELEGATION,
|
|
80
|
+
txHash,
|
|
81
|
+
explorerUrl: `https://gnosisscan.io/tx/${txHash}`,
|
|
82
|
+
note: 'Your EOA can now receive sponsored UserOperations via PaymasterHub.',
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
spin.stop();
|
|
87
|
+
output.error(err.message);
|
|
88
|
+
process.exit(1);
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Argv, ArgumentsCamelCase } from 'yargs';
|
|
2
|
+
interface DeployToOrgArgs {
|
|
3
|
+
'target-org': string;
|
|
4
|
+
chain: number;
|
|
5
|
+
username?: string;
|
|
6
|
+
rpc?: string;
|
|
7
|
+
'private-key'?: string;
|
|
8
|
+
'dry-run'?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const deployToOrgHandler: {
|
|
11
|
+
builder: (yargs: Argv) => Argv<{
|
|
12
|
+
"target-org": string;
|
|
13
|
+
} & {
|
|
14
|
+
chain: number;
|
|
15
|
+
} & {
|
|
16
|
+
username: string | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
handler: (argv: ArgumentsCamelCase<DeployToOrgArgs>) => Promise<void>;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.deployToOrgHandler = void 0;
|
|
37
|
+
const ethers_1 = require("ethers");
|
|
38
|
+
const signer_1 = require("@poa-box/cli/lib/signer");
|
|
39
|
+
const networks_1 = require("@poa-box/cli/config/networks");
|
|
40
|
+
const output = __importStar(require("@poa-box/cli/lib/output"));
|
|
41
|
+
const IDENTITY_REGISTRY = '0x8004A169FB4a3325136EB29fA0ceB6D2e539a432';
|
|
42
|
+
const EOA_DELEGATION = '0x776ec88A88E86e38d54a985983377f1A2A25ef8b';
|
|
43
|
+
exports.deployToOrgHandler = {
|
|
44
|
+
builder: (yargs) => yargs
|
|
45
|
+
.option('target-org', { type: 'string', demandOption: true, describe: 'Target org name' })
|
|
46
|
+
.option('chain', { type: 'number', demandOption: true, describe: 'Target chain ID' })
|
|
47
|
+
.option('username', { type: 'string', describe: 'Username to register (if not already registered)' }),
|
|
48
|
+
handler: async (argv) => {
|
|
49
|
+
const spin = output.spinner('Preparing cross-org deployment...');
|
|
50
|
+
spin.start();
|
|
51
|
+
try {
|
|
52
|
+
const networkConfig = (0, networks_1.resolveNetworkConfig)(argv.chain);
|
|
53
|
+
const { signer } = (0, signer_1.createSigner)({ privateKey: argv.privateKey, chainId: argv.chain, rpcUrl: argv.rpc });
|
|
54
|
+
const provider = new ethers_1.ethers.providers.JsonRpcProvider(networkConfig.resolvedRpc);
|
|
55
|
+
const steps = [];
|
|
56
|
+
// Step 1: Check wallet balance on target chain
|
|
57
|
+
spin.text = 'Checking wallet balance...';
|
|
58
|
+
const balance = await provider.getBalance(signer.address);
|
|
59
|
+
const balanceEth = ethers_1.ethers.utils.formatEther(balance);
|
|
60
|
+
const hasGas = balance.gt(ethers_1.ethers.utils.parseEther('0.001'));
|
|
61
|
+
steps.push({
|
|
62
|
+
step: 'Wallet balance',
|
|
63
|
+
status: hasGas ? 'OK' : 'NEEDS_FUNDING',
|
|
64
|
+
detail: `${balanceEth} ${networkConfig.nativeCurrency.symbol}`,
|
|
65
|
+
});
|
|
66
|
+
// Step 2: Check ERC-8004 registration on target chain
|
|
67
|
+
spin.text = 'Checking ERC-8004 identity...';
|
|
68
|
+
const registryAbi = ['function balanceOf(address) view returns (uint256)'];
|
|
69
|
+
const registry = new ethers_1.ethers.Contract(IDENTITY_REGISTRY, registryAbi, provider);
|
|
70
|
+
let hasIdentity = false;
|
|
71
|
+
try {
|
|
72
|
+
const idBalance = await registry.balanceOf(signer.address);
|
|
73
|
+
hasIdentity = idBalance.gt(0);
|
|
74
|
+
}
|
|
75
|
+
catch { /* registry might not exist on this chain */ }
|
|
76
|
+
steps.push({
|
|
77
|
+
step: 'ERC-8004 identity',
|
|
78
|
+
status: hasIdentity ? 'REGISTERED' : 'NOT_REGISTERED',
|
|
79
|
+
detail: hasIdentity ? 'Agent identity exists on target chain' : 'Run pop agent register --chain ' + argv.chain,
|
|
80
|
+
});
|
|
81
|
+
// Step 3: Check delegation
|
|
82
|
+
spin.text = 'Checking EIP-7702 delegation...';
|
|
83
|
+
let isDelegated = false;
|
|
84
|
+
try {
|
|
85
|
+
const code = await provider.getCode(signer.address);
|
|
86
|
+
isDelegated = code.length > 2 && code.startsWith('0xef0100');
|
|
87
|
+
}
|
|
88
|
+
catch { /* not delegated */ }
|
|
89
|
+
steps.push({
|
|
90
|
+
step: 'EIP-7702 delegation',
|
|
91
|
+
status: isDelegated ? 'DELEGATED' : 'NOT_DELEGATED',
|
|
92
|
+
detail: isDelegated ? 'EOA delegated to EOADelegation' : 'Run pop agent delegate --chain ' + argv.chain,
|
|
93
|
+
});
|
|
94
|
+
// Step 4: Check if org exists on target chain
|
|
95
|
+
spin.text = 'Checking target org...';
|
|
96
|
+
const orgQuery = `query($name: String!) { organizations(where: { name: $name }, first: 1) { id name users(first: 100) { address membershipStatus account { username } } } }`;
|
|
97
|
+
const { queryAllChains } = require('@poa-box/cli/lib/subgraph');
|
|
98
|
+
let orgFound = false;
|
|
99
|
+
let isMember = false;
|
|
100
|
+
let orgMembers = 0;
|
|
101
|
+
for (const r of await queryAllChains(orgQuery, { name: argv.targetOrg })) {
|
|
102
|
+
const org = r.data?.organizations?.[0];
|
|
103
|
+
if (org && r.chainId === argv.chain) {
|
|
104
|
+
orgFound = true;
|
|
105
|
+
orgMembers = org.users?.length || 0;
|
|
106
|
+
isMember = (org.users || []).some((u) => u.address?.toLowerCase() === signer.address.toLowerCase());
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
steps.push({
|
|
110
|
+
step: 'Target org',
|
|
111
|
+
status: orgFound ? (isMember ? 'MEMBER' : 'FOUND') : 'NOT_FOUND',
|
|
112
|
+
detail: orgFound ? `${argv.targetOrg} (${orgMembers} members)${isMember ? ' — already a member!' : ''}` : `${argv.targetOrg} not found on chain ${argv.chain}`,
|
|
113
|
+
});
|
|
114
|
+
spin.stop();
|
|
115
|
+
// Summary
|
|
116
|
+
const ready = hasGas && orgFound;
|
|
117
|
+
const needsAction = steps.filter(s => !['OK', 'REGISTERED', 'DELEGATED', 'MEMBER', 'FOUND'].includes(s.status));
|
|
118
|
+
if (output.isJsonMode()) {
|
|
119
|
+
output.json({ targetOrg: argv.targetOrg, chain: argv.chain, address: signer.address, steps, ready, needsAction: needsAction.length });
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
console.log('');
|
|
123
|
+
console.log(` Cross-Org Deployment: ${signer.address.slice(0, 10)}... → ${argv.targetOrg}`);
|
|
124
|
+
console.log(' ' + '═'.repeat(50));
|
|
125
|
+
for (const s of steps) {
|
|
126
|
+
const icon = ['OK', 'REGISTERED', 'DELEGATED', 'MEMBER'].includes(s.status) ? '✓' : s.status === 'FOUND' ? '○' : '✗';
|
|
127
|
+
console.log(` ${icon} ${s.step}: ${s.detail}`);
|
|
128
|
+
}
|
|
129
|
+
console.log('');
|
|
130
|
+
if (isMember) {
|
|
131
|
+
console.log(' ✓ Already a member of this org!');
|
|
132
|
+
}
|
|
133
|
+
else if (ready) {
|
|
134
|
+
console.log(' Ready to deploy. Next steps:');
|
|
135
|
+
console.log(` 1. Ask a ${argv.targetOrg} member to vouch for you`);
|
|
136
|
+
console.log(` 2. pop vouch claim --hat <hat-id> --chain ${argv.chain}`);
|
|
137
|
+
if (!hasIdentity)
|
|
138
|
+
console.log(` 3. pop agent register --name <name> --chain ${argv.chain}`);
|
|
139
|
+
if (!isDelegated)
|
|
140
|
+
console.log(` ${hasIdentity ? '3' : '4'}. pop agent delegate --chain ${argv.chain}`);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
console.log(' Not ready. Fix issues marked ✗ above.');
|
|
144
|
+
}
|
|
145
|
+
console.log('');
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
catch (err) {
|
|
149
|
+
spin.stop();
|
|
150
|
+
output.error(err.message);
|
|
151
|
+
process.exit(1);
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerAgentCommands = registerAgentCommands;
|
|
4
|
+
const status_1 = require("./status");
|
|
5
|
+
const triage_1 = require("./triage");
|
|
6
|
+
const register_1 = require("./register");
|
|
7
|
+
const delegate_1 = require("./delegate");
|
|
8
|
+
const setup_sponsorship_1 = require("./setup-sponsorship");
|
|
9
|
+
const paymaster_status_1 = require("./paymaster-status");
|
|
10
|
+
const onboard_1 = require("./onboard");
|
|
11
|
+
const deploy_to_org_1 = require("./deploy-to-org");
|
|
12
|
+
const init_1 = require("./init");
|
|
13
|
+
const daily_digest_1 = require("./daily-digest");
|
|
14
|
+
function registerAgentCommands(yargs) {
|
|
15
|
+
return yargs
|
|
16
|
+
.command('status', 'Show agent operational status and action items', status_1.agentStatusHandler.builder, status_1.agentStatusHandler.handler)
|
|
17
|
+
.command('triage', 'Prioritized action plan for current heartbeat', triage_1.triageHandler.builder, triage_1.triageHandler.handler)
|
|
18
|
+
.command('daily-digest', 'Summarize cross-agent activity for operator status checks', daily_digest_1.dailyDigestHandler.builder, daily_digest_1.dailyDigestHandler.handler)
|
|
19
|
+
.command('register', 'Register agent identity on ERC-8004', register_1.registerHandler.builder, register_1.registerHandler.handler)
|
|
20
|
+
.command('delegate', 'Set up EIP-7702 delegation for gas sponsorship', delegate_1.delegateHandler.builder, delegate_1.delegateHandler.handler)
|
|
21
|
+
.command('setup-sponsorship', 'Set up full gas sponsorship (delegate + budget + fee caps)', setup_sponsorship_1.setupSponsorshipHandler.builder, setup_sponsorship_1.setupSponsorshipHandler.handler)
|
|
22
|
+
.command('paymaster-status', 'Show gas sponsorship status (budgets, deposits, fee caps)', paymaster_status_1.paymasterStatusHandler.builder, paymaster_status_1.paymasterStatusHandler.handler)
|
|
23
|
+
.command('onboard', 'Complete agent onboarding: register + delegate + identity + brain', onboard_1.onboardHandler.builder, onboard_1.onboardHandler.handler)
|
|
24
|
+
.command('deploy-to-org', 'Check readiness for cross-org deployment', deploy_to_org_1.deployToOrgHandler.builder, deploy_to_org_1.deployToOrgHandler.handler)
|
|
25
|
+
.command('init', 'Initialize a new agent (brain files, wallet, bootstrap checklist)', init_1.initHandler.builder, init_1.initHandler.handler)
|
|
26
|
+
.demandCommand(1, 'Please specify an agent action');
|
|
27
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Argv, ArgumentsCamelCase } from 'yargs';
|
|
2
|
+
interface InitArgs {
|
|
3
|
+
org: string;
|
|
4
|
+
chain: number;
|
|
5
|
+
username?: string;
|
|
6
|
+
'hat-id'?: string;
|
|
7
|
+
home?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const initHandler: {
|
|
10
|
+
builder: (yargs: Argv) => Argv<{
|
|
11
|
+
username: string | undefined;
|
|
12
|
+
} & {
|
|
13
|
+
"hat-id": string | undefined;
|
|
14
|
+
} & {
|
|
15
|
+
home: string | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
handler: (argv: ArgumentsCamelCase<InitArgs>) => Promise<void>;
|
|
18
|
+
};
|
|
19
|
+
export {};
|