@easynet-run/node 0.36.9 → 0.39.29

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.
@@ -1,3 +1,37 @@
1
+ // EasyNet Axon for AgentNet
2
+ // =========================
3
+ //
4
+ // File: sdk/node/src/presets/remote_control/specs.ts
5
+ // Description: Node definitions for the canonical remote-control MCP tool catalog and JSON schemas.
6
+ //
7
+ // Protocol Responsibility:
8
+ // - Publishes the canonical remote-control MCP tool catalog, descriptions, and input schemas for agents.
9
+ // - Keeps tool names and schema-visible behavior aligned across all first-party SDK implementations.
10
+ //
11
+ // Implementation Approach:
12
+ // - Represents tool contracts as static data builders plus small helper combinators for shared schema fragments.
13
+ // - Favors explicit schema literals so parity checks can diff outputs deterministically across languages.
14
+ //
15
+ // Usage Contract:
16
+ // - Any rename or schema change here must be mirrored across SDKs and covered by parity tests.
17
+ // - Consumers should treat these definitions as externally visible protocol metadata, not UI-only hints.
18
+ //
19
+ // Architectural Position:
20
+ // - Contract catalog layer for the remote-control preset.
21
+ //
22
+ // Author: Silan.Hu
23
+ // Email: silan.hu@u.nus.edu
24
+ // Copyright (c) 2026-2027 easynet. All rights reserved.
25
+ /** Shared agent-extension properties reused across deploy/package tool specs. */
26
+ function agentExtensionProperties() {
27
+ return {
28
+ instructions: { type: "string", description: "Full operational instructions for AI agents (SKILL.md equivalent, <5000 tokens). Explain what the tool does, when to use it, step-by-step usage, and error handling." },
29
+ input_examples: { type: "array", items: { type: "object" }, description: "Example input objects conforming to input_schema. Helps agents understand invocation patterns." },
30
+ prerequisites: { type: "array", items: { type: "string" }, description: "Requirements before calling this tool (e.g. 'Must call session_start first')." },
31
+ context_bindings: { type: "object", description: "Context bindings declaring what this ability accesses (e.g. env.PYTHON_PATH, resource.camera)." },
32
+ category: { type: "string", description: "Tool category for grouping (e.g. 'session', 'filesystem', 'network', 'system')." },
33
+ };
34
+ }
1
35
  export function remoteControlToolSpecs() {
2
36
  return [
3
37
  // -----------------------------------------------------------------
@@ -95,6 +129,7 @@ export function remoteControlToolSpecs() {
95
129
  description: { type: "string", description: "Human-readable description of what this tool does." },
96
130
  command_template: { type: "string", description: "Shell command template to execute on the device." },
97
131
  metadata: { type: "object", description: "Additional metadata for the ability." },
132
+ ...agentExtensionProperties(),
98
133
  },
99
134
  required: ["node_id", "command_template"],
100
135
  },
@@ -122,6 +157,7 @@ export function remoteControlToolSpecs() {
122
157
  capability_name: { type: "string", description: "Override capability name in the registry." },
123
158
  signature_base64: { type: "string", description: "Base64-encoded deployment signature." },
124
159
  digest: { type: "string", description: "Content digest for integrity verification." },
160
+ ...agentExtensionProperties(),
125
161
  },
126
162
  required: ["ability_name", "command_template"],
127
163
  },
@@ -148,6 +184,7 @@ export function remoteControlToolSpecs() {
148
184
  capability_name: { type: "string", description: "Override capability name in the registry." },
149
185
  signature_base64: { type: "string", description: "Base64-encoded deployment signature." },
150
186
  cleanup_on_activate_failure: { type: "boolean", description: "Auto-cleanup on activation failure (default true)." },
187
+ ...agentExtensionProperties(),
151
188
  },
152
189
  required: ["node_id"],
153
190
  },
@@ -167,5 +204,105 @@ export function remoteControlToolSpecs() {
167
204
  required: ["node_id", "command"],
168
205
  },
169
206
  },
