@tangle-network/create-agent-app 0.46.20 → 0.46.22
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/index.mjs +25 -20
- package/package.json +2 -1
- package/template/_package.json +7 -5
- package/template/pnpm-workspace.yaml +1 -0
- package/template-chat/_package.json +5 -3
- package/template-chat/pnpm-workspace.yaml +1 -0
- package/template-common/.nvmrc +1 -0
- package/template-common/renovate.json +4 -0
package/index.mjs
CHANGED
|
@@ -25,6 +25,7 @@ const TEMPLATES = {
|
|
|
25
25
|
default: join(HERE, 'template'),
|
|
26
26
|
chat: join(HERE, 'template-chat'),
|
|
27
27
|
}
|
|
28
|
+
const COMMON_TEMPLATE = join(HERE, 'template-common')
|
|
28
29
|
|
|
29
30
|
const { version: packageVersion } = JSON.parse(await readFile(join(HERE, 'package.json'), 'utf8'))
|
|
30
31
|
const AGENT_APP_RANGE = `^${packageVersion}`
|
|
@@ -110,6 +111,28 @@ async function walk(dir, base = dir, out = []) {
|
|
|
110
111
|
return out
|
|
111
112
|
}
|
|
112
113
|
|
|
114
|
+
async function materializeTemplate(templateDir, targetDir, tokens) {
|
|
115
|
+
const files = await walk(templateDir)
|
|
116
|
+
for (const rel of files) {
|
|
117
|
+
const src = join(templateDir, rel)
|
|
118
|
+
const parts = rel.split(/[\\/]/)
|
|
119
|
+
const baseName = parts[parts.length - 1]
|
|
120
|
+
const outName = RENAME.get(baseName) ?? baseName
|
|
121
|
+
parts[parts.length - 1] = outName
|
|
122
|
+
const dest = join(targetDir, parts.join('/'))
|
|
123
|
+
|
|
124
|
+
await mkdir(dirname(dest), { recursive: true })
|
|
125
|
+
|
|
126
|
+
const isText = TEXT_EXT.test(baseName) || TEXT_BASENAMES.has(baseName)
|
|
127
|
+
if (isText) {
|
|
128
|
+
const raw = await readFile(src, 'utf8')
|
|
129
|
+
await writeFile(dest, applyTokens(raw, tokens))
|
|
130
|
+
} else {
|
|
131
|
+
await cp(src, dest)
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
113
136
|
async function main() {
|
|
114
137
|
const args = parseArgs(process.argv.slice(2))
|
|
115
138
|
if (args.help || (args._.length === 0 && !args.name)) {
|
|
@@ -141,26 +164,8 @@ async function main() {
|
|
|
141
164
|
AGENT_APP_VERSION: agentAppVersion,
|
|
142
165
|
}
|
|
143
166
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
const src = join(templateDir, rel)
|
|
147
|
-
// Resolve any renamed path segments (only basenames are renamed).
|
|
148
|
-
const parts = rel.split(/[\\/]/)
|
|
149
|
-
const baseName = parts[parts.length - 1]
|
|
150
|
-
const outName = RENAME.get(baseName) ?? baseName
|
|
151
|
-
parts[parts.length - 1] = outName
|
|
152
|
-
const dest = join(targetDir, parts.join('/'))
|
|
153
|
-
|
|
154
|
-
await mkdir(dirname(dest), { recursive: true })
|
|
155
|
-
|
|
156
|
-
const isText = TEXT_EXT.test(baseName) || TEXT_BASENAMES.has(baseName)
|
|
157
|
-
if (isText) {
|
|
158
|
-
const raw = await readFile(src, 'utf8')
|
|
159
|
-
await writeFile(dest, applyTokens(raw, tokens))
|
|
160
|
-
} else {
|
|
161
|
-
await cp(src, dest)
|
|
162
|
-
}
|
|
163
|
-
}
|
|
167
|
+
await materializeTemplate(COMMON_TEMPLATE, targetDir, tokens)
|
|
168
|
+
await materializeTemplate(templateDir, targetDir, tokens)
|
|
164
169
|
|
|
165
170
|
process.stdout.write(
|
|
166
171
|
[
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/create-agent-app",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.22",
|
|
4
4
|
"description": "Create a tested Tangle agent application with either a tool loop or a complete chat interface.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tangle",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
24
|
"index.mjs",
|
|
25
|
+
"template-common",
|
|
25
26
|
"template",
|
|
26
27
|
"template-chat"
|
|
27
28
|
],
|
package/template/_package.json
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"dev": "wrangler dev",
|
|
12
12
|
"deploy": "wrangler deploy",
|
|
13
|
+
"peer-check": "agent-app-peer-check",
|
|
14
|
+
"signoff": "agent-app-signoff",
|
|
13
15
|
"typecheck": "tsc --noEmit",
|
|
14
16
|
"test": "vitest run",
|
|
15
17
|
"test:watch": "vitest",
|
|
@@ -21,16 +23,16 @@
|
|
|
21
23
|
"peerDependencies": {
|
|
22
24
|
"@tangle-network/agent-eval": "0.170.0",
|
|
23
25
|
"@tangle-network/agent-integrations": ">=0.53.55 <0.54.0",
|
|
24
|
-
"@tangle-network/agent-interface": "1.
|
|
25
|
-
"@tangle-network/agent-runtime": "0.
|
|
26
|
+
"@tangle-network/agent-interface": "1.9.0",
|
|
27
|
+
"@tangle-network/agent-runtime": "0.180.0"
|
|
26
28
|
},
|
|
27
29
|
"devDependencies": {
|
|
28
30
|
"@tangle-network/agent-eval": "0.170.0",
|
|
29
31
|
"@tangle-network/agent-integrations": "0.53.55",
|
|
30
|
-
"@tangle-network/agent-interface": "1.
|
|
32
|
+
"@tangle-network/agent-interface": "1.9.0",
|
|
31
33
|
"@tangle-network/agent-knowledge": "10.8.0",
|
|
32
|
-
"@tangle-network/agent-runtime": "0.
|
|
33
|
-
"@tangle-network/sandbox": "0.34.
|
|
34
|
+
"@tangle-network/agent-runtime": "0.180.0",
|
|
35
|
+
"@tangle-network/sandbox": "0.34.3",
|
|
34
36
|
"@types/node": "^22.20.1",
|
|
35
37
|
"typescript": "^7.0.2",
|
|
36
38
|
"viem": "^2.0.0",
|
|
@@ -12,15 +12,17 @@
|
|
|
12
12
|
"deploy": "wrangler deploy",
|
|
13
13
|
"db:migrate": "wrangler d1 migrations apply __PACKAGE_NAME__ --remote",
|
|
14
14
|
"db:migrate:local": "wrangler d1 migrations apply __PACKAGE_NAME__ --local",
|
|
15
|
+
"peer-check": "agent-app-peer-check",
|
|
16
|
+
"signoff": "agent-app-signoff",
|
|
15
17
|
"typecheck": "tsc --noEmit",
|
|
16
18
|
"test": "vitest run",
|
|
17
19
|
"test:watch": "vitest"
|
|
18
20
|
},
|
|
19
21
|
"dependencies": {
|
|
20
22
|
"@tangle-network/agent-app": "__AGENT_APP_VERSION__",
|
|
21
|
-
"@tangle-network/agent-interface": "1.
|
|
22
|
-
"@tangle-network/agent-runtime": "0.
|
|
23
|
-
"@tangle-network/sandbox": "0.34.
|
|
23
|
+
"@tangle-network/agent-interface": "1.9.0",
|
|
24
|
+
"@tangle-network/agent-runtime": "0.180.0",
|
|
25
|
+
"@tangle-network/sandbox": "0.34.3",
|
|
24
26
|
"better-auth": "^1.7.2",
|
|
25
27
|
"drizzle-orm": "^0.45.2",
|
|
26
28
|
"viem": "^2.0.0"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
22
|