@pixelml/agenticflow-cli 1.1.1 → 1.2.1

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 (36) hide show
  1. package/README.md +22 -8
  2. package/dist/cli/company-blueprints.d.ts +42 -0
  3. package/dist/cli/company-blueprints.d.ts.map +1 -0
  4. package/dist/cli/company-blueprints.js +96 -0
  5. package/dist/cli/company-blueprints.js.map +1 -0
  6. package/dist/cli/gateway/connector.d.ts +31 -37
  7. package/dist/cli/gateway/connector.d.ts.map +1 -1
  8. package/dist/cli/gateway/connector.js +13 -5
  9. package/dist/cli/gateway/connector.js.map +1 -1
  10. package/dist/cli/gateway/connectors/linear.d.ts +7 -14
  11. package/dist/cli/gateway/connectors/linear.d.ts.map +1 -1
  12. package/dist/cli/gateway/connectors/linear.js +37 -82
  13. package/dist/cli/gateway/connectors/linear.js.map +1 -1
  14. package/dist/cli/gateway/connectors/paperclip.d.ts +6 -10
  15. package/dist/cli/gateway/connectors/paperclip.d.ts.map +1 -1
  16. package/dist/cli/gateway/connectors/paperclip.js +37 -80
  17. package/dist/cli/gateway/connectors/paperclip.js.map +1 -1
  18. package/dist/cli/gateway/connectors/webhook.d.ts +6 -10
  19. package/dist/cli/gateway/connectors/webhook.d.ts.map +1 -1
  20. package/dist/cli/gateway/connectors/webhook.js +15 -27
  21. package/dist/cli/gateway/connectors/webhook.js.map +1 -1
  22. package/dist/cli/gateway/server.d.ts +13 -12
  23. package/dist/cli/gateway/server.d.ts.map +1 -1
  24. package/dist/cli/gateway/server.js +118 -81
  25. package/dist/cli/gateway/server.js.map +1 -1
  26. package/dist/cli/main.d.ts.map +1 -1
  27. package/dist/cli/main.js +308 -30
  28. package/dist/cli/main.js.map +1 -1
  29. package/dist/cli/playbooks.d.ts.map +1 -1
  30. package/dist/cli/playbooks.js +169 -42
  31. package/dist/cli/playbooks.js.map +1 -1
  32. package/package.json +1 -1
  33. package/dist/cli/paperclip-bridge.d.ts +0 -15
  34. package/dist/cli/paperclip-bridge.d.ts.map +0 -1
  35. package/dist/cli/paperclip-bridge.js +0 -244
  36. package/dist/cli/paperclip-bridge.js.map +0 -1
package/README.md CHANGED
@@ -42,11 +42,17 @@ af agent list --fields id,name,model --json
42
42
  af agent get --agent-id <id> --json
43
43
  af agent create --body @agent.json --dry-run # Validate first
44
44
  af agent create --body @agent.json
45
- af agent stream --agent-id <id> --body @stream.json
45
+ af agent run --agent-id <id> --message "Analyze this" --json # Non-streaming
46
+ af agent stream --agent-id <id> --body @stream.json # Streaming
46
47
  af agent update --agent-id <id> --body @update.json
47
48
  af agent delete --agent-id <id>
48
49
  ```
49
50
 
51
+ `af agent run` is designed for AI agents and scripts — returns structured JSON:
52
+ ```json
53
+ {"schema":"agenticflow.agent.run.v1","status":"completed","thread_id":"...","response":"..."}
54
+ ```
55
+
50
56
  ### Workflows
51
57
 
52
58
  ```bash
