@techdigger/humanode-agentlink-cli 0.3.4 → 0.3.5
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 +2 -0
- package/REGISTRATION.md +4 -2
- package/dist/commands/authorize-link.js +1 -1
- package/dist/commands/request.js +6 -36
- package/dist/lib/core.js +5 -6
- package/dist/templates.js +8 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -30,6 +30,8 @@ After the owner completes linking in the browser, check the result:
|
|
|
30
30
|
agentlink status
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
+
For the first protected-route test, start with a `free-trial` route before moving to stricter gating or more complex payment flows.
|
|
34
|
+
|
|
33
35
|
## Commands
|
|
34
36
|
|
|
35
37
|
### `agentlink init`
|
package/REGISTRATION.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Humanode Agentlink — Agent Developer Guide
|
|
2
2
|
|
|
3
|
-
Link your AI agent to a biomapped human and unlock
|
|
3
|
+
Link your AI agent to a biomapped human and unlock verified-human access on x402 APIs.
|
|
4
4
|
|
|
5
5
|
## What linking does
|
|
6
6
|
|
|
7
|
-
When your agent is linked to a biomapped owner, platforms using Humanode Agentlink can identify your agent as acting on behalf of a real human. This unlocks better
|
|
7
|
+
When your agent is linked to a biomapped owner, platforms using Humanode Agentlink can identify your agent as acting on behalf of a real human. This unlocks better route behavior: free tiers, free trials, or linked-only gating that are unavailable to unlinked agents.
|
|
8
8
|
|
|
9
9
|
## Prerequisites
|
|
10
10
|
|
|
@@ -112,6 +112,8 @@ Possible results:
|
|
|
112
112
|
|
|
113
113
|
Use `--json` for machine-readable output.
|
|
114
114
|
|
|
115
|
+
For the first protected-route test, start with a `free-trial` route. It is the fastest way to prove the linked-human path end to end.
|
|
116
|
+
|
|
115
117
|
## Manual consent flow
|
|
116
118
|
|
|
117
119
|
If you do not want the CLI to create a link session URL, use the lower-level `authorize-link` command:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isAddress } from 'viem';
|
|
2
2
|
import { createAgentLinkConsent } from '@techdigger/humanode-agentlink';
|
|
3
|
-
import { CliError, assertNoExtraPositionals, createConsolePrompter, defaultDeadline, parseFlags, parseFutureDeadline,
|
|
3
|
+
import { CliError, assertNoExtraPositionals, createConsolePrompter, defaultDeadline, parseFlags, parseFutureDeadline, resolveNetwork, resolvePrivateKey, resolveRegistryAddress, resolveRpcUrl, } from '../lib/core.js';
|
|
4
4
|
export async function parseAuthorizeLinkOptions(argv, env, now, overrides = {}) {
|
|
5
5
|
const parsed = parseFlags(argv);
|
|
6
6
|
assertNoExtraPositionals('authorize-link', parsed.positionals);
|
package/dist/commands/request.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { CliError, NETWORKS, assertNoExtraPositionals, parseFlags, resolveNetwork, resolvePrivateKey, } from '../lib/core.js';
|
|
1
|
+
import { buildAgentLinkHeader } from '@techdigger/humanode-agentlink';
|
|
2
|
+
import { CliError, assertNoExtraPositionals, parseFlags, resolveNetwork, resolvePrivateKey, } from '../lib/core.js';
|
|
4
3
|
export function parseRequestOptions(argv, env, overrides = {}) {
|
|
5
4
|
const parsed = parseFlags(argv);
|
|
6
5
|
if (parsed.positionals.length === 0) {
|
|
@@ -29,43 +28,14 @@ export function parseRequestOptions(argv, env, overrides = {}) {
|
|
|
29
28
|
privateKey: resolvePrivateKey(parsed.values['private-key'], env, overrides.privateKey),
|
|
30
29
|
};
|
|
31
30
|
}
|
|
32
|
-
async function buildAgentLinkHeader(privateKey, url, network) {
|
|
33
|
-
const account = privateKeyToAccount(privateKey);
|
|
34
|
-
const parsed = new URL(url);
|
|
35
|
-
const chainId = NETWORKS[network].chainId;
|
|
36
|
-
const nonce = Math.random().toString(36).slice(2) + Date.now().toString(36);
|
|
37
|
-
const issuedAt = new Date().toISOString();
|
|
38
|
-
const siwe = new SiweMessage({
|
|
39
|
-
domain: parsed.hostname,
|
|
40
|
-
address: account.address,
|
|
41
|
-
uri: url,
|
|
42
|
-
version: '1',
|
|
43
|
-
chainId,
|
|
44
|
-
nonce,
|
|
45
|
-
issuedAt,
|
|
46
|
-
statement: 'Agentlink access request',
|
|
47
|
-
});
|
|
48
|
-
const message = siwe.prepareMessage();
|
|
49
|
-
const signature = await account.signMessage({ message });
|
|
50
|
-
const payload = {
|
|
51
|
-
domain: parsed.hostname,
|
|
52
|
-
address: account.address,
|
|
53
|
-
statement: 'Agentlink access request',
|
|
54
|
-
uri: url,
|
|
55
|
-
version: '1',
|
|
56
|
-
chainId: `eip155:${chainId}`,
|
|
57
|
-
type: 'eip191',
|
|
58
|
-
nonce,
|
|
59
|
-
issuedAt,
|
|
60
|
-
signature,
|
|
61
|
-
};
|
|
62
|
-
return Buffer.from(JSON.stringify(payload)).toString('base64');
|
|
63
|
-
}
|
|
64
31
|
export async function runRequest(options, deps = {}) {
|
|
65
32
|
const fetchImpl = deps.fetchImpl ?? fetch;
|
|
66
33
|
const results = [];
|
|
67
34
|
for (let i = 1; i <= options.count; i++) {
|
|
68
|
-
const agentlinkHeader = await buildAgentLinkHeader(options.
|
|
35
|
+
const agentlinkHeader = await buildAgentLinkHeader(options.url, {
|
|
36
|
+
privateKey: options.privateKey,
|
|
37
|
+
network: options.network,
|
|
38
|
+
});
|
|
69
39
|
let response;
|
|
70
40
|
try {
|
|
71
41
|
response = await fetchImpl(new Request(options.url, {
|
package/dist/lib/core.js
CHANGED
|
@@ -241,17 +241,16 @@ export function getPackageManagerInstallCommand(packageManager) {
|
|
|
241
241
|
export function getPackageManagerRunCommand(packageManager, script) {
|
|
242
242
|
return `${PM_COMMANDS[packageManager].run} ${script}`;
|
|
243
243
|
}
|
|
244
|
-
const HUMANODE_PACKAGE_VERSION = '^0.2.0';
|
|
245
244
|
const HUMANODE_PACKAGE_META = {
|
|
246
|
-
agentlink: { dirName: 'agentlink', packageName: '@techdigger/humanode-agentlink', version:
|
|
245
|
+
agentlink: { dirName: 'agentlink', packageName: '@techdigger/humanode-agentlink', version: '^0.3.0' },
|
|
247
246
|
langchain: {
|
|
248
247
|
dirName: 'langchain',
|
|
249
248
|
packageName: '@techdigger/humanode-agentlink-langchain',
|
|
250
|
-
version:
|
|
249
|
+
version: '^0.1.0',
|
|
251
250
|
},
|
|
252
|
-
aiSdk: { dirName: 'ai-sdk', packageName: '@techdigger/humanode-agentlink-ai-sdk', version:
|
|
253
|
-
mcp: { dirName: 'mcp', packageName: '@techdigger/humanode-agentlink-mcp', version:
|
|
254
|
-
cli: { dirName: 'cli', packageName: '@techdigger/humanode-agentlink-cli', version:
|
|
251
|
+
aiSdk: { dirName: 'ai-sdk', packageName: '@techdigger/humanode-agentlink-ai-sdk', version: '^0.1.0' },
|
|
252
|
+
mcp: { dirName: 'mcp', packageName: '@techdigger/humanode-agentlink-mcp', version: '^0.1.0' },
|
|
253
|
+
cli: { dirName: 'cli', packageName: '@techdigger/humanode-agentlink-cli', version: '^0.3.5' },
|
|
255
254
|
};
|
|
256
255
|
async function pathExists(targetPath) {
|
|
257
256
|
try {
|
package/dist/templates.js
CHANGED
|
@@ -7,7 +7,7 @@ const MCP_SDK_VERSION = '^1.12.1';
|
|
|
7
7
|
const DOTENV_VERSION = '^17.3.1';
|
|
8
8
|
const TSX_VERSION = '^4.19.4';
|
|
9
9
|
const TYPESCRIPT_VERSION = '^5.8.3';
|
|
10
|
-
function buildCommonEnv(input
|
|
10
|
+
function buildCommonEnv(input) {
|
|
11
11
|
const lines = [
|
|
12
12
|
`BIOMAPPER_NETWORK=${input.network}`,
|
|
13
13
|
`BIOMAPPER_REGISTRY=${input.registry}`,
|
|
@@ -210,6 +210,10 @@ ${getPackageManagerRunCommand(input.packageManager, 'link')} -- --owner 0xOwner
|
|
|
210
210
|
\`\`\`bash
|
|
211
211
|
${getPackageManagerRunCommand(input.packageManager, 'status')}
|
|
212
212
|
\`\`\`
|
|
213
|
+
|
|
214
|
+
## Recommended First Route Test
|
|
215
|
+
|
|
216
|
+
After linking succeeds, start by pointing the agent at a \`free-trial\` route. That proves the linked-human path before you move to stricter gating or more advanced payment flows.
|
|
213
217
|
`;
|
|
214
218
|
}
|
|
215
219
|
function buildLangChainReadme(input) {
|
|
@@ -253,21 +257,21 @@ export function buildTemplateFiles(input) {
|
|
|
253
257
|
case 'langchain':
|
|
254
258
|
return [
|
|
255
259
|
...commonFiles,
|
|
256
|
-
{ path: '.env.local', content: buildCommonEnv(input
|
|
260
|
+
{ path: '.env.local', content: buildCommonEnv(input) },
|
|
257
261
|
{ path: 'README.md', content: buildLangChainReadme(input) },
|
|
258
262
|
{ path: 'src/index.ts', content: buildLangChainSource() },
|
|
259
263
|
];
|
|
260
264
|
case 'vercel-ai-sdk':
|
|
261
265
|
return [
|
|
262
266
|
...commonFiles,
|
|
263
|
-
{ path: '.env.local', content: buildCommonEnv(input
|
|
267
|
+
{ path: '.env.local', content: buildCommonEnv(input) },
|
|
264
268
|
{ path: 'README.md', content: buildAISDKReadme(input) },
|
|
265
269
|
{ path: 'src/index.ts', content: buildAISource() },
|
|
266
270
|
];
|
|
267
271
|
case 'mcp':
|
|
268
272
|
return [
|
|
269
273
|
...commonFiles,
|
|
270
|
-
{ path: '.env.local', content: buildCommonEnv(input
|
|
274
|
+
{ path: '.env.local', content: buildCommonEnv(input) },
|
|
271
275
|
{ path: 'README.md', content: buildMcpReadme(input) },
|
|
272
276
|
{ path: 'mcp.config.json', content: buildMcpConfig(input.packageManager) },
|
|
273
277
|
{ path: 'src/index.ts', content: buildMcpSource() },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@techdigger/humanode-agentlink-cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "Scaffold, link, and inspect Biomapper-ready agent projects.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"mcp"
|
|
37
37
|
],
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@types/node": "^24.
|
|
39
|
+
"@types/node": "^24.12.2",
|
|
40
40
|
"tsx": "^4.19.4",
|
|
41
41
|
"typescript": "^5.9.3"
|
|
42
42
|
}
|