@reppo/cli 0.1.2 → 0.3.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 +5 -5
- package/dist/bin.js +1 -1
- package/dist/chain/abis.d.ts +57 -78
- package/dist/chain/abis.d.ts.map +1 -1
- package/dist/chain/abis.js +24 -20
- package/dist/chain/abis.js.map +1 -1
- package/dist/chain/addresses.d.ts +6 -4
- package/dist/chain/addresses.d.ts.map +1 -1
- package/dist/chain/addresses.js +3 -3
- package/dist/chain/addresses.js.map +1 -1
- package/dist/chain/contracts.d.ts +9 -6
- package/dist/chain/contracts.d.ts.map +1 -1
- package/dist/chain/contracts.js +3 -3
- package/dist/chain/contracts.js.map +1 -1
- package/dist/chain/errors.d.ts.map +1 -1
- package/dist/chain/errors.js +30 -4
- package/dist/chain/errors.js.map +1 -1
- package/dist/commands/claim-emissions.d.ts.map +1 -1
- package/dist/commands/claim-emissions.js +17 -38
- package/dist/commands/claim-emissions.js.map +1 -1
- package/dist/commands/mint-pod.d.ts +0 -3
- package/dist/commands/mint-pod.d.ts.map +1 -1
- package/dist/commands/mint-pod.js +117 -228
- package/dist/commands/mint-pod.js.map +1 -1
- package/dist/commands/query/voting-power.js +2 -2
- package/dist/commands/register-agent.d.ts.map +1 -1
- package/dist/commands/register-agent.js +26 -30
- package/dist/commands/register-agent.js.map +1 -1
- package/dist/commands/vote.d.ts +1 -1
- package/dist/commands/vote.d.ts.map +1 -1
- package/dist/commands/vote.js +48 -31
- package/dist/commands/vote.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,31 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `reppo register-agent --name <s> --description <s>` — register a new
|
|
3
3
|
* agent identity on the Reppo platform. Returns a persistent agent
|
|
4
|
-
* id +
|
|
4
|
+
* id + apiKey (Bearer token).
|
|
5
5
|
*
|
|
6
6
|
* Endpoint: `POST https://reppo.ai/api/v1/agents/register` (no auth).
|
|
7
|
+
* Spec: https://docs.reppo.ai/api/agent/custom-agents
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
* - `reppo.ai/api/v1/agents/...` — uses the persistent `
|
|
10
|
-
* returned by this command (Bearer header). Used for
|
|
11
|
-
*
|
|
12
|
-
* - `api.reppo.xyz/...` —
|
|
13
|
-
* token (separate `reppo auth` flow, lands in v0.2 of this CLI).
|
|
9
|
+
* Two distinct agent auth surfaces on the platform:
|
|
10
|
+
* - `reppo.ai/api/v1/agents/...` — uses the persistent `apiKey`
|
|
11
|
+
* returned by this command (Bearer header). Used for the
|
|
12
|
+
* agent-scoped endpoints (POST /agents/[id]/subnets, /pods).
|
|
13
|
+
* - `api.reppo.xyz/...` — Privy / wallet-auth flow (`reppo auth`).
|
|
14
14
|
*
|
|
15
|
-
* Each call to /agents/register creates a NEW identity
|
|
16
|
-
*
|
|
17
|
-
* pods minted by the prior agent stay attributed to that prior
|
|
18
|
-
* id/wallet. Save the returned credentials.
|
|
15
|
+
* Each call to /agents/register creates a NEW identity. Re-registering
|
|
16
|
+
* does NOT recover a previous agent — save the returned credentials.
|
|
19
17
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* No private key required for registration itself — it's permissionless.
|
|
19
|
+
* The agent's on-chain wallet for minting is the user's own
|
|
20
|
+
* REPPO_PRIVATE_KEY; the platform no longer provisions one server-side.
|
|
21
|
+
* After an on-chain mint, the agent calls the agent-scoped /pods or
|
|
22
|
+
* /subnets endpoint with the resulting txHash to register metadata.
|
|
22
23
|
*
|
|
23
24
|
* Output schema:
|
|
24
|
-
* { id,
|
|
25
|
-
*
|
|
26
|
-
* No private key required — registration is permissionless. The CLI's
|
|
27
|
-
* REPPO_PRIVATE_KEY is unused here; the agent's wallet is provisioned
|
|
28
|
-
* server-side and its credentials live in the accessToken.
|
|
25
|
+
* { id, apiKey }
|
|
29
26
|
*/
|
|
30
27
|
import { Option } from 'clipanion';
|
|
31
28
|
import { BaseCommand } from './_base.js';
|
|
@@ -83,27 +80,26 @@ export class RegisterAgentCommand extends BaseCommand {
|
|
|
83
80
|
throw cliError('PLATFORM_API_ERROR', `Registration failed: ${platformMsg}`, `If the error persists, file an issue with the request body (name + description) and the HTTP status (${response.status}).`);
|
|
84
81
|
}
|
|
85
82
|
const data = body?.data;
|
|
86
|
-
if (!data?.id || !data.
|
|
87
|
-
throw cliError('PLATFORM_API_INVALID_RESPONSE', `Reppo platform returned 200 but the response is missing expected fields (id,
|
|
83
|
+
if (!data?.id || !data.apiKey) {
|
|
84
|
+
throw cliError('PLATFORM_API_INVALID_RESPONSE', `Reppo platform returned 200 but the response is missing expected fields (id, apiKey).`, 'Capture the full HTTP response and file an issue.');
|
|
88
85
|
}
|
|
89
86
|
const result = {
|
|
90
87
|
id: data.id,
|
|
91
|
-
|
|
92
|
-
walletAddress: data.walletAddress,
|
|
88
|
+
apiKey: data.apiKey,
|
|
93
89
|
};
|
|
94
90
|
emit(result, [
|
|
95
91
|
`✓ Registered new agent "${trimmedName}"`,
|
|
96
92
|
``,
|
|
97
|
-
` id:
|
|
98
|
-
`
|
|
99
|
-
` accessToken: ${data.accessToken}`,
|
|
93
|
+
` id: ${data.id}`,
|
|
94
|
+
` apiKey: ${data.apiKey}`,
|
|
100
95
|
``,
|
|
101
96
|
`⚠ SAVE THESE CREDENTIALS NOW.`,
|
|
102
|
-
` - The
|
|
103
|
-
` - Re-running register-agent creates a NEW agent identity
|
|
104
|
-
`
|
|
105
|
-
` -
|
|
106
|
-
`
|
|
97
|
+
` - The apiKey is the agent's persistent Bearer token — don't share it.`,
|
|
98
|
+
` - Re-running register-agent creates a NEW agent identity. Pods previously`,
|
|
99
|
+
` registered by an old agent stay attributed to that old id.`,
|
|
100
|
+
` - On-chain mints use your REPPO_PRIVATE_KEY wallet. After minting, the`,
|
|
101
|
+
` platform expects an /agents/${data.id}/{pods,subnets} call with the`,
|
|
102
|
+
` resulting txHash to register the metadata.`,
|
|
107
103
|
]);
|
|
108
104
|
return 0;
|
|
109
105
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-agent.js","sourceRoot":"","sources":["../../src/commands/register-agent.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"register-agent.js","sourceRoot":"","sources":["../../src/commands/register-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAEjC,0EAA0E;AAC1E,6EAA6E;AAC7E,kEAAkE;AAClE,MAAM,eAAe,GAAG,yBAAyB,CAAC;AAYlD,MAAM,OAAO,oBAAqB,SAAQ,WAAW;IACnD,MAAM,CAAU,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAEpC,MAAM,CAAU,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;QACxC,WAAW,EAAE,sDAAsD;QACnE,QAAQ,EAAE;YACR,CAAC,sBAAsB;gBACrB,8EAA8E,CAAC;YACjF,CAAC,oDAAoD;gBACnD,gEAAgE,CAAC;SACpE;KACF,CAAC,CAAC;IAEH,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC,CAAC;IACnG,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAErG,KAAK,CAAC,OAAO;QACX,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;YAC1C,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CA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;YAED,MAAM,IAAI,GAAG,IAAI,EAAE,IAAI,CAAC;YACxB,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;gBAC9B,MAAM,QAAQ,CACZ,+BAA+B,EAC/B,uFAAuF,EACvF,mDAAmD,CACpD,CAAC;YACJ,CAAC;YAED,MAAM,MAAM,GAAG;gBACb,EAAE,EAAE,IAAI,CAAC,EAAE;gBACX,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC;YAEF,IAAI,CAAC,MAAM,EAAE;gBACX,2BAA2B,WAAW,GAAG;gBACzC,EAAE;gBACF,aAAa,IAAI,CAAC,EAAE,EAAE;gBACtB,aAAa,IAAI,CAAC,MAAM,EAAE;gBAC1B,EAAE;gBACF,+BAA+B;gBAC/B,yEAAyE;gBACzE,6EAA6E;gBAC7E,gEAAgE;gBAChE,0EAA0E;gBAC1E,mCAAmC,IAAI,CAAC,EAAE,+BAA+B;gBACzE,gDAAgD;aACjD,CAAC,CAAC;YACH,OAAO,CAAC,CAAC;QACX,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;IACH,CAAC"}
|
package/dist/commands/vote.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vote.d.ts","sourceRoot":"","sources":["../../src/commands/vote.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vote.d.ts","sourceRoot":"","sources":["../../src/commands/vote.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AASzC,qBAAa,WAAY,SAAQ,WAAW;IAC1C,OAAgB,KAAK,aAAc;IAEnC,OAAgB,KAAK,4BAUlB;IAEH,GAAG,SAA2E;IAC9E,KAAK,SAAyG;IAC9G,IAAI,UAAmC;IACvC,OAAO,UAAsC;IAC7C,cAAc,qBAAsC;IACpD,MAAM,UAAsC;IAEtC,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;CA2KjC"}
|
package/dist/commands/vote.js
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `reppo vote --pod <id> --
|
|
2
|
+
* `reppo vote --pod <id> --votes <n> --like|--dislike` — cast an
|
|
3
3
|
* on-chain vote against a creative pod. Uses REPPO_VOTER_PRIVATE_KEY
|
|
4
4
|
* if set (separates voter and publisher EOAs since publishers cannot
|
|
5
5
|
* vote on their own pods), else falls back to REPPO_PRIVATE_KEY.
|
|
6
6
|
*
|
|
7
|
+
* On PodManager V2 the second arg to `vote(podId, votes, upVote)` is
|
|
8
|
+
* the amount of voting power to spend, NOT a subnetId. The caller's
|
|
9
|
+
* subnet access is enforced inside the contract via the pod's parent
|
|
10
|
+
* subnet — the CLI no longer needs a subnetId here; if the voter
|
|
11
|
+
* lacks access the contract reverts with `VoterLacksSubnetAccess` and
|
|
12
|
+
* the decoder surfaces a structured hint.
|
|
13
|
+
*
|
|
7
14
|
* Pre-flight checks (read-only) before sending:
|
|
8
|
-
* 1.
|
|
9
|
-
* 2. Voter has
|
|
15
|
+
* 1. Pod is valid for the current epoch (PodManager.podValid)
|
|
16
|
+
* 2. Voter has at least `--votes` voting power (veREPPO)
|
|
10
17
|
* Both produce structured errors with recovery hints.
|
|
11
18
|
*
|
|
12
19
|
* Idempotency two-phase write protocol:
|
|
@@ -18,25 +25,25 @@ import { Option } from 'clipanion';
|
|
|
18
25
|
import { BaseCommand } from './_base.js';
|
|
19
26
|
import { cliError, emit } from '../output/format.js';
|
|
20
27
|
import { createClients, nextNonce } from '../chain/clients.js';
|
|
21
|
-
import { podManager,
|
|
28
|
+
import { podManager, veReppo } from '../chain/contracts.js';
|
|
22
29
|
import { decodeRevert } from '../chain/errors.js';
|
|
23
30
|
import { begin, markSubmitted, markConfirmed, markFailed, peekIdempotent } from '../state/idempotency.js';
|
|
24
31
|
const COMMAND = 'vote';
|
|
25
32
|
export class VoteCommand extends BaseCommand {
|
|
26
33
|
static paths = [['vote']];
|
|
27
34
|
static usage = BaseCommand.Usage({
|
|
28
|
-
description: 'Cast a vote on a Reppo pod
|
|
35
|
+
description: 'Cast a vote on a Reppo pod, spending voting power.',
|
|
29
36
|
examples: [
|
|
30
|
-
['Like pod 34
|
|
31
|
-
'reppo vote --pod 34 --
|
|
37
|
+
['Like pod 34 with 100 voting power',
|
|
38
|
+
'reppo vote --pod 34 --votes 100 --like'],
|
|
32
39
|
['Dislike with idempotency key',
|
|
33
|
-
'reppo vote --pod 35 --
|
|
40
|
+
'reppo vote --pod 35 --votes 50 --dislike --idempotency-key job-3858-B'],
|
|
34
41
|
['Dry-run (simulate only)',
|
|
35
|
-
'reppo vote --pod 34 --
|
|
42
|
+
'reppo vote --pod 34 --votes 100 --like --dry-run'],
|
|
36
43
|
],
|
|
37
44
|
});
|
|
38
45
|
pod = Option.String('--pod', { required: true, description: 'Pod token ID' });
|
|
39
|
-
|
|
46
|
+
votes = Option.String('--votes', { required: true, description: 'Voting power to spend (positive integer)' });
|
|
40
47
|
like = Option.Boolean('--like', false);
|
|
41
48
|
dislike = Option.Boolean('--dislike', false);
|
|
42
49
|
idempotencyKey = Option.String('--idempotency-key');
|
|
@@ -52,13 +59,22 @@ export class VoteCommand extends BaseCommand {
|
|
|
52
59
|
throw cliError('MISSING_PRIVATE_KEY', 'No signing key available.', 'Set REPPO_VOTER_PRIVATE_KEY (preferred) or REPPO_PRIVATE_KEY in env.');
|
|
53
60
|
}
|
|
54
61
|
const podId = BigInt(this.pod);
|
|
55
|
-
|
|
62
|
+
let votes;
|
|
63
|
+
try {
|
|
64
|
+
votes = BigInt(this.votes);
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
throw cliError('INVALID_VOTES', `--votes must be a positive integer; got "${this.votes}".`);
|
|
68
|
+
}
|
|
69
|
+
if (votes <= 0n) {
|
|
70
|
+
throw cliError('INVALID_VOTES', `--votes must be >= 1; got "${this.votes}".`);
|
|
71
|
+
}
|
|
56
72
|
const likeBool = this.like;
|
|
57
73
|
// Args fingerprint baked into the cache so re-using one key with
|
|
58
|
-
// different (--pod, --
|
|
74
|
+
// different (--pod, --votes, --like) is rejected with
|
|
59
75
|
// IDEMPOTENCY_ARGS_MISMATCH instead of silently returning the
|
|
60
76
|
// wrong cached result.
|
|
61
|
-
const args = { podId: podId.toString(),
|
|
77
|
+
const args = { podId: podId.toString(), votes: votes.toString(), like: likeBool };
|
|
62
78
|
// Dry-run NEVER consults or mutates the idempotency cache. A
|
|
63
79
|
// simulation is read-only by definition; returning a cached real
|
|
64
80
|
// tx hash with `simulated: true` would be a lie, and writing
|
|
@@ -82,26 +98,27 @@ export class VoteCommand extends BaseCommand {
|
|
|
82
98
|
...(cfg.rpcUrl ? { rpcUrl: cfg.rpcUrl } : {}),
|
|
83
99
|
});
|
|
84
100
|
const pm = podManager(cfg.network);
|
|
85
|
-
const sm = subnetManager(cfg.network);
|
|
86
101
|
const vr = veReppo(cfg.network);
|
|
87
|
-
// Pre-flight:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
102
|
+
// Pre-flight: pod must be valid for the current epoch. Cheaper
|
|
103
|
+
// to fail here than to send a tx that will revert with
|
|
104
|
+
// PodNotValidForEpoch.
|
|
105
|
+
const podOk = await clients.publicClient.readContract({
|
|
106
|
+
address: pm.address, abi: pm.abi, functionName: 'podValid', args: [podId],
|
|
107
|
+
});
|
|
108
|
+
if (!podOk) {
|
|
109
|
+
throw cliError('POD_NOT_VALID_FOR_EPOCH', `Pod ${podId} is not valid for the current voting epoch.`, 'Check `reppo query pod <id>` to verify validity; pod publishers may need to republish.');
|
|
93
110
|
}
|
|
94
|
-
// Pre-flight:
|
|
95
|
-
const
|
|
96
|
-
address:
|
|
97
|
-
})
|
|
98
|
-
if (
|
|
99
|
-
throw cliError('
|
|
111
|
+
// Pre-flight: voting power must cover `--votes`.
|
|
112
|
+
const power = await clients.publicClient.readContract({
|
|
113
|
+
address: vr.address, abi: vr.abi, functionName: 'votingPowerOf', args: [clients.account.address],
|
|
114
|
+
});
|
|
115
|
+
if (power < votes) {
|
|
116
|
+
throw cliError('INSUFFICIENT_VOTING_POWER', `Voter has ${power} voting power but --votes is ${votes}.`, 'Lock more REPPO with `reppo lock <amount> --duration <seconds>` to increase voting power, or pass a smaller --votes.');
|
|
100
117
|
}
|
|
101
118
|
if (this.dryRun) {
|
|
102
119
|
const sim = await clients.publicClient.simulateContract({
|
|
103
120
|
address: pm.address, abi: pm.abi, functionName: 'vote',
|
|
104
|
-
args: [podId,
|
|
121
|
+
args: [podId, votes, likeBool], account: clients.account,
|
|
105
122
|
}).catch((e) => {
|
|
106
123
|
const decoded = decodeRevert(e);
|
|
107
124
|
throw cliError(decoded.code, 'Simulation reverted', decoded.hint);
|
|
@@ -109,7 +126,7 @@ export class VoteCommand extends BaseCommand {
|
|
|
109
126
|
emit({
|
|
110
127
|
simulated: true,
|
|
111
128
|
podId: podId.toString(),
|
|
112
|
-
|
|
129
|
+
votes: votes.toString(),
|
|
113
130
|
like: likeBool,
|
|
114
131
|
voterPower: power.toString(),
|
|
115
132
|
gas: sim.request.gas?.toString() ?? null,
|
|
@@ -124,7 +141,7 @@ export class VoteCommand extends BaseCommand {
|
|
|
124
141
|
const nonce = await nextNonce(clients.publicClient, clients.account.address);
|
|
125
142
|
tx = await clients.walletClient.writeContract({
|
|
126
143
|
address: pm.address, abi: pm.abi, functionName: 'vote',
|
|
127
|
-
args: [podId,
|
|
144
|
+
args: [podId, votes, likeBool],
|
|
128
145
|
chain: clients.walletClient.chain, account: clients.account, nonce,
|
|
129
146
|
});
|
|
130
147
|
}
|
|
@@ -149,7 +166,7 @@ export class VoteCommand extends BaseCommand {
|
|
|
149
166
|
const result = {
|
|
150
167
|
txHash: tx,
|
|
151
168
|
podId: podId.toString(),
|
|
152
|
-
|
|
169
|
+
votes: votes.toString(),
|
|
153
170
|
like: likeBool,
|
|
154
171
|
voterPower: power.toString(),
|
|
155
172
|
block: receipt.blockNumber.toString(),
|
|
@@ -160,7 +177,7 @@ export class VoteCommand extends BaseCommand {
|
|
|
160
177
|
if (this.idempotencyKey)
|
|
161
178
|
await markConfirmed(this.idempotencyKey, COMMAND, args, result, tx);
|
|
162
179
|
emit(result, [
|
|
163
|
-
`✓ Voted on pod ${podId} (${likeBool ? 'like' : 'dislike'})`,
|
|
180
|
+
`✓ Voted on pod ${podId} (${likeBool ? 'like' : 'dislike'}, ${votes} votes)`,
|
|
164
181
|
` tx: ${result.basescanUrl}`,
|
|
165
182
|
` block: ${receipt.blockNumber}`,
|
|
166
183
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vote.js","sourceRoot":"","sources":["../../src/commands/vote.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"vote.js","sourceRoot":"","sources":["../../src/commands/vote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE1G,MAAM,OAAO,GAAG,MAAM,CAAC;AAEvB,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C,MAAM,CAAU,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAEnC,MAAM,CAAU,KAAK,GAAG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