@lunora/agent 1.0.0-alpha.2 → 1.0.0-alpha.21

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 (79) hide show
  1. package/dist/channels.d.mts +39 -31
  2. package/dist/channels.d.ts +39 -31
  3. package/dist/channels.mjs +1 -181
  4. package/dist/component.d.mts +57 -68
  5. package/dist/component.d.ts +57 -68
  6. package/dist/component.mjs +2 -407
  7. package/dist/inbound.d.mts +20 -20
  8. package/dist/inbound.d.ts +20 -20
  9. package/dist/inbound.mjs +1 -32
  10. package/dist/index.d.mts +474 -490
  11. package/dist/index.d.ts +474 -490
  12. package/dist/index.mjs +1 -18
  13. package/dist/naming.d.mts +19 -19
  14. package/dist/naming.d.ts +19 -19
  15. package/dist/naming.mjs +1 -8
  16. package/dist/packem_shared/AGENT_MODULE-BXx-tSCe.mjs +1 -0
  17. package/dist/packem_shared/VoiceSessionDO-CTaBSdXk.mjs +1 -0
  18. package/dist/packem_shared/adaptMcpResult-18G7zpFo.mjs +2 -0
  19. package/dist/packem_shared/agentAsTool-CJCTyAQG.mjs +1 -0
  20. package/dist/packem_shared/base64-jU-Ci6Tu.mjs +1 -0
  21. package/dist/packem_shared/braintrustTelemetry-CnOI5WAw.mjs +1 -0
  22. package/dist/packem_shared/buildModelMessages-Dm2wVNQy.mjs +5 -0
  23. package/dist/packem_shared/codeTool-DYJVy-bH.mjs +1 -0
  24. package/dist/packem_shared/collectAgenticMemoryTools-DBcP8dUa.mjs +1 -0
  25. package/dist/packem_shared/combineTelemetry-oLCV_EPV.mjs +1 -0
  26. package/dist/packem_shared/common-Dck97z3Y.mjs +1 -0
  27. package/dist/packem_shared/compileAgentWorkflow-C4xqSw82.mjs +1 -0
  28. package/dist/packem_shared/consoleTelemetry-CaoI-NGg.mjs +1 -0
  29. package/dist/packem_shared/createAgentContext-B1IfI7ro.mjs +1 -0
  30. package/dist/packem_shared/createAgentGenerate-BUVImo85.mjs +3 -0
  31. package/dist/packem_shared/createDispatchRunner-CQ8HXscn-BrqT0bIG.mjs +1 -0
  32. package/dist/packem_shared/defineAgent-CKhzzmys.mjs +3 -0
  33. package/dist/packem_shared/defineSkill-DfJxCwfZ.mjs +1 -0
  34. package/dist/packem_shared/functionTool-CWHhkYqd.mjs +1 -0
  35. package/dist/packem_shared/graph-component-B2YmC2eL.mjs +2 -0
  36. package/dist/packem_shared/memory-DNRyyp1b.mjs +1 -0
  37. package/dist/packem_shared/normalizeEntityName-BQpyssvL.mjs +1 -0
  38. package/dist/packem_shared/otlpTelemetry-DcW9mOLV.mjs +1 -0
  39. package/dist/packem_shared/runAgentLoop-DNAt-pGz.mjs +3 -0
  40. package/dist/packem_shared/runVoiceTurn-PkMsfG_v.mjs +1 -0
  41. package/dist/packem_shared/sandboxComponent-BhaGHsQZ.mjs +1 -0
  42. package/dist/packem_shared/sentryTelemetry-Dr2aPuvl.mjs +1 -0
  43. package/dist/packem_shared/types.d-boAM2Yi1.d.mts +1114 -0
  44. package/dist/packem_shared/types.d-boAM2Yi1.d.ts +1114 -0
  45. package/dist/sandbox.d.mts +126 -122
  46. package/dist/sandbox.d.ts +126 -122
  47. package/dist/sandbox.mjs +1 -109
  48. package/dist/telemetry/index.d.mts +185 -104
  49. package/dist/telemetry/index.d.ts +185 -104
  50. package/dist/telemetry/index.mjs +1 -4
  51. package/package.json +8 -8
  52. package/dist/packem_shared/AGENT_MODULE-Dnt_-AAT.mjs +0 -24
  53. package/dist/packem_shared/VoiceSessionDO-DLoXsHGF.mjs +0 -297
  54. package/dist/packem_shared/adaptMcpResult-wtNMvLoP.mjs +0 -65
  55. package/dist/packem_shared/agentAsTool-Dt8NlU6k.mjs +0 -94
  56. package/dist/packem_shared/base64-BVwtgRJV.mjs +0 -18
  57. package/dist/packem_shared/braintrustTelemetry-wuGDErob.mjs +0 -47
  58. package/dist/packem_shared/buildModelMessages-BWFigaoo.mjs +0 -69
  59. package/dist/packem_shared/codeTool-CjgJOC9t.mjs +0 -122
  60. package/dist/packem_shared/collectAgenticMemoryTools-QrzpV-WX.mjs +0 -97
  61. package/dist/packem_shared/combineTelemetry-DCyaaWAI.mjs +0 -43
  62. package/dist/packem_shared/common-DAeFCot5.mjs +0 -61
  63. package/dist/packem_shared/compileAgentWorkflow-BxJjHgtD.mjs +0 -55
  64. package/dist/packem_shared/consoleTelemetry-z2MiP1jt.mjs +0 -93
  65. package/dist/packem_shared/createAgentContext-4xJGXNR4.mjs +0 -50
  66. package/dist/packem_shared/createAgentGenerate-BQv9YJ01.mjs +0 -192
  67. package/dist/packem_shared/createDispatchRunner-DSbp_dph-ZHTtxy3f.mjs +0 -69
  68. package/dist/packem_shared/defineAgent-D6maSbVc.mjs +0 -148
  69. package/dist/packem_shared/defineSkill-Ctf_S-rz.mjs +0 -22
  70. package/dist/packem_shared/functionTool-D6lCa2jB.mjs +0 -20
  71. package/dist/packem_shared/graph-component-aoUwO-f0.mjs +0 -216
  72. package/dist/packem_shared/memory-D4FPcBsX.mjs +0 -12
  73. package/dist/packem_shared/normalizeEntityName-CyEEWFkR.mjs +0 -3
  74. package/dist/packem_shared/runAgentLoop-Dhg4ZNvw.mjs +0 -493
  75. package/dist/packem_shared/runVoiceTurn-LnqLvCRR.mjs +0 -211
  76. package/dist/packem_shared/sandboxComponent-DR3pTwBL.mjs +0 -194
  77. package/dist/packem_shared/sentryTelemetry-CgqFJyLO.mjs +0 -36
  78. package/dist/packem_shared/types.d-BhJFTvz_.d.mts +0 -1114
  79. package/dist/packem_shared/types.d-BhJFTvz_.d.ts +0 -1114
