agenticros 0.2.3 → 0.3.0

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.
Files changed (80) hide show
  1. package/README.md +4 -0
  2. package/dist/__tests__/skill-scaffold.test.d.ts +2 -0
  3. package/dist/__tests__/skill-scaffold.test.d.ts.map +1 -0
  4. package/dist/__tests__/skill-scaffold.test.js +80 -0
  5. package/dist/__tests__/skill-scaffold.test.js.map +1 -0
  6. package/dist/commands/create-skill.d.ts +9 -0
  7. package/dist/commands/create-skill.d.ts.map +1 -0
  8. package/dist/commands/create-skill.js +41 -0
  9. package/dist/commands/create-skill.js.map +1 -0
  10. package/dist/commands/init.d.ts.map +1 -1
  11. package/dist/commands/init.js +4 -20
  12. package/dist/commands/init.js.map +1 -1
  13. package/dist/commands/publish-skill.d.ts +10 -0
  14. package/dist/commands/publish-skill.d.ts.map +1 -0
  15. package/dist/commands/publish-skill.js +222 -0
  16. package/dist/commands/publish-skill.js.map +1 -0
  17. package/dist/commands/skills-dev.d.ts +11 -0
  18. package/dist/commands/skills-dev.d.ts.map +1 -0
  19. package/dist/commands/skills-dev.js +154 -0
  20. package/dist/commands/skills-dev.js.map +1 -0
  21. package/dist/commands/skills.d.ts.map +1 -1
  22. package/dist/commands/skills.js +21 -11
  23. package/dist/commands/skills.js.map +1 -1
  24. package/dist/commands/up.js +1 -1
  25. package/dist/commands/up.js.map +1 -1
  26. package/dist/index.js +37 -2
  27. package/dist/index.js.map +1 -1
  28. package/dist/menu.d.ts.map +1 -1
  29. package/dist/menu.js +28 -2
  30. package/dist/menu.js.map +1 -1
  31. package/dist/runners/real-robot.d.ts +2 -3
  32. package/dist/runners/real-robot.d.ts.map +1 -1
  33. package/dist/runners/real-robot.js +2 -3
  34. package/dist/runners/real-robot.js.map +1 -1
  35. package/dist/util/marketplace.d.ts +26 -2
  36. package/dist/util/marketplace.d.ts.map +1 -1
  37. package/dist/util/marketplace.js +56 -4
  38. package/dist/util/marketplace.js.map +1 -1
  39. package/dist/util/skill-manifest.d.ts +58 -0
  40. package/dist/util/skill-manifest.d.ts.map +1 -0
  41. package/dist/util/skill-manifest.js +81 -0
  42. package/dist/util/skill-manifest.js.map +1 -0
  43. package/dist/util/skill-scaffold.d.ts +26 -0
  44. package/dist/util/skill-scaffold.d.ts.map +1 -0
  45. package/dist/util/skill-scaffold.js +153 -0
  46. package/dist/util/skill-scaffold.js.map +1 -0
  47. package/dist/util/workspace.d.ts +9 -0
  48. package/dist/util/workspace.d.ts.map +1 -1
  49. package/dist/util/workspace.js +36 -15
  50. package/dist/util/workspace.js.map +1 -1
  51. package/package.json +2 -1
  52. package/runtime/BUNDLE.json +1 -1
  53. package/runtime/README.md +2 -0
  54. package/runtime/docs/cli.md +13 -1
  55. package/runtime/packages/core/package.json +1 -1
  56. package/runtime/packages/core/src/transport/factory.ts +12 -2
  57. package/runtime/packages/core/src/transport/webrtc/node-datachannel-loader.ts +31 -0
  58. package/runtime/packages/core/src/transport/webrtc/transport.ts +12 -7
  59. package/runtime/pnpm-lock.yaml +48 -18
  60. package/runtime/scripts/start_demo.sh +80 -30
  61. package/templates/skills/camera/README.md +16 -0
  62. package/templates/skills/camera/demo.md +5 -0
  63. package/templates/skills/camera/package.json +38 -0
  64. package/templates/skills/camera/src/index.ts +68 -0
  65. package/templates/skills/camera/tsconfig.json +15 -0
  66. package/templates/skills/depth/README.md +16 -0
  67. package/templates/skills/depth/demo.md +5 -0
  68. package/templates/skills/depth/package.json +38 -0
  69. package/templates/skills/depth/src/index.ts +69 -0
  70. package/templates/skills/depth/tsconfig.json +15 -0
  71. package/templates/skills/hello/README.md +32 -0
  72. package/templates/skills/hello/demo.md +5 -0
  73. package/templates/skills/hello/package.json +37 -0
  74. package/templates/skills/hello/src/index.ts +37 -0
  75. package/templates/skills/hello/tsconfig.json +15 -0
  76. package/templates/skills/robot/README.md +18 -0
  77. package/templates/skills/robot/demo.md +5 -0
  78. package/templates/skills/robot/package.json +40 -0
  79. package/templates/skills/robot/src/index.ts +69 -0
  80. package/templates/skills/robot/tsconfig.json +15 -0