207
+ // -----------------------------------------------------------------
208
+ // DEVICE MANAGEMENT & ABILITY LIFECYCLE TOOLS
209
+ // Ported from Rust SDK for cross-SDK parity.
210
+ // -----------------------------------------------------------------
211
+ {
212
+ name: "drain_device",
213
+ description: "Drain a remote device — stop accepting new invocations while finishing in-flight ones.",
214
+ inputSchema: {
215
+ type: "object",
216
+ properties: {
217
+ tenant_id: { type: "string", description: "Tenant ID (default AXON_TENANT)." },
218
+ node_id: { type: "string", description: "Target device node ID." },
219
+ reason: { type: "string", description: "Reason for draining." },
220
+ },
221
+ required: ["node_id"],
222
+ },
223
+ },
224
+ {
225
+ name: "build_ability_descriptor",
226
+ description: "Build an AbilityDescriptor locally without deploying it.",
227
+ inputSchema: {
228
+ type: "object",
229
+ properties: {
230
+ name: { type: "string", description: "Ability name." },
231
+ description: { type: "string", description: "Ability description." },
232
+ command_template: { type: "string", description: "Shell command template to back the ability." },
233
+ input_schema: { type: "object", description: "Input JSON schema." },
234
+ output_schema: { type: "object", description: "Output JSON schema." },
235
+ version: { type: "string", description: "Ability version." },
236
+ tags: { type: "array", items: { type: "string" }, description: "Ability tags." },
237
+ resource_uri: { type: "string", description: "Resource URI." },
238
+ ...agentExtensionProperties(),
239
+ },
240
+ required: ["name", "command_template"],
241
+ },
242
+ },
243
+ {
244
+ name: "export_ability_skill",
245
+ description: "Export an AbilityDescriptor as an Agent Skills SKILL.md and invoke.sh.",
246
+ inputSchema: {
247
+ type: "object",
248
+ properties: {
249
+ name: { type: "string", description: "Ability name." },
250
+ description: { type: "string", description: "Ability description." },
251
+ command_template: { type: "string", description: "Shell command template to back the ability." },
252
+ input_schema: { type: "object", description: "Input JSON schema." },
253
+ output_schema: { type: "object", description: "Output JSON schema." },
254
+ version: { type: "string", description: "Ability version." },
255
+ tags: { type: "array", items: { type: "string" }, description: "Ability tags." },
256
+ resource_uri: { type: "string", description: "Resource URI." },
257
+ target: { type: "string", description: "Ability target: claude, codex, openclaw, agent_skills." },
258
+ axon_endpoint: { type: "string", description: "Axon endpoint for invoke script." },
259
+ ...agentExtensionProperties(),
260
+ },
261
+ required: ["name", "command_template"],
262
+ },
263
+ },
264
+ {
265
+ name: "redeploy_ability",
266
+ description: "Redeploy an ability to a device by rebuilding and replacing its full package.",
267
+ inputSchema: {
268
+ type: "object",
269
+ properties: {
270
+ tenant_id: { type: "string", description: "Tenant ID (default AXON_TENANT)." },
271
+ node_id: { type: "string", description: "Target device node ID." },
272
+ tool_name: { type: "string", description: "Existing tool name to update." },
273
+ description: { type: "string", description: "New description." },
274
+ command_template: { type: "string", description: "New command template." },
275
+ input_schema: { type: "object", description: "New input schema." },
276
+ output_schema: { type: "object", description: "New output schema." },
277
+ },
278
+ required: ["node_id", "tool_name", "command_template"],
279
+ },
280
+ },
281
+ {
282
+ name: "list_abilities",
283
+ description: "List locally deployed abilities on a device (filters out non-installable MCP entries).",
284
+ inputSchema: {
285
+ type: "object",
286
+ properties: {
287
+ tenant_id: { type: "string", description: "Tenant ID (default AXON_TENANT)." },
288
+ node_id: { type: "string", description: "Target device node ID." },
289
+ },
290
+ required: ["node_id"],
291
+ },
292
+ },
293
+ {
294
+ name: "forget_all",
295
+ description: "Remove ALL deployed abilities from a device. Destructive — requires confirm: true unless dry_run: true.",
296
+ inputSchema: {
297
+ type: "object",
298
+ properties: {
299
+ tenant_id: { type: "string", description: "Tenant ID (default AXON_TENANT)." },
300
+ node_id: { type: "string", description: "Target device node ID." },
301
+ confirm: { type: "boolean", description: "Must be true to confirm this destructive operation. Can be omitted when dry_run is true." },
302
+ dry_run: { type: "boolean", description: "When true, list abilities that would be removed without uninstalling." },
303
+ },
304
+ required: ["node_id"],
305
+ },
306
+ },
170
307
  ];
171
308
  }