package/dist/inbound.d.ts CHANGED
@@ -1,34 +1,34 @@
1
- import { A as AgentDefinition } from "./packem_shared/types.d-BhJFTvz_.js";
1
+ import { A as AgentDefinition } from "./packem_shared/types.d-boAM2Yi1.js";
2
2
  import '@lunora/mail/inbound';
3
3
  import 'ai';
4
4
  /**
5
- * One agent wired into the inbound `email()` handler.
6
- * @experimental
7
- */
5
+ * One agent wired into the inbound `email()` handler.
6
+ * @experimental
7
+ */
8
8
  interface AgentEmailTarget {
9
9
  /**
10
- * The agent definition — only its `onEmail` mapper is read, deciding whether
11
- * this agent claims the message and, if so, the run to start.
12
- */
10
+ * The agent definition — only its `onEmail` mapper is read, deciding whether
11
+ * this agent claims the message and, if so, the run to start.
12
+ */
13
13
  agent: Pick<AgentDefinition, "onEmail">;
14
14
  /** The `AGENT_*` Workflow binding name (off `env`) that starts a run. */
15
15
  binding: string;
16
16
  }
17
17
  /**
18
- * The worker `email(message, env, ctx)` callback. Typed with `unknown`
19
- * parameters so it drops straight onto the generated `composed.email` slot
20
- * without a cast.
21
- * @experimental
22
- */
18
+ * The worker `email(message, env, ctx)` callback. Typed with `unknown`
19
+ * parameters so it drops straight onto the generated `composed.email` slot
20
+ * without a cast.
21
+ * @experimental
22
+ */
23
23
  type InboundAgentEmailHandler = (message: unknown, env: unknown, context: unknown) => Promise<void>;
