@polka-codes/cli-shared 0.9.24 → 0.9.26
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 +164 -105
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -36220,8 +36220,7 @@ var toolInfo = {
|
|
|
36220
36220
|
}
|
|
36221
36221
|
}
|
|
36222
36222
|
]
|
|
36223
|
-
})
|
|
36224
|
-
permissionLevel: 0 /* None */
|
|
36223
|
+
})
|
|
36225
36224
|
};
|
|
36226
36225
|
var handler = async (provider, args) => {
|
|
36227
36226
|
if (!provider.askFollowupQuestion) {
|
|
@@ -36283,8 +36282,7 @@ var toolInfo2 = {
|
|
|
36283
36282
|
}
|
|
36284
36283
|
}
|
|
36285
36284
|
]
|
|
36286
|
-
})
|
|
36287
|
-
permissionLevel: 0 /* None */
|
|
36285
|
+
})
|
|
36288
36286
|
};
|
|
36289
36287
|
var handler2 = async (provider, args) => {
|
|
36290
36288
|
const parsed = toolInfo2.parameters.safeParse(args);
|
|
@@ -36347,8 +36345,7 @@ var toolInfo3 = {
|
|
|
36347
36345
|
}
|
|
36348
36346
|
}
|
|
36349
36347
|
]
|
|
36350
|
-
})
|
|
36351
|
-
permissionLevel: 0 /* None */
|
|
36348
|
+
})
|
|
36352
36349
|
};
|
|
36353
36350
|
var handler3 = async (_provider, args) => {
|
|
36354
36351
|
const parsed = toolInfo3.parameters.safeParse(args);
|
|
@@ -36404,8 +36401,7 @@ var toolInfo4 = {
|
|
|
36404
36401
|
}
|
|
36405
36402
|
}
|
|
36406
36403
|
]
|
|
36407
|
-
})
|
|
36408
|
-
permissionLevel: 3 /* Arbitrary */
|
|
36404
|
+
})
|
|
36409
36405
|
};
|
|
36410
36406
|
var handler4 = async (provider, args) => {
|
|
36411
36407
|
if (!provider.executeCommand) {
|
|
@@ -36495,8 +36491,7 @@ var toolInfo5 = {
|
|
|
36495
36491
|
}
|
|
36496
36492
|
}
|
|
36497
36493
|
]
|
|
36498
|
-
})
|
|
36499
|
-
permissionLevel: 1 /* Read */
|
|
36494
|
+
})
|
|
36500
36495
|
};
|
|
36501
36496
|
var handler5 = async (provider, args) => {
|
|
36502
36497
|
if (!provider.fetchUrl) {
|
|
@@ -36572,8 +36567,7 @@ var toolInfo6 = {
|
|
|
36572
36567
|
}
|
|
36573
36568
|
}
|
|
36574
36569
|
]
|
|
36575
|
-
})
|
|
36576
|
-
permissionLevel: 0 /* None */
|
|
36570
|
+
})
|
|
36577
36571
|
};
|
|
36578
36572
|
var handler6 = async (_provider, args) => {
|
|
36579
36573
|
const parsed = toolInfo6.parameters.safeParse(args);
|
|
@@ -36640,8 +36634,7 @@ var toolInfo7 = {
|
|
|
36640
36634
|
}
|
|
36641
36635
|
}
|
|
36642
36636
|
]
|
|
36643
|
-
})
|
|
36644
|
-
permissionLevel: 1 /* Read */
|
|
36637
|
+
})
|
|
36645
36638
|
};
|
|
36646
36639
|
var handler7 = async (provider, args) => {
|
|
36647
36640
|
if (!provider.listFiles) {
|
|
@@ -36682,8 +36675,7 @@ var toolInfo8 = {
|
|
|
36682
36675
|
description: "Read a binary file from a URL or local path. Use file:// prefix to access local files. This can be used to access non-text files such as PDFs or images.",
|
|
36683
36676
|
parameters: exports_external.object({
|
|
36684
36677
|
url: exports_external.string().describe("The URL or local path of the file to read.")
|
|
36685
|
-
})
|
|
36686
|
-
permissionLevel: 1 /* Read */
|
|
36678
|
+
})
|
|
36687
36679
|
};
|
|
36688
36680
|
var handler8 = async (provider, args) => {
|
|
36689
36681
|
if (!provider.readBinaryFile) {
|
|
@@ -36767,8 +36759,7 @@ var toolInfo9 = {
|
|
|
36767
36759
|
}
|
|
36768
36760
|
}
|
|
36769
36761
|
]
|
|
36770
|
-
})
|
|
36771
|
-
permissionLevel: 1 /* Read */
|
|
36762
|
+
})
|
|
36772
36763
|
};
|
|
36773
36764
|
var handler9 = async (provider, args) => {
|
|
36774
36765
|
if (!provider.readFile) {
|
|
@@ -36827,8 +36818,7 @@ var toolInfo10 = {
|
|
|
36827
36818
|
}
|
|
36828
36819
|
}
|
|
36829
36820
|
]
|
|
36830
|
-
})
|
|
36831
|
-
permissionLevel: 2 /* Write */
|
|
36821
|
+
})
|
|
36832
36822
|
};
|
|
36833
36823
|
var handler10 = async (provider, args) => {
|
|
36834
36824
|
if (!provider.removeFile) {
|
|
@@ -36885,8 +36875,7 @@ var toolInfo11 = {
|
|
|
36885
36875
|
}
|
|
36886
36876
|
}
|
|
36887
36877
|
]
|
|
36888
|
-
})
|
|
36889
|
-
permissionLevel: 2 /* Write */
|
|
36878
|
+
})
|
|
36890
36879
|
};
|
|
36891
36880
|
var handler11 = async (provider, args) => {
|
|
36892
36881
|
if (!provider.renameFile) {
|
|
@@ -37099,8 +37088,7 @@ function oldFeature() {
|
|
|
37099
37088
|
}
|
|
37100
37089
|
}
|
|
37101
37090
|
]
|
|
37102
|
-
})
|
|
37103
|
-
permissionLevel: 2 /* Write */
|
|
37091
|
+
})
|
|
37104
37092
|
};
|
|
37105
37093
|
var handler12 = async (provider, args) => {
|
|
37106
37094
|
if (!provider.readFile || !provider.writeFile) {
|
|
@@ -37206,8 +37194,7 @@ var toolInfo13 = {
|
|
|
37206
37194
|
}
|
|
37207
37195
|
}
|
|
37208
37196
|
]
|
|
37209
|
-
})
|
|
37210
|
-
permissionLevel: 1 /* Read */
|
|
37197
|
+
})
|
|
37211
37198
|
};
|
|
37212
37199
|
var handler13 = async (provider, args) => {
|
|
37213
37200
|
if (!provider.searchFiles) {
|
|
@@ -37292,8 +37279,7 @@ export default App;
|
|
|
37292
37279
|
}
|
|
37293
37280
|
}
|
|
37294
37281
|
]
|
|
37295
|
-
})
|
|
37296
|
-
permissionLevel: 2 /* Write */
|
|
37282
|
+
})
|
|
37297
37283
|
};
|
|
37298
37284
|
var handler14 = async (provider, args) => {
|
|
37299
37285
|
if (!provider.writeFile) {
|
|
@@ -37341,7 +37327,6 @@ var getAvailableTools = ({
|
|
|
37341
37327
|
provider: provider2,
|
|
37342
37328
|
allTools: allTools2,
|
|
37343
37329
|
hasAgent,
|
|
37344
|
-
permissionLevel,
|
|
37345
37330
|
interactive
|
|
37346
37331
|
}) => {
|
|
37347
37332
|
const filteredTools = interactive ? allTools2 : allTools2.filter((tool) => tool.name !== askFollowupQuestion_default.name);
|
|
@@ -37354,7 +37339,7 @@ var getAvailableTools = ({
|
|
|
37354
37339
|
continue;
|
|
37355
37340
|
}
|
|
37356
37341
|
}
|
|
37357
|
-
if (tool.isAvailable(provider2)
|
|
37342
|
+
if (tool.isAvailable(provider2)) {
|
|
37358
37343
|
tools.push(tool);
|
|
37359
37344
|
}
|
|
37360
37345
|
}
|
|
@@ -61501,14 +61486,23 @@ Retrying request ${i + 2} of ${retryCount}`);
|
|
|
61501
61486
|
return { type: "exit", reason: { type: "Pause", responses: toolResponses } };
|
|
61502
61487
|
}
|
|
61503
61488
|
if (toolResponses.length === 0) {
|
|
61489
|
+
if (this.config.requireToolUse) {
|
|
61490
|
+
return {
|
|
61491
|
+
type: "reply",
|
|
61492
|
+
message: [
|
|
61493
|
+
{
|
|
61494
|
+
role: "user",
|
|
61495
|
+
content: responsePrompts.requireUseToolNative
|
|
61496
|
+
}
|
|
61497
|
+
]
|
|
61498
|
+
};
|
|
61499
|
+
}
|
|
61504
61500
|
return {
|
|
61505
|
-
type: "
|
|
61506
|
-
|
|
61507
|
-
|
|
61508
|
-
|
|
61509
|
-
|
|
61510
|
-
}
|
|
61511
|
-
]
|
|
61501
|
+
type: "exit",
|
|
61502
|
+
reason: {
|
|
61503
|
+
type: "Exit" /* Exit */,
|
|
61504
|
+
message: response.filter((c) => c.type === "text").map((c) => c.content).join("")
|
|
61505
|
+
}
|
|
61512
61506
|
};
|
|
61513
61507
|
}
|
|
61514
61508
|
const mediaUserMessage = medias.length > 0 ? [
|
|
@@ -61550,14 +61544,23 @@ Retrying request ${i + 2} of ${retryCount}`);
|
|
|
61550
61544
|
};
|
|
61551
61545
|
}
|
|
61552
61546
|
if (toolResponses.length === 0) {
|
|
61547
|
+
if (this.config.requireToolUse) {
|
|
61548
|
+
return {
|
|
61549
|
+
type: "reply",
|
|
61550
|
+
message: [
|
|
61551
|
+
{
|
|
61552
|
+
role: "user",
|
|
61553
|
+
content: responsePrompts.requireUseTool
|
|
61554
|
+
}
|
|
61555
|
+
]
|
|
61556
|
+
};
|
|
61557
|
+
}
|
|
61553
61558
|
return {
|
|
61554
|
-
type: "
|
|
61555
|
-
|
|
61556
|
-
|
|
61557
|
-
|
|
61558
|
-
|
|
61559
|
-
}
|
|
61560
|
-
]
|
|
61559
|
+
type: "exit",
|
|
61560
|
+
reason: {
|
|
61561
|
+
type: "Exit" /* Exit */,
|
|
61562
|
+
message: response.filter((c) => c.type === "text").map((c) => c.content).join("")
|
|
61563
|
+
}
|
|
61561
61564
|
};
|
|
61562
61565
|
}
|
|
61563
61566
|
const finalResp = toolResponses.filter((resp) => resp.type === "response").flatMap(({ tool: tool2, response: response2 }) => responsePrompts.toolResults(tool2, response2));
|
|
@@ -61647,14 +61650,15 @@ ${customScripts(scripts)}
|
|
|
61647
61650
|
`;
|
|
61648
61651
|
|
|
61649
61652
|
// ../core/src/Agent/AnalyzerAgent/index.ts
|
|
61653
|
+
var agentTools = [askFollowupQuestion_default, attemptCompletion_default, delegate_default, fetchUrl_default, handOver_default, listFiles_default, readBinaryFile_default, readFile_default, searchFiles_default];
|
|
61654
|
+
|
|
61650
61655
|
class AnalyzerAgent extends AgentBase {
|
|
61651
61656
|
constructor(options) {
|
|
61652
|
-
const combinedTools = [...options.additionalTools ?? [], ...
|
|
61657
|
+
const combinedTools = [...options.additionalTools ?? [], ...agentTools];
|
|
61653
61658
|
const tools = getAvailableTools({
|
|
61654
61659
|
provider: options.provider,
|
|
61655
61660
|
allTools: combinedTools,
|
|
61656
61661
|
hasAgent: (options.agents?.length ?? 0) > 0,
|
|
61657
|
-
permissionLevel: 1 /* Read */,
|
|
61658
61662
|
interactive: true
|
|
61659
61663
|
});
|
|
61660
61664
|
const toolNamePrefix = options.toolFormat === "native" ? "" : "tool_";
|
|
@@ -61674,7 +61678,8 @@ class AnalyzerAgent extends AgentBase {
|
|
|
61674
61678
|
toolFormat: options.toolFormat,
|
|
61675
61679
|
parameters: options.parameters ?? {},
|
|
61676
61680
|
usageMeter: options.usageMeter ?? new UsageMeter,
|
|
61677
|
-
requestTimeoutSeconds: options.requestTimeoutSeconds
|
|
61681
|
+
requestTimeoutSeconds: options.requestTimeoutSeconds,
|
|
61682
|
+
requireToolUse: options.requireToolUse ?? true
|
|
61678
61683
|
});
|
|
61679
61684
|
}
|
|
61680
61685
|
onBeforeInvokeTool() {
|
|
@@ -61778,7 +61783,6 @@ class CodeFixerAgent extends AgentBase {
|
|
|
61778
61783
|
provider: options.provider,
|
|
61779
61784
|
allTools: combinedTools,
|
|
61780
61785
|
hasAgent: (options.agents?.length ?? 0) > 0,
|
|
61781
|
-
permissionLevel: 3 /* Arbitrary */,
|
|
61782
61786
|
interactive: true
|
|
61783
61787
|
});
|
|
61784
61788
|
const toolNamePrefix = options.toolFormat === "native" ? "" : "tool_";
|
|
@@ -61798,7 +61802,8 @@ class CodeFixerAgent extends AgentBase {
|
|
|
61798
61802
|
toolFormat: options.toolFormat,
|
|
61799
61803
|
parameters: options.parameters ?? {},
|
|
61800
61804
|
usageMeter: options.usageMeter ?? new UsageMeter,
|
|
61801
|
-
requestTimeoutSeconds: options.requestTimeoutSeconds
|
|
61805
|
+
requestTimeoutSeconds: options.requestTimeoutSeconds,
|
|
61806
|
+
requireToolUse: options.requireToolUse ?? true
|
|
61802
61807
|
});
|
|
61803
61808
|
this.#maxRetries = options.maxRetries ?? 5;
|
|
61804
61809
|
}
|
|
@@ -61983,7 +61988,6 @@ class CoderAgent extends AgentBase {
|
|
|
61983
61988
|
provider: options.provider,
|
|
61984
61989
|
allTools: combinedTools,
|
|
61985
61990
|
hasAgent: (options.agents?.length ?? 0) > 0,
|
|
61986
|
-
permissionLevel: 3 /* Arbitrary */,
|
|
61987
61991
|
interactive: true
|
|
61988
61992
|
});
|
|
61989
61993
|
const toolNamePrefix = options.toolFormat === "native" ? "" : "tool_";
|
|
@@ -62003,7 +62007,8 @@ class CoderAgent extends AgentBase {
|
|
|
62003
62007
|
toolFormat: options.toolFormat,
|
|
62004
62008
|
parameters: options.parameters ?? {},
|
|
62005
62009
|
usageMeter: options.usageMeter ?? new UsageMeter,
|
|
62006
|
-
requestTimeoutSeconds: options.requestTimeoutSeconds
|
|
62010
|
+
requestTimeoutSeconds: options.requestTimeoutSeconds,
|
|
62011
|
+
requireToolUse: options.requireToolUse ?? true
|
|
62007
62012
|
});
|
|
62008
62013
|
}
|
|
62009
62014
|
async#runScript(scriptName, shouldReplyWithError) {
|
|
@@ -62590,7 +62595,7 @@ var toolInfo15 = {
|
|
|
62590
62595
|
return val;
|
|
62591
62596
|
}, exports_external.boolean().optional().default(false)).describe("Get staged changes instead of unstaged changes."),
|
|
62592
62597
|
commitRange: exports_external.string().optional().describe('The commit range to get the diff for (e.g., "main...HEAD").'),
|
|
62593
|
-
file: exports_external.string().
|
|
62598
|
+
file: exports_external.string().describe("Get the diff for a specific file."),
|
|
62594
62599
|
contextLines: exports_external.coerce.number().optional().default(5).describe("Number of context lines to include around changes."),
|
|
62595
62600
|
includeLineNumbers: exports_external.preprocess((val) => {
|
|
62596
62601
|
if (typeof val === "string") {
|
|
@@ -62602,8 +62607,7 @@ var toolInfo15 = {
|
|
|
62602
62607
|
}
|
|
62603
62608
|
return val;
|
|
62604
62609
|
}, exports_external.boolean().optional().default(false)).describe("Annotate the diff with line numbers for additions and deletions.")
|
|
62605
|
-
})
|
|
62606
|
-
permissionLevel: 1 /* Read */
|
|
62610
|
+
})
|
|
62607
62611
|
};
|
|
62608
62612
|
var handler15 = async (provider2, args) => {
|
|
62609
62613
|
if (!provider2.executeCommand) {
|
|
@@ -62687,50 +62691,64 @@ var prompt5 = `
|
|
|
62687
62691
|
You are a senior software engineer reviewing code changes.
|
|
62688
62692
|
|
|
62689
62693
|
## Critical Instructions
|
|
62690
|
-
**ONLY review the actual changes shown in the diff.** Do not comment on existing code that wasn't modified.
|
|
62694
|
+
- **ONLY review the actual changes shown in the diff.** Do not comment on existing code that wasn't modified.
|
|
62695
|
+
- **ONLY run git_diff on files that are reviewable source/config files** per the "File Selection for git_diff" rules below. Do not pass excluded files to git_diff.
|
|
62696
|
+
|
|
62697
|
+
## File Selection for git_diff
|
|
62698
|
+
Use <file_status> to decide which files to diff. Include only files likely to contain human-authored source or meaningful configuration.
|
|
62699
|
+
|
|
62700
|
+
Include (run git_diff):
|
|
62701
|
+
- Application/source code
|
|
62702
|
+
- UI/templates/assets code
|
|
62703
|
+
- Infra/config that affects behavior
|
|
62704
|
+
|
|
62705
|
+
Exclude (do NOT run git_diff; do not review):
|
|
62706
|
+
- Lockfiles
|
|
62707
|
+
- Generated/build artifacts & deps
|
|
62708
|
+
- Test artifacts/snapshots
|
|
62709
|
+
- Data and fixtures
|
|
62710
|
+
- Binary/media/minified/maps
|
|
62691
62711
|
|
|
62692
62712
|
## Viewing Changes
|
|
62693
|
-
- **
|
|
62694
|
-
- **Pull request
|
|
62695
|
-
- **Local changes
|
|
62696
|
-
- The diff will include line number annotations: [Line N] for additions and [Line N removed] for deletions
|
|
62697
|
-
-
|
|
62713
|
+
- For each included file, **use git_diff** to inspect the actual code changes:
|
|
62714
|
+
- **Pull request:** use the provided commit range for the git_diff tool with contextLines: 5 and includeLineNumbers: true, but only surface and review the included files.
|
|
62715
|
+
- **Local changes:** diff staged or unstaged included files using git_diff with contextLines: 5 and includeLineNumbers: true.
|
|
62716
|
+
- The diff will include line number annotations: [Line N] for additions and [Line N removed] for deletions.
|
|
62717
|
+
- You may receive:
|
|
62698
62718
|
- <pr_title>
|
|
62699
62719
|
- <pr_description>
|
|
62700
62720
|
- <commit_messages>
|
|
62701
62721
|
- A <review_instructions> tag tells you the focus of the review.
|
|
62702
|
-
-
|
|
62722
|
+
- Use <file_status> to understand which files were modified, added, deleted, or renamed and to apply the inclusion/exclusion rules above.
|
|
62703
62723
|
|
|
62704
62724
|
## Line Number Reporting
|
|
62705
|
-
-
|
|
62706
|
-
- For additions:
|
|
62707
|
-
- For deletions:
|
|
62708
|
-
- For modifications:
|
|
62709
|
-
- Report single lines as "N" and ranges as "N-M"
|
|
62725
|
+
- Use the line numbers from the annotations in the diff output.
|
|
62726
|
+
- For additions: use the number from the [Line N] annotation after the + line.
|
|
62727
|
+
- For deletions: use the number from the [Line N removed] annotation after the - line.
|
|
62728
|
+
- For modifications: report the line number of the new/current code (from [Line N]).
|
|
62729
|
+
- Report single lines as "N" and ranges as "N-M".
|
|
62710
62730
|
|
|
62711
62731
|
## Review Guidelines
|
|
62712
62732
|
Focus exclusively on the changed lines (+ additions, - deletions, modified lines):
|
|
62713
|
-
- **Specific issues
|
|
62714
|
-
- **Actionable fixes
|
|
62715
|
-
- **Clear reasoning
|
|
62716
|
-
- **Avoid generic advice
|
|
62733
|
+
- **Specific issues:** Point to exact problems in the changed code with accurate line references from the annotations.
|
|
62734
|
+
- **Actionable fixes:** Provide concrete solutions, not vague suggestions.
|
|
62735
|
+
- **Clear reasoning:** Explain why each issue matters and how to fix it.
|
|
62736
|
+
- **Avoid generic advice** unless directly tied to a specific problem visible in the diff.
|
|
62717
62737
|
|
|
62718
62738
|
## What NOT to review
|
|
62719
|
-
-
|
|
62720
|
-
-
|
|
62721
|
-
-
|
|
62722
|
-
- Missing features or functionality not part of this diff
|
|
62739
|
+
- Files excluded by the "File Selection for git_diff" rules (do not diff or comment on them).
|
|
62740
|
+
- Existing unchanged code.
|
|
62741
|
+
- Overall project structure/architecture unless directly impacted by the changes.
|
|
62742
|
+
- Missing features or functionality not part of this diff.
|
|
62723
62743
|
|
|
62724
62744
|
## Output Format
|
|
62725
|
-
Do
|
|
62745
|
+
Do not include praise or positive feedback.
|
|
62726
62746
|
Only include reviews for actual issues found in the changed code.
|
|
62727
62747
|
|
|
62728
62748
|
Return your review as a JSON object inside a \`\`\`json block, wrapped like:
|
|
62729
|
-
<tool_attempt_completion>
|
|
62730
|
-
<tool_parameter_result>
|
|
62731
62749
|
\`\`\`json
|
|
62732
62750
|
{
|
|
62733
|
-
"overview": "Summary of specific issues found in the diff changes,
|
|
62751
|
+
"overview": "Summary of specific issues found in the diff changes, 'No issues found', or 'No reviewable changes' if all modified files were excluded.",
|
|
62734
62752
|
"specificReviews": [
|
|
62735
62753
|
{
|
|
62736
62754
|
"file": "path/filename.ext",
|
|
@@ -62740,8 +62758,6 @@ Return your review as a JSON object inside a \`\`\`json block, wrapped like:
|
|
|
62740
62758
|
]
|
|
62741
62759
|
}
|
|
62742
62760
|
\`\`\`
|
|
62743
|
-
</tool_parameter_result>
|
|
62744
|
-
</tool_attempt_completion>
|
|
62745
62761
|
`;
|
|
62746
62762
|
var reviewDiff_default = {
|
|
62747
62763
|
name: "reviewDiff",
|
|
@@ -62803,7 +62819,8 @@ ${output}`,
|
|
|
62803
62819
|
agent: (options) => {
|
|
62804
62820
|
return new AnalyzerAgent({
|
|
62805
62821
|
...options,
|
|
62806
|
-
additionalTools: [gitDiff_default]
|
|
62822
|
+
additionalTools: [gitDiff_default],
|
|
62823
|
+
requireToolUse: false
|
|
62807
62824
|
});
|
|
62808
62825
|
}
|
|
62809
62826
|
};
|
|
@@ -62865,8 +62882,50 @@ var generateGithubPullRequestDetails = makeTool(generateGithubPullRequestDetails
|
|
|
62865
62882
|
var reviewDiff = makeAgentTool(reviewDiff_default);
|
|
62866
62883
|
var generateProjectConfig = makeMultiAgentTool(generateProjectConfig_default);
|
|
62867
62884
|
var createNewProject = makeMultiAgentTool(createNewProject_default);
|
|
62868
|
-
// src/
|
|
62885
|
+
// ../core/src/workflow/utils.ts
|
|
62869
62886
|
var import_lodash2 = __toESM(require_lodash(), 1);
|
|
62887
|
+
// ../core/src/workflow/builder.ts
|
|
62888
|
+
class StepsBuilder {
|
|
62889
|
+
#steps = [];
|
|
62890
|
+
build() {
|
|
62891
|
+
if (this.#steps.length === 0) {
|
|
62892
|
+
throw new Error("A workflow must have at least one step.");
|
|
62893
|
+
}
|
|
62894
|
+
const rootStep = this.#steps.length > 1 ? {
|
|
62895
|
+
id: "root",
|
|
62896
|
+
type: "sequential",
|
|
62897
|
+
steps: this.#steps
|
|
62898
|
+
} : this.#steps[0];
|
|
62899
|
+
return rootStep;
|
|
62900
|
+
}
|
|
62901
|
+
step(step) {
|
|
62902
|
+
this.#steps.push(step);
|
|
62903
|
+
return this;
|
|
62904
|
+
}
|
|
62905
|
+
parallel(id, step) {
|
|
62906
|
+
return this.step({
|
|
62907
|
+
id,
|
|
62908
|
+
type: "parallel",
|
|
62909
|
+
step
|
|
62910
|
+
});
|
|
62911
|
+
}
|
|
62912
|
+
custom(id, run) {
|
|
62913
|
+
return this.step({
|
|
62914
|
+
id,
|
|
62915
|
+
type: "custom",
|
|
62916
|
+
run
|
|
62917
|
+
});
|
|
62918
|
+
}
|
|
62919
|
+
agent(id, spec2) {
|
|
62920
|
+
return this.step({
|
|
62921
|
+
...spec2,
|
|
62922
|
+
id,
|
|
62923
|
+
type: "agent"
|
|
62924
|
+
});
|
|
62925
|
+
}
|
|
62926
|
+
}
|
|
62927
|
+
// src/config.ts
|
|
62928
|
+
var import_lodash3 = __toESM(require_lodash(), 1);
|
|
62870
62929
|
|
|
62871
62930
|
// node_modules/yaml/dist/index.js
|
|
62872
62931
|
var composer = require_composer();
|
|
@@ -65511,9 +65570,9 @@ class ZodUnion4 extends ZodType4 {
|
|
|
65511
65570
|
return this._def.options;
|
|
65512
65571
|
}
|
|
65513
65572
|
}
|
|
65514
|
-
ZodUnion4.create = (
|
|
65573
|
+
ZodUnion4.create = (types2, params) => {
|
|
65515
65574
|
return new ZodUnion4({
|
|
65516
|
-
options:
|
|
65575
|
+
options: types2,
|
|
65517
65576
|
typeName: ZodFirstPartyTypeKind4.ZodUnion,
|
|
65518
65577
|
...processCreateParams2(params)
|
|
65519
65578
|
});
|
|
@@ -66777,7 +66836,7 @@ function mergeConfigs(configs) {
|
|
|
66777
66836
|
return {};
|
|
66778
66837
|
}
|
|
66779
66838
|
const mergedConfig = configs.reduce((acc, config4) => {
|
|
66780
|
-
const merged =
|
|
66839
|
+
const merged = import_lodash3.merge({}, acc, config4);
|
|
66781
66840
|
let accRules = acc.rules ?? [];
|
|
66782
66841
|
if (typeof accRules === "string") {
|
|
66783
66842
|
accRules = [accRules];
|
|
@@ -68161,7 +68220,7 @@ function lookup(path) {
|
|
|
68161
68220
|
}
|
|
68162
68221
|
return $types[extension2] || false;
|
|
68163
68222
|
}
|
|
68164
|
-
function populateMaps(extensions,
|
|
68223
|
+
function populateMaps(extensions, types2) {
|
|
68165
68224
|
Object.keys(db).forEach(function forEachMimeType(type) {
|
|
68166
68225
|
var mime = db[type];
|
|
68167
68226
|
var exts = mime.extensions;
|
|
@@ -68171,10 +68230,10 @@ function populateMaps(extensions, types) {
|
|
|
68171
68230
|
extensions[type] = exts;
|
|
68172
68231
|
for (var i = 0;i < exts.length; i++) {
|
|
68173
68232
|
var extension2 = exts[i];
|
|
68174
|
-
|
|
68175
|
-
const legacyType = _preferredTypeLegacy(extension2,
|
|
68176
|
-
if (legacyType !==
|
|
68177
|
-
$_extensionConflicts.push([extension2, legacyType,
|
|
68233
|
+
types2[extension2] = _preferredType(extension2, types2[extension2], type);
|
|
68234
|
+
const legacyType = _preferredTypeLegacy(extension2, types2[extension2], type);
|
|
68235
|
+
if (legacyType !== types2[extension2]) {
|
|
68236
|
+
$_extensionConflicts.push([extension2, legacyType, types2[extension2]]);
|
|
68178
68237
|
}
|
|
68179
68238
|
}
|
|
68180
68239
|
});
|
|
@@ -68419,10 +68478,10 @@ var getProvider = (_agentName, _config, options = {}) => {
|
|
|
68419
68478
|
mediaType
|
|
68420
68479
|
};
|
|
68421
68480
|
},
|
|
68422
|
-
executeCommand: (
|
|
68481
|
+
executeCommand: (command2, _needApprove) => {
|
|
68423
68482
|
return new Promise((resolve4, reject) => {
|
|
68424
|
-
options.command?.onStarted(
|
|
68425
|
-
const child = spawn2(
|
|
68483
|
+
options.command?.onStarted(command2);
|
|
68484
|
+
const child = spawn2(command2, [], {
|
|
68426
68485
|
shell: true,
|
|
68427
68486
|
stdio: "pipe"
|
|
68428
68487
|
});
|
|
@@ -68868,17 +68927,17 @@ Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
|
68868
68927
|
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
|
68869
68928
|
styles2[styleName] = {
|
|
68870
68929
|
get() {
|
|
68871
|
-
const
|
|
68872
|
-
Object.defineProperty(this, styleName, { value:
|
|
68873
|
-
return
|
|
68930
|
+
const builder2 = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
68931
|
+
Object.defineProperty(this, styleName, { value: builder2 });
|
|
68932
|
+
return builder2;
|
|
68874
68933
|
}
|
|
68875
68934
|
};
|
|
68876
68935
|
}
|
|
68877
68936
|
styles2.visible = {
|
|
68878
68937
|
get() {
|
|
68879
|
-
const
|
|
68880
|
-
Object.defineProperty(this, "visible", { value:
|
|
68881
|
-
return
|
|
68938
|
+
const builder2 = createBuilder(this, this[STYLER], true);
|
|
68939
|
+
Object.defineProperty(this, "visible", { value: builder2 });
|
|
68940
|
+
return builder2;
|
|
68882
68941
|
}
|
|
68883
68942
|
};
|
|
68884
68943
|
var getModelAnsi = (model, level, type, ...arguments_) => {
|
|
@@ -68949,12 +69008,12 @@ var createStyler = (open, close, parent) => {
|
|
|
68949
69008
|
};
|
|
68950
69009
|
};
|
|
68951
69010
|
var createBuilder = (self2, _styler, _isEmpty) => {
|
|
68952
|
-
const
|
|
68953
|
-
Object.setPrototypeOf(
|
|
68954
|
-
|
|
68955
|
-
|
|
68956
|
-
|
|
68957
|
-
return
|
|
69011
|
+
const builder2 = (...arguments_) => applyStyle(builder2, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
69012
|
+
Object.setPrototypeOf(builder2, proto);
|
|
69013
|
+
builder2[GENERATOR] = self2;
|
|
69014
|
+
builder2[STYLER] = _styler;
|
|
69015
|
+
builder2[IS_EMPTY] = _isEmpty;
|
|
69016
|
+
return builder2;
|
|
68958
69017
|
};
|
|
68959
69018
|
var applyStyle = (self2, string8) => {
|
|
68960
69019
|
if (self2.level <= 0 || !string8) {
|