@kalphq/cli 0.0.2 → 0.2.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/add-KRHLYYTO.js +138 -0
- package/dist/add-KRHLYYTO.js.map +1 -0
- package/dist/chunk-6LLXGS2P.js +25 -0
- package/dist/chunk-6LLXGS2P.js.map +1 -0
- package/dist/chunk-INB3LG6O.js +25 -0
- package/dist/chunk-INB3LG6O.js.map +1 -0
- package/dist/chunk-MMS3GWBG.js +50 -0
- package/dist/chunk-MMS3GWBG.js.map +1 -0
- package/dist/create-7J5R6OVF.js +82 -0
- package/dist/create-7J5R6OVF.js.map +1 -0
- package/dist/delete-47ZP6XRB.js +144 -0
- package/dist/delete-47ZP6XRB.js.map +1 -0
- package/dist/index.js +54 -4
- package/dist/index.js.map +1 -1
- package/dist/link-WZQSR2TM.js +36 -0
- package/dist/link-WZQSR2TM.js.map +1 -0
- package/dist/list-3ZQIFUOT.js +119 -0
- package/dist/list-3ZQIFUOT.js.map +1 -0
- package/dist/login-JYPWGL6P.js +38 -0
- package/dist/login-JYPWGL6P.js.map +1 -0
- package/dist/logout-V67DZZXO.js +31 -0
- package/dist/logout-V67DZZXO.js.map +1 -0
- package/dist/push-RBTBXCP7.js +205 -0
- package/dist/push-RBTBXCP7.js.map +1 -0
- package/dist/secrets-KFMVBKJQ.js +49 -0
- package/dist/secrets-KFMVBKJQ.js.map +1 -0
- package/dist/sync-YFM5P3IS.js +120 -0
- package/dist/sync-YFM5P3IS.js.map +1 -0
- package/package.json +11 -11
- package/dist/agents/b2b-sales/signals/.gitkeep +0 -0
- package/dist/agents/b2b-sales/webhooks/.gitkeep +0 -0
- package/dist/agents/customer-support/signals/.gitkeep +0 -0
- package/dist/agents/customer-support/webhooks/.gitkeep +0 -0
- package/dist/agents/financial-agent/signals/.gitkeep +0 -0
- package/dist/agents/financial-agent/webhooks/.gitkeep +0 -0
- package/dist/agents/minimal/signals/.gitkeep +0 -0
- package/dist/agents/minimal/webhooks/.gitkeep +0 -0
- package/dist/build-ZMN2247N.js +0 -121
- package/dist/build-ZMN2247N.js.map +0 -1
- package/dist/chunk-BO2MEQKM.js +0 -121
- package/dist/chunk-BO2MEQKM.js.map +0 -1
- package/dist/create-ZNKKOQLH.js +0 -118
- package/dist/create-ZNKKOQLH.js.map +0 -1
- package/dist/init-7FSWWKI5.js +0 -66
- package/dist/init-7FSWWKI5.js.map +0 -1
- package/dist/templates/agents/b2b-sales/signals/.gitkeep +0 -0
- package/dist/templates/agents/b2b-sales/webhooks/.gitkeep +0 -0
- package/dist/templates/agents/customer-support/signals/.gitkeep +0 -0
- package/dist/templates/agents/customer-support/webhooks/.gitkeep +0 -0
- package/dist/templates/agents/financial-agent/signals/.gitkeep +0 -0
- package/dist/templates/agents/financial-agent/webhooks/.gitkeep +0 -0
- package/dist/templates/agents/minimal/signals/.gitkeep +0 -0
- package/dist/templates/agents/minimal/webhooks/.gitkeep +0 -0
- package/templates/agents/b2b-sales/index.ts +0 -28
- package/templates/agents/b2b-sales/signals/.gitkeep +0 -0
- package/templates/agents/b2b-sales/steps/score-lead.ts +0 -24
- package/templates/agents/b2b-sales/tools/enrich-company.ts +0 -17
- package/templates/agents/b2b-sales/webhooks/.gitkeep +0 -0
- package/templates/agents/customer-support/index.ts +0 -28
- package/templates/agents/customer-support/signals/.gitkeep +0 -0
- package/templates/agents/customer-support/steps/classify-ticket.ts +0 -22
- package/templates/agents/customer-support/tools/search-kb.ts +0 -13
- package/templates/agents/customer-support/webhooks/.gitkeep +0 -0
- package/templates/agents/financial-agent/index.ts +0 -28
- package/templates/agents/financial-agent/signals/.gitkeep +0 -0
- package/templates/agents/financial-agent/steps/analyze-signal.ts +0 -26
- package/templates/agents/financial-agent/tools/fetch-market-data.ts +0 -13
- package/templates/agents/financial-agent/webhooks/.gitkeep +0 -0
- package/templates/agents/minimal/index.ts +0 -16
- package/templates/agents/minimal/signals/.gitkeep +0 -0
- package/templates/agents/minimal/steps/example-step.ts +0 -13
- package/templates/agents/minimal/tools/example-tool.ts +0 -13
- package/templates/agents/minimal/webhooks/.gitkeep +0 -0
- package/templates/project/meta/deployed.json +0 -1
- package/templates/project/package.json +0 -13
- package/templates/project/tsconfig.json +0 -14
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { createTool } from "@kalphq/sdk";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
export const enrichCompany = createTool({
|
|
5
|
-
id: "enrich_company",
|
|
6
|
-
description: "Fetches enriched company data from the CRM.",
|
|
7
|
-
input: z.object({ domain: z.string() }),
|
|
8
|
-
async execute({ domain }, ctx) {
|
|
9
|
-
ctx.logger.info("Enriching company", { domain });
|
|
10
|
-
// Replace with actual CRM API call
|
|
11
|
-
return {
|
|
12
|
-
companyName: domain.split(".")[0] ?? domain,
|
|
13
|
-
employees: 0,
|
|
14
|
-
industry: "Unknown",
|
|
15
|
-
};
|
|
16
|
-
},
|
|
17
|
-
});
|
|
File without changes
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { asAgentId, defineAgent } from "@kalphq/sdk";
|
|
2
|
-
import { classifyTicket } from "./steps/classify-ticket.js";
|
|
3
|
-
import { searchKnowledgeBase } from "./tools/search-kb.js";
|
|
4
|
-
|
|
5
|
-
export default defineAgent({
|
|
6
|
-
id: asAgentId("__AGENT_NAME__"),
|
|
7
|
-
name: "__AGENT_NAME__",
|
|
8
|
-
description: "Handles incoming support tickets with AI-powered routing.",
|
|
9
|
-
steps: [classifyTicket],
|
|
10
|
-
tools: [searchKnowledgeBase],
|
|
11
|
-
|
|
12
|
-
systemPrompt:
|
|
13
|
-
"You are a friendly support agent. Classify tickets, search the knowledge base, and resolve issues efficiently.",
|
|
14
|
-
|
|
15
|
-
async onMessage(message, ctx) {
|
|
16
|
-
const ticket = await ctx.runStep(classifyTicket, { text: message.text });
|
|
17
|
-
|
|
18
|
-
if (ticket.category === "billing") {
|
|
19
|
-
return { text: "Routing to billing team..." };
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const results = await ctx.callTool(searchKnowledgeBase, {
|
|
23
|
-
query: message.text,
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
return { text: results.answer ?? "Let me escalate this to a human agent." };
|
|
27
|
-
},
|
|
28
|
-
});
|
|
File without changes
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { createStep } from "@kalphq/sdk";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
export const classifyTicket = createStep({
|
|
5
|
-
id: "classify_ticket",
|
|
6
|
-
description: "Classifies a support ticket by category and priority.",
|
|
7
|
-
input: z.object({ text: z.string() }),
|
|
8
|
-
output: z.object({
|
|
9
|
-
category: z.enum(["billing", "technical", "general"]),
|
|
10
|
-
priority: z.enum(["low", "medium", "high"]),
|
|
11
|
-
}),
|
|
12
|
-
async run({ text }, ctx) {
|
|
13
|
-
const result = await ctx.ai.generateObject({
|
|
14
|
-
prompt: `Classify this support ticket: "${text}"`,
|
|
15
|
-
schema: z.object({
|
|
16
|
-
category: z.enum(["billing", "technical", "general"]),
|
|
17
|
-
priority: z.enum(["low", "medium", "high"]),
|
|
18
|
-
}),
|
|
19
|
-
});
|
|
20
|
-
return result;
|
|
21
|
-
},
|
|
22
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createTool } from "@kalphq/sdk";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
export const searchKnowledgeBase = createTool({
|
|
5
|
-
id: "search_kb",
|
|
6
|
-
description: "Searches the product knowledge base for relevant articles.",
|
|
7
|
-
input: z.object({ query: z.string() }),
|
|
8
|
-
async execute({ query }, ctx) {
|
|
9
|
-
ctx.logger.info("Searching KB", { query });
|
|
10
|
-
// Replace with your actual knowledge base search logic
|
|
11
|
-
return { answer: null as string | null, sources: [] as string[] };
|
|
12
|
-
},
|
|
13
|
-
});
|
|
File without changes
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { asAgentId, defineAgent } from "@kalphq/sdk";
|
|
2
|
-
import { analyzeSignal } from "./steps/analyze-signal.js";
|
|
3
|
-
import { fetchMarketData } from "./tools/fetch-market-data.js";
|
|
4
|
-
|
|
5
|
-
export default defineAgent({
|
|
6
|
-
id: asAgentId("__AGENT_NAME__"),
|
|
7
|
-
name: "__AGENT_NAME__",
|
|
8
|
-
description: "Monitors market signals and provides financial analysis.",
|
|
9
|
-
steps: [analyzeSignal],
|
|
10
|
-
tools: [fetchMarketData],
|
|
11
|
-
|
|
12
|
-
systemPrompt:
|
|
13
|
-
"You are a financial analysis agent. Interpret market signals, fetch live data, and provide actionable insights.",
|
|
14
|
-
|
|
15
|
-
async onMessage(message, ctx) {
|
|
16
|
-
const market = await ctx.callTool(fetchMarketData, {
|
|
17
|
-
symbol: message.text.trim().toUpperCase(),
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const analysis = await ctx.runStep(analyzeSignal, {
|
|
21
|
-
symbol: market.symbol,
|
|
22
|
-
price: market.price,
|
|
23
|
-
change: market.change,
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
return { text: analysis.summary };
|
|
27
|
-
},
|
|
28
|
-
});
|
|
File without changes
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { createStep } from "@kalphq/sdk";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
export const analyzeSignal = createStep({
|
|
5
|
-
id: "analyze_signal",
|
|
6
|
-
description: "Analyzes a market signal and produces a summary.",
|
|
7
|
-
input: z.object({
|
|
8
|
-
symbol: z.string(),
|
|
9
|
-
price: z.number(),
|
|
10
|
-
change: z.number(),
|
|
11
|
-
}),
|
|
12
|
-
output: z.object({
|
|
13
|
-
sentiment: z.enum(["bullish", "bearish", "neutral"]),
|
|
14
|
-
summary: z.string(),
|
|
15
|
-
}),
|
|
16
|
-
async run({ symbol, price, change }, ctx) {
|
|
17
|
-
const result = await ctx.ai.generateObject({
|
|
18
|
-
prompt: `Analyze this market signal: ${symbol} at $${price} (${change > 0 ? "+" : ""}${change}%). Give sentiment and a one-line summary.`,
|
|
19
|
-
schema: z.object({
|
|
20
|
-
sentiment: z.enum(["bullish", "bearish", "neutral"]),
|
|
21
|
-
summary: z.string(),
|
|
22
|
-
}),
|
|
23
|
-
});
|
|
24
|
-
return result;
|
|
25
|
-
},
|
|
26
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createTool } from "@kalphq/sdk";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
export const fetchMarketData = createTool({
|
|
5
|
-
id: "fetch_market_data",
|
|
6
|
-
description: "Fetches real-time market data for a given symbol.",
|
|
7
|
-
input: z.object({ symbol: z.string() }),
|
|
8
|
-
async execute({ symbol }, ctx) {
|
|
9
|
-
ctx.logger.info("Fetching market data", { symbol });
|
|
10
|
-
// Replace with actual market data API call
|
|
11
|
-
return { symbol, price: 0, change: 0, volume: 0 };
|
|
12
|
-
},
|
|
13
|
-
});
|
|
File without changes
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { asAgentId, defineAgent } from "@kalphq/sdk";
|
|
2
|
-
import { exampleStep } from "./steps/example-step.js";
|
|
3
|
-
import { exampleTool } from "./tools/example-tool.js";
|
|
4
|
-
|
|
5
|
-
export default defineAgent({
|
|
6
|
-
id: asAgentId("__AGENT_NAME__"),
|
|
7
|
-
name: "__AGENT_NAME__",
|
|
8
|
-
steps: [exampleStep],
|
|
9
|
-
tools: [exampleTool],
|
|
10
|
-
|
|
11
|
-
async onMessage(message, ctx) {
|
|
12
|
-
const stepped = await ctx.runStep(exampleStep, { message: message.text });
|
|
13
|
-
const tooled = await ctx.callTool(exampleTool, { query: message.text });
|
|
14
|
-
return { text: `${stepped.result} | ${tooled.output}` };
|
|
15
|
-
},
|
|
16
|
-
});
|
|
File without changes
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createStep } from "@kalphq/sdk";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
export const exampleStep = createStep({
|
|
5
|
-
id: "example_step",
|
|
6
|
-
description: "A stub step — replace with your own logic.",
|
|
7
|
-
input: z.object({ message: z.string() }),
|
|
8
|
-
output: z.object({ result: z.string() }),
|
|
9
|
-
async run({ message }, ctx) {
|
|
10
|
-
ctx.logger.info("Running example step", { message });
|
|
11
|
-
return { result: `Processed: ${message}` };
|
|
12
|
-
},
|
|
13
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createTool } from "@kalphq/sdk";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
export const exampleTool = createTool({
|
|
5
|
-
id: "example_tool",
|
|
6
|
-
description: "A stub tool — replace with your own external call.",
|
|
7
|
-
input: z.object({ query: z.string() }),
|
|
8
|
-
async execute({ query }, ctx) {
|
|
9
|
-
ctx.logger.info("Calling example tool", { query });
|
|
10
|
-
// Replace with your actual external API call
|
|
11
|
-
return { output: `Result for: ${query}` };
|
|
12
|
-
},
|
|
13
|
-
});
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{ "deployments": [] }
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"esModuleInterop": true,
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
"outDir": "dist",
|
|
10
|
-
"rootDir": "."
|
|
11
|
-
},
|
|
12
|
-
"include": ["agents/**/*.ts", "../kalp.config.ts"],
|
|
13
|
-
"exclude": ["node_modules", "dist", "meta"]
|
|
14
|
-
}
|