@kalphq/cli 0.0.0-dev-20260416091527 → 0.0.0-dev-20260420003114
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/{chunk-GFEVTHUW.js → chunk-DOHVZBJO.js} +59 -64
- package/dist/chunk-DOHVZBJO.js.map +1 -0
- package/dist/chunk-INMLAVHJ.js +217 -0
- package/dist/chunk-INMLAVHJ.js.map +1 -0
- package/dist/{create-XJURMQC4.js → create-LCVZRFEF.js} +8 -4
- package/dist/{create-XJURMQC4.js.map → create-LCVZRFEF.js.map} +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/{init-K7EASUMM.js → init-VMOFA2AV.js} +2 -2
- package/dist/manifest-LKYALPCB.js +82 -0
- package/dist/manifest-LKYALPCB.js.map +1 -0
- package/dist/push-RUUHE6RW.js +81 -0
- package/dist/push-RUUHE6RW.js.map +1 -0
- package/dist/skill-IGGMF5GR.js +346 -0
- package/dist/skill-IGGMF5GR.js.map +1 -0
- package/package.json +2 -2
- package/templates/project/meta/manifest-registry.json +1 -0
- package/templates/project/meta/manifests/.gitkeep +1 -0
- package/templates/project/meta/skills/.gitkeep +1 -0
- package/templates/project/meta/skills/applied.json +4 -0
- package/dist/chunk-GFEVTHUW.js.map +0 -1
- package/dist/push-YFHHNITO.js +0 -174
- package/dist/push-YFHHNITO.js.map +0 -1
- package/templates/agents/b2b-sales/index.ts +0 -57
- package/templates/agents/b2b-sales/signals/deal-won.ts +0 -31
- package/templates/agents/b2b-sales/signals/hot-lead-alert.ts +0 -29
- package/templates/agents/b2b-sales/steps/qualify-prospect.ts +0 -50
- 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/tools/send-slack-notification.ts +0 -26
- package/templates/agents/b2b-sales/webhooks/crm-inbound.ts +0 -27
- package/templates/agents/b2b-sales/webhooks/stripe-payment.ts +0 -27
- package/templates/agents/customer-support/index.ts +0 -60
- package/templates/agents/customer-support/signals/escalation-needed.ts +0 -28
- package/templates/agents/customer-support/signals/ticket-resolved.ts +0 -29
- package/templates/agents/customer-support/steps/classify-ticket.ts +0 -22
- package/templates/agents/customer-support/steps/escalate-ticket.ts +0 -53
- package/templates/agents/customer-support/tools/create-jira-issue.ts +0 -30
- package/templates/agents/customer-support/tools/search-kb.ts +0 -13
- package/templates/agents/customer-support/webhooks/slack-escalation.ts +0 -27
- package/templates/agents/customer-support/webhooks/zendesk-ticket.ts +0 -29
- package/templates/agents/financial-agent/index.ts +0 -50
- package/templates/agents/financial-agent/signals/market-alert.ts +0 -31
- package/templates/agents/financial-agent/signals/portfolio-rebalance.ts +0 -27
- package/templates/agents/financial-agent/steps/analyze-signal.ts +0 -26
- package/templates/agents/financial-agent/steps/rebalance-check.ts +0 -55
- package/templates/agents/financial-agent/tools/fetch-market-data.ts +0 -13
- package/templates/agents/financial-agent/tools/send-email-alert.ts +0 -31
- package/templates/agents/financial-agent/webhooks/exchange-webhook.ts +0 -33
- package/templates/agents/financial-agent/webhooks/tradingview-alert.ts +0 -30
- package/templates/agents/minimal/index.ts +0 -24
- package/templates/agents/minimal/signals/error-alert.ts +0 -26
- package/templates/agents/minimal/signals/task-complete.ts +0 -25
- package/templates/agents/minimal/steps/example-step.ts +0 -13
- package/templates/agents/minimal/steps/transform-data.ts +0 -32
- package/templates/agents/minimal/tools/example-tool.ts +0 -13
- package/templates/agents/minimal/tools/http-request.ts +0 -26
- package/templates/agents/minimal/webhooks/generic-inbound.ts +0 -25
- package/templates/agents/minimal/webhooks/health-check.ts +0 -23
- /package/dist/{init-K7EASUMM.js.map → init-VMOFA2AV.js.map} +0 -0
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-2H7UOFLK.js";
|
|
5
5
|
|
|
6
6
|
// src/scaffold.ts
|
|
7
|
-
import { writeFile, readFile as readFile2, readdir, cp } from "fs/promises";
|
|
7
|
+
import { writeFile, readFile as readFile2, readdir, cp, mkdir } from "fs/promises";
|
|
8
8
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
9
9
|
import { join as join4, dirname as dirname3 } from "path";
|
|
10
10
|
|
|
@@ -19658,37 +19658,6 @@ var debugApis = {
|
|
|
19658
19658
|
mockable
|
|
19659
19659
|
};
|
|
19660
19660
|
|
|
19661
|
-
// src/templates/index.ts
|
|
19662
|
-
var TEMPLATES = [
|
|
19663
|
-
{
|
|
19664
|
-
id: "customer-support",
|
|
19665
|
-
label: "Customer Support",
|
|
19666
|
-
hint: "ticket routing, escalation, knowledge base",
|
|
19667
|
-
secrets: ["OPENAI_API_KEY"]
|
|
19668
|
-
},
|
|
19669
|
-
{
|
|
19670
|
-
id: "b2b-sales",
|
|
19671
|
-
label: "B2B Sales Outreach",
|
|
19672
|
-
hint: "CRM enrichment, lead scoring",
|
|
19673
|
-
secrets: ["OPENAI_API_KEY", "CRM_API_KEY"]
|
|
19674
|
-
},
|
|
19675
|
-
{
|
|
19676
|
-
id: "financial-agent",
|
|
19677
|
-
label: "Financial Agent",
|
|
19678
|
-
hint: "market signals, portfolio analysis",
|
|
19679
|
-
secrets: ["OPENAI_API_KEY", "MARKET_DATA_API_KEY"]
|
|
19680
|
-
},
|
|
19681
|
-
{
|
|
19682
|
-
id: "minimal",
|
|
19683
|
-
label: "Minimal Skeleton",
|
|
19684
|
-
hint: "bare structure, start from scratch",
|
|
19685
|
-
secrets: []
|
|
19686
|
-
}
|
|
19687
|
-
];
|
|
19688
|
-
function getTemplateMeta(id) {
|
|
19689
|
-
return TEMPLATES.find((t) => t.id === id);
|
|
19690
|
-
}
|
|
19691
|
-
|
|
19692
19661
|
// src/scaffold.ts
|
|
19693
19662
|
var __filename2 = fileURLToPath6(import.meta.url);
|
|
19694
19663
|
var __dirname2 = dirname3(__filename2);
|
|
@@ -19751,32 +19720,67 @@ export default defineConfig({
|
|
|
19751
19720
|
await replacePlaceholders(targetDir, { __PROJECT_NAME__: projectName });
|
|
19752
19721
|
}
|
|
19753
19722
|
async function scaffoldAgent(opts) {
|
|
19754
|
-
const { agentName,
|
|
19755
|
-
const meta = getTemplateMeta(templateId);
|
|
19723
|
+
const { agentName, cwd } = opts;
|
|
19756
19724
|
const agentDir = join4(cwd, "agents", agentName);
|
|
19757
|
-
await
|
|
19758
|
-
|
|
19759
|
-
|
|
19760
|
-
|
|
19761
|
-
|
|
19762
|
-
|
|
19763
|
-
|
|
19764
|
-
|
|
19765
|
-
|
|
19766
|
-
|
|
19767
|
-
|
|
19768
|
-
|
|
19769
|
-
|
|
19770
|
-
|
|
19771
|
-
|
|
19772
|
-
|
|
19773
|
-
|
|
19774
|
-
|
|
19725
|
+
await mkdir(join4(agentDir, "steps"), { recursive: true });
|
|
19726
|
+
await mkdir(join4(agentDir, "tools"), { recursive: true });
|
|
19727
|
+
const agentIndex = `import { asAgentId, defineAgent } from "@kalphq/sdk";
|
|
19728
|
+
import { exampleStep } from "./steps/example-step.js";
|
|
19729
|
+
import { exampleTool } from "./tools/example-tool.js";
|
|
19730
|
+
|
|
19731
|
+
export default defineAgent({
|
|
19732
|
+
id: asAgentId("${agentName}"),
|
|
19733
|
+
name: "${agentName}",
|
|
19734
|
+
steps: [exampleStep],
|
|
19735
|
+
tools: [exampleTool],
|
|
19736
|
+
|
|
19737
|
+
async onMessage(message, ctx) {
|
|
19738
|
+
const stepped = await ctx.runStep(exampleStep, { message: message.text });
|
|
19739
|
+
const tooled = await ctx.callTool(exampleTool, { query: message.text });
|
|
19740
|
+
return { text: stepped.result + " | " + tooled.output };
|
|
19741
|
+
},
|
|
19742
|
+
});
|
|
19743
|
+
`;
|
|
19744
|
+
const stepFile = `import { createStep } from "@kalphq/sdk";
|
|
19745
|
+
import { z } from "zod";
|
|
19746
|
+
|
|
19747
|
+
export const exampleStep = createStep({
|
|
19748
|
+
id: "example_step",
|
|
19749
|
+
description: "A starter step for your agent.",
|
|
19750
|
+
input: z.object({ message: z.string() }),
|
|
19751
|
+
output: z.object({ result: z.string() }),
|
|
19752
|
+
async run({ message }) {
|
|
19753
|
+
return { result: "Processed: " + message };
|
|
19754
|
+
},
|
|
19755
|
+
});
|
|
19756
|
+
`;
|
|
19757
|
+
const toolFile = `import { createTool } from "@kalphq/sdk";
|
|
19758
|
+
import { z } from "zod";
|
|
19759
|
+
|
|
19760
|
+
export const exampleTool = createTool({
|
|
19761
|
+
id: "example_tool",
|
|
19762
|
+
description: "A starter tool for your agent.",
|
|
19763
|
+
input: z.object({ query: z.string() }),
|
|
19764
|
+
async execute({ query }) {
|
|
19765
|
+
return { output: "Tool result for: " + query };
|
|
19766
|
+
},
|
|
19767
|
+
});
|
|
19768
|
+
`;
|
|
19769
|
+
await writeFile(join4(agentDir, "index.ts"), agentIndex, "utf-8");
|
|
19770
|
+
await writeFile(
|
|
19771
|
+
join4(agentDir, "steps", "example-step.ts"),
|
|
19772
|
+
stepFile,
|
|
19773
|
+
"utf-8"
|
|
19774
|
+
);
|
|
19775
|
+
await writeFile(
|
|
19776
|
+
join4(agentDir, "tools", "example-tool.ts"),
|
|
19777
|
+
toolFile,
|
|
19778
|
+
"utf-8"
|
|
19779
|
+
);
|
|
19775
19780
|
}
|
|
19776
19781
|
|
|
19777
19782
|
// src/utils/ui.ts
|
|
19778
19783
|
import * as p from "@clack/prompts";
|
|
19779
|
-
import pc from "picocolors";
|
|
19780
19784
|
async function promptProjectName(opts) {
|
|
19781
19785
|
const message = opts?.message ?? "Project name?";
|
|
19782
19786
|
const placeholder = opts?.placeholder ?? "my-project";
|
|
@@ -19811,14 +19815,6 @@ async function promptAgentDetails() {
|
|
|
19811
19815
|
return "Use lowercase letters, numbers, and dashes only.";
|
|
19812
19816
|
}
|
|
19813
19817
|
}
|
|
19814
|
-
}),
|
|
19815
|
-
template: () => p.select({
|
|
19816
|
-
message: "Choose a template",
|
|
19817
|
-
options: TEMPLATES.map((t) => ({
|
|
19818
|
-
value: t.id,
|
|
19819
|
-
label: t.label,
|
|
19820
|
-
hint: pc.dim(t.hint)
|
|
19821
|
-
}))
|
|
19822
19818
|
})
|
|
19823
19819
|
},
|
|
19824
19820
|
{
|
|
@@ -19829,8 +19825,7 @@ async function promptAgentDetails() {
|
|
|
19829
19825
|
}
|
|
19830
19826
|
);
|
|
19831
19827
|
return {
|
|
19832
|
-
name: answers.name
|
|
19833
|
-
templateId: answers.template
|
|
19828
|
+
name: answers.name
|
|
19834
19829
|
};
|
|
19835
19830
|
}
|
|
19836
19831
|
|
|
@@ -19840,4 +19835,4 @@ export {
|
|
|
19840
19835
|
promptProjectName,
|
|
19841
19836
|
promptAgentDetails
|
|
19842
19837
|
};
|
|
19843
|
-
//# sourceMappingURL=chunk-
|
|
19838
|
+
//# sourceMappingURL=chunk-DOHVZBJO.js.map
|