@@ -89,6 +95,11 @@ af gateway serve --channels linear
89
95
  Deploy agents to [Paperclip](https://github.com/paperclipai/paperclip) companies:
90
96
 
91
97
  ```bash
98
+ # One-command setup from a blueprint
99
+ af paperclip blueprints # List templates
100
+ af paperclip init --blueprint dev-shop # Bootstrap entire company
101
+
102
+ # Or step by step
92
103
  af paperclip company create --name "My Company" --budget 100000
93
104
  af paperclip deploy --agent-id <id> --role engineer
94
105
  af paperclip goal create --title "Build the product" --level company
@@ -98,6 +109,8 @@ af paperclip agent wakeup --id <id> # Trigger execution
98
109
  af paperclip dashboard # Monitor
99
110
  ```
100
111
 
112
+ Blueprints: `dev-shop`, `marketing-agency`, `sales-team`, `content-studio`, `support-center`.
113
+
101
114
  ### AI-Agent Discovery
102
115
 
103
116
  ```bash
@@ -119,13 +132,14 @@ af connections list --limit 200 --json
119
132
  ### Playbooks
120
133
 
121
134
  ```bash
122
- af playbook quickstart # Zero to working agent in 5 min
123
- af playbook gateway-setup # Webhook gateway setup
124
- af playbook deploy-to-paperclip # Paperclip company setup
125
- af playbook agent-channels # Connect Linear, webhooks, etc.
126
- af playbook agent-build # Agent configuration
127
- af playbook workflow-build # Workflow design
128
- af playbook template-bootstrap # Start from templates
135
+ af playbook quickstart # Zero to working agent in 5 min
136
+ af playbook company-from-scratch # Full Paperclip company setup
137
+ af playbook gateway-setup # Webhook gateway setup
138
+ af playbook deploy-to-paperclip # Step-by-step Paperclip deploy
139
+ af playbook agent-channels # Connect Linear, webhooks, etc.
140
+ af playbook agent-build # Agent configuration
141
+ af playbook workflow-build # Workflow design
142
+ af playbook template-bootstrap # Start from templates
129
143
  ```
130
144
 
131
145
  ## Global Options
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Pre-built company blueprints for Paperclip deployment.
3
+ *
4
+ * Each blueprint defines a team of AgenticFlow agents that can be
5
+ * deployed to Paperclip as a ready-made company. Agents are sourced
6
+ * from the AF marketplace templates or the user's existing agents.
7
+ */
8
+ export interface AgentSlot {
9
+ /** Paperclip role */
10
+ role: string;
11
+ /** What this slot does */
12
+ title: string;
13
+ /** Human description */
14
+ description: string;
15
+ /** Suggested AF agent name to search for (from marketplace) */
16
+ suggestedTemplate?: string;
17
+ /** Allow user to skip this slot */
18
+ optional?: boolean;
19
+ }
20
+ export interface CompanyBlueprint {
21
+ /** Short slug */
22
+ id: string;
23
+ /** Display name */
24
+ name: string;
25
+ /** What this company does */
26
+ description: string;
27
+ /** Company goal */
28
+ goal: string;
29
+ /** Starter tasks */
30
+ starterTasks: Array<{
31
+ title: string;
32
+ description: string;
33
+ assigneeRole: string;
34
+ priority: string;
35
+ }>;
36
+ /** Agent slots to fill */
37
+ agents: AgentSlot[];
38
+ }
39
+ export declare const BLUEPRINTS: Record<string, CompanyBlueprint>;
40
+ export declare function listBlueprints(): CompanyBlueprint[];
41
+ export declare function getBlueprint(id: string): CompanyBlueprint | null;
42
+ //# sourceMappingURL=company-blueprints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"company-blueprints.d.ts","sourceRoot":"","sources":["../../src/cli/company-blueprints.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,SAAS;IACxB,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,iBAAiB;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB;IACpB,YAAY,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpG,0BAA0B;IAC1B,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB;AAED,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAiFvD,CAAC;AAEF,wBAAgB,cAAc,IAAI,gBAAgB,EAAE,CAEnD;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAEhE"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Pre-built company blueprints for Paperclip deployment.
3
+ *
4
+ * Each blueprint defines a team of AgenticFlow agents that can be
5
+ * deployed to Paperclip as a ready-made company. Agents are sourced
6
+ * from the AF marketplace templates or the user's existing agents.
7
+ */
8
+ export const BLUEPRINTS = {
9
+ "dev-shop": {
10
+ id: "dev-shop",
11
+ name: "Software Dev Shop",
12
+ description: "A lean engineering team that builds and ships software products.",
13
+ goal: "Build and ship high-quality software products",
14
+ agents: [
15
+ { role: "ceo", title: "CEO / Tech Lead", description: "Strategic direction, delegation, project oversight" },
16
+ { role: "engineer", title: "Senior Engineer", description: "Core development, architecture, code implementation" },
17
+ { role: "designer", title: "UX Designer", description: "UI/UX design, user research, visual design", optional: true },
18
+ { role: "qa", title: "QA Engineer", description: "Testing, bug finding, quality assurance", optional: true },
19
+ ],
20
+ starterTasks: [
21
+ { title: "Define product roadmap", description: "Create a 3-month product roadmap with milestones and deliverables.", assigneeRole: "ceo", priority: "high" },
22
+ { title: "Set up project architecture", description: "Design the technical architecture and set up the development environment.", assigneeRole: "engineer", priority: "high" },
23
+ ],
24
+ },
25
+ "marketing-agency": {
26
+ id: "marketing-agency",
27
+ name: "Marketing Agency",
28
+ description: "A full-service marketing team for content, social media, SEO, and campaigns.",
29
+ goal: "Drive brand awareness and customer acquisition through multi-channel marketing",
30
+ agents: [
31
+ { role: "ceo", title: "Agency Director", description: "Strategy, client relations, campaign oversight" },
32
+ { role: "cmo", title: "Content Strategist", description: "Content planning, blog posts, newsletters", suggestedTemplate: "Content Writer" },
33
+ { role: "designer", title: "Visual Designer", description: "Graphics, social media visuals, brand assets", suggestedTemplate: "Visual designer" },
34
+ { role: "researcher", title: "Market Researcher", description: "Competitive analysis, trend research", suggestedTemplate: "Ari, the Market Researcher", optional: true },
35
+ ],
36
+ starterTasks: [
37
+ { title: "Develop content calendar", description: "Create a 4-week content calendar covering blog posts, social media, and email newsletters.", assigneeRole: "cmo", priority: "high" },
38
+ { title: "Create brand guidelines", description: "Define color palette, typography, logo usage, and visual style for all marketing materials.", assigneeRole: "designer", priority: "high" },
39
+ { title: "Competitive landscape report", description: "Research top 5 competitors and summarize their positioning, pricing, and marketing strategies.", assigneeRole: "researcher", priority: "medium" },
40
+ ],
41
+ },
42
+ "sales-team": {
43
+ id: "sales-team",
44
+ name: "Sales Team",
45
+ description: "A sales operation with outreach, research, and customer management.",
46
+ goal: "Generate qualified leads and close deals",
47
+ agents: [
48
+ { role: "ceo", title: "Sales Director", description: "Pipeline management, strategy, team coordination" },
49
+ { role: "researcher", title: "Sales Researcher", description: "Lead research, company profiling, ICP matching", suggestedTemplate: "Olivia, the Sales Strategist" },
50
+ { role: "general", title: "SDR / Outreach", description: "Email outreach, follow-ups, scheduling", suggestedTemplate: "Rachel, the Support Agent" },
51
+ ],
52
+ starterTasks: [
53
+ { title: "Define ICP and target list", description: "Create ideal customer profile and build a list of 50 target companies.", assigneeRole: "researcher", priority: "high" },
54
+ { title: "Write outreach sequences", description: "Draft 3-step email sequences for cold outreach, follow-up, and re-engagement.", assigneeRole: "general", priority: "high" },
55
+ ],
56
+ },
57
+ "content-studio": {
58
+ id: "content-studio",
59
+ name: "Content Studio",
60
+ description: "A creative content production team for video, social, and written content.",
61
+ goal: "Produce high-quality content across video, social media, and written formats",
62
+ agents: [
63
+ { role: "ceo", title: "Creative Director", description: "Content strategy, quality control, brand voice" },
64
+ { role: "cmo", title: "Social Media Manager", description: "Social media scheduling, engagement, analytics", suggestedTemplate: "Mason, the Social Media Manager" },
65
+ { role: "engineer", title: "Content Writer", description: "Blog posts, articles, scripts, copy", suggestedTemplate: "Content Writer" },
66
+ { role: "designer", title: "Visual Creator", description: "Graphics, thumbnails, social visuals", suggestedTemplate: "Visual designer", optional: true },
67
+ ],
68
+ starterTasks: [
69
+ { title: "Create content pillars", description: "Define 3-5 content themes/pillars that align with the brand and audience.", assigneeRole: "ceo", priority: "high" },
70
+ { title: "Write 5 blog posts", description: "Draft 5 blog posts of 800-1200 words each on the defined content pillars.", assigneeRole: "engineer", priority: "high" },
71
+ { title: "Design social media templates", description: "Create reusable templates for Instagram, Twitter, and LinkedIn posts.", assigneeRole: "designer", priority: "medium" },
72
+ ],
73
+ },
74
+ "support-center": {
75
+ id: "support-center",
76
+ name: "Customer Support Center",
77
+ description: "A customer support team with triage, resolution, and escalation.",
78
+ goal: "Provide fast, helpful customer support and maintain high satisfaction",
79
+ agents: [
80
+ { role: "ceo", title: "Support Manager", description: "Escalation handling, SLA monitoring, team coordination" },
81
+ { role: "general", title: "Support Agent", description: "Ticket triage, first response, common issue resolution", suggestedTemplate: "Rachel, the Support Agent" },
82
+ { role: "researcher", title: "Knowledge Base Manager", description: "FAQ maintenance, documentation, self-service content", optional: true },
83
+ ],
84
+ starterTasks: [
85
+ { title: "Set up support playbook", description: "Create a support playbook with common issues, resolution steps, and escalation criteria.", assigneeRole: "ceo", priority: "high" },
86
+ { title: "Draft FAQ document", description: "Write an FAQ with the top 20 most common customer questions and answers.", assigneeRole: "researcher", priority: "medium" },
87
+ ],
88
+ },
89
+ };
90
+ export function listBlueprints() {
91
+ return Object.values(BLUEPRINTS);
92
+ }
93
+ export function getBlueprint(id) {
94
+ return BLUEPRINTS[id] ?? null;
95
+ }
96
+ //# sourceMappingURL=company-blueprints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"company-blueprints.js","sourceRoot":"","sources":["../../src/cli/company-blueprints.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA8BH,MAAM,CAAC,MAAM,UAAU,GAAqC;IAC1D,UAAU,EAAE;QACV,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,kEAAkE;QAC/E,IAAI,EAAE,+CAA+C;QACrD,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,oDAAoD,EAAE;YAC5G,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,qDAAqD,EAAE;YAClH,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,4CAA4C,EAAE,QAAQ,EAAE,IAAI,EAAE;YACrH,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,yCAAyC,EAAE,QAAQ,EAAE,IAAI,EAAE;SAC7G;QACD,YAAY,EAAE;YAC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AAM,UAAU,cAAc;IAC5B,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,EAAU;IACrC,OAAO,UAAU,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC;AAChC,CAAC"}
@@ -1,51 +1,45 @@
1
1
  /**
2
- * Channel connector interface — inspired by hermes-agent's platform adapters.
2
+ * Channel connector interface.
3
3
  *
4
- * A "channel" is any external platform that can send tasks to AgenticFlow
5
- * agents: Paperclip, Linear, GitHub, Slack, webhooks, etc.
4
+ * A connector is a THIN protocol translator between an external platform
5
+ * and the AgenticFlow runtime API. It does NOT contain business logic —
6
+ * the runtime handles agent execution, thread persistence, RAG, tools, etc.
6
7
  *
7
- * Each connector normalizes platform-specific events into a standard task
8
- * and posts results back to the originating channel.
8
+ * Connector responsibilities:
9
+ * 1. Parse platform webhook { afAgentId, message, threadId }
10
+ * 2. Post agent response back to platform
11
+ *
12
+ * Runtime responsibilities (NOT the connector's job):
13
+ * - Agent execution, streaming, tool calling
14
+ * - Thread/session persistence
15
+ * - Knowledge retrieval, sub-agents
16
+ * - Credit management, permissions
9
17
  */
10
- /** Platform-agnostic task representation (the "MessageEvent" equivalent). */
11
- export interface NormalizedTask {
12
- /** Stable UUID for AF thread continuity across messages. */
13
- threadId: string;
14
- /** Human-readable identifier, e.g. "PIX-1", "LIN-123". */
15
- taskIdentifier: string;
16
- /** The full message to send to the AF agent. */
17
- message: string;
18
+ /** What the connector extracts from a platform webhook. */
19
+ export interface InboundTask {
18
20
  /** AF agent ID to invoke. */
19
21
  afAgentId: string;
20
- /** Override AF stream URL. */
22
+ /** Message to send to the agent. */
23
+ message: string;
24
+ /** Thread ID for conversation continuity (reuse across calls for same task). */
25
+ threadId?: string;
26
+ /** Override AF stream URL (if stored in platform metadata). */
21
27
  afStreamUrl?: string;
22
- /** Source channel info (for routing responses back). */
23
- source: {
24
- channel: string;
25
- chatId: string;
26
- userId?: string;
27
- userName?: string;
28
- };
29
- /** Opaque platform data the connector needs in postResult. */
30
- platformContext: Record<string, unknown>;
28
+ /** Human-readable task label for logging. */
29
+ label: string;
30
+ /** Opaque data the connector needs to post results back. */
31
+ replyContext: Record<string, unknown>;
31
32
  }
32
- /** Channel connector for receiving tasks from an external platform. */
33
+ /** Channel connector thin protocol translator. */
33
34
  export interface ChannelConnector {
34
- /** Short slug: paperclip, linear, github, webhook, etc. */
35
+ /** Short slug: paperclip, linear, github, webhook */
35
36
  readonly name: string;
36
- /** Human-readable display name. */
37
- readonly displayName: string;
38
37
  /**
39
- * Parse incoming webhook into a NormalizedTask.
40
- * Return null to skip (irrelevant event type).
41
- * Throw to reject with 400.
38
+ * Parse incoming webhook InboundTask.
39
+ * Return null to acknowledge but skip.
42
40
  */
43
- parseWebhook(headers: Record<string, string | string[] | undefined>, body: string): Promise<NormalizedTask | null>;
44
- /** Post agent response back to the originating channel. */
45
- postResult(task: NormalizedTask, resultText: string): Promise<void>;
46
- /** Optional: check if the channel is reachable. */
47
- healthCheck?(): Promise<boolean>;
41
+ parseWebhook(headers: Record<string, string | string[] | undefined>, body: string): Promise<InboundTask | null>;
42
+ /** Post agent response back to originating platform. */
43
+ postResult(task: InboundTask, resultText: string): Promise<void>;
48
44
  }
49
- /** Registry of available channel connectors. */
50
- export type ConnectorRegistry = Map<string, ChannelConnector>;
51
45
  //# sourceMappingURL=connector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../../src/cli/gateway/connector.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,6EAA6E;AAC7E,MAAM,WAAW,cAAc;IAC7B,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,cAAc,EAAE,MAAM,CAAC;IACvB,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,8BAA8B;IAC9B,WA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AAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC;AAED,oDAAoD;AACpD,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,YAAY,CACV,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,EACtD,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAE/B,wDAAwD;IACxD,UAAU,CAAC,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClE"}
@@ -1,11 +1,19 @@
1
1
  /**
2
- * Channel connector interface — inspired by hermes-agent's platform adapters.
2
+ * Channel connector interface.
3
3
  *
4
- * A "channel" is any external platform that can send tasks to AgenticFlow
5
- * agents: Paperclip, Linear, GitHub, Slack, webhooks, etc.
4
+ * A connector is a THIN protocol translator between an external platform
5
+ * and the AgenticFlow runtime API. It does NOT contain business logic —
6
+ * the runtime handles agent execution, thread persistence, RAG, tools, etc.
6
7
  *
7
- * Each connector normalizes platform-specific events into a standard task
8
- * and posts results back to the originating channel.
8
+ * Connector responsibilities:
9
+ * 1. Parse platform webhook { afAgentId, message, threadId }
10
+ * 2. Post agent response back to platform
11
+ *
12
+ * Runtime responsibilities (NOT the connector's job):
13
+ * - Agent execution, streaming, tool calling
14
+ * - Thread/session persistence
15
+ * - Knowledge retrieval, sub-agents
16
+ * - Credit management, permissions
9
17
  */
10
18
  export {};
11
19
  //# sourceMappingURL=connector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"connector.js","sourceRoot":"","sources":["../../../src/cli/gateway/connector.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
1
+ {"version":3,"file":"connector.js","sourceRoot":"","sources":["../../../src/cli/gateway/connector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
@@ -1,27 +1,20 @@
1
1
  /**
2
- * Linear channel connector.
2
+ * Linear channel connector (thin).
3
3
  *
4
- * Receives Linear webhooks (issue.create, issue.update, comment.create),
5
- * fetches issue context, and posts results back as comments.
6
- *
7
- * Setup: In Linear → Settings → API → Webhooks, add:
8
- * URL: https://your-gateway/webhook/linear
9
- * Events: Issues (created, updated), Comments (created)
4
+ * Translates Linear webhooks AF runtime call.
5
+ * Linear webhook events: issue.create, issue.update, comment.create.
10
6
  */
11
- import type { ChannelConnector, NormalizedTask } from "../connector.js";
7
+ import type { ChannelConnector, InboundTask } from "../connector.js";
12
8
  export interface LinearConnectorConfig {
13
9
  linearApiKey: string;
14
- /** Map of Linear team key → AF agent ID. e.g. { "ENG": "af-agent-uuid" } */
10
+ /** Team key → AF agent ID. e.g. { "ENG": "af-uuid" } */
15
11
  agentMapping: Record<string, string>;
16
- /** Optional: AF stream URL override per agent. */
17
- streamUrlMapping?: Record<string, string>;
18
12
  }
19
13
  export declare class LinearConnector implements ChannelConnector {
20
14
  private config;
21
15
  readonly name = "linear";
22
- readonly displayName = "Linear";
23
16
  constructor(config: LinearConnectorConfig);
24
- parseWebhook(_headers: Record<string, string | string[] | undefined>, body: string): Promise<NormalizedTask | null>;
25
- postResult(task: NormalizedTask, resultText: string): Promise<void>;
17
+ parseWebhook(_headers: Record<string, string | string[] | undefined>, body: string): Promise<InboundTask | null>;
18
+ postResult(task: InboundTask, resultText: string): Promise<void>;
26
19
  }
27
20
  //# sourceMappingURL=linear.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"linear.d.ts","sourceRoot":"","sources":["../../../../src/cli/gateway/connectors/linear.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CA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,CAAC;IA+CxB,UAAU,CAAC,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAUvE"}
@@ -1,121 +1,76 @@
1
1
  /**
2
- * Linear channel connector.
2
+ * Linear channel connector (thin).
3
3
  *
4
- * Receives Linear webhooks (issue.create, issue.update, comment.create),
5
- * fetches issue context, and posts results back as comments.
6
- *
7
- * Setup: In Linear → Settings → API → Webhooks, add:
8
- * URL: https://your-gateway/webhook/linear
9
- * Events: Issues (created, updated), Comments (created)
4
+ * Translates Linear webhooks AF runtime call.
5
+ * Linear webhook events: issue.create, issue.update, comment.create.
10
6
  */
11
- // Minimal Linear GraphQL client
12
- async function linearQuery(apiKey, query, variables) {
7
+ async function linearGql(apiKey, query, variables) {
13
8
  const resp = await fetch("https://api.linear.app/graphql", {
14
9
  method: "POST",
15
- headers: {
16
- "Content-Type": "application/json",
17
- Authorization: apiKey,
18
- },
10
+ headers: { "Content-Type": "application/json", Authorization: apiKey },
19
11
  body: JSON.stringify({ query, variables }),
20
12
  });
21
13
  if (!resp.ok)
22
- throw new Error(`Linear API failed (${resp.status})`);
14
+ throw new Error(`Linear API ${resp.status}`);
23
15
  const result = (await resp.json());
24
16
  if (result.errors)
25
- throw new Error(`Linear GraphQL: ${JSON.stringify(result.errors)}`);
17
+ throw new Error(JSON.stringify(result.errors));
26
18
  return result.data;
27
19
  }
28
- async function linearGetIssue(apiKey, issueId) {
29
- const data = (await linearQuery(apiKey, `
30
- query($id: String!) {
31
- issue(id: $id) {
32
- id identifier title description priority priorityLabel
33
- state { name }
34
- team { key name }
35
- assignee { name }
36
- labels { nodes { name } }
37
- comments { nodes { body user { name } createdAt } }
38
- }
39
- }
40
- `, { id: issueId }));
41
- return data.issue;
42
- }
43
- async function linearAddComment(apiKey, issueId, body) {
44
- await linearQuery(apiKey, `
45
- mutation($issueId: String!, $body: String!) {
46
- commentCreate(input: { issueId: $issueId, body: $body }) {
47
- success
48
- }
49
- }
50
- `, { issueId, body });
51
- }
52
20
  export class LinearConnector {
53
21
  config;
54
22
  name = "linear";
55
- displayName = "Linear";
56
23
  constructor(config) {
57
24
  this.config = config;
58
25
  }
59
26
  async parseWebhook(_headers, body) {
60
27
  const payload = JSON.parse(body);
61
- // Only handle issue creates/updates and comment creates
62
28
  const isIssue = payload.type === "Issue" && ["create", "update"].includes(payload.action);
63
29
  const isComment = payload.type === "Comment" && payload.action === "create";
64
30
  if (!isIssue && !isComment)
65
31
  return null;
66
32
  const issueId = isComment ? payload.data.issueId : payload.data.id;
67
- // Fetch full issue details
68
- const issue = await linearGetIssue(this.config.linearApiKey, issueId);
33
+ // Fetch issue for context
34
+ const data = (await linearGql(this.config.linearApiKey, `
35
+ query($id: String!) {
36
+ issue(id: $id) {
37
+ id identifier title description priorityLabel
38
+ state { name }
39
+ team { key }
40
+ }
41
+ }
42
+ `, { id: issueId }));
43
+ const issue = data.issue;
69
44
  const team = issue.team;
70
45
  const teamKey = team?.key ?? "";
71
- // Find AF agent for this team
72
46
  const afAgentId = this.config.agentMapping[teamKey];
73
47
  if (!afAgentId)
74
- return null; // No agent mapped for this team — skip
48
+ return null; // No agent for this team
75
49
  const state = issue.state;
76
- const labels = issue.labels;
77
- const comments = issue.comments;
78
- // Build message
79
- const parts = [];
80
- parts.push("You have received a task from Linear.\n");
81
- parts.push(`## Task: ${issue.identifier} — ${issue.title}`);
82
- parts.push(`- **Priority:** ${issue.priorityLabel ?? "medium"}`);
83
- parts.push(`- **Status:** ${state?.name ?? "unknown"}`);
84
- if (labels?.nodes?.length) {
85
- parts.push(`- **Labels:** ${labels.nodes.map((l) => l.name).join(", ")}`);
86
- }
87
- if (issue.description) {
88
- parts.push(`\n### Description\n${issue.description}`);
89
- }
90
- if (comments?.nodes?.length) {
91
- parts.push("\n### Recent Comments");
92
- for (const c of comments.nodes.slice(-5)) {
93
- const user = c.user;
94
- parts.push(`- **${user?.name ?? "Unknown"}:** ${c.body}`);
95
- }
96
- }
97
- if (isComment && payload.data.body) {
98
- parts.push(`\n### New Comment (trigger)\n${payload.data.body}`);
99
- }
100
- parts.push("\n## Instructions\nComplete this task. Provide a clear summary of your work.");
50
+ const parts = [
51
+ `Task: ${issue.identifier} ${issue.title}`,
52
+ `Priority: ${issue.priorityLabel ?? "medium"} | Status: ${state?.name ?? "unknown"}`,
53
+ ];
54
+ if (issue.description)
55
+ parts.push(`Description: ${issue.description}`);
56
+ if (isComment && payload.data.body)
57
+ parts.push(`New comment: ${payload.data.body}`);
101
58
  return {
102
- threadId: issueId, // reuse Linear issue ID as thread for continuity
103
- taskIdentifier: issue.identifier ?? issueId,
104
- message: parts.join("\n"),
105
59
  afAgentId,
106
- afStreamUrl: this.config.streamUrlMapping?.[afAgentId],
107
- source: {
108
- channel: "linear",
109
- chatId: teamKey,
110
- userName: issue.assignee?.name,
111
- },
112
- platformContext: { issueId, teamKey },
60
+ message: parts.join("\n"),
61
+ threadId: issueId,
62
+ label: issue.identifier ?? issueId,
63
+ replyContext: { issueId, teamKey },
113
64
  };
114
65
  }
