Skip to content

Commit 869e71b

Browse files
committed
fix: update @claw-network dependencies to version 0.5.3 and improve attachment handling in ClawNetTransportService
1 parent 7b0991a commit 869e71b

File tree

7 files changed

+46
-47
lines changed

7 files changed

+46
-47
lines changed

packages/node/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"start": "tsx --env-file=../../.env src/daemon.ts"
1515
},
1616
"dependencies": {
17-
"@claw-network/core": "^0.5.2",
18-
"@claw-network/node": "^0.5.2",
19-
"@claw-network/sdk": "^0.5.2",
17+
"@claw-network/core": "^0.5.3",
18+
"@claw-network/node": "^0.5.3",
19+
"@claw-network/sdk": "^0.5.3",
2020
"@telagent/protocol": "workspace:*",
2121
"better-sqlite3": "^12.2.0",
2222
"ethers": "^6.15.0",

packages/node/src/services/clawnet-transport-service.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,7 @@ export class ClawNetTransportService {
149149
attachmentId: string,
150150
fileName?: string,
151151
): Promise<{ delivered: boolean }> {
152-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
153-
const messaging = this.gateway.client.messaging as any;
154-
return messaging.relayAttachment({
152+
return this.gateway.client.messaging.relayAttachment({
155153
targetDid,
156154
data: data.toString('base64'),
157155
contentType,
@@ -166,9 +164,7 @@ export class ClawNetTransportService {
166164
*/
167165
async downloadAttachment(attachmentId: string): Promise<Buffer | null> {
168166
try {
169-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
170-
const messaging = this.gateway.client.messaging as any;
171-
const arrayBuf = await messaging.getAttachment(attachmentId);
167+
const arrayBuf = await this.gateway.client.messaging.getAttachment(attachmentId);
172168
return Buffer.from(arrayBuf as ArrayBuffer);
173169
} catch {
174170
return null;
@@ -190,7 +186,8 @@ export class ClawNetTransportService {
190186
let wsUrl = this.baseUrl.replace(/^http/, 'ws')
191187
+ '/api/v1/messaging/subscribe';
192188
const params = new URLSearchParams();
193-
params.set('topic', 'telagent/*');
189+
// Subscribe to telagent app topics AND the _attachment relay notification from ClawNet P2P.
190+
params.set('topic', 'telagent/*,_attachment');
194191
if (this.apiKey) {
195192
params.set('apiKey', this.apiKey);
196193
}

packages/webapp/src/components/chat/MessageList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export function MessageList({ messages }: MessageListProps) {
8282
kind: "message",
8383
key: message.envelopeId,
8484
value: message,
85-
senderDid: decodeUtf8Hex(message.sealedHeader),
85+
senderDid: decodeUtf8Hex(message.sealedHeader) ?? "",
8686
showTail: false, // will be patched below
8787
})
8888
}

packages/webapp/src/hooks/use-message-sender.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,10 @@ export function useMessageSender() {
258258
targetDid,
259259
})
260260

261-
// Use a "local:" URI as the wire payload.
262-
// The receiver's node gets the file via ClawNet P2P (relayed during completeAttachmentUpload)
263-
// and stores it under the same objectKey. Both sender and receiver resolve
264-
// "local:<objectKey>" → "${nodeUrl}/api/v1/attachments/<objectKey>" using their own nodeUrl,
265-
// so the file is always served from the locally-reachable node — no cross-machine HTTP needed.
261+
// Wire format: `local:<objectKey>` — resolved by the receiver via their own node URL.
262+
// The P2P relay (relayAttachment above) pushes the file to the receiver's ClawNet node,
263+
// so the receiver serves it at their own nodeUrl. MessageBubble.resolveAttachmentUrl()
264+
// expands this schema into a full URL at render time.
266265
const rawPayloadText = `local:${initialized.objectKey}`
267266
const displayText = contentType === "image"
268267
? URL.createObjectURL(input.file) // local blob for sender's immediate preview

packages/webapp/src/stores/message.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ function makeEnvelope(overrides: Partial<Envelope> = {}): Envelope {
1111
conversationType: overrides.conversationType ?? "direct",
1212
routeHint: overrides.routeHint ?? {
1313
targetDomain: "local",
14+
targetDid: "did:claw:test",
1415
mailboxKeyId: "key",
1516
},
1617
sealedHeader: overrides.sealedHeader ?? "header",

pnpm-lock.yaml

Lines changed: 24 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

skills/cloud-node-deploy/SKILL.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,15 @@ ssh -i "$SSH_KEY" root@<IP> "cat >> /opt/telagent/.env.cloud" << 'EOF'
135135
CLAW_CHAIN_RPC_URL=https://rpc.clawnetd.com
136136
CLAW_CHAIN_ID=7625
137137
CLAW_CHAIN_IDENTITY_CONTRACT=0xee9B2D7eb0CD51e1d0a14278bCA32b02548D1149
138-
CLAW_CHAIN_TOKEN_CONTRACT=0xE1cf20376ef0372E26CEE715F84A15348bdbB5c6
139-
CLAW_CHAIN_ESCROW_CONTRACT=0x0e60c5EAf869fBDEbcE5cde4E52ddd195c1F1feD
140-
CLAW_CHAIN_REPUTATION_CONTRACT=0x9b28722bE8d488b31CF4cAd073De6ad52434b78c
141-
CLAW_CHAIN_CONTRACTS_CONTRACT=0x7C558284776372A44C906E6f2c38cB83f23966A3
142-
CLAW_CHAIN_DAO_CONTRACT=0x98f5280ceBEe1eD067A3Cb6729eaAF5ceb3f7Bd9
143-
CLAW_CHAIN_STAKING_CONTRACT=0x6269D9358a8C4502fC8b629E8998Eb9C98961995
144-
CLAW_CHAIN_PARAM_REGISTRY_CONTRACT=0x08116e0598Cba600faa7D1f44ef493589B43d3bC
138+
# Optional: only needed for ClawNet chain-level features (token/escrow/dao/staking)
139+
# ABIs for these are not bundled in this repo — omit to avoid startup warnings.
140+
# CLAW_CHAIN_TOKEN_CONTRACT=0xE1cf20376ef0372E26CEE715F84A15348bdbB5c6
141+
# CLAW_CHAIN_ESCROW_CONTRACT=0x0e60c5EAf869fBDEbcE5cde4E52ddd195c1F1feD
142+
# CLAW_CHAIN_REPUTATION_CONTRACT=0x9b28722bE8d488b31CF4cAd073De6ad52434b78c
143+
# CLAW_CHAIN_CONTRACTS_CONTRACT=0x7C558284776372A44C906E6f2c38cB83f23966A3
144+
# CLAW_CHAIN_DAO_CONTRACT=0x98f5280ceBEe1eD067A3Cb6729eaAF5ceb3f7Bd9
145+
# CLAW_CHAIN_STAKING_CONTRACT=0x6269D9358a8C4502fC8b629E8998Eb9C98961995
146+
# CLAW_CHAIN_PARAM_REGISTRY_CONTRACT=0x08116e0598Cba600faa7D1f44ef493589B43d3bC
145147
CLAW_SIGNER_TYPE=env
146148
CLAW_SIGNER_ENV=TELAGENT_PRIVATE_KEY
147149
CLAW_CHAIN_ARTIFACTS_DIR=../../packages/contracts/artifacts

0 commit comments

Comments
 (0)