@inkeep/agents-cli 0.0.0-dev-20251104211850 → 0.0.0-dev-20251105001429
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/index.js +481 -139
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -235163,7 +235163,9 @@ function generateProjectDefinition(projectId, projectData, style = DEFAULT_STYLE
|
|
|
235163
235163
|
missingFields.push("models.base");
|
|
235164
235164
|
}
|
|
235165
235165
|
if (missingFields.length > 0) {
|
|
235166
|
-
throw new Error(
|
|
235166
|
+
throw new Error(
|
|
235167
|
+
`Missing required fields for project '${projectId}': ${missingFields.join(", ")}`
|
|
235168
|
+
);
|
|
235167
235169
|
}
|
|
235168
235170
|
const { quotes, semicolons, indentation } = style;
|
|
235169
235171
|
const q = quotes === "single" ? "'" : '"';
|
|
@@ -235182,10 +235184,14 @@ function generateProjectDefinition(projectId, projectData, style = DEFAULT_STYLE
|
|
|
235182
235184
|
if (shouldInclude(projectData.stopWhen)) {
|
|
235183
235185
|
lines.push(`${indentation}stopWhen: {`);
|
|
235184
235186
|
if (projectData.stopWhen.transferCountIs !== void 0) {
|
|
235185
|
-
lines.push(
|
|
235187
|
+
lines.push(
|
|
235188
|
+
`${indentation}${indentation}transferCountIs: ${projectData.stopWhen.transferCountIs}, // Max transfers for agents`
|
|
235189
|
+
);
|
|
235186
235190
|
}
|
|
235187
235191
|
if (projectData.stopWhen.stepCountIs !== void 0) {
|
|
235188
|
-
lines.push(
|
|
235192
|
+
lines.push(
|
|
235193
|
+
`${indentation}${indentation}stepCountIs: ${projectData.stopWhen.stepCountIs} // Max steps for sub-agents`
|
|
235194
|
+
);
|
|
235189
235195
|
}
|
|
235190
235196
|
if (lines.length > 1) {
|
|
235191
235197
|
const lastLine = lines[lines.length - 1];
|
|
@@ -235216,7 +235222,12 @@ function generateProjectDefinition(projectId, projectData, style = DEFAULT_STYLE
|
|
|
235216
235222
|
lines.push(`${indentation}dataComponents: () => ${dataComponentsArray},`);
|
|
235217
235223
|
}
|
|
235218
235224
|
if (shouldInclude(projectData.artifactComponents)) {
|
|
235219
|
-
const artifactComponentsArray = registry2 ? registry2.formatReferencesForCode(
|
|
235225
|
+
const artifactComponentsArray = registry2 ? registry2.formatReferencesForCode(
|
|
235226
|
+
projectData.artifactComponents,
|
|
235227
|
+
"artifactComponent",
|
|
235228
|
+
style,
|
|
235229
|
+
2
|
|
235230
|
+
) : "[]";
|
|
235220
235231
|
lines.push(`${indentation}artifactComponents: () => ${artifactComponentsArray},`);
|
|
235221
235232
|
}
|
|
235222
235233
|
if (shouldInclude(projectData.credentialReferences)) {
|
|
@@ -235468,28 +235479,40 @@ function generateAgentDefinition(agentId, agentData, style = DEFAULT_STYLE, regi
|
|
|
235468
235479
|
lines.push(`${indentation}models: {`);
|
|
235469
235480
|
if (agentData.models.base?.model) {
|
|
235470
235481
|
lines.push(`${indentation}${indentation}base: {`);
|
|
235471
|
-
lines.push(
|
|
235482
|
+
lines.push(
|
|
235483
|
+
`${indentation}${indentation}${indentation}model: ${formatString(agentData.models.base.model, q)}`
|
|
235484
|
+
);
|
|
235472
235485
|
if (agentData.models.base.providerOptions) {
|
|
235473
235486
|
lines.push(`${indentation}${indentation}${indentation},`);
|
|
235474
|
-
lines.push(
|
|
235487
|
+
lines.push(
|
|
235488
|
+
`${indentation}${indentation}${indentation}providerOptions: ${JSON.stringify(agentData.models.base.providerOptions)}`
|
|
235489
|
+
);
|
|
235475
235490
|
}
|
|
235476
235491
|
lines.push(`${indentation}${indentation}},`);
|
|
235477
235492
|
}
|
|
235478
235493
|
if (agentData.models.structuredOutput?.model) {
|
|
235479
235494
|
lines.push(`${indentation}${indentation}structuredOutput: {`);
|
|
235480
|
-
lines.push(
|
|
235495
|
+
lines.push(
|
|
235496
|
+
`${indentation}${indentation}${indentation}model: ${formatString(agentData.models.structuredOutput.model, q)}`
|
|
235497
|
+
);
|
|
235481
235498
|
if (agentData.models.structuredOutput.providerOptions) {
|
|
235482
235499
|
lines.push(`${indentation}${indentation}${indentation},`);
|
|
235483
|
-
lines.push(
|
|
235500
|
+
lines.push(
|
|
235501
|
+
`${indentation}${indentation}${indentation}providerOptions: ${JSON.stringify(agentData.models.structuredOutput.providerOptions)}`
|
|
235502
|
+
);
|
|
235484
235503
|
}
|
|
235485
235504
|
lines.push(`${indentation}${indentation}},`);
|
|
235486
235505
|
}
|
|
235487
235506
|
if (agentData.models.summarizer?.model) {
|
|
235488
235507
|
lines.push(`${indentation}${indentation}summarizer: {`);
|
|
235489
|
-
lines.push(
|
|
235508
|
+
lines.push(
|
|
235509
|
+
`${indentation}${indentation}${indentation}model: ${formatString(agentData.models.summarizer.model, q)}`
|
|
235510
|
+
);
|
|
235490
235511
|
if (agentData.models.summarizer.providerOptions) {
|
|
235491
235512
|
lines.push(`${indentation}${indentation}${indentation},`);
|
|
235492
|
-
lines.push(
|
|
235513
|
+
lines.push(
|
|
235514
|
+
`${indentation}${indentation}${indentation}providerOptions: ${JSON.stringify(agentData.models.summarizer.providerOptions)}`
|
|
235515
|
+
);
|
|
235493
235516
|
}
|
|
235494
235517
|
lines.push(`${indentation}${indentation}},`);
|
|
235495
235518
|
}
|
|
@@ -235502,7 +235525,9 @@ function generateAgentDefinition(agentId, agentData, style = DEFAULT_STYLE, regi
|
|
|
235502
235525
|
}
|
|
235503
235526
|
const defaultSubAgentVar = registry2.getVariableName(agentData.defaultSubAgentId, "subAgent");
|
|
235504
235527
|
if (!defaultSubAgentVar) {
|
|
235505
|
-
throw new Error(
|
|
235528
|
+
throw new Error(
|
|
235529
|
+
`Failed to resolve variable name for default sub-agent: ${agentData.defaultSubAgentId}`
|
|
235530
|
+
);
|
|
235506
235531
|
}
|
|
235507
235532
|
lines.push(`${indentation}defaultSubAgent: ${defaultSubAgentVar},`);
|
|
235508
235533
|
}
|
|
@@ -235564,7 +235589,9 @@ function generateAgentImports(agentId, agentData, style = DEFAULT_STYLE, registr
|
|
|
235564
235589
|
const referencedComponents = [];
|
|
235565
235590
|
if (agentData.subAgents && typeof agentData.subAgents === "object") {
|
|
235566
235591
|
const subAgentIds = Object.keys(agentData.subAgents);
|
|
235567
|
-
referencedComponents.push(
|
|
235592
|
+
referencedComponents.push(
|
|
235593
|
+
...subAgentIds.map((id) => ({ id, type: "subAgent" }))
|
|
235594
|
+
);
|
|
235568
235595
|
}
|
|
235569
235596
|
if (agentData.statusUpdates && agentData.statusUpdates.statusComponents && Array.isArray(agentData.statusUpdates.statusComponents)) {
|
|
235570
235597
|
for (const comp of agentData.statusUpdates.statusComponents) {
|
|
@@ -235649,7 +235676,9 @@ function generateSubAgentDefinition(agentId, agentData, style = DEFAULT_STYLE, r
|
|
|
235649
235676
|
(field) => !agentData[field] || agentData[field] === null || agentData[field] === void 0
|
|
235650
235677
|
);
|
|
235651
235678
|
if (missingFields.length > 0) {
|
|
235652
|
-
throw new Error(
|
|
235679
|
+
throw new Error(
|
|
235680
|
+
`Missing required fields for sub-agent '${agentId}': ${missingFields.join(", ")}`
|
|
235681
|
+
);
|
|
235653
235682
|
}
|
|
235654
235683
|
const { quotes, semicolons, indentation } = style;
|
|
235655
235684
|
const q = quotes === "single" ? "'" : '"';
|
|
@@ -235670,7 +235699,9 @@ function generateSubAgentDefinition(agentId, agentData, style = DEFAULT_STYLE, r
|
|
|
235670
235699
|
if (hasTemplateVariables(agentData.prompt) && parentAgentId && registry2 && contextConfigData) {
|
|
235671
235700
|
const contextVarName = registry2.getVariableName(contextConfigData.id, "contextConfig");
|
|
235672
235701
|
if (!contextVarName) {
|
|
235673
|
-
throw new Error(
|
|
235702
|
+
throw new Error(
|
|
235703
|
+
`Failed to resolve context config variable name for: ${contextConfigData.id}`
|
|
235704
|
+
);
|
|
235674
235705
|
}
|
|
235675
235706
|
const headersVarName = "headersSchema";
|
|
235676
235707
|
lines.push(
|
|
@@ -235684,28 +235715,40 @@ function generateSubAgentDefinition(agentId, agentData, style = DEFAULT_STYLE, r
|
|
|
235684
235715
|
lines.push(`${indentation}models: {`);
|
|
235685
235716
|
if (agentData.models.base?.model) {
|
|
235686
235717
|
lines.push(`${indentation}${indentation}base: {`);
|
|
235687
|
-
lines.push(
|
|
235718
|
+
lines.push(
|
|
235719
|
+
`${indentation}${indentation}${indentation}model: ${formatString(agentData.models.base.model, q)}`
|
|
235720
|
+
);
|
|
235688
235721
|
if (agentData.models.base.providerOptions) {
|
|
235689
235722
|
lines.push(`${indentation}${indentation}${indentation},`);
|
|
235690
|
-
lines.push(
|
|
235723
|
+
lines.push(
|
|
235724
|
+
`${indentation}${indentation}${indentation}providerOptions: ${JSON.stringify(agentData.models.base.providerOptions)}`
|
|
235725
|
+
);
|
|
235691
235726
|
}
|
|
235692
235727
|
lines.push(`${indentation}${indentation}},`);
|
|
235693
235728
|
}
|
|
235694
235729
|
if (agentData.models.structuredOutput?.model) {
|
|
235695
235730
|
lines.push(`${indentation}${indentation}structuredOutput: {`);
|
|
235696
|
-
lines.push(
|
|
235731
|
+
lines.push(
|
|
235732
|
+
`${indentation}${indentation}${indentation}model: ${formatString(agentData.models.structuredOutput.model, q)}`
|
|
235733
|
+
);
|
|
235697
235734
|
if (agentData.models.structuredOutput.providerOptions) {
|
|
235698
235735
|
lines.push(`${indentation}${indentation}${indentation},`);
|
|
235699
|
-
lines.push(
|
|
235736
|
+
lines.push(
|
|
235737
|
+
`${indentation}${indentation}${indentation}providerOptions: ${JSON.stringify(agentData.models.structuredOutput.providerOptions)}`
|
|
235738
|
+
);
|
|
235700
235739
|
}
|
|
235701
235740
|
lines.push(`${indentation}${indentation}},`);
|
|
235702
235741
|
}
|
|
235703
235742
|
if (agentData.models.summarizer?.model) {
|
|
235704
235743
|
lines.push(`${indentation}${indentation}summarizer: {`);
|
|
235705
|
-
lines.push(
|
|
235744
|
+
lines.push(
|
|
235745
|
+
`${indentation}${indentation}${indentation}model: ${formatString(agentData.models.summarizer.model, q)}`
|
|
235746
|
+
);
|
|
235706
235747
|
if (agentData.models.summarizer.providerOptions) {
|
|
235707
235748
|
lines.push(`${indentation}${indentation}${indentation},`);
|
|
235708
|
-
lines.push(
|
|
235749
|
+
lines.push(
|
|
235750
|
+
`${indentation}${indentation}${indentation}providerOptions: ${JSON.stringify(agentData.models.summarizer.providerOptions)}`
|
|
235751
|
+
);
|
|
235709
235752
|
}
|
|
235710
235753
|
lines.push(`${indentation}${indentation}},`);
|
|
235711
235754
|
}
|
|
@@ -235724,7 +235767,9 @@ function generateSubAgentDefinition(agentId, agentData, style = DEFAULT_STYLE, r
|
|
|
235724
235767
|
toolVarName = registry2.getVariableName(toolId, "functionTool");
|
|
235725
235768
|
}
|
|
235726
235769
|
if (!toolVarName) {
|
|
235727
|
-
throw new Error(
|
|
235770
|
+
throw new Error(
|
|
235771
|
+
`Failed to resolve variable name for tool: ${toolId} (tried both 'tool' and 'functionTool' types)`
|
|
235772
|
+
);
|
|
235728
235773
|
}
|
|
235729
235774
|
const hasToolSelection = toolRelation.toolSelection && toolRelation.toolSelection.length > 0;
|
|
235730
235775
|
const hasHeaders = toolRelation.headers && Object.keys(toolRelation.headers).length > 0;
|
|
@@ -235783,17 +235828,23 @@ function generateSubAgentDefinition(agentId, agentData, style = DEFAULT_STYLE, r
|
|
|
235783
235828
|
targetAgentId = delegateRelation.subAgentId;
|
|
235784
235829
|
targetType = "subAgent";
|
|
235785
235830
|
} else {
|
|
235786
|
-
throw new Error(
|
|
235831
|
+
throw new Error(
|
|
235832
|
+
`Delegate relation missing agentId, subAgentId, or externalAgentId: ${JSON.stringify(delegateRelation)}`
|
|
235833
|
+
);
|
|
235787
235834
|
}
|
|
235788
235835
|
} else {
|
|
235789
235836
|
throw new Error(`Invalid delegate relation format: ${JSON.stringify(delegateRelation)}`);
|
|
235790
235837
|
}
|
|
235791
235838
|
if (!targetAgentId) {
|
|
235792
|
-
throw new Error(
|
|
235839
|
+
throw new Error(
|
|
235840
|
+
`Failed to extract target agent ID from delegate relation: ${JSON.stringify(delegateRelation)}`
|
|
235841
|
+
);
|
|
235793
235842
|
}
|
|
235794
235843
|
const agentVarName2 = registry2.getVariableName(targetAgentId, targetType);
|
|
235795
235844
|
if (!agentVarName2) {
|
|
235796
|
-
throw new Error(
|
|
235845
|
+
throw new Error(
|
|
235846
|
+
`Failed to resolve variable name for delegate ${targetType}: ${targetAgentId}`
|
|
235847
|
+
);
|
|
235797
235848
|
}
|
|
235798
235849
|
if (hasHeaders) {
|
|
235799
235850
|
const headersStr = JSON.stringify(delegateRelation.headers);
|
|
@@ -235820,9 +235871,16 @@ function generateSubAgentDefinition(agentId, agentData, style = DEFAULT_STYLE, r
|
|
|
235820
235871
|
if (!registry2) {
|
|
235821
235872
|
throw new Error("Registry is required for canTransferTo generation");
|
|
235822
235873
|
}
|
|
235823
|
-
const transferArray = registry2.formatReferencesForCode(
|
|
235874
|
+
const transferArray = registry2.formatReferencesForCode(
|
|
235875
|
+
agentData.canTransferTo,
|
|
235876
|
+
"subAgent",
|
|
235877
|
+
style,
|
|
235878
|
+
2
|
|
235879
|
+
);
|
|
235824
235880
|
if (!transferArray) {
|
|
235825
|
-
throw new Error(
|
|
235881
|
+
throw new Error(
|
|
235882
|
+
`Failed to resolve variable names for canTransferTo agents: ${agentData.canTransferTo.join(", ")}`
|
|
235883
|
+
);
|
|
235826
235884
|
}
|
|
235827
235885
|
lines.push(`${indentation}canTransferTo: () => ${transferArray},`);
|
|
235828
235886
|
}
|
|
@@ -235837,7 +235895,9 @@ function generateSubAgentDefinition(agentId, agentData, style = DEFAULT_STYLE, r
|
|
|
235837
235895
|
2
|
|
235838
235896
|
);
|
|
235839
235897
|
if (!dataComponentsArray) {
|
|
235840
|
-
throw new Error(
|
|
235898
|
+
throw new Error(
|
|
235899
|
+
`Failed to resolve variable names for data components: ${agentData.dataComponents.join(", ")}`
|
|
235900
|
+
);
|
|
235841
235901
|
}
|
|
235842
235902
|
lines.push(`${indentation}dataComponents: () => ${dataComponentsArray},`);
|
|
235843
235903
|
}
|
|
@@ -235852,7 +235912,9 @@ function generateSubAgentDefinition(agentId, agentData, style = DEFAULT_STYLE, r
|
|
|
235852
235912
|
2
|
|
235853
235913
|
);
|
|
235854
235914
|
if (!artifactComponentsArray) {
|
|
235855
|
-
throw new Error(
|
|
235915
|
+
throw new Error(
|
|
235916
|
+
`Failed to resolve variable names for artifact components: ${agentData.artifactComponents.join(", ")}`
|
|
235917
|
+
);
|
|
235856
235918
|
}
|
|
235857
235919
|
lines.push(`${indentation}artifactComponents: () => ${artifactComponentsArray},`);
|
|
235858
235920
|
}
|
|
@@ -235873,7 +235935,11 @@ function generateSubAgentImports(agentId, agentData, style = DEFAULT_STYLE, regi
|
|
|
235873
235935
|
if (hasTemplateVariables(agentData.prompt) && parentAgentId && registry2 && contextConfigData) {
|
|
235874
235936
|
const contextConfigId = contextConfigData.id;
|
|
235875
235937
|
const currentFilePath = `agents/sub-agents/${agentId}.ts`;
|
|
235876
|
-
const importStatement = registry2.getImportStatement(
|
|
235938
|
+
const importStatement = registry2.getImportStatement(
|
|
235939
|
+
currentFilePath,
|
|
235940
|
+
contextConfigId,
|
|
235941
|
+
"contextConfig"
|
|
235942
|
+
);
|
|
235877
235943
|
if (importStatement) {
|
|
235878
235944
|
imports.push(importStatement);
|
|
235879
235945
|
}
|
|
@@ -235985,7 +236051,9 @@ function generateExternalAgentDefinition(agentId, agentData, style = DEFAULT_STY
|
|
|
235985
236051
|
(field) => !agentData[field] || agentData[field] === null || agentData[field] === void 0
|
|
235986
236052
|
);
|
|
235987
236053
|
if (missingFields.length > 0) {
|
|
235988
|
-
throw new Error(
|
|
236054
|
+
throw new Error(
|
|
236055
|
+
`Missing required fields for external agent '${agentId}': ${missingFields.join(", ")}`
|
|
236056
|
+
);
|
|
235989
236057
|
}
|
|
235990
236058
|
const { quotes, semicolons, indentation } = style;
|
|
235991
236059
|
const q = quotes === "single" ? "'" : '"';
|
|
@@ -236020,19 +236088,27 @@ function generateExternalAgentDefinition(agentId, agentData, style = DEFAULT_STY
|
|
|
236020
236088
|
}
|
|
236021
236089
|
const credentialVar = registry2.getVariableName(agentData.credentialReference, "credential");
|
|
236022
236090
|
if (!credentialVar) {
|
|
236023
|
-
throw new Error(
|
|
236091
|
+
throw new Error(
|
|
236092
|
+
`Failed to resolve variable name for credential reference: ${agentData.credentialReference}`
|
|
236093
|
+
);
|
|
236024
236094
|
}
|
|
236025
236095
|
lines.push(`${indentation}credentialReference: ${credentialVar},`);
|
|
236026
236096
|
} else if (typeof agentData.credentialReference === "object") {
|
|
236027
236097
|
const credLines = [];
|
|
236028
236098
|
if (agentData.credentialReference.id) {
|
|
236029
|
-
credLines.push(
|
|
236099
|
+
credLines.push(
|
|
236100
|
+
`${indentation}${indentation}id: ${formatString(agentData.credentialReference.id, q)},`
|
|
236101
|
+
);
|
|
236030
236102
|
}
|
|
236031
236103
|
if (agentData.credentialReference.name) {
|
|
236032
|
-
credLines.push(
|
|
236104
|
+
credLines.push(
|
|
236105
|
+
`${indentation}${indentation}name: ${formatString(agentData.credentialReference.name, q)},`
|
|
236106
|
+
);
|
|
236033
236107
|
}
|
|
236034
236108
|
if (agentData.credentialReference.description) {
|
|
236035
|
-
credLines.push(
|
|
236109
|
+
credLines.push(
|
|
236110
|
+
`${indentation}${indentation}description: ${formatString(agentData.credentialReference.description, q)},`
|
|
236111
|
+
);
|
|
236036
236112
|
}
|
|
236037
236113
|
if (credLines.length > 0 && credLines[credLines.length - 1].endsWith(",")) {
|
|
236038
236114
|
credLines[credLines.length - 1] = credLines[credLines.length - 1].slice(0, -1);
|
|
@@ -236054,7 +236130,9 @@ function generateExternalAgentImports(agentId, agentData, style = DEFAULT_STYLE,
|
|
|
236054
236130
|
throw new Error("Registry is required for credential reference imports");
|
|
236055
236131
|
}
|
|
236056
236132
|
const currentFilePath = `external-agents/${agentId}.ts`;
|
|
236057
|
-
const credentialRefs = [
|
|
236133
|
+
const credentialRefs = [
|
|
236134
|
+
{ id: agentData.credentialReference, type: "credential" }
|
|
236135
|
+
];
|
|
236058
236136
|
const componentImports = registry2.getImportsForFile(currentFilePath, credentialRefs);
|
|
236059
236137
|
imports.push(...componentImports);
|
|
236060
236138
|
}
|
|
@@ -236108,7 +236186,9 @@ function generateDataComponentDefinition(componentId, componentData, style = DEF
|
|
|
236108
236186
|
(field) => !componentData[field] || componentData[field] === null || componentData[field] === void 0
|
|
236109
236187
|
);
|
|
236110
236188
|
if (missingFields.length > 0) {
|
|
236111
|
-
throw new Error(
|
|
236189
|
+
throw new Error(
|
|
236190
|
+
`Missing required fields for data component '${componentId}': ${missingFields.join(", ")}`
|
|
236191
|
+
);
|
|
236112
236192
|
}
|
|
236113
236193
|
const { quotes, semicolons, indentation } = style;
|
|
236114
236194
|
const q = quotes === "single" ? "'" : '"';
|
|
@@ -236228,7 +236308,9 @@ function generateArtifactComponentDefinition(componentId, componentData, style =
|
|
|
236228
236308
|
(field) => !componentData[field] || componentData[field] === null || componentData[field] === void 0
|
|
236229
236309
|
);
|
|
236230
236310
|
if (missingFields.length > 0) {
|
|
236231
|
-
throw new Error(
|
|
236311
|
+
throw new Error(
|
|
236312
|
+
`Missing required fields for artifact component '${componentId}': ${missingFields.join(", ")}`
|
|
236313
|
+
);
|
|
236232
236314
|
}
|
|
236233
236315
|
const { quotes, semicolons, indentation } = style;
|
|
236234
236316
|
const q = quotes === "single" ? "'" : '"';
|
|
@@ -236334,7 +236416,9 @@ function generateStatusComponentDefinition(componentId, componentData, style = D
|
|
|
236334
236416
|
(field) => !componentData[field] || componentData[field] === null || componentData[field] === void 0
|
|
236335
236417
|
);
|
|
236336
236418
|
if (missingFields.length > 0) {
|
|
236337
|
-
throw new Error(
|
|
236419
|
+
throw new Error(
|
|
236420
|
+
`Missing required fields for status component '${componentId}': ${missingFields.join(", ")}`
|
|
236421
|
+
);
|
|
236338
236422
|
}
|
|
236339
236423
|
const { quotes, semicolons, indentation } = style;
|
|
236340
236424
|
const q = quotes === "single" ? "'" : '"';
|
|
@@ -236443,7 +236527,9 @@ function generateFunctionToolDefinition(toolId, toolData, style = DEFAULT_STYLE5
|
|
|
236443
236527
|
(field) => !toolData[field] || toolData[field] === null || toolData[field] === void 0
|
|
236444
236528
|
);
|
|
236445
236529
|
if (missingFields.length > 0) {
|
|
236446
|
-
throw new Error(
|
|
236530
|
+
throw new Error(
|
|
236531
|
+
`Missing required fields for function tool '${toolId}': ${missingFields.join(", ")}`
|
|
236532
|
+
);
|
|
236447
236533
|
}
|
|
236448
236534
|
const { quotes, semicolons, indentation } = style;
|
|
236449
236535
|
const q = quotes === "single" ? "'" : '"';
|
|
@@ -236534,7 +236620,9 @@ function generateMcpToolDefinition(toolId, toolData, style = DEFAULT_STYLE6, reg
|
|
|
236534
236620
|
missingFields.push("serverUrl (from config.mcp.server.url or serverUrl)");
|
|
236535
236621
|
}
|
|
236536
236622
|
if (missingFields.length > 0) {
|
|
236537
|
-
throw new Error(
|
|
236623
|
+
throw new Error(
|
|
236624
|
+
`Missing required fields for MCP tool '${toolId}': ${missingFields.join(", ")}`
|
|
236625
|
+
);
|
|
236538
236626
|
}
|
|
236539
236627
|
const { quotes, semicolons, indentation } = style;
|
|
236540
236628
|
const q = quotes === "single" ? "'" : '"';
|
|
@@ -236568,7 +236656,9 @@ function generateMcpToolDefinition(toolId, toolData, style = DEFAULT_STYLE6, reg
|
|
|
236568
236656
|
}
|
|
236569
236657
|
} else if (toolData.credentialReferenceId && registry2) {
|
|
236570
236658
|
const validKey = registry2.getVariableName(toolData.credentialReferenceId, "credential");
|
|
236571
|
-
lines.push(
|
|
236659
|
+
lines.push(
|
|
236660
|
+
`${indentation}credential: envSettings.getEnvironmentCredential(${formatString6(validKey, q)}),`
|
|
236661
|
+
);
|
|
236572
236662
|
}
|
|
236573
236663
|
if (lines.length > 0 && lines[lines.length - 1].endsWith(",")) {
|
|
236574
236664
|
lines[lines.length - 1] = lines[lines.length - 1].slice(0, -1);
|
|
@@ -236631,7 +236721,9 @@ function formatRetrievalParams(retrievalParams, style, indentLevel) {
|
|
|
236631
236721
|
} else if (typeof value === "number" || typeof value === "boolean") {
|
|
236632
236722
|
lines.push(`${indent}${q}${key}${q}: ${JSON.stringify(value)},`);
|
|
236633
236723
|
} else if (typeof value === "object" && value !== null) {
|
|
236634
|
-
lines.push(
|
|
236724
|
+
lines.push(
|
|
236725
|
+
`${indent}${q}${key}${q}: ${formatRetrievalParams(value, style, indentLevel + 1)},`
|
|
236726
|
+
);
|
|
236635
236727
|
}
|
|
236636
236728
|
}
|
|
236637
236729
|
if (lines.length > 1 && lines[lines.length - 1].endsWith(",")) {
|
|
@@ -236653,11 +236745,15 @@ function generateCredentialDefinition(credentialId, credentialData, style = DEFA
|
|
|
236653
236745
|
(field) => !credentialData[field] || credentialData[field] === null || credentialData[field] === void 0
|
|
236654
236746
|
);
|
|
236655
236747
|
if (missingFields.length > 0) {
|
|
236656
|
-
throw new Error(
|
|
236748
|
+
throw new Error(
|
|
236749
|
+
`Missing required fields for credential '${credentialId}': ${missingFields.join(", ")}`
|
|
236750
|
+
);
|
|
236657
236751
|
}
|
|
236658
236752
|
lines.push(`${indentation}name: ${formatString7(credentialData.name, q)},`);
|
|
236659
236753
|
lines.push(`${indentation}type: ${formatString7(credentialData.type, q)},`);
|
|
236660
|
-
lines.push(
|
|
236754
|
+
lines.push(
|
|
236755
|
+
`${indentation}credentialStoreId: ${formatString7(credentialData.credentialStoreId, q)},`
|
|
236756
|
+
);
|
|
236661
236757
|
if (credentialData.description) {
|
|
236662
236758
|
lines.push(`${indentation}description: ${formatString7(credentialData.description, q, true)},`);
|
|
236663
236759
|
}
|
|
@@ -236751,7 +236847,9 @@ function formatCredentialsObject(credentials, style, indentLevel) {
|
|
|
236751
236847
|
}
|
|
236752
236848
|
}
|
|
236753
236849
|
if (credentialData.credentialStoreId) {
|
|
236754
|
-
lines.push(
|
|
236850
|
+
lines.push(
|
|
236851
|
+
`${nestedIndent}credentialStoreId: ${formatString8(credentialData.credentialStoreId, q)},`
|
|
236852
|
+
);
|
|
236755
236853
|
}
|
|
236756
236854
|
if (credentialData.description) {
|
|
236757
236855
|
lines.push(`${nestedIndent}description: ${formatString8(credentialData.description, q)},`);
|
|
@@ -236887,7 +236985,9 @@ function generateEnvironmentFile(environmentName, environmentData, style = DEFAU
|
|
|
236887
236985
|
const credentialVarName = credentialRefs[i];
|
|
236888
236986
|
const isLast = i === credentialRefs.length - 1;
|
|
236889
236987
|
const validKey = registry2.getVariableName(credentialId, "credential");
|
|
236890
|
-
lines.push(
|
|
236988
|
+
lines.push(
|
|
236989
|
+
`${indentation}${indentation}${validKey}: ${credentialVarName}${isLast ? "" : ","}`
|
|
236990
|
+
);
|
|
236891
236991
|
}
|
|
236892
236992
|
lines.push(`${indentation}}`);
|
|
236893
236993
|
} else {
|
|
@@ -236918,7 +237018,10 @@ function processFetchConfigTemplates(fetchConfig, headersVarName) {
|
|
|
236918
237018
|
const processValue = (value) => {
|
|
236919
237019
|
if (typeof value === "string") {
|
|
236920
237020
|
if (hasTemplateVariables(value)) {
|
|
236921
|
-
const convertedStr = value.replace(
|
|
237021
|
+
const convertedStr = value.replace(
|
|
237022
|
+
/\{\{headers\.([^}]+)\}\}/g,
|
|
237023
|
+
`\${${headersVarName}.toTemplate("$1")}`
|
|
237024
|
+
);
|
|
236922
237025
|
return `\`${convertedStr.replace(/`/g, "\\`")}\``;
|
|
236923
237026
|
} else {
|
|
236924
237027
|
return `'${value.replace(/'/g, "\\'")}'`;
|
|
@@ -236974,7 +237077,10 @@ function generateFetchDefinitionDefinition(fetchId, fetchData, style = DEFAULT_S
|
|
|
236974
237077
|
lines.push(`${indentation}trigger: ${formatString(fetchData.trigger, q)},`);
|
|
236975
237078
|
}
|
|
236976
237079
|
if (fetchData.fetchConfig) {
|
|
236977
|
-
const processedFetchConfig = processFetchConfigTemplates(
|
|
237080
|
+
const processedFetchConfig = processFetchConfigTemplates(
|
|
237081
|
+
fetchData.fetchConfig,
|
|
237082
|
+
headersVarName || "headers"
|
|
237083
|
+
);
|
|
236978
237084
|
lines.push(`${indentation}fetchConfig: ${processedFetchConfig},`);
|
|
236979
237085
|
}
|
|
236980
237086
|
if (fetchData.responseSchema) {
|
|
@@ -237081,18 +237187,34 @@ function generateContextConfigFile(contextId, contextData, style = DEFAULT_STYLE
|
|
|
237081
237187
|
} else {
|
|
237082
237188
|
headersVarName = `${toCamelCase(contextId)}Headers`;
|
|
237083
237189
|
}
|
|
237084
|
-
const headersDefinition = generateHeadersDefinition(
|
|
237190
|
+
const headersDefinition = generateHeadersDefinition(
|
|
237191
|
+
headersVarName || "headers",
|
|
237192
|
+
{ schema: contextData.headersSchema },
|
|
237193
|
+
style
|
|
237194
|
+
);
|
|
237085
237195
|
definitions.push(headersDefinition);
|
|
237086
237196
|
}
|
|
237087
237197
|
if (contextData.contextVariables) {
|
|
237088
237198
|
for (const [varName, varData] of Object.entries(contextData.contextVariables)) {
|
|
237089
237199
|
if (varData && typeof varData === "object" && (varData.fetchConfig || varData.responseSchema)) {
|
|
237090
|
-
const fetchDefinition2 = generateFetchDefinitionDefinition(
|
|
237200
|
+
const fetchDefinition2 = generateFetchDefinitionDefinition(
|
|
237201
|
+
varName,
|
|
237202
|
+
varData,
|
|
237203
|
+
style,
|
|
237204
|
+
headersVarName
|
|
237205
|
+
);
|
|
237091
237206
|
definitions.push(fetchDefinition2);
|
|
237092
237207
|
}
|
|
237093
237208
|
}
|
|
237094
237209
|
}
|
|
237095
|
-
const contextDefinition = generateContextConfigDefinition(
|
|
237210
|
+
const contextDefinition = generateContextConfigDefinition(
|
|
237211
|
+
contextId,
|
|
237212
|
+
contextData,
|
|
237213
|
+
style,
|
|
237214
|
+
registry2,
|
|
237215
|
+
agentId,
|
|
237216
|
+
headersVarName
|
|
237217
|
+
);
|
|
237096
237218
|
definitions.push(contextDefinition);
|
|
237097
237219
|
const contextVarName = (() => {
|
|
237098
237220
|
if (!registry2) {
|
|
@@ -237221,7 +237343,12 @@ async function introspectGenerate(project, paths, environment, debug, options =
|
|
|
237221
237343
|
if (project.externalAgents) {
|
|
237222
237344
|
for (const [extAgentId, extAgentData] of Object.entries(project.externalAgents)) {
|
|
237223
237345
|
const extAgentFile = join6(paths.externalAgentsDir, `${extAgentId}.ts`);
|
|
237224
|
-
const extAgentContent = generateExternalAgentFile(
|
|
237346
|
+
const extAgentContent = generateExternalAgentFile(
|
|
237347
|
+
extAgentId,
|
|
237348
|
+
extAgentData,
|
|
237349
|
+
style,
|
|
237350
|
+
registry2
|
|
237351
|
+
);
|
|
237225
237352
|
ensureDir(extAgentFile);
|
|
237226
237353
|
writeFileSync3(extAgentFile, extAgentContent, "utf-8");
|
|
237227
237354
|
generatedFiles.push(extAgentFile);
|
|
@@ -237233,7 +237360,12 @@ async function introspectGenerate(project, paths, environment, debug, options =
|
|
|
237233
237360
|
const contextData = findContextConfigData(project, contextComp.id);
|
|
237234
237361
|
if (contextData) {
|
|
237235
237362
|
const contextFile = join6(paths.contextConfigsDir, `${contextComp.id}.ts`);
|
|
237236
|
-
const contextContent = generateContextConfigFile(
|
|
237363
|
+
const contextContent = generateContextConfigFile(
|
|
237364
|
+
contextComp.id,
|
|
237365
|
+
contextData,
|
|
237366
|
+
style,
|
|
237367
|
+
registry2
|
|
237368
|
+
);
|
|
237237
237369
|
ensureDir(contextFile);
|
|
237238
237370
|
writeFileSync3(contextFile, contextContent, "utf-8");
|
|
237239
237371
|
generatedFiles.push(contextFile);
|
|
@@ -237256,7 +237388,15 @@ async function introspectGenerate(project, paths, environment, debug, options =
|
|
|
237256
237388
|
for (const [subAgentId, subAgentData] of Object.entries(agentData.subAgents)) {
|
|
237257
237389
|
const subAgentFile = join6(paths.agentsDir, "sub-agents", `${subAgentId}.ts`);
|
|
237258
237390
|
const parentModels = agentData.models || project.models;
|
|
237259
|
-
const subAgentContent = generateSubAgentFile(
|
|
237391
|
+
const subAgentContent = generateSubAgentFile(
|
|
237392
|
+
subAgentId,
|
|
237393
|
+
subAgentData,
|
|
237394
|
+
style,
|
|
237395
|
+
registry2,
|
|
237396
|
+
agentId,
|
|
237397
|
+
contextConfigData,
|
|
237398
|
+
parentModels
|
|
237399
|
+
);
|
|
237260
237400
|
ensureDir(subAgentFile);
|
|
237261
237401
|
writeFileSync3(subAgentFile, subAgentContent, "utf-8");
|
|
237262
237402
|
generatedFiles.push(subAgentFile);
|
|
@@ -237269,7 +237409,14 @@ async function introspectGenerate(project, paths, environment, debug, options =
|
|
|
237269
237409
|
for (const [agentId, agentData] of Object.entries(project.agents)) {
|
|
237270
237410
|
const agentFile = join6(paths.agentsDir, `${agentId}.ts`);
|
|
237271
237411
|
const contextConfigData = agentData.contextConfig?.id ? findContextConfigData(project, agentData.contextConfig.id) : void 0;
|
|
237272
|
-
const agentContent = generateAgentFile(
|
|
237412
|
+
const agentContent = generateAgentFile(
|
|
237413
|
+
agentId,
|
|
237414
|
+
agentData,
|
|
237415
|
+
style,
|
|
237416
|
+
registry2,
|
|
237417
|
+
contextConfigData,
|
|
237418
|
+
project.models
|
|
237419
|
+
);
|
|
237273
237420
|
ensureDir(agentFile);
|
|
237274
237421
|
writeFileSync3(agentFile, agentContent, "utf-8");
|
|
237275
237422
|
generatedFiles.push(agentFile);
|
|
@@ -237286,7 +237433,12 @@ async function introspectGenerate(project, paths, environment, debug, options =
|
|
|
237286
237433
|
credentialReferences: project.credentialReferences ? Object.keys(project.credentialReferences) : []
|
|
237287
237434
|
};
|
|
237288
237435
|
const projectFile = join6(paths.projectRoot, "index.ts");
|
|
237289
|
-
const projectContent = generateProjectFile(
|
|
237436
|
+
const projectContent = generateProjectFile(
|
|
237437
|
+
project.id,
|
|
237438
|
+
projectDataForGenerator,
|
|
237439
|
+
style,
|
|
237440
|
+
registry2
|
|
237441
|
+
);
|
|
237290
237442
|
ensureDir(projectFile);
|
|
237291
237443
|
writeFileSync3(projectFile, projectContent, "utf-8");
|
|
237292
237444
|
generatedFiles.push(projectFile);
|
|
@@ -237295,7 +237447,9 @@ async function introspectGenerate(project, paths, environment, debug, options =
|
|
|
237295
237447
|
}
|
|
237296
237448
|
} catch (error) {
|
|
237297
237449
|
console.error(chalk8.red("\n\u274C Introspect regeneration failed:"));
|
|
237298
|
-
console.error(
|
|
237450
|
+
console.error(
|
|
237451
|
+
chalk8.red(` Error: ${error instanceof Error ? error.message : "Unknown error"}`)
|
|
237452
|
+
);
|
|
237299
237453
|
throw error;
|
|
237300
237454
|
}
|
|
237301
237455
|
}
|
|
@@ -237496,12 +237650,44 @@ function compareComponentsDirectly(localProject, remoteProject, localRegistry, d
|
|
|
237496
237650
|
changes.push(...compareAgents(localProject.agents || {}, remoteProject.agents || {}, debug));
|
|
237497
237651
|
changes.push(...compareSubAgents(localProject.agents || {}, remoteProject.agents || {}, debug));
|
|
237498
237652
|
changes.push(...compareTools(localProject.tools || {}, remoteProject.tools || {}, debug));
|
|
237499
|
-
changes.push(
|
|
237500
|
-
|
|
237501
|
-
|
|
237502
|
-
|
|
237503
|
-
|
|
237504
|
-
|
|
237653
|
+
changes.push(
|
|
237654
|
+
...compareFunctionTools(
|
|
237655
|
+
localProject.functionTools || {},
|
|
237656
|
+
remoteProject.functionTools || {},
|
|
237657
|
+
debug
|
|
237658
|
+
)
|
|
237659
|
+
);
|
|
237660
|
+
changes.push(
|
|
237661
|
+
...compareFunctions(localProject.functions || {}, remoteProject.functions || {}, debug)
|
|
237662
|
+
);
|
|
237663
|
+
changes.push(
|
|
237664
|
+
...compareDataComponents(
|
|
237665
|
+
localProject.dataComponents || {},
|
|
237666
|
+
remoteProject.dataComponents || {},
|
|
237667
|
+
debug
|
|
237668
|
+
)
|
|
237669
|
+
);
|
|
237670
|
+
changes.push(
|
|
237671
|
+
...compareArtifactComponents(
|
|
237672
|
+
localProject.artifactComponents || {},
|
|
237673
|
+
remoteProject.artifactComponents || {},
|
|
237674
|
+
debug
|
|
237675
|
+
)
|
|
237676
|
+
);
|
|
237677
|
+
changes.push(
|
|
237678
|
+
...compareCredentials(
|
|
237679
|
+
localProject.credentialReferences || {},
|
|
237680
|
+
remoteProject.credentialReferences || {},
|
|
237681
|
+
debug
|
|
237682
|
+
)
|
|
237683
|
+
);
|
|
237684
|
+
changes.push(
|
|
237685
|
+
...compareExternalAgents(
|
|
237686
|
+
localProject.externalAgents || {},
|
|
237687
|
+
remoteProject.externalAgents || {},
|
|
237688
|
+
debug
|
|
237689
|
+
)
|
|
237690
|
+
);
|
|
237505
237691
|
const localStatusComponents = extractStatusComponentsFromProject(localProject);
|
|
237506
237692
|
const remoteStatusComponents = extractStatusComponentsFromProject(remoteProject);
|
|
237507
237693
|
changes.push(...compareStatusComponents(localStatusComponents, remoteStatusComponents, debug));
|
|
@@ -237649,7 +237835,12 @@ function compareDataComponents(localDataComponents, remoteDataComponents, debug)
|
|
|
237649
237835
|
return compareComponentMaps("dataComponent", localDataComponents, remoteDataComponents, debug);
|
|
237650
237836
|
}
|
|
237651
237837
|
function compareArtifactComponents(localArtifactComponents, remoteArtifactComponents, debug) {
|
|
237652
|
-
return compareComponentMaps(
|
|
237838
|
+
return compareComponentMaps(
|
|
237839
|
+
"artifactComponent",
|
|
237840
|
+
localArtifactComponents,
|
|
237841
|
+
remoteArtifactComponents,
|
|
237842
|
+
debug
|
|
237843
|
+
);
|
|
237653
237844
|
}
|
|
237654
237845
|
function compareCredentials(localCredentials, remoteCredentials, debug) {
|
|
237655
237846
|
return compareComponentMaps("credential", localCredentials, remoteCredentials, debug);
|
|
@@ -237658,7 +237849,12 @@ function compareExternalAgents(localExternalAgents, remoteExternalAgents, debug)
|
|
|
237658
237849
|
return compareComponentMaps("externalAgent", localExternalAgents, remoteExternalAgents, debug);
|
|
237659
237850
|
}
|
|
237660
237851
|
function compareStatusComponents(localStatusComponents, remoteStatusComponents, debug) {
|
|
237661
|
-
return compareComponentMaps(
|
|
237852
|
+
return compareComponentMaps(
|
|
237853
|
+
"statusComponent",
|
|
237854
|
+
localStatusComponents,
|
|
237855
|
+
remoteStatusComponents,
|
|
237856
|
+
debug
|
|
237857
|
+
);
|
|
237662
237858
|
}
|
|
237663
237859
|
function compareProjectModels(localModels, remoteModels, debug) {
|
|
237664
237860
|
const changes = [];
|
|
@@ -237806,7 +238002,12 @@ function compareArraysAsSet(basePath, oldArray, newArray, depth) {
|
|
|
237806
238002
|
for (const [key, { item: newItem }] of newMap) {
|
|
237807
238003
|
if (oldMap.has(key)) {
|
|
237808
238004
|
const { item: oldItem } = oldMap.get(key);
|
|
237809
|
-
const itemChanges = getDetailedFieldChanges(
|
|
238005
|
+
const itemChanges = getDetailedFieldChanges(
|
|
238006
|
+
`${basePath}[${key}]`,
|
|
238007
|
+
oldItem,
|
|
238008
|
+
newItem,
|
|
238009
|
+
depth + 1
|
|
238010
|
+
);
|
|
237810
238011
|
changes.push(...itemChanges);
|
|
237811
238012
|
}
|
|
237812
238013
|
}
|
|
@@ -237998,8 +238199,12 @@ function generateAgentChangeSummary(fieldChanges) {
|
|
|
237998
238199
|
const nameChange = fieldChanges.find((c) => c.field === "name");
|
|
237999
238200
|
const promptChange = fieldChanges.find((c) => c.field === "prompt");
|
|
238000
238201
|
const modelChanges = fieldChanges.filter((c) => c.field.startsWith("models"));
|
|
238001
|
-
const toolChanges = fieldChanges.filter(
|
|
238002
|
-
|
|
238202
|
+
const toolChanges = fieldChanges.filter(
|
|
238203
|
+
(c) => c.field.includes("canUse") || c.field.includes("tools")
|
|
238204
|
+
);
|
|
238205
|
+
const subAgentChanges = fieldChanges.filter(
|
|
238206
|
+
(c) => c.field.includes("subAgents") || c.field.includes("canDelegateTo")
|
|
238207
|
+
);
|
|
238003
238208
|
if (nameChange) summaryParts.push("name updated");
|
|
238004
238209
|
if (promptChange) summaryParts.push("prompt changed");
|
|
238005
238210
|
if (modelChanges.length > 0) summaryParts.push(`${modelChanges.length} model changes`);
|
|
@@ -238075,21 +238280,21 @@ function extractStatusComponentsFromProject(project) {
|
|
|
238075
238280
|
function groupChangesByType(changes) {
|
|
238076
238281
|
const result = createEmptyComponentChanges();
|
|
238077
238282
|
const typeMapping = {
|
|
238078
|
-
|
|
238079
|
-
|
|
238080
|
-
|
|
238081
|
-
|
|
238082
|
-
|
|
238083
|
-
|
|
238084
|
-
|
|
238085
|
-
|
|
238086
|
-
|
|
238087
|
-
|
|
238088
|
-
|
|
238089
|
-
|
|
238090
|
-
|
|
238091
|
-
|
|
238092
|
-
|
|
238283
|
+
agent: "agents",
|
|
238284
|
+
subAgent: "subAgents",
|
|
238285
|
+
tool: "tools",
|
|
238286
|
+
functionTool: "functionTools",
|
|
238287
|
+
function: "functions",
|
|
238288
|
+
dataComponent: "dataComponents",
|
|
238289
|
+
artifactComponent: "artifactComponents",
|
|
238290
|
+
statusComponent: "statusComponents",
|
|
238291
|
+
environment: "environments",
|
|
238292
|
+
contextConfig: "contextConfigs",
|
|
238293
|
+
fetchDefinition: "fetchDefinitions",
|
|
238294
|
+
header: "headers",
|
|
238295
|
+
credential: "credentials",
|
|
238296
|
+
externalAgent: "externalAgents",
|
|
238297
|
+
models: "models"
|
|
238093
238298
|
};
|
|
238094
238299
|
changes.forEach((change) => {
|
|
238095
238300
|
const groupKey = typeMapping[change.componentType];
|
|
@@ -238475,7 +238680,10 @@ function parseFileForComponents(filePath, projectRoot, debug = false) {
|
|
|
238475
238680
|
}
|
|
238476
238681
|
const componentTypes = Object.keys(COMPONENT_TYPE_MAP);
|
|
238477
238682
|
for (const funcName of componentTypes) {
|
|
238478
|
-
const inlineIdPattern = new RegExp(
|
|
238683
|
+
const inlineIdPattern = new RegExp(
|
|
238684
|
+
`(?<!(?:export\\s+)?const\\s+\\w+\\s*=\\s*)\\b${funcName}\\s*\\(\\s*\\{[^}]*?id:\\s*['"\`]([^'"\`]+)['"\`]`,
|
|
238685
|
+
"gs"
|
|
238686
|
+
);
|
|
238479
238687
|
let inlineMatch;
|
|
238480
238688
|
while ((inlineMatch = inlineIdPattern.exec(content)) !== null) {
|
|
238481
238689
|
const componentId = inlineMatch[1];
|
|
@@ -238492,7 +238700,10 @@ function parseFileForComponents(filePath, projectRoot, debug = false) {
|
|
|
238492
238700
|
});
|
|
238493
238701
|
}
|
|
238494
238702
|
if (funcName === "functionTool") {
|
|
238495
|
-
const inlineNamePattern = new RegExp(
|
|
238703
|
+
const inlineNamePattern = new RegExp(
|
|
238704
|
+
`(?<!(?:export\\s+)?const\\s+\\w+\\s*=\\s*)\\b${funcName}\\s*\\(\\s*\\{[^}]*?name:\\s*['"\`]([^'"\`]+)['"\`]`,
|
|
238705
|
+
"gs"
|
|
238706
|
+
);
|
|
238496
238707
|
while ((inlineMatch = inlineNamePattern.exec(content)) !== null) {
|
|
238497
238708
|
const componentId = inlineMatch[1];
|
|
238498
238709
|
const componentType = COMPONENT_TYPE_MAP[funcName];
|
|
@@ -238628,21 +238839,21 @@ var init_component_parser = __esm({
|
|
|
238628
238839
|
init_esm_shims();
|
|
238629
238840
|
init_component_registry();
|
|
238630
238841
|
COMPONENT_TYPE_MAP = {
|
|
238631
|
-
|
|
238632
|
-
|
|
238633
|
-
|
|
238634
|
-
|
|
238635
|
-
|
|
238842
|
+
project: "project",
|
|
238843
|
+
agent: "agent",
|
|
238844
|
+
subAgent: "subAgent",
|
|
238845
|
+
tool: "tool",
|
|
238846
|
+
mcpTool: "tool",
|
|
238636
238847
|
// MCP tools are a type of tool
|
|
238637
|
-
|
|
238638
|
-
|
|
238639
|
-
|
|
238640
|
-
|
|
238641
|
-
|
|
238642
|
-
|
|
238643
|
-
|
|
238644
|
-
|
|
238645
|
-
|
|
238848
|
+
functionTool: "functionTool",
|
|
238849
|
+
dataComponent: "dataComponent",
|
|
238850
|
+
artifactComponent: "artifactComponent",
|
|
238851
|
+
statusComponent: "statusComponent",
|
|
238852
|
+
externalAgent: "externalAgent",
|
|
238853
|
+
credential: "credential",
|
|
238854
|
+
contextConfig: "contextConfig",
|
|
238855
|
+
fetchDefinition: "fetchDefinition",
|
|
238856
|
+
headers: "headers"
|
|
238646
238857
|
};
|
|
238647
238858
|
}
|
|
238648
238859
|
});
|
|
@@ -238723,10 +238934,22 @@ async function validateProjectEquivalence(tempDir, remoteProject) {
|
|
|
238723
238934
|
console.log(chalk10.yellow(` \u{1F4DD} Modified: ${changes.modified.join(", ")}`));
|
|
238724
238935
|
for (const modifiedId of changes.modified) {
|
|
238725
238936
|
console.log(chalk10.gray(` ${modifiedId} detailed differences:`));
|
|
238726
|
-
const generatedComponent = getComponentFromProject(
|
|
238727
|
-
|
|
238728
|
-
|
|
238729
|
-
|
|
238937
|
+
const generatedComponent = getComponentFromProject(
|
|
238938
|
+
tempProjectDefinition,
|
|
238939
|
+
componentType,
|
|
238940
|
+
modifiedId
|
|
238941
|
+
);
|
|
238942
|
+
const remoteComponent = getComponentFromProject(
|
|
238943
|
+
remoteProject,
|
|
238944
|
+
componentType,
|
|
238945
|
+
modifiedId
|
|
238946
|
+
);
|
|
238947
|
+
console.log(
|
|
238948
|
+
chalk10.gray(`Generated Component: ${JSON.stringify(generatedComponent, null, 2)}`)
|
|
238949
|
+
);
|
|
238950
|
+
console.log(
|
|
238951
|
+
chalk10.gray(`Remote Component: ${JSON.stringify(remoteComponent, null, 2)}`)
|
|
238952
|
+
);
|
|
238730
238953
|
}
|
|
238731
238954
|
}
|
|
238732
238955
|
if (changes.deleted.length > 0) {
|
|
@@ -238989,7 +239212,9 @@ function getAvailableModel() {
|
|
|
238989
239212
|
}
|
|
238990
239213
|
}
|
|
238991
239214
|
}
|
|
238992
|
-
throw new Error(
|
|
239215
|
+
throw new Error(
|
|
239216
|
+
"No API keys detected. Please set ANTHROPIC_API_KEY, OPENAI_API_KEY, or GOOGLE_API_KEY"
|
|
239217
|
+
);
|
|
238993
239218
|
}
|
|
238994
239219
|
var PROVIDER_CONFIGS;
|
|
238995
239220
|
var init_model_provider_detector = __esm({
|
|
@@ -239102,7 +239327,11 @@ Return only the merged TypeScript code without any explanation or markdown forma
|
|
|
239102
239327
|
const estimatedCompletionTokens = estimateTokens(mergedContent);
|
|
239103
239328
|
const totalTokens = estimatedPromptTokens + estimatedCompletionTokens;
|
|
239104
239329
|
const estimatedCost = calculateCostEstimate(estimatedPromptTokens, estimatedCompletionTokens);
|
|
239105
|
-
console.log(
|
|
239330
|
+
console.log(
|
|
239331
|
+
chalk11.gray(
|
|
239332
|
+
` \u{1F4B0} LLM usage: ~${totalTokens.toLocaleString()} tokens ($${estimatedCost.toFixed(4)})`
|
|
239333
|
+
)
|
|
239334
|
+
);
|
|
239106
239335
|
const allReplacements = {
|
|
239107
239336
|
...oldPlaceholders.replacements,
|
|
239108
239337
|
...newPlaceholders.replacements
|
|
@@ -239110,9 +239339,7 @@ Return only the merged TypeScript code without any explanation or markdown forma
|
|
|
239110
239339
|
if (Object.keys(allReplacements).length > 0) {
|
|
239111
239340
|
mergedContent = restoreTargetedTypeScriptPlaceholders(mergedContent, allReplacements);
|
|
239112
239341
|
}
|
|
239113
|
-
const changes = modifiedComponents.map(
|
|
239114
|
-
(c) => `Updated ${c.componentType}:${c.componentId}`
|
|
239115
|
-
);
|
|
239342
|
+
const changes = modifiedComponents.map((c) => `Updated ${c.componentType}:${c.componentId}`);
|
|
239116
239343
|
return {
|
|
239117
239344
|
mergedContent,
|
|
239118
239345
|
changes,
|
|
@@ -239150,7 +239377,15 @@ __export(component_updater_exports, {
|
|
|
239150
239377
|
copyProjectToTemp: () => copyProjectToTemp,
|
|
239151
239378
|
updateModifiedComponents: () => updateModifiedComponents
|
|
239152
239379
|
});
|
|
239153
|
-
import {
|
|
239380
|
+
import {
|
|
239381
|
+
mkdirSync as mkdirSync3,
|
|
239382
|
+
readFileSync as readFileSync5,
|
|
239383
|
+
writeFileSync as writeFileSync5,
|
|
239384
|
+
readdirSync as readdirSync4,
|
|
239385
|
+
statSync as statSync3,
|
|
239386
|
+
copyFileSync as copyFileSync2,
|
|
239387
|
+
existsSync as existsSync9
|
|
239388
|
+
} from "fs";
|
|
239154
239389
|
import { dirname as dirname7, join as join10, extname as extname3 } from "path";
|
|
239155
239390
|
import { spawn as spawn2 } from "child_process";
|
|
239156
239391
|
import chalk12 from "chalk";
|
|
@@ -239263,7 +239498,14 @@ function generateUpdatedComponentContent(componentType, componentId, componentDa
|
|
|
239263
239498
|
const parentInfo = findSubAgentWithParent(remoteProject, componentId);
|
|
239264
239499
|
const parentAgentId = parentInfo?.parentAgentId;
|
|
239265
239500
|
const contextConfigData = parentInfo?.contextConfigData;
|
|
239266
|
-
return generateSubAgentFile(
|
|
239501
|
+
return generateSubAgentFile(
|
|
239502
|
+
componentId,
|
|
239503
|
+
componentData,
|
|
239504
|
+
defaultStyle,
|
|
239505
|
+
localRegistry,
|
|
239506
|
+
parentAgentId,
|
|
239507
|
+
contextConfigData
|
|
239508
|
+
);
|
|
239267
239509
|
}
|
|
239268
239510
|
case "tools":
|
|
239269
239511
|
return generateMcpToolFile(componentId, componentData, defaultStyle, localRegistry);
|
|
@@ -239286,7 +239528,13 @@ function generateUpdatedComponentContent(componentType, componentId, componentDa
|
|
|
239286
239528
|
const agentId = componentData._agentId;
|
|
239287
239529
|
const cleanComponentData = { ...componentData };
|
|
239288
239530
|
delete cleanComponentData._agentId;
|
|
239289
|
-
return generateContextConfigFile(
|
|
239531
|
+
return generateContextConfigFile(
|
|
239532
|
+
componentId,
|
|
239533
|
+
cleanComponentData,
|
|
239534
|
+
defaultStyle,
|
|
239535
|
+
localRegistry,
|
|
239536
|
+
agentId
|
|
239537
|
+
);
|
|
239290
239538
|
}
|
|
239291
239539
|
case "fetchDefinitions":
|
|
239292
239540
|
return "";
|
|
@@ -239518,11 +239766,17 @@ ${componentContent}`);
|
|
|
239518
239766
|
\u{1F4CB} Analyzed ${actualChanges.length} components with changes`));
|
|
239519
239767
|
if (actualChanges.length > 0) {
|
|
239520
239768
|
actualChanges.forEach((change) => {
|
|
239521
|
-
console.log(
|
|
239769
|
+
console.log(
|
|
239770
|
+
chalk12.blue(` \u{1F504} ${change.componentType}:${change.componentId} in ${change.filePath}`)
|
|
239771
|
+
);
|
|
239522
239772
|
if (debug) {
|
|
239523
|
-
console.log(
|
|
239773
|
+
console.log(
|
|
239774
|
+
chalk12.gray(` \u{1F50D} Available comparison changes: ${comparison.changes.length}`)
|
|
239775
|
+
);
|
|
239524
239776
|
comparison.changes.forEach((c, i) => {
|
|
239525
|
-
console.log(
|
|
239777
|
+
console.log(
|
|
239778
|
+
chalk12.gray(` ${i}: ${c.componentType}:${c.componentId} (${c.changeType})`)
|
|
239779
|
+
);
|
|
239526
239780
|
});
|
|
239527
239781
|
}
|
|
239528
239782
|
const normalizedCompType = change.componentType.endsWith("s") && change.componentType !== "headers" ? change.componentType.slice(0, -1) : change.componentType;
|
|
@@ -239536,7 +239790,11 @@ ${componentContent}`);
|
|
|
239536
239790
|
if (compChange.changedFields && compChange.changedFields.length > 0) {
|
|
239537
239791
|
compChange.changedFields.forEach((fieldChange) => {
|
|
239538
239792
|
const changeSymbol = fieldChange.changeType === "added" ? "\u2795" : fieldChange.changeType === "deleted" ? "\u2796" : "\u{1F504}";
|
|
239539
|
-
console.log(
|
|
239793
|
+
console.log(
|
|
239794
|
+
chalk12.gray(
|
|
239795
|
+
` ${changeSymbol} ${fieldChange.field}: ${fieldChange.description || fieldChange.changeType}`
|
|
239796
|
+
)
|
|
239797
|
+
);
|
|
239540
239798
|
});
|
|
239541
239799
|
} else if (debug) {
|
|
239542
239800
|
console.log(chalk12.gray(` \u{1F50D} No changedFields data available for this change`));
|
|
@@ -239643,7 +239901,14 @@ function generateComponentContent(componentType, componentId, componentData, com
|
|
|
239643
239901
|
const cleanComponentData = { ...componentData };
|
|
239644
239902
|
delete cleanComponentData._parentAgentId;
|
|
239645
239903
|
delete cleanComponentData._contextConfigData;
|
|
239646
|
-
return generateSubAgentFile(
|
|
239904
|
+
return generateSubAgentFile(
|
|
239905
|
+
componentId,
|
|
239906
|
+
cleanComponentData,
|
|
239907
|
+
defaultStyle,
|
|
239908
|
+
componentRegistry,
|
|
239909
|
+
parentAgentId,
|
|
239910
|
+
contextConfigData
|
|
239911
|
+
);
|
|
239647
239912
|
}
|
|
239648
239913
|
case "tools":
|
|
239649
239914
|
return generateMcpToolFile(componentId, componentData, defaultStyle, componentRegistry);
|
|
@@ -239666,7 +239931,13 @@ function generateComponentContent(componentType, componentId, componentData, com
|
|
|
239666
239931
|
const agentId = componentData._agentId;
|
|
239667
239932
|
const cleanComponentData = { ...componentData };
|
|
239668
239933
|
delete cleanComponentData._agentId;
|
|
239669
|
-
return generateContextConfigFile(
|
|
239934
|
+
return generateContextConfigFile(
|
|
239935
|
+
componentId,
|
|
239936
|
+
cleanComponentData,
|
|
239937
|
+
defaultStyle,
|
|
239938
|
+
componentRegistry,
|
|
239939
|
+
agentId
|
|
239940
|
+
);
|
|
239670
239941
|
}
|
|
239671
239942
|
default:
|
|
239672
239943
|
throw new Error(`No generator for component type: ${componentType}`);
|
|
@@ -239725,7 +239996,10 @@ async function createNewComponents(comparison, remoteProject, localRegistry, pat
|
|
|
239725
239996
|
const existsLocally = localRegistry.get(componentId, componentType);
|
|
239726
239997
|
if (existsLocally) continue;
|
|
239727
239998
|
const filePath = determineNewFilePath(componentType, componentId, targetPaths);
|
|
239728
|
-
const relativePath = filePath.replace(
|
|
239999
|
+
const relativePath = filePath.replace(
|
|
240000
|
+
(tempDirName ? targetPaths.projectRoot : paths.projectRoot) + "/",
|
|
240001
|
+
""
|
|
240002
|
+
);
|
|
239729
240003
|
let variableName;
|
|
239730
240004
|
if (componentType === "contextConfigs") {
|
|
239731
240005
|
const contextResult = findContextConfigData2(remoteProject, componentId);
|
|
@@ -239850,7 +240124,9 @@ async function createNewComponents(comparison, remoteProject, localRegistry, pat
|
|
|
239850
240124
|
}
|
|
239851
240125
|
}
|
|
239852
240126
|
}
|
|
239853
|
-
const createdEnvironments = results.filter(
|
|
240127
|
+
const createdEnvironments = results.filter(
|
|
240128
|
+
(r) => r.success && r.componentType === "environments"
|
|
240129
|
+
);
|
|
239854
240130
|
if (createdEnvironments.length > 0) {
|
|
239855
240131
|
try {
|
|
239856
240132
|
console.log(chalk13.cyan("\u{1F4DD} Generating environments index file..."));
|
|
@@ -239863,7 +240139,12 @@ async function createNewComponents(comparison, remoteProject, localRegistry, pat
|
|
|
239863
240139
|
writeFileSync6(indexPath, indexContent, "utf8");
|
|
239864
240140
|
console.log(chalk13.green("\u2705 Environment index file created"));
|
|
239865
240141
|
} catch (error) {
|
|
239866
|
-
console.log(
|
|
240142
|
+
console.log(
|
|
240143
|
+
chalk13.yellow(
|
|
240144
|
+
"\u26A0\uFE0F Failed to create environment index file:",
|
|
240145
|
+
error instanceof Error ? error.message : String(error)
|
|
240146
|
+
)
|
|
240147
|
+
);
|
|
239867
240148
|
}
|
|
239868
240149
|
}
|
|
239869
240150
|
const successful = results.filter((r) => r.success);
|
|
@@ -239957,7 +240238,12 @@ async function generateProjectIndex(projectRoot, remoteProject, localRegistry, p
|
|
|
239957
240238
|
artifactComponents: registryComponents.filter((c) => c.type === "artifactComponent").map((c) => c.id),
|
|
239958
240239
|
credentialReferences: registryComponents.filter((c) => c.type === "credential").map((c) => c.id)
|
|
239959
240240
|
};
|
|
239960
|
-
const content = generateProjectFile(
|
|
240241
|
+
const content = generateProjectFile(
|
|
240242
|
+
projectId,
|
|
240243
|
+
projectDataWithRegistry,
|
|
240244
|
+
defaultStyle,
|
|
240245
|
+
localRegistry
|
|
240246
|
+
);
|
|
239961
240247
|
writeFileSync7(indexPath, content, "utf8");
|
|
239962
240248
|
}
|
|
239963
240249
|
var init_project_index_generator = __esm({
|
|
@@ -240026,11 +240312,19 @@ function enrichCanDelegateToWithTypes(project, debug = false) {
|
|
|
240026
240312
|
}
|
|
240027
240313
|
const agentIds = new Set(project.agents ? Object.keys(project.agents) : []);
|
|
240028
240314
|
const subAgentIds = new Set(Object.keys(extractSubAgents(project)));
|
|
240029
|
-
const externalAgentIds = new Set(
|
|
240315
|
+
const externalAgentIds = new Set(
|
|
240316
|
+
project.externalAgents ? Object.keys(project.externalAgents) : []
|
|
240317
|
+
);
|
|
240030
240318
|
if (debug) {
|
|
240031
240319
|
console.log(chalk14.gray(` Available agents: ${Array.from(agentIds).join(", ") || "none"}`));
|
|
240032
|
-
console.log(
|
|
240033
|
-
|
|
240320
|
+
console.log(
|
|
240321
|
+
chalk14.gray(` Available subAgents: ${Array.from(subAgentIds).join(", ") || "none"}`)
|
|
240322
|
+
);
|
|
240323
|
+
console.log(
|
|
240324
|
+
chalk14.gray(
|
|
240325
|
+
` Available externalAgents: ${Array.from(externalAgentIds).join(", ") || "none"}`
|
|
240326
|
+
)
|
|
240327
|
+
);
|
|
240034
240328
|
}
|
|
240035
240329
|
const enrichCanDelegateToArray = (canDelegateTo, context) => {
|
|
240036
240330
|
if (!Array.isArray(canDelegateTo)) return;
|
|
@@ -240047,12 +240341,18 @@ function enrichCanDelegateToWithTypes(project, debug = false) {
|
|
|
240047
240341
|
enrichedItem = { externalAgentId: id };
|
|
240048
240342
|
} else {
|
|
240049
240343
|
if (debug) {
|
|
240050
|
-
console.log(
|
|
240344
|
+
console.log(
|
|
240345
|
+
chalk14.yellow(
|
|
240346
|
+
` Warning: canDelegateTo reference "${id}" in ${context} not found in any component collection`
|
|
240347
|
+
)
|
|
240348
|
+
);
|
|
240051
240349
|
}
|
|
240052
240350
|
continue;
|
|
240053
240351
|
}
|
|
240054
240352
|
if (debug && enrichedItem) {
|
|
240055
|
-
console.log(
|
|
240353
|
+
console.log(
|
|
240354
|
+
chalk14.gray(` Enriched "${id}" in ${context} -> ${JSON.stringify(enrichedItem)}`)
|
|
240355
|
+
);
|
|
240056
240356
|
}
|
|
240057
240357
|
canDelegateTo[i] = enrichedItem;
|
|
240058
240358
|
}
|
|
@@ -240095,9 +240395,15 @@ async function readExistingProject(projectRoot, debug = false) {
|
|
|
240095
240395
|
const isCredentialError = errorMessage.includes("Credential") && errorMessage.includes("not found");
|
|
240096
240396
|
if (debug) {
|
|
240097
240397
|
if (isCredentialError) {
|
|
240098
|
-
console.log(
|
|
240398
|
+
console.log(
|
|
240399
|
+
chalk14.yellow(" \u26A0 Cannot load existing project - credentials not configured:")
|
|
240400
|
+
);
|
|
240099
240401
|
console.log(chalk14.gray(` ${errorMessage}`));
|
|
240100
|
-
console.log(
|
|
240402
|
+
console.log(
|
|
240403
|
+
chalk14.gray(
|
|
240404
|
+
" \u{1F4A1} This is expected if you haven't added credentials to environment files yet"
|
|
240405
|
+
)
|
|
240406
|
+
);
|
|
240101
240407
|
} else {
|
|
240102
240408
|
console.log(chalk14.red(" \u2717 Error parsing existing project:"));
|
|
240103
240409
|
console.log(chalk14.red(` ${errorMessage}`));
|
|
@@ -240156,9 +240462,14 @@ async function pullV3Command(options) {
|
|
|
240156
240462
|
);
|
|
240157
240463
|
const remoteProject = await apiClient.getFullProject(projectId);
|
|
240158
240464
|
if (options.debug && remoteProject.functions) {
|
|
240159
|
-
console.log(
|
|
240465
|
+
console.log(
|
|
240466
|
+
chalk14.gray(" \u{1F4CB} Project-level functions from API:"),
|
|
240467
|
+
Object.keys(remoteProject.functions)
|
|
240468
|
+
);
|
|
240160
240469
|
Object.entries(remoteProject.functions).forEach(([id, data]) => {
|
|
240161
|
-
console.log(
|
|
240470
|
+
console.log(
|
|
240471
|
+
chalk14.gray(` ${id}: has name=${!!data.name}, has description=${!!data.description}`)
|
|
240472
|
+
);
|
|
240162
240473
|
});
|
|
240163
240474
|
}
|
|
240164
240475
|
if (remoteProject.agents) {
|
|
@@ -240167,7 +240478,11 @@ async function pullV3Command(options) {
|
|
|
240167
240478
|
remoteProject.functionTools = remoteProject.functionTools || {};
|
|
240168
240479
|
Object.assign(remoteProject.functionTools, agentData.functionTools);
|
|
240169
240480
|
if (options.debug) {
|
|
240170
|
-
console.log(
|
|
240481
|
+
console.log(
|
|
240482
|
+
chalk14.gray(
|
|
240483
|
+
` Hoisted functionTools from agent ${agentId}: ${Object.keys(agentData.functionTools).join(", ")}`
|
|
240484
|
+
)
|
|
240485
|
+
);
|
|
240171
240486
|
}
|
|
240172
240487
|
}
|
|
240173
240488
|
if (agentData.functions) {
|
|
@@ -240183,9 +240498,13 @@ async function pullV3Command(options) {
|
|
|
240183
240498
|
}
|
|
240184
240499
|
});
|
|
240185
240500
|
if (options.debug) {
|
|
240186
|
-
const hoistedKeys = Object.keys(agentData.functions).filter(
|
|
240501
|
+
const hoistedKeys = Object.keys(agentData.functions).filter(
|
|
240502
|
+
(key) => !remoteProject.functions[key]
|
|
240503
|
+
);
|
|
240187
240504
|
if (hoistedKeys.length > 0) {
|
|
240188
|
-
console.log(
|
|
240505
|
+
console.log(
|
|
240506
|
+
chalk14.gray(` Hoisted functions from agent ${agentId}: ${hoistedKeys.join(", ")}`)
|
|
240507
|
+
);
|
|
240189
240508
|
}
|
|
240190
240509
|
}
|
|
240191
240510
|
}
|
|
@@ -240207,7 +240526,9 @@ async function pullV3Command(options) {
|
|
|
240207
240526
|
if (options.debug) {
|
|
240208
240527
|
const removedCount = originalToolCount - Object.keys(agentSpecificTools).length;
|
|
240209
240528
|
if (removedCount > 0) {
|
|
240210
|
-
console.log(
|
|
240529
|
+
console.log(
|
|
240530
|
+
chalk14.gray(` Filtered ${removedCount} project-level tools from agent ${agentId}`)
|
|
240531
|
+
);
|
|
240211
240532
|
}
|
|
240212
240533
|
}
|
|
240213
240534
|
}
|
|
@@ -240226,7 +240547,12 @@ async function pullV3Command(options) {
|
|
|
240226
240547
|
if (options.introspect) {
|
|
240227
240548
|
console.log(chalk14.yellow("\n\u{1F50D} Introspect mode: Regenerating all files from scratch"));
|
|
240228
240549
|
s.start("Generating all files deterministically...");
|
|
240229
|
-
await introspectGenerate(
|
|
240550
|
+
await introspectGenerate(
|
|
240551
|
+
remoteProject,
|
|
240552
|
+
paths,
|
|
240553
|
+
options.env || "development",
|
|
240554
|
+
options.debug || false
|
|
240555
|
+
);
|
|
240230
240556
|
s.stop("All files generated");
|
|
240231
240557
|
console.log(chalk14.green("\n\u2705 Project regenerated successfully with introspect mode!"));
|
|
240232
240558
|
console.log(chalk14.gray(` \u{1F4C1} Location: ${paths.projectRoot}`));
|
|
@@ -240246,7 +240572,12 @@ async function pullV3Command(options) {
|
|
|
240246
240572
|
const localRegistry = buildComponentRegistryFromParsing2(paths.projectRoot, options.debug);
|
|
240247
240573
|
s.message("Component registry built");
|
|
240248
240574
|
s.start("Comparing projects for changes...");
|
|
240249
|
-
const comparison = await compareProjects(
|
|
240575
|
+
const comparison = await compareProjects(
|
|
240576
|
+
localProject,
|
|
240577
|
+
remoteProject,
|
|
240578
|
+
localRegistry,
|
|
240579
|
+
options.debug
|
|
240580
|
+
);
|
|
240250
240581
|
if (!comparison.hasChanges && !options.force) {
|
|
240251
240582
|
s.stop();
|
|
240252
240583
|
console.log(chalk14.green("\u2705 Project is already up to date"));
|
|
@@ -240267,7 +240598,10 @@ async function pullV3Command(options) {
|
|
|
240267
240598
|
console.log(chalk14.green(`\u2705 Empty temp directory created for new project`));
|
|
240268
240599
|
}
|
|
240269
240600
|
s.message("Temp directory prepared");
|
|
240270
|
-
const newComponentCount = Object.values(comparison.componentChanges).reduce(
|
|
240601
|
+
const newComponentCount = Object.values(comparison.componentChanges).reduce(
|
|
240602
|
+
(sum, changes) => sum + changes.added.length,
|
|
240603
|
+
0
|
|
240604
|
+
);
|
|
240271
240605
|
if (newComponentCount > 0) {
|
|
240272
240606
|
s.start("Creating new component files in temp directory...");
|
|
240273
240607
|
const { createNewComponents: createNewComponents2 } = await Promise.resolve().then(() => (init_new_component_generator(), new_component_generator_exports));
|
|
@@ -240283,7 +240617,10 @@ async function pullV3Command(options) {
|
|
|
240283
240617
|
console.log(chalk14.green(`\u2705 Added ${successful.length} new components to temp directory`));
|
|
240284
240618
|
s.message("New component files created");
|
|
240285
240619
|
}
|
|
240286
|
-
const modifiedCount = Object.values(comparison.componentChanges).reduce(
|
|
240620
|
+
const modifiedCount = Object.values(comparison.componentChanges).reduce(
|
|
240621
|
+
(sum, changes) => sum + changes.modified.length,
|
|
240622
|
+
0
|
|
240623
|
+
);
|
|
240287
240624
|
if (modifiedCount > 0) {
|
|
240288
240625
|
s.start("Applying modified components to temp directory...");
|
|
240289
240626
|
const { updateModifiedComponents: updateModifiedComponents2 } = await Promise.resolve().then(() => (init_component_updater(), component_updater_exports));
|
|
@@ -240301,7 +240638,12 @@ async function pullV3Command(options) {
|
|
|
240301
240638
|
}
|
|
240302
240639
|
s.start("Generating project index file in temp directory...");
|
|
240303
240640
|
const { generateProjectIndex: generateProjectIndex2 } = await Promise.resolve().then(() => (init_project_index_generator(), project_index_generator_exports));
|
|
240304
|
-
await generateProjectIndex2(
|
|
240641
|
+
await generateProjectIndex2(
|
|
240642
|
+
join13(paths.projectRoot, tempDirName),
|
|
240643
|
+
remoteProject,
|
|
240644
|
+
localRegistry,
|
|
240645
|
+
projectId
|
|
240646
|
+
);
|
|
240305
240647
|
s.message("Project index file created");
|
|
240306
240648
|
if (newComponentCount > 0 || modifiedCount > 0) {
|
|
240307
240649
|
s.start("Running validation on complete project...");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-cli",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20251105001429",
|
|
4
4
|
"description": "Inkeep CLI tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"ts-morph": "^26.0.0",
|
|
50
50
|
"tsx": "^4.20.5",
|
|
51
51
|
"open": "^10.2.0",
|
|
52
|
-
"@inkeep/agents-core": "^0.0.0-dev-
|
|
53
|
-
"@inkeep/agents-sdk": "^0.0.0-dev-
|
|
52
|
+
"@inkeep/agents-core": "^0.0.0-dev-20251105001429",
|
|
53
|
+
"@inkeep/agents-sdk": "^0.0.0-dev-20251105001429"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/degit": "^2.8.6",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"vitest": "^3.2.4"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@inkeep/agents-manage-ui": "0.0.0-dev-
|
|
66
|
+
"@inkeep/agents-manage-ui": "0.0.0-dev-20251105001429",
|
|
67
67
|
"zod": "^4.1.11"
|
|
68
68
|
},
|
|
69
69
|
"engines": {
|