115
66
  async postResult(task, resultText) {
116
- const issueId = task.platformContext.issueId;
67
+ const issueId = task.replyContext.issueId;
117
68
  if (issueId && resultText) {
118
- await linearAddComment(this.config.linearApiKey, issueId, `**Agent Response:**\n\n${resultText}`);
69
+ await linearGql(this.config.linearApiKey, `
70
+ mutation($issueId: String!, $body: String!) {
71
+ commentCreate(input: { issueId: $issueId, body: $body }) { success }
72
+ }
73
+ `, { issueId, body: `**Agent Response:**\n\n${resultText}` });
119
74
  }
120
75
  }
121
76
  }
@@ -1 +1 @@
1
- {"version":3,"file":"linear.js","sourceRoot":"","sources":["../../../../src/cli/gateway/connectors/linear.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAYH,gCAAgC;AAChC,KAAK,UAAU,WAAW,CACxB,MAAc,EACd,KAAa,EACb,SAAmC;IAEnC,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,gCAAgC,EAAE;QACzD,MAAM,EAAE,MAAM;Q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AS;YAAE,OAAO,IAAI,CAAC,CAAC,yBAAyB;QAEtD,MAAM,KAAK,GAAG,KAAK,CAAC,KAA4C,CAAC;QACjE,MAAM,KAAK,GAAG;YACZ,SAAS,KAAK,CAAC,UAAU,MAAM,KAAK,CAAC,KAAK,EAAE;YAC5C,aAAa,KAAK,CAAC,aAAa,IAAI,QAAQ,cAAc,KAAK,EAAE,IAAI,IAAI,SAAS,EAAE;SACrF,CAAC;QACF,IAAI,KAAK,CAAC,WAAW;YAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;QACvE,IAAI,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI;YAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAEpF,OAAO;YACL,SAAS;YACT,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;YACzB,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAG,KAAK,CAAC,UAAqB,IAAI,OAAO;YAC9C,YAAY,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;SACnC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,IAAiB,EAAE,UAAkB;QACpD,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,OAAiB,CAAC;QACpD,IAAI,OAAO,IAAI,UAAU,EAAE,CAAC;YAC1B,MAAM,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE;;;;OAIzC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,0BAA0B,UAAU,EAAE,EAAE,CAAC,CAAC;QAChE,CAAC;IACH,CAAC;CACF"}
@@ -1,22 +1,18 @@
1
1
  /**
2
- * Paperclip channel connector.
2
+ * Paperclip channel connector (thin).
3
3
  *
4
- * Receives heartbeat POSTs from Paperclip, fetches issue context,
5
- * builds agent message, and posts results back as comments.
4
+ * Translates Paperclip heartbeat POST AF runtime call.
5
+ * All execution logic lives in the AF runtime.
6
6
  */
7
- import type { ChannelConnector, NormalizedTask } from "../connector.js";
7
+ import type { ChannelConnector, InboundTask } from "../connector.js";
8
8
  export interface PaperclipConnectorConfig {
9
9
  paperclipUrl: string;
10
10
  }
11
11
  export declare class PaperclipConnector implements ChannelConnector {
12
- private config;
13
12
  readonly name = "paperclip";
14
- readonly displayName = "Paperclip";
15
13
  private pc;
16
14
  constructor(config: PaperclipConnectorConfig);
17
- healthCheck(): Promise<boolean>;
18
- parseWebhook(_headers: Record<string, string | string[] | undefined>, body: string): Promise<NormalizedTask | null>;
19
- postResult(task: NormalizedTask, resultText: string): Promise<void>;
20
- private buildMessage;
15
+ parseWebhook(_headers: Record<string, string | string[] | undefined>, body: string): Promise<InboundTask | null>;
16
+ postResult(task: InboundTask, resultText: string): Promise<void>;
21
17
  }
22
18
  //# sourceMappingURL=paperclip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"paperclip.d.ts","sourceRoot":"","sources":["../../../../src/cli/gateway/connectors/paperclip.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAExE,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,kBAAmB,YAAW,gBAAgB;IAK7C,OAAO,CAAC,MAAM;IAJ1B,QAAQ,CAAC,IAAI,eAAe;IAC5B,QAAQ,CAAC,WAAW,eAAe;IACnC,OAAO,CAAC,EAAE,CAAoB;gBAEV,MAAM,EAAE,wBAAwB;IAI9C,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAI/B,YAAY,CAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,EACvD,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAmD3B,UAA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