@@ -0,0 +1,68 @@
1
+ /**
2
+ * {{displayName}} — capture one frame from the robot camera.
3
+ */
4
+
5
+ import { Type } from "@sinclair/typebox";
6
+ import type { RosTransport } from "@agenticros/core";
7
+
8
+ const TOOL_NAME = "{{toolName}}";
9
+
10
+ interface SkillContext {
11
+ getTransport(): RosTransport;
12
+ }
13
+
14
+ interface SkillPluginApi {
15
+ registerTool(tool: {
16
+ name: string;
17
+ label: string;
18
+ description: string;
19
+ parameters: unknown;
20
+ execute: (
21
+ toolCallId: string,
22
+ params: Record<string, unknown>,
23
+ signal?: AbortSignal,
24
+ ) => Promise<{ content: { type: string; text: string }[]; details?: unknown }>;
25
+ }): void;
26
+ }
27
+
28
+ export function registerSkill(
29
+ api: SkillPluginApi,
30
+ config: { robot?: { cameraTopic?: string } },
31
+ context: SkillContext,
32
+ ): void {
33
+ api.registerTool({
34
+ name: TOOL_NAME,
35
+ label: "{{displayName}}",
36
+ description: "{{description}}",
37
+ parameters: Type.Object({
38
+ topic: Type.Optional(
39
+ Type.String({ description: "Camera topic override (default from robot config)." }),
40
+ ),
41
+ }),
42
+ async execute(_id, params) {
43
+ const transport = context.getTransport();
44
+ const topic =
45
+ (typeof params.topic === "string" && params.topic) ||
46
+ config.robot?.cameraTopic ||
47
+ "camera/color/image_raw";
48
+ const msg = await transport.subscribeOnce(topic, 5000);
49
+ const encoding =
50
+ msg && typeof msg === "object" && "encoding" in msg
51
+ ? String((msg as { encoding?: string }).encoding ?? "unknown")
52
+ : "unknown";
53
+ const width =
54
+ msg && typeof msg === "object" && "width" in msg
55
+ ? Number((msg as { width?: number }).width ?? 0)
56
+ : 0;
57
+ const height =
58
+ msg && typeof msg === "object" && "height" in msg
59
+ ? Number((msg as { height?: number }).height ?? 0)
60
+ : 0;
61
+ const summary = `Captured ${width}x${height} frame (${encoding}) from ${topic}.`;
62
+ return {
63
+ content: [{ type: "text", text: summary }],
64
+ details: { topic, width, height, encoding, captured: Boolean(msg) },
65
+ };
66
+ },
67
+ });
68
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "outDir": "dist",
7
+ "rootDir": "src",
8
+ "strict": true,
9
+ "declaration": true,
10
+ "declarationMap": true,
11
+ "sourceMap": true,
12
+ "skipLibCheck": true
13
+ },
14
+ "include": ["src/**/*"]
15
+ }
@@ -0,0 +1,16 @@
1
+ # {{displayName}}
2
+
3
+ {{description}}
4
+
5
+ ## Local dev
6
+
7
+ ```bash
8
+ npm install
9
+ npm run dev
10
+ ```
11
+
12
+ ## Publish
13
+
14
+ ```bash
15
+ npx agenticros publish
16
+ ```
@@ -0,0 +1,5 @@
1
+ # Prompt examples
2
+
3
+ - Measure distance to the object in front of the robot
4
+ - Run {{displayName}}
5
+ - How far away is the obstacle?
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "agenticros-skill-{{slug}}",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "{{description}}",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "scripts": {
9
+ "build": "tsc",
10
+ "typecheck": "tsc --noEmit",
11
+ "dev": "npx agenticros skills dev"
12
+ },
13
+ "agenticros": {
14
+ "id": "{{slug}}",
15
+ "displayName": "{{displayName}}",
16
+ "description": "{{description}}",
17
+ "tutorial": false,
18
+ "categories": ["vision", "telemetry"],
19
+ "screenshots": ["docs/icon.png"],
20
+ "capabilities": [
21
+ {
22
+ "id": "{{toolName}}",
23
+ "verb": "measure",
24
+ "description": "{{description}}"
25
+ }
26
+ ]
27
+ },
28
+ "dependencies": {
29
+ "@agenticros/core": "^0.5.0",
30
+ "@sinclair/typebox": "^0.34.0"
31
+ },
32
+ "devDependencies": {
33
+ "@types/node": "^20.17.0",
34
+ "typescript": "^5.7.0"
35
+ },
36
+ "keywords": ["agenticros", "depth", "realsense"],
37
+ "license": "Apache-2.0"
38
+ }
@@ -0,0 +1,69 @@
1
+ /**
2
+ * {{displayName}} — sample depth at image center (RealSense / depth camera).
3
+ */
4
+
5
+ import { Type } from "@sinclair/typebox";
6
+ import type { RosTransport } from "@agenticros/core";
7
+
8
+ const TOOL_NAME = "{{toolName}}";
9
+
10
+ interface DepthSampleResult {
11
+ distance_m: number;
12
+ valid: boolean;
13
+ topic: string;
14
+ }
15
+
16
+ interface SkillContext {
17
+ getTransport(): RosTransport;
18
+ getDepthDistance(
19
+ transport: RosTransport,
20
+ topic: string,
21
+ timeoutMs?: number,
22
+ ): Promise<DepthSampleResult>;
23
+ }
24
+
25
+ interface SkillPluginApi {
26
+ registerTool(tool: {
27
+ name: string;
28
+ label: string;
29
+ description: string;
30
+ parameters: unknown;
31
+ execute: (
32
+ toolCallId: string,
33
+ params: Record<string, unknown>,
34
+ signal?: AbortSignal,
35
+ ) => Promise<{ content: { type: string; text: string }[]; details?: unknown }>;
36
+ }): void;
37
+ }
38
+
39
+ export function registerSkill(
40
+ api: SkillPluginApi,
41
+ config: { robot?: { depthTopic?: string } },
42
+ context: SkillContext,
43
+ ): void {
44
+ api.registerTool({
45
+ name: TOOL_NAME,
46
+ label: "{{displayName}}",
47
+ description: "{{description}}",
48
+ parameters: Type.Object({
49
+ topic: Type.Optional(
50
+ Type.String({ description: "Depth topic override (default: depth/image_rect_raw)." }),
51
+ ),
52
+ }),
53
+ async execute(_id, params) {
54
+ const transport = context.getTransport();
55
+ const topic =
56
+ (typeof params.topic === "string" && params.topic) ||
57
+ config.robot?.depthTopic ||
58
+ "depth/image_rect_raw";
59
+ const sample = await context.getDepthDistance(transport, topic, 5000);
60
+ const text = sample.valid
61
+ ? `Object is ${sample.distance_m.toFixed(1)} meters away.`
62
+ : `No valid depth reading on ${topic}.`;
63
+ return {
64
+ content: [{ type: "text", text }],
65
+ details: sample,
66
+ };
67
+ },
68
+ });
69
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "outDir": "dist",
7
+ "rootDir": "src",
8
+ "strict": true,
9
+ "declaration": true,
10
+ "declarationMap": true,
11
+ "sourceMap": true,
12
+ "skipLibCheck": true
13
+ },
14
+ "include": ["src/**/*"]
15
+ }
@@ -0,0 +1,32 @@
1
+ # {{displayName}}
2
+
3
+ {{description}}
4
+
5
+ > **Tutorial skill** — meant for local learning with `npm run dev`. Customize the code or scaffold with `--template robot` before publishing to the marketplace.
6
+
7
+ ## Local dev
8
+
9
+ ```bash
10
+ npm install
11
+ npm run dev
12
+ ```
13
+
14
+ ## Invoke (OpenClaw / Claude / Gemini)
15
+
16
+ After registering with your gateway:
17
+
18
+ ```bash
19
+ agenticros skills add .
20
+ agenticros skills sync
21
+ # restart gateway
22
+ ```
23
+
24
+ Try prompts from [demo.md](./demo.md).
25
+
26
+ ## Publish
27
+
28
+ ```bash
29
+ npx agenticros publish
30
+ ```
31
+
32
+ Tutorial skills stay unlisted on [skills.agenticros.com](https://skills.agenticros.com) unless you customize and use `--graduate`.
@@ -0,0 +1,5 @@
1
+ # Prompt examples
2
+
3
+ - Run {{displayName}}
4
+ - Execute {{toolName}}
5
+ - Test my first skill
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "agenticros-skill-{{slug}}",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "{{description}}",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "scripts": {
9
+ "build": "tsc",
10
+ "typecheck": "tsc --noEmit",
11
+ "dev": "npx agenticros skills dev"
12
+ },
13
+ "agenticros": {
14
+ "id": "{{slug}}",
15
+ "displayName": "{{displayName}}",
16
+ "description": "{{description}}",
17
+ "tutorial": true,
18
+ "categories": ["communication"],
19
+ "screenshots": ["docs/icon.png"],
20
+ "capabilities": [
21
+ {
22
+ "id": "{{toolName}}",
23
+ "verb": "run",
24
+ "description": "{{description}}"
25
+ }
26
+ ]
27
+ },
28
+ "dependencies": {
29
+ "@sinclair/typebox": "^0.34.0"
30
+ },
31
+ "devDependencies": {
32
+ "@types/node": "^20.17.0",
33
+ "typescript": "^5.7.0"
34
+ },
35
+ "keywords": ["agenticros", "tutorial", "getting-started"],
36
+ "license": "Apache-2.0"
37
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * {{displayName}} — AgenticROS hello-world skill (local dev / tutorial).
3
+ */
4
+
5
+ import { Type } from "@sinclair/typebox";
6
+
7
+ const TOOL_NAME = "{{toolName}}";
8
+
9
+ interface SkillPluginApi {
10
+ registerTool(tool: {
11
+ name: string;
12
+ label: string;
13
+ description: string;
14
+ parameters: unknown;
15
+ execute: (
16
+ toolCallId: string,
17
+ params: Record<string, unknown>,
18
+ signal?: AbortSignal,
19
+ ) => Promise<{ content: { type: string; text: string }[]; details?: unknown }>;
20
+ }): void;
21
+ }
22
+
23
+ export function registerSkill(api: SkillPluginApi): void {
24
+ api.registerTool({
25
+ name: TOOL_NAME,
26
+ label: "{{displayName}}",
27
+ description: "{{description}}",
28
+ parameters: Type.Object({}),
29
+ async execute() {
30
+ const message = "Hello from AgenticROS!";
31
+ return {
32
+ content: [{ type: "text", text: message }],
33
+ details: { success: true, message },
34
+ };
35
+ },
36
+ });
37
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "outDir": "dist",
7
+ "rootDir": "src",
8
+ "strict": true,
9
+ "declaration": true,
10
+ "declarationMap": true,
11
+ "sourceMap": true,
12
+ "skipLibCheck": true
13
+ },
14
+ "include": ["src/**/*"]
15
+ }
@@ -0,0 +1,18 @@
1
+ # {{displayName}}
2
+
3
+ {{description}}
4
+
5
+ ## Local dev
6
+
7
+ ```bash
8
+ npm install
9
+ npm run dev
10
+ ```
11
+
12
+ Use `npm run dev -- --live` when your robot gateway is connected to exercise real cmd_vel.
13
+
14
+ ## Publish
15
+
16
+ ```bash
17
+ npx agenticros publish
18
+ ```
@@ -0,0 +1,5 @@
1
+ # Prompt examples
2
+
3
+ - Wave hello
4
+ - Run {{displayName}}
5
+ - Make the robot wave
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "agenticros-skill-{{slug}}",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "{{description}}",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "scripts": {
9
+ "build": "tsc",
10
+ "typecheck": "tsc --noEmit",
11
+ "dev": "npx agenticros skills dev"
12
+ },
13
+ "agenticros": {
14
+ "id": "{{slug}}",
15
+ "displayName": "{{displayName}}",
16
+ "description": "{{description}}",
17
+ "tutorial": false,
18
+ "categories": ["human-interaction", "navigation"],
19
+ "screenshots": ["docs/icon.png"],
20
+ "capabilities": [
21
+ {
22
+ "id": "{{toolName}}",
23
+ "verb": "wave",
24
+ "description": "{{description}}",
25
+ "interruptible": true,
26
+ "blocks_base": true
27
+ }
28
+ ]
29
+ },
30
+ "dependencies": {
31
+ "@agenticros/core": "^0.5.0",
32
+ "@sinclair/typebox": "^0.34.0"
33
+ },
34
+ "devDependencies": {
35
+ "@types/node": "^20.17.0",
36
+ "typescript": "^5.7.0"
37
+ },
38
+ "keywords": ["agenticros", "robot", "cmd_vel"],
39
+ "license": "Apache-2.0"
40
+ }
@@ -0,0 +1,69 @@
1
+ /**
2
+ * {{displayName}} — simple cmd_vel wave gesture.
3
+ */
4
+
5
+ import { Type } from "@sinclair/typebox";
6
+ import type { RosTransport } from "@agenticros/core";
7
+
8
+ const TOOL_NAME = "{{toolName}}";
9
+ const CMD_VEL_TOPIC = "cmd_vel";
10
+
11
+ interface SkillContext {
12
+ getTransport(): RosTransport;
13
+ }
14
+
15
+ interface SkillPluginApi {
16
+ registerTool(tool: {
17
+ name: string;
18
+ label: string;
19
+ description: string;
20
+ parameters: unknown;
21
+ execute: (
22
+ toolCallId: string,
23
+ params: Record<string, unknown>,
24
+ signal?: AbortSignal,
25
+ ) => Promise<{ content: { type: string; text: string }[]; details?: unknown }>;
26
+ }): void;
27
+ }
28
+
29
+ function sleep(ms: number): Promise<void> {
30
+ return new Promise((r) => setTimeout(r, ms));
31
+ }
32
+
33
+ async function publishTwist(
34
+ transport: RosTransport,
35
+ linear: number,
36
+ angular: number,
37
+ ): Promise<void> {
38
+ await transport.publish(CMD_VEL_TOPIC, "geometry_msgs/msg/Twist", {
39
+ linear: { x: linear, y: 0, z: 0 },
40
+ angular: { x: 0, y: 0, z: angular },
41
+ });
42
+ }
43
+
44
+ export function registerSkill(
45
+ api: SkillPluginApi,
46
+ _config: unknown,
47
+ context: SkillContext,
48
+ ): void {
49
+ api.registerTool({
50
+ name: TOOL_NAME,
51
+ label: "{{displayName}}",
52
+ description: "{{description}}",
53
+ parameters: Type.Object({}),
54
+ async execute() {
55
+ const transport = context.getTransport();
56
+ // Brief side-to-side angular motion as a "wave".
57
+ await publishTwist(transport, 0, 0.4);
58
+ await sleep(400);
59
+ await publishTwist(transport, 0, -0.4);
60
+ await sleep(400);
61
+ await publishTwist(transport, 0, 0);
62
+ const message = "I waved hello.";
63
+ return {
64
+ content: [{ type: "text", text: message }],
65
+ details: { success: true, message },
66
+ };
67
+ },
68
+ });
69
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "outDir": "dist",
7
+ "rootDir": "src",
8
+ "strict": true,
9
+ "declaration": true,
10
+ "declarationMap": true,
11
+ "sourceMap": true,
12
+ "skipLibCheck": true
13
+ },
14
+ "include": ["src/**/*"]
15
+ }