struere 0.3.8 → 0.3.10
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/bin/struere.js +28 -69
- package/dist/cli/index.js +28 -69
- package/dist/cli/templates/index.d.ts +1 -2
- package/dist/cli/templates/index.d.ts.map +1 -1
- package/dist/cli/utils/scaffold.d.ts.map +1 -1
- package/dist/define/index.d.ts +0 -1
- package/dist/define/index.d.ts.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -13
- package/dist/types.d.ts +0 -13
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/bin/struere.js
CHANGED
|
@@ -17313,7 +17313,6 @@ export default defineConfig({
|
|
|
17313
17313
|
function getAgentTs(name) {
|
|
17314
17314
|
const displayName = name.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
17315
17315
|
return `import { defineAgent } from 'struere'
|
|
17316
|
-
import { context } from './context'
|
|
17317
17316
|
import { tools } from './tools'
|
|
17318
17317
|
|
|
17319
17318
|
export default defineAgent({
|
|
@@ -17328,6 +17327,8 @@ export default defineAgent({
|
|
|
17328
17327
|
},
|
|
17329
17328
|
systemPrompt: \`You are ${displayName}, a helpful AI assistant.
|
|
17330
17329
|
|
|
17330
|
+
Current time: {{datetime}}
|
|
17331
|
+
|
|
17331
17332
|
Your capabilities:
|
|
17332
17333
|
- Answer questions accurately and helpfully
|
|
17333
17334
|
- Use available tools when appropriate
|
|
@@ -17335,30 +17336,6 @@ Your capabilities:
|
|
|
17335
17336
|
|
|
17336
17337
|
Always be concise, accurate, and helpful.\`,
|
|
17337
17338
|
tools,
|
|
17338
|
-
context,
|
|
17339
|
-
state: {
|
|
17340
|
-
storage: 'memory',
|
|
17341
|
-
ttl: 3600,
|
|
17342
|
-
},
|
|
17343
|
-
})
|
|
17344
|
-
`;
|
|
17345
|
-
}
|
|
17346
|
-
function getContextTs() {
|
|
17347
|
-
return `import { defineContext } from 'struere'
|
|
17348
|
-
|
|
17349
|
-
export const context = defineContext(async (request) => {
|
|
17350
|
-
const { conversationId, userId, channel, state } = request
|
|
17351
|
-
|
|
17352
|
-
return {
|
|
17353
|
-
additionalContext: \`
|
|
17354
|
-
Current conversation: \${conversationId}
|
|
17355
|
-
Channel: \${channel}
|
|
17356
|
-
\`,
|
|
17357
|
-
variables: {
|
|
17358
|
-
userId,
|
|
17359
|
-
timestamp: new Date().toISOString(),
|
|
17360
|
-
},
|
|
17361
|
-
}
|
|
17362
17339
|
})
|
|
17363
17340
|
`;
|
|
17364
17341
|
}
|
|
@@ -17480,7 +17457,7 @@ function getEnvLocal(deploymentUrl) {
|
|
|
17480
17457
|
return `STRUERE_DEPLOYMENT_URL=${deploymentUrl}
|
|
17481
17458
|
`;
|
|
17482
17459
|
}
|
|
17483
|
-
function
|
|
17460
|
+
function getClaudeMD(name) {
|
|
17484
17461
|
const displayName = name.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
17485
17462
|
return `# ${displayName} Agent
|
|
17486
17463
|
|
|
@@ -17491,7 +17468,6 @@ This is a Struere AI agent project. Struere is a framework for building producti
|
|
|
17491
17468
|
\`\`\`
|
|
17492
17469
|
src/
|
|
17493
17470
|
\u251C\u2500\u2500 agent.ts # Agent definition (system prompt, model, tools)
|
|
17494
|
-
\u251C\u2500\u2500 context.ts # Dynamic context injection per request
|
|
17495
17471
|
\u251C\u2500\u2500 tools.ts # Custom tool definitions
|
|
17496
17472
|
\u2514\u2500\u2500 workflows/ # Multi-step workflow definitions
|
|
17497
17473
|
tests/
|
|
@@ -17507,7 +17483,6 @@ Define your agent in \`src/agent.ts\`:
|
|
|
17507
17483
|
\`\`\`typescript
|
|
17508
17484
|
import { defineAgent } from 'struere'
|
|
17509
17485
|
import { tools } from './tools'
|
|
17510
|
-
import { context } from './context'
|
|
17511
17486
|
|
|
17512
17487
|
export default defineAgent({
|
|
17513
17488
|
name: 'my-agent',
|
|
@@ -17524,11 +17499,6 @@ export default defineAgent({
|
|
|
17524
17499
|
Current time: {{datetime}}
|
|
17525
17500
|
Customer: {{entity.get({"id": "{{thread.metadata.customerId}}"})}}\\\`,
|
|
17526
17501
|
tools,
|
|
17527
|
-
context,
|
|
17528
|
-
state: {
|
|
17529
|
-
storage: 'memory',
|
|
17530
|
-
ttl: 3600,
|
|
17531
|
-
},
|
|
17532
17502
|
})
|
|
17533
17503
|
\`\`\`
|
|
17534
17504
|
|
|
@@ -17669,33 +17639,6 @@ Example job operations:
|
|
|
17669
17639
|
{ "id": "job_abc123" }
|
|
17670
17640
|
\`\`\`
|
|
17671
17641
|
|
|
17672
|
-
## Context Function
|
|
17673
|
-
|
|
17674
|
-
Inject dynamic context per request in \`src/context.ts\`:
|
|
17675
|
-
|
|
17676
|
-
\`\`\`typescript
|
|
17677
|
-
import { defineContext } from 'struere'
|
|
17678
|
-
|
|
17679
|
-
export const context = defineContext(async (request) => {
|
|
17680
|
-
const { conversationId, userId, channel, state } = request
|
|
17681
|
-
|
|
17682
|
-
const userProfile = await fetchUserProfile(userId)
|
|
17683
|
-
|
|
17684
|
-
return {
|
|
17685
|
-
additionalContext: \\\`
|
|
17686
|
-
User: \${userProfile.name} (\${userProfile.tier} tier)
|
|
17687
|
-
Conversation: \${conversationId}
|
|
17688
|
-
Channel: \${channel}
|
|
17689
|
-
\\\`,
|
|
17690
|
-
variables: {
|
|
17691
|
-
userId,
|
|
17692
|
-
userTier: userProfile.tier,
|
|
17693
|
-
timestamp: new Date().toISOString(),
|
|
17694
|
-
},
|
|
17695
|
-
}
|
|
17696
|
-
})
|
|
17697
|
-
\`\`\`
|
|
17698
|
-
|
|
17699
17642
|
## Testing
|
|
17700
17643
|
|
|
17701
17644
|
Write YAML-based conversation tests in \`tests/\`:
|
|
@@ -17803,7 +17746,7 @@ curl -X POST https://your-deployment.convex.cloud/v1/chat \\
|
|
|
17803
17746
|
4. **Events**: Emit events for audit trails and analytics
|
|
17804
17747
|
5. **Jobs**: Use jobs for async operations (emails, notifications)
|
|
17805
17748
|
6. **Testing**: Write tests for critical conversation flows
|
|
17806
|
-
7. **
|
|
17749
|
+
7. **Thread Metadata**: Use metadata for user-specific personalization
|
|
17807
17750
|
`;
|
|
17808
17751
|
}
|
|
17809
17752
|
|
|
@@ -17841,12 +17784,11 @@ function scaffoldAgentFiles(cwd, projectName) {
|
|
|
17841
17784
|
"tsconfig.json": getTsConfig(),
|
|
17842
17785
|
"struere.config.ts": getStruereConfig(),
|
|
17843
17786
|
"src/agent.ts": getAgentTs(projectName),
|
|
17844
|
-
"src/context.ts": getContextTs(),
|
|
17845
17787
|
"src/tools.ts": getToolsTs(),
|
|
17846
17788
|
"src/workflows/.gitkeep": "",
|
|
17847
17789
|
"tests/basic.test.yaml": getBasicTestYaml(),
|
|
17848
17790
|
".env.example": getEnvExample(),
|
|
17849
|
-
".
|
|
17791
|
+
"CLAUDE.md": getClaudeMD(projectName)
|
|
17850
17792
|
};
|
|
17851
17793
|
for (const [relativePath, content] of Object.entries(files)) {
|
|
17852
17794
|
const fullPath = join3(cwd, relativePath);
|
|
@@ -18174,7 +18116,7 @@ import { join as join6 } from "path";
|
|
|
18174
18116
|
async function loadAgent(cwd) {
|
|
18175
18117
|
const agentPath = join6(cwd, "src/agent.ts");
|
|
18176
18118
|
try {
|
|
18177
|
-
const module = await import(agentPath);
|
|
18119
|
+
const module = await import(`${agentPath}?t=${Date.now()}`);
|
|
18178
18120
|
const agent = module.default || module;
|
|
18179
18121
|
if (!agent.name) {
|
|
18180
18122
|
throw new Error("Agent must have a name");
|
|
@@ -18224,10 +18166,10 @@ var devCommand = new Command("dev").description("Sync agent to development envir
|
|
|
18224
18166
|
spinner.start("Loading agent");
|
|
18225
18167
|
let agent = await loadAgent(cwd);
|
|
18226
18168
|
spinner.succeed(`Agent "${agent.name}" loaded`);
|
|
18227
|
-
const claudeMdPath = join7(cwd, ".
|
|
18169
|
+
const claudeMdPath = join7(cwd, "CLAUDE.md");
|
|
18228
18170
|
if (!existsSync5(claudeMdPath)) {
|
|
18229
|
-
writeFileSync4(claudeMdPath,
|
|
18230
|
-
console.log(source_default.green("\u2713"), "Created .
|
|
18171
|
+
writeFileSync4(claudeMdPath, getClaudeMD(project.agent.slug));
|
|
18172
|
+
console.log(source_default.green("\u2713"), "Created CLAUDE.md");
|
|
18231
18173
|
}
|
|
18232
18174
|
let credentials = loadCredentials();
|
|
18233
18175
|
const apiKey = getApiKey();
|
|
@@ -18423,7 +18365,24 @@ async function interactiveSetup(cwd) {
|
|
|
18423
18365
|
console.log(source_default.green("\u2713"), `Created ${file}`);
|
|
18424
18366
|
}
|
|
18425
18367
|
console.log();
|
|
18426
|
-
|
|
18368
|
+
spinner.start("Installing dependencies");
|
|
18369
|
+
try {
|
|
18370
|
+
const proc = Bun.spawn(["bun", "install"], {
|
|
18371
|
+
cwd,
|
|
18372
|
+
stdout: "pipe",
|
|
18373
|
+
stderr: "pipe"
|
|
18374
|
+
});
|
|
18375
|
+
await proc.exited;
|
|
18376
|
+
if (proc.exitCode === 0) {
|
|
18377
|
+
spinner.succeed("Dependencies installed");
|
|
18378
|
+
} else {
|
|
18379
|
+
spinner.fail("Failed to install dependencies");
|
|
18380
|
+
console.log(source_default.yellow("Run"), source_default.cyan("bun install"), source_default.yellow("manually"));
|
|
18381
|
+
}
|
|
18382
|
+
} catch {
|
|
18383
|
+
spinner.fail("Failed to install dependencies");
|
|
18384
|
+
console.log(source_default.yellow("Run"), source_default.cyan("bun install"), source_default.yellow("manually"));
|
|
18385
|
+
}
|
|
18427
18386
|
}
|
|
18428
18387
|
console.log();
|
|
18429
18388
|
return projectData;
|
|
@@ -19148,7 +19107,7 @@ var whoamiCommand = new Command("whoami").description("Show current logged in us
|
|
|
19148
19107
|
// package.json
|
|
19149
19108
|
var package_default = {
|
|
19150
19109
|
name: "struere",
|
|
19151
|
-
version: "0.3.
|
|
19110
|
+
version: "0.3.10",
|
|
19152
19111
|
description: "Build, test, and deploy AI agents",
|
|
19153
19112
|
keywords: [
|
|
19154
19113
|
"ai",
|
package/dist/cli/index.js
CHANGED
|
@@ -652,7 +652,6 @@ export default defineConfig({
|
|
|
652
652
|
function getAgentTs(name) {
|
|
653
653
|
const displayName = name.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
654
654
|
return `import { defineAgent } from 'struere'
|
|
655
|
-
import { context } from './context'
|
|
656
655
|
import { tools } from './tools'
|
|
657
656
|
|
|
658
657
|
export default defineAgent({
|
|
@@ -667,6 +666,8 @@ export default defineAgent({
|
|
|
667
666
|
},
|
|
668
667
|
systemPrompt: \`You are ${displayName}, a helpful AI assistant.
|
|
669
668
|
|
|
669
|
+
Current time: {{datetime}}
|
|
670
|
+
|
|
670
671
|
Your capabilities:
|
|
671
672
|
- Answer questions accurately and helpfully
|
|
672
673
|
- Use available tools when appropriate
|
|
@@ -674,30 +675,6 @@ Your capabilities:
|
|
|
674
675
|
|
|
675
676
|
Always be concise, accurate, and helpful.\`,
|
|
676
677
|
tools,
|
|
677
|
-
context,
|
|
678
|
-
state: {
|
|
679
|
-
storage: 'memory',
|
|
680
|
-
ttl: 3600,
|
|
681
|
-
},
|
|
682
|
-
})
|
|
683
|
-
`;
|
|
684
|
-
}
|
|
685
|
-
function getContextTs() {
|
|
686
|
-
return `import { defineContext } from 'struere'
|
|
687
|
-
|
|
688
|
-
export const context = defineContext(async (request) => {
|
|
689
|
-
const { conversationId, userId, channel, state } = request
|
|
690
|
-
|
|
691
|
-
return {
|
|
692
|
-
additionalContext: \`
|
|
693
|
-
Current conversation: \${conversationId}
|
|
694
|
-
Channel: \${channel}
|
|
695
|
-
\`,
|
|
696
|
-
variables: {
|
|
697
|
-
userId,
|
|
698
|
-
timestamp: new Date().toISOString(),
|
|
699
|
-
},
|
|
700
|
-
}
|
|
701
678
|
})
|
|
702
679
|
`;
|
|
703
680
|
}
|
|
@@ -819,7 +796,7 @@ function getEnvLocal(deploymentUrl) {
|
|
|
819
796
|
return `STRUERE_DEPLOYMENT_URL=${deploymentUrl}
|
|
820
797
|
`;
|
|
821
798
|
}
|
|
822
|
-
function
|
|
799
|
+
function getClaudeMD(name) {
|
|
823
800
|
const displayName = name.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
824
801
|
return `# ${displayName} Agent
|
|
825
802
|
|
|
@@ -830,7 +807,6 @@ This is a Struere AI agent project. Struere is a framework for building producti
|
|
|
830
807
|
\`\`\`
|
|
831
808
|
src/
|
|
832
809
|
\u251C\u2500\u2500 agent.ts # Agent definition (system prompt, model, tools)
|
|
833
|
-
\u251C\u2500\u2500 context.ts # Dynamic context injection per request
|
|
834
810
|
\u251C\u2500\u2500 tools.ts # Custom tool definitions
|
|
835
811
|
\u2514\u2500\u2500 workflows/ # Multi-step workflow definitions
|
|
836
812
|
tests/
|
|
@@ -846,7 +822,6 @@ Define your agent in \`src/agent.ts\`:
|
|
|
846
822
|
\`\`\`typescript
|
|
847
823
|
import { defineAgent } from 'struere'
|
|
848
824
|
import { tools } from './tools'
|
|
849
|
-
import { context } from './context'
|
|
850
825
|
|
|
851
826
|
export default defineAgent({
|
|
852
827
|
name: 'my-agent',
|
|
@@ -863,11 +838,6 @@ export default defineAgent({
|
|
|
863
838
|
Current time: {{datetime}}
|
|
864
839
|
Customer: {{entity.get({"id": "{{thread.metadata.customerId}}"})}}\\\`,
|
|
865
840
|
tools,
|
|
866
|
-
context,
|
|
867
|
-
state: {
|
|
868
|
-
storage: 'memory',
|
|
869
|
-
ttl: 3600,
|
|
870
|
-
},
|
|
871
841
|
})
|
|
872
842
|
\`\`\`
|
|
873
843
|
|
|
@@ -1008,33 +978,6 @@ Example job operations:
|
|
|
1008
978
|
{ "id": "job_abc123" }
|
|
1009
979
|
\`\`\`
|
|
1010
980
|
|
|
1011
|
-
## Context Function
|
|
1012
|
-
|
|
1013
|
-
Inject dynamic context per request in \`src/context.ts\`:
|
|
1014
|
-
|
|
1015
|
-
\`\`\`typescript
|
|
1016
|
-
import { defineContext } from 'struere'
|
|
1017
|
-
|
|
1018
|
-
export const context = defineContext(async (request) => {
|
|
1019
|
-
const { conversationId, userId, channel, state } = request
|
|
1020
|
-
|
|
1021
|
-
const userProfile = await fetchUserProfile(userId)
|
|
1022
|
-
|
|
1023
|
-
return {
|
|
1024
|
-
additionalContext: \\\`
|
|
1025
|
-
User: \${userProfile.name} (\${userProfile.tier} tier)
|
|
1026
|
-
Conversation: \${conversationId}
|
|
1027
|
-
Channel: \${channel}
|
|
1028
|
-
\\\`,
|
|
1029
|
-
variables: {
|
|
1030
|
-
userId,
|
|
1031
|
-
userTier: userProfile.tier,
|
|
1032
|
-
timestamp: new Date().toISOString(),
|
|
1033
|
-
},
|
|
1034
|
-
}
|
|
1035
|
-
})
|
|
1036
|
-
\`\`\`
|
|
1037
|
-
|
|
1038
981
|
## Testing
|
|
1039
982
|
|
|
1040
983
|
Write YAML-based conversation tests in \`tests/\`:
|
|
@@ -1142,7 +1085,7 @@ curl -X POST https://your-deployment.convex.cloud/v1/chat \\
|
|
|
1142
1085
|
4. **Events**: Emit events for audit trails and analytics
|
|
1143
1086
|
5. **Jobs**: Use jobs for async operations (emails, notifications)
|
|
1144
1087
|
6. **Testing**: Write tests for critical conversation flows
|
|
1145
|
-
7. **
|
|
1088
|
+
7. **Thread Metadata**: Use metadata for user-specific personalization
|
|
1146
1089
|
`;
|
|
1147
1090
|
}
|
|
1148
1091
|
|
|
@@ -1180,12 +1123,11 @@ function scaffoldAgentFiles(cwd, projectName) {
|
|
|
1180
1123
|
"tsconfig.json": getTsConfig(),
|
|
1181
1124
|
"struere.config.ts": getStruereConfig(),
|
|
1182
1125
|
"src/agent.ts": getAgentTs(projectName),
|
|
1183
|
-
"src/context.ts": getContextTs(),
|
|
1184
1126
|
"src/tools.ts": getToolsTs(),
|
|
1185
1127
|
"src/workflows/.gitkeep": "",
|
|
1186
1128
|
"tests/basic.test.yaml": getBasicTestYaml(),
|
|
1187
1129
|
".env.example": getEnvExample(),
|
|
1188
|
-
".
|
|
1130
|
+
"CLAUDE.md": getClaudeMD(projectName)
|
|
1189
1131
|
};
|
|
1190
1132
|
for (const [relativePath, content] of Object.entries(files)) {
|
|
1191
1133
|
const fullPath = join3(cwd, relativePath);
|
|
@@ -1516,7 +1458,7 @@ import { join as join6 } from "path";
|
|
|
1516
1458
|
async function loadAgent(cwd) {
|
|
1517
1459
|
const agentPath = join6(cwd, "src/agent.ts");
|
|
1518
1460
|
try {
|
|
1519
|
-
const module = await import(agentPath);
|
|
1461
|
+
const module = await import(`${agentPath}?t=${Date.now()}`);
|
|
1520
1462
|
const agent = module.default || module;
|
|
1521
1463
|
if (!agent.name) {
|
|
1522
1464
|
throw new Error("Agent must have a name");
|
|
@@ -1566,10 +1508,10 @@ var devCommand = new Command3("dev").description("Sync agent to development envi
|
|
|
1566
1508
|
spinner.start("Loading agent");
|
|
1567
1509
|
let agent = await loadAgent(cwd);
|
|
1568
1510
|
spinner.succeed(`Agent "${agent.name}" loaded`);
|
|
1569
|
-
const claudeMdPath = join7(cwd, ".
|
|
1511
|
+
const claudeMdPath = join7(cwd, "CLAUDE.md");
|
|
1570
1512
|
if (!existsSync5(claudeMdPath)) {
|
|
1571
|
-
writeFileSync4(claudeMdPath,
|
|
1572
|
-
console.log(chalk3.green("\u2713"), "Created .
|
|
1513
|
+
writeFileSync4(claudeMdPath, getClaudeMD(project.agent.slug));
|
|
1514
|
+
console.log(chalk3.green("\u2713"), "Created CLAUDE.md");
|
|
1573
1515
|
}
|
|
1574
1516
|
let credentials = loadCredentials();
|
|
1575
1517
|
const apiKey = getApiKey();
|
|
@@ -1765,7 +1707,24 @@ async function interactiveSetup(cwd) {
|
|
|
1765
1707
|
console.log(chalk3.green("\u2713"), `Created ${file}`);
|
|
1766
1708
|
}
|
|
1767
1709
|
console.log();
|
|
1768
|
-
|
|
1710
|
+
spinner.start("Installing dependencies");
|
|
1711
|
+
try {
|
|
1712
|
+
const proc = Bun.spawn(["bun", "install"], {
|
|
1713
|
+
cwd,
|
|
1714
|
+
stdout: "pipe",
|
|
1715
|
+
stderr: "pipe"
|
|
1716
|
+
});
|
|
1717
|
+
await proc.exited;
|
|
1718
|
+
if (proc.exitCode === 0) {
|
|
1719
|
+
spinner.succeed("Dependencies installed");
|
|
1720
|
+
} else {
|
|
1721
|
+
spinner.fail("Failed to install dependencies");
|
|
1722
|
+
console.log(chalk3.yellow("Run"), chalk3.cyan("bun install"), chalk3.yellow("manually"));
|
|
1723
|
+
}
|
|
1724
|
+
} catch {
|
|
1725
|
+
spinner.fail("Failed to install dependencies");
|
|
1726
|
+
console.log(chalk3.yellow("Run"), chalk3.cyan("bun install"), chalk3.yellow("manually"));
|
|
1727
|
+
}
|
|
1769
1728
|
}
|
|
1770
1729
|
console.log();
|
|
1771
1730
|
return projectData;
|
|
@@ -2513,7 +2472,7 @@ var whoamiCommand = new Command11("whoami").description("Show current logged in
|
|
|
2513
2472
|
// package.json
|
|
2514
2473
|
var package_default = {
|
|
2515
2474
|
name: "struere",
|
|
2516
|
-
version: "0.3.
|
|
2475
|
+
version: "0.3.10",
|
|
2517
2476
|
description: "Build, test, and deploy AI agents",
|
|
2518
2477
|
keywords: [
|
|
2519
2478
|
"ai",
|
|
@@ -2,12 +2,11 @@ export declare function getPackageJson(name: string): string;
|
|
|
2
2
|
export declare function getTsConfig(): string;
|
|
3
3
|
export declare function getStruereConfig(): string;
|
|
4
4
|
export declare function getAgentTs(name: string): string;
|
|
5
|
-
export declare function getContextTs(): string;
|
|
6
5
|
export declare function getToolsTs(): string;
|
|
7
6
|
export declare function getBasicTestYaml(): string;
|
|
8
7
|
export declare function getEnvExample(): string;
|
|
9
8
|
export declare function getGitignore(): string;
|
|
10
9
|
export declare function getStruereJson(agentId: string, team: string, slug: string, name: string): string;
|
|
11
10
|
export declare function getEnvLocal(deploymentUrl: string): string;
|
|
12
|
-
export declare function
|
|
11
|
+
export declare function getClaudeMD(name: string): string;
|
|
13
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/templates/index.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAuBnD;AAED,wBAAgB,WAAW,IAAI,MAAM,CAsBpC;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAgBzC;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/templates/index.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAuBnD;AAED,wBAAgB,WAAW,IAAI,MAAM,CAsBpC;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAgBzC;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAgC/C;AAED,wBAAgB,UAAU,IAAI,MAAM,CAoDnC;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAmBzC;AAED,wBAAgB,aAAa,IAAI,MAAM,CAatC;AAED,wBAAgB,YAAY,IAAI,MAAM,CAgBrC;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAahG;AAED,wBAAgB,WAAW,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAGzD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAuShD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/scaffold.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/scaffold.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,YAAY,EAAE,MAAM,EAAE,CAAA;CACvB;AAeD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,cAAc,CAexF;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,cAAc,CA+BrF;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,cAAc,CA8BnF;AAsBD,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAElD"}
|
package/dist/define/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/define/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/define/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { defineAgent } from './define/agent';
|
|
2
|
-
export { defineContext } from './define/context';
|
|
3
2
|
export { defineTools } from './define/tools';
|
|
4
3
|
export { defineConfig } from './define/config';
|
|
5
|
-
export type { AgentConfig, ModelConfig, ToolReference, ToolParameters, ParameterDefinition, ToolHandler, ToolContext, StateAccessor, WorkflowReference, StateConfig,
|
|
4
|
+
export type { AgentConfig, ModelConfig, ToolReference, ToolParameters, ParameterDefinition, ToolHandler, ToolContext, StateAccessor, WorkflowReference, StateConfig, FrameworkConfig, CorsConfig, LoggingConfig, AuthConfig, Message, Conversation, TestCase, TestMessage, TestToolCall, TestAssertion, DeployConfig, ScalingConfig, } from './types';
|
|
6
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,YAAY,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,UAAU,EACV,aAAa,EACb,UAAU,EACV,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,aAAa,GACd,MAAM,SAAS,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -19,18 +19,6 @@ function defineAgent(config) {
|
|
|
19
19
|
...config
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
// src/define/context.ts
|
|
23
|
-
function defineContext(fn) {
|
|
24
|
-
return async (request) => {
|
|
25
|
-
try {
|
|
26
|
-
const result = await fn(request);
|
|
27
|
-
return result ?? {};
|
|
28
|
-
} catch (error) {
|
|
29
|
-
console.error("Context function error:", error);
|
|
30
|
-
return {};
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
22
|
// src/define/tools.ts
|
|
35
23
|
function defineTools(tools) {
|
|
36
24
|
return tools.map(validateTool);
|
|
@@ -92,7 +80,6 @@ function defineConfig(config = {}) {
|
|
|
92
80
|
}
|
|
93
81
|
export {
|
|
94
82
|
defineTools,
|
|
95
|
-
defineContext,
|
|
96
83
|
defineConfig,
|
|
97
84
|
defineAgent
|
|
98
85
|
};
|
package/dist/types.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ export interface AgentConfig {
|
|
|
7
7
|
tools?: ToolReference[];
|
|
8
8
|
workflows?: WorkflowReference[];
|
|
9
9
|
state?: StateConfig;
|
|
10
|
-
context?: ContextFunction;
|
|
11
10
|
}
|
|
12
11
|
export interface ModelConfig {
|
|
13
12
|
provider: 'anthropic' | 'openai' | 'google' | 'custom';
|
|
@@ -54,18 +53,6 @@ export interface StateConfig {
|
|
|
54
53
|
ttl?: number;
|
|
55
54
|
prefix?: string;
|
|
56
55
|
}
|
|
57
|
-
export type ContextFunction = (request: ContextRequest) => Promise<ContextResult>;
|
|
58
|
-
export interface ContextRequest {
|
|
59
|
-
conversationId: string;
|
|
60
|
-
userId?: string;
|
|
61
|
-
channel: string;
|
|
62
|
-
message: string;
|
|
63
|
-
state: StateAccessor;
|
|
64
|
-
}
|
|
65
|
-
export interface ContextResult {
|
|
66
|
-
additionalContext?: string;
|
|
67
|
-
variables?: Record<string, unknown>;
|
|
68
|
-
}
|
|
69
56
|
export interface FrameworkConfig {
|
|
70
57
|
port?: number;
|
|
71
58
|
host?: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,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