@lunora/agent 1.0.0-alpha.1 → 1.0.0-alpha.100
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 +2 -0
- package/dist/channels.d.mts +33 -21
- package/dist/channels.d.ts +33 -21
- package/dist/channels.mjs +1 -181
- package/dist/component.d.mts +61 -56
- package/dist/component.d.ts +61 -56
- package/dist/component.mjs +2 -407
- package/dist/inbound.d.mts +23 -16
- package/dist/inbound.d.ts +23 -16
- package/dist/inbound.mjs +1 -32
- package/dist/index.d.mts +542 -409
- package/dist/index.d.ts +542 -409
- package/dist/index.mjs +1 -18
- package/dist/naming.d.mts +23 -10
- package/dist/naming.d.ts +23 -10
- package/dist/naming.mjs +1 -8
- package/dist/packem_shared/AGENT_MODULE-M4D1EejI.mjs +1 -0
- package/dist/packem_shared/VoiceSessionDO-D238XrlM.mjs +1 -0
- package/dist/packem_shared/adaptMcpResult-CVlq-_TO.mjs +2 -0
- package/dist/packem_shared/agent-loop-CE_Q6bk9.mjs +3 -0
- package/dist/packem_shared/agentAsTool-CgZb6ycK.mjs +1 -0
- package/dist/packem_shared/base64-5eyBfWO3.mjs +1 -0
- package/dist/packem_shared/braintrustTelemetry-Byne8uPK.mjs +1 -0
- package/dist/packem_shared/branch-marker-boZ00zmk.mjs +1 -0
- package/dist/packem_shared/buildModelMessages-Y4tGo1T9.mjs +5 -0
- package/dist/packem_shared/codeTool-BQb-K3my.mjs +1 -0
- package/dist/packem_shared/collectAgenticMemoryTools-BeMWT2qt.mjs +1 -0
- package/dist/packem_shared/combineTelemetry-DgE9W9G8.mjs +1 -0
- package/dist/packem_shared/common-CJSjtsfv.mjs +1 -0
- package/dist/packem_shared/compileAgentWorkflow-DVHi7NYD.mjs +1 -0
- package/dist/packem_shared/component-shared-G8ngerkU.mjs +1 -0
- package/dist/packem_shared/consoleTelemetry-BZY3Y-Ly.mjs +1 -0
- package/dist/packem_shared/createAgentContext-BvU9LP43.mjs +1 -0
- package/dist/packem_shared/createAgentGenerate-BOILDUZj.mjs +3 -0
- package/dist/packem_shared/createDispatchRunner-BxtGxAQi-DXXP7SxZ.mjs +1 -0
- package/dist/packem_shared/defineAgent-KgH-gwYg.mjs +3 -0
- package/dist/packem_shared/defineSkill-DGGvDWNq.mjs +1 -0
- package/dist/packem_shared/fnv1a-BNN96GYb.mjs +1 -0
- package/dist/packem_shared/functionTool-D3CP4f8-.mjs +1 -0
- package/dist/packem_shared/in-flight-calls-GH1A_1P3.mjs +1 -0
- package/dist/packem_shared/normalizeEntityName-k3fjicAG.mjs +2 -0
- package/dist/packem_shared/otlpTelemetry-ByqrB-72.mjs +1 -0
- package/dist/packem_shared/positive-integer-ztHqqpBk.mjs +1 -0
- package/dist/packem_shared/runAgentLoop-Drn1NcCc.mjs +1 -0
- package/dist/packem_shared/runVoiceTurn-BtcmyaBo.mjs +1 -0
- package/dist/packem_shared/sandboxComponent-BtOkUYpY.mjs +5 -0
- package/dist/packem_shared/sentryTelemetry-BHeydiAB.mjs +1 -0
- package/dist/packem_shared/tool-output-Cmk3JWMG.mjs +1 -0
- package/dist/packem_shared/types.d-B8WZl1rU.d.mts +1347 -0
- package/dist/packem_shared/types.d-B8WZl1rU.d.ts +1347 -0
- package/dist/packem_shared/voice-turn-BRj_it54.mjs +1 -0
- package/dist/reply.d.mts +40 -0
- package/dist/reply.d.ts +40 -0
- package/dist/reply.mjs +1 -0
- package/dist/sandbox.d.mts +130 -110
- package/dist/sandbox.d.ts +130 -110
- package/dist/sandbox.mjs +1 -109
- package/dist/skill-markdown.d.mts +36 -0
- package/dist/skill-markdown.d.ts +36 -0
- package/dist/skill-markdown.mjs +1 -0
- package/dist/telemetry/index.d.mts +319 -96
- package/dist/telemetry/index.d.ts +319 -96
- package/dist/telemetry/index.mjs +1 -4
- package/package.json +18 -9
- package/dist/packem_shared/AGENT_MODULE-Dnt_-AAT.mjs +0 -24
- package/dist/packem_shared/VoiceSessionDO-DLoXsHGF.mjs +0 -297
- package/dist/packem_shared/adaptMcpResult-wtNMvLoP.mjs +0 -65
- package/dist/packem_shared/agentAsTool-Dt8NlU6k.mjs +0 -94
- package/dist/packem_shared/base64-BVwtgRJV.mjs +0 -18
- package/dist/packem_shared/braintrustTelemetry-wuGDErob.mjs +0 -47
- package/dist/packem_shared/buildModelMessages-BWFigaoo.mjs +0 -69
- package/dist/packem_shared/codeTool-CjgJOC9t.mjs +0 -122
- package/dist/packem_shared/collectAgenticMemoryTools-QrzpV-WX.mjs +0 -97
- package/dist/packem_shared/combineTelemetry-DCyaaWAI.mjs +0 -43
- package/dist/packem_shared/common-DAeFCot5.mjs +0 -61
- package/dist/packem_shared/compileAgentWorkflow-BxJjHgtD.mjs +0 -55
- package/dist/packem_shared/consoleTelemetry-z2MiP1jt.mjs +0 -93
- package/dist/packem_shared/createAgentContext-4xJGXNR4.mjs +0 -50
- package/dist/packem_shared/createAgentGenerate-BQv9YJ01.mjs +0 -192
- package/dist/packem_shared/createDispatchRunner-DSbp_dph-ZHTtxy3f.mjs +0 -69
- package/dist/packem_shared/defineAgent-D6maSbVc.mjs +0 -148
- package/dist/packem_shared/defineSkill-Ctf_S-rz.mjs +0 -22
- package/dist/packem_shared/functionTool-D6lCa2jB.mjs +0 -20
- package/dist/packem_shared/graph-component-aoUwO-f0.mjs +0 -216
- package/dist/packem_shared/memory-D4FPcBsX.mjs +0 -12
- package/dist/packem_shared/normalizeEntityName-CyEEWFkR.mjs +0 -3
- package/dist/packem_shared/runAgentLoop-Dhg4ZNvw.mjs +0 -493
- package/dist/packem_shared/runVoiceTurn-LnqLvCRR.mjs +0 -211
- package/dist/packem_shared/sandboxComponent-DR3pTwBL.mjs +0 -194
- package/dist/packem_shared/sentryTelemetry-CgqFJyLO.mjs +0 -36
- package/dist/packem_shared/types.d-BWG0uUtX.d.mts +0 -1015
- package/dist/packem_shared/types.d-BWG0uUtX.d.ts +0 -1015
package/dist/inbound.d.ts
CHANGED
|
@@ -1,29 +1,36 @@
|
|
|
1
|
-
import { A as AgentDefinition } from "./packem_shared/types.d-
|
|
1
|
+
import { A as AgentDefinition } from "./packem_shared/types.d-B8WZl1rU.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
8
|
interface AgentEmailTarget {
|
|
6
9
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
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
13
|
agent: Pick<AgentDefinition, "onEmail">;
|
|
11
14
|
/** The `AGENT_*` Workflow binding name (off `env`) that starts a run. */
|
|
12
15
|
binding: string;
|
|
13
16
|
}
|
|
14
17
|
/**
|
|
15
|
-
* The worker `email(message, env, ctx)` callback. Typed with `unknown`
|
|
16
|
-
* parameters so it drops straight onto the generated `composed.email` slot
|
|
17
|
-
* without a cast.
|
|
18
|
-
|
|
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
|
+
*/
|
|
19
23
|
type InboundAgentEmailHandler = (message: unknown, env: unknown, context: unknown) => Promise<void>;
|
|
20
24
|
/**
|
|
21
|
-
* Build the inbound `email()` handler for one or more `onEmail` agents. The
|
|
22
|
-
* returned callback parses the message, then walks `targets` in order and starts
|
|
23
|
-
* a durable run for the first agent whose `onEmail` mapper returns a run.
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* `
|
|
27
|
-
|
|
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.
|
|
28
|
+
*
|
|
29
|
+
* Two dispatch failures bounce the message permanently rather than retrying: a
|
|
30
|
+
* missing Workflow binding (run codegen/dev so `wrangler.jsonc` declares it) and
|
|
31
|
+
* a run carrying the reserved workflow branch-marker key. See
|
|
32
|
+
* {@link rejectPermanently}.
|
|
33
|
+
* @experimental
|
|
34
|
+
*/
|
|
28
35
|
declare const dispatchAgentEmail: (targets: ReadonlyArray<AgentEmailTarget>) => InboundAgentEmailHandler;
|
|
29
36
|
export { type AgentEmailTarget, type InboundAgentEmailHandler, dispatchAgentEmail };
|
package/dist/inbound.mjs
CHANGED
|
@@ -1,32 +1 @@
|
|
|
1
|
-
import {
|
|
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{createInboundEmailHandler as u,authenticatesFrom as d,parseInboundEmail as g}from"@lunora/mail/inbound";import{h as l,B as m}from"./packem_shared/branch-marker-boZ00zmk.mjs";const f="message could not be processed",c=(r,o)=>{console.error("@lunora/agent/inbound: bouncing message —",o),r.message.setReject(f)},b=r=>{const o=u({dispatch:async(t,n)=>{for(const e of r){const s=e.agent.onEmail;if(!s)continue;const a=await s(t);if(a==null)continue;const i=n.env[e.binding];if(!i||typeof i.create!="function"){c(n,`@lunora/agent: no Workflow binding "${e.binding}" on env for an inbound agent — run codegen/dev so wrangler.jsonc declares it`);return}if(l(a)){c(n,`@lunora/agent: inbound run params ${m}`);return}await i.create({params:a});return}},parse:g,verify:d});return async(t,n,e)=>o(t,n,e)};export{b as dispatchAgentEmail};
|