plotlink-ows 0.1.13
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/LICENSE +21 -0
- package/README.md +151 -0
- package/app/db.ts +8 -0
- package/app/lib/llm-client.ts +265 -0
- package/app/lib/paths.ts +11 -0
- package/app/lib/publish.ts +204 -0
- package/app/lib/writer-prompt.ts +44 -0
- package/app/node_modules/.prisma/local-client/client.d.ts +1 -0
- package/app/node_modules/.prisma/local-client/client.js +5 -0
- package/app/node_modules/.prisma/local-client/default.d.ts +1 -0
- package/app/node_modules/.prisma/local-client/default.js +5 -0
- package/app/node_modules/.prisma/local-client/edge.d.ts +1 -0
- package/app/node_modules/.prisma/local-client/edge.js +184 -0
- package/app/node_modules/.prisma/local-client/index-browser.js +173 -0
- package/app/node_modules/.prisma/local-client/index.d.ts +3304 -0
- package/app/node_modules/.prisma/local-client/index.js +207 -0
- package/app/node_modules/.prisma/local-client/libquery_engine-darwin-arm64.dylib.node +0 -0
- package/app/node_modules/.prisma/local-client/package.json +183 -0
- package/app/node_modules/.prisma/local-client/query_engine_bg.js +2 -0
- package/app/node_modules/.prisma/local-client/query_engine_bg.wasm +0 -0
- package/app/node_modules/.prisma/local-client/runtime/edge-esm.js +35 -0
- package/app/node_modules/.prisma/local-client/runtime/edge.js +35 -0
- package/app/node_modules/.prisma/local-client/runtime/index-browser.d.ts +370 -0
- package/app/node_modules/.prisma/local-client/runtime/index-browser.js +17 -0
- package/app/node_modules/.prisma/local-client/runtime/library.d.ts +3982 -0
- package/app/node_modules/.prisma/local-client/runtime/library.js +147 -0
- package/app/node_modules/.prisma/local-client/runtime/react-native.js +84 -0
- package/app/node_modules/.prisma/local-client/runtime/wasm-compiler-edge.js +85 -0
- package/app/node_modules/.prisma/local-client/runtime/wasm-engine-edge.js +38 -0
- package/app/node_modules/.prisma/local-client/schema.prisma +21 -0
- package/app/node_modules/.prisma/local-client/wasm-edge-light-loader.mjs +5 -0
- package/app/node_modules/.prisma/local-client/wasm-worker-loader.mjs +5 -0
- package/app/node_modules/.prisma/local-client/wasm.d.ts +1 -0
- package/app/node_modules/.prisma/local-client/wasm.js +191 -0
- package/app/prisma/schema.prisma +57 -0
- package/app/routes/auth.ts +173 -0
- package/app/routes/chat.ts +135 -0
- package/app/routes/config.ts +210 -0
- package/app/routes/dashboard.ts +186 -0
- package/app/routes/oauth.ts +150 -0
- package/app/routes/publish.ts +112 -0
- package/app/routes/wallet.ts +99 -0
- package/app/server.ts +154 -0
- package/app/vite.config.ts +19 -0
- package/app/web/App.tsx +102 -0
- package/app/web/components/Chat.tsx +272 -0
- package/app/web/components/Dashboard.tsx +222 -0
- package/app/web/components/LLMSetup.tsx +291 -0
- package/app/web/components/Layout.tsx +235 -0
- package/app/web/components/Login.tsx +62 -0
- package/app/web/components/Publish.tsx +245 -0
- package/app/web/components/Settings.tsx +175 -0
- package/app/web/components/Setup.tsx +84 -0
- package/app/web/components/WalletCard.tsx +117 -0
- package/app/web/dist/assets/index-C9kXlYO_.css +2 -0
- package/app/web/dist/assets/index-CJiiaLHs.js +9 -0
- package/app/web/dist/index.html +16 -0
- package/app/web/index.html +15 -0
- package/app/web/main.tsx +10 -0
- package/app/web/plotlink-logo.svg +5 -0
- package/app/web/styles.css +51 -0
- package/bin/plotlink-ows.js +394 -0
- package/lib/ows/index.ts +3 -0
- package/lib/ows/policy.ts +68 -0
- package/lib/ows/types.ts +14 -0
- package/lib/ows/wallet.ts +70 -0
- package/package.json +79 -0
- package/packages/cli/node_modules/commander/LICENSE +22 -0
- package/packages/cli/node_modules/commander/Readme.md +1149 -0
- package/packages/cli/node_modules/commander/esm.mjs +16 -0
- package/packages/cli/node_modules/commander/index.js +24 -0
- package/packages/cli/node_modules/commander/lib/argument.js +149 -0
- package/packages/cli/node_modules/commander/lib/command.js +2662 -0
- package/packages/cli/node_modules/commander/lib/error.js +39 -0
- package/packages/cli/node_modules/commander/lib/help.js +709 -0
- package/packages/cli/node_modules/commander/lib/option.js +367 -0
- package/packages/cli/node_modules/commander/lib/suggestSimilar.js +101 -0
- package/packages/cli/node_modules/commander/package-support.json +16 -0
- package/packages/cli/node_modules/commander/package.json +82 -0
- package/packages/cli/node_modules/commander/typings/esm.d.mts +3 -0
- package/packages/cli/node_modules/commander/typings/index.d.ts +1045 -0
- package/packages/cli/node_modules/resolve-from/index.d.ts +31 -0
- package/packages/cli/node_modules/resolve-from/index.js +47 -0
- package/packages/cli/node_modules/resolve-from/license +9 -0
- package/packages/cli/node_modules/resolve-from/package.json +36 -0
- package/packages/cli/node_modules/resolve-from/readme.md +72 -0
- package/packages/cli/node_modules/tsup/LICENSE +21 -0
- package/packages/cli/node_modules/tsup/README.md +75 -0
- package/packages/cli/node_modules/tsup/assets/cjs_shims.js +13 -0
- package/packages/cli/node_modules/tsup/assets/esm_shims.js +9 -0
- package/packages/cli/node_modules/tsup/assets/package.json +3 -0
- package/packages/cli/node_modules/tsup/dist/chunk-DI5BO6XE.js +153 -0
- package/packages/cli/node_modules/tsup/dist/chunk-JZ25TPTY.js +42 -0
- package/packages/cli/node_modules/tsup/dist/chunk-PEEXUWMS.js +6 -0
- package/packages/cli/node_modules/tsup/dist/chunk-TWFEYLU4.js +352 -0
- package/packages/cli/node_modules/tsup/dist/chunk-VGC3FXLU.js +203 -0
- package/packages/cli/node_modules/tsup/dist/cli-default.js +12 -0
- package/packages/cli/node_modules/tsup/dist/cli-main.js +8 -0
- package/packages/cli/node_modules/tsup/dist/cli-node.js +14 -0
- package/packages/cli/node_modules/tsup/dist/index.d.ts +511 -0
- package/packages/cli/node_modules/tsup/dist/index.js +1711 -0
- package/packages/cli/node_modules/tsup/dist/rollup.js +6949 -0
- package/packages/cli/node_modules/tsup/package.json +99 -0
- package/packages/cli/node_modules/tsup/schema.json +362 -0
- package/packages/cli/package.json +35 -0
- package/packages/cli/src/commands/agent-register.ts +77 -0
- package/packages/cli/src/commands/chain.ts +29 -0
- package/packages/cli/src/commands/claim.ts +70 -0
- package/packages/cli/src/commands/create.ts +34 -0
- package/packages/cli/src/commands/status.ts +201 -0
- package/packages/cli/src/config.ts +103 -0
- package/packages/cli/src/index.ts +21 -0
- package/packages/cli/src/sdk/abi.ts +222 -0
- package/packages/cli/src/sdk/client.ts +713 -0
- package/packages/cli/src/sdk/constants.ts +56 -0
- package/packages/cli/src/sdk/index.ts +46 -0
- package/packages/cli/src/sdk/ipfs.ts +88 -0
- package/packages/cli/src/sdk.ts +36 -0
- package/packages/cli/tsconfig.json +20 -0
- package/packages/cli/tsup.config.ts +14 -0
- package/public/.well-known/farcaster.json +38 -0
- package/public/basescan-icon.svg +4 -0
- package/public/embed-image.png +0 -0
- package/public/favicon.png +0 -0
- package/public/hunt-token.svg +11 -0
- package/public/icon-192.png +0 -0
- package/public/icon.png +0 -0
- package/public/manifest.json +26 -0
- package/public/mc-icon-light.svg +12 -0
- package/public/og-image.png +0 -0
- package/public/plotlink-logo-symbol.svg +5 -0
- package/public/plotlink-logo.svg +5 -0
- package/public/screenshot-1.png +0 -0
- package/public/screenshot-2.png +0 -0
- package/public/screenshot-3.png +0 -0
- package/public/splash.png +0 -0
- package/public/wide-banner.png +0 -0
- package/scripts/backfill-trade-prices.ts +97 -0
- package/scripts/backfill-usd-rates.ts +220 -0
- package/scripts/e2e-verify.ts +1100 -0
- package/scripts/ows-smoke-test.ts +37 -0
- package/scripts/score-users.mjs +203 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tsup",
|
|
3
|
+
"version": "8.5.1",
|
|
4
|
+
"description": "Bundle your TypeScript library with no config, powered by esbuild",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://tsup.egoist.dev/",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/egoist/tsup.git"
|
|
10
|
+
},
|
|
11
|
+
"author": "EGOIST",
|
|
12
|
+
"files": [
|
|
13
|
+
"/assets",
|
|
14
|
+
"/dist",
|
|
15
|
+
"/schema.json"
|
|
16
|
+
],
|
|
17
|
+
"main": "dist/index.js",
|
|
18
|
+
"types": "dist/index.d.ts",
|
|
19
|
+
"bin": {
|
|
20
|
+
"tsup": "dist/cli-default.js",
|
|
21
|
+
"tsup-node": "dist/cli-node.js"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"@microsoft/api-extractor": "^7.36.0",
|
|
25
|
+
"@swc/core": "^1",
|
|
26
|
+
"postcss": "^8.4.12",
|
|
27
|
+
"typescript": ">=4.5.0"
|
|
28
|
+
},
|
|
29
|
+
"peerDependenciesMeta": {
|
|
30
|
+
"@microsoft/api-extractor": {
|
|
31
|
+
"optional": true
|
|
32
|
+
},
|
|
33
|
+
"@swc/core": {
|
|
34
|
+
"optional": true
|
|
35
|
+
},
|
|
36
|
+
"postcss": {
|
|
37
|
+
"optional": true
|
|
38
|
+
},
|
|
39
|
+
"typescript": {
|
|
40
|
+
"optional": true
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"bundle-require": "^5.1.0",
|
|
45
|
+
"cac": "^6.7.14",
|
|
46
|
+
"chokidar": "^4.0.3",
|
|
47
|
+
"consola": "^3.4.0",
|
|
48
|
+
"debug": "^4.4.0",
|
|
49
|
+
"esbuild": "^0.27.0",
|
|
50
|
+
"fix-dts-default-cjs-exports": "^1.0.0",
|
|
51
|
+
"joycon": "^3.1.1",
|
|
52
|
+
"picocolors": "^1.1.1",
|
|
53
|
+
"postcss-load-config": "^6.0.1",
|
|
54
|
+
"resolve-from": "^5.0.0",
|
|
55
|
+
"rollup": "^4.34.8",
|
|
56
|
+
"source-map": "^0.7.6",
|
|
57
|
+
"sucrase": "^3.35.0",
|
|
58
|
+
"tinyexec": "^0.3.2",
|
|
59
|
+
"tinyglobby": "^0.2.11",
|
|
60
|
+
"tree-kill": "^1.2.2"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@microsoft/api-extractor": "^7.50.0",
|
|
64
|
+
"@rollup/plugin-json": "6.1.0",
|
|
65
|
+
"@swc/core": "1.10.18",
|
|
66
|
+
"@types/debug": "4.1.12",
|
|
67
|
+
"@types/node": "22.13.4",
|
|
68
|
+
"@types/resolve": "1.20.6",
|
|
69
|
+
"bumpp": "^10.0.3",
|
|
70
|
+
"flat": "6.0.1",
|
|
71
|
+
"postcss": "8.5.2",
|
|
72
|
+
"postcss-simple-vars": "7.0.1",
|
|
73
|
+
"prettier": "3.5.1",
|
|
74
|
+
"resolve": "1.22.10",
|
|
75
|
+
"rollup-plugin-dts": "6.1.1",
|
|
76
|
+
"sass": "1.85.0",
|
|
77
|
+
"strip-json-comments": "5.0.1",
|
|
78
|
+
"svelte": "5.19.9",
|
|
79
|
+
"svelte-preprocess": "6.0.3",
|
|
80
|
+
"terser": "^5.39.0",
|
|
81
|
+
"ts-essentials": "10.0.4",
|
|
82
|
+
"tsup": "8.3.6",
|
|
83
|
+
"typescript": "5.7.3",
|
|
84
|
+
"vitest": "3.0.6",
|
|
85
|
+
"wait-for-expect": "3.0.2"
|
|
86
|
+
},
|
|
87
|
+
"engines": {
|
|
88
|
+
"node": ">=18"
|
|
89
|
+
},
|
|
90
|
+
"scripts": {
|
|
91
|
+
"dev": "pnpm run build-fast --watch",
|
|
92
|
+
"build": "tsup src/cli-*.ts src/index.ts src/rollup.ts --clean --splitting",
|
|
93
|
+
"test": "pnpm run build && pnpm run test-only",
|
|
94
|
+
"format": "prettier --write .",
|
|
95
|
+
"test-only": "vitest run",
|
|
96
|
+
"build-fast": "pnpm run build --no-dts",
|
|
97
|
+
"release": "bumpp"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "tsup",
|
|
4
|
+
"version": 1.1,
|
|
5
|
+
"anyOf": [
|
|
6
|
+
{
|
|
7
|
+
"type": "object",
|
|
8
|
+
"required": ["tsup"],
|
|
9
|
+
"additionalProperties": true,
|
|
10
|
+
"properties": {
|
|
11
|
+
"tsup": {
|
|
12
|
+
"type": ["object", "array"],
|
|
13
|
+
"oneOf": [
|
|
14
|
+
{
|
|
15
|
+
"type": "object",
|
|
16
|
+
"additionalProperties": false,
|
|
17
|
+
"$ref": "#/definitions/options"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"type": "array",
|
|
21
|
+
"items": {
|
|
22
|
+
"additionalProperties": false,
|
|
23
|
+
"$ref": "#/definitions/options"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"type": ["object", "array"],
|
|
32
|
+
"oneOf": [
|
|
33
|
+
{
|
|
34
|
+
"type": "object",
|
|
35
|
+
"$ref": "#/definitions/options"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"type": "array",
|
|
39
|
+
"items": {
|
|
40
|
+
"$ref": "#/definitions/options"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"definitions": {
|
|
47
|
+
"options": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"markdownDescription": "Configuration options for [tsup](https://tsup.egoist.dev)",
|
|
50
|
+
"properties": {
|
|
51
|
+
"entry": {
|
|
52
|
+
"markdownDescription": "Files that each serve as an input to the bundling algorithm.\n\n---\nReferences:\n- [Entry Points](https://esbuild.github.io/api/#entry-points) - esbuild\n - [Multiple Entrypoints](https://tsup.egoist.dev/#multiple-entrypoints) - tsup",
|
|
53
|
+
"oneOf": [
|
|
54
|
+
{
|
|
55
|
+
"type": "array",
|
|
56
|
+
"items": {
|
|
57
|
+
"type": "string"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"type": "object"
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
"treeshake": {
|
|
66
|
+
"markdownDescription": "By default esbuild already does treeshaking but this option allow you to perform additional treeshaking with Rollup and result in smaller bundle size.",
|
|
67
|
+
"oneOf": [
|
|
68
|
+
{
|
|
69
|
+
"type": "boolean"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"type": "string",
|
|
73
|
+
"enum": ["smallest", "safest", "recommended"]
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
"name": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"description": "Optional config name to show in CLI output"
|
|
80
|
+
},
|
|
81
|
+
"legacyOutput": {
|
|
82
|
+
"type": "boolean",
|
|
83
|
+
"description": "Output different formats to different folder instead of using different extension"
|
|
84
|
+
},
|
|
85
|
+
"target": {
|
|
86
|
+
"markdownDescription": "This sets the target environment for the generated code\n\n---\nReferences:\n- [Target](https://esbuild.github.io/api/#target) - esbuild",
|
|
87
|
+
"default": "node14",
|
|
88
|
+
"oneOf": [
|
|
89
|
+
{
|
|
90
|
+
"type": "string"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"type": "array",
|
|
94
|
+
"items": {
|
|
95
|
+
"type": "string"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
"minify": {
|
|
101
|
+
"description": "When enabled, the generated code will be minified instead of pretty-printed.",
|
|
102
|
+
"oneOf": [
|
|
103
|
+
{
|
|
104
|
+
"type": "boolean"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"type": "string",
|
|
108
|
+
"enum": ["terser"]
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"minifyWhitespace": {
|
|
113
|
+
"type": "boolean"
|
|
114
|
+
},
|
|
115
|
+
"minifyIdentifiers": {
|
|
116
|
+
"type": "boolean"
|
|
117
|
+
},
|
|
118
|
+
"minifySyntax": {
|
|
119
|
+
"type": "boolean"
|
|
120
|
+
},
|
|
121
|
+
"keepNames": {
|
|
122
|
+
"type": "boolean"
|
|
123
|
+
},
|
|
124
|
+
"watch": {
|
|
125
|
+
"oneOf": [
|
|
126
|
+
{
|
|
127
|
+
"type": "boolean"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"type": "string",
|
|
131
|
+
"items": {
|
|
132
|
+
"type": "string"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"type": "array",
|
|
137
|
+
"items": {
|
|
138
|
+
"type": ["string", "boolean"]
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
"ignoreWatch": {
|
|
144
|
+
"oneOf": [
|
|
145
|
+
{
|
|
146
|
+
"type": "string"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"type": "array",
|
|
150
|
+
"items": {
|
|
151
|
+
"type": "string"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
"onSuccess": {
|
|
157
|
+
"type": "string"
|
|
158
|
+
},
|
|
159
|
+
"jsxFactory": {
|
|
160
|
+
"type": "string"
|
|
161
|
+
},
|
|
162
|
+
"jsxFragment": {
|
|
163
|
+
"type": "string"
|
|
164
|
+
},
|
|
165
|
+
"outDir": {
|
|
166
|
+
"type": "string"
|
|
167
|
+
},
|
|
168
|
+
"format": {
|
|
169
|
+
"oneOf": [
|
|
170
|
+
{
|
|
171
|
+
"enum": ["cjs", "iife", "esm"],
|
|
172
|
+
"type": "string"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"type": "array",
|
|
176
|
+
"uniqueItems": true,
|
|
177
|
+
"items": {
|
|
178
|
+
"type": "string",
|
|
179
|
+
"enum": ["cjs", "iife", "esm"]
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
"swc": {
|
|
185
|
+
"type": "object"
|
|
186
|
+
},
|
|
187
|
+
"globalName": {
|
|
188
|
+
"type": "string"
|
|
189
|
+
},
|
|
190
|
+
"env": {
|
|
191
|
+
"type": "object"
|
|
192
|
+
},
|
|
193
|
+
"define": {
|
|
194
|
+
"type": "object"
|
|
195
|
+
},
|
|
196
|
+
"dts": {
|
|
197
|
+
"markdownDescription": "This will emit `./dist/index.js` and `./dist/index.d.ts`.\n\nIf you have multiple entry files, each entry will get a corresponding `.d.ts` file. So when you only want to generate declaration file for a single entry, use `--dts <entry>` format, e.g. `--dts src/index.ts`.\n\n**Note** that `--dts` does not resolve external (aka in node_modules) types used in the `.d.ts file`, if that's somehow a requirement, try the experimental `--dts-resolve` flag instead.",
|
|
198
|
+
"oneOf": [
|
|
199
|
+
{
|
|
200
|
+
"type": "boolean"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"type": "string"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"type": "object",
|
|
207
|
+
"properties": {
|
|
208
|
+
"entry": {
|
|
209
|
+
"oneOf": [
|
|
210
|
+
{
|
|
211
|
+
"type": "string"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"type": "object"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"type": "array",
|
|
218
|
+
"items": {
|
|
219
|
+
"type": "string"
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
},
|
|
228
|
+
"sourcemap": {
|
|
229
|
+
"oneOf": [
|
|
230
|
+
{
|
|
231
|
+
"type": "boolean"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"enum": ["inline"]
|
|
235
|
+
}
|
|
236
|
+
]
|
|
237
|
+
},
|
|
238
|
+
"noExternal": {
|
|
239
|
+
"type": "array",
|
|
240
|
+
"items": {
|
|
241
|
+
"type": "string"
|
|
242
|
+
},
|
|
243
|
+
"description": "Always bundle modules matching given patterns"
|
|
244
|
+
},
|
|
245
|
+
"external": {
|
|
246
|
+
"description": "Don't bundle these modules",
|
|
247
|
+
"type": "array",
|
|
248
|
+
"items": {
|
|
249
|
+
"type": "string"
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"replaceNodeEnv": {
|
|
253
|
+
"type": "boolean",
|
|
254
|
+
"markdownDescription": "Replace `process.env.NODE_ENV` with `production` or `development` `production` when the bundled is minified, `development` otherwise"
|
|
255
|
+
},
|
|
256
|
+
"splitting": {
|
|
257
|
+
"type": "boolean",
|
|
258
|
+
"default": true,
|
|
259
|
+
"markdownDescription": "You may want to disable code splitting sometimes: [`#255`](https://github.com/egoist/tsup/issues/255)"
|
|
260
|
+
},
|
|
261
|
+
"clean": {
|
|
262
|
+
"description": "Clean output directory before each buil",
|
|
263
|
+
"oneOf": [
|
|
264
|
+
{
|
|
265
|
+
"type": "boolean"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"type": "array",
|
|
269
|
+
"items": {
|
|
270
|
+
"type": "string"
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
]
|
|
274
|
+
},
|
|
275
|
+
"silent": {
|
|
276
|
+
"type": "boolean",
|
|
277
|
+
"description": "Suppress non-error logs (excluding \"onSuccess\" process output)"
|
|
278
|
+
},
|
|
279
|
+
"skipNodeModulesBundle": {
|
|
280
|
+
"type": "boolean",
|
|
281
|
+
"description": "Skip node_modules bundling"
|
|
282
|
+
},
|
|
283
|
+
"pure": {
|
|
284
|
+
"markdownDescription": "See:\n- [Pure](https://esbuild.github.io/api/#pure) - esbuild",
|
|
285
|
+
"oneOf": [
|
|
286
|
+
{
|
|
287
|
+
"type": "boolean"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"type": "array",
|
|
291
|
+
"items": {
|
|
292
|
+
"type": "string"
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
]
|
|
296
|
+
},
|
|
297
|
+
"bundle": {
|
|
298
|
+
"default": true,
|
|
299
|
+
"type": "boolean",
|
|
300
|
+
"description": "Disable bundling, default to true"
|
|
301
|
+
},
|
|
302
|
+
"inject": {
|
|
303
|
+
"markdownDescription": "This option allows you to automatically replace a global variable with an import from another file.\n\n---\nSee:\n- [Inject](https://esbuild.github.io/api/#inject) - esbuild",
|
|
304
|
+
"type": "array",
|
|
305
|
+
"items": {
|
|
306
|
+
"type": "string"
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
"metafile": {
|
|
310
|
+
"type": "boolean",
|
|
311
|
+
"markdownDescription": "Emit esbuild metafile.\n\n---\nSee:\n- [Metafile](https://esbuild.github.io/api/#metafile) - esbuild"
|
|
312
|
+
},
|
|
313
|
+
"footer": {
|
|
314
|
+
"type": "object",
|
|
315
|
+
"properties": {
|
|
316
|
+
"js": {
|
|
317
|
+
"type": "string"
|
|
318
|
+
},
|
|
319
|
+
"css": {
|
|
320
|
+
"type": "string"
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
"banner": {
|
|
325
|
+
"type": "object",
|
|
326
|
+
"properties": {
|
|
327
|
+
"js": {
|
|
328
|
+
"type": "string"
|
|
329
|
+
},
|
|
330
|
+
"css": {
|
|
331
|
+
"type": "string"
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
"platform": {
|
|
336
|
+
"description": "Target platform",
|
|
337
|
+
"type": "string",
|
|
338
|
+
"default": "node",
|
|
339
|
+
"enum": ["node", "browser", "neutral"]
|
|
340
|
+
},
|
|
341
|
+
"config": {
|
|
342
|
+
"markdownDescription": "Disable config file with `false` or pass a custom config filename",
|
|
343
|
+
"type": ["boolean", "string"]
|
|
344
|
+
},
|
|
345
|
+
"tsconfig": {
|
|
346
|
+
"type": "string",
|
|
347
|
+
"description": " Use a custom tsconfig"
|
|
348
|
+
},
|
|
349
|
+
"injectStyle": {
|
|
350
|
+
"type": "boolean",
|
|
351
|
+
"default": false,
|
|
352
|
+
"description": "Inject CSS as style tags to document head"
|
|
353
|
+
},
|
|
354
|
+
"shims": {
|
|
355
|
+
"type": "boolean",
|
|
356
|
+
"default": false,
|
|
357
|
+
"description": "Inject cjs and esm shims if needed"
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "plotlink-cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CLI for the PlotLink protocol — create storylines, chain plots, register agents, and claim royalties.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"plotlink": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsup",
|
|
14
|
+
"typecheck": "tsc --noEmit"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@supabase/supabase-js": "^2.49.4",
|
|
18
|
+
"commander": "^13.1.0",
|
|
19
|
+
"viem": "^2.47.2"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"bundle-require": "^5.1.0",
|
|
23
|
+
"chokidar": "^4.0.3",
|
|
24
|
+
"consola": "^3.4.0",
|
|
25
|
+
"fix-dts-default-cjs-exports": "^1.0.0",
|
|
26
|
+
"joycon": "^3.1.1",
|
|
27
|
+
"postcss-load-config": "^6.0.1",
|
|
28
|
+
"source-map": "^0.7.6",
|
|
29
|
+
"sucrase": "^3.35.0",
|
|
30
|
+
"tree-kill": "^1.2.2",
|
|
31
|
+
"tsup": "^8.4.0",
|
|
32
|
+
"typescript": "^5"
|
|
33
|
+
},
|
|
34
|
+
"license": "MIT"
|
|
35
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { Address } from "viem";
|
|
3
|
+
import { isAddress } from "viem";
|
|
4
|
+
import { buildClient } from "../sdk.js";
|
|
5
|
+
|
|
6
|
+
export function registerAgentRegister(program: Command): void {
|
|
7
|
+
const agent = program
|
|
8
|
+
.command("agent")
|
|
9
|
+
.description("Agent identity commands");
|
|
10
|
+
|
|
11
|
+
agent
|
|
12
|
+
.command("register")
|
|
13
|
+
.description("Register an AI agent on the ERC-8004 registry and set its wallet")
|
|
14
|
+
.requiredOption("-n, --name <name>", "Agent display name")
|
|
15
|
+
.requiredOption("-d, --description <desc>", "Short description of the agent")
|
|
16
|
+
.requiredOption("-g, --genre <genre>", "Primary genre the agent writes in")
|
|
17
|
+
.requiredOption("-m, --model <model>", "LLM model identifier (e.g. \"Claude Opus 4\")")
|
|
18
|
+
.option("-w, --wallet <address>", "Agent wallet address (defaults to the configured wallet)")
|
|
19
|
+
.option("--skip-wallet", "Skip wallet binding step", false)
|
|
20
|
+
.action(
|
|
21
|
+
async (opts: {
|
|
22
|
+
name: string;
|
|
23
|
+
description: string;
|
|
24
|
+
genre: string;
|
|
25
|
+
model: string;
|
|
26
|
+
wallet?: string;
|
|
27
|
+
skipWallet?: boolean;
|
|
28
|
+
}) => {
|
|
29
|
+
try {
|
|
30
|
+
// Validate wallet address and key BEFORE spending gas on registration
|
|
31
|
+
let walletKey: string | undefined;
|
|
32
|
+
if (opts.wallet && !opts.skipWallet) {
|
|
33
|
+
if (!isAddress(opts.wallet)) {
|
|
34
|
+
console.error(`Invalid address: ${opts.wallet}`);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
walletKey = process.env.PLOTLINK_AGENT_WALLET_KEY;
|
|
38
|
+
if (!walletKey) {
|
|
39
|
+
console.error(
|
|
40
|
+
"Error: PLOTLINK_AGENT_WALLET_KEY env var is required when --wallet is set.\n" +
|
|
41
|
+
"Set it before running this command, or pass --skip-wallet to register without binding.",
|
|
42
|
+
);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const client = buildClient({ ipfs: false });
|
|
48
|
+
|
|
49
|
+
console.log(`Registering agent "${opts.name}"...`);
|
|
50
|
+
const result = await client.registerAgent(
|
|
51
|
+
opts.name,
|
|
52
|
+
opts.description,
|
|
53
|
+
opts.genre,
|
|
54
|
+
opts.model,
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
console.log("Agent registered!");
|
|
58
|
+
console.log(` Agent ID: ${result.agentId}`);
|
|
59
|
+
console.log(` TX: ${result.txHash}`);
|
|
60
|
+
|
|
61
|
+
if (opts.wallet && !opts.skipWallet && walletKey) {
|
|
62
|
+
const walletAddress = opts.wallet as Address;
|
|
63
|
+
console.log(`Setting agent wallet to ${walletAddress}...`);
|
|
64
|
+
const walletResult = await client.setAgentWallet(
|
|
65
|
+
result.agentId,
|
|
66
|
+
walletAddress,
|
|
67
|
+
walletKey,
|
|
68
|
+
);
|
|
69
|
+
console.log(`Agent wallet set! TX: ${walletResult.txHash}`);
|
|
70
|
+
}
|
|
71
|
+
} catch (err) {
|
|
72
|
+
console.error(`Error: ${err instanceof Error ? err.message : String(err)}`);
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
);
|
|
77
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import type { Command } from "commander";
|
|
3
|
+
import { buildClient } from "../sdk.js";
|
|
4
|
+
|
|
5
|
+
export function registerChain(program: Command): void {
|
|
6
|
+
program
|
|
7
|
+
.command("chain")
|
|
8
|
+
.description("Chain a new plot onto an existing storyline")
|
|
9
|
+
.requiredOption("-s, --storyline <id>", "Storyline ID")
|
|
10
|
+
.requiredOption("-f, --file <path>", "Path to content file (plain text)")
|
|
11
|
+
.option("-t, --title <title>", "Chapter title", "")
|
|
12
|
+
.action(async (opts: { storyline: string; file: string; title: string }) => {
|
|
13
|
+
try {
|
|
14
|
+
const content = readFileSync(opts.file, "utf-8");
|
|
15
|
+
const storylineId = BigInt(opts.storyline);
|
|
16
|
+
const client = buildClient({ ipfs: true });
|
|
17
|
+
|
|
18
|
+
console.log(`Chaining plot onto storyline ${storylineId}...`);
|
|
19
|
+
const result = await client.chainPlot(storylineId, content, opts.title);
|
|
20
|
+
|
|
21
|
+
console.log("Plot chained!");
|
|
22
|
+
console.log(` TX: ${result.txHash}`);
|
|
23
|
+
console.log(` CID: ${result.contentCid}`);
|
|
24
|
+
} catch (err) {
|
|
25
|
+
console.error(`Error: ${err instanceof Error ? err.message : String(err)}`);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import { type Address, erc20Abi, formatUnits, isAddress } from "viem";
|
|
3
|
+
import { mcv2BondAbi } from "../sdk/index.js";
|
|
4
|
+
import { buildClient } from "../sdk.js";
|
|
5
|
+
|
|
6
|
+
export function registerClaim(program: Command): void {
|
|
7
|
+
program
|
|
8
|
+
.command("claim")
|
|
9
|
+
.description("Claim accumulated royalties for a storyline token")
|
|
10
|
+
.requiredOption("-a, --address <tokenAddress>", "Storyline ERC-20 token address")
|
|
11
|
+
.action(async (opts: { address: string }) => {
|
|
12
|
+
try {
|
|
13
|
+
if (!isAddress(opts.address)) {
|
|
14
|
+
console.error(`Invalid address: ${opts.address}`);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
const tokenAddress = opts.address as Address;
|
|
18
|
+
const client = buildClient({ ipfs: false });
|
|
19
|
+
|
|
20
|
+
// Fetch bond data (creator = beneficiary, reserve token for display)
|
|
21
|
+
console.log("Checking royalties...");
|
|
22
|
+
const bond = await client.publicClient.readContract({
|
|
23
|
+
address: client.mcv2Bond,
|
|
24
|
+
abi: mcv2BondAbi,
|
|
25
|
+
functionName: "tokenBond",
|
|
26
|
+
args: [tokenAddress],
|
|
27
|
+
});
|
|
28
|
+
const creator = (bond as readonly unknown[])[0] as Address;
|
|
29
|
+
const reserveToken = (bond as readonly unknown[])[4] as Address;
|
|
30
|
+
|
|
31
|
+
let decimals = 18;
|
|
32
|
+
let symbol = "TOKEN";
|
|
33
|
+
try {
|
|
34
|
+
const [dec, sym] = await Promise.all([
|
|
35
|
+
client.publicClient.readContract({
|
|
36
|
+
address: reserveToken,
|
|
37
|
+
abi: erc20Abi,
|
|
38
|
+
functionName: "decimals",
|
|
39
|
+
}),
|
|
40
|
+
client.publicClient.readContract({
|
|
41
|
+
address: reserveToken,
|
|
42
|
+
abi: erc20Abi,
|
|
43
|
+
functionName: "symbol",
|
|
44
|
+
}),
|
|
45
|
+
]);
|
|
46
|
+
decimals = dec;
|
|
47
|
+
symbol = sym;
|
|
48
|
+
} catch {
|
|
49
|
+
// Default to 18/TOKEN if calls fail
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const info = await client.getRoyaltyInfo(creator, reserveToken);
|
|
53
|
+
const formatted = formatUnits(info.balance, decimals);
|
|
54
|
+
console.log(` Unclaimed: ${formatted} ${symbol}`);
|
|
55
|
+
console.log(` Beneficiary: ${creator}`);
|
|
56
|
+
|
|
57
|
+
if (info.balance === 0n) {
|
|
58
|
+
console.log("No royalties to claim.");
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
console.log("Claiming royalties...");
|
|
63
|
+
const txHash = await client.claimRoyalties(reserveToken);
|
|
64
|
+
console.log(`Royalties claimed! TX: ${txHash}`);
|
|
65
|
+
} catch (err) {
|
|
66
|
+
console.error(`Error: ${err instanceof Error ? err.message : String(err)}`);
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|