24
24
  /**
25
- * Build the inbound `email()` handler for one or more `onEmail` agents. The
26
- * returned callback parses the message, then walks `targets` in order and starts
27
- * a durable run for the first agent whose `onEmail` mapper returns a run. If the
28
- * matched agent's Workflow binding is missing from `env` (run codegen/dev so
29
- * `wrangler.jsonc` declares it) the dispatch throws, and the inbound handler's
30
- * `onError` rejects (bounces) the message.
31
- * @experimental
32
- */
25
+ * Build the inbound `email()` handler for one or more `onEmail` agents. The
26
+ * returned callback parses the message, then walks `targets` in order and starts
27
+ * a durable run for the first agent whose `onEmail` mapper returns a run. If the
28
+ * matched agent's Workflow binding is missing from `env` (run codegen/dev so
29
+ * `wrangler.jsonc` declares it) the dispatch throws, and the inbound handler's
30
+ * `onError` rejects (bounces) the message.
31
+ * @experimental
32
+ */
33
33
  declare const dispatchAgentEmail: (targets: ReadonlyArray<AgentEmailTarget>) => InboundAgentEmailHandler;
34
34
  export { type AgentEmailTarget, type InboundAgentEmailHandler, dispatchAgentEmail };
package/dist/inbound.mjs CHANGED
@@ -1,32 +1 @@
1
- import { LunoraError } from '@lunora/errors';
2
- import { createInboundEmailHandler, parseInboundEmail } from '@lunora/mail/inbound';
3
-
4
- const dispatchAgentEmail = (targets) => {
5
- const handler = createInboundEmailHandler({
6
- dispatch: async (email, context) => {
7
- for (const target of targets) {
8
- const mapper = target.agent.onEmail;
9
- if (!mapper) {
10
- continue;
11
- }
12
- const run = await mapper(email);
13
- if (run === null || run === void 0) {
14
- continue;
15
- }
16
- const binding = context.env[target.binding];
17
- if (!binding || typeof binding.create !== "function") {
18
- throw new LunoraError(
19
- "INTERNAL",
20
- `@lunora/agent: no Workflow binding "${target.binding}" on env for an inbound agent — run codegen/dev so wrangler.jsonc declares it`
21
- );
22
- }
23
- await binding.create({ params: run });
24
- return;
25
- }
26
- },
27
- parse: parseInboundEmail
28
- });
29
- return async (message, env, context) => handler(message, env, context);
30
- };
31
-
32
- export { dispatchAgentEmail };
1
+ import{LunoraError as s}from"@lunora/errors";import{createInboundEmailHandler as d,parseInboundEmail as u}from"@lunora/mail/inbound";const m=i=>{const c=d({dispatch:async(o,a)=>{for(const n of i){const t=n.agent.onEmail;if(!t)continue;const e=await t(o);if(e==null)continue;const r=a.env[n.binding];if(!r||typeof r.create!="function")throw new s("INTERNAL",`@lunora/agent: no Workflow binding "${n.binding}" on env for an inbound agent — run codegen/dev so wrangler.jsonc declares it`);await r.create({params:e});return}},parse:u});return async(o,a,n)=>c(o,a,n)};export{m as dispatchAgentEmail};