@agentproto/apps 0.2.1 → 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.
- package/dist/code-team/workflows/deliver-change.d.ts +13 -2
- package/dist/code-team/workflows/deliver-change.d.ts.map +1 -1
- package/dist/code-team.mjs +18 -4
- package/dist/code-team.mjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +66 -5
- package/dist/index.mjs.map +1 -1
- package/dist/mail-triage/agents/triager.d.ts +4 -0
- package/dist/mail-triage/agents/triager.d.ts.map +1 -0
- package/dist/mail-triage/index.d.ts +13 -0
- package/dist/mail-triage/index.d.ts.map +1 -0
- package/dist/mail-triage/workflows/triage-inbox.d.ts +3 -0
- package/dist/mail-triage/workflows/triage-inbox.d.ts.map +1 -0
- package/dist/mail-triage.mjs +60 -0
- package/dist/mail-triage.mjs.map +1 -0
- package/package.json +10 -5
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
1
|
+
/**
|
|
2
|
+
* The one workflow the code team delivers a change through. Every team agent
|
|
3
|
+
* references it; the app-kit attachment invariant keeps that honest.
|
|
4
|
+
*
|
|
5
|
+
* Three declarative `kind:"agent"` steps — implementer → reviewer → fixer —
|
|
6
|
+
* one per team agent, each `agent.ref` resolving (at compile time, against
|
|
7
|
+
* this app's own install record) to that agent's emitted AGENT.md. This
|
|
8
|
+
* replaces an earlier `ToolStep`-based draft (`apply_patch`/`read_diff`/
|
|
9
|
+
* `run_tests`) that dispatched daemon-side, where those tool ids don't
|
|
10
|
+
* exist — the daemon has no `apply_patch` tool, only live agent sessions
|
|
11
|
+
* that can edit files. Agent steps are the adoption fix (WP-B4): each step
|
|
12
|
+
* spawns the named team agent as a real session and lets it act.
|
|
13
|
+
*/
|
|
3
14
|
export declare const deliverChange: Readonly<import("@agentproto/workflow").WorkflowDefinition>;
|
|
4
15
|
//# sourceMappingURL=deliver-change.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deliver-change.d.ts","sourceRoot":"","sources":["../../../src/code-team/workflows/deliver-change.ts"],"names":[],"mappings":"AAEA;
|
|
1
|
+
{"version":3,"file":"deliver-change.d.ts","sourceRoot":"","sources":["../../../src/code-team/workflows/deliver-change.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,6DA4BxB,CAAA"}
|
package/dist/code-team.mjs
CHANGED
|
@@ -53,10 +53,24 @@ var deliverChange = defineWorkflow({
|
|
|
53
53
|
inputs: {},
|
|
54
54
|
outputs: {},
|
|
55
55
|
steps: [
|
|
56
|
-
{
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
{
|
|
57
|
+
id: "implement",
|
|
58
|
+
kind: "agent",
|
|
59
|
+
agent: { ref: "@agentproto/implementer" },
|
|
60
|
+
prompt: "Implement the requested change."
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: "review",
|
|
64
|
+
kind: "agent",
|
|
65
|
+
agent: { ref: "@agentproto/reviewer" },
|
|
66
|
+
prompt: "Review the diff the implementer just produced. Report every real issue as `file:line \u2014 why`."
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: "fix",
|
|
70
|
+
kind: "agent",
|
|
71
|
+
agent: { ref: "@agentproto/fixer" },
|
|
72
|
+
prompt: "Apply the reviewer's findings, then re-run the tests."
|
|
73
|
+
}
|
|
60
74
|
]
|
|
61
75
|
});
|
|
62
76
|
|
package/dist/code-team.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/code-team/agents/implementer.ts","../src/code-team/agents/reviewer.ts","../src/code-team/agents/fixer.ts","../src/code-team/workflows/deliver-change.ts","../src/code-team/index.ts"],"names":["defineAgent"],"mappings":";;;;;;;;;AAIO,IAAM,WAAA,GAA0B;AAAA,EACrC,OAAO,WAAA,CAAY;AAAA,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":3,"sources":["../src/code-team/agents/implementer.ts","../src/code-team/agents/reviewer.ts","../src/code-team/agents/fixer.ts","../src/code-team/workflows/deliver-change.ts","../src/code-team/index.ts"],"names":["defineAgent"],"mappings":";;;;;;;;;AAIO,IAAM,WAAA,GAA0B;AAAA,EACrC,OAAO,WAAA,CAAY;AAAA,IACjB,MAAA,EAAQ,UAAA;AAAA,IACR,EAAA,EAAI,yBAAA;AAAA,IACJ,WAAA,EAAa,uCAAA;AAAA,IACb,KAAA,EAAO,iBAAA;AAAA,IACP,UAAA,EAAY,CAAC,gCAAA,EAAkC,6BAA6B,CAAA;AAAA,IAC5E,OAAO,CAAC,UAAA,EAAY,WAAA,EAAa,YAAA,EAAc,aAAa,aAAa,CAAA;AAAA,IACzE,SAAA,EAAW,CAAC,EAAE,GAAA,EAAK,kBAAkB;AAAA,GACtC,CAAA;AAAA,EACD,IAAA,EACE;AAGJ;ACdO,IAAM,QAAA,GAAuB;AAAA,EAClC,OAAOA,WAAAA,CAAY;AAAA,IACjB,MAAA,EAAQ,UAAA;AAAA,IACR,EAAA,EAAI,sBAAA;AAAA,IACJ,WAAA,EAAa,wCAAA;AAAA,IACb,KAAA,EAAO,iBAAA;AAAA,IACP,UAAA,EAAY,CAAC,sBAAA,EAAwB,kBAAA,EAAoB,uBAAuB,CAAA;AAAA;AAAA;AAAA,IAGhF,KAAA,EAAO,CAAC,UAAA,EAAY,WAAA,EAAa,aAAa,CAAA;AAAA,IAC9C,SAAA,EAAW,CAAC,EAAE,GAAA,EAAK,kBAAkB;AAAA,GACtC,CAAA;AAAA,EACD,IAAA,EACE;AAEJ;ACfO,IAAM,KAAA,GAAoB;AAAA,EAC/B,OAAOA,WAAAA,CAAY;AAAA,IACjB,MAAA,EAAQ,UAAA;AAAA,IACR,EAAA,EAAI,mBAAA;AAAA,IACJ,WAAA,EAAa,2DAAA;AAAA,IACb,KAAA,EAAO,iBAAA;AAAA,IACP,UAAA,EAAY,CAAC,gCAAA,EAAkC,wBAAwB,CAAA;AAAA,IACvE,OAAO,CAAC,UAAA,EAAY,WAAA,EAAa,YAAA,EAAc,aAAa,aAAa,CAAA;AAAA,IACzE,SAAA,EAAW,CAAC,EAAE,GAAA,EAAK,kBAAkB;AAAA,GACtC,CAAA;AAAA,EACD,IAAA,EACE;AAEJ;ACFO,IAAM,gBAAgB,cAAA,CAAe;AAAA,EAC1C,EAAA,EAAI,gBAAA;AAAA,EACJ,IAAA,EAAM,uBAAA;AAAA,EACN,WAAA,EAAa,6DAAA;AAAA,EACb,OAAA,EAAS,OAAA;AAAA,EACT,QAAQ,EAAC;AAAA,EACT,SAAS,EAAC;AAAA,EACV,KAAA,EAAO;AAAA,IACL;AAAA,MACE,EAAA,EAAI,WAAA;AAAA,MACJ,IAAA,EAAM,OAAA;AAAA,MACN,KAAA,EAAO,EAAE,GAAA,EAAK,yBAAA,EAA0B;AAAA,MACxC,MAAA,EAAQ;AAAA,KACV;AAAA,IACA;AAAA,MACE,EAAA,EAAI,QAAA;AAAA,MACJ,IAAA,EAAM,OAAA;AAAA,MACN,KAAA,EAAO,EAAE,GAAA,EAAK,sBAAA,EAAuB;AAAA,MACrC,MAAA,EACE;AAAA,KACJ;AAAA,IACA;AAAA,MACE,EAAA,EAAI,KAAA;AAAA,MACJ,IAAA,EAAM,OAAA;AAAA,MACN,KAAA,EAAO,EAAE,GAAA,EAAK,mBAAA,EAAoB;AAAA,MAClC,MAAA,EAAQ;AAAA;AACV;AAEJ,CAAC;;;AC1BM,IAAM,WAAsB,SAAA,CAAU;AAAA,EAC3C,MAAA,EAAQ,CAAC,WAAA,EAAa,QAAA,EAAU,KAAK,CAAA;AAAA,EACrC,SAAA,EAAW,CAAC,aAAa;AAC3B,CAAC","file":"code-team.mjs","sourcesContent":["import { defineAgent } from \"@agentproto/agent\"\nimport type { AgentEntry } from \"@agentproto/app-kit\"\n\n/** Writes the requested change. */\nexport const implementer: AgentEntry = {\n agent: defineAgent({\n schema: \"agent/v1\",\n id: \"@agentproto/implementer\",\n description: \"Implements the requested code change.\",\n model: \"claude-sonnet-5\",\n boundaries: [\"Change only what the task asks\", \"Match the surrounding style\"],\n tools: [\"list_dir\", \"read_file\", \"write_file\", \"edit_file\", \"run_command\"],\n workflows: [{ ref: \"deliver-change\" }],\n }),\n body:\n \"You implement the requested change. Read the task and the surrounding code \" +\n \"first, make the smallest correct change that satisfies it, then run the \" +\n \"tests. Do not touch anything the task didn't ask for.\",\n}\n","import { defineAgent } from \"@agentproto/agent\"\nimport type { AgentEntry } from \"@agentproto/app-kit\"\n\n/** Reviews the diff; reports only. */\nexport const reviewer: AgentEntry = {\n agent: defineAgent({\n schema: \"agent/v1\",\n id: \"@agentproto/reviewer\",\n description: \"Reviews the diff and reports findings.\",\n model: \"claude-sonnet-5\",\n boundaries: [\"Report findings only\", \"Never edit files\", \"Never run gh pr merge\"],\n // Read-only + run_command (to inspect the diff / run tests). No write/edit\n // tools — the \"never edit files\" boundary is enforced by capability too.\n tools: [\"list_dir\", \"read_file\", \"run_command\"],\n workflows: [{ ref: \"deliver-change\" }],\n }),\n body:\n \"You are a rigorous reviewer. Read the diff, and report each real issue as \" +\n \"`file:line — why`. Change nothing; you only report.\",\n}\n","import { defineAgent } from \"@agentproto/agent\"\nimport type { AgentEntry } from \"@agentproto/app-kit\"\n\n/** Applies the reviewer's findings, precisely and minimally. */\nexport const fixer: AgentEntry = {\n agent: defineAgent({\n schema: \"agent/v1\",\n id: \"@agentproto/fixer\",\n description: \"Applies the reviewer's findings, precisely and minimally.\",\n model: \"claude-sonnet-5\",\n boundaries: [\"Apply only the listed findings\", \"No unrelated refactors\"],\n tools: [\"list_dir\", \"read_file\", \"write_file\", \"edit_file\", \"run_command\"],\n workflows: [{ ref: \"deliver-change\" }],\n }),\n body:\n \"You apply the reviewer's findings. Address each listed finding exactly, add \" +\n \"nothing extra, and re-run the tests when done.\",\n}\n","import { defineWorkflow } from \"@agentproto/workflow\"\n\n/**\n * The one workflow the code team delivers a change through. Every team agent\n * references it; the app-kit attachment invariant keeps that honest.\n *\n * Three declarative `kind:\"agent\"` steps — implementer → reviewer → fixer —\n * one per team agent, each `agent.ref` resolving (at compile time, against\n * this app's own install record) to that agent's emitted AGENT.md. This\n * replaces an earlier `ToolStep`-based draft (`apply_patch`/`read_diff`/\n * `run_tests`) that dispatched daemon-side, where those tool ids don't\n * exist — the daemon has no `apply_patch` tool, only live agent sessions\n * that can edit files. Agent steps are the adoption fix (WP-B4): each step\n * spawns the named team agent as a real session and lets it act.\n */\nexport const deliverChange = defineWorkflow({\n id: \"deliver-change\",\n name: \"Deliver a code change\",\n description: \"Implement the change, review the diff, apply fixes, verify.\",\n version: \"0.1.0\",\n inputs: {},\n outputs: {},\n steps: [\n {\n id: \"implement\",\n kind: \"agent\",\n agent: { ref: \"@agentproto/implementer\" },\n prompt: \"Implement the requested change.\",\n },\n {\n id: \"review\",\n kind: \"agent\",\n agent: { ref: \"@agentproto/reviewer\" },\n prompt:\n \"Review the diff the implementer just produced. Report every real issue as `file:line — why`.\",\n },\n {\n id: \"fix\",\n kind: \"agent\",\n agent: { ref: \"@agentproto/fixer\" },\n prompt: \"Apply the reviewer's findings, then re-run the tests.\",\n },\n ],\n})\n","/**\n * `code-team` — a ready-made agentproto app: a small team that ships a code\n * change. Three agents (implementer → reviewer → fixer) bound to one delivery\n * workflow, declared with `@agentproto/app-kit`.\n *\n * Generic on purpose — `@agentproto/…` ids, no product dependency, no home\n * workspace. A host imports it and uses any subset of its agents/workflows:\n * in-process via `codeTeam.toMastraAgents(...)`, or on disk via\n * `codeTeam.emit(dir)`.\n */\n\nimport { defineApp, type AppHandle } from \"@agentproto/app-kit\"\nimport { implementer } from \"./agents/implementer.js\"\nimport { reviewer } from \"./agents/reviewer.js\"\nimport { fixer } from \"./agents/fixer.js\"\nimport { deliverChange } from \"./workflows/deliver-change.js\"\n\nexport const codeTeam: AppHandle = defineApp({\n agents: [implementer, reviewer, fixer],\n workflows: [deliverChange],\n})\n\nexport { implementer, reviewer, fixer, deliverChange }\n"]}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -53,10 +53,24 @@ var deliverChange = defineWorkflow({
|
|
|
53
53
|
inputs: {},
|
|
54
54
|
outputs: {},
|
|
55
55
|
steps: [
|
|
56
|
-
{
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
{
|
|
57
|
+
id: "implement",
|
|
58
|
+
kind: "agent",
|
|
59
|
+
agent: { ref: "@agentproto/implementer" },
|
|
60
|
+
prompt: "Implement the requested change."
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: "review",
|
|
64
|
+
kind: "agent",
|
|
65
|
+
agent: { ref: "@agentproto/reviewer" },
|
|
66
|
+
prompt: "Review the diff the implementer just produced. Report every real issue as `file:line \u2014 why`."
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: "fix",
|
|
70
|
+
kind: "agent",
|
|
71
|
+
agent: { ref: "@agentproto/fixer" },
|
|
72
|
+
prompt: "Apply the reviewer's findings, then re-run the tests."
|
|
73
|
+
}
|
|
60
74
|
]
|
|
61
75
|
});
|
|
62
76
|
|
|
@@ -149,7 +163,54 @@ var contentTeam = defineApp({
|
|
|
149
163
|
agents: [researcher, writer, editor, illustrator],
|
|
150
164
|
workflows: [produceContent, produceCover]
|
|
151
165
|
});
|
|
166
|
+
var triager = {
|
|
167
|
+
agent: defineAgent({
|
|
168
|
+
schema: "agent/v1",
|
|
169
|
+
id: "@agentproto/triager",
|
|
170
|
+
description: "Triages your inbox \u2014 finds unread mail, categorizes, labels, archives.",
|
|
171
|
+
model: "claude-sonnet-5",
|
|
172
|
+
boundaries: [
|
|
173
|
+
"Always show the triage plan before applying",
|
|
174
|
+
"Never delete \u2014 only archive, label, or mark read",
|
|
175
|
+
"Ask before applying bulk actions on more than 20 messages"
|
|
176
|
+
],
|
|
177
|
+
tools: [
|
|
178
|
+
"mailbox_list",
|
|
179
|
+
"mailbox_search",
|
|
180
|
+
"mailbox_list_threads",
|
|
181
|
+
"mailbox_get_thread",
|
|
182
|
+
"mailbox_labels_list",
|
|
183
|
+
"mailbox_label_create",
|
|
184
|
+
"mailbox_triage_plan",
|
|
185
|
+
"mailbox_triage_apply"
|
|
186
|
+
],
|
|
187
|
+
workflows: [{ ref: "triage-inbox" }]
|
|
188
|
+
}),
|
|
189
|
+
body: "You scan the inbox for unread messages using mailbox_search. Categorize them (urgent, needs-reply, newsletter, notification, spam). Create a triage plan: label each category, archive newsletters+notifications, keep urgent+needs-reply in inbox. Show the plan before applying. Use mailbox_triage_plan to build the plan and mailbox_triage_apply to execute it after user confirmation."
|
|
190
|
+
};
|
|
191
|
+
var triageInbox = defineWorkflow({
|
|
192
|
+
id: "triage-inbox",
|
|
193
|
+
name: "Triage Inbox",
|
|
194
|
+
description: "Scan inbox, categorize unread messages, create and apply triage plan.",
|
|
195
|
+
version: "0.1.0",
|
|
196
|
+
inputs: {},
|
|
197
|
+
outputs: {},
|
|
198
|
+
steps: [
|
|
199
|
+
{
|
|
200
|
+
id: "triage",
|
|
201
|
+
kind: "agent",
|
|
202
|
+
agent: { ref: "@agentproto/triager" },
|
|
203
|
+
prompt: "Scan the inbox for unread messages. Categorize them (urgent, needs-reply, newsletter, notification, spam). Create a triage plan: label each category, archive newsletters+notifications, keep urgent+needs-reply in inbox. Show me the plan before applying."
|
|
204
|
+
}
|
|
205
|
+
]
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
// src/mail-triage/index.ts
|
|
209
|
+
var mailTriage = defineApp({
|
|
210
|
+
agents: [triager],
|
|
211
|
+
workflows: [triageInbox]
|
|
212
|
+
});
|
|
152
213
|
|
|
153
|
-
export { codeTeam, contentTeam };
|
|
214
|
+
export { codeTeam, contentTeam, mailTriage };
|
|
154
215
|
//# sourceMappingURL=index.mjs.map
|
|
155
216
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/code-team/agents/implementer.ts","../src/code-team/agents/reviewer.ts","../src/code-team/agents/fixer.ts","../src/code-team/workflows/deliver-change.ts","../src/code-team/index.ts","../src/content-team/agents/researcher.ts","../src/content-team/agents/writer.ts","../src/content-team/agents/editor.ts","../src/content-team/agents/illustrator.ts","../src/content-team/workflows/produce-content.ts","../src/content-team/workflows/produce-cover.ts","../src/content-team/index.ts"],"names":["defineAgent","defineWorkflow","defineApp"],"mappings":";;;;;;;;;AAIO,IAAM,WAAA,GAA0B;AAAA,EACrC,OAAO,WAAA,CAAY;AAAA,IACjB,MAAA,EAAQ,UAAA;AAAA,IACR,EAAA,EAAI,yBAAA;AAAA,IACJ,WAAA,EAAa,uCAAA;AAAA,IACb,KAAA,EAAO,iBAAA;AAAA,IACP,UAAA,EAAY,CAAC,gCAAA,EAAkC,6BAA6B,CAAA;AAAA,IAC5E,OAAO,CAAC,UAAA,EAAY,WAAA,EAAa,YAAA,EAAc,aAAa,aAAa,CAAA;AAAA,IACzE,SAAA,EAAW,CAAC,EAAE,GAAA,EAAK,kBAAkB;AAAA,GACtC,CAAA;AAAA,EACD,IAAA,EACE;AAGJ,CAAA;ACdO,IAAM,QAAA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AQ,IAAA,EAAM,MAAA,EAAQ,MAAM,WAAA,EAAY;AAAA,IAC9C,EAAE,EAAA,EAAI,SAAA,EAAW,IAAA,EAAM,MAAA,EAAQ,MAAM,aAAA;AAAc;AAEvD,CAAC,CAAA;AChBM,IAAM,eAAeA,cAAAA,CAAe;AAAA,EACzC,EAAA,EAAI,eAAA;AAAA,EACJ,IAAA,EAAM,8BAAA;AAAA,EACN,WAAA,EACE,+GAAA;AAAA,EAEF,OAAA,EAAS,OAAA;AAAA,EACT,QAAQ,EAAC;AAAA,EACT,SAAS,EAAC;AAAA,EACV,KAAA,EAAO;AAAA,IACL,EAAE,EAAA,EAAI,sBAAA,EAAwB,IAAA,EAAM,MAAA,EAAQ,MAAM,uBAAA,EAAwB;AAAA,IAC1E,EAAE,EAAA,EAAI,UAAA,EAAY,IAAA,EAAM,MAAA,EAAQ,MAAM,wBAAA,EAAyB;AAAA,IAC/D,EAAE,EAAA,EAAI,SAAA,EAAW,IAAA,EAAM,MAAA,EAAQ,MAAM,uBAAA,EAAwB;AAAA,IAC7D,EAAE,EAAA,EAAI,QAAA,EAAU,IAAA,EAAM,MAAA,EAAQ,MAAM,sBAAA;AAAuB;AAE/D,CAAC,CAAA;;;ACDM,IAAM,cAAyBC,SAAAA,CAAU;AAAA,EAC9C,MAAA,EAAQ,CAAC,UAAA,EAAY,MAAA,EAAQ,QAAQ,WAAW,CAAA;AAAA,EAChD,SAAA,EAAW,CAAC,cAAA,EAAgB,YAAY;AAC1C,CAAC","file":"index.mjs","sourcesContent":["import { defineAgent } from \"@agentproto/agent\"\nimport type { AgentEntry } from \"@agentproto/app-kit\"\n\n/** Writes the requested change. */\nexport const implementer: AgentEntry = {\n agent: defineAgent({\n schema: \"agent/v1\",\n id: \"@agentproto/implementer\",\n description: \"Implements the requested code change.\",\n model: \"claude-sonnet-5\",\n boundaries: [\"Change only what the task asks\", \"Match the surrounding style\"],\n tools: [\"list_dir\", \"read_file\", \"write_file\", \"edit_file\", \"run_command\"],\n workflows: [{ ref: \"deliver-change\" }],\n }),\n body:\n \"You implement the requested change. Read the task and the surrounding code \" +\n \"first, make the smallest correct change that satisfies it, then run the \" +\n \"tests. Do not touch anything the task didn't ask for.\",\n}\n","import { defineAgent } from \"@agentproto/agent\"\nimport type { AgentEntry } from \"@agentproto/app-kit\"\n\n/** Reviews the diff; reports only. */\nexport const reviewer: AgentEntry = {\n agent: defineAgent({\n schema: \"agent/v1\",\n id: \"@agentproto/reviewer\",\n description: \"Reviews the diff and reports findings.\",\n model: \"claude-sonnet-5\",\n boundaries: [\"Report findings only\", \"Never edit files\", \"Never run gh pr merge\"],\n // Read-only + run_command (to inspect the diff / run tests). No write/edit\n // tools — the \"never edit files\" boundary is enforced by capability too.\n tools: [\"list_dir\", \"read_file\", \"run_command\"],\n workflows: [{ ref: \"deliver-change\" }],\n }),\n body:\n \"You are a rigorous reviewer. Read the diff, and report each real issue as \" +\n \"`file:line — why`. Change nothing; you only report.\",\n}\n","import { defineAgent } from \"@agentproto/agent\"\nimport type { AgentEntry } from \"@agentproto/app-kit\"\n\n/** Applies the reviewer's findings, precisely and minimally. */\nexport const fixer: AgentEntry = {\n agent: defineAgent({\n schema: \"agent/v1\",\n id: \"@agentproto/fixer\",\n description: \"Applies the reviewer's findings, precisely and minimally.\",\n model: \"claude-sonnet-5\",\n boundaries: [\"Apply only the listed findings\", \"No unrelated refactors\"],\n tools: [\"list_dir\", \"read_file\", \"write_file\", \"edit_file\", \"run_command\"],\n workflows: [{ ref: \"deliver-change\" }],\n }),\n body:\n \"You apply the reviewer's findings. Address each listed finding exactly, add \" +\n \"nothing extra, and re-run the tests when done.\",\n}\n","import { defineWorkflow } from \"@agentproto/workflow\"\n\n/** The one workflow the code team delivers a change through. Every team agent\n * references it; the app-kit attachment invariant keeps that honest. */\nexport const deliverChange = defineWorkflow({\n id: \"deliver-change\",\n name: \"Deliver a code change\",\n description: \"Implement the change, review the diff, apply fixes, verify.\",\n version: \"0.1.0\",\n inputs: {},\n outputs: {},\n steps: [\n { id: \"implement\", kind: \"tool\", tool: \"apply_patch\" },\n { id: \"review\", kind: \"tool\", tool: \"read_diff\" },\n { id: \"fix\", kind: \"tool\", tool: \"apply_patch\" },\n { id: \"verify\", kind: \"tool\", tool: \"run_tests\" },\n ],\n})\n","/**\n * `code-team` — a ready-made agentproto app: a small team that ships a code\n * change. Three agents (implementer → reviewer → fixer) bound to one delivery\n * workflow, declared with `@agentproto/app-kit`.\n *\n * Generic on purpose — `@agentproto/…` ids, no product dependency, no home\n * workspace. A host imports it and uses any subset of its agents/workflows:\n * in-process via `codeTeam.toMastraAgents(...)`, or on disk via\n * `codeTeam.emit(dir)`.\n */\n\nimport { defineApp, type AppHandle } from \"@agentproto/app-kit\"\nimport { implementer } from \"./agents/implementer.js\"\nimport { reviewer } from \"./agents/reviewer.js\"\nimport { fixer } from \"./agents/fixer.js\"\nimport { deliverChange } from \"./workflows/deliver-change.js\"\n\nexport const codeTeam: AppHandle = defineApp({\n agents: [implementer, reviewer, fixer],\n workflows: [deliverChange],\n})\n\nexport { implementer, reviewer, fixer, deliverChange }\n","import { defineAgent } from \"@agentproto/agent\"\nimport type { AgentEntry } from \"@agentproto/app-kit\"\n\n/** Gathers sources for the piece. */\nexport const researcher: AgentEntry = {\n agent: defineAgent({\n schema: \"agent/v1\",\n id: \"@agentproto/researcher\",\n description: \"Reads the provided sources and summarizes them for the writer.\",\n model: \"claude-sonnet-5\",\n boundaries: [\"Cite every claim\", \"Prefer primary sources\"],\n tools: [\"list_dir\", \"read_file\", \"run_command\"],\n workflows: [{ ref: \"produce-content\" }],\n }),\n body:\n \"You read the source material already in the workspace (list_dir, then \" +\n \"read_file the sources), extract the key facts, and hand the writer a tight \" +\n \"brief with a citation for every claim. Use run_command only to fetch a URL \" +\n \"already named in the task; do not invent sources.\",\n}\n","import { defineAgent } from \"@agentproto/agent\"\nimport type { AgentEntry } from \"@agentproto/app-kit\"\n\n/** Drafts the piece from the brief. */\nexport const writer: AgentEntry = {\n agent: defineAgent({\n schema: \"agent/v1\",\n id: \"@agentproto/writer\",\n description: \"Drafts the piece from the researcher's brief.\",\n model: \"claude-sonnet-5\",\n boundaries: [\"Stay on the brief\", \"One idea per paragraph\"],\n tools: [\"list_dir\", \"read_file\", \"write_file\", \"edit_file\"],\n workflows: [{ ref: \"produce-content\" }],\n }),\n body:\n \"You draft the piece from the brief and its sources. Lead with the point, \" +\n \"keep one idea per paragraph, and don't invent facts the brief doesn't have.\",\n}\n","import { defineAgent } from \"@agentproto/agent\"\nimport type { AgentEntry } from \"@agentproto/app-kit\"\n\n/** Tightens the draft. */\nexport const editor: AgentEntry = {\n agent: defineAgent({\n schema: \"agent/v1\",\n id: \"@agentproto/editor\",\n description: \"Edits the draft for voice, clarity, and length.\",\n model: \"claude-sonnet-5\",\n boundaries: [\"Preserve the writer's meaning\", \"Cut, don't pad\"],\n tools: [\"read_file\", \"edit_file\"],\n workflows: [{ ref: \"produce-content\" }],\n }),\n body:\n \"You edit the draft. Tighten the voice, cut fluff, fix clarity — without \" +\n \"changing what the writer meant. Leave it shorter than you found it.\",\n}\n","import { defineAgent } from \"@agentproto/agent\"\nimport type { AgentEntry } from \"@agentproto/app-kit\"\n\n/** Art-directs the cover illustration for each article. */\nexport const illustrator: AgentEntry = {\n agent: defineAgent({\n schema: \"agent/v1\",\n id: \"@agentproto/illustrator\",\n description: \"Art-directs the cover illustration for each article.\",\n model: \"claude-sonnet-5\",\n boundaries: [\"One cover per article\", \"Text-free prompts only\"],\n tools: [\"read_file\", \"write_file\", \"run_command\"],\n workflows: [{ ref: \"produce-cover\" }],\n }),\n body:\n \"You art-direct a single cover illustration for the article. \" +\n \"Read the article (read_file) to extract the one visual idea that best \" +\n \"represents the piece, then write the art direction (write_file) as a \" +\n \"clean, text-free image prompt. Keep the visual discipline tight: bold \" +\n \"flat shapes, limited risograph-style palettes, strong negative space, and \" +\n \"a single focal subject. Never include text, lettering, logos, watermarks, \" +\n \"or UI chrome in the prompt. Produce exactly one cover per article; if the \" +\n \"article calls for a literal diagram or chart, fall back to a precise \" +\n \"gpt-image-1 style description and treat the diagram itself as the image \" +\n \"subject. Use run_command only to inspect generated assets or move files \" +\n \"during the upload step.\",\n}\n","import { defineWorkflow } from \"@agentproto/workflow\"\n\n/** The one workflow the content team produces a piece through. Every team\n * agent references it (app-kit attachment invariant). */\nexport const produceContent = defineWorkflow({\n id: \"produce-content\",\n name: \"Produce a piece of content\",\n description: \"Read the sources, draft the piece, edit it, then commit it.\",\n version: \"0.1.0\",\n inputs: {},\n outputs: {},\n // Concrete workspace tools (fs + exec), so the workflow describes a process\n // a standard runtime can actually run — not abstract tools nothing provides.\n steps: [\n { id: \"research\", kind: \"tool\", tool: \"read_file\" },\n { id: \"draft\", kind: \"tool\", tool: \"write_file\" },\n { id: \"edit\", kind: \"tool\", tool: \"edit_file\" },\n { id: \"publish\", kind: \"tool\", tool: \"run_command\" },\n ],\n})\n","import { defineWorkflow } from \"@agentproto/workflow\"\n\n/** The one workflow the illustrator uses to produce a cover. */\nexport const produceCover = defineWorkflow({\n id: \"produce-cover\",\n name: \"Produce a cover illustration\",\n description:\n \"Read the article, derive the cover concept, generate the base image, \" +\n \"clean it up, and upload the final cover.\",\n version: \"0.1.0\",\n inputs: {},\n outputs: {},\n steps: [\n { id: \"concept-from-article\", kind: \"tool\", tool: \"content.cover-concept\" },\n { id: \"base-gen\", kind: \"tool\", tool: \"content.cover-base-gen\" },\n { id: \"cleanup\", kind: \"tool\", tool: \"content.cover-cleanup\" },\n { id: \"upload\", kind: \"tool\", tool: \"content.cover-upload\" },\n ],\n})\n","/**\n * `content-team` — a ready-made agentproto app: a small team that produces a\n * piece of content. Three agents (researcher → writer → editor) bound to one\n * production workflow, declared with `@agentproto/app-kit`.\n *\n * Generic on purpose — `@agentproto/…` ids, no product dependency. A host\n * imports it and uses any subset of its agents/workflows.\n */\n\nimport { defineApp, type AppHandle } from \"@agentproto/app-kit\"\nimport { researcher } from \"./agents/researcher.js\"\nimport { writer } from \"./agents/writer.js\"\nimport { editor } from \"./agents/editor.js\"\nimport { illustrator } from \"./agents/illustrator.js\"\nimport { produceContent } from \"./workflows/produce-content.js\"\nimport { produceCover } from \"./workflows/produce-cover.js\"\n\nexport const contentTeam: AppHandle = defineApp({\n agents: [researcher, writer, editor, illustrator],\n workflows: [produceContent, produceCover],\n})\n\nexport { researcher, writer, editor, illustrator, produceContent, produceCover }\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/code-team/agents/implementer.ts","../src/code-team/agents/reviewer.ts","../src/code-team/agents/fixer.ts","../src/code-team/workflows/deliver-change.ts","../src/code-team/index.ts","../src/content-team/agents/researcher.ts","../src/content-team/agents/writer.ts","../src/content-team/agents/editor.ts","../src/content-team/agents/illustrator.ts","../src/content-team/workflows/produce-content.ts","../src/content-team/workflows/produce-cover.ts","../src/content-team/index.ts","../src/mail-triage/agents/triager.ts","../src/mail-triage/workflows/triage-inbox.ts","../src/mail-triage/index.ts"],"names":["defineAgent","defineWorkflow","defineApp"],"mappings":";;;;;;;;;AAIO,IAAM,WAAA,GAA0B;AAAA,EACrC,OAAO,WAAA,CAAY;AAAA,IACjB,MAAA,EAAQ,UAAA;AAAA,IACR,EAAA,EAAI,yBAAA;AAAA,IACJ,WAAA,EAAa,uCAAA;AAAA,IACb,KAAA,EAAO,iBAAA;AAAA,IACP,UAAA,EAAY,CAAC,gCAAA,EAAkC,6BAA6B,CAAA;AAAA,IAC5E,OAAO,CAAC,UAAA,EAAY,WAAA,EAAa,YAAA,EAAc,aAAa,aAAa,CAAA;AAAA,IACzE,SAAA,EAAW,CAAC,EAAE,GAAA,EAAK,kBAAkB;AAAA,GACtC,CAAA;AAAA,EACD,IAAA,EACE;AAGJ,CAAA;ACdO,IAAM,QAAA,GAAuB;AAAA,EAClC,OAAOA,WAAAA,CAAY;AAAA,IACjB,MAAA,EAAQ,UAAA;AAAA,IACR,EAAA,EAAI,sBAAA;AAAA,IACJ,WAAA,EAAa,wCAAA;AAAA,IACb,KAAA,EAAO,iB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AA,MACA,sBAAA;AAAA,MACA,oBAAA;AAAA,MACA,qBAAA;AAAA,MACA,sBAAA;AAAA,MACA,qBAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,SAAA,EAAW,CAAC,EAAE,GAAA,EAAK,gBAAgB;AAAA,GACpC,CAAA;AAAA,EACD,IAAA,EACE;AAKJ,CAAA;AC9BO,IAAM,cAAcC,cAAAA,CAAe;AAAA,EACxC,EAAA,EAAI,cAAA;AAAA,EACJ,IAAA,EAAM,cAAA;AAAA,EACN,WAAA,EAAa,uEAAA;AAAA,EACb,OAAA,EAAS,OAAA;AAAA,EACT,QAAQ,EAAC;AAAA,EACT,SAAS,EAAC;AAAA,EACV,KAAA,EAAO;AAAA,IACL;AAAA,MACE,EAAA,EAAI,QAAA;AAAA,MACJ,IAAA,EAAM,OAAA;AAAA,MACN,KAAA,EAAO,EAAE,GAAA,EAAK,qBAAA,EAAsB;AAAA,MACpC,MAAA,EACE;AAAA;AAIJ;AAEJ,CAAC,CAAA;;;ACVM,IAAM,aAAwBC,SAAAA,CAAU;AAAA,EAC7C,MAAA,EAAQ,CAAC,OAAO,CAAA;AAAA,EAChB,SAAA,EAAW,CAAC,WAAW;AACzB,CAAC","file":"index.mjs","sourcesContent":["import { defineAgent } from \"@agentproto/agent\"\nimport type { AgentEntry } from \"@agentproto/app-kit\"\n\n/** Writes the requested change. */\nexport const implementer: AgentEntry = {\n agent: defineAgent({\n schema: \"agent/v1\",\n id: \"@agentproto/implementer\",\n description: \"Implements the requested code change.\",\n model: \"claude-sonnet-5\",\n boundaries: [\"Change only what the task asks\", \"Match the surrounding style\"],\n tools: [\"list_dir\", \"read_file\", \"write_file\", \"edit_file\", \"run_command\"],\n workflows: [{ ref: \"deliver-change\" }],\n }),\n body:\n \"You implement the requested change. Read the task and the surrounding code \" +\n \"first, make the smallest correct change that satisfies it, then run the \" +\n \"tests. Do not touch anything the task didn't ask for.\",\n}\n","import { defineAgent } from \"@agentproto/agent\"\nimport type { AgentEntry } from \"@agentproto/app-kit\"\n\n/** Reviews the diff; reports only. */\nexport const reviewer: AgentEntry = {\n agent: defineAgent({\n schema: \"agent/v1\",\n id: \"@agentproto/reviewer\",\n description: \"Reviews the diff and reports findings.\",\n model: \"claude-sonnet-5\",\n boundaries: [\"Report findings only\", \"Never edit files\", \"Never run gh pr merge\"],\n // Read-only + run_command (to inspect the diff / run tests). No write/edit\n // tools — the \"never edit files\" boundary is enforced by capability too.\n tools: [\"list_dir\", \"read_file\", \"run_command\"],\n workflows: [{ ref: \"deliver-change\" }],\n }),\n body:\n \"You are a rigorous reviewer. Read the diff, and report each real issue as \" +\n \"`file:line — why`. Change nothing; you only report.\",\n}\n","import { defineAgent } from \"@agentproto/agent\"\nimport type { AgentEntry } from \"@agentproto/app-kit\"\n\n/** Applies the reviewer's findings, precisely and minimally. */\nexport const fixer: AgentEntry = {\n agent: defineAgent({\n schema: \"agent/v1\",\n id: \"@agentproto/fixer\",\n description: \"Applies the reviewer's findings, precisely and minimally.\",\n model: \"claude-sonnet-5\",\n boundaries: [\"Apply only the listed findings\", \"No unrelated refactors\"],\n tools: [\"list_dir\", \"read_file\", \"write_file\", \"edit_file\", \"run_command\"],\n workflows: [{ ref: \"deliver-change\" }],\n }),\n body:\n \"You apply the reviewer's findings. Address each listed finding exactly, add \" +\n \"nothing extra, and re-run the tests when done.\",\n}\n","import { defineWorkflow } from \"@agentproto/workflow\"\n\n/**\n * The one workflow the code team delivers a change through. Every team agent\n * references it; the app-kit attachment invariant keeps that honest.\n *\n * Three declarative `kind:\"agent\"` steps — implementer → reviewer → fixer —\n * one per team agent, each `agent.ref` resolving (at compile time, against\n * this app's own install record) to that agent's emitted AGENT.md. This\n * replaces an earlier `ToolStep`-based draft (`apply_patch`/`read_diff`/\n * `run_tests`) that dispatched daemon-side, where those tool ids don't\n * exist — the daemon has no `apply_patch` tool, only live agent sessions\n * that can edit files. Agent steps are the adoption fix (WP-B4): each step\n * spawns the named team agent as a real session and lets it act.\n */\nexport const deliverChange = defineWorkflow({\n id: \"deliver-change\",\n name: \"Deliver a code change\",\n description: \"Implement the change, review the diff, apply fixes, verify.\",\n version: \"0.1.0\",\n inputs: {},\n outputs: {},\n steps: [\n {\n id: \"implement\",\n kind: \"agent\",\n agent: { ref: \"@agentproto/implementer\" },\n prompt: \"Implement the requested change.\",\n },\n {\n id: \"review\",\n kind: \"agent\",\n agent: { ref: \"@agentproto/reviewer\" },\n prompt:\n \"Review the diff the implementer just produced. Report every real issue as `file:line — why`.\",\n },\n {\n id: \"fix\",\n kind: \"agent\",\n agent: { ref: \"@agentproto/fixer\" },\n prompt: \"Apply the reviewer's findings, then re-run the tests.\",\n },\n ],\n})\n","/**\n * `code-team` — a ready-made agentproto app: a small team that ships a code\n * change. Three agents (implementer → reviewer → fixer) bound to one delivery\n * workflow, declared with `@agentproto/app-kit`.\n *\n * Generic on purpose — `@agentproto/…` ids, no product dependency, no home\n * workspace. A host imports it and uses any subset of its agents/workflows:\n * in-process via `codeTeam.toMastraAgents(...)`, or on disk via\n * `codeTeam.emit(dir)`.\n */\n\nimport { defineApp, type AppHandle } from \"@agentproto/app-kit\"\nimport { implementer } from \"./agents/implementer.js\"\nimport { reviewer } from \"./agents/reviewer.js\"\nimport { fixer } from \"./agents/fixer.js\"\nimport { deliverChange } from \"./workflows/deliver-change.js\"\n\nexport const codeTeam: AppHandle = defineApp({\n agents: [implementer, reviewer, fixer],\n workflows: [deliverChange],\n})\n\nexport { implementer, reviewer, fixer, deliverChange }\n","import { defineAgent } from \"@agentproto/agent\"\nimport type { AgentEntry } from \"@agentproto/app-kit\"\n\n/** Gathers sources for the piece. */\nexport const researcher: AgentEntry = {\n agent: defineAgent({\n schema: \"agent/v1\",\n id: \"@agentproto/researcher\",\n description: \"Reads the provided sources and summarizes them for the writer.\",\n model: \"claude-sonnet-5\",\n boundaries: [\"Cite every claim\", \"Prefer primary sources\"],\n tools: [\"list_dir\", \"read_file\", \"run_command\"],\n workflows: [{ ref: \"produce-content\" }],\n }),\n body:\n \"You read the source material already in the workspace (list_dir, then \" +\n \"read_file the sources), extract the key facts, and hand the writer a tight \" +\n \"brief with a citation for every claim. Use run_command only to fetch a URL \" +\n \"already named in the task; do not invent sources.\",\n}\n","import { defineAgent } from \"@agentproto/agent\"\nimport type { AgentEntry } from \"@agentproto/app-kit\"\n\n/** Drafts the piece from the brief. */\nexport const writer: AgentEntry = {\n agent: defineAgent({\n schema: \"agent/v1\",\n id: \"@agentproto/writer\",\n description: \"Drafts the piece from the researcher's brief.\",\n model: \"claude-sonnet-5\",\n boundaries: [\"Stay on the brief\", \"One idea per paragraph\"],\n tools: [\"list_dir\", \"read_file\", \"write_file\", \"edit_file\"],\n workflows: [{ ref: \"produce-content\" }],\n }),\n body:\n \"You draft the piece from the brief and its sources. Lead with the point, \" +\n \"keep one idea per paragraph, and don't invent facts the brief doesn't have.\",\n}\n","import { defineAgent } from \"@agentproto/agent\"\nimport type { AgentEntry } from \"@agentproto/app-kit\"\n\n/** Tightens the draft. */\nexport const editor: AgentEntry = {\n agent: defineAgent({\n schema: \"agent/v1\",\n id: \"@agentproto/editor\",\n description: \"Edits the draft for voice, clarity, and length.\",\n model: \"claude-sonnet-5\",\n boundaries: [\"Preserve the writer's meaning\", \"Cut, don't pad\"],\n tools: [\"read_file\", \"edit_file\"],\n workflows: [{ ref: \"produce-content\" }],\n }),\n body:\n \"You edit the draft. Tighten the voice, cut fluff, fix clarity — without \" +\n \"changing what the writer meant. Leave it shorter than you found it.\",\n}\n","import { defineAgent } from \"@agentproto/agent\"\nimport type { AgentEntry } from \"@agentproto/app-kit\"\n\n/** Art-directs the cover illustration for each article. */\nexport const illustrator: AgentEntry = {\n agent: defineAgent({\n schema: \"agent/v1\",\n id: \"@agentproto/illustrator\",\n description: \"Art-directs the cover illustration for each article.\",\n model: \"claude-sonnet-5\",\n boundaries: [\"One cover per article\", \"Text-free prompts only\"],\n tools: [\"read_file\", \"write_file\", \"run_command\"],\n workflows: [{ ref: \"produce-cover\" }],\n }),\n body:\n \"You art-direct a single cover illustration for the article. \" +\n \"Read the article (read_file) to extract the one visual idea that best \" +\n \"represents the piece, then write the art direction (write_file) as a \" +\n \"clean, text-free image prompt. Keep the visual discipline tight: bold \" +\n \"flat shapes, limited risograph-style palettes, strong negative space, and \" +\n \"a single focal subject. Never include text, lettering, logos, watermarks, \" +\n \"or UI chrome in the prompt. Produce exactly one cover per article; if the \" +\n \"article calls for a literal diagram or chart, fall back to a precise \" +\n \"gpt-image-1 style description and treat the diagram itself as the image \" +\n \"subject. Use run_command only to inspect generated assets or move files \" +\n \"during the upload step.\",\n}\n","import { defineWorkflow } from \"@agentproto/workflow\"\n\n/** The one workflow the content team produces a piece through. Every team\n * agent references it (app-kit attachment invariant). */\nexport const produceContent = defineWorkflow({\n id: \"produce-content\",\n name: \"Produce a piece of content\",\n description: \"Read the sources, draft the piece, edit it, then commit it.\",\n version: \"0.1.0\",\n inputs: {},\n outputs: {},\n // Concrete workspace tools (fs + exec), so the workflow describes a process\n // a standard runtime can actually run — not abstract tools nothing provides.\n steps: [\n { id: \"research\", kind: \"tool\", tool: \"read_file\" },\n { id: \"draft\", kind: \"tool\", tool: \"write_file\" },\n { id: \"edit\", kind: \"tool\", tool: \"edit_file\" },\n { id: \"publish\", kind: \"tool\", tool: \"run_command\" },\n ],\n})\n","import { defineWorkflow } from \"@agentproto/workflow\"\n\n/** The one workflow the illustrator uses to produce a cover. */\nexport const produceCover = defineWorkflow({\n id: \"produce-cover\",\n name: \"Produce a cover illustration\",\n description:\n \"Read the article, derive the cover concept, generate the base image, \" +\n \"clean it up, and upload the final cover.\",\n version: \"0.1.0\",\n inputs: {},\n outputs: {},\n steps: [\n { id: \"concept-from-article\", kind: \"tool\", tool: \"content.cover-concept\" },\n { id: \"base-gen\", kind: \"tool\", tool: \"content.cover-base-gen\" },\n { id: \"cleanup\", kind: \"tool\", tool: \"content.cover-cleanup\" },\n { id: \"upload\", kind: \"tool\", tool: \"content.cover-upload\" },\n ],\n})\n","/**\n * `content-team` — a ready-made agentproto app: a small team that produces a\n * piece of content. Three agents (researcher → writer → editor) bound to one\n * production workflow, declared with `@agentproto/app-kit`.\n *\n * Generic on purpose — `@agentproto/…` ids, no product dependency. A host\n * imports it and uses any subset of its agents/workflows.\n */\n\nimport { defineApp, type AppHandle } from \"@agentproto/app-kit\"\nimport { researcher } from \"./agents/researcher.js\"\nimport { writer } from \"./agents/writer.js\"\nimport { editor } from \"./agents/editor.js\"\nimport { illustrator } from \"./agents/illustrator.js\"\nimport { produceContent } from \"./workflows/produce-content.js\"\nimport { produceCover } from \"./workflows/produce-cover.js\"\n\nexport const contentTeam: AppHandle = defineApp({\n agents: [researcher, writer, editor, illustrator],\n workflows: [produceContent, produceCover],\n})\n\nexport { researcher, writer, editor, illustrator, produceContent, produceCover }\n","import { defineAgent } from \"@agentproto/agent\"\nimport type { AgentEntry } from \"@agentproto/app-kit\"\n\n/** Triages your inbox — finds unread mail, categorizes, labels, archives. */\nexport const triager: AgentEntry = {\n agent: defineAgent({\n schema: \"agent/v1\",\n id: \"@agentproto/triager\",\n description: \"Triages your inbox — finds unread mail, categorizes, labels, archives.\",\n model: \"claude-sonnet-5\",\n boundaries: [\n \"Always show the triage plan before applying\",\n \"Never delete — only archive, label, or mark read\",\n \"Ask before applying bulk actions on more than 20 messages\",\n ],\n tools: [\n \"mailbox_list\",\n \"mailbox_search\",\n \"mailbox_list_threads\",\n \"mailbox_get_thread\",\n \"mailbox_labels_list\",\n \"mailbox_label_create\",\n \"mailbox_triage_plan\",\n \"mailbox_triage_apply\",\n ],\n workflows: [{ ref: \"triage-inbox\" }],\n }),\n body:\n \"You scan the inbox for unread messages using mailbox_search. Categorize them \" +\n \"(urgent, needs-reply, newsletter, notification, spam). Create a triage plan: \" +\n \"label each category, archive newsletters+notifications, keep urgent+needs-reply \" +\n \"in inbox. Show the plan before applying. Use mailbox_triage_plan to build the \" +\n \"plan and mailbox_triage_apply to execute it after user confirmation.\",\n}\n","import { defineWorkflow } from \"@agentproto/workflow\"\n\n/** Single-agent workflow: triage the inbox. */\nexport const triageInbox = defineWorkflow({\n id: \"triage-inbox\",\n name: \"Triage Inbox\",\n description: \"Scan inbox, categorize unread messages, create and apply triage plan.\",\n version: \"0.1.0\",\n inputs: {},\n outputs: {},\n steps: [\n {\n id: \"triage\",\n kind: \"agent\",\n agent: { ref: \"@agentproto/triager\" },\n prompt:\n \"Scan the inbox for unread messages. Categorize them (urgent, needs-reply, \" +\n \"newsletter, notification, spam). Create a triage plan: label each category, \" +\n \"archive newsletters+notifications, keep urgent+needs-reply in inbox. \" +\n \"Show me the plan before applying.\",\n },\n ],\n})\n","/**\n * `mail-triage` — a single-agent agentproto app for email triage.\n *\n * One agent (triager) scans inbox, categorizes unread mail, and applies\n * triage actions (label, archive). Proves the APP primitive works end-to-end\n * with a simple, useful real-world task.\n */\n\nimport { defineApp, type AppHandle } from \"@agentproto/app-kit\"\nimport { triager } from \"./agents/triager.js\"\nimport { triageInbox } from \"./workflows/triage-inbox.js\"\n\nexport const mailTriage: AppHandle = defineApp({\n agents: [triager],\n workflows: [triageInbox],\n})\n\nexport { triager, triageInbox }\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triager.d.ts","sourceRoot":"","sources":["../../../src/mail-triage/agents/triager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAErD,6EAA6E;AAC7E,eAAO,MAAM,OAAO,EAAE,UA6BrB,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `mail-triage` — a single-agent agentproto app for email triage.
|
|
3
|
+
*
|
|
4
|
+
* One agent (triager) scans inbox, categorizes unread mail, and applies
|
|
5
|
+
* triage actions (label, archive). Proves the APP primitive works end-to-end
|
|
6
|
+
* with a simple, useful real-world task.
|
|
7
|
+
*/
|
|
8
|
+
import { type AppHandle } from "@agentproto/app-kit";
|
|
9
|
+
import { triager } from "./agents/triager.js";
|
|
10
|
+
import { triageInbox } from "./workflows/triage-inbox.js";
|
|
11
|
+
export declare const mailTriage: AppHandle;
|
|
12
|
+
export { triager, triageInbox };
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mail-triage/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAEzD,eAAO,MAAM,UAAU,EAAE,SAGvB,CAAA;AAEF,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triage-inbox.d.ts","sourceRoot":"","sources":["../../../src/mail-triage/workflows/triage-inbox.ts"],"names":[],"mappings":"AAEA,+CAA+C;AAC/C,eAAO,MAAM,WAAW,6DAmBtB,CAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { defineApp } from '@agentproto/app-kit';
|
|
2
|
+
import { defineAgent } from '@agentproto/agent';
|
|
3
|
+
import { defineWorkflow } from '@agentproto/workflow';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @agentproto/apps v0.1.0
|
|
7
|
+
* Ready-made agentproto apps (teams of agents + workflows) built on app-kit.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var triager = {
|
|
11
|
+
agent: defineAgent({
|
|
12
|
+
schema: "agent/v1",
|
|
13
|
+
id: "@agentproto/triager",
|
|
14
|
+
description: "Triages your inbox \u2014 finds unread mail, categorizes, labels, archives.",
|
|
15
|
+
model: "claude-sonnet-5",
|
|
16
|
+
boundaries: [
|
|
17
|
+
"Always show the triage plan before applying",
|
|
18
|
+
"Never delete \u2014 only archive, label, or mark read",
|
|
19
|
+
"Ask before applying bulk actions on more than 20 messages"
|
|
20
|
+
],
|
|
21
|
+
tools: [
|
|
22
|
+
"mailbox_list",
|
|
23
|
+
"mailbox_search",
|
|
24
|
+
"mailbox_list_threads",
|
|
25
|
+
"mailbox_get_thread",
|
|
26
|
+
"mailbox_labels_list",
|
|
27
|
+
"mailbox_label_create",
|
|
28
|
+
"mailbox_triage_plan",
|
|
29
|
+
"mailbox_triage_apply"
|
|
30
|
+
],
|
|
31
|
+
workflows: [{ ref: "triage-inbox" }]
|
|
32
|
+
}),
|
|
33
|
+
body: "You scan the inbox for unread messages using mailbox_search. Categorize them (urgent, needs-reply, newsletter, notification, spam). Create a triage plan: label each category, archive newsletters+notifications, keep urgent+needs-reply in inbox. Show the plan before applying. Use mailbox_triage_plan to build the plan and mailbox_triage_apply to execute it after user confirmation."
|
|
34
|
+
};
|
|
35
|
+
var triageInbox = defineWorkflow({
|
|
36
|
+
id: "triage-inbox",
|
|
37
|
+
name: "Triage Inbox",
|
|
38
|
+
description: "Scan inbox, categorize unread messages, create and apply triage plan.",
|
|
39
|
+
version: "0.1.0",
|
|
40
|
+
inputs: {},
|
|
41
|
+
outputs: {},
|
|
42
|
+
steps: [
|
|
43
|
+
{
|
|
44
|
+
id: "triage",
|
|
45
|
+
kind: "agent",
|
|
46
|
+
agent: { ref: "@agentproto/triager" },
|
|
47
|
+
prompt: "Scan the inbox for unread messages. Categorize them (urgent, needs-reply, newsletter, notification, spam). Create a triage plan: label each category, archive newsletters+notifications, keep urgent+needs-reply in inbox. Show me the plan before applying."
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// src/mail-triage/index.ts
|
|
53
|
+
var mailTriage = defineApp({
|
|
54
|
+
agents: [triager],
|
|
55
|
+
workflows: [triageInbox]
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export { mailTriage, triageInbox, triager };
|
|
59
|
+
//# sourceMappingURL=mail-triage.mjs.map
|
|
60
|
+
//# sourceMappingURL=mail-triage.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/mail-triage/agents/triager.ts","../src/mail-triage/workflows/triage-inbox.ts","../src/mail-triage/index.ts"],"names":[],"mappings":";;;;;;;;;AAIO,IAAM,OAAA,GAAsB;AAAA,EACjC,OAAO,WAAA,CAAY;AAAA,IACjB,MAAA,EAAQ,UAAA;AAAA,IACR,EAAA,EAAI,qBAAA;AAAA,IACJ,WAAA,EAAa,6EAAA;AAAA,IACb,KAAA,EAAO,iBAAA;AAAA,IACP,UAAA,EAAY;AAAA,MACV,6CAAA;AAAA,MACA,uDAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,KAAA,EAAO;AAAA,MACL,cAAA;AAAA,MACA,gBAAA;AAAA,MACA,sBAAA;AAAA,MACA,oBAAA;AAAA,MACA,qBAAA;AAAA,MACA,sBAAA;AAAA,MACA,qBAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,SAAA,EAAW,CAAC,EAAE,GAAA,EAAK,gBAAgB;AAAA,GACpC,CAAA;AAAA,EACD,IAAA,EACE;AAKJ;AC9BO,IAAM,cAAc,cAAA,CAAe;AAAA,EACxC,EAAA,EAAI,cAAA;AAAA,EACJ,IAAA,EAAM,cAAA;AAAA,EACN,WAAA,EAAa,uEAAA;AAAA,EACb,OAAA,EAAS,OAAA;AAAA,EACT,QAAQ,EAAC;AAAA,EACT,SAAS,EAAC;AAAA,EACV,KAAA,EAAO;AAAA,IACL;AAAA,MACE,EAAA,EAAI,QAAA;AAAA,MACJ,IAAA,EAAM,OAAA;AAAA,MACN,KAAA,EAAO,EAAE,GAAA,EAAK,qBAAA,EAAsB;AAAA,MACpC,MAAA,EACE;AAAA;AAIJ;AAEJ,CAAC;;;ACVM,IAAM,aAAwB,SAAA,CAAU;AAAA,EAC7C,MAAA,EAAQ,CAAC,OAAO,CAAA;AAAA,EAChB,SAAA,EAAW,CAAC,WAAW;AACzB,CAAC","file":"mail-triage.mjs","sourcesContent":["import { defineAgent } from \"@agentproto/agent\"\nimport type { AgentEntry } from \"@agentproto/app-kit\"\n\n/** Triages your inbox — finds unread mail, categorizes, labels, archives. */\nexport const triager: AgentEntry = {\n agent: defineAgent({\n schema: \"agent/v1\",\n id: \"@agentproto/triager\",\n description: \"Triages your inbox — finds unread mail, categorizes, labels, archives.\",\n model: \"claude-sonnet-5\",\n boundaries: [\n \"Always show the triage plan before applying\",\n \"Never delete — only archive, label, or mark read\",\n \"Ask before applying bulk actions on more than 20 messages\",\n ],\n tools: [\n \"mailbox_list\",\n \"mailbox_search\",\n \"mailbox_list_threads\",\n \"mailbox_get_thread\",\n \"mailbox_labels_list\",\n \"mailbox_label_create\",\n \"mailbox_triage_plan\",\n \"mailbox_triage_apply\",\n ],\n workflows: [{ ref: \"triage-inbox\" }],\n }),\n body:\n \"You scan the inbox for unread messages using mailbox_search. Categorize them \" +\n \"(urgent, needs-reply, newsletter, notification, spam). Create a triage plan: \" +\n \"label each category, archive newsletters+notifications, keep urgent+needs-reply \" +\n \"in inbox. Show the plan before applying. Use mailbox_triage_plan to build the \" +\n \"plan and mailbox_triage_apply to execute it after user confirmation.\",\n}\n","import { defineWorkflow } from \"@agentproto/workflow\"\n\n/** Single-agent workflow: triage the inbox. */\nexport const triageInbox = defineWorkflow({\n id: \"triage-inbox\",\n name: \"Triage Inbox\",\n description: \"Scan inbox, categorize unread messages, create and apply triage plan.\",\n version: \"0.1.0\",\n inputs: {},\n outputs: {},\n steps: [\n {\n id: \"triage\",\n kind: \"agent\",\n agent: { ref: \"@agentproto/triager\" },\n prompt:\n \"Scan the inbox for unread messages. Categorize them (urgent, needs-reply, \" +\n \"newsletter, notification, spam). Create a triage plan: label each category, \" +\n \"archive newsletters+notifications, keep urgent+needs-reply in inbox. \" +\n \"Show me the plan before applying.\",\n },\n ],\n})\n","/**\n * `mail-triage` — a single-agent agentproto app for email triage.\n *\n * One agent (triager) scans inbox, categorizes unread mail, and applies\n * triage actions (label, archive). Proves the APP primitive works end-to-end\n * with a simple, useful real-world task.\n */\n\nimport { defineApp, type AppHandle } from \"@agentproto/app-kit\"\nimport { triager } from \"./agents/triager.js\"\nimport { triageInbox } from \"./workflows/triage-inbox.js\"\n\nexport const mailTriage: AppHandle = defineApp({\n agents: [triager],\n workflows: [triageInbox],\n})\n\nexport { triager, triageInbox }\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentproto/apps",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "@agentproto/apps — a home for ready-made agentproto apps (teams of agents + their workflows), declared with @agentproto/app-kit. Import a team (code-team, content-team, …) and use any of its agents/workflows from your own host: in-process via toMastraAgents(), or emit its manifests to disk.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agentproto",
|
|
@@ -41,6 +41,11 @@
|
|
|
41
41
|
"import": "./dist/content-team.mjs",
|
|
42
42
|
"default": "./dist/content-team.mjs"
|
|
43
43
|
},
|
|
44
|
+
"./mail-triage": {
|
|
45
|
+
"types": "./dist/mail-triage/index.d.ts",
|
|
46
|
+
"import": "./dist/mail-triage.mjs",
|
|
47
|
+
"default": "./dist/mail-triage.mjs"
|
|
48
|
+
},
|
|
44
49
|
"./package.json": "./package.json"
|
|
45
50
|
},
|
|
46
51
|
"files": [
|
|
@@ -53,19 +58,19 @@
|
|
|
53
58
|
},
|
|
54
59
|
"dependencies": {
|
|
55
60
|
"@agentproto/agent": "0.2.1",
|
|
56
|
-
"@agentproto/app-kit": "0.
|
|
57
|
-
"@agentproto/workflow": "0.
|
|
61
|
+
"@agentproto/app-kit": "0.4.0",
|
|
62
|
+
"@agentproto/workflow": "0.2.0"
|
|
58
63
|
},
|
|
59
64
|
"peerDependencies": {
|
|
60
65
|
"@mastra/core": ">=1.0.0"
|
|
61
66
|
},
|
|
62
67
|
"devDependencies": {
|
|
63
|
-
"@mastra/core": "1.
|
|
68
|
+
"@mastra/core": "1.55.0",
|
|
64
69
|
"@types/node": "^25.6.2",
|
|
65
70
|
"tsup": "^8.5.1",
|
|
66
71
|
"typescript": "^5.9.3",
|
|
67
72
|
"vitest": "^3.2.4",
|
|
68
|
-
"@agentproto/mastra": "0.2.
|
|
73
|
+
"@agentproto/mastra": "0.2.5",
|
|
69
74
|
"@agentproto/tooling": "0.1.0-alpha.0"
|
|
70
75
|
},
|
|
71
76
|
"scripts": {
|