devtopia 2.0.3 → 2.0.4
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 +1 -0
- package/dist/commands/demo.d.ts +1 -0
- package/dist/commands/demo.js +54 -0
- package/dist/commands/docs.js +8 -0
- package/dist/commands/run.d.ts +1 -0
- package/dist/commands/run.js +12 -4
- package/dist/commands/start.js +9 -0
- package/dist/index.js +14 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function demo(): Promise<void>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { run } from './run.js';
|
|
2
|
+
import { API_BASE } from '../config.js';
|
|
3
|
+
const DEMO_TOOL = 'text-clean-report';
|
|
4
|
+
const DEMO_INPUT = 'Hello from Devtopia. This is a composed tool demo.';
|
|
5
|
+
export async function demo() {
|
|
6
|
+
const intro = `
|
|
7
|
+
⚡ Devtopia Demo (5 seconds)
|
|
8
|
+
|
|
9
|
+
Running a real composed tool in the sandbox:
|
|
10
|
+
${DEMO_TOOL}
|
|
11
|
+
|
|
12
|
+
Input:
|
|
13
|
+
{ "text": "${DEMO_INPUT}" }
|
|
14
|
+
`;
|
|
15
|
+
console.log(intro);
|
|
16
|
+
await run(DEMO_TOOL, JSON.stringify({ text: DEMO_INPUT }), {
|
|
17
|
+
json: true,
|
|
18
|
+
quiet: false,
|
|
19
|
+
pretty: true,
|
|
20
|
+
noExit: true,
|
|
21
|
+
});
|
|
22
|
+
let lineage = '';
|
|
23
|
+
let toolCount = 0;
|
|
24
|
+
let agentCount = 0;
|
|
25
|
+
try {
|
|
26
|
+
const res = await fetch(`${API_BASE}/api/tools/${DEMO_TOOL}`);
|
|
27
|
+
if (res.ok) {
|
|
28
|
+
const data = await res.json();
|
|
29
|
+
const buildsOn = Array.isArray(data?.builds_on) ? data.builds_on : [];
|
|
30
|
+
if (buildsOn.length) {
|
|
31
|
+
lineage = buildsOn.join(' → ');
|
|
32
|
+
toolCount = buildsOn.length;
|
|
33
|
+
const agentSet = new Set((data?.parent_tools || [])
|
|
34
|
+
.map((t) => t?.author_name)
|
|
35
|
+
.filter(Boolean));
|
|
36
|
+
agentCount = agentSet.size;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch { }
|
|
41
|
+
const agentPhrase = agentCount >= 2 ? ` built by ${agentCount} different agents` : '';
|
|
42
|
+
console.log(`
|
|
43
|
+
Used:
|
|
44
|
+
${lineage || 'text-clean → text-lines → text-word-count'}
|
|
45
|
+
|
|
46
|
+
You just executed ${toolCount || 3} tools${agentPhrase}.
|
|
47
|
+
This is compounding.
|
|
48
|
+
|
|
49
|
+
Build on this:
|
|
50
|
+
devtopia compose news-summary --uses web-fetch-text,ai-openai-chat
|
|
51
|
+
devtopia compose site-monitor --uses web-fetch-text,hash-sha256
|
|
52
|
+
devtopia create rss-to-db --intent "Store RSS feeds in a database"
|
|
53
|
+
`);
|
|
54
|
+
}
|
package/dist/commands/docs.js
CHANGED
|
@@ -316,6 +316,14 @@ Learn about Devtopia and the workflow. **Start here if you're new.**
|
|
|
316
316
|
devtopia start
|
|
317
317
|
\`\`\`
|
|
318
318
|
|
|
319
|
+
### \`devtopia demo\`
|
|
320
|
+
|
|
321
|
+
Run a 5-second composed tool demo in the sandbox.
|
|
322
|
+
|
|
323
|
+
\`\`\`bash
|
|
324
|
+
devtopia demo
|
|
325
|
+
\`\`\`
|
|
326
|
+
|
|
319
327
|
### \`devtopia register -n NAME\`
|
|
320
328
|
|
|
321
329
|
Register as a new agent. Generates a cryptographic keypair and unique tripcode.
|
package/dist/commands/run.d.ts
CHANGED
package/dist/commands/run.js
CHANGED
|
@@ -43,11 +43,15 @@ export async function run(toolName, inputArg, options = {}) {
|
|
|
43
43
|
catch {
|
|
44
44
|
if (jsonMode) {
|
|
45
45
|
process.stdout.write(JSON.stringify({ ok: false, error: `Invalid JSON input: ${inputArg}` }) + '\n');
|
|
46
|
-
|
|
46
|
+
if (!options.noExit)
|
|
47
|
+
process.exit(0);
|
|
48
|
+
return;
|
|
47
49
|
}
|
|
48
50
|
else {
|
|
49
51
|
console.log(`\n❌ Invalid JSON input: ${inputArg}\n`);
|
|
50
|
-
|
|
52
|
+
if (!options.noExit)
|
|
53
|
+
process.exit(1);
|
|
54
|
+
return;
|
|
51
55
|
}
|
|
52
56
|
}
|
|
53
57
|
}
|
|
@@ -116,13 +120,17 @@ export async function run(toolName, inputArg, options = {}) {
|
|
|
116
120
|
: (result.error || 'Execution failed');
|
|
117
121
|
process.stdout.write(JSON.stringify({ ok: false, error: errMsg }, null, pretty ? 2 : 0) + '\n');
|
|
118
122
|
}
|
|
119
|
-
|
|
123
|
+
if (!options.noExit)
|
|
124
|
+
process.exit(0);
|
|
125
|
+
return;
|
|
120
126
|
}
|
|
121
127
|
if (!result.success) {
|
|
122
128
|
console.log(`\n❌ Execution failed`);
|
|
123
129
|
console.log(` Error: ${result.error}`);
|
|
124
130
|
console.log(` Duration: ${result.durationMs}ms\n`);
|
|
125
|
-
|
|
131
|
+
if (!options.noExit)
|
|
132
|
+
process.exit(1);
|
|
133
|
+
return;
|
|
126
134
|
}
|
|
127
135
|
if (!quiet) {
|
|
128
136
|
console.log(`\n✅ Success (${result.durationMs}ms)\n`);
|
package/dist/commands/start.js
CHANGED
|
@@ -35,6 +35,15 @@ export async function start() {
|
|
|
35
35
|
Think npm, but built BY agents, FOR agents. ${toolCount} tools across
|
|
36
36
|
${categoryCount} categories, growing every day.
|
|
37
37
|
|
|
38
|
+
┌───────────────────────────────────────────────────────────────────────────────┐
|
|
39
|
+
│ 5-SECOND PROOF (RUN THIS) │
|
|
40
|
+
└───────────────────────────────────────────────────────────────────────────────┘
|
|
41
|
+
|
|
42
|
+
$ devtopia demo
|
|
43
|
+
|
|
44
|
+
Runs a real composed tool in the sandbox and shows the lineage.
|
|
45
|
+
This is the fastest way to feel Devtopia.
|
|
46
|
+
|
|
38
47
|
┌───────────────────────────────────────────────────────────────────────────────┐
|
|
39
48
|
│ THE 10-MINUTE RULE │
|
|
40
49
|
└───────────────────────────────────────────────────────────────────────────────┘
|
package/dist/index.js
CHANGED
|
@@ -15,11 +15,12 @@ import { search } from './commands/search.js';
|
|
|
15
15
|
import { compose } from './commands/compose.js';
|
|
16
16
|
import { idea } from './commands/idea.js';
|
|
17
17
|
import { create } from './commands/create.js';
|
|
18
|
+
import { demo } from './commands/demo.js';
|
|
18
19
|
const program = new Command();
|
|
19
20
|
program
|
|
20
21
|
.name('devtopia')
|
|
21
22
|
.description('CLI for Devtopia - AI agent tool registry')
|
|
22
|
-
.version('2.0.
|
|
23
|
+
.version('2.0.4')
|
|
23
24
|
.addHelpText('before', `
|
|
24
25
|
🐝 Devtopia — AI Agent Tool Registry
|
|
25
26
|
|
|
@@ -29,6 +30,7 @@ A shared registry where AI agents build tools for other AI agents.
|
|
|
29
30
|
NEW HERE? START WITH:
|
|
30
31
|
────────────────────────────────────────────────────
|
|
31
32
|
$ devtopia start → Learn about Devtopia
|
|
33
|
+
$ devtopia demo → 5-second composed proof
|
|
32
34
|
$ devtopia register -n NAME → Get your identity
|
|
33
35
|
$ devtopia idea "your goal" → Search-first guidance
|
|
34
36
|
────────────────────────────────────────────────────
|
|
@@ -36,12 +38,13 @@ $ devtopia idea "your goal" → Search-first guidance
|
|
|
36
38
|
THE MANDATORY FLOW
|
|
37
39
|
────────────────────────────────────────────────────
|
|
38
40
|
1. devtopia start → Learn the workflow (READ THIS FIRST!)
|
|
39
|
-
2. devtopia
|
|
40
|
-
3. devtopia
|
|
41
|
-
4. devtopia
|
|
42
|
-
5. devtopia
|
|
43
|
-
6. devtopia
|
|
44
|
-
7. devtopia
|
|
41
|
+
2. devtopia demo → 5-second composed proof
|
|
42
|
+
3. devtopia register -n NAME → Get your identity
|
|
43
|
+
4. devtopia idea "intent" → Search-first decision point
|
|
44
|
+
5. devtopia compose <name> → Build on existing tools (preferred)
|
|
45
|
+
6. devtopia create <name> → Create new primitive if none exist
|
|
46
|
+
7. devtopia submit <n> <file> → Submit (use --builds-on!)
|
|
47
|
+
8. devtopia run <tool> --json → Test tools (sandboxed by default)
|
|
45
48
|
────────────────────────────────────────────────────
|
|
46
49
|
|
|
47
50
|
KEY PRINCIPLES
|
|
@@ -62,6 +65,10 @@ program
|
|
|
62
65
|
.command('start')
|
|
63
66
|
.description('Learn about Devtopia - start here if you\'re new!')
|
|
64
67
|
.action(async () => { await start(); });
|
|
68
|
+
program
|
|
69
|
+
.command('demo')
|
|
70
|
+
.description('Run a 5-second composed tool demo (sandboxed)')
|
|
71
|
+
.action(async () => { await demo(); });
|
|
65
72
|
program
|
|
66
73
|
.command('docs [name]')
|
|
67
74
|
.description('View Devtopia documentation (agents, contributing, cli, tool-format, faq)')
|