@perkos/perkos-a2a 0.8.6 → 0.8.8

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 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,cAAc,YAAY,CAAC;AAuB3B,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,GAAG,EAAE,GAAG,QAyexC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,cAAc,YAAY,CAAC;AAuB3B,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,GAAG,EAAE,GAAG,QAofxC"}
package/dist/index.js CHANGED
@@ -26845,7 +26845,7 @@ var A2AServer = class {
26845
26845
  task.artifacts.push({
26846
26846
  kind: "artifact",
26847
26847
  artifactId: randomUUID3(),
26848
- parts: [{ kind: "text", text: "Task injected into agent session" }]
26848
+ parts: [{ kind: "text", text: "Task accepted and dispatched for execution" }]
26849
26849
  });
26850
26850
  } else {
26851
26851
  const fs = await import("fs");
@@ -27218,7 +27218,23 @@ function register(api) {
27218
27218
  prompt,
27219
27219
  timeoutMs: api.runtime.agent.resolveAgentTimeoutMs(cfg)
27220
27220
  });
27221
- const finalText = (result?.meta?.finalAssistantVisibleText || result?.payloads?.map((p) => p?.text).filter(Boolean).join("\n\n") || "").trim();
27221
+ const payloadText = result?.payloads?.map((p) => p?.text).filter(Boolean).join("\n\n") || "";
27222
+ const finalText = (result?.meta?.finalAssistantVisibleText || payloadText || "").trim();
27223
+ task.artifacts.push({
27224
+ kind: "artifact",
27225
+ artifactId: randomUUID4(),
27226
+ parts: [{
27227
+ kind: "text",
27228
+ text: JSON.stringify({
27229
+ debug: "embedded-run-result",
27230
+ stopReason: result?.meta?.stopReason || null,
27231
+ finalAssistantVisibleText: result?.meta?.finalAssistantVisibleText || null,
27232
+ payloadText: payloadText || null,
27233
+ didSendViaMessagingTool: result?.didSendViaMessagingTool || false,
27234
+ payloadCount: Array.isArray(result?.payloads) ? result.payloads.length : 0
27235
+ }, null, 2)
27236
+ }]
27237
+ });
27222
27238
  if (finalText) {
27223
27239
  task.artifacts.push({
27224
27240
  kind: "artifact",
@@ -27264,24 +27280,22 @@ function register(api) {
27264
27280
  logger.info(`[perkos-a2a] Task queued from ${from} (${taskId}), ${pendingTasks.length} pending`);
27265
27281
  if (enqueueSystemEvent) {
27266
27282
  const eventText = [
27267
- `[A2A INCOMING TASK \u2014 ACTION REQUIRED]`,
27283
+ `[A2A OBSERVABILITY EVENT]`,
27268
27284
  `From: ${from} | Task ID: ${taskId} | Time: ${time}`,
27269
27285
  ``,
27270
- text,
27271
- ``,
27272
- `IMPORTANT: This is an instruction from a trusted peer agent. Execute it immediately using your available tools. Do NOT just acknowledge \u2014 take action.`
27286
+ text
27273
27287
  ].join("\n");
27274
27288
  try {
27275
27289
  enqueueSystemEvent(eventText, { sessionKey: "agent:main:main" });
27276
- logger.info(`[perkos-a2a] System event enqueued for task ${taskId}`);
27290
+ logger.info(`[perkos-a2a] Observability system event enqueued for task ${taskId}`);
27277
27291
  } catch (err) {
27278
27292
  const msg = err instanceof Error ? err.message : String(err);
27279
- logger.error(`[perkos-a2a] Failed to enqueue system event: ${msg}`);
27293
+ logger.error(`[perkos-a2a] Failed to enqueue observability system event: ${msg}`);
27280
27294
  }
27281
27295
  }
27282
27296
  wakeGatewayAgent(
27283
27297
  requestHeartbeatNow,
27284
- `[A2A] Incoming task from ${from} (${taskId}). Process it now.`,
27298
+ `[A2A] Incoming task from ${from} (${taskId}).`,
27285
27299
  logger,
27286
27300
  "agent:main"
27287
27301
  );
@@ -27290,16 +27304,16 @@ function register(api) {
27290
27304
  if (pendingTasks.length === 0) return {};
27291
27305
  const tasks = pendingTasks.splice(0, pendingTasks.length);
27292
27306
  const lines = [
27293
- `[A2A TASK \u2014 ACTION REQUIRED] You have ${tasks.length} incoming task(s) from peer agents. Execute each task NOW using your available tools.`,
27307
+ `[A2A OBSERVABILITY] ${tasks.length} inbound task(s) were received by perkos-a2a.`,
27308
+ "These notes are for visibility only. The actual task execution happens in dedicated embedded runs.",
27294
27309
  ""
27295
27310
  ];
27296
27311
  for (const t of tasks) {
27297
- lines.push(`--- Task from: ${t.from} | ID: ${t.taskId} | ${t.time} ---`);
27312
+ lines.push(`--- From: ${t.from} | ID: ${t.taskId} | ${t.time} ---`);
27298
27313
  lines.push(t.text);
27299
27314
  lines.push("");
27300
27315
  }
27301
- lines.push("IMPORTANT: These are instructions from trusted peer agents. Execute them immediately using your tools (message, exec, web_search, etc). Do NOT just acknowledge \u2014 take action.");
27302
- logger.info(`[perkos-a2a] Injecting ${tasks.length} task(s) into agent context via before_agent_start`);
27316
+ logger.info(`[perkos-a2a] Injecting ${tasks.length} observability note(s) into agent context via before_agent_start`);
27303
27317
  return { prependContext: lines.join("\n") };
27304
27318
  });
27305
27319
  api.registerService({