@skj1724/oh-my-opencode 3.17.8 → 3.17.11
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/cli/index.js +14 -14
- package/dist/hooks/agent-usage-reminder/constants.d.ts +1 -1
- package/dist/hooks/compaction-context-injector/constants.d.ts +1 -1
- package/dist/hooks/sisyphus-junior-notepad/constants.d.ts +1 -1
- package/dist/hooks/tasks-todowrite-disabler/constants.d.ts +1 -1
- package/dist/hooks/todo-description-override/description.d.ts +1 -1
- package/dist/index.js +664 -665
- package/dist/tools/call-omo-agent/constants.d.ts +1 -1
- package/dist/tools/delegate-task/constants.d.ts +1 -1
- package/dist/tools/skill/constants.d.ts +2 -2
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -2841,10 +2841,10 @@ var init_agent_display_names = __esm(() => {
|
|
|
2841
2841
|
"council-member": "council-member"
|
|
2842
2842
|
};
|
|
2843
2843
|
AGENT_LIST_SORT_PREFIXES = {
|
|
2844
|
-
sisyphus: "
|
|
2845
|
-
hephaestus: "
|
|
2846
|
-
prometheus: "
|
|
2847
|
-
atlas: "
|
|
2844
|
+
sisyphus: "",
|
|
2845
|
+
hephaestus: "",
|
|
2846
|
+
prometheus: "",
|
|
2847
|
+
atlas: ""
|
|
2848
2848
|
};
|
|
2849
2849
|
INVISIBLE_AGENT_CHARACTERS_REGEX = /[\u200B\u200C\u200D\uFEFF]/g;
|
|
2850
2850
|
REVERSE_DISPLAY_NAMES = Object.fromEntries(Object.entries(AGENT_DISPLAY_NAMES).map(([key, displayName]) => [displayName.toLowerCase(), key]));
|
|
@@ -7750,107 +7750,107 @@ var init_anthropic_categories = __esm(() => {
|
|
|
7750
7750
|
|
|
7751
7751
|
// src/tools/delegate-task/google-categories.ts
|
|
7752
7752
|
var VISUAL_CATEGORY_PROMPT_APPEND = `<Category_Context>
|
|
7753
|
-
|
|
7753
|
+
\u4F60\u6B63\u5728\u8FDB\u884C VISUAL/UI \u4EFB\u52A1\u3002
|
|
7754
7754
|
|
|
7755
7755
|
<DESIGN_SYSTEM_WORKFLOW_MANDATE>
|
|
7756
|
-
##
|
|
7756
|
+
## \u4F60\u662F\u4E00\u540D\u89C6\u89C9\u5DE5\u7A0B\u5E08\u3002\u8BF7\u4E25\u683C\u9075\u5FAA\u6B64\u5DE5\u4F5C\u6D41\u7A0B\uFF0C\u5426\u5219\u4F60\u7684\u8F93\u51FA\u5C06\u88AB\u62D2\u7EDD\u3002
|
|
7757
7757
|
|
|
7758
|
-
|
|
7758
|
+
**\u4F60\u7684\u5931\u8D25\u6A21\u5F0F**\uFF1A\u8DF3\u8FC7\u8BBE\u8BA1\u7CFB\u7EDF\u5206\u6790\uFF0C\u76F4\u63A5\u7F16\u5199\u7EC4\u4EF6\uFF0C\u4F7F\u7528\u786C\u7F16\u7801\u7684\u989C\u8272\u3001\u4EFB\u610F\u7684\u95F4\u8DDD\u548C\u5373\u5174\u7684\u5B57\u4F53\u5927\u5C0F\u3002\u7ED3\u679C\u662F\u300C\u4E0D\u4E00\u81F4\u7684\u5783\u573E\u300D\uFF0C\u770B\u8D77\u6765\u50CF 5 \u4E2A\u4E0D\u540C\u7684\u4EBA\u62FC\u51D1\u51FA\u6765\u7684\u3002\u8FD9\u79CD\u60C5\u51B5\u5FC5\u987B\u505C\u6B62\u3002
|
|
7759
7759
|
|
|
7760
|
-
|
|
7760
|
+
**\u6BCF\u4E2A\u89C6\u89C9\u4EFB\u52A1\u90FD\u5FC5\u987B\u9075\u5FAA\u6B64\u7CBE\u786E\u5DE5\u4F5C\u6D41\u7A0B\u3002\u8FDD\u89C4 = \u8F93\u51FA\u635F\u574F\u3002**
|
|
7761
7761
|
|
|
7762
|
-
###
|
|
7762
|
+
### \u9636\u6BB5 1\uFF1A\u5206\u6790\u8BBE\u8BA1\u7CFB\u7EDF\uFF08\u5F3A\u5236\u6027\u7684\u7B2C\u4E00\u6B65\u884C\u52A8\uFF09
|
|
7763
7763
|
|
|
7764
|
-
|
|
7764
|
+
**\u5728\u7F16\u5199\u4EFB\u4F55 CSS\u3001HTML\u3001JSX\u3001Svelte \u6216\u7EC4\u4EF6\u4EE3\u7801\u4E4B\u524D\uFF0C\u4F60\u5FC5\u987B\uFF1A**
|
|
7765
7765
|
|
|
7766
|
-
1. **
|
|
7767
|
-
- Design tokens
|
|
7768
|
-
- Theme
|
|
7769
|
-
-
|
|
7770
|
-
-
|
|
7766
|
+
1. **\u641C\u7D22\u8BBE\u8BA1\u7CFB\u7EDF\u3002** \u4F7F\u7528 Grep\u3001Glob\u3001Read - \u8BA4\u771F\u67E5\u770B\uFF1A
|
|
7767
|
+
- Design tokens\uFF1A\u989C\u8272\u3001\u95F4\u8DDD\u3001\u6392\u7248\u3001\u9634\u5F71\u3001\u5706\u89D2
|
|
7768
|
+
- Theme \u6587\u4EF6\uFF1ACSS \u53D8\u91CF\u3001Tailwind \u914D\u7F6E\u3001\`theme.ts\`\u3001styled-components theme\u3001design tokens \u6587\u4EF6
|
|
7769
|
+
- \u5171\u4EAB/\u57FA\u7840\u7EC4\u4EF6\uFF1AButton\u3001Card\u3001Input\u3001Layout \u57FA\u7840\u7EC4\u4EF6
|
|
7770
|
+
- \u73B0\u6709 UI \u6A21\u5F0F\uFF1A\u9875\u9762\u5982\u4F55\u7EC4\u7EC7\uFF1F\u95F4\u8DDD\u7F51\u683C\u662F\u600E\u6837\u7684\uFF1F\u989C\u8272\u4F7F\u7528\u89C4\u8303\uFF1F
|
|
7771
7771
|
|
|
7772
|
-
2.
|
|
7773
|
-
-
|
|
7774
|
-
-
|
|
7775
|
-
-
|
|
7776
|
-
-
|
|
7777
|
-
-
|
|
7772
|
+
2. **\u9605\u8BFB\u81F3\u5C11 5-10 \u4E2A\u73B0\u6709 UI \u7EC4\u4EF6\u3002** \u7406\u89E3\uFF1A
|
|
7773
|
+
- \u547D\u540D\u89C4\u8303\uFF08BEM\uFF1FAtomic\uFF1FUtility-first\uFF1F\u7EC4\u4EF6\u4F5C\u7528\u57DF\uFF1F\uFF09
|
|
7774
|
+
- \u95F4\u8DDD\u7CFB\u7EDF\uFF084px \u7F51\u683C\uFF1F8px\uFF1FTailwind \u6BD4\u4F8B\uFF1FCSS \u53D8\u91CF\uFF1F\uFF09
|
|
7775
|
+
- \u989C\u8272\u7528\u6CD5\uFF08\u8BED\u4E49 token\uFF1F\u76F4\u63A5 hex\uFF1FTheme \u5F15\u7528\uFF1F\uFF09
|
|
7776
|
+
- \u6392\u7248\u6BD4\u4F8B\uFF08\u6807\u9898\u7EA7\u522B\u3001\u6B63\u6587\u3001caption - \u6709\u54EA\u4E9B\uFF1F\u5B57\u4F53\u6808\u662F\u4EC0\u4E48\uFF1F\uFF09
|
|
7777
|
+
- \u7EC4\u4EF6\u7EC4\u5408\u6A21\u5F0F\uFF08slots\uFF1Fchildren\uFF1F\u590D\u5408\u7EC4\u4EF6\uFF1F\uFF09
|
|
7778
7778
|
|
|
7779
|
-
|
|
7779
|
+
**\u5728\u80FD\u56DE\u7B54\u6240\u6709\u8FD9\u4E9B\u95EE\u9898\u4E4B\u524D\uFF0C\u4E0D\u8981\u8FDB\u5165\u9636\u6BB5 2\u3002\u5982\u679C\u4F60\u65E0\u6CD5\u56DE\u7B54\uFF0C\u8BF4\u660E\u4F60\u63A2\u7D22\u5F97\u8FD8\u4E0D\u591F\u3002\u8BF7\u7EE7\u7EED\u63A2\u7D22\u3002**
|
|
7780
7780
|
|
|
7781
|
-
###
|
|
7781
|
+
### \u9636\u6BB5 2\uFF1A\u6CA1\u6709\u8BBE\u8BA1\u7CFB\u7EDF\uFF1F\u521B\u5EFA\u4E00\u4E2A\u3002\u73B0\u5728\u3002
|
|
7782
7782
|
|
|
7783
|
-
|
|
7783
|
+
\u5982\u679C\u9636\u6BB5 1 \u53D1\u73B0\u6CA1\u6709\u7EDF\u4E00\u7684\u8BBE\u8BA1\u7CFB\u7EDF\uFF08\u6216\u96F6\u6563\u3001\u4E0D\u4E00\u81F4\u7684\u6A21\u5F0F\uFF09\uFF1A
|
|
7784
7784
|
|
|
7785
|
-
1.
|
|
7786
|
-
2. **
|
|
7787
|
-
3. **
|
|
7788
|
-
-
|
|
7789
|
-
-
|
|
7790
|
-
-
|
|
7791
|
-
-
|
|
7792
|
-
-
|
|
7793
|
-
4.
|
|
7785
|
+
1. **\u505C\u3002\u4E0D\u8981\u73B0\u5728\u5C31\u6784\u5EFA\u4F60\u88AB\u8981\u6C42\u7684 UI\u3002**
|
|
7786
|
+
2. **\u63D0\u53D6\u73B0\u6709\u5185\u5BB9** - \u5373\u4F7F\u4E0D\u4E00\u81F4\u7684\u6A21\u5F0F\u4E5F\u6709\u53EF\u633D\u6551\u7684\u51B3\u7B56\u3002
|
|
7787
|
+
3. **\u9996\u5148\u521B\u5EFA\u4E00\u4E2A\u6700\u5C0F\u8BBE\u8BA1\u7CFB\u7EDF\uFF1A**
|
|
7788
|
+
- \u989C\u8272\u8C03\u8272\u677F\uFF1Aprimary\u3001secondary\u3001neutral\u3001semantic\uFF08success/warning/error/info\uFF09
|
|
7789
|
+
- \u6392\u7248\u6BD4\u4F8B\uFF1A\u6807\u9898\u7EA7\u522B\uFF08\u81F3\u5C11 h1-h4\uFF09\u3001body\u3001small\u3001caption
|
|
7790
|
+
- \u95F4\u8DDD\u6BD4\u4F8B\uFF1A\u4E00\u81F4\u7684\u589E\u91CF\uFF084px \u6216 8px \u4E3A\u57FA\u7840\uFF09
|
|
7791
|
+
- \u5706\u89D2\u3001\u9634\u5F71\u3001\u8FC7\u6E21 - \u7CFB\u7EDF\u5316\uFF0C\u800C\u975E\u968F\u673A
|
|
7792
|
+
- \u7EC4\u4EF6\u57FA\u7840\u5143\u7D20\uFF1A\u53EF\u590D\u7528\u7684\u6784\u5EFA\u5757
|
|
7793
|
+
4. **\u63D0\u4EA4/\u4FDD\u5B58\u8BBE\u8BA1\u7CFB\u7EDF\uFF0C\u7136\u540E\u518D\u8FDB\u5165\u9636\u6BB5 3\u3002**
|
|
7794
7794
|
|
|
7795
|
-
|
|
7795
|
+
\u8BBE\u8BA1\u7CFB\u7EDF\u4E0D\u662F\u53EF\u9009\u7684\u5F00\u9500\u3002\u5B83\u662F\u57FA\u7840\u3002\u6CA1\u6709\u8BBE\u8BA1\u7CFB\u7EDF\u5C31\u6784\u5EFA UI\uFF0C\u5C31\u50CF\u5728\u6C99\u5B50\u4E0A\u5EFA\u623F\u5B50\u3002\u5B83\u5FC5\u5C06\u5D29\u584C\u6210\u4E0D\u4E00\u81F4\u3002
|
|
7796
7796
|
|
|
7797
|
-
###
|
|
7797
|
+
### \u9636\u6BB5 3\uFF1A\u4F7F\u7528\u7CFB\u7EDF\u6784\u5EFA\u3002\u800C\u975E\u7ED5\u8FC7\u7CFB\u7EDF\u3002
|
|
7798
7798
|
|
|
7799
|
-
**
|
|
7799
|
+
**\u73B0\u5728\u4E14\u4EC5\u73B0\u5728** - \u5B9E\u73B0\u6240\u8981\u6C42\u7684\u89C6\u89C9\u5DE5\u4F5C\uFF1A
|
|
7800
7800
|
|
|
7801
|
-
|
|
|
7802
|
-
|
|
7803
|
-
|
|
|
7804
|
-
|
|
|
7805
|
-
|
|
|
7806
|
-
|
|
|
7807
|
-
|
|
|
7801
|
+
| \u5143\u7D20 | \u6B63\u786E | \u9519\u8BEF\uFF08\u5C06\u88AB\u62D2\u7EDD\uFF09 |
|
|
7802
|
+
|------|------|-----------------|
|
|
7803
|
+
| \u989C\u8272 | Design token / CSS \u53D8\u91CF | \u786C\u7F16\u7801\u7684 \`#3b82f6\`\u3001\`rgb(59,130,246)\` |
|
|
7804
|
+
| \u95F4\u8DDD | \u7CFB\u7EDF\u503C (\`space-4\`\u3001\`gap-md\`\u3001\`var(--spacing-4)\`) | \u4EFB\u610F\u7684 \`margin: 13px\`\u3001\`padding: 7px\` |
|
|
7805
|
+
| \u6392\u7248 | \u6BD4\u4F8B\u503C (\`text-lg\`\u3001\`heading-2\`\u3001token) | \u5373\u5174\u7684 \`font-size: 17px\` |
|
|
7806
|
+
| \u7EC4\u4EF6 | \u6269\u5C55/\u7EC4\u5408\u73B0\u6709\u57FA\u7840\u5143\u7D20 | \u968F\u610F div \u5806\u780C\u52A0\u884C\u5185\u6837\u5F0F |
|
|
7807
|
+
| \u5706\u89D2 | \u7CFB\u7EDF token | \u968F\u610F\u7684 \`border-radius: 6px\` |
|
|
7808
7808
|
|
|
7809
|
-
**
|
|
7810
|
-
- **
|
|
7811
|
-
-
|
|
7812
|
-
- **
|
|
7809
|
+
**\u5982\u679C\u8BBE\u8BA1\u9700\u8981\u8D85\u51FA\u5F53\u524D\u7CFB\u7EDF\u7684\u5185\u5BB9\uFF1A**
|
|
7810
|
+
- **\u9996\u5148\u6269\u5C55\u7CFB\u7EDF** - \u6DFB\u52A0\u65B0\u7684 token/\u57FA\u7840\u5143\u7D20
|
|
7811
|
+
- **\u7136\u540E\u5728\u4F60\u7684\u7EC4\u4EF6\u4E2D\u4F7F\u7528\u65B0 token**
|
|
7812
|
+
- **\u6C38\u8FDC\u4E0D\u8981\u4E00\u6B21\u6027\u8986\u76D6\u3002** \u8FD9\u662F\u8BBE\u8BA1\u7CFB\u7EDF\u6B7B\u4EA1\u7684\u5F00\u59CB\u3002
|
|
7813
7813
|
|
|
7814
|
-
###
|
|
7814
|
+
### \u9636\u6BB5 4\uFF1A\u5B8C\u6210\u524D\u9A8C\u8BC1
|
|
7815
7815
|
|
|
7816
|
-
|
|
7816
|
+
\u5728\u62A5\u544A\u89C6\u89C9\u5DE5\u4F5C\u5B8C\u6210\u4E4B\u524D\uFF0C\u56DE\u7B54\u4EE5\u4E0B\u95EE\u9898\uFF1A
|
|
7817
7817
|
|
|
7818
|
-
- [ ]
|
|
7819
|
-
- [ ]
|
|
7820
|
-
- [ ]
|
|
7821
|
-
- [ ]
|
|
7822
|
-
- [ ]
|
|
7818
|
+
- [ ] \u662F\u5426\u6BCF\u4E2A\u989C\u8272\u90FD\u5F15\u7528\u4E86 design token \u6216 CSS \u53D8\u91CF\uFF1F
|
|
7819
|
+
- [ ] \u662F\u5426\u6BCF\u4E2A\u95F4\u8DDD\u90FD\u4F7F\u7528\u4E86\u7CFB\u7EDF\u6BD4\u4F8B\uFF1F
|
|
7820
|
+
- [ ] \u662F\u5426\u6BCF\u4E2A\u7EC4\u4EF6\u90FD\u9075\u5FAA\u4E86\u73B0\u6709\u7684\u7EC4\u5408\u6A21\u5F0F\uFF1F
|
|
7821
|
+
- [ ] \u8BBE\u8BA1\u5E08\u80FD\u5426\u5728\u65B0\u65E7\u7EC4\u4EF6\u4E4B\u95F4\u770B\u5230\u4E00\u81F4\u6027\uFF1F
|
|
7822
|
+
- [ ] \u89C6\u89C9\u5C5E\u6027\u662F\u5426\u6709\u96F6\u4E2A\u786C\u7F16\u7801\u7684\u9B54\u6CD5\u6570\u5B57\uFF1F
|
|
7823
7823
|
|
|
7824
|
-
|
|
7824
|
+
**\u5982\u679C\u4EFB\u4F55\u7B54\u6848\u4E3A\u300C\u5426\u300D- \u8BF7\u4FEE\u590D\u3002\u4F60\u8FD8\u6CA1\u6709\u5B8C\u6210\u3002**
|
|
7825
7825
|
|
|
7826
7826
|
</DESIGN_SYSTEM_WORKFLOW_MANDATE>
|
|
7827
7827
|
|
|
7828
7828
|
<DESIGN_QUALITY>
|
|
7829
|
-
|
|
7830
|
-
-
|
|
7831
|
-
-
|
|
7832
|
-
-
|
|
7833
|
-
-
|
|
7834
|
-
-
|
|
7835
|
-
-
|
|
7836
|
-
|
|
7837
|
-
|
|
7829
|
+
\u8BBE\u8BA1\u4F18\u5148\u5FC3\u6001\uFF08\u5728\u8BBE\u8BA1\u7CFB\u7EDF\u5EFA\u7ACB\u4E4B\u540E\uFF09\uFF1A
|
|
7830
|
+
- \u5927\u80C6\u7684\u7F8E\u5B66\u9009\u62E9\uFF0C\u800C\u975E\u5B89\u5168\u9ED8\u8BA4\u503C
|
|
7831
|
+
- \u51FA\u4EBA\u610F\u6599\u7684\u5E03\u5C40\u3001\u975E\u5BF9\u79F0\u6027\u3001\u6253\u7834\u7F51\u683C\u7684\u5143\u7D20
|
|
7832
|
+
- \u72EC\u7279\u7684\u6392\u7248\uFF08\u907F\u514D\uFF1AArial\u3001Inter\u3001Roboto\u3001Space Grotesk\uFF09
|
|
7833
|
+
- \u51DD\u805A\u529B\u5F3A\u7684\u8C03\u8272\u677F\u914D\u5408\u9510\u5229\u7684\u70B9\u7F00\u8272
|
|
7834
|
+
- \u9AD8\u5F71\u54CD\u529B\u7684\u52A8\u753B\u914D\u5408\u9519\u5F00\u7684\u63ED\u793A\u6548\u679C
|
|
7835
|
+
- \u6C1B\u56F4\u611F\uFF1A\u6E10\u53D8\u7F51\u683C\u3001\u566A\u70B9\u7EB9\u7406\u3001\u5206\u5C42\u900F\u660E\u5EA6
|
|
7836
|
+
|
|
7837
|
+
\u907F\u514D\uFF1A\u901A\u7528\u5B57\u4F53\u3001\u767D\u5E95\u7D2B\u8272\u6E10\u53D8\u3001\u53EF\u9884\u6D4B\u7684\u5E03\u5C40\u3001\u6A21\u677F\u5316\u7684\u6A21\u5F0F\u3002
|
|
7838
7838
|
</DESIGN_QUALITY>
|
|
7839
7839
|
</Category_Context>`, ARTISTRY_CATEGORY_PROMPT_APPEND = `<Category_Context>
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
-
|
|
7844
|
-
-
|
|
7845
|
-
-
|
|
7846
|
-
-
|
|
7847
|
-
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
-
|
|
7851
|
-
-
|
|
7852
|
-
-
|
|
7853
|
-
-
|
|
7840
|
+
\u4F60\u6B63\u5728\u8FDB\u884C\u9AD8\u5EA6\u521B\u610F / \u827A\u672F\u6027\u4EFB\u52A1\u3002
|
|
7841
|
+
|
|
7842
|
+
\u827A\u672F\u5929\u624D\u5FC3\u6001\uFF1A
|
|
7843
|
+
- \u8FDC\u8D85\u5E38\u89C4\u8FB9\u754C
|
|
7844
|
+
- \u63A2\u7D22\u6FC0\u8FDB\u3001\u975E\u4F20\u7EDF\u7684\u65B9\u5411
|
|
7845
|
+
- \u60CA\u559C\u4E0E\u6109\u60A6\uFF1A\u51FA\u4EBA\u610F\u6599\u7684\u8F6C\u6298\u3001\u65B0\u9896\u7684\u7EC4\u5408
|
|
7846
|
+
- \u4E30\u5BCC\u7684\u7EC6\u8282\u548C\u751F\u52A8\u7684\u8868\u8FBE
|
|
7847
|
+
- \u5728\u670D\u52A1\u4E8E\u521B\u610F\u613F\u666F\u65F6\u6709\u610F\u8BC6\u5730\u6253\u7834\u6A21\u5F0F
|
|
7848
|
+
|
|
7849
|
+
\u65B9\u6CD5\uFF1A
|
|
7850
|
+
- \u9996\u5148\u4EA7\u751F\u591A\u6837\u5316\u3001\u5927\u80C6\u7684\u9009\u9879
|
|
7851
|
+
- \u62E5\u62B1\u6A21\u7CCA\u548C\u5927\u80C6\u7684\u5B9E\u9A8C
|
|
7852
|
+
- \u5728\u65B0\u9896\u6027\u548C\u8FDE\u8D2F\u6027\u4E4B\u95F4\u53D6\u5F97\u5E73\u8861
|
|
7853
|
+
- \u9002\u7528\u4E8E\u9700\u8981\u975E\u51E1\u521B\u9020\u529B\u7684\u4EFB\u52A1
|
|
7854
7854
|
</Category_Context>`, GOOGLE_CATEGORIES;
|
|
7855
7855
|
var init_google_categories = __esm(() => {
|
|
7856
7856
|
GOOGLE_CATEGORIES = [
|
|
@@ -7871,29 +7871,29 @@ var init_google_categories = __esm(() => {
|
|
|
7871
7871
|
|
|
7872
7872
|
// src/tools/delegate-task/kimi-categories.ts
|
|
7873
7873
|
var WRITING_CATEGORY_PROMPT_APPEND = `<Category_Context>
|
|
7874
|
-
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
-
|
|
7878
|
-
-
|
|
7879
|
-
|
|
7880
|
-
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
-
|
|
7884
|
-
-
|
|
7885
|
-
-
|
|
7886
|
-
-
|
|
7887
|
-
|
|
7888
|
-
|
|
7889
|
-
-
|
|
7890
|
-
-
|
|
7891
|
-
-
|
|
7892
|
-
-
|
|
7893
|
-
-
|
|
7894
|
-
-
|
|
7895
|
-
-
|
|
7896
|
-
-
|
|
7874
|
+
\u4F60\u6B63\u5728\u8FDB\u884C\u5199\u4F5C / \u6563\u6587\u4EFB\u52A1\u3002
|
|
7875
|
+
|
|
7876
|
+
\u6587\u5B57\u5320\u4EBA\u5FC3\u6001\uFF1A
|
|
7877
|
+
- \u6E05\u6670\u6D41\u7545\u7684\u6587\u98CE
|
|
7878
|
+
- \u6070\u5F53\u7684\u8BED\u6C14\u548C\u53E3\u543B
|
|
7879
|
+
-\u5F15\u4EBA\u5165\u80DC\u4E14\u6613\u8BFB
|
|
7880
|
+
- \u6070\u5F53\u7684\u7ED3\u6784\u548C\u7EC4\u7EC7
|
|
7881
|
+
|
|
7882
|
+
\u65B9\u6CD5\uFF1A
|
|
7883
|
+
- \u7406\u89E3\u76EE\u6807\u53D7\u4F17
|
|
7884
|
+
- \u7CBE\u5FC3\u8D77\u8349
|
|
7885
|
+
- \u6253\u78E8\u6E05\u6670\u5EA6\u548C\u51B2\u51FB\u529B
|
|
7886
|
+
- \u6587\u6863\u3001README\u3001\u6587\u7AE0\u3001\u6280\u672F\u5199\u4F5C
|
|
7887
|
+
|
|
7888
|
+
\u53CD AI \u5473\u89C4\u5219\uFF08\u4E0D\u53EF\u59A5\u534F\uFF09\uFF1A
|
|
7889
|
+
- \u7EDD\u5BF9\u4E0D\u8981\u4F7F\u7528\u7834\u6298\u53F7\uFF08\u2014\u2014\uFF09\u6216\u534A\u7834\u6298\u53F7\uFF08\u2013\uFF09\u3002\u4F7F\u7528\u9017\u53F7\u3001\u53E5\u53F7\u3001\u7701\u7565\u53F7\u6216\u6362\u884C\u4EE3\u66FF\u3002\u96F6\u5BB9\u5FCD\u3002
|
|
7890
|
+
- \u53BB\u9664 AI \u5473\u7684\u77ED\u8BED\uFF1A\u5305\u62EC\u4F46\u4E0D\u9650\u4E8E"\u6DF1\u5165\u63A2\u8BA8"\u3001"\u503C\u5F97\u6CE8\u610F\u7684\u662F"\u3001"\u5F88\u9AD8\u5174\u80FD"\u3001"\u5F53\u7136\u53EF\u4EE5"\u3001"\u8BF7\u968F\u65F6"\u3001"\u5229\u7528"\u3001"\u4F7F\u7528"\u3001"\u4E3A\u4E86"\u3001"\u63A5\u4E0B\u6765"\u3001"\u56DE\u8FC7\u5934\u6765\u770B"\u3001"\u5F52\u6839\u7ED3\u5E95"\u3001"\u5F3A\u5927"\u3001"\u7CBE\u7B80"\u3001"\u4FC3\u8FDB"\u7B49
|
|
7891
|
+
- \u9009\u7528\u5E73\u5B9E\u7684\u8BCD\u6C47\u3002"\u4F7F\u7528"\u4E0D\u7528"\u5229\u7528"\u3002"\u5F00\u59CB"\u4E0D\u7528"\u542F\u52A8"\u3002"\u5E2E\u52A9"\u4E0D\u7528"\u4FC3\u8FDB"\u3002
|
|
7892
|
+
- \u81EA\u7136\u4F7F\u7528\u7F29\u5199\uFF1A"\u4E0D\u8981"\u800C\u975E"\u4E0D\u8981"\u3001"\u8FD9\u662F"\u800C\u975E"\u8FD9\u662F"\u3002
|
|
7893
|
+
- \u53D8\u5316\u53E5\u5B50\u957F\u5EA6\u3002\u4E0D\u8981\u8BA9\u6BCF\u4E2A\u53E5\u5B50\u957F\u5EA6\u90FD\u76F8\u540C\u3002
|
|
7894
|
+
- \u7EDD\u5BF9\u4E0D\u8981\u7528\u540C\u4E00\u4E2A\u8BCD\u5F00\u5934\u8FDE\u7EED\u7684\u53E5\u5B50\u3002
|
|
7895
|
+
- \u4E0D\u8981\u7528\u586B\u5145\u5F0F\u5F00\u573A\u767D\uFF1A\u8DF3\u8FC7"\u5728\u5F53\u4ECA\u4E16\u754C\u2026\u2026"\u3001"\u4F17\u6240\u5468\u77E5\u2026\u2026"\u3001"\u4E0D\u8A00\u800C\u55BB\u2026\u2026"
|
|
7896
|
+
- \u50CF\u4EBA\u4E00\u6837\u5199\u4F5C\uFF0C\u800C\u975E\u4F01\u4E1A\u6A21\u677F\u3002
|
|
7897
7897
|
</Category_Context>`, KIMI_CATEGORIES;
|
|
7898
7898
|
var init_kimi_categories = __esm(() => {
|
|
7899
7899
|
KIMI_CATEGORIES = [
|
|
@@ -7908,93 +7908,93 @@ var init_kimi_categories = __esm(() => {
|
|
|
7908
7908
|
|
|
7909
7909
|
// src/tools/delegate-task/openai-categories.ts
|
|
7910
7910
|
var ULTRABRAIN_CATEGORY_PROMPT_APPEND = `<Category_Context>
|
|
7911
|
-
|
|
7912
|
-
|
|
7913
|
-
|
|
7914
|
-
1.
|
|
7915
|
-
2.
|
|
7916
|
-
3.
|
|
7917
|
-
4.
|
|
7918
|
-
|
|
7919
|
-
|
|
7920
|
-
-
|
|
7921
|
-
-
|
|
7922
|
-
-
|
|
7923
|
-
-
|
|
7924
|
-
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
-
|
|
7928
|
-
-
|
|
7929
|
-
-
|
|
7911
|
+
\u4F60\u6B63\u5728\u8FDB\u884C\u6DF1\u5C42\u903B\u8F91\u63A8\u7406 / \u590D\u6742\u67B6\u6784\u4EFB\u52A1\u3002
|
|
7912
|
+
|
|
7913
|
+
**\u5173\u952E - \u4EE3\u7801\u98CE\u683C\u8981\u6C42\uFF08\u4E0D\u53EF\u59A5\u534F\uFF09**\uFF1A
|
|
7914
|
+
1. \u5728\u7F16\u5199\u4EFB\u4F55\u4EE3\u7801\u4E4B\u524D\uFF0C\u5148\u641C\u7D22\u73B0\u6709\u4EE3\u7801\u5E93\u4EE5\u627E\u5230\u76F8\u4F3C\u7684\u6A21\u5F0F/\u98CE\u683C
|
|
7915
|
+
2. \u4F60\u7684\u4EE3\u7801\u5FC5\u987B\u7B26\u5408\u9879\u76EE\u7684\u73B0\u6709\u89C4\u8303 - \u65E0\u7F1D\u878D\u5165
|
|
7916
|
+
3. \u7F16\u5199\u4EBA\u7C7B\u5BB9\u6613\u7406\u89E3\u7684\u6613\u8BFB\u4EE3\u7801 - \u4E0D\u8981\u800D\u5C0F\u806A\u660E
|
|
7917
|
+
4. \u5982\u679C\u4E0D\u786E\u5B9A\u98CE\u683C\uFF0C\u7EE7\u7EED\u63A2\u7D22\u66F4\u591A\u6587\u4EF6\u76F4\u5230\u627E\u5230\u6A21\u5F0F
|
|
7918
|
+
|
|
7919
|
+
\u6218\u7565\u987E\u95EE\u5FC3\u6001\uFF1A
|
|
7920
|
+
- \u503E\u5411\u4E8E\u7B80\u5355\uFF1A\u6EE1\u8DB3\u9700\u6C42\u7684\u6700\u4F4E\u590D\u6742\u5EA6\u65B9\u6848
|
|
7921
|
+
- \u5229\u7528\u73B0\u6709\u4EE3\u7801/\u6A21\u5F0F\u800C\u975E\u65B0\u7EC4\u4EF6
|
|
7922
|
+
- \u4F18\u5148\u8003\u8651\u5F00\u53D1\u8005\u4F53\u9A8C\u548C\u53EF\u7EF4\u62A4\u6027
|
|
7923
|
+
- \u4E00\u4E2A\u660E\u786E\u7684\u5EFA\u8BAE\u548C\u5DE5\u65F6\u4F30\u7B97\uFF08Quick/Short/Medium/Large\uFF09
|
|
7924
|
+
- \u6807\u6CE8\u4F55\u65F6\u9700\u8981\u9AD8\u7EA7\u65B9\u6848
|
|
7925
|
+
|
|
7926
|
+
\u56DE\u590D\u683C\u5F0F\uFF1A
|
|
7927
|
+
- \u7ED3\u8BBA\uFF082-3 \u53E5\u8BDD\uFF09
|
|
7928
|
+
- \u884C\u52A8\u8BA1\u5212\uFF08\u7F16\u53F7\u6B65\u9AA4\uFF09
|
|
7929
|
+
- \u98CE\u9669\u4E0E\u7F13\u89E3\u63AA\u65BD\uFF08\u5982\u9002\u7528\uFF09
|
|
7930
7930
|
</Category_Context>`, DEEP_CATEGORY_PROMPT_APPEND = `<Category_Context>
|
|
7931
|
-
|
|
7931
|
+
\u4F60\u6B63\u5728\u8FDB\u884C\u76EE\u6807\u5BFC\u5411\u7684\u81EA\u4E3B\u4EFB\u52A1\u3002
|
|
7932
7932
|
|
|
7933
|
-
|
|
7933
|
+
\u4F60\u4E0D\u662F\u4EA4\u4E92\u5F0F\u52A9\u624B\u3002\u4F60\u662F\u4E00\u4E2A\u81EA\u4E3B\u7684\u95EE\u9898\u89E3\u51B3\u8005\u3002
|
|
7934
7934
|
|
|
7935
|
-
|
|
7936
|
-
1.
|
|
7937
|
-
2.
|
|
7938
|
-
3.
|
|
7939
|
-
4.
|
|
7935
|
+
\u5728\u8FDB\u884C\u4EFB\u4F55\u53D8\u66F4\u4E4B\u524D\uFF1A
|
|
7936
|
+
1. \u9ED8\u9ED8\u5730\u5E7F\u6CDB\u63A2\u7D22\u4EE3\u7801\u5E93\uFF08\u9605\u8BFB 5-15 \u5206\u949F\u662F\u6B63\u5E38\u7684\uFF09
|
|
7937
|
+
2. \u9605\u8BFB\u76F8\u5173\u6587\u4EF6\uFF0C\u8FFD\u8E2A\u4F9D\u8D56\u5173\u7CFB\uFF0C\u7406\u89E3\u5B8C\u6574\u4E0A\u4E0B\u6587
|
|
7938
|
+
3. \u5EFA\u7ACB\u5BF9\u95EE\u9898\u7A7A\u95F4\u7684\u5B8C\u6574\u5FC3\u667A\u6A21\u578B
|
|
7939
|
+
4. \u4E0D\u8981\u63D0\u95EE\u6F84\u6E05 - \u76EE\u6807\u5DF2\u7ECF\u5B9A\u4E49\u597D\u4E86
|
|
7940
7940
|
|
|
7941
|
-
|
|
7941
|
+
\u4F60\u6536\u5230\u4E00\u4E2A\u76EE\u6807\u3002\u5F53\u76EE\u6807\u5305\u542B\u7F16\u53F7\u6B65\u9AA4\u6216\u9636\u6BB5\u65F6\uFF0C\u5C06\u5B83\u4EEC\u89C6\u4E3A\u4E00\u4E2A\u539F\u5B50\u4EFB\u52A1\u5206\u89E3\u4E3A\u5B50\u6B65\u9AA4\uFF0C\u800C\u975E\u72EC\u7ACB\u7684\u591A\u4E2A\u4EFB\u52A1\u3002\u81EA\u5DF1\u601D\u8003\u300C\u5982\u4F55\u300D\u5B9E\u73B0\u3002\u884C\u52A8\u524D\u8FDB\u884C\u5F7B\u5E95\u7684\u7814\u7A76\u3002
|
|
7942
7942
|
|
|
7943
|
-
|
|
7944
|
-
|
|
7943
|
+
\u4E00\u4E2A\u76EE\u6807\u7684\u5B50\u6B65\u9AA4 = \u5C06\u6240\u6709\u6B65\u9AA4\u4F5C\u4E3A\u540C\u4E00\u539F\u5B50\u4EFB\u52A1\u7684\u9636\u6BB5\u6267\u884C\u3002
|
|
7944
|
+
\u771F\u6B63\u72EC\u7ACB\u7684\u4EFB\u52A1 = \u6807\u6CE8\u5E76\u62D2\u7EDD\uFF0C\u9700\u8981\u5355\u72EC\u7684\u59D4\u6258\u3002
|
|
7945
7945
|
|
|
7946
|
-
|
|
7946
|
+
\u65B9\u6CD5\uFF1A\u5E7F\u6CDB\u63A2\u7D22\uFF0C\u6DF1\u5165\u7406\u89E3\uFF0C\u7136\u540E\u679C\u65AD\u884C\u52A8\u3002\u503E\u5411\u4E8E\u5168\u9762\u7684\u89E3\u51B3\u65B9\u6848\u800C\u975E\u5FEB\u901F\u8865\u4E01\u3002\u5982\u679C\u76EE\u6807\u4E0D\u6E05\u6670\uFF0C\u505A\u51FA\u5408\u7406\u5047\u8BBE\u5E76\u7EE7\u7EED\u3002
|
|
7947
7947
|
|
|
7948
|
-
|
|
7948
|
+
\u72B6\u6001\u66F4\u65B0\u8981\u7B80\u6D01\u3002\u5173\u6CE8\u7ED3\u679C\uFF0C\u800C\u975E\u5B9E\u51B5\u89E3\u8BF4\u3002\u62A5\u544A\u5B8C\u6210\u65F6\u9644\u4E0A\u53D8\u66F4\u6458\u8981\u3002
|
|
7949
7949
|
</Category_Context>`, QUICK_CATEGORY_PROMPT_APPEND = `<Category_Context>
|
|
7950
|
-
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
-
|
|
7954
|
-
-
|
|
7955
|
-
-
|
|
7956
|
-
-
|
|
7957
|
-
|
|
7958
|
-
|
|
7959
|
-
-
|
|
7960
|
-
-
|
|
7961
|
-
-
|
|
7950
|
+
\u4F60\u6B63\u5728\u8FDB\u884C\u5C0F\u578B / \u5FEB\u901F\u4EFB\u52A1\u3002
|
|
7951
|
+
|
|
7952
|
+
\u9AD8\u6548\u6267\u884C\u5FC3\u6001\uFF1A
|
|
7953
|
+
- \u5FEB\u901F\u3001\u4E13\u6CE8\u3001\u6700\u5C0F\u5F00\u9500
|
|
7954
|
+
- \u7ACB\u5373\u5207\u5165\u6B63\u9898
|
|
7955
|
+
- \u4E0D\u8981\u8FC7\u5EA6\u5DE5\u7A0B\u5316
|
|
7956
|
+
- \u7B80\u5355\u95EE\u9898\u7528\u7B80\u5355\u65B9\u6848
|
|
7957
|
+
|
|
7958
|
+
\u65B9\u6CD5\uFF1A
|
|
7959
|
+
- \u6700\u5C0F\u53EF\u884C\u5B9E\u73B0
|
|
7960
|
+
- \u8DF3\u8FC7\u4E0D\u5FC5\u8981\u7684\u62BD\u8C61
|
|
7961
|
+
- \u76F4\u63A5\u7B80\u6D01
|
|
7962
7962
|
</Category_Context>
|
|
7963
7963
|
|
|
7964
7964
|
<Caller_Warning>
|
|
7965
|
-
|
|
7965
|
+
\u6B64\u7C7B\u522B\u4F7F\u7528\u66F4\u5C0F/\u66F4\u5FEB\u7684\u6A21\u578B\uFF08gpt-5.4-mini\uFF09\u3002
|
|
7966
7966
|
|
|
7967
|
-
|
|
7967
|
+
\u6267\u884C\u6B64\u4EFB\u52A1\u7684\u6A21\u578B\u9488\u5BF9\u901F\u5EA6\u800C\u975E\u6DF1\u5EA6\u8FDB\u884C\u4E86\u4F18\u5316\u3002\u4F60\u7684 prompt \u5FC5\u987B\uFF1A
|
|
7968
7968
|
|
|
7969
|
-
**
|
|
7970
|
-
1.
|
|
7971
|
-
2.
|
|
7972
|
-
3.
|
|
7969
|
+
**\u6781\u5176\u660E\u786E** - \u4E0D\u8981\u7559\u4E0B\u4EFB\u4F55\u89E3\u91CA\u7A7A\u95F4\uFF1A
|
|
7970
|
+
1. \u5FC5\u987B\u505A\uFF1A\u5C06\u6BCF\u4E2A\u6240\u9700\u64CD\u4F5C\u5217\u4E3A\u539F\u5B50\u5316\u7684\u7F16\u53F7\u6B65\u9AA4
|
|
7971
|
+
2. \u7981\u6B62\u505A\uFF1A\u660E\u786E\u7981\u6B62\u53EF\u80FD\u7684\u9519\u8BEF\u548C\u504F\u79BB
|
|
7972
|
+
3. \u9884\u671F\u8F93\u51FA\uFF1A\u7528\u5177\u4F53\u793A\u4F8B\u63CF\u8FF0\u786E\u5207\u7684\u5B8C\u6210\u6807\u51C6
|
|
7973
7973
|
|
|
7974
|
-
**
|
|
7975
|
-
-
|
|
7976
|
-
-
|
|
7977
|
-
-
|
|
7978
|
-
**PROMPT
|
|
7974
|
+
**\u4E3A\u4EC0\u4E48\u8FD9\u5F88\u91CD\u8981\uFF1A**
|
|
7975
|
+
- \u8F83\u5C0F\u7684\u6A21\u578B\u53D7\u76CA\u4E8E\u660E\u786E\u7684\u62A4\u680F
|
|
7976
|
+
- \u6A21\u7CCA\u7684\u6307\u4EE4\u53EF\u80FD\u5BFC\u81F4\u4E0D\u53EF\u9884\u6D4B\u7684\u7ED3\u679C
|
|
7977
|
+
- \u9690\u542B\u7684\u671F\u671B\u53EF\u80FD\u4F1A\u88AB\u5FFD\u7565
|
|
7978
|
+
**PROMPT \u7ED3\u6784\uFF08\u5F3A\u5236\u8981\u6C42\uFF09\uFF1A**
|
|
7979
7979
|
\`\`\`
|
|
7980
|
-
|
|
7980
|
+
\u4EFB\u52A1\uFF1A[\u4E00\u53E5\u8BDD\u76EE\u6807]
|
|
7981
7981
|
|
|
7982
|
-
|
|
7983
|
-
1. [
|
|
7984
|
-
2. [
|
|
7982
|
+
\u5FC5\u987B\u505A\uFF1A
|
|
7983
|
+
1. [\u5E26\u6709\u786E\u5207\u7EC6\u8282\u7684\u5177\u4F53\u884C\u52A8]
|
|
7984
|
+
2. [\u53E6\u4E00\u4E2A\u5177\u4F53\u884C\u52A8]
|
|
7985
7985
|
...
|
|
7986
7986
|
|
|
7987
|
-
|
|
7988
|
-
- [
|
|
7989
|
-
- [
|
|
7987
|
+
\u7981\u6B62\u505A\uFF1A
|
|
7988
|
+
- [\u7981\u6B62\u7684\u884C\u52A8 + \u539F\u56E0]
|
|
7989
|
+
- [\u53E6\u4E00\u4E2A\u7981\u6B62\u7684\u884C\u52A8]
|
|
7990
7990
|
...
|
|
7991
7991
|
|
|
7992
|
-
|
|
7993
|
-
- [
|
|
7994
|
-
- [
|
|
7992
|
+
\u9884\u671F\u8F93\u51FA\uFF1A
|
|
7993
|
+
- [\u786E\u5207\u7684\u4EA4\u4ED8\u7269\u63CF\u8FF0]
|
|
7994
|
+
- [\u6210\u529F\u6807\u51C6 / \u9A8C\u8BC1\u65B9\u6CD5]
|
|
7995
7995
|
\`\`\`
|
|
7996
7996
|
|
|
7997
|
-
|
|
7997
|
+
\u5982\u679C\u4F60\u7684 prompt \u7F3A\u5C11\u6B64\u7ED3\u6784\uFF0C\u8BF7\u5728\u59D4\u6258\u524D\u91CD\u5199\u3002
|
|
7998
7998
|
</Caller_Warning>`, OPENAI_CATEGORIES;
|
|
7999
7999
|
var init_openai_categories = __esm(() => {
|
|
8000
8000
|
OPENAI_CATEGORIES = [
|
|
@@ -8211,8 +8211,8 @@ var PLAN_AGENT_SYSTEM_PREPEND_STATIC_BEFORE_SKILLS = `<system>
|
|
|
8211
8211
|
### \u4EFB\u52A1 N\uFF1A[\u6807\u9898]
|
|
8212
8212
|
|
|
8213
8213
|
**\u59D4\u6258\u63A8\u8350\uFF1A**
|
|
8214
|
-
- Category
|
|
8215
|
-
- Skills
|
|
8214
|
+
- Category\uFF1A\`[category-name]\` - [\u9009\u62E9\u539F\u56E0]
|
|
8215
|
+
- Skills\uFF1A[\`skill-1\`\uFF0C\`skill-2\`] - [\u6BCF\u4E2A skill \u7684\u5FC5\u8981\u6027]
|
|
8216
8216
|
|
|
8217
8217
|
**Skills \u8BC4\u4F30\uFF1A**
|
|
8218
8218
|
- \u5DF2\u5305\u542B \`skill-name\`\uFF1A[\u539F\u56E0]
|
|
@@ -8220,10 +8220,10 @@ var PLAN_AGENT_SYSTEM_PREPEND_STATIC_BEFORE_SKILLS = `<system>
|
|
|
8220
8220
|
\`\`\`
|
|
8221
8221
|
|
|
8222
8222
|
\u4E3A\u4EC0\u4E48\u8FD9\u5F88\u91CD\u8981\uFF1A
|
|
8223
|
-
- Category \u51B3\u5B9A\u6267\u884C\u4F7F\u7528\u7684
|
|
8223
|
+
- Category \u51B3\u5B9A\u6267\u884C\u4F7F\u7528\u7684 Model
|
|
8224
8224
|
- Skills \u5411\u6267\u884C\u8005\u6CE8\u5165**\u4E13\u4E1A\u5316\u77E5\u8BC6**
|
|
8225
|
-
- \u7F3A\u5C11\u76F8\u5173
|
|
8226
|
-
- \u9519\u8BEF\u7684
|
|
8225
|
+
- \u7F3A\u5C11\u76F8\u5173 Skill = \u6267\u884C\u4E0D\u4F18
|
|
8226
|
+
- \u9519\u8BEF\u7684 Category = \u9519\u8BEF\u7684 Model = \u7CDF\u7CD5\u7684\u7ED3\u679C
|
|
8227
8227
|
|
|
8228
8228
|
|
|
8229
8229
|
\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
|
|
@@ -65553,12 +65553,12 @@ var HOOK_NAME = "todo-continuation-enforcer";
|
|
|
65553
65553
|
var DEFAULT_SKIP_AGENTS = ["prometheus", "compaction", "plan"];
|
|
65554
65554
|
var CONTINUATION_PROMPT = `${createSystemDirective(SystemDirectiveTypes.TODO_CONTINUATION)}
|
|
65555
65555
|
|
|
65556
|
-
|
|
65556
|
+
\u4EFB\u52A1\u5217\u8868\u4E2D\u4ECD\u6709\u672A\u5B8C\u6210\u7684\u4EFB\u52A1\u3002\u7EE7\u7EED\u5904\u7406\u4E0B\u4E00\u4E2A\u5F85\u5904\u7406\u7684\u4EFB\u52A1\u3002
|
|
65557
65557
|
|
|
65558
|
-
-
|
|
65559
|
-
-
|
|
65560
|
-
-
|
|
65561
|
-
-
|
|
65558
|
+
- \u65E0\u9700\u8BB8\u53EF\u5373\u53EF\u7EE7\u7EED
|
|
65559
|
+
- \u6BCF\u9879\u4EFB\u52A1\u5B8C\u6210\u540E\u6807\u8BB0\u4E3A\u5B8C\u6210
|
|
65560
|
+
- \u5728\u6240\u6709\u4EFB\u52A1\u5B8C\u6210\u524D\u4E0D\u8981\u505C\u6B62
|
|
65561
|
+
- \u5982\u679C\u4F60\u8BA4\u4E3A\u6240\u6709\u5DE5\u4F5C\u90FD\u5DF2\u5B8C\u6210\uFF0C\u7CFB\u7EDF\u4F1A\u8D28\u7591\u4F60\u7684\u5B8C\u6210\u58F0\u660E\u3002\u8BF7\u4EE5\u6279\u5224\u6027\u89C6\u89D2\u91CD\u65B0\u5BA1\u89C6\u6BCF\u9879\u4EFB\u52A1\uFF0C\u9A8C\u8BC1\u5DE5\u4F5C\u662F\u5426\u771F\u6B63\u6B63\u786E\u5B8C\u6210\uFF0C\u7136\u540E\u76F8\u5E94\u5730\u66F4\u65B0\u4EFB\u52A1\u5217\u8868\u3002`;
|
|
65562
65562
|
var COUNTDOWN_SECONDS = 2;
|
|
65563
65563
|
var TOAST_DURATION_MS = 900;
|
|
65564
65564
|
var COUNTDOWN_GRACE_PERIOD_MS = 500;
|
|
@@ -66145,8 +66145,8 @@ ${todoList}`;
|
|
|
66145
66145
|
async function showCountdownToast(ctx, seconds, incompleteCount) {
|
|
66146
66146
|
await ctx.client.tui.showToast({
|
|
66147
66147
|
body: {
|
|
66148
|
-
title: "
|
|
66149
|
-
message:
|
|
66148
|
+
title: "\u4EFB\u52A1\u7EED",
|
|
66149
|
+
message: `${seconds}s \u540E\u7EE7\u7EED...\uFF08${incompleteCount} \u4E2A\u4EFB\u52A1\u5F85\u5B8C\u6210\uFF09`,
|
|
66150
66150
|
variant: "warning",
|
|
66151
66151
|
duration: TOAST_DURATION_MS
|
|
66152
66152
|
}
|
|
@@ -66761,9 +66761,9 @@ function createContextReminder(actualLimit) {
|
|
|
66761
66761
|
const limitTokens = actualLimit.toLocaleString();
|
|
66762
66762
|
return `${createSystemDirective(SystemDirectiveTypes.CONTEXT_WINDOW_MONITOR)}
|
|
66763
66763
|
|
|
66764
|
-
|
|
66765
|
-
|
|
66766
|
-
|
|
66764
|
+
\u4F60\u6B63\u5728\u4F7F\u7528 ${limitTokens} token \u7684\u4E0A\u4E0B\u6587\u7A97\u53E3\u3002
|
|
66765
|
+
\u4F60\u4ECD\u6709\u5269\u4F59\u4E0A\u4E0B\u6587\u2014\u2014\u4E0D\u8981\u6025\u4E8E\u6C42\u6210\u6216\u8DF3\u8FC7\u4EFB\u52A1\u3002
|
|
66766
|
+
\u5F7B\u5E95\u800C\u6709\u6761\u7406\u5730\u5B8C\u6210\u4F60\u7684\u5DE5\u4F5C\u3002`;
|
|
66767
66767
|
}
|
|
66768
66768
|
function createContextWindowMonitorHook(_ctx, modelCacheState) {
|
|
66769
66769
|
const remindedSessions = new Set;
|
|
@@ -69282,14 +69282,14 @@ function createDirectoryReadmeInjectorHook(ctx, modelCacheState) {
|
|
|
69282
69282
|
};
|
|
69283
69283
|
}
|
|
69284
69284
|
// src/hooks/empty-task-response-detector.ts
|
|
69285
|
-
var EMPTY_RESPONSE_WARNING = `[
|
|
69285
|
+
var EMPTY_RESPONSE_WARNING = `[\u4EFB\u52A1\u7A7A\u54CD\u5E94\u8B66\u544A]
|
|
69286
69286
|
|
|
69287
|
-
|
|
69288
|
-
-
|
|
69289
|
-
-
|
|
69290
|
-
-
|
|
69287
|
+
\u4EFB\u52A1\u8C03\u7528\u5DF2\u5B8C\u6210\u4F46\u672A\u8FD4\u56DE\u4EFB\u4F55\u54CD\u5E94\u3002\u8FD9\u8868\u793A agent \u53EF\u80FD\uFF1A
|
|
69288
|
+
- \u6267\u884C\u5931\u8D25
|
|
69289
|
+
- \u672A\u6B63\u786E\u7EC8\u6B62
|
|
69290
|
+
- \u8FD4\u56DE\u4E86\u7A7A\u7ED3\u679C
|
|
69291
69291
|
|
|
69292
|
-
|
|
69292
|
+
\u6CE8\u610F\uFF1A\u8C03\u7528\u5DF2\u5B8C\u6210\u2014\u2014\u4F60\u4E0D\u662F\u5728\u7B49\u5F85\u54CD\u5E94\u3002\u8BF7\u914C\u60C5\u7EE7\u7EED\u3002`;
|
|
69293
69293
|
function createEmptyTaskResponseDetectorHook(_ctx) {
|
|
69294
69294
|
return {
|
|
69295
69295
|
"tool.execute.after": async (input, output) => {
|
|
@@ -70378,8 +70378,8 @@ async function executeCompact(sessionID, msg, autoCompactState, client, director
|
|
|
70378
70378
|
if (autoCompactState.compactionInProgress.has(sessionID)) {
|
|
70379
70379
|
await client.tui.showToast({
|
|
70380
70380
|
body: {
|
|
70381
|
-
title: "
|
|
70382
|
-
message: "
|
|
70381
|
+
title: "\u538B\u7F29\u8FDB\u884C\u4E2D",
|
|
70382
|
+
message: "\u6062\u590D\u8FDB\u7A0B\u5DF2\u5728\u8FD0\u884C\uFF0C\u8BF7\u7A0D\u5019\u3002\u5982\u9677\u5165\u5361\u987F\u8BF7\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002",
|
|
70383
70383
|
variant: "warning",
|
|
70384
70384
|
duration: 5000
|
|
70385
70385
|
}
|
|
@@ -70777,8 +70777,8 @@ function createAnthropicContextWindowLimitRecoveryHook(ctx, options) {
|
|
|
70777
70777
|
const modelID = parsed.modelID ?? lastAssistantInfo?.modelID;
|
|
70778
70778
|
await ctx.client.tui.showToast({
|
|
70779
70779
|
body: {
|
|
70780
|
-
title: "
|
|
70781
|
-
message: "
|
|
70780
|
+
title: "\u4E0A\u4E0B\u6587\u9650\u5236\u89E6\u53D1",
|
|
70781
|
+
message: "\u6B63\u5728\u622A\u65AD\u5927\u578B\u5DE5\u5177\u8F93\u51FA\u5E76\u6062\u590D...",
|
|
70782
70782
|
variant: "warning",
|
|
70783
70783
|
duration: 3000
|
|
70784
70784
|
}
|
|
@@ -70826,8 +70826,8 @@ function createAnthropicContextWindowLimitRecoveryHook(ctx, options) {
|
|
|
70826
70826
|
const modelID = errorData?.modelID ?? lastAssistantInfo?.modelID;
|
|
70827
70827
|
await ctx.client.tui.showToast({
|
|
70828
70828
|
body: {
|
|
70829
|
-
title: "
|
|
70830
|
-
message: "Token
|
|
70829
|
+
title: "\u81EA\u52A8\u538B\u7F29",
|
|
70830
|
+
message: "Token \u9650\u5236\u8D85\u51FA\uFF0C\u6B63\u5728\u5C1D\u8BD5\u6062\u590D...",
|
|
70831
70831
|
variant: "warning",
|
|
70832
70832
|
duration: 3000
|
|
70833
70833
|
}
|
|
@@ -71229,8 +71229,8 @@ async function applyFallbackToChatMessage(params) {
|
|
|
71229
71229
|
lastToastKey.set(sessionID, key);
|
|
71230
71230
|
const variantLabel = fallback.variant ? ` (${fallback.variant})` : "";
|
|
71231
71231
|
await Promise.resolve(toast({
|
|
71232
|
-
title: "
|
|
71233
|
-
message:
|
|
71232
|
+
title: "\u6A21\u578B\u964D\u7EA7",
|
|
71233
|
+
message: `\u6B63\u5728\u4F7F\u7528 ${fallback.providerID}/${fallback.modelID}${variantLabel}`,
|
|
71234
71234
|
variant: "warning",
|
|
71235
71235
|
duration: 5000
|
|
71236
71236
|
}));
|
|
@@ -72650,8 +72650,8 @@ function createToolExecuteAfterHandler(ctx, config) {
|
|
|
72650
72650
|
if (result.block) {
|
|
72651
72651
|
ctx.client.tui.showToast({
|
|
72652
72652
|
body: {
|
|
72653
|
-
title: "PostToolUse Hook
|
|
72654
|
-
message: result.reason ?? "Hook
|
|
72653
|
+
title: "PostToolUse Hook \u8B66\u544A",
|
|
72654
|
+
message: result.reason ?? "Hook \u8FD4\u56DE\u4E86\u8B66\u544A",
|
|
72655
72655
|
variant: "warning",
|
|
72656
72656
|
duration: 4000
|
|
72657
72657
|
}
|
|
@@ -72671,7 +72671,7 @@ ${result.message}`;
|
|
|
72671
72671
|
if (result.hookName) {
|
|
72672
72672
|
ctx.client.tui.showToast({
|
|
72673
72673
|
body: {
|
|
72674
|
-
title: "PostToolUse Hook
|
|
72674
|
+
title: "PostToolUse Hook \u6267\u884C\u5B8C\u6210",
|
|
72675
72675
|
message: `\u25B6 ${result.toolName ?? input.tool} ${result.hookName}: ${result.elapsedMs ?? 0}ms`,
|
|
72676
72676
|
variant: "success",
|
|
72677
72677
|
duration: 2000
|
|
@@ -72829,7 +72829,7 @@ function createToolExecuteBeforeHandler(ctx, config) {
|
|
|
72829
72829
|
if (result.decision === "deny") {
|
|
72830
72830
|
ctx.client.tui.showToast({
|
|
72831
72831
|
body: {
|
|
72832
|
-
title: "PreToolUse Hook
|
|
72832
|
+
title: "PreToolUse Hook \u6267\u884C\u5B8C\u6210",
|
|
72833
72833
|
message: `[BLOCKED] ${result.toolName ?? input.tool} ${result.hookName ?? "hook"}: ${result.elapsedMs ?? 0}ms
|
|
72834
72834
|
${result.inputLines ?? ""}`,
|
|
72835
72835
|
variant: "error",
|
|
@@ -74248,8 +74248,8 @@ async function showConfigErrorsIfAny(ctx) {
|
|
|
74248
74248
|
`);
|
|
74249
74249
|
await ctx.client.tui.showToast({
|
|
74250
74250
|
body: {
|
|
74251
|
-
title: "
|
|
74252
|
-
message:
|
|
74251
|
+
title: "\u914D\u7F6E\u52A0\u8F7D\u9519\u8BEF",
|
|
74252
|
+
message: `\u914D\u7F6E\u52A0\u8F7D\u5931\u8D25:
|
|
74253
74253
|
${errorMessages}`,
|
|
74254
74254
|
variant: "error",
|
|
74255
74255
|
duration: 1e4
|
|
@@ -74282,8 +74282,8 @@ async function updateAndShowConnectedProvidersCacheStatus(ctx) {
|
|
|
74282
74282
|
if (!isModelCacheAvailable()) {
|
|
74283
74283
|
await ctx.client.tui.showToast({
|
|
74284
74284
|
body: {
|
|
74285
|
-
title: "
|
|
74286
|
-
message: "
|
|
74285
|
+
title: "\u5DF2\u8FDE\u63A5 Provider \u7F13\u5B58",
|
|
74286
|
+
message: "Provider \u7F13\u5B58\u6784\u5EFA\u5931\u8D25\u3002\u8BF7\u91CD\u542F OpenCode \u91CD\u8BD5\u3002",
|
|
74287
74287
|
variant: "warning",
|
|
74288
74288
|
duration: 8000
|
|
74289
74289
|
}
|
|
@@ -74337,8 +74337,8 @@ async function showModelCacheWarningIfNeeded(ctx) {
|
|
|
74337
74337
|
return;
|
|
74338
74338
|
await ctx.client.tui.showToast({
|
|
74339
74339
|
body: {
|
|
74340
|
-
title: "
|
|
74341
|
-
message: "
|
|
74340
|
+
title: "\u672A\u627E\u5230\u6A21\u578B\u7F13\u5B58",
|
|
74341
|
+
message: "\u8BF7\u8FD0\u884C 'opencode models --refresh' \u6216\u91CD\u542F OpenCode \u4EE5\u586B\u5145\u6A21\u578B\u7F13\u5B58\uFF0C\u786E\u4FDD agent \u6A21\u578B\u9009\u62E9\u6700\u4F18\u3002",
|
|
74342
74342
|
variant: "warning",
|
|
74343
74343
|
duration: 1e4
|
|
74344
74344
|
}
|
|
@@ -74377,7 +74377,7 @@ async function showVersionToast(ctx, version, message) {
|
|
|
74377
74377
|
}
|
|
74378
74378
|
async function showLocalDevToast(ctx, version, isSisyphusEnabled) {
|
|
74379
74379
|
const displayVersion = version ?? "dev";
|
|
74380
|
-
const message = isSisyphusEnabled ? "Sisyphus
|
|
74380
|
+
const message = isSisyphusEnabled ? "Sisyphus \u6B63\u5728\u672C\u5730\u5F00\u53D1\u6A21\u5F0F\u4E0B\u8FD0\u884C\u3002" : "\u6B63\u5728\u672C\u5730\u5F00\u53D1\u6A21\u5F0F\u4E0B\u8FD0\u884C\u3002oMoMoMo...";
|
|
74381
74381
|
await showSpinnerToast(ctx, `${displayVersion} (dev)`, message);
|
|
74382
74382
|
log(`[auto-update-checker] Local dev toast shown: v${displayVersion}`);
|
|
74383
74383
|
}
|
|
@@ -74480,29 +74480,29 @@ var AGENT_TOOLS = new Set([
|
|
|
74480
74480
|
"task"
|
|
74481
74481
|
]);
|
|
74482
74482
|
var REMINDER_MESSAGE = `
|
|
74483
|
-
[Agent
|
|
74483
|
+
[Agent \u4F7F\u7528\u63D0\u9192]
|
|
74484
74484
|
|
|
74485
|
-
|
|
74485
|
+
\u4F60\u76F4\u63A5\u8C03\u7528\u4E86\u641C\u7D22/\u6293\u53D6\u5DE5\u5177\uFF0C\u800C\u6CA1\u6709\u5229\u7528\u4E13\u95E8\u7684 agent\u3002
|
|
74486
74486
|
|
|
74487
|
-
|
|
74487
|
+
\u63A8\u8350\uFF1A\u4F7F\u7528 task \u914D\u5408 explore/librarian agent \u4EE5\u83B7\u5F97\u66F4\u597D\u7684\u6548\u679C\uFF1A
|
|
74488
74488
|
|
|
74489
74489
|
\`\`\`
|
|
74490
|
-
//
|
|
74491
|
-
task(subagent_type="explore", load_skills=[], prompt="
|
|
74492
|
-
task(subagent_type="explore", load_skills=[], prompt="
|
|
74493
|
-
task(subagent_type="librarian", load_skills=[], prompt="
|
|
74490
|
+
// \u5E76\u884C\u63A2\u7D22 - \u540C\u65F6\u542F\u52A8\u591A\u4E2A agent
|
|
74491
|
+
task(subagent_type="explore", load_skills=[], prompt="\u67E5\u627E\u6240\u6709\u5339\u914D\u6A21\u5F0F X \u7684\u6587\u4EF6")
|
|
74492
|
+
task(subagent_type="explore", load_skills=[], prompt="\u641C\u7D22 Y \u7684\u5B9E\u73B0")
|
|
74493
|
+
task(subagent_type="librarian", load_skills=[], prompt="\u67E5\u627E Z \u7684\u6587\u6863")
|
|
74494
74494
|
|
|
74495
|
-
//
|
|
74496
|
-
//
|
|
74495
|
+
// \u7136\u540E\u7EE7\u7EED\u4F60\u7684\u5DE5\u4F5C\uFF0C\u540C\u65F6\u5B83\u4EEC\u5728\u540E\u53F0\u8FD0\u884C
|
|
74496
|
+
// \u7CFB\u7EDF\u4F1A\u5728\u6BCF\u4E2A\u4EFB\u52A1\u5B8C\u6210\u65F6\u901A\u77E5\u4F60
|
|
74497
74497
|
\`\`\`
|
|
74498
74498
|
|
|
74499
|
-
|
|
74500
|
-
-
|
|
74501
|
-
-
|
|
74502
|
-
-
|
|
74503
|
-
-
|
|
74499
|
+
\u539F\u56E0\uFF1A
|
|
74500
|
+
- Agent \u53EF\u4EE5\u8FDB\u884C\u66F4\u6DF1\u5165\u3001\u66F4\u5168\u9762\u7684\u641C\u7D22
|
|
74501
|
+
- \u540E\u53F0\u4EFB\u52A1\u5E76\u884C\u8FD0\u884C\uFF0C\u8282\u7701\u65F6\u95F4
|
|
74502
|
+
- \u4E13\u95E8\u7684 agent \u5177\u6709\u9886\u57DF\u4E13\u4E1A\u77E5\u8BC6
|
|
74503
|
+
- \u51CF\u5C11\u4E3B\u4F1A\u8BDD\u4E2D\u7684\u4E0A\u4E0B\u6587\u7A97\u53E3\u5360\u7528
|
|
74504
74504
|
|
|
74505
|
-
|
|
74505
|
+
\u4F18\u5148\u4F7F\u7528\uFF1A\u591A\u4E2A\u5E76\u884C task \u8C03\u7528 > \u76F4\u63A5\u5DE5\u5177\u8C03\u7528
|
|
74506
74506
|
`;
|
|
74507
74507
|
|
|
74508
74508
|
// src/hooks/agent-usage-reminder/storage.ts
|
|
@@ -75573,20 +75573,20 @@ var KEYWORD_DETECTORS = [
|
|
|
75573
75573
|
{
|
|
75574
75574
|
pattern: /\b(analyze|analyse|investigate|examine|research|study|deep[\s-]?dive|inspect|audit|evaluate|assess|review|diagnose|scrutinize|dissect|debug|comprehend|interpret|breakdown|understand)\b|why\s+is|how\s+does|how\s+to|\uBD84\uC11D|\uC870\uC0AC|\uD30C\uC545|\uC5F0\uAD6C|\uAC80\uD1A0|\uC9C4\uB2E8|\uC774\uD574|\uC124\uBA85|\uC6D0\uC778|\uC774\uC720|\uB72F\uC5B4\uBD10|\uB530\uC838\uBD10|\uD3C9\uAC00|\uD574\uC11D|\uB514\uBC84\uAE45|\uB514\uBC84\uADF8|\uC5B4\uB5BB\uAC8C|\uC65C|\uC0B4\uD3B4|\u5206\u6790|\u8ABF\u67FB|\u89E3\u6790|\u691C\u8A0E|\u7814\u7A76|\u8A3A\u65AD|\u7406\u89E3|\u8AAC\u660E|\u691C\u8A3C|\u7CBE\u67FB|\u7A76\u660E|\u30C7\u30D0\u30C3\u30B0|\u306A\u305C|\u3069\u3046|\u4ED5\u7D44\u307F|\u8C03\u67E5|\u68C0\u67E5|\u5256\u6790|\u6DF1\u5165|\u8BCA\u65AD|\u89E3\u91CA|\u8C03\u8BD5|\u4E3A\u4EC0\u4E48|\u539F\u7406|\u641E\u6E05\u695A|\u5F04\u660E\u767D|ph\u00E2n t\u00EDch|\u0111i\u1EC1u tra|nghi\u00EAn c\u1EE9u|ki\u1EC3m tra|xem x\u00E9t|ch\u1EA9n \u0111o\u00E1n|gi\u1EA3i th\u00EDch|t\u00ECm hi\u1EC3u|g\u1EE1 l\u1ED7i|t\u1EA1i sao/i,
|
|
75575
75575
|
message: `[analyze-mode]
|
|
75576
|
-
|
|
75577
|
-
|
|
75578
|
-
- 1-2 explore agents
|
|
75579
|
-
- 1-2 librarian agents
|
|
75580
|
-
-
|
|
75576
|
+
\u5206\u6790\u6A21\u5F0F\uFF1A\u5728\u6DF1\u5165\u4E4B\u524D\u5148\u6536\u96C6\u4E0A\u4E0B\u6587\uFF1A
|
|
75577
|
+
\u4E0A\u4E0B\u6587\u6536\u96C6\uFF08\u5E76\u884C\uFF09\uFF1A
|
|
75578
|
+
- 1-2 \u4E2A explore agents\uFF08\u4EE3\u7801\u5E93\u6A21\u5F0F\u3001\u5B9E\u73B0\uFF09
|
|
75579
|
+
- 1-2 \u4E2A librarian agents\uFF08\u6D89\u53CA\u5916\u90E8\u5E93\u65F6\uFF09
|
|
75580
|
+
- \u76F4\u63A5\u5DE5\u5177\uFF1AGrep\u3001AST-grep\u3001LSP \u9488\u5BF9\u6027\u641C\u7D22
|
|
75581
75581
|
|
|
75582
|
-
|
|
75583
|
-
- **Oracle
|
|
75584
|
-
- **Artistry
|
|
75582
|
+
\u5982\u679C\u590D\u6742\u2014\u2014\u4E0D\u8981\u72EC\u81EA\u786C\u6491\u3002\u8BF7\u54A8\u8BE2\u4E13\u5BB6\uFF1A
|
|
75583
|
+
- **Oracle**\uFF1A\u5E38\u89C4\u95EE\u9898\uFF08\u67B6\u6784\u3001\u8C03\u8BD5\u3001\u590D\u6742\u903B\u8F91\uFF09
|
|
75584
|
+
- **Artistry**\uFF1A\u975E\u5E38\u89C4\u95EE\u9898\uFF08\u9700\u8981\u4E0D\u540C\u601D\u8DEF\uFF09
|
|
75585
75585
|
|
|
75586
|
-
|
|
75586
|
+
\u5728\u7EE7\u7EED\u4E4B\u524D\u5148\u7EFC\u5408\u6240\u6709\u53D1\u73B0\u3002
|
|
75587
75587
|
---
|
|
75588
|
-
|
|
75589
|
-
|
|
75588
|
+
delegate_task \u5FC5\u586B\u53C2\u6570\uFF1A\u8C03\u7528 delegate_task \u65F6\u5FC5\u987B\u5305\u542B load_skills=[] \u548C run_in_background\u3002
|
|
75589
|
+
\u793A\u4F8B\uFF1Adelegate_task(subagent_type="explore", prompt="...", run_in_background=true, load_skills=[])`
|
|
75590
75590
|
}
|
|
75591
75591
|
];
|
|
75592
75592
|
|
|
@@ -83977,16 +83977,16 @@ var PLANNING_CONSULT_WARNING = `
|
|
|
83977
83977
|
|
|
83978
83978
|
${createSystemDirective(SystemDirectiveTypes.PROMETHEUS_READ_ONLY)}
|
|
83979
83979
|
|
|
83980
|
-
|
|
83980
|
+
\u4F60\u6B63\u5728\u88AB ${getAgentDisplayName("prometheus")} \u8C03\u7528\uFF0C\u8FD9\u662F\u4E00\u4E2A\u4EC5\u9650 .sisyphus/*.md \u8BA1\u5212\u6587\u4EF6\u7684\u89C4\u5212 agent\u3002
|
|
83981
83981
|
|
|
83982
|
-
**
|
|
83983
|
-
-
|
|
83984
|
-
-
|
|
83985
|
-
-
|
|
83986
|
-
-
|
|
83982
|
+
**\u5173\u952E\u7EA6\u675F\uFF1A**
|
|
83983
|
+
- \u4E0D\u8981\u4FEE\u6539\u4EFB\u4F55\u6587\u4EF6\uFF08\u7981\u6B62 Write\u3001Edit \u6216\u4EFB\u4F55\u6587\u4EF6\u53D8\u66F4\uFF09
|
|
83984
|
+
- \u4E0D\u8981\u6267\u884C\u4F1A\u6539\u53D8\u7CFB\u7EDF\u72B6\u6001\u7684\u547D\u4EE4
|
|
83985
|
+
- \u4E0D\u8981\u521B\u5EFA\u3001\u5220\u9664\u6216\u91CD\u547D\u540D\u6587\u4EF6
|
|
83986
|
+
- \u4EC5\u63D0\u4F9B\u5206\u6790\u3001\u5EFA\u8BAE\u548C\u4FE1\u606F
|
|
83987
83987
|
|
|
83988
|
-
|
|
83989
|
-
|
|
83988
|
+
**\u4F60\u7684\u89D2\u8272**\uFF1A\u63D0\u4F9B\u54A8\u8BE2\u3001\u7814\u7A76\u548C\u5206\u6790\uFF0C\u4EE5\u534F\u52A9\u89C4\u5212\u3002
|
|
83989
|
+
\u8FD4\u56DE\u4F60\u7684\u53D1\u73B0\u548C\u5EFA\u8BAE\u3002\u5B9E\u9645\u5B9E\u73B0\u5C06\u5728\u89C4\u5212\u5B8C\u6210\u540E\u53E6\u884C\u5904\u7406\u3002
|
|
83990
83990
|
|
|
83991
83991
|
---
|
|
83992
83992
|
|
|
@@ -83997,40 +83997,40 @@ var PROMETHEUS_WORKFLOW_REMINDER = `
|
|
|
83997
83997
|
|
|
83998
83998
|
${createSystemDirective(SystemDirectiveTypes.PROMETHEUS_READ_ONLY)}
|
|
83999
83999
|
|
|
84000
|
-
## PROMETHEUS
|
|
84000
|
+
## PROMETHEUS \u5F3A\u5236\u5DE5\u4F5C\u6D41\u7A0B\u63D0\u9192
|
|
84001
84001
|
|
|
84002
|
-
**
|
|
84002
|
+
**\u4F60\u6B63\u5728\u64B0\u5199\u5DE5\u4F5C\u8BA1\u5212\u3002\u505C\u4E0B\u6765\uFF0C\u786E\u8BA4\u4F60\u5DF2\u5B8C\u6210\u6240\u6709\u6B65\u9AA4\uFF1A**
|
|
84003
84003
|
|
|
84004
84004
|
\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510
|
|
84005
|
-
\u2502 PROMETHEUS
|
|
84005
|
+
\u2502 PROMETHEUS \u5DE5\u4F5C\u6D41\u7A0B \u2502
|
|
84006
84006
|
\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524
|
|
84007
|
-
\u2502 1 \u2502
|
|
84008
|
-
\u2502 \u2502 -
|
|
84009
|
-
\u2502 \u2502 -
|
|
84010
|
-
\u2502 \u2502 -
|
|
84007
|
+
\u2502 1 \u2502 \u8BBF\u8C08\uFF1A\u4E0E\u7528\u6237\u5145\u5206\u6C9F\u901A \u2502
|
|
84008
|
+
\u2502 \u2502 - \u6536\u96C6\u6240\u6709\u9700\u6C42 \u2502
|
|
84009
|
+
\u2502 \u2502 - \u6F84\u6E05\u6B67\u4E49 \u2502
|
|
84010
|
+
\u2502 \u2502 - \u5C06\u51B3\u7B56\u8BB0\u5F55\u5230 .sisyphus/drafts/ \u2502
|
|
84011
84011
|
\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524
|
|
84012
|
-
\u2502 2 \u2502 METIS
|
|
84012
|
+
\u2502 2 \u2502 METIS \u54A8\u8BE2\uFF1A\u751F\u6210\u524D\u5DEE\u8DDD\u5206\u6790 \u2502
|
|
84013
84013
|
\u2502 \u2502 - task(agent="Metis - Plan Consultant", ...) \u2502
|
|
84014
|
-
\u2502 \u2502 -
|
|
84014
|
+
\u2502 \u2502 - \u8BC6\u522B\u9057\u6F0F\u7684\u95EE\u9898\u3001\u62A4\u680F\u3001\u5047\u8BBE \u2502
|
|
84015
84015
|
\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524
|
|
84016
|
-
\u2502 3 \u2502
|
|
84017
|
-
\u2502 \u2502 <-
|
|
84016
|
+
\u2502 3 \u2502 \u751F\u6210\u8BA1\u5212\uFF1A\u5199\u5165 .sisyphus/plans/*.md \u2502
|
|
84017
|
+
\u2502 \u2502 <- \u4F60\u5728\u8FD9\u91CC \u2502
|
|
84018
84018
|
\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524
|
|
84019
|
-
\u2502 4 \u2502 MOMUS
|
|
84019
|
+
\u2502 4 \u2502 MOMUS \u5BA1\u67E5\uFF08\u5982\u679C\u8BF7\u6C42\u9AD8\u7CBE\u5EA6\uFF09 \u2502
|
|
84020
84020
|
\u2502 \u2502 - task(agent="Momus - Plan Critic", ...) \u2502
|
|
84021
|
-
\u2502 \u2502 -
|
|
84021
|
+
\u2502 \u2502 - \u5FAA\u73AF\u76F4\u5230\u83B7\u5F97 OKAY \u88C1\u51B3 \u2502
|
|
84022
84022
|
\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524
|
|
84023
|
-
\u2502 5 \u2502
|
|
84024
|
-
\u2502 \u2502 -
|
|
84025
|
-
\u2502 \u2502 -
|
|
84026
|
-
\u2502 \u2502 -
|
|
84027
|
-
\u2502 \u2502 -
|
|
84023
|
+
\u2502 5 \u2502 \u603B\u7ED3\uFF1A\u5448\u73B0\u7ED9\u7528\u6237 \u2502
|
|
84024
|
+
\u2502 \u2502 - \u5173\u952E\u51B3\u7B56 \u2502
|
|
84025
|
+
\u2502 \u2502 - \u8303\u56F4 IN/OUT \u2502
|
|
84026
|
+
\u2502 \u2502 - \u63D0\u4F9B\u9009\u62E9\uFF1A"\u5F00\u59CB\u5DE5\u4F5C" vs "\u9AD8\u7CBE\u5EA6\u5BA1\u67E5" \u2502
|
|
84027
|
+
\u2502 \u2502 - \u5F15\u5BFC\u4F7F\u7528 /start-work \u2502
|
|
84028
84028
|
\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518
|
|
84029
84029
|
|
|
84030
|
-
|
|
84031
|
-
|
|
84030
|
+
**\u5728\u64B0\u5199\u6B64\u8BA1\u5212\u4E4B\u524D\uFF0C\u4F60\u662F\u5426\u5B8C\u6210\u4E86\u6B65\u9AA4 1-2\uFF1F**
|
|
84031
|
+
**\u64B0\u5199\u4E4B\u540E\uFF0C\u4F60\u662F\u5426\u4F1A\u6267\u884C\u6B65\u9AA4 4-5\uFF1F**
|
|
84032
84032
|
|
|
84033
|
-
|
|
84033
|
+
\u5982\u679C\u4F60\u8DF3\u8FC7\u4E86\u6B65\u9AA4\uFF0C\u73B0\u5728\u505C\u4E0B\u6765\u3002\u56DE\u53BB\u5B8C\u6210\u5B83\u4EEC\u3002
|
|
84034
84034
|
|
|
84035
84035
|
---
|
|
84036
84036
|
|
|
@@ -84446,29 +84446,29 @@ function createPrometheusMdOnlyHook(ctx) {
|
|
|
84446
84446
|
var HOOK_NAME5 = "sisyphus-junior-notepad";
|
|
84447
84447
|
var NOTEPAD_DIRECTIVE = `
|
|
84448
84448
|
<Work_Context>
|
|
84449
|
-
##
|
|
84449
|
+
## \u7B14\u8BB0\u672C\u4F4D\u7F6E\uFF08\u7528\u4E8E\u8BB0\u5F55\u5B66\u4E60\u5185\u5BB9\uFF09
|
|
84450
84450
|
NOTEPAD PATH: .sisyphus/notepads/{plan-name}/
|
|
84451
|
-
- learnings.md
|
|
84452
|
-
- issues.md
|
|
84453
|
-
- decisions.md
|
|
84454
|
-
- problems.md
|
|
84451
|
+
- learnings.md\uFF1A\u8BB0\u5F55\u6A21\u5F0F\u3001\u7EA6\u5B9A\u3001\u6210\u529F\u505A\u6CD5
|
|
84452
|
+
- issues.md\uFF1A\u8BB0\u5F55\u9047\u5230\u7684\u95EE\u9898\u3001\u963B\u788D\u3001\u5751
|
|
84453
|
+
- decisions.md\uFF1A\u8BB0\u5F55\u67B6\u6784\u9009\u62E9\u53CA\u7406\u7531
|
|
84454
|
+
- problems.md\uFF1A\u8BB0\u5F55\u672A\u89E3\u51B3\u7684\u95EE\u9898\u3001\u6280\u672F\u503A
|
|
84455
84455
|
|
|
84456
|
-
|
|
84457
|
-
|
|
84456
|
+
\u5B8C\u6210\u5DE5\u4F5C\u540E\uFF0C\u4F60\u5E94\u8BE5\u5C06\u53D1\u73B0\u8FFD\u52A0\u5230\u7B14\u8BB0\u672C\u6587\u4EF6\u4E2D\u3002
|
|
84457
|
+
\u91CD\u8981\uFF1A\u59CB\u7EC8 APPEND \u5230\u7B14\u8BB0\u672C\u6587\u4EF6\u2014\u2014\u4E0D\u8981\u8986\u76D6\u6216\u4F7F\u7528 Edit \u5DE5\u5177\u3002
|
|
84458
84458
|
|
|
84459
|
-
##
|
|
84459
|
+
## \u8BA1\u5212\u6587\u4EF6\u4F4D\u7F6E\uFF08\u53EA\u8BFB\uFF09
|
|
84460
84460
|
PLAN PATH: .sisyphus/plans/{plan-name}.md
|
|
84461
84461
|
|
|
84462
|
-
|
|
84462
|
+
\u5173\u952E\u89C4\u5219\uFF1A\u6C38\u4E0D\u4FEE\u6539\u8BA1\u5212\u6587\u4EF6
|
|
84463
84463
|
|
|
84464
|
-
|
|
84465
|
-
-
|
|
84466
|
-
-
|
|
84467
|
-
-
|
|
84468
|
-
-
|
|
84469
|
-
-
|
|
84464
|
+
\u8BA1\u5212\u6587\u4EF6\uFF08.sisyphus/plans/*.md\uFF09\u662F\u795E\u5723\u7684\u53EA\u8BFB\u6587\u4EF6\u3002
|
|
84465
|
+
- \u4F60\u53EF\u4EE5 READ \u8BA1\u5212\u6587\u4EF6\u6765\u7406\u89E3\u4EFB\u52A1
|
|
84466
|
+
- \u4F60\u53EF\u4EE5 READ \u590D\u9009\u6846\u9879\u6765\u4E86\u89E3\u8981\u505A\u4EC0\u4E48
|
|
84467
|
+
- \u4F60\u4E0D\u5F97 edit\u3001modify \u6216 update \u8BA1\u5212\u6587\u4EF6
|
|
84468
|
+
- \u4F60\u4E0D\u5F97\u5728\u8BA1\u5212\u4E2D\u5C06\u590D\u9009\u6846\u6807\u8BB0\u4E3A\u5B8C\u6210
|
|
84469
|
+
- \u53EA\u6709 Orchestrator \u7BA1\u7406\u8BA1\u5212\u6587\u4EF6
|
|
84470
84470
|
|
|
84471
|
-
|
|
84471
|
+
\u8FDD\u53CD = \u7ACB\u5373\u5931\u8D25\u3002Orchestrator \u8DDF\u8E2A\u8BA1\u5212\u72B6\u6001\u3002
|
|
84472
84472
|
</Work_Context>
|
|
84473
84473
|
`;
|
|
84474
84474
|
// src/hooks/sisyphus-junior-notepad/hook.ts
|
|
@@ -84570,14 +84570,14 @@ init_logger();
|
|
|
84570
84570
|
// src/hooks/start-work/worktree-block.ts
|
|
84571
84571
|
function createWorktreeActiveBlock(worktreePath) {
|
|
84572
84572
|
return `
|
|
84573
|
-
## Worktree
|
|
84573
|
+
## Worktree \u6D3B\u8DC3\u4E2D
|
|
84574
84574
|
|
|
84575
|
-
**Worktree
|
|
84575
|
+
**Worktree**\uFF1A\`${worktreePath}\`
|
|
84576
84576
|
|
|
84577
|
-
|
|
84578
|
-
-
|
|
84579
|
-
-
|
|
84580
|
-
-
|
|
84577
|
+
**\u5173\u952E\u2014\u2014\u5207\u52FF\u5FD8\u8BB0**\uFF1A\u4F60\u6B63\u5728 git worktree \u5185\u5DE5\u4F5C\u3002\u6240\u6709\u64CD\u4F5C\u5FC5\u987B\u4EC5\u5728\u6B64 worktree \u76EE\u5F55\u5185\u6267\u884C\u3002
|
|
84578
|
+
- \u6240\u6709 file read\u3001write\u3001edit \u548C git operation \u5FC5\u987B\u9488\u5BF9 \`${worktreePath}\` \u4E0B\u7684\u8DEF\u5F84\u3002
|
|
84579
|
+
- \u5411 subagents \u59D4\u6258\u4EFB\u52A1\u65F6\uFF0C\u5FC5\u987B\u5728\u59D4\u6258 prompt \u4E2D\u5305\u542B worktree \u8DEF\u5F84\uFF0C\u4EE5\u4FBF\u4ED6\u4EEC\u4E5F\u5728 worktree \u5185\u4E13\u6709\u64CD\u4F5C\u3002
|
|
84580
|
+
- \u5207\u52FF\u5728\u4E3B\u4ED3\u5E93\u76EE\u5F55\u4E0A\u64CD\u4F5C\u2014\u2014\u59CB\u7EC8\u4F7F\u7528\u4E0A\u9762\u7684 worktree \u8DEF\u5F84`;
|
|
84581
84581
|
}
|
|
84582
84582
|
|
|
84583
84583
|
// src/hooks/start-work/context-info-builder.ts
|
|
@@ -86791,7 +86791,7 @@ function isPromptConfigRecovered(actualPromptConfig, expectedPromptConfig) {
|
|
|
86791
86791
|
}
|
|
86792
86792
|
|
|
86793
86793
|
// src/hooks/compaction-context-injector/constants.ts
|
|
86794
|
-
var AGENT_RECOVERY_PROMPT = "[
|
|
86794
|
+
var AGENT_RECOVERY_PROMPT = "[compaction \u540E\u6062\u590D checkpointed session agent \u914D\u7F6E]";
|
|
86795
86795
|
var NO_TEXT_TAIL_THRESHOLD = 5;
|
|
86796
86796
|
var RECOVERY_COOLDOWN_MS = 60000;
|
|
86797
86797
|
var RECENT_COMPACTION_WINDOW_MS = 10 * 60 * 1000;
|
|
@@ -87206,23 +87206,23 @@ function isUnstableTask(task) {
|
|
|
87206
87206
|
}
|
|
87207
87207
|
function buildReminder(task, summary, idleMs) {
|
|
87208
87208
|
const idleSeconds = Math.round(idleMs / 1000);
|
|
87209
|
-
const summaryText = summary ?? "
|
|
87210
|
-
return
|
|
87209
|
+
const summaryText = summary ?? "\uFF08\u65E0\u53EF\u7528\u7684 thinking \u75D5\u8FF9\uFF09";
|
|
87210
|
+
return `\u4E0D\u7A33\u5B9A\u7684\u540E\u53F0 agent \u5DF2\u7A7A\u95F2 ${idleSeconds}s\u3002
|
|
87211
87211
|
|
|
87212
|
-
Task ID
|
|
87213
|
-
Description
|
|
87214
|
-
Agent
|
|
87215
|
-
Status
|
|
87216
|
-
Session ID
|
|
87212
|
+
Task ID\uFF1A${task.id}
|
|
87213
|
+
Description\uFF1A${task.description}
|
|
87214
|
+
Agent\uFF1A${task.agent}
|
|
87215
|
+
Status\uFF1A${task.status}
|
|
87216
|
+
Session ID\uFF1A${task.sessionID ?? "N/A"}
|
|
87217
87217
|
|
|
87218
|
-
Thinking
|
|
87218
|
+
Thinking \u6458\u8981\uFF08\u524D ${THINKING_SUMMARY_MAX_CHARS} \u4E2A\u5B57\u7B26\uFF09\uFF1A
|
|
87219
87219
|
${summaryText}
|
|
87220
87220
|
|
|
87221
|
-
|
|
87221
|
+
\u5EFA\u8BAE\u64CD\u4F5C\uFF1A
|
|
87222
87222
|
- background_output task_id="${task.id}" full_session=true include_thinking=true include_tool_results=true message_limit=50
|
|
87223
87223
|
- background_cancel taskId="${task.id}"
|
|
87224
87224
|
|
|
87225
|
-
|
|
87225
|
+
\u8FD9\u4EC5\u4F5C\u4E3A\u63D0\u9192\u3002\u672A\u81EA\u52A8\u91C7\u53D6\u4EFB\u4F55\u64CD\u4F5C\u3002`;
|
|
87226
87226
|
}
|
|
87227
87227
|
|
|
87228
87228
|
// src/hooks/unstable-agent-babysitter/unstable-agent-babysitter-hook.ts
|
|
@@ -87718,34 +87718,34 @@ function createPreemptiveCompactionHook(ctx, pluginConfig, modelCacheState) {
|
|
|
87718
87718
|
}
|
|
87719
87719
|
// src/hooks/tasks-todowrite-disabler/constants.ts
|
|
87720
87720
|
var BLOCKED_TOOLS2 = ["TodoWrite", "TodoRead"];
|
|
87721
|
-
var REPLACEMENT_MESSAGE = `TodoRead/TodoWrite
|
|
87721
|
+
var REPLACEMENT_MESSAGE = `TodoRead/TodoWrite \u5DF2\u7981\u7528\uFF0C\u56E0\u4E3A experimental.task_system \u5DF2\u542F\u7528\u3002
|
|
87722
87722
|
|
|
87723
|
-
|
|
87723
|
+
**\u5FC5\u987B\u6267\u884C\u7684\u64CD\u4F5C**\uFF1A\u7ACB\u5373\u4F7F\u7528 Task \u5DE5\u5177\u91CD\u65B0\u6CE8\u518C\u4F60\u539F\u672C\u8981\u7528 Todo \u5199\u5165\u7684\u5185\u5BB9\u3002\u7136\u540E\u5206\u914D\u7ED9\u81EA\u5DF1\u5E76\u7ACB\u5373\u5F00\u59CB\u5DE5\u4F5C\u3002
|
|
87724
87724
|
|
|
87725
|
-
**
|
|
87726
|
-
- TaskCreate
|
|
87727
|
-
- TaskUpdate
|
|
87728
|
-
- TaskList
|
|
87729
|
-
- TaskGet
|
|
87725
|
+
**\u8BF7\u6539\u7528\u4EE5\u4E0B\u5DE5\u5177\uFF1A**
|
|
87726
|
+
- TaskCreate\uFF1A\u521B\u5EFA\u5E26\u6709\u81EA\u52A8\u751F\u6210 ID \u7684\u65B0\u4EFB\u52A1
|
|
87727
|
+
- TaskUpdate\uFF1A\u66F4\u65B0\u72B6\u6001\u3001\u5206\u914D\u8D1F\u8D23\u4EBA\u3001\u6DFB\u52A0\u4F9D\u8D56
|
|
87728
|
+
- TaskList\uFF1A\u5217\u51FA\u5E26\u6709\u4F9D\u8D56\u4FE1\u606F\u7684\u6240\u6709\u6D3B\u52A8\u4EFB\u52A1
|
|
87729
|
+
- TaskGet\uFF1A\u83B7\u53D6\u4EFB\u52A1\u7684\u5B8C\u6574\u8BE6\u60C5
|
|
87730
87730
|
|
|
87731
|
-
**
|
|
87732
|
-
1. TaskCreate({ subject: "
|
|
87733
|
-
2. TaskUpdate({ id: "T-xxx", status: "in_progress", owner: "
|
|
87734
|
-
3.
|
|
87731
|
+
**\u5DE5\u4F5C\u6D41\u7A0B\uFF1A**
|
|
87732
|
+
1. TaskCreate({ subject: "\u4F60\u7684\u4EFB\u52A1\u63CF\u8FF0" })
|
|
87733
|
+
2. TaskUpdate({ id: "T-xxx", status: "in_progress", owner: "\u4F60\u7684\u7EBF\u7A0B ID" })
|
|
87734
|
+
3. \u6267\u884C\u5DE5\u4F5C
|
|
87735
87735
|
4. TaskUpdate({ id: "T-xxx", status: "completed" })
|
|
87736
87736
|
|
|
87737
|
-
|
|
87737
|
+
\u5173\u952E\u539F\u5219\uFF1A1 \u4E2A\u4EFB\u52A1 = 1 \u4E2A\u4EFB\u52A1\u3002\u72EC\u7ACB\u4EFB\u52A1\u5E76\u53D1\u6267\u884C\u3002
|
|
87738
87738
|
|
|
87739
|
-
**
|
|
87740
|
-
|
|
87741
|
-
1.
|
|
87742
|
-
2.
|
|
87743
|
-
3.
|
|
87744
|
-
4.
|
|
87739
|
+
**\u505C\uFF01\u4E0D\u8981\u76F4\u63A5\u5F00\u59CB\u5DE5\u4F5C\u2014\u2014\u65E0\u8BBA\u4EFB\u52A1\u591A\u5C0F\uFF01**
|
|
87740
|
+
\u5373\u4F7F\u4EFB\u52A1\u770B\u8D77\u6765\u5F88\u7B80\u5355\uFF08\u4E00\u884C\u4FEE\u590D\u3001\u7B80\u5355\u7F16\u8F91\u3001\u5FEB\u901F\u66F4\u6539\uFF09\uFF0C\u4F60\u4E5F\u5FC5\u987B\uFF1A
|
|
87741
|
+
1. \u9996\u5148\u7528 TaskCreate \u6CE8\u518C\u4EFB\u52A1
|
|
87742
|
+
2. \u7136\u540E\u6807\u8BB0\u4E3A in_progress
|
|
87743
|
+
3. \u53EA\u6709\u5728\u8FD9\u4E4B\u540E\u624D\u80FD\u6267\u884C\u5B9E\u9645\u5DE5\u4F5C
|
|
87744
|
+
4. \u6700\u540E\u6807\u8BB0\u4E3A completed
|
|
87745
87745
|
|
|
87746
|
-
|
|
87746
|
+
**\u539F\u56E0\uFF1F**\u4EFB\u52A1\u8DDF\u8E2A = \u53EF\u89C6\u6027 = \u8D23\u4EFB\u5F52\u5C5E\u3002\u8DF3\u8FC7\u6CE8\u518C = \u9690\u5F62\u5DE5\u4F5C = \u6DF7\u4E71\u3002
|
|
87747
87747
|
|
|
87748
|
-
|
|
87748
|
+
\u4E0D\u8981\u91CD\u8BD5 TodoWrite\u3002\u7ACB\u5373\u8F6C\u6362\u4E3A TaskCreate\u3002`;
|
|
87749
87749
|
|
|
87750
87750
|
// src/hooks/tasks-todowrite-disabler/hook.ts
|
|
87751
87751
|
function createTasksTodowriteDisablerHook(config) {
|
|
@@ -88617,8 +88617,8 @@ async function dispatchFallbackRetry(deps, helpers, options) {
|
|
|
88617
88617
|
if (result.success && deps.config.notify_on_fallback) {
|
|
88618
88618
|
await deps.ctx.client.tui.showToast({
|
|
88619
88619
|
body: {
|
|
88620
|
-
title: "
|
|
88621
|
-
message:
|
|
88620
|
+
title: "\u6A21\u578B\u964D\u7EA7",
|
|
88621
|
+
message: `\u6B63\u5728\u5207\u6362\u5230 ${result.newModel?.split("/").pop() || result.newModel} \u4EE5\u5904\u7406\u4E0B\u4E00\u8BF7\u6C42`,
|
|
88622
88622
|
variant: "warning",
|
|
88623
88623
|
duration: 5000
|
|
88624
88624
|
}
|
|
@@ -90506,34 +90506,34 @@ function createReadImageResizerHook(_ctx) {
|
|
|
90506
90506
|
};
|
|
90507
90507
|
}
|
|
90508
90508
|
// src/hooks/todo-description-override/description.ts
|
|
90509
|
-
var TODOWRITE_DESCRIPTION =
|
|
90509
|
+
var TODOWRITE_DESCRIPTION = `\u4F7F\u7528\u6B64\u5DE5\u5177\u521B\u5EFA\u548C\u7BA1\u7406\u7ED3\u6784\u5316\u4EFB\u52A1\u5217\u8868\uFF0C\u4EE5\u8DDF\u8E2A\u591A\u6B65\u9AA4\u5DE5\u4F5C\u7684\u8FDB\u5EA6\u3002
|
|
90510
90510
|
|
|
90511
|
-
## Todo
|
|
90511
|
+
## Todo \u683C\u5F0F\uFF08\u5F3A\u5236\uFF09
|
|
90512
90512
|
|
|
90513
|
-
|
|
90513
|
+
\u6BCF\u4E2A todo \u6807\u9898\u5FC5\u987B\u5305\u542B\u56DB\u4E2A\u8981\u7D20\uFF1A\u4F4D\u7F6E\uFF08WHERE\uFF09\u3001\u539F\u56E0\uFF08WHY\uFF09\u3001\u65B9\u6CD5\uFF08HOW\uFF09\u548C\u9884\u671F\u7ED3\u679C\uFF08EXPECTED RESULT\uFF09\u3002
|
|
90514
90514
|
|
|
90515
|
-
|
|
90515
|
+
\u683C\u5F0F\uFF1A"[\u4F4D\u7F6E] [\u65B9\u6CD5] \u4EE5 [\u539F\u56E0] - \u9884\u671F [\u7ED3\u679C]"
|
|
90516
90516
|
|
|
90517
|
-
|
|
90518
|
-
- "src/utils/validation.ts:
|
|
90519
|
-
- "UserService.create():
|
|
90520
|
-
- "validation.test.ts:
|
|
90517
|
+
\u6B63\u786E\u793A\u4F8B\uFF1A
|
|
90518
|
+
- "src/utils/validation.ts: \u6DFB\u52A0 validateEmail() \u7528\u4E8E\u8F93\u5165\u6E05\u7406 - \u8FD4\u56DE boolean"
|
|
90519
|
+
- "UserService.create(): \u5728 DB \u63D2\u5165\u524D\u8C03\u7528 validateEmail() - \u62D2\u7EDD\u65E0\u6548\u90AE\u4EF6\u5E76\u8FD4\u56DE 400"
|
|
90520
|
+
- "validation.test.ts: \u6DFB\u52A0\u7F3A\u5C11 @ \u7B26\u53F7\u7684\u6D4B\u8BD5 - \u9884\u671F validateEmail('foo') \u8FD4\u56DE false"
|
|
90521
90521
|
|
|
90522
|
-
|
|
90523
|
-
- "
|
|
90524
|
-
- "
|
|
90525
|
-
- "
|
|
90522
|
+
\u9519\u8BEF\u793A\u4F8B\uFF1A
|
|
90523
|
+
- "\u5B9E\u73B0\u90AE\u4EF6\u9A8C\u8BC1"\uFF08\u4F4D\u7F6E\uFF1F\u65B9\u6CD5\uFF1F\u9884\u671F\u7ED3\u679C\uFF1F\uFF09
|
|
90524
|
+
- "\u6DFB\u52A0\u6DF1\u8272\u6A21\u5F0F"\uFF08\u529F\u80FD\uFF0C\u4E0D\u662F todo\uFF09
|
|
90525
|
+
- "\u4FEE\u590D\u8BA4\u8BC1"\uFF08\u54EA\u4E2A\u6587\u4EF6\uFF1F\u4EC0\u4E48\u6539\u52A8\uFF1F\u9884\u671F\u7ED3\u679C\uFF1F\uFF09
|
|
90526
90526
|
|
|
90527
|
-
##
|
|
90527
|
+
## \u7C92\u5EA6\u89C4\u5219
|
|
90528
90528
|
|
|
90529
|
-
|
|
90529
|
+
\u6BCF\u4E2A todo \u5FC5\u987B\u662F\u4E00\u4E2A\u5355\u4E00\u539F\u5B50\u64CD\u4F5C\uFF0C\u53EF\u5728 1-3 \u6B21\u5DE5\u5177\u8C03\u7528\u5185\u5B8C\u6210\u3002\u5982\u679C\u9700\u8981\u66F4\u591A\u8C03\u7528\uFF0C\u8BF7\u62C6\u5206\u3002
|
|
90530
90530
|
|
|
90531
|
-
|
|
90531
|
+
**\u89C4\u6A21\u6D4B\u8BD5**\uFF1A\u4F60\u53EF\u4EE5\u901A\u8FC7\u7F16\u8F91\u4E00\u4E2A\u6587\u4EF6\u6216\u8FD0\u884C\u4E00\u4E2A\u547D\u4EE4\u6765\u5B8C\u6210\u8FD9\u4E2A todo \u5417\uFF1F\u5982\u679C\u4E0D\u80FD\uFF0C\u8BF4\u660E\u5B83\u592A\u5927\u4E86\u3002
|
|
90532
90532
|
|
|
90533
|
-
##
|
|
90534
|
-
-
|
|
90535
|
-
-
|
|
90536
|
-
-
|
|
90533
|
+
## \u4EFB\u52A1\u7BA1\u7406
|
|
90534
|
+
- \u4E00\u6B21\u53EA\u80FD\u6709\u4E00\u4E2A in_progress\u3002\u5B8C\u6210\u540E\u518D\u5F00\u59CB\u4E0B\u4E00\u4E2A\u3002
|
|
90535
|
+
- \u6BCF\u9879\u5B8C\u6210\u540E\u7ACB\u5373\u6807\u8BB0\u4E3A completed\u3002
|
|
90536
|
+
- \u5355\u4E00\u7410\u788E\u4EFB\u52A1\uFF08\u4E00\u6B65\u3001\u660E\u663E\u64CD\u4F5C\uFF09\u8DF3\u8FC7\u6B64\u5DE5\u5177\u3002`;
|
|
90537
90537
|
|
|
90538
90538
|
// src/hooks/todo-description-override/hook.ts
|
|
90539
90539
|
function createTodoDescriptionOverrideHook() {
|
|
@@ -91352,7 +91352,7 @@ function validateCwd(cwd) {
|
|
|
91352
91352
|
}
|
|
91353
91353
|
return { valid: true };
|
|
91354
91354
|
} catch (err) {
|
|
91355
|
-
return { valid: false, error:
|
|
91355
|
+
return { valid: false, error: `\u65E0\u6CD5\u8BBF\u95EE\u5DE5\u4F5C\u76EE\u5F55\uFF1A${cwd}\uFF08${err instanceof Error ? err.message : String(err)}\uFF09` };
|
|
91356
91356
|
}
|
|
91357
91357
|
}
|
|
91358
91358
|
function wrapNodeProcess2(proc) {
|
|
@@ -91517,15 +91517,15 @@ class LSPClientTransport {
|
|
|
91517
91517
|
env
|
|
91518
91518
|
});
|
|
91519
91519
|
if (!this.proc) {
|
|
91520
|
-
throw new Error(
|
|
91520
|
+
throw new Error(`\u542F\u52A8 LSP \u670D\u52A1\u5668\u5931\u8D25\uFF1A${this.server.command.join(" ")}`);
|
|
91521
91521
|
}
|
|
91522
91522
|
this.startStderrReading();
|
|
91523
91523
|
await new Promise((resolve14) => setTimeout(resolve14, 100));
|
|
91524
91524
|
if (this.proc.exitCode !== null) {
|
|
91525
91525
|
const stderr = this.stderrBuffer.join(`
|
|
91526
91526
|
`);
|
|
91527
|
-
throw new Error(`LSP
|
|
91528
|
-
stderr
|
|
91527
|
+
throw new Error(`LSP \u670D\u52A1\u5668\u7ACB\u5373\u9000\u51FA\uFF0C\u9000\u51FA\u7801 ${this.proc.exitCode}` + (stderr ? `
|
|
91528
|
+
stderr\uFF1A${stderr}` : ""));
|
|
91529
91529
|
}
|
|
91530
91530
|
const stdoutReader = this.proc.stdout.getReader();
|
|
91531
91531
|
const nodeReadable = new Readable2({
|
|
@@ -91604,8 +91604,8 @@ stderr: ${stderr}` : ""));
|
|
|
91604
91604
|
if (this.processExited || this.proc && this.proc.exitCode !== null) {
|
|
91605
91605
|
const stderr = this.stderrBuffer.slice(-10).join(`
|
|
91606
91606
|
`);
|
|
91607
|
-
throw new Error(`LSP
|
|
91608
|
-
stderr
|
|
91607
|
+
throw new Error(`LSP \u670D\u52A1\u5668\u5DF2\u9000\u51FA\uFF08\u4EE3\u7801\uFF1A${this.proc?.exitCode}\uFF09` + (stderr ? `
|
|
91608
|
+
stderr\uFF1A${stderr}` : ""));
|
|
91609
91609
|
}
|
|
91610
91610
|
let timeoutId;
|
|
91611
91611
|
const timeoutPromise = new Promise((_, reject) => {
|
|
@@ -92138,24 +92138,24 @@ function formatServerLookupError(result) {
|
|
|
92138
92138
|
if (result.status === "not_installed") {
|
|
92139
92139
|
const { server, installHint } = result;
|
|
92140
92140
|
return [
|
|
92141
|
-
`LSP
|
|
92141
|
+
`LSP \u670D\u52A1\u5668 '${server.id}' \u5DF2\u914D\u7F6E\u4F46\u672A\u5B89\u88C5\u3002`,
|
|
92142
92142
|
``,
|
|
92143
|
-
|
|
92143
|
+
`\u672A\u627E\u5230\u547D\u4EE4\uFF1A${server.command[0]}`,
|
|
92144
92144
|
``,
|
|
92145
92145
|
`To install:`,
|
|
92146
92146
|
` ${installHint}`,
|
|
92147
92147
|
``,
|
|
92148
92148
|
`Supported extensions: ${server.extensions.join(", ")}`,
|
|
92149
92149
|
``,
|
|
92150
|
-
|
|
92150
|
+
`\u5B89\u88C5\u540E\uFF0C\u670D\u52A1\u5668\u5C06\u81EA\u52A8\u53EF\u7528\u3002`,
|
|
92151
92151
|
`Run 'LspServers' tool to verify installation status.`
|
|
92152
92152
|
].join(`
|
|
92153
92153
|
`);
|
|
92154
92154
|
}
|
|
92155
92155
|
return [
|
|
92156
|
-
|
|
92156
|
+
`\u672A\u4E3A\u6269\u5C55\u914D\u7F6E LSP \u670D\u52A1\u5668\uFF1A${result.extension}`,
|
|
92157
92157
|
``,
|
|
92158
|
-
|
|
92158
|
+
`\u53EF\u7528\u670D\u52A1\u5668\uFF1A${result.availableServers.slice(0, 10).join(", ")}${result.availableServers.length > 10 ? "..." : ""}`,
|
|
92159
92159
|
``,
|
|
92160
92160
|
`To add a custom server, configure 'lsp' in ${CONFIG_BASENAME}.json:`,
|
|
92161
92161
|
` {`,
|
|
@@ -92188,7 +92188,7 @@ async function withLspClient(filePath, fn) {
|
|
|
92188
92188
|
if (e instanceof Error && e.message.includes("timeout")) {
|
|
92189
92189
|
const isInitializing = lspManager.isServerInitializing(root, server.id);
|
|
92190
92190
|
if (isInitializing) {
|
|
92191
|
-
throw new Error(`LSP
|
|
92191
|
+
throw new Error(`LSP \u670D\u52A1\u5668\u4ECD\u5728\u521D\u59CB\u5316\u4E2D\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002 ` + `Original error: ${e.message}`);
|
|
92192
92192
|
}
|
|
92193
92193
|
}
|
|
92194
92194
|
throw e;
|
|
@@ -92269,14 +92269,14 @@ function formatPrepareRenameResult(result) {
|
|
|
92269
92269
|
const endLine = result.range.end.line + 1;
|
|
92270
92270
|
const endChar = result.range.end.character;
|
|
92271
92271
|
const placeholder = result.placeholder ? ` (current: "${result.placeholder}")` : "";
|
|
92272
|
-
return
|
|
92272
|
+
return `\u53EF\u5728 ${startLine}:${startChar}-${endLine}:${endChar} \u91CD\u547D\u540D${placeholder}`;
|
|
92273
92273
|
}
|
|
92274
92274
|
if ("start" in result && "end" in result) {
|
|
92275
92275
|
const startLine = result.start.line + 1;
|
|
92276
92276
|
const startChar = result.start.character;
|
|
92277
92277
|
const endLine = result.end.line + 1;
|
|
92278
92278
|
const endChar = result.end.character;
|
|
92279
|
-
return
|
|
92279
|
+
return `\u53EF\u5728 ${startLine}:${startChar}-${endLine}:${endChar} \u91CD\u547D\u540D`;
|
|
92280
92280
|
}
|
|
92281
92281
|
return "Cannot rename at this position";
|
|
92282
92282
|
}
|
|
@@ -92290,7 +92290,7 @@ function formatApplyResult(result) {
|
|
|
92290
92290
|
} else {
|
|
92291
92291
|
lines.push("Failed to apply some changes:");
|
|
92292
92292
|
for (const err of result.errors) {
|
|
92293
|
-
lines.push(`
|
|
92293
|
+
lines.push(` \u9519\u8BEF\uFF1A${err}`);
|
|
92294
92294
|
}
|
|
92295
92295
|
if (result.filesModified.length > 0) {
|
|
92296
92296
|
lines.push(`Successfully modified: ${result.filesModified.join(", ")}`);
|
|
@@ -92435,7 +92435,7 @@ var lsp_goto_definition = tool({
|
|
|
92435
92435
|
`);
|
|
92436
92436
|
return output;
|
|
92437
92437
|
} catch (e) {
|
|
92438
|
-
const output =
|
|
92438
|
+
const output = `\u9519\u8BEF\uFF1A${e instanceof Error ? e.message : String(e)}`;
|
|
92439
92439
|
return output;
|
|
92440
92440
|
}
|
|
92441
92441
|
}
|
|
@@ -92469,7 +92469,7 @@ var lsp_find_references = tool({
|
|
|
92469
92469
|
`);
|
|
92470
92470
|
return output;
|
|
92471
92471
|
} catch (e) {
|
|
92472
|
-
const output =
|
|
92472
|
+
const output = `\u9519\u8BEF\uFF1A${e instanceof Error ? e.message : String(e)}`;
|
|
92473
92473
|
return output;
|
|
92474
92474
|
}
|
|
92475
92475
|
}
|
|
@@ -92488,7 +92488,7 @@ var lsp_symbols = tool({
|
|
|
92488
92488
|
const scope = args.scope ?? "document";
|
|
92489
92489
|
if (scope === "workspace") {
|
|
92490
92490
|
if (!args.query) {
|
|
92491
|
-
return "
|
|
92491
|
+
return "\u9519\u8BEF\uFF1Aworkspace \u8303\u56F4\u9700\u8981 'query' \u53C2\u6570";
|
|
92492
92492
|
}
|
|
92493
92493
|
const result = await withLspClient(args.filePath, async (client) => {
|
|
92494
92494
|
return await client.workspaceSymbols(args.query);
|
|
@@ -92530,7 +92530,7 @@ var lsp_symbols = tool({
|
|
|
92530
92530
|
`);
|
|
92531
92531
|
}
|
|
92532
92532
|
} catch (e) {
|
|
92533
|
-
return
|
|
92533
|
+
return `\u9519\u8BEF\uFF1A${e instanceof Error ? e.message : String(e)}`;
|
|
92534
92534
|
}
|
|
92535
92535
|
}
|
|
92536
92536
|
});
|
|
@@ -92634,7 +92634,7 @@ async function aggregateDiagnosticsForDirectory(directory, extension, severity,
|
|
|
92634
92634
|
`Directory: ${absDir}`,
|
|
92635
92635
|
`Extension: ${extension}`,
|
|
92636
92636
|
`Files scanned: ${filesToProcess.length}${wasCapped ? ` (capped at ${maxFiles})` : ""}`,
|
|
92637
|
-
|
|
92637
|
+
`\u5305\u542B\u9519\u8BEF\u7684\u6587\u4EF6\uFF1A${fileErrors.length} \u4E2A`,
|
|
92638
92638
|
`Total diagnostics: ${allDiagnostics.length}`
|
|
92639
92639
|
];
|
|
92640
92640
|
if (fileErrors.length > 0) {
|
|
@@ -92759,7 +92759,7 @@ var lsp_diagnostics = tool({
|
|
|
92759
92759
|
`);
|
|
92760
92760
|
return output;
|
|
92761
92761
|
} catch (e) {
|
|
92762
|
-
const output =
|
|
92762
|
+
const output = `\u9519\u8BEF\uFF1A${e instanceof Error ? e.message : String(e)}`;
|
|
92763
92763
|
throw new Error(output);
|
|
92764
92764
|
}
|
|
92765
92765
|
}
|
|
@@ -92780,7 +92780,7 @@ var lsp_prepare_rename = tool({
|
|
|
92780
92780
|
const output = formatPrepareRenameResult(result);
|
|
92781
92781
|
return output;
|
|
92782
92782
|
} catch (e) {
|
|
92783
|
-
const output =
|
|
92783
|
+
const output = `\u9519\u8BEF\uFF1A${e instanceof Error ? e.message : String(e)}`;
|
|
92784
92784
|
return output;
|
|
92785
92785
|
}
|
|
92786
92786
|
}
|
|
@@ -92802,7 +92802,7 @@ var lsp_rename = tool({
|
|
|
92802
92802
|
const output = formatApplyResult(result);
|
|
92803
92803
|
return output;
|
|
92804
92804
|
} catch (e) {
|
|
92805
|
-
const output =
|
|
92805
|
+
const output = `\u9519\u8BEF\uFF1A${e instanceof Error ? e.message : String(e)}`;
|
|
92806
92806
|
return output;
|
|
92807
92807
|
}
|
|
92808
92808
|
}
|
|
@@ -92914,7 +92914,7 @@ async function downloadAstGrep(version = DEFAULT_VERSION) {
|
|
|
92914
92914
|
log(`[${PUBLISHED_PACKAGE_NAME}] ast-grep binary ready.`);
|
|
92915
92915
|
return binaryPath;
|
|
92916
92916
|
} catch (err) {
|
|
92917
|
-
log(`[${PUBLISHED_PACKAGE_NAME}]
|
|
92917
|
+
log(`[${PUBLISHED_PACKAGE_NAME}] \u4E0B\u8F7D ast-grep \u5931\u8D25\uFF1A${err instanceof Error ? err.message : err}`);
|
|
92918
92918
|
return null;
|
|
92919
92919
|
}
|
|
92920
92920
|
}
|
|
@@ -93040,7 +93040,7 @@ async function collectProcessOutputWithTimeout(process3, timeoutMs) {
|
|
|
93040
93040
|
const timeoutPromise = new Promise((_, reject) => {
|
|
93041
93041
|
const timeoutId = setTimeout(() => {
|
|
93042
93042
|
process3.kill();
|
|
93043
|
-
reject(new Error(
|
|
93043
|
+
reject(new Error(`\u641C\u7D22\u8D85\u65F6 ${timeoutMs}ms`));
|
|
93044
93044
|
}, timeoutMs);
|
|
93045
93045
|
process3.exited.then(() => clearTimeout(timeoutId));
|
|
93046
93046
|
});
|
|
@@ -93173,7 +93173,7 @@ async function runSg(options) {
|
|
|
93173
93173
|
truncated: false,
|
|
93174
93174
|
error: `ast-grep CLI binary not found.
|
|
93175
93175
|
|
|
93176
|
-
` +
|
|
93176
|
+
` + `\u81EA\u52A8\u4E0B\u8F7D\u5931\u8D25\u3002\u624B\u52A8\u5B89\u88C5\u9009\u9879\uFF1A
|
|
93177
93177
|
` + ` bun add -D @ast-grep/cli
|
|
93178
93178
|
` + ` cargo install ast-grep --locked
|
|
93179
93179
|
` + ` brew install ast-grep`
|
|
@@ -93208,11 +93208,11 @@ async function runSg(options) {
|
|
|
93208
93208
|
const writeOutput = await collectProcessOutputWithTimeout(writeProc, timeout);
|
|
93209
93209
|
if (writeOutput.exitCode !== 0) {
|
|
93210
93210
|
const errorDetail = writeOutput.stderr.trim() || `ast-grep exited with code ${writeOutput.exitCode}`;
|
|
93211
|
-
return { ...jsonResult, error:
|
|
93211
|
+
return { ...jsonResult, error: `\u66FF\u6362\u5931\u8D25\uFF1A${errorDetail}` };
|
|
93212
93212
|
}
|
|
93213
93213
|
} catch (error) {
|
|
93214
93214
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
93215
|
-
return { ...jsonResult, error:
|
|
93215
|
+
return { ...jsonResult, error: `\u66FF\u6362\u5931\u8D25\uFF1A${errorMessage}` };
|
|
93216
93216
|
}
|
|
93217
93217
|
}
|
|
93218
93218
|
return jsonResult;
|
|
@@ -93221,18 +93221,18 @@ async function runSg(options) {
|
|
|
93221
93221
|
// src/tools/ast-grep/result-formatter.ts
|
|
93222
93222
|
function formatSearchResult(result) {
|
|
93223
93223
|
if (result.error) {
|
|
93224
|
-
return
|
|
93224
|
+
return `\u9519\u8BEF\uFF1A${result.error}`;
|
|
93225
93225
|
}
|
|
93226
93226
|
if (result.matches.length === 0) {
|
|
93227
|
-
return "
|
|
93227
|
+
return "\u672A\u627E\u5230\u5339\u914D\u9879";
|
|
93228
93228
|
}
|
|
93229
93229
|
const lines = [];
|
|
93230
93230
|
if (result.truncated) {
|
|
93231
|
-
const reason = result.truncatedReason === "max_matches" ?
|
|
93232
|
-
lines.push(`[
|
|
93231
|
+
const reason = result.truncatedReason === "max_matches" ? `\u663E\u793A\u524D ${result.matches.length} \u4E2A\uFF0C\u5171 ${result.totalMatches} \u4E2A` : result.truncatedReason === "max_output_bytes" ? "\u8F93\u51FA\u8D85\u8FC7 1MB \u9650\u5236" : "\u641C\u7D22\u8D85\u65F6";
|
|
93232
|
+
lines.push(`[\u5DF2\u622A\u65AD] \u7ED3\u679C\u5DF2\u622A\u65AD\uFF08${reason}\uFF09
|
|
93233
93233
|
`);
|
|
93234
93234
|
}
|
|
93235
|
-
lines.push(
|
|
93235
|
+
lines.push(`\u627E\u5230 ${result.matches.length} \u4E2A\u5339\u914D\u9879${result.truncated ? `\uFF08\u4ECE ${result.totalMatches} \u5904\u622A\u65AD\uFF09` : ""}\uFF1A
|
|
93236
93236
|
`);
|
|
93237
93237
|
for (const match of result.matches) {
|
|
93238
93238
|
const loc = `${match.file}:${match.range.start.line + 1}:${match.range.start.column + 1}`;
|
|
@@ -93245,19 +93245,19 @@ function formatSearchResult(result) {
|
|
|
93245
93245
|
}
|
|
93246
93246
|
function formatReplaceResult(result, isDryRun) {
|
|
93247
93247
|
if (result.error) {
|
|
93248
|
-
return
|
|
93248
|
+
return `\u9519\u8BEF\uFF1A${result.error}`;
|
|
93249
93249
|
}
|
|
93250
93250
|
if (result.matches.length === 0) {
|
|
93251
|
-
return "
|
|
93251
|
+
return "\u672A\u627E\u5230\u53EF\u66FF\u6362\u7684\u5339\u914D\u9879";
|
|
93252
93252
|
}
|
|
93253
|
-
const prefix = isDryRun ? "[
|
|
93253
|
+
const prefix = isDryRun ? "[\u9884\u6F14] " : "";
|
|
93254
93254
|
const lines = [];
|
|
93255
93255
|
if (result.truncated) {
|
|
93256
|
-
const reason = result.truncatedReason === "max_matches" ?
|
|
93257
|
-
lines.push(`[
|
|
93256
|
+
const reason = result.truncatedReason === "max_matches" ? `\u663E\u793A\u524D ${result.matches.length} \u4E2A\uFF0C\u5171 ${result.totalMatches} \u4E2A` : result.truncatedReason === "max_output_bytes" ? "\u8F93\u51FA\u8D85\u8FC7 1MB \u9650\u5236" : "\u641C\u7D22\u8D85\u65F6";
|
|
93257
|
+
lines.push(`[\u5DF2\u622A\u65AD] \u7ED3\u679C\u5DF2\u622A\u65AD\uFF08${reason}\uFF09
|
|
93258
93258
|
`);
|
|
93259
93259
|
}
|
|
93260
|
-
lines.push(`${prefix}${result.matches.length}
|
|
93260
|
+
lines.push(`${prefix}${result.matches.length} \u4E2A\u66FF\u6362\u9879\uFF1A
|
|
93261
93261
|
`);
|
|
93262
93262
|
for (const match of result.matches) {
|
|
93263
93263
|
const loc = `${match.file}:${match.range.start.line + 1}:${match.range.start.column + 1}`;
|
|
@@ -93266,7 +93266,7 @@ function formatReplaceResult(result, isDryRun) {
|
|
|
93266
93266
|
lines.push("");
|
|
93267
93267
|
}
|
|
93268
93268
|
if (isDryRun) {
|
|
93269
|
-
lines.push("
|
|
93269
|
+
lines.push("\u4F7F\u7528 dryRun=false \u6765\u5E94\u7528\u66F4\u6539");
|
|
93270
93270
|
}
|
|
93271
93271
|
return lines.join(`
|
|
93272
93272
|
`);
|
|
@@ -93327,7 +93327,7 @@ ${hint}`;
|
|
|
93327
93327
|
await showOutputToUser(context, output);
|
|
93328
93328
|
return output;
|
|
93329
93329
|
} catch (e) {
|
|
93330
|
-
const output =
|
|
93330
|
+
const output = `\u9519\u8BEF\uFF1A${e instanceof Error ? e.message : String(e)}`;
|
|
93331
93331
|
await showOutputToUser(context, output);
|
|
93332
93332
|
return output;
|
|
93333
93333
|
}
|
|
@@ -93357,7 +93357,7 @@ ${hint}`;
|
|
|
93357
93357
|
await showOutputToUser(context, output);
|
|
93358
93358
|
return output;
|
|
93359
93359
|
} catch (e) {
|
|
93360
|
-
const output =
|
|
93360
|
+
const output = `\u9519\u8BEF\uFF1A${e instanceof Error ? e.message : String(e)}`;
|
|
93361
93361
|
await showOutputToUser(context, output);
|
|
93362
93362
|
return output;
|
|
93363
93363
|
}
|
|
@@ -93751,7 +93751,7 @@ async function runRgInternal(options, resolvedCli) {
|
|
|
93751
93751
|
const timeoutPromise = new Promise((_, reject) => {
|
|
93752
93752
|
const id = setTimeout(() => {
|
|
93753
93753
|
proc.kill();
|
|
93754
|
-
reject(new Error(
|
|
93754
|
+
reject(new Error(`\u641C\u7D22\u8D85\u65F6 ${timeout}ms`));
|
|
93755
93755
|
}, timeout);
|
|
93756
93756
|
proc.exited.then(() => clearTimeout(id));
|
|
93757
93757
|
});
|
|
@@ -93815,7 +93815,7 @@ async function runRgCountInternal(options, resolvedCli) {
|
|
|
93815
93815
|
const timeoutPromise = new Promise((_, reject) => {
|
|
93816
93816
|
const id = setTimeout(() => {
|
|
93817
93817
|
proc.kill();
|
|
93818
|
-
reject(new Error(
|
|
93818
|
+
reject(new Error(`\u641C\u7D22\u8D85\u65F6 ${timeout}ms`));
|
|
93819
93819
|
}, timeout);
|
|
93820
93820
|
proc.exited.then(() => clearTimeout(id));
|
|
93821
93821
|
});
|
|
@@ -93823,7 +93823,7 @@ async function runRgCountInternal(options, resolvedCli) {
|
|
|
93823
93823
|
const stdout = await Promise.race([new Response(proc.stdout).text(), timeoutPromise]);
|
|
93824
93824
|
return parseCountOutput(stdout);
|
|
93825
93825
|
} catch (e) {
|
|
93826
|
-
throw new Error(
|
|
93826
|
+
throw new Error(`\u8BA1\u6570\u641C\u7D22\u5931\u8D25\uFF1A${e instanceof Error ? e.message : String(e)}`);
|
|
93827
93827
|
}
|
|
93828
93828
|
}
|
|
93829
93829
|
|
|
@@ -93833,13 +93833,13 @@ function formatGrepResult(result) {
|
|
|
93833
93833
|
return `Error: ${result.error}`;
|
|
93834
93834
|
}
|
|
93835
93835
|
if (result.matches.length === 0) {
|
|
93836
|
-
return "
|
|
93836
|
+
return "\u672A\u627E\u5230\u5339\u914D\u9879";
|
|
93837
93837
|
}
|
|
93838
93838
|
const lines = [];
|
|
93839
93839
|
const isFilesOnlyMode = result.matches.every((match) => match.line === 0 && match.text.trim() === "");
|
|
93840
|
-
lines.push(
|
|
93840
|
+
lines.push(`\u5728 ${result.filesSearched} \u4E2A\u6587\u4EF6\u4E2D\u627E\u5230 ${result.totalMatches} \u4E2A\u5339\u914D\u9879`);
|
|
93841
93841
|
if (result.truncated) {
|
|
93842
|
-
lines.push("[
|
|
93842
|
+
lines.push("[\u8F93\u51FA\u56E0\u5927\u5C0F\u9650\u5236\u88AB\u622A\u65AD]");
|
|
93843
93843
|
}
|
|
93844
93844
|
lines.push("");
|
|
93845
93845
|
const byFile = new Map;
|
|
@@ -93866,10 +93866,10 @@ function formatGrepResult(result) {
|
|
|
93866
93866
|
}
|
|
93867
93867
|
function formatCountResult(results) {
|
|
93868
93868
|
if (results.length === 0) {
|
|
93869
|
-
return "
|
|
93869
|
+
return "\u672A\u627E\u5230\u5339\u914D\u9879";
|
|
93870
93870
|
}
|
|
93871
93871
|
const total = results.reduce((sum, r) => sum + r.count, 0);
|
|
93872
|
-
const lines = [
|
|
93872
|
+
const lines = [`\u5728 ${results.length} \u4E2A\u6587\u4EF6\u4E2D\u627E\u5230 ${total} \u4E2A\u5339\u914D\u9879\uFF1A`, ""];
|
|
93873
93873
|
const sorted = [...results].sort((a, b) => b.count - a.count);
|
|
93874
93874
|
for (const { file, count } of sorted) {
|
|
93875
93875
|
lines.push(` ${count.toString().padStart(6)}: ${file}`);
|
|
@@ -93918,7 +93918,7 @@ function createGrepTools(ctx) {
|
|
|
93918
93918
|
}, cli);
|
|
93919
93919
|
return formatGrepResult(result);
|
|
93920
93920
|
} catch (e) {
|
|
93921
|
-
return
|
|
93921
|
+
return `\u9519\u8BEF\uFF1A${e instanceof Error ? e.message : String(e)}`;
|
|
93922
93922
|
}
|
|
93923
93923
|
}
|
|
93924
93924
|
});
|
|
@@ -94033,7 +94033,7 @@ async function runRgFilesInternal(options, resolvedCli) {
|
|
|
94033
94033
|
const timeoutPromise = new Promise((_, reject) => {
|
|
94034
94034
|
const id = setTimeout(() => {
|
|
94035
94035
|
proc.kill();
|
|
94036
|
-
reject(new Error(`Glob
|
|
94036
|
+
reject(new Error(`Glob \u641C\u7D22\u8D85\u65F6 ${timeout}ms`));
|
|
94037
94037
|
}, timeout);
|
|
94038
94038
|
proc.exited.then(() => clearTimeout(id));
|
|
94039
94039
|
});
|
|
@@ -94090,7 +94090,7 @@ async function runRgFilesInternal(options, resolvedCli) {
|
|
|
94090
94090
|
// src/tools/glob/result-formatter.ts
|
|
94091
94091
|
function formatGlobResult(result) {
|
|
94092
94092
|
if (result.error) {
|
|
94093
|
-
return
|
|
94093
|
+
return `\u9519\u8BEF\uFF1A${result.error}`;
|
|
94094
94094
|
}
|
|
94095
94095
|
if (result.files.length === 0) {
|
|
94096
94096
|
return "No files found";
|
|
@@ -94129,23 +94129,23 @@ function createGlobTools(ctx) {
|
|
|
94129
94129
|
}, cli);
|
|
94130
94130
|
return formatGlobResult(result);
|
|
94131
94131
|
} catch (e) {
|
|
94132
|
-
return
|
|
94132
|
+
return `\u9519\u8BEF\uFF1A${e instanceof Error ? e.message : String(e)}`;
|
|
94133
94133
|
}
|
|
94134
94134
|
}
|
|
94135
94135
|
});
|
|
94136
94136
|
return { glob };
|
|
94137
94137
|
}
|
|
94138
94138
|
// src/tools/skill/constants.ts
|
|
94139
|
-
var TOOL_DESCRIPTION_NO_SKILLS = "
|
|
94140
|
-
var TOOL_DESCRIPTION_PREFIX =
|
|
94139
|
+
var TOOL_DESCRIPTION_NO_SKILLS = "\u52A0\u8F7D\u4E00\u4E2A Skill \u6216\u6267\u884C\u4E00\u4E2A\u659C\u6760\u547D\u4EE4\u6765\u83B7\u53D6\u7279\u5B9A\u4EFB\u52A1\u7684\u8BE6\u7EC6\u8BF4\u660E\u3002\u5F53\u524D\u6CA1\u6709\u53EF\u7528\u7684 Skills\u3002";
|
|
94140
|
+
var TOOL_DESCRIPTION_PREFIX = `\u52A0\u8F7D\u4E00\u4E2A Skill \u6216\u6267\u884C\u4E00\u4E2A\u659C\u6760\u547D\u4EE4\u6765\u83B7\u53D6\u7279\u5B9A\u4EFB\u52A1\u7684\u8BE6\u7EC6\u8BF4\u660E\u3002
|
|
94141
94141
|
|
|
94142
|
-
Skills
|
|
94143
|
-
|
|
94142
|
+
Skills \u548C Commands \u63D0\u4F9B\u4E13\u4E1A\u77E5\u8BC6\u548C\u5206\u6B65\u9AA4\u6307\u5BFC\u3002
|
|
94143
|
+
\u5F53\u4EFB\u52A1\u4E0E\u67D0\u4E2A\u53EF\u7528\u7684 Skill \u6216 Command \u7684\u63CF\u8FF0\u5339\u914D\u65F6\u4F7F\u7528\u6B64\u5DE5\u5177\u3002
|
|
94144
94144
|
|
|
94145
|
-
**
|
|
94146
|
-
-
|
|
94147
|
-
-
|
|
94148
|
-
-
|
|
94145
|
+
**\u4F7F\u7528\u65B9\u6CD5\uFF1A**
|
|
94146
|
+
- \u901A\u8FC7 Skill \u540D\u79F0\u8C03\u7528\uFF1Aname='review-work'
|
|
94147
|
+
- \u901A\u8FC7 Command \u540D\u79F0\u8C03\u7528\uFF08\u4E0D\u5E26\u524D\u5BFC\u659C\u6760\uFF09\uFF1Aname='publish'
|
|
94148
|
+
- \u8BE5\u5DE5\u5177\u5C06\u8FD4\u56DE\u5E26\u6709\u4F60\u4E0A\u4E0B\u6587\u7684\u8BE6\u7EC6\u8BF4\u660E\u3002
|
|
94149
94149
|
`;
|
|
94150
94150
|
// src/tools/skill/tools.ts
|
|
94151
94151
|
import { dirname as dirname27 } from "path";
|
|
@@ -94183,7 +94183,7 @@ async function formatLoadedCommand(command, userMessage) {
|
|
|
94183
94183
|
`);
|
|
94184
94184
|
sections.push(`---
|
|
94185
94185
|
`);
|
|
94186
|
-
sections.push(`##
|
|
94186
|
+
sections.push(`## \u547D\u4EE4\u8BF4\u660E
|
|
94187
94187
|
`);
|
|
94188
94188
|
let content = command.content || "";
|
|
94189
94189
|
if (!content && command.lazyContentLoader) {
|
|
@@ -94239,7 +94239,7 @@ function formatSlashCommand(command) {
|
|
|
94239
94239
|
const lines = [
|
|
94240
94240
|
" <command>",
|
|
94241
94241
|
` <name>/${command.name}</name>`,
|
|
94242
|
-
` <description>${command.metadata.description || "
|
|
94242
|
+
` <description>${command.metadata.description || "\uFF08\u65E0\u63CF\u8FF0\uFF09"}</description>`,
|
|
94243
94243
|
` <scope>${command.scope}</scope>`
|
|
94244
94244
|
];
|
|
94245
94245
|
if (argumentHint) {
|
|
@@ -94262,8 +94262,8 @@ function formatCombinedDescription(skills2, commands3) {
|
|
|
94262
94262
|
}
|
|
94263
94263
|
return `${TOOL_DESCRIPTION_PREFIX}
|
|
94264
94264
|
<available_items>
|
|
94265
|
-
|
|
94266
|
-
|
|
94265
|
+
\u4F18\u5148\u7EA7\uFF1Aproject > user > opencode > builtin/plugin | Skills \u4F18\u5148\u4E8E Commands
|
|
94266
|
+
\u8C03\u7528\u65B9\u5F0F\uFF1Askill(name="item-name") - Commands \u4E0D\u5E26\u524D\u5BFC\u659C\u6760\u3002
|
|
94267
94267
|
${availableItems.join(`
|
|
94268
94268
|
`)}
|
|
94269
94269
|
</available_items>`;
|
|
@@ -94324,7 +94324,7 @@ async function formatMcpCapabilities(skill, manager, sessionID) {
|
|
|
94324
94324
|
if (!skill.mcpConfig || Object.keys(skill.mcpConfig).length === 0) {
|
|
94325
94325
|
return null;
|
|
94326
94326
|
}
|
|
94327
|
-
const sections = ["", "##
|
|
94327
|
+
const sections = ["", "## \u53EF\u7528\u7684 MCP \u670D\u52A1\u5668", ""];
|
|
94328
94328
|
for (const [serverName, config2] of Object.entries(skill.mcpConfig)) {
|
|
94329
94329
|
const info = {
|
|
94330
94330
|
serverName,
|
|
@@ -94347,14 +94347,14 @@ async function formatMcpCapabilities(skill, manager, sessionID) {
|
|
|
94347
94347
|
appendResourceSection(sections, resources);
|
|
94348
94348
|
appendPromptSection(sections, prompts);
|
|
94349
94349
|
if (tools.length === 0 && resources.length === 0 && prompts.length === 0) {
|
|
94350
|
-
sections.push("*
|
|
94350
|
+
sections.push("*\u672A\u53D1\u73B0\u4EFB\u4F55\u80FD\u529B*");
|
|
94351
94351
|
}
|
|
94352
94352
|
} catch (error) {
|
|
94353
94353
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
94354
|
-
sections.push(
|
|
94354
|
+
sections.push(`*\u8FDE\u63A5\u5931\u8D25\uFF1A${errorMessage.split(`
|
|
94355
94355
|
`)[0]}*`);
|
|
94356
94356
|
}
|
|
94357
|
-
sections.push("",
|
|
94357
|
+
sections.push("", `\u4F7F\u7528 \`skill_mcp\` \u5DE5\u5177\u5E76\u8BBE\u7F6E \`mcp_name="${serverName}"\` \u6765\u8C03\u7528\u3002`, "");
|
|
94358
94358
|
}
|
|
94359
94359
|
return sections.join(`
|
|
94360
94360
|
`);
|
|
@@ -94363,7 +94363,7 @@ function appendToolSections(sections, tools) {
|
|
|
94363
94363
|
if (tools.length === 0) {
|
|
94364
94364
|
return;
|
|
94365
94365
|
}
|
|
94366
|
-
sections.push("
|
|
94366
|
+
sections.push("**\u5DE5\u5177:**", "");
|
|
94367
94367
|
for (const toolDefinition of tools) {
|
|
94368
94368
|
sections.push(`#### \`${toolDefinition.name}\``);
|
|
94369
94369
|
if (toolDefinition.description) {
|
|
@@ -94376,13 +94376,13 @@ function appendResourceSection(sections, resources) {
|
|
|
94376
94376
|
if (resources.length === 0) {
|
|
94377
94377
|
return;
|
|
94378
94378
|
}
|
|
94379
|
-
sections.push(
|
|
94379
|
+
sections.push(`**\u8D44\u6E90:** ${resources.map((resource) => resource.uri).join(", ")}`);
|
|
94380
94380
|
}
|
|
94381
94381
|
function appendPromptSection(sections, prompts) {
|
|
94382
94382
|
if (prompts.length === 0) {
|
|
94383
94383
|
return;
|
|
94384
94384
|
}
|
|
94385
|
-
sections.push(
|
|
94385
|
+
sections.push(`**\u63D0\u793A:** ${prompts.map((prompt) => prompt.name).join(", ")}`);
|
|
94386
94386
|
}
|
|
94387
94387
|
|
|
94388
94388
|
// src/tools/skill/skill-matcher.ts
|
|
@@ -94553,8 +94553,8 @@ function createSkillTool(options = {}) {
|
|
|
94553
94553
|
return cachedDescription ?? TOOL_DESCRIPTION_PREFIX;
|
|
94554
94554
|
},
|
|
94555
94555
|
args: {
|
|
94556
|
-
name: tool.schema.string().describe("
|
|
94557
|
-
user_message: tool.schema.string().optional().describe("
|
|
94556
|
+
name: tool.schema.string().describe("Skill \u6216 Command \u7684\u540D\u79F0\uFF08\u4F8B\u5982 'review-work' \u6216 'publish'\uFF09\u3002Commands \u4E0D\u5E26\u524D\u5BFC\u659C\u6760\u3002"),
|
|
94557
|
+
user_message: tool.schema.string().optional().describe("Command \u8C03\u7528\u65F6\u7684\u53EF\u9009\u53C2\u6570\u6216\u4E0A\u4E0B\u6587\u3002\u793A\u4F8B\uFF1Aname='publish', user_message='patch'")
|
|
94558
94558
|
},
|
|
94559
94559
|
async execute(args, ctx) {
|
|
94560
94560
|
const skills2 = await getSkills();
|
|
@@ -94572,7 +94572,7 @@ function createSkillTool(options = {}) {
|
|
|
94572
94572
|
}
|
|
94573
94573
|
});
|
|
94574
94574
|
if (matchedSkill.definition.agent && (!ctx?.agent || matchedSkill.definition.agent !== ctx.agent)) {
|
|
94575
|
-
throw new Error(`Skill "${matchedSkill.name}"
|
|
94575
|
+
throw new Error(`Skill "${matchedSkill.name}" \u4EC5\u9650 Agent "${matchedSkill.definition.agent}" \u4F7F\u7528`);
|
|
94576
94576
|
}
|
|
94577
94577
|
let body = await extractSkillBody(matchedSkill);
|
|
94578
94578
|
if (matchedSkill.name === "git-master") {
|
|
@@ -94580,9 +94580,9 @@ function createSkillTool(options = {}) {
|
|
|
94580
94580
|
}
|
|
94581
94581
|
const dir = matchedSkill.path ? dirname27(matchedSkill.path) : matchedSkill.resolvedPath || process.cwd();
|
|
94582
94582
|
const output = [
|
|
94583
|
-
`## Skill
|
|
94583
|
+
`## Skill\uFF1A${matchedSkill.name}`,
|
|
94584
94584
|
"",
|
|
94585
|
-
|
|
94585
|
+
`**\u57FA\u7840\u76EE\u5F55**\uFF1A${dir}`,
|
|
94586
94586
|
"",
|
|
94587
94587
|
body
|
|
94588
94588
|
];
|
|
@@ -94606,13 +94606,13 @@ function createSkillTool(options = {}) {
|
|
|
94606
94606
|
}
|
|
94607
94607
|
const partialMatches = findPartialMatches(skills2, commands3, requestedName);
|
|
94608
94608
|
if (partialMatches.length > 0) {
|
|
94609
|
-
throw new Error(
|
|
94609
|
+
throw new Error(`\u672A\u627E\u5230 Skill \u6216 Command "${args.name}"\u3002\u4F60\u662F\u5728\u627E\uFF1A${partialMatches.join(", ")} \u5417\uFF1F`);
|
|
94610
94610
|
}
|
|
94611
94611
|
const available = [
|
|
94612
94612
|
...skills2.map((skill) => skill.name),
|
|
94613
94613
|
...commands3.map((command) => `/${command.name}`)
|
|
94614
94614
|
].join(", ");
|
|
94615
|
-
throw new Error(
|
|
94615
|
+
throw new Error(`\u672A\u627E\u5230 Skill \u6216 Command "${args.name}"\u3002\u53EF\u7528\u9879\uFF1A${available || "\u65E0"}`);
|
|
94616
94616
|
}
|
|
94617
94617
|
});
|
|
94618
94618
|
}
|
|
@@ -95145,11 +95145,11 @@ async function getSessionInfo(sessionID) {
|
|
|
95145
95145
|
// src/tools/session-manager/session-formatter.ts
|
|
95146
95146
|
async function formatSessionList(sessionIDs) {
|
|
95147
95147
|
if (sessionIDs.length === 0) {
|
|
95148
|
-
return "
|
|
95148
|
+
return "\u672A\u627E\u5230\u4F1A\u8BDD\u3002";
|
|
95149
95149
|
}
|
|
95150
95150
|
const infos = (await Promise.all(sessionIDs.map((id) => getSessionInfo(id)))).filter((info) => info !== null);
|
|
95151
95151
|
if (infos.length === 0) {
|
|
95152
|
-
return "
|
|
95152
|
+
return "\u672A\u627E\u5230\u6709\u6548\u7684\u4F1A\u8BDD\u3002";
|
|
95153
95153
|
}
|
|
95154
95154
|
const headers = ["Session ID", "Messages", "First", "Last", "Agents"];
|
|
95155
95155
|
const rows = infos.map((info) => [
|
|
@@ -95169,11 +95169,11 @@ async function formatSessionList(sessionIDs) {
|
|
|
95169
95169
|
}
|
|
95170
95170
|
function formatSessionMessages(messages, includeTodos, todos) {
|
|
95171
95171
|
if (messages.length === 0) {
|
|
95172
|
-
return "
|
|
95172
|
+
return "\u6B64\u4F1A\u8BDD\u4E2D\u672A\u627E\u5230\u6D88\u606F\u3002";
|
|
95173
95173
|
}
|
|
95174
95174
|
const lines = [];
|
|
95175
95175
|
for (const msg of messages) {
|
|
95176
|
-
const timestamp2 = msg.time?.created ? new Date(msg.time.created).toISOString() : "
|
|
95176
|
+
const timestamp2 = msg.time?.created ? new Date(msg.time.created).toISOString() : "\u672A\u77E5\u65F6\u95F4";
|
|
95177
95177
|
const agent = msg.agent ? ` (${msg.agent})` : "";
|
|
95178
95178
|
lines.push(`
|
|
95179
95179
|
[${msg.role}${agent}] ${timestamp2}`);
|
|
@@ -95194,7 +95194,7 @@ function formatSessionMessages(messages, includeTodos, todos) {
|
|
|
95194
95194
|
if (includeTodos && todos && todos.length > 0) {
|
|
95195
95195
|
lines.push(`
|
|
95196
95196
|
|
|
95197
|
-
===
|
|
95197
|
+
=== \u5F85\u529E\u4E8B\u9879 ===`);
|
|
95198
95198
|
for (const todo of todos) {
|
|
95199
95199
|
const status = todo.status === "completed" ? "[x]" : todo.status === "in_progress" ? "[-]" : "[ ]";
|
|
95200
95200
|
lines.push(`${status} [${todo.status}] ${todo.content}`);
|
|
@@ -95225,15 +95225,15 @@ function formatSessionInfo(info) {
|
|
|
95225
95225
|
}
|
|
95226
95226
|
function formatSearchResults(results) {
|
|
95227
95227
|
if (results.length === 0) {
|
|
95228
|
-
return "
|
|
95228
|
+
return "\u672A\u627E\u5230\u5339\u914D\u9879\u3002";
|
|
95229
95229
|
}
|
|
95230
|
-
const lines = [
|
|
95230
|
+
const lines = [`\u627E\u5230 ${results.length} \u4E2A\u5339\u914D\u9879\uFF1A
|
|
95231
95231
|
`];
|
|
95232
95232
|
for (const result of results) {
|
|
95233
95233
|
const timestamp2 = result.timestamp ? new Date(result.timestamp).toISOString() : "";
|
|
95234
95234
|
lines.push(`[${result.session_id}] ${result.message_id} (${result.role}) ${timestamp2}`);
|
|
95235
95235
|
lines.push(` ${result.excerpt}`);
|
|
95236
|
-
lines.push(`
|
|
95236
|
+
lines.push(` \u5339\u914D\u6570\uFF1A${result.match_count}
|
|
95237
95237
|
`);
|
|
95238
95238
|
}
|
|
95239
95239
|
return lines.join(`
|
|
@@ -95351,7 +95351,7 @@ function createSessionManagerTools(ctx, deps = {}) {
|
|
|
95351
95351
|
}
|
|
95352
95352
|
return await resolvedDeps.formatSessionList(sessionIDs);
|
|
95353
95353
|
} catch (e) {
|
|
95354
|
-
return
|
|
95354
|
+
return `\u9519\u8BEF\uFF1A${e instanceof Error ? e.message : String(e)}`;
|
|
95355
95355
|
}
|
|
95356
95356
|
}
|
|
95357
95357
|
});
|
|
@@ -95366,11 +95366,11 @@ function createSessionManagerTools(ctx, deps = {}) {
|
|
|
95366
95366
|
execute: async (args, _context) => {
|
|
95367
95367
|
try {
|
|
95368
95368
|
if (!await resolvedDeps.sessionExists(args.session_id)) {
|
|
95369
|
-
return
|
|
95369
|
+
return `\u672A\u627E\u5230 Session\uFF1A${args.session_id}`;
|
|
95370
95370
|
}
|
|
95371
95371
|
let messages = await resolvedDeps.readSessionMessages(args.session_id);
|
|
95372
95372
|
if (messages.length === 0) {
|
|
95373
|
-
return
|
|
95373
|
+
return `\u672A\u627E\u5230 Session\uFF1A${args.session_id}`;
|
|
95374
95374
|
}
|
|
95375
95375
|
if (args.limit && args.limit > 0) {
|
|
95376
95376
|
messages = messages.slice(0, args.limit);
|
|
@@ -95378,7 +95378,7 @@ function createSessionManagerTools(ctx, deps = {}) {
|
|
|
95378
95378
|
const todos = args.include_todos ? await resolvedDeps.readSessionTodos(args.session_id) : undefined;
|
|
95379
95379
|
return resolvedDeps.formatSessionMessages(messages, args.include_todos, todos);
|
|
95380
95380
|
} catch (e) {
|
|
95381
|
-
return
|
|
95381
|
+
return `\u9519\u8BEF\uFF1A${e instanceof Error ? e.message : String(e)}`;
|
|
95382
95382
|
}
|
|
95383
95383
|
}
|
|
95384
95384
|
});
|
|
@@ -95412,7 +95412,7 @@ function createSessionManagerTools(ctx, deps = {}) {
|
|
|
95412
95412
|
const results = await withTimeout4(searchOperation(), SEARCH_TIMEOUT_MS, "Search");
|
|
95413
95413
|
return resolvedDeps.formatSearchResults(results);
|
|
95414
95414
|
} catch (e) {
|
|
95415
|
-
return
|
|
95415
|
+
return `\u9519\u8BEF\uFF1A${e instanceof Error ? e.message : String(e)}`;
|
|
95416
95416
|
}
|
|
95417
95417
|
}
|
|
95418
95418
|
});
|
|
@@ -95425,11 +95425,11 @@ function createSessionManagerTools(ctx, deps = {}) {
|
|
|
95425
95425
|
try {
|
|
95426
95426
|
const info = await resolvedDeps.getSessionInfo(args.session_id);
|
|
95427
95427
|
if (!info) {
|
|
95428
|
-
return
|
|
95428
|
+
return `\u672A\u627E\u5230 Session\uFF1A${args.session_id}`;
|
|
95429
95429
|
}
|
|
95430
95430
|
return resolvedDeps.formatSessionInfo(info);
|
|
95431
95431
|
} catch (e) {
|
|
95432
|
-
return
|
|
95432
|
+
return `\u9519\u8BEF\uFF1A${e instanceof Error ? e.message : String(e)}`;
|
|
95433
95433
|
}
|
|
95434
95434
|
}
|
|
95435
95435
|
});
|
|
@@ -95493,14 +95493,14 @@ function tokenizeCommand2(cmd) {
|
|
|
95493
95493
|
var interactive_bash = tool({
|
|
95494
95494
|
description: INTERACTIVE_BASH_DESCRIPTION,
|
|
95495
95495
|
args: {
|
|
95496
|
-
tmux_command: tool.schema.string().describe("
|
|
95496
|
+
tmux_command: tool.schema.string().describe("\u8981\u6267\u884C\u7684 tmux \u547D\u4EE4\uFF08\u4E0D\u5E26 'tmux' \u524D\u7F00\uFF09")
|
|
95497
95497
|
},
|
|
95498
95498
|
execute: async (args) => {
|
|
95499
95499
|
try {
|
|
95500
95500
|
const tmuxPath2 = getCachedTmuxPath() ?? "tmux";
|
|
95501
95501
|
const parts = tokenizeCommand2(args.tmux_command);
|
|
95502
95502
|
if (parts.length === 0) {
|
|
95503
|
-
return "
|
|
95503
|
+
return "\u9519\u8BEF\uFF1A\u7A7A\u7684 tmux \u547D\u4EE4";
|
|
95504
95504
|
}
|
|
95505
95505
|
const subcommand = parts[0].toLowerCase();
|
|
95506
95506
|
if (BLOCKED_TMUX_SUBCOMMANDS.includes(subcommand)) {
|
|
@@ -95513,7 +95513,7 @@ var interactive_bash = tool({
|
|
|
95513
95513
|
sessionName = parts[sessionIdx].slice(2);
|
|
95514
95514
|
}
|
|
95515
95515
|
}
|
|
95516
|
-
return
|
|
95516
|
+
return `\u9519\u8BEF\uFF1A'${parts[0]}' \u5728 interactive_bash \u4E2D\u88AB\u963B\u6B62\u3002
|
|
95517
95517
|
|
|
95518
95518
|
**USE BASH TOOL INSTEAD:**
|
|
95519
95519
|
|
|
@@ -95525,7 +95525,7 @@ tmux capture-pane -p -t ${sessionName}
|
|
|
95525
95525
|
tmux capture-pane -p -t ${sessionName} -S -1000
|
|
95526
95526
|
\`\`\`
|
|
95527
95527
|
|
|
95528
|
-
|
|
95528
|
+
Bash \u5DE5\u5177\u53EF\u4EE5\u76F4\u63A5\u6267\u884C\u8FD9\u4E9B\u547D\u4EE4\u3002\u8BF7\u52FF\u4F7F\u7528 interactive_bash \u91CD\u8BD5\u3002`;
|
|
95529
95529
|
}
|
|
95530
95530
|
const proc = spawnWithWindowsHide([tmuxPath2, ...parts], {
|
|
95531
95531
|
stdout: "pipe",
|
|
@@ -95551,12 +95551,12 @@ The Bash tool can execute these commands directly. Do NOT retry with interactive
|
|
|
95551
95551
|
timeoutPromise
|
|
95552
95552
|
]);
|
|
95553
95553
|
if (exitCode !== 0) {
|
|
95554
|
-
const errorMsg = stderr.trim() ||
|
|
95555
|
-
return
|
|
95554
|
+
const errorMsg = stderr.trim() || `\u547D\u4EE4\u4EE5\u9000\u51FA\u7801 ${exitCode} \u5931\u8D25`;
|
|
95555
|
+
return `\u9519\u8BEF\uFF1A${errorMsg}`;
|
|
95556
95556
|
}
|
|
95557
95557
|
return stdout || "(no output)";
|
|
95558
95558
|
} catch (e) {
|
|
95559
|
-
return
|
|
95559
|
+
return `\u9519\u8BEF\uFF1A${e instanceof Error ? e.message : String(e)}`;
|
|
95560
95560
|
}
|
|
95561
95561
|
}
|
|
95562
95562
|
});
|
|
@@ -95600,9 +95600,9 @@ function validateOperationParams(args) {
|
|
|
95600
95600
|
if (args.prompt_name)
|
|
95601
95601
|
operations.push({ type: "prompt", name: args.prompt_name });
|
|
95602
95602
|
if (operations.length === 0) {
|
|
95603
|
-
throw new Error(
|
|
95603
|
+
throw new Error(`\u7F3A\u5C11\u64CD\u4F5C\u3002\u5FC5\u987B\u6307\u5B9A tool_name\u3001resource_name \u6216 prompt_name \u4E2D\u7684\u5176\u4E2D\u4E00\u4E2A\u3002
|
|
95604
95604
|
|
|
95605
|
-
` +
|
|
95605
|
+
` + `\u793A\u4F8B:
|
|
95606
95606
|
` + ` skill_mcp(mcp_name="sqlite", tool_name="query", arguments='{"sql": "SELECT * FROM users"}')
|
|
95607
95607
|
` + ` skill_mcp(mcp_name="memory", resource_name="memory://notes")
|
|
95608
95608
|
` + ` skill_mcp(mcp_name="helper", prompt_name="summarize", arguments='{"text": "..."}')`);
|
|
@@ -95613,11 +95613,11 @@ function validateOperationParams(args) {
|
|
|
95613
95613
|
args.resource_name && `resource_name="${args.resource_name}"`,
|
|
95614
95614
|
args.prompt_name && `prompt_name="${args.prompt_name}"`
|
|
95615
95615
|
].filter(Boolean).join(", ");
|
|
95616
|
-
throw new Error(
|
|
95616
|
+
throw new Error(`\u6307\u5B9A\u4E86\u591A\u4E2A\u64CD\u4F5C\u3002\u53EA\u80FD\u63D0\u4F9B tool_name\u3001resource_name \u6216 prompt_name \u4E2D\u7684\u5176\u4E2D\u4E00\u4E2A\u3002
|
|
95617
95617
|
|
|
95618
|
-
` +
|
|
95618
|
+
` + `\u6536\u5230: ${provided}
|
|
95619
95619
|
|
|
95620
|
-
` + `
|
|
95620
|
+
` + `\u8BF7\u4F7F\u7528\u72EC\u7ACB\u7684\u8C03\u7528\u6765\u5904\u7406\u6BCF\u4E2A\u64CD\u4F5C\u3002`);
|
|
95621
95621
|
}
|
|
95622
95622
|
return operations[0];
|
|
95623
95623
|
}
|
|
@@ -95634,19 +95634,19 @@ function formatAvailableMcps(skills2) {
|
|
|
95634
95634
|
for (const skill2 of skills2) {
|
|
95635
95635
|
if (skill2.mcpConfig) {
|
|
95636
95636
|
for (const serverName of Object.keys(skill2.mcpConfig)) {
|
|
95637
|
-
mcps.push(` - "${serverName}"
|
|
95637
|
+
mcps.push(` - "${serverName}"\uFF08\u6765\u81EA skill "${skill2.name}"\uFF09`);
|
|
95638
95638
|
}
|
|
95639
95639
|
}
|
|
95640
95640
|
}
|
|
95641
95641
|
return mcps.length > 0 ? mcps.join(`
|
|
95642
|
-
`) : "
|
|
95642
|
+
`) : " \uFF08\u672A\u627E\u5230\uFF09";
|
|
95643
95643
|
}
|
|
95644
95644
|
function formatBuiltinMcpHint(mcpName) {
|
|
95645
95645
|
const nativeTools = BUILTIN_MCP_TOOL_HINTS[mcpName];
|
|
95646
95646
|
if (!nativeTools)
|
|
95647
95647
|
return null;
|
|
95648
|
-
return `"${mcpName}"
|
|
95649
|
-
` +
|
|
95648
|
+
return `"${mcpName}" \u662F\u4E00\u4E2A\u5185\u7F6E MCP\uFF0C\u800C\u975E skill MCP\u3002
|
|
95649
|
+
` + `\u8BF7\u76F4\u63A5\u4F7F\u7528\u539F\u751F\u5DE5\u5177:
|
|
95650
95650
|
` + nativeTools.map((toolName) => ` - ${toolName}`).join(`
|
|
95651
95651
|
`);
|
|
95652
95652
|
}
|
|
@@ -95659,7 +95659,7 @@ function applyGrepFilter(output, pattern) {
|
|
|
95659
95659
|
`);
|
|
95660
95660
|
const filtered = lines.filter((line) => regex.test(line));
|
|
95661
95661
|
return filtered.length > 0 ? filtered.join(`
|
|
95662
|
-
`) : `[grep]
|
|
95662
|
+
`) : `[grep] \u6CA1\u6709\u884C\u5339\u914D\u6A21\u5F0F: ${pattern}`;
|
|
95663
95663
|
} catch {
|
|
95664
95664
|
return output;
|
|
95665
95665
|
}
|
|
@@ -95669,12 +95669,12 @@ function createSkillMcpTool(options) {
|
|
|
95669
95669
|
return tool({
|
|
95670
95670
|
description: SKILL_MCP_DESCRIPTION,
|
|
95671
95671
|
args: {
|
|
95672
|
-
mcp_name: tool.schema.string().describe("
|
|
95673
|
-
tool_name: tool.schema.string().optional().describe("MCP
|
|
95674
|
-
resource_name: tool.schema.string().optional().describe("MCP
|
|
95675
|
-
prompt_name: tool.schema.string().optional().describe("MCP
|
|
95676
|
-
arguments: tool.schema.union([tool.schema.string(), tool.schema.object({})]).optional().describe("JSON
|
|
95677
|
-
grep: tool.schema.string().optional().describe("
|
|
95672
|
+
mcp_name: tool.schema.string().describe("skill \u914D\u7F6E\u4E2D MCP \u670D\u52A1\u5668\u7684\u540D\u79F0"),
|
|
95673
|
+
tool_name: tool.schema.string().optional().describe("\u8981\u8C03\u7528\u7684 MCP \u5DE5\u5177"),
|
|
95674
|
+
resource_name: tool.schema.string().optional().describe("\u8981\u8BFB\u53D6\u7684 MCP \u8D44\u6E90 URI"),
|
|
95675
|
+
prompt_name: tool.schema.string().optional().describe("\u8981\u83B7\u53D6\u7684 MCP \u63D0\u793A"),
|
|
95676
|
+
arguments: tool.schema.union([tool.schema.string(), tool.schema.object({})]).optional().describe("JSON \u5B57\u7B26\u4E32\u6216\u5BF9\u8C61\u5F62\u5F0F\u7684\u53C2\u6570"),
|
|
95677
|
+
grep: tool.schema.string().optional().describe("\u7528\u4E8E\u8FC7\u6EE4\u8F93\u51FA\u884C\u7684\u6B63\u5219\u8868\u8FBE\u5F0F\u6A21\u5F0F\uFF08\u4EC5\u8FD4\u56DE\u5339\u914D\u7684\u884C\uFF09")
|
|
95678
95678
|
},
|
|
95679
95679
|
async execute(args, toolContext) {
|
|
95680
95680
|
const operation = validateOperationParams(args);
|
|
@@ -95685,16 +95685,16 @@ function createSkillMcpTool(options) {
|
|
|
95685
95685
|
if (builtinHint) {
|
|
95686
95686
|
throw new Error(builtinHint);
|
|
95687
95687
|
}
|
|
95688
|
-
throw new Error(
|
|
95688
|
+
throw new Error(`\u672A\u627E\u5230 MCP \u670D\u52A1\u5668 "${args.mcp_name}"\u3002
|
|
95689
95689
|
|
|
95690
|
-
` +
|
|
95690
|
+
` + `\u5DF2\u52A0\u8F7D skills \u4E2D\u7684\u53EF\u7528 MCP \u670D\u52A1\u5668:
|
|
95691
95691
|
` + formatAvailableMcps(skills2) + `
|
|
95692
95692
|
|
|
95693
|
-
` +
|
|
95693
|
+
` + `\u63D0\u793A: \u8BF7\u5148\u4F7F\u7528 'skill' \u5DE5\u5177\u52A0\u8F7D skill\uFF0C\u7136\u540E\u518D\u8C03\u7528 skill_mcp\u3002`);
|
|
95694
95694
|
}
|
|
95695
95695
|
const sessionID = toolContext.sessionID || getSessionID2?.();
|
|
95696
95696
|
if (!sessionID) {
|
|
95697
|
-
throw new Error("
|
|
95697
|
+
throw new Error("\u6CA1\u6709\u53EF\u7528\u7684\u6D3B\u8DC3\u4F1A\u8BDD\u6765\u6267\u884C skill MCP \u8C03\u7528\u3002");
|
|
95698
95698
|
}
|
|
95699
95699
|
const info = {
|
|
95700
95700
|
serverName: args.mcp_name,
|
|
@@ -95902,11 +95902,11 @@ async function formatFullSession(task, client2, options) {
|
|
|
95902
95902
|
});
|
|
95903
95903
|
const errorMessage = getErrorMessage4(messagesResult);
|
|
95904
95904
|
if (errorMessage) {
|
|
95905
|
-
return
|
|
95905
|
+
return `\u9519\u8BEF\u83B7\u53D6\u6D88\u606F\uFF1A${errorMessage}`;
|
|
95906
95906
|
}
|
|
95907
95907
|
const rawMessages = extractMessages2(messagesResult);
|
|
95908
95908
|
if (!Array.isArray(rawMessages)) {
|
|
95909
|
-
return "
|
|
95909
|
+
return "\u9519\u8BEF\u83B7\u53D6\u6D88\u606F\uFF1A\u65E0\u6548\u54CD\u5E94";
|
|
95910
95910
|
}
|
|
95911
95911
|
const sortedMessages = [...rawMessages].sort((a, b) => {
|
|
95912
95912
|
const timeA = String(a.info?.time ?? "");
|
|
@@ -95917,7 +95917,7 @@ async function formatFullSession(task, client2, options) {
|
|
|
95917
95917
|
if (options.sinceMessageId) {
|
|
95918
95918
|
const index = filteredMessages.findIndex((message) => message.id === options.sinceMessageId);
|
|
95919
95919
|
if (index === -1) {
|
|
95920
|
-
return
|
|
95920
|
+
return `\u9519\u8BEF\uFF1A\u672A\u627E\u5230 since_message_id\uFF1A${options.sinceMessageId}`;
|
|
95921
95921
|
}
|
|
95922
95922
|
filteredMessages = filteredMessages.slice(index + 1);
|
|
95923
95923
|
}
|
|
@@ -95944,20 +95944,20 @@ async function formatFullSession(task, client2, options) {
|
|
|
95944
95944
|
const hasMore = limit !== undefined && normalizedMessages.length > limit;
|
|
95945
95945
|
const visibleMessages = limit !== undefined ? normalizedMessages.slice(0, limit) : normalizedMessages;
|
|
95946
95946
|
const lines = [];
|
|
95947
|
-
lines.push("#
|
|
95947
|
+
lines.push("# \u5B8C\u6574\u4F1A\u8BDD\u8F93\u51FA");
|
|
95948
95948
|
lines.push("");
|
|
95949
|
-
lines.push(`Task ID
|
|
95950
|
-
lines.push(`Description
|
|
95951
|
-
lines.push(`Status
|
|
95952
|
-
lines.push(`Session ID
|
|
95953
|
-
lines.push(
|
|
95954
|
-
lines.push(
|
|
95955
|
-
lines.push(
|
|
95949
|
+
lines.push(`Task ID\uFF1A${task.id}`);
|
|
95950
|
+
lines.push(`Description\uFF1A${task.description}`);
|
|
95951
|
+
lines.push(`Status\uFF1A${task.status}`);
|
|
95952
|
+
lines.push(`Session ID\uFF1A${task.sessionID}`);
|
|
95953
|
+
lines.push(`\u6D88\u606F\u603B\u6570\uFF1A${normalizedMessages.length}`);
|
|
95954
|
+
lines.push(`\u5DF2\u8FD4\u56DE\uFF1A${visibleMessages.length}`);
|
|
95955
|
+
lines.push(`\u8FD8\u6709\u66F4\u591A\uFF1A${hasMore ? "true" : "false"}`);
|
|
95956
95956
|
lines.push("");
|
|
95957
|
-
lines.push("##
|
|
95957
|
+
lines.push("## \u6D88\u606F");
|
|
95958
95958
|
if (visibleMessages.length === 0) {
|
|
95959
95959
|
lines.push("");
|
|
95960
|
-
lines.push("
|
|
95960
|
+
lines.push("\uFF08\u672A\u627E\u5230\u6D88\u606F\uFF09");
|
|
95961
95961
|
return lines.join(`
|
|
95962
95962
|
`);
|
|
95963
95963
|
}
|
|
@@ -95993,40 +95993,40 @@ function getTimeString(value) {
|
|
|
95993
95993
|
}
|
|
95994
95994
|
async function formatTaskResult(task, client2) {
|
|
95995
95995
|
if (!task.sessionID) {
|
|
95996
|
-
return
|
|
95996
|
+
return `\u9519\u8BEF\uFF1A\u4EFB\u52A1\u6CA1\u6709 sessionID`;
|
|
95997
95997
|
}
|
|
95998
95998
|
const messagesResult = await client2.session.messages({
|
|
95999
95999
|
path: { id: task.sessionID }
|
|
96000
96000
|
});
|
|
96001
96001
|
const errorMessage = getErrorMessage4(messagesResult);
|
|
96002
96002
|
if (errorMessage) {
|
|
96003
|
-
return
|
|
96003
|
+
return `\u9519\u8BEF\u83B7\u53D6\u6D88\u606F\uFF1A${errorMessage}`;
|
|
96004
96004
|
}
|
|
96005
96005
|
const messages = extractMessages2(messagesResult);
|
|
96006
96006
|
if (!Array.isArray(messages) || messages.length === 0) {
|
|
96007
|
-
return
|
|
96007
|
+
return `\u4EFB\u52A1\u7ED3\u679C
|
|
96008
96008
|
|
|
96009
|
-
Task ID
|
|
96010
|
-
Description
|
|
96011
|
-
Duration
|
|
96012
|
-
Session ID
|
|
96009
|
+
Task ID\uFF1A${task.id}
|
|
96010
|
+
Description\uFF1A${task.description}
|
|
96011
|
+
Duration\uFF1A${formatDuration(task.startedAt ?? new Date, task.completedAt)}
|
|
96012
|
+
Session ID\uFF1A${task.sessionID}
|
|
96013
96013
|
|
|
96014
96014
|
---
|
|
96015
96015
|
|
|
96016
|
-
|
|
96016
|
+
\uFF08\u672A\u627E\u5230\u6D88\u606F\uFF09`;
|
|
96017
96017
|
}
|
|
96018
96018
|
const relevantMessages = messages.filter((m) => m.info?.role === "assistant" || m.info?.role === "tool");
|
|
96019
96019
|
if (relevantMessages.length === 0) {
|
|
96020
|
-
return
|
|
96020
|
+
return `\u4EFB\u52A1\u7ED3\u679C
|
|
96021
96021
|
|
|
96022
|
-
Task ID
|
|
96023
|
-
Description
|
|
96024
|
-
Duration
|
|
96025
|
-
Session ID
|
|
96022
|
+
Task ID\uFF1A${task.id}
|
|
96023
|
+
Description\uFF1A${task.description}
|
|
96024
|
+
Duration\uFF1A${formatDuration(task.startedAt ?? new Date, task.completedAt)}
|
|
96025
|
+
Session ID\uFF1A${task.sessionID}
|
|
96026
96026
|
|
|
96027
96027
|
---
|
|
96028
96028
|
|
|
96029
|
-
|
|
96029
|
+
\uFF08\u672A\u627E\u5230\u52A9\u624B\u6216\u5DE5\u5177\u54CD\u5E94\uFF09`;
|
|
96030
96030
|
}
|
|
96031
96031
|
const sortedMessages = [...relevantMessages].sort((a, b) => {
|
|
96032
96032
|
const timeA = getTimeString(a.info?.time);
|
|
@@ -96036,16 +96036,16 @@ Session ID: ${task.sessionID}
|
|
|
96036
96036
|
const newMessages = consumeNewMessages(task.sessionID, sortedMessages);
|
|
96037
96037
|
if (newMessages.length === 0) {
|
|
96038
96038
|
const duration2 = formatDuration(task.startedAt ?? new Date, task.completedAt);
|
|
96039
|
-
return
|
|
96039
|
+
return `\u4EFB\u52A1\u7ED3\u679C
|
|
96040
96040
|
|
|
96041
|
-
Task ID
|
|
96042
|
-
Description
|
|
96043
|
-
Duration
|
|
96044
|
-
Session ID
|
|
96041
|
+
Task ID\uFF1A${task.id}
|
|
96042
|
+
Description\uFF1A${task.description}
|
|
96043
|
+
Duration\uFF1A${duration2}
|
|
96044
|
+
Session ID\uFF1A${task.sessionID}
|
|
96045
96045
|
|
|
96046
96046
|
---
|
|
96047
96047
|
|
|
96048
|
-
|
|
96048
|
+
\uFF08\u81EA\u4E0A\u6B21\u68C0\u67E5\u4EE5\u6765\u65E0\u65B0\u8F93\u51FA\uFF09`;
|
|
96049
96049
|
}
|
|
96050
96050
|
const extractedContent = [];
|
|
96051
96051
|
for (const message of newMessages) {
|
|
@@ -96074,16 +96074,16 @@ Session ID: ${task.sessionID}
|
|
|
96074
96074
|
|
|
96075
96075
|
`);
|
|
96076
96076
|
const duration = formatDuration(task.startedAt ?? new Date, task.completedAt);
|
|
96077
|
-
return
|
|
96077
|
+
return `\u4EFB\u52A1\u7ED3\u679C
|
|
96078
96078
|
|
|
96079
|
-
Task ID
|
|
96080
|
-
Description
|
|
96081
|
-
Duration
|
|
96082
|
-
Session ID
|
|
96079
|
+
Task ID\uFF1A${task.id}
|
|
96080
|
+
Description\uFF1A${task.description}
|
|
96081
|
+
Duration\uFF1A${duration}
|
|
96082
|
+
Session ID\uFF1A${task.sessionID}
|
|
96083
96083
|
|
|
96084
96084
|
---
|
|
96085
96085
|
|
|
96086
|
-
${textContent || "
|
|
96086
|
+
${textContent || "\uFF08\u65E0\u6587\u672C\u8F93\u51FA\uFF09"}`;
|
|
96087
96087
|
}
|
|
96088
96088
|
|
|
96089
96089
|
// src/tools/background-task/create-background-output.ts
|
|
@@ -96151,28 +96151,28 @@ function isTaskActiveStatus(status) {
|
|
|
96151
96151
|
function appendTimeoutNote(output, timeoutMs) {
|
|
96152
96152
|
return `${output}
|
|
96153
96153
|
|
|
96154
|
-
> **
|
|
96154
|
+
> **\u7B49\u5F85\u8D85\u65F6** ${timeoutMs}ms \u540E\u3002\u4EFB\u52A1\u4ECD\u5728\u8FD0\u884C\uFF1B\u663E\u793A\u6700\u65B0\u53EF\u7528\u8F93\u51FA\u3002`;
|
|
96155
96155
|
}
|
|
96156
96156
|
function createBackgroundOutput(manager, client2) {
|
|
96157
96157
|
return tool({
|
|
96158
96158
|
description: BACKGROUND_OUTPUT_DESCRIPTION,
|
|
96159
96159
|
args: {
|
|
96160
|
-
task_id: tool.schema.string().describe("Task ID
|
|
96160
|
+
task_id: tool.schema.string().describe("\u8981\u83B7\u53D6\u8F93\u51FA\u7684 Task ID"),
|
|
96161
96161
|
block: tool.schema.boolean().optional().describe("Wait for completion (default: false). System notifies when done, so blocking is rarely needed."),
|
|
96162
|
-
timeout: tool.schema.number().optional().describe("
|
|
96163
|
-
full_session: tool.schema.boolean().optional().describe("
|
|
96164
|
-
include_thinking: tool.schema.boolean().optional().describe("
|
|
96165
|
-
message_limit: tool.schema.number().optional().describe("
|
|
96166
|
-
since_message_id: tool.schema.string().optional().describe("
|
|
96167
|
-
include_tool_results: tool.schema.boolean().optional().describe("
|
|
96168
|
-
thinking_max_chars: tool.schema.number().optional().describe("
|
|
96162
|
+
timeout: tool.schema.number().optional().describe("\u6700\u5927\u7B49\u5F85\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF0C\u9ED8\u8BA4\uFF1A60000\uFF0C\u6700\u5927\uFF1A600000\uFF09"),
|
|
96163
|
+
full_session: tool.schema.boolean().optional().describe("\u8FD4\u56DE\u5B8C\u6574\u4F1A\u8BDD\u6D88\u606F\u5E76\u5E94\u7528\u8FC7\u6EE4\u5668\uFF08\u9ED8\u8BA4\uFF1Afalse\uFF09"),
|
|
96164
|
+
include_thinking: tool.schema.boolean().optional().describe("\u5728 full_session \u8F93\u51FA\u4E2D\u5305\u542B thinking/reasoning \u90E8\u5206\uFF08\u9ED8\u8BA4\uFF1Afalse\uFF09"),
|
|
96165
|
+
message_limit: tool.schema.number().optional().describe("\u6700\u5927\u8FD4\u56DE\u6D88\u606F\u6570\uFF08\u4E0A\u9650 100\uFF09"),
|
|
96166
|
+
since_message_id: tool.schema.string().optional().describe("\u8FD4\u56DE\u6B64\u6D88\u606F ID \u4E4B\u540E\u7684\u6D88\u606F\uFF08\u4E0D\u5305\u542B\uFF09"),
|
|
96167
|
+
include_tool_results: tool.schema.boolean().optional().describe("\u5728 full_session \u8F93\u51FA\u4E2D\u5305\u542B\u5DE5\u5177\u7ED3\u679C\uFF08\u9ED8\u8BA4\uFF1Afalse\uFF09"),
|
|
96168
|
+
thinking_max_chars: tool.schema.number().optional().describe("thinking \u5185\u5BB9\u6700\u5927\u5B57\u7B26\u6570\uFF08\u9ED8\u8BA4\uFF1A2000\uFF09")
|
|
96169
96169
|
},
|
|
96170
96170
|
async execute(args, toolContext) {
|
|
96171
96171
|
try {
|
|
96172
96172
|
const ctx = toolContext;
|
|
96173
96173
|
const task = manager.getTask(args.task_id);
|
|
96174
96174
|
if (!task) {
|
|
96175
|
-
return
|
|
96175
|
+
return `\u672A\u627E\u5230\u4EFB\u52A1\uFF1A${args.task_id}`;
|
|
96176
96176
|
}
|
|
96177
96177
|
const meta = {
|
|
96178
96178
|
title: formatResolvedTitle(task),
|
|
@@ -96195,7 +96195,7 @@ function createBackgroundOutput(manager, client2) {
|
|
|
96195
96195
|
await delay3(1000);
|
|
96196
96196
|
const currentTask = manager.getTask(args.task_id);
|
|
96197
96197
|
if (!currentTask) {
|
|
96198
|
-
return
|
|
96198
|
+
return `\u4EFB\u52A1\u5DF2\u5220\u9664\uFF1A${args.task_id}`;
|
|
96199
96199
|
}
|
|
96200
96200
|
resolvedTask = currentTask;
|
|
96201
96201
|
if (!isTaskActiveStatus(currentTask.status)) {
|
|
@@ -96236,7 +96236,7 @@ function createBackgroundOutput(manager, client2) {
|
|
|
96236
96236
|
const statusOutput = formatTaskStatus(resolvedTask);
|
|
96237
96237
|
return didTimeoutWhileActive ? appendTimeoutNote(statusOutput, timeoutMs) : statusOutput;
|
|
96238
96238
|
} catch (error) {
|
|
96239
|
-
return
|
|
96239
|
+
return `\u83B7\u53D6\u8F93\u51FA\u9519\u8BEF\uFF1A${error instanceof Error ? error.message : String(error)}`;
|
|
96240
96240
|
}
|
|
96241
96241
|
}
|
|
96242
96242
|
});
|
|
@@ -96246,8 +96246,8 @@ function createBackgroundCancel(manager, _client) {
|
|
|
96246
96246
|
return tool({
|
|
96247
96247
|
description: BACKGROUND_CANCEL_DESCRIPTION,
|
|
96248
96248
|
args: {
|
|
96249
|
-
taskId: tool.schema.string().optional().describe("
|
|
96250
|
-
all: tool.schema.boolean().optional().describe("
|
|
96249
|
+
taskId: tool.schema.string().optional().describe("\u8981\u53D6\u6D88\u7684 task ID\uFF08\u5F53 all=false \u65F6\u5FC5\u987B\u63D0\u4F9B\uFF09"),
|
|
96250
|
+
all: tool.schema.boolean().optional().describe("\u53D6\u6D88\u6240\u6709\u6B63\u5728\u8FD0\u884C\u7684\u540E\u53F0\u4EFB\u52A1\uFF08\u9ED8\u8BA4: false\uFF09")
|
|
96251
96251
|
},
|
|
96252
96252
|
async execute(args, toolContext) {
|
|
96253
96253
|
try {
|
|
@@ -96351,7 +96351,7 @@ var CALL_OMO_AGENT_DESCRIPTION = `\u542F\u52A8 explore/librarian agent \u6216\u8
|
|
|
96351
96351
|
|
|
96352
96352
|
\u540C\u65F6\u652F\u6301\u901A\u8FC7 user \u6216 project agent \u76EE\u5F55\u6CE8\u518C\u7684\u81EA\u5B9A\u4E49 agents\u3002
|
|
96353
96353
|
|
|
96354
|
-
\u4F20\u5165 \`session_id=<id>\` \u53EF\u5728\u4E4B\u524D\u7684 agent \u4E2D\u7EE7\u7EED\u5B8C\u6574\u4E0A\u4E0B\u6587\u3002Nested subagent depth\uFF08\u5D4C\u5957\u5C42\u7EA7\uFF09\u4F1A\u88AB\u81EA\u52A8\u8FFD\u8E2A\uFF0C\u8D85\u8FC7\u914D\u7F6E\u9650\u5236\u540E\u4F1A\u88AB\u963B\u6B62\
|
|
96354
|
+
\u4F20\u5165 \`session_id=<id>\` \u53EF\u5728\u4E4B\u524D\u7684 agent \u4E2D\u7EE7\u7EED\u5B8C\u6574\u4E0A\u4E0B\u6587\u3002Nested subagent depth\uFF08\u5D4C\u5957\u5C42\u7EA7\uFF09\u4F1A\u88AB\u81EA\u52A8\u8FFD\u8E2A\uFF0C\u8D85\u8FC7\u914D\u7F6E\u9650\u5236\u540E\u4F1A\u88AB\u963B\u6B62\u3002\u63D0\u793A\u5FC5\u987B\u7528\u4E2D\u6587\u3002\u4F7F\u7528 \`background_output\` \u83B7\u53D6\u5F02\u6B65\u7ED3\u679C\u3002`;
|
|
96355
96355
|
// src/tools/call-omo-agent/tools.ts
|
|
96356
96356
|
init_agent_display_names();
|
|
96357
96357
|
|
|
@@ -96477,7 +96477,7 @@ async function executeBackground(args, toolContext, manager, client2, fallbackCh
|
|
|
96477
96477
|
while (!sessionId && Date.now() - waitStart < WAIT_FOR_SESSION_TIMEOUT_MS) {
|
|
96478
96478
|
const updated = manager.getTask(task.id);
|
|
96479
96479
|
if (updated?.status === "error" || updated?.status === "cancelled" || updated?.status === "interrupt") {
|
|
96480
|
-
return
|
|
96480
|
+
return `\u4EFB\u52A1\u542F\u52A8\u5931\u8D25\uFF08\u72B6\u6001\uFF1A${updated.status}\uFF09\u3002
|
|
96481
96481
|
|
|
96482
96482
|
Task ID: ${task.id}`;
|
|
96483
96483
|
}
|
|
@@ -96494,7 +96494,7 @@ Task ID: ${task.id}`;
|
|
|
96494
96494
|
title: args.description,
|
|
96495
96495
|
metadata: { sessionId: sessionId ?? "pending" }
|
|
96496
96496
|
});
|
|
96497
|
-
return
|
|
96497
|
+
return `\u540E\u53F0 agent \u4EFB\u52A1\u5DF2\u6210\u529F\u542F\u52A8\u3002
|
|
96498
96498
|
|
|
96499
96499
|
Task ID: ${task.id}
|
|
96500
96500
|
Session ID: ${sessionId ?? "pending"}
|
|
@@ -96502,12 +96502,12 @@ Description: ${task.description}
|
|
|
96502
96502
|
Agent: ${task.agent} (subagent)
|
|
96503
96503
|
Status: ${task.status}
|
|
96504
96504
|
|
|
96505
|
-
|
|
96505
|
+
\u7CFB\u7EDF\u4F1A\u5728\u5B8C\u6210\u65F6\u901A\u77E5\u3002\u4F7F\u7528 \`background_output\` \u548C task_id="${task.id}" \u6765\u68C0\u67E5\u7ED3\u679C\u3002
|
|
96506
96506
|
|
|
96507
|
-
|
|
96507
|
+
\u73B0\u5728\u4E0D\u8981\u8C03\u7528 background_output\u3002\u8BF7\u5148\u7B49\u5F85 <system-reminder> \u901A\u77E5\u3002`;
|
|
96508
96508
|
} catch (error) {
|
|
96509
96509
|
const message = error instanceof Error ? error.message : String(error);
|
|
96510
|
-
return
|
|
96510
|
+
return `\u542F\u52A8\u540E\u53F0 agent \u4EFB\u52A1\u5931\u8D25\uFF1A${message}`;
|
|
96511
96511
|
}
|
|
96512
96512
|
}
|
|
96513
96513
|
|
|
@@ -96777,13 +96777,13 @@ async function executeSync(args, toolContext, ctx, deps = defaultDeps3, fallback
|
|
|
96777
96777
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
96778
96778
|
log(`[call_omo_agent] Prompt error:`, errorMessage);
|
|
96779
96779
|
if (errorMessage.includes("agent.name") || errorMessage.includes("undefined")) {
|
|
96780
|
-
return
|
|
96780
|
+
return `\u9519\u8BEF\uFF1A\u672A\u627E\u5230 Agent "${normalizedSubagentType}"\u3002\u8BF7\u786E\u4FDD\u8BE5 agent \u5DF2\u5728 opencode.json \u4E2D\u6CE8\u518C\u6216\u7531\u63D2\u4EF6\u63D0\u4F9B\u3002
|
|
96781
96781
|
|
|
96782
96782
|
<task_metadata>
|
|
96783
96783
|
session_id: ${sessionID}
|
|
96784
96784
|
</task_metadata>`;
|
|
96785
96785
|
}
|
|
96786
|
-
return
|
|
96786
|
+
return `\u9519\u8BEF\uFF1A\u53D1\u9001\u63D0\u793A\u5931\u8D25\uFF1A${errorMessage}
|
|
96787
96787
|
|
|
96788
96788
|
<task_metadata>
|
|
96789
96789
|
session_id: ${sessionID}
|
|
@@ -96890,17 +96890,17 @@ function resolveModelAndFallbackChain(args) {
|
|
|
96890
96890
|
};
|
|
96891
96891
|
}
|
|
96892
96892
|
function createCallOmoAgent(ctx, backgroundManager, disabledAgents = [], agentOverrides, userCategories, modelFallbackControllerAccessor) {
|
|
96893
|
-
const agentDescriptions = ALLOWED_AGENTS.map((name) => `- ${name}
|
|
96893
|
+
const agentDescriptions = ALLOWED_AGENTS.map((name) => `- ${name}\uFF1A\u4E13\u95E8\u5904\u7406 ${name} \u4EFB\u52A1\u7684 agent`).join(`
|
|
96894
96894
|
`);
|
|
96895
96895
|
const description = CALL_OMO_AGENT_DESCRIPTION.replace("{agents}", agentDescriptions);
|
|
96896
96896
|
return tool({
|
|
96897
96897
|
description,
|
|
96898
96898
|
args: {
|
|
96899
|
-
description: tool.schema.string().describe("
|
|
96900
|
-
prompt: tool.schema.string().describe("
|
|
96901
|
-
subagent_type: tool.schema.string().describe("
|
|
96902
|
-
run_in_background: tool.schema.boolean().describe("
|
|
96903
|
-
session_id: tool.schema.string().describe("
|
|
96899
|
+
description: tool.schema.string().describe("\u4EFB\u52A1\u7684\u7B80\u77ED\u63CF\u8FF0\uFF083-5 \u4E2A\u8BCD\uFF09"),
|
|
96900
|
+
prompt: tool.schema.string().describe("agent \u9700\u8981\u6267\u884C\u7684\u4EFB\u52A1\u5185\u5BB9"),
|
|
96901
|
+
subagent_type: tool.schema.string().describe("\u8981\u8C03\u7528\u7684 agent\u3002\u652F\u6301\u5185\u7F6E agents \u548C\u8FD0\u884C\u65F6\u6CE8\u518C\u7684\u81EA\u5B9A\u4E49 agents\u3002"),
|
|
96902
|
+
run_in_background: tool.schema.boolean().describe("\u5FC5\u586B\u3002true: \u5F02\u6B65\u8FD0\u884C\uFF08\u4F7F\u7528 background_output \u83B7\u53D6\u7ED3\u679C\uFF09\uFF0Cfalse: \u540C\u6B65\u8FD0\u884C\u5E76\u7B49\u5F85\u5B8C\u6210"),
|
|
96903
|
+
session_id: tool.schema.string().describe("\u8981\u7EE7\u7EED\u7684\u5DF2\u6709 Task session").optional()
|
|
96904
96904
|
},
|
|
96905
96905
|
async execute(args, toolContext) {
|
|
96906
96906
|
const toolCtx = toolContext;
|
|
@@ -96908,12 +96908,12 @@ function createCallOmoAgent(ctx, backgroundManager, disabledAgents = [], agentOv
|
|
|
96908
96908
|
const callableAgents = await resolveCallableAgents(ctx.client);
|
|
96909
96909
|
const strippedAgentType = stripInvisibleAgentCharacters(args.subagent_type);
|
|
96910
96910
|
if (!callableAgents.some((name) => name.toLowerCase() === strippedAgentType.toLowerCase())) {
|
|
96911
|
-
return
|
|
96911
|
+
return `\u9519\u8BEF\uFF1A\u65E0\u6548\u7684 agent \u7C7B\u578B "${args.subagent_type}"\u3002\u53EA\u5141\u8BB8\uFF1A${callableAgents.join(", ")}\u3002`;
|
|
96912
96912
|
}
|
|
96913
96913
|
const normalizedAgent = strippedAgentType.toLowerCase();
|
|
96914
96914
|
args = { ...args, subagent_type: normalizedAgent };
|
|
96915
96915
|
if (disabledAgents.some((disabled) => stripInvisibleAgentCharacters(disabled).toLowerCase() === normalizedAgent)) {
|
|
96916
|
-
return
|
|
96916
|
+
return `\u9519\u8BEF\uFF1AAgent "${normalizedAgent}" \u901A\u8FC7 disabled_agents \u914D\u7F6E\u88AB\u7981\u7528\u3002\u8BF7\u4ECE ${CONFIG_BASENAME}.json \u7684 disabled_agents \u4E2D\u79FB\u9664\u5B83\u4EE5\u542F\u7528\u3002`;
|
|
96917
96917
|
}
|
|
96918
96918
|
const { model: resolvedModel, fallbackChain } = resolveModelAndFallbackChain({
|
|
96919
96919
|
subagentType: args.subagent_type,
|
|
@@ -96922,7 +96922,7 @@ function createCallOmoAgent(ctx, backgroundManager, disabledAgents = [], agentOv
|
|
|
96922
96922
|
});
|
|
96923
96923
|
if (args.run_in_background) {
|
|
96924
96924
|
if (args.session_id) {
|
|
96925
|
-
return
|
|
96925
|
+
return `\u9519\u8BEF\uFF1Abackground \u6A21\u5F0F\u4E0B\u4E0D\u652F\u6301 session_id\u3002\u8BF7\u4F7F\u7528 run_in_background=false \u6765\u7EE7\u7EED\u73B0\u6709\u4F1A\u8BDD\u3002`;
|
|
96926
96926
|
}
|
|
96927
96927
|
return await executeBackground(args, toolCtx, backgroundManager, ctx.client, fallbackChain, resolvedModel);
|
|
96928
96928
|
}
|
|
@@ -96933,7 +96933,7 @@ function createCallOmoAgent(ctx, backgroundManager, disabledAgents = [], agentOv
|
|
|
96933
96933
|
return await executeSync(args, toolCtx, ctx, createSyncExecutorDeps(modelFallbackControllerAccessor), fallbackChain, spawnReservation, resolvedModel);
|
|
96934
96934
|
} catch (error) {
|
|
96935
96935
|
spawnReservation?.rollback();
|
|
96936
|
-
return
|
|
96936
|
+
return `\u9519\u8BEF\uFF1A${error instanceof Error ? error.message : String(error)}`;
|
|
96937
96937
|
}
|
|
96938
96938
|
}
|
|
96939
96939
|
return await executeSync(args, toolCtx, ctx, createSyncExecutorDeps(modelFallbackControllerAccessor), fallbackChain, undefined, resolvedModel);
|
|
@@ -97018,7 +97018,7 @@ function needsConversion(mimeType) {
|
|
|
97018
97018
|
}
|
|
97019
97019
|
function convertImageToJpeg(inputPath, mimeType) {
|
|
97020
97020
|
if (!existsSync81(inputPath)) {
|
|
97021
|
-
throw new Error(
|
|
97021
|
+
throw new Error(`\u672A\u627E\u5230\u6587\u4EF6\uFF1A${inputPath}`);
|
|
97022
97022
|
}
|
|
97023
97023
|
const tempDir = mkdtempSync(join87(tmpdir7(), "opencode-img-"));
|
|
97024
97024
|
const outputPath = join87(tempDir, "converted.jpg");
|
|
@@ -97053,7 +97053,7 @@ function convertImageToJpeg(inputPath, mimeType) {
|
|
|
97053
97053
|
} catch (convertError) {
|
|
97054
97054
|
log(`[image-converter] ImageMagick convert failed: ${convertError}`);
|
|
97055
97055
|
}
|
|
97056
|
-
throw new Error(
|
|
97056
|
+
throw new Error(`\u65E0\u53EF\u7528\u7684\u56FE\u50CF\u8F6C\u6362\u5DE5\u5177\u3002\u8BF7\u5B89\u88C5 ImageMagick\uFF1A
|
|
97057
97057
|
` + ` macOS: brew install imagemagick
|
|
97058
97058
|
` + ` Ubuntu/Debian: sudo apt install imagemagick
|
|
97059
97059
|
` + ` RHEL/CentOS: sudo yum install ImageMagick`);
|
|
@@ -97147,7 +97147,7 @@ function prepareLookAtInput(args) {
|
|
|
97147
97147
|
log(`[look_at] Base64 conversion failed: ${conversionError}`);
|
|
97148
97148
|
return {
|
|
97149
97149
|
ok: false,
|
|
97150
|
-
error:
|
|
97150
|
+
error: `\u9519\u8BEF\uFF1A\u8F6C\u6362 Base64 \u56FE\u50CF\u683C\u5F0F\u5931\u8D25\u3002${conversionError}`
|
|
97151
97151
|
};
|
|
97152
97152
|
}
|
|
97153
97153
|
}
|
|
@@ -97190,7 +97190,7 @@ function prepareLookAtInput(args) {
|
|
|
97190
97190
|
log(`[look_at] Conversion failed: ${conversionError}`);
|
|
97191
97191
|
return {
|
|
97192
97192
|
ok: false,
|
|
97193
|
-
error:
|
|
97193
|
+
error: `\u9519\u8BEF\uFF1A\u8F6C\u6362\u56FE\u50CF\u683C\u5F0F\u5931\u8D25\u3002${conversionError}`
|
|
97194
97194
|
};
|
|
97195
97195
|
}
|
|
97196
97196
|
}
|
|
@@ -97215,7 +97215,7 @@ function prepareLookAtInput(args) {
|
|
|
97215
97215
|
}
|
|
97216
97216
|
return {
|
|
97217
97217
|
ok: false,
|
|
97218
|
-
error: "
|
|
97218
|
+
error: "\u9519\u8BEF\uFF1A\u5FC5\u987B\u63D0\u4F9B 'file_path' \u6216 'image_data' \u4E4B\u4E00\u3002"
|
|
97219
97219
|
};
|
|
97220
97220
|
}
|
|
97221
97221
|
|
|
@@ -97445,16 +97445,16 @@ async function runLookAtSession({
|
|
|
97445
97445
|
log("[look_at] Session create error:", createResult.error);
|
|
97446
97446
|
const errorString = String(createResult.error);
|
|
97447
97447
|
if (errorString.toLowerCase().includes("unauthorized")) {
|
|
97448
|
-
return
|
|
97449
|
-
1. OAuth token
|
|
97450
|
-
2. Provider
|
|
97451
|
-
3.
|
|
97448
|
+
return `\u9519\u8BEF\uFF1A\u521B\u5EFA\u4F1A\u8BDD\u5931\u8D25\uFF08\u672A\u6388\u6743\uFF09\u3002\u53EF\u80FD\u539F\u56E0\uFF1A
|
|
97449
|
+
1. OAuth token \u9650\u5236\uFF08\u4F8B\u5982 Claude Code \u51ED\u8BC1\u4EC5\u9650\u4E8E Claude Code \u4F7F\u7528\uFF09
|
|
97450
|
+
2. Provider \u8BA4\u8BC1\u95EE\u9898
|
|
97451
|
+
3. \u4F1A\u8BDD\u6743\u9650\u7EE7\u627F\u95EE\u9898
|
|
97452
97452
|
|
|
97453
|
-
|
|
97453
|
+
\u8BF7\u5C1D\u8BD5\u4F7F\u7528\u4E0D\u540C\u7684 provider \u6216 API key \u8BA4\u8BC1\u3002
|
|
97454
97454
|
|
|
97455
|
-
|
|
97455
|
+
\u539F\u59CB\u9519\u8BEF\uFF1A${createResult.error}`;
|
|
97456
97456
|
}
|
|
97457
|
-
return
|
|
97457
|
+
return `\u9519\u8BEF\uFF1A\u521B\u5EFA\u4F1A\u8BDD\u5931\u8D25\uFF1A${createResult.error}`;
|
|
97458
97458
|
}
|
|
97459
97459
|
const sessionID = createResult.data.id;
|
|
97460
97460
|
log(`[look_at] Created session: ${sessionID}`);
|
|
@@ -97487,14 +97487,14 @@ Original error: ${createResult.error}`;
|
|
|
97487
97487
|
});
|
|
97488
97488
|
if (messagesResult.error) {
|
|
97489
97489
|
log("[look_at] Messages error:", messagesResult.error);
|
|
97490
|
-
return
|
|
97490
|
+
return `\u9519\u8BEF\uFF1A\u83B7\u53D6\u6D88\u606F\u5931\u8D25\uFF1A${messagesResult.error}`;
|
|
97491
97491
|
}
|
|
97492
97492
|
const messages = messagesResult.data;
|
|
97493
97493
|
log(`[look_at] Got ${messages.length} messages`);
|
|
97494
97494
|
const responseText = extractLatestAssistantText(messages);
|
|
97495
97495
|
if (!responseText) {
|
|
97496
97496
|
log("[look_at] No assistant message found");
|
|
97497
|
-
return "
|
|
97497
|
+
return "\u9519\u8BEF\uFF1Amultimodal-looker agent \u65E0\u54CD\u5E94";
|
|
97498
97498
|
}
|
|
97499
97499
|
log(`[look_at] Got response, length: ${responseText.length}`);
|
|
97500
97500
|
return responseText;
|
|
@@ -97534,7 +97534,7 @@ function createLookAt(ctx) {
|
|
|
97534
97534
|
} catch (error) {
|
|
97535
97535
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
97536
97536
|
log(`[look_at] Unexpected error analyzing ${sourceDescription}:`, error);
|
|
97537
|
-
return
|
|
97537
|
+
return `\u9519\u8BEF\uFF1A\u5206\u6790 ${sourceDescription} \u5931\u8D25\uFF1A${errorMessage}`;
|
|
97538
97538
|
} finally {
|
|
97539
97539
|
preparedInput.cleanup();
|
|
97540
97540
|
}
|
|
@@ -97648,13 +97648,12 @@ function buildSystemContentWithTokenLimit(input, maxTokens) {
|
|
|
97648
97648
|
// src/tools/delegate-task/prompt-builder.ts
|
|
97649
97649
|
var FREE_OR_LOCAL_PROMPT_TOKEN_LIMIT = 24000;
|
|
97650
97650
|
var PLAN_AGENT_PROMPT_BASE = `
|
|
97651
|
-
|
|
97652
|
-
|
|
97653
|
-
-
|
|
97654
|
-
-
|
|
97655
|
-
-
|
|
97656
|
-
|
|
97657
|
-
var TDD_LINE = "- Use TDD-oriented planning.";
|
|
97651
|
+
\u672C\u6B21\u89C4\u5212\u8BF7\u6C42\u7684\u9644\u52A0\u8981\u6C42\uFF1A
|
|
97652
|
+
- \u8BF7\u7528\u4E2D\u6587\u56DE\u7B54\u3002
|
|
97653
|
+
- \u8BF7\u7528\u4E2D\u6587\u64B0\u5199\u8BA1\u5212\u3002
|
|
97654
|
+
- \u4E3A ultrawork \u6267\u884C\u505A\u597D\u89C4\u5212\u3002
|
|
97655
|
+
- \u5305\u542B\u6E05\u6670\u7684\u539F\u5B50\u63D0\u4EA4\u7B56\u7565\u3002`;
|
|
97656
|
+
var TDD_LINE = "- \u4F7F\u7528 TDD \u5BFC\u5411\u7684\u89C4\u5212\u3002";
|
|
97658
97657
|
function buildPlanAgentPromptAppend(tddEnabled) {
|
|
97659
97658
|
if (tddEnabled) {
|
|
97660
97659
|
return `${PLAN_AGENT_PROMPT_BASE}
|
|
@@ -97669,7 +97668,7 @@ function buildAvailableSkillsSection(skills2) {
|
|
|
97669
97668
|
const rows = skills2.map((s) => `- \`${s.name}\`: ${s.description || s.name}`).join(`
|
|
97670
97669
|
`);
|
|
97671
97670
|
return `<available_skills>
|
|
97672
|
-
Skills
|
|
97671
|
+
Skills \u63D0\u4F9B\u4E13\u4E1A\u5316\u6307\u4EE4\u3002\u5728\u59D4\u6258\u4EFB\u52A1\u65F6\u901A\u8FC7 load_skills \u53C2\u6570\u52A0\u8F7D\u3002
|
|
97673
97672
|
|
|
97674
97673
|
${rows}
|
|
97675
97674
|
</available_skills>`;
|
|
@@ -97727,7 +97726,7 @@ async function resolveSkillContent2(skills2, options) {
|
|
|
97727
97726
|
if (notFound.length > 0) {
|
|
97728
97727
|
const allSkills = await discoverSkills({ includeClaudeCodePaths: true, directory: options?.directory });
|
|
97729
97728
|
const available = allSkills.map((s) => s.name).join(", ");
|
|
97730
|
-
return { content: undefined, contents: [], error:
|
|
97729
|
+
return { content: undefined, contents: [], error: `\u672A\u627E\u5230 Skills\uFF1A${notFound.join(", ")}\u3002\u53EF\u7528\uFF1A${available}` };
|
|
97731
97730
|
}
|
|
97732
97731
|
const contents = Array.from(resolved.values());
|
|
97733
97732
|
return { content: contents.join(`
|
|
@@ -97771,12 +97770,12 @@ function getTaskID(args) {
|
|
|
97771
97770
|
function formatDetailedError(error, ctx) {
|
|
97772
97771
|
const message = error instanceof Error ? error.message : String(error);
|
|
97773
97772
|
const stack = error instanceof Error ? error.stack : undefined;
|
|
97774
|
-
const lines = [`${ctx.operation}
|
|
97773
|
+
const lines = [`${ctx.operation} \u5931\u8D25`, "", `**\u9519\u8BEF**\uFF1A${message}`];
|
|
97775
97774
|
if (ctx.sessionID) {
|
|
97776
|
-
lines.push(`**Session ID
|
|
97775
|
+
lines.push(`**Session ID**\uFF1A${ctx.sessionID}`);
|
|
97777
97776
|
}
|
|
97778
97777
|
if (ctx.agent) {
|
|
97779
|
-
lines.push(`**Agent
|
|
97778
|
+
lines.push(`**Agent**\uFF1A${ctx.agent}${ctx.category ? `\uFF08category\uFF1A${ctx.category}\uFF09` : ""}`);
|
|
97780
97779
|
}
|
|
97781
97780
|
if (ctx.args) {
|
|
97782
97781
|
lines.push("", "**Arguments**:");
|
|
@@ -97791,7 +97790,7 @@ function formatDetailedError(error, ctx) {
|
|
|
97791
97790
|
}
|
|
97792
97791
|
}
|
|
97793
97792
|
if (stack) {
|
|
97794
|
-
lines.push("", "
|
|
97793
|
+
lines.push("", "**\u5806\u6808\u8DDF\u8E2A**\uFF1A");
|
|
97795
97794
|
lines.push("```");
|
|
97796
97795
|
lines.push(stack.split(`
|
|
97797
97796
|
`).slice(0, 10).join(`
|
|
@@ -97846,17 +97845,17 @@ async function executeBackgroundContinuation(args, ctx, executorCtx, parentConte
|
|
|
97846
97845
|
}
|
|
97847
97846
|
};
|
|
97848
97847
|
await publishToolMetadata(ctx, bgContMeta);
|
|
97849
|
-
return
|
|
97848
|
+
return `\u540E\u53F0\u4EFB\u52A1\u5DF2\u7EE7\u7EED\u3002
|
|
97850
97849
|
|
|
97851
|
-
Task ID
|
|
97852
|
-
|
|
97853
|
-
Agent
|
|
97854
|
-
|
|
97850
|
+
Task ID\uFF1A${task.id}
|
|
97851
|
+
\u63CF\u8FF0\uFF1A${task.description}
|
|
97852
|
+
Agent\uFF1A${task.agent}
|
|
97853
|
+
\u72B6\u6001\uFF1A${task.status}
|
|
97855
97854
|
|
|
97856
|
-
Agent
|
|
97857
|
-
|
|
97855
|
+
Agent \u7EE7\u7EED\u6267\u884C\uFF0C\u5B8C\u6574\u4FDD\u7559\u4E4B\u524D\u7684\u4E0A\u4E0B\u6587\u3002
|
|
97856
|
+
\u7CFB\u7EDF\u4F1A\u5728\u5B8C\u6210\u65F6\u901A\u77E5\u3002\u4F7F\u7528 \`background_output\` \u548C task_id="${task.id}" \u6765\u68C0\u67E5\u7ED3\u679C\u3002
|
|
97858
97857
|
|
|
97859
|
-
|
|
97858
|
+
\u73B0\u5728\u4E0D\u8981\u8C03\u7528 background_output\u3002\u8BF7\u5148\u7B49\u5F85 <system-reminder> \u901A\u77E5\u3002
|
|
97860
97859
|
|
|
97861
97860
|
${buildTaskMetadataBlock({
|
|
97862
97861
|
sessionId: task.sessionID,
|
|
@@ -97990,7 +97989,7 @@ async function pollSyncSession(ctx, client2, input, timeoutMs) {
|
|
|
97990
97989
|
abortSyncSession(client2, input.sessionID, "parent_abort");
|
|
97991
97990
|
if (input.toastManager && input.taskId)
|
|
97992
97991
|
input.toastManager.removeTask(input.taskId);
|
|
97993
|
-
return
|
|
97992
|
+
return `\u4EFB\u52A1\u5DF2\u4E2D\u6B62\u3002
|
|
97994
97993
|
|
|
97995
97994
|
Session ID: ${input.sessionID}`;
|
|
97996
97995
|
}
|
|
@@ -98043,7 +98042,7 @@ Session ID: ${input.sessionID}`;
|
|
|
98043
98042
|
abortSyncSession(client2, input.sessionID, "max_turns_exceeded");
|
|
98044
98043
|
if (input.toastManager && input.taskId)
|
|
98045
98044
|
input.toastManager.removeTask(input.taskId);
|
|
98046
|
-
return
|
|
98045
|
+
return `\u4EFB\u52A1\u5DF2\u4E2D\u6B62\uFF1Asubagent \u8D85\u8FC7 ${maxTurns} \u6B21 assistant \u8F6E\u6B21\u4ECD\u672A\u5B8C\u6210\u3002\u8FD9\u901A\u5E38\u8868\u793A\u5B58\u5728\u65E0\u9650\u5DE5\u5177\u8C03\u7528\u5FAA\u73AF\u3002Session ID: ${input.sessionID}`;
|
|
98047
98046
|
}
|
|
98048
98047
|
}
|
|
98049
98048
|
const hasAssistantText = messages.some((m) => {
|
|
@@ -98070,7 +98069,7 @@ Session ID: ${input.sessionID}`;
|
|
|
98070
98069
|
log("[task] Poll timeout reached", { sessionID: input.sessionID, pollCount });
|
|
98071
98070
|
abortSyncSession(client2, input.sessionID, "poll_timeout");
|
|
98072
98071
|
}
|
|
98073
|
-
return timedOut ?
|
|
98072
|
+
return timedOut ? `\u8F6E\u8BE2\u8D85\u65F6\uFF0C${maxPollTimeMs}ms \u540E\u4ECD\u672A\u5B8C\u6210\uFF0C\u4F1A\u8BDD ${input.sessionID}` : null;
|
|
98074
98073
|
}
|
|
98075
98074
|
|
|
98076
98075
|
// src/tools/delegate-task/sync-result-fetcher.ts
|
|
@@ -98079,7 +98078,7 @@ async function fetchSyncResult(client2, sessionID, anchorMessageCount) {
|
|
|
98079
98078
|
path: { id: sessionID }
|
|
98080
98079
|
});
|
|
98081
98080
|
if (messagesResult.error) {
|
|
98082
|
-
return { ok: false, error:
|
|
98081
|
+
return { ok: false, error: `\u83B7\u53D6\u7ED3\u679C\u9519\u8BEF\uFF1A${messagesResult.error}
|
|
98083
98082
|
|
|
98084
98083
|
Session ID: ${sessionID}` };
|
|
98085
98084
|
}
|
|
@@ -98090,7 +98089,7 @@ Session ID: ${sessionID}` };
|
|
|
98090
98089
|
if (anchorMessageCount !== undefined && messagesAfterAnchor.length === 0) {
|
|
98091
98090
|
return {
|
|
98092
98091
|
ok: false,
|
|
98093
|
-
error:
|
|
98092
|
+
error: `\u4F1A\u8BDD\u5B8C\u6210\u4F46\u672A\u751F\u6210\u65B0\u54CD\u5E94\u3002\u6A21\u578B\u53EF\u80FD\u9759\u9ED8\u5931\u8D25\u4E86\u3002
|
|
98094
98093
|
|
|
98095
98094
|
Session ID: ${sessionID}`
|
|
98096
98095
|
};
|
|
@@ -98100,13 +98099,13 @@ Session ID: ${sessionID}`
|
|
|
98100
98099
|
if (anchorMessageCount !== undefined && !lastMessage) {
|
|
98101
98100
|
return {
|
|
98102
98101
|
ok: false,
|
|
98103
|
-
error:
|
|
98102
|
+
error: `\u4F1A\u8BDD\u5B8C\u6210\u4F46\u672A\u751F\u6210\u65B0\u54CD\u5E94\u3002\u6A21\u578B\u53EF\u80FD\u9759\u9ED8\u5931\u8D25\u4E86\u3002
|
|
98104
98103
|
|
|
98105
98104
|
Session ID: ${sessionID}`
|
|
98106
98105
|
};
|
|
98107
98106
|
}
|
|
98108
98107
|
if (!lastMessage) {
|
|
98109
|
-
return { ok: false, error:
|
|
98108
|
+
return { ok: false, error: `\u672A\u627E\u5230 assistant \u54CD\u5E94\u3002
|
|
98110
98109
|
|
|
98111
98110
|
Session ID: ${sessionID}` };
|
|
98112
98111
|
}
|
|
@@ -98213,7 +98212,7 @@ async function executeSyncContinuation(args, ctx, executorCtx, parentContext, de
|
|
|
98213
98212
|
toastManager.removeTask(taskId);
|
|
98214
98213
|
}
|
|
98215
98214
|
const errorMessage = promptError instanceof Error ? promptError.message : String(promptError);
|
|
98216
|
-
return
|
|
98215
|
+
return `\u53D1\u9001\u7EED\u63A5\u63D0\u793A\u5931\u8D25\uFF1A${errorMessage}
|
|
98217
98216
|
|
|
98218
98217
|
Task ID: ${continuationID}`;
|
|
98219
98218
|
}
|
|
@@ -98233,11 +98232,11 @@ Task ID: ${continuationID}`;
|
|
|
98233
98232
|
return result.error;
|
|
98234
98233
|
}
|
|
98235
98234
|
const duration = formatDuration2(startTime);
|
|
98236
|
-
return
|
|
98235
|
+
return `\u4EFB\u52A1\u5DF2\u7EE7\u7EED\u5E76\u5728 ${duration} \u5185\u5B8C\u6210\u3002
|
|
98237
98236
|
|
|
98238
98237
|
---
|
|
98239
98238
|
|
|
98240
|
-
${result.textContent || "
|
|
98239
|
+
${result.textContent || "\uFF08\u65E0\u6587\u672C\u8F93\u51FA\uFF09"}
|
|
98241
98240
|
|
|
98242
98241
|
${buildTaskMetadataBlock({
|
|
98243
98242
|
sessionId: continuationID,
|
|
@@ -98299,7 +98298,7 @@ async function executeUnstableAgentTask(args, ctx, executorCtx, parentContext, a
|
|
|
98299
98298
|
while (!sessionID && Date.now() - waitStart < timing.WAIT_FOR_SESSION_TIMEOUT_MS) {
|
|
98300
98299
|
if (ctx.abort?.aborted) {
|
|
98301
98300
|
cleanupReason = "Parent aborted while waiting for unstable task session start";
|
|
98302
|
-
return
|
|
98301
|
+
return `\u4EFB\u52A1\u5DF2\u4E2D\u6B62\uFF0C\u6B63\u5728\u7B49\u5F85\u4F1A\u8BDD\u542F\u52A8\u3002
|
|
98303
98302
|
|
|
98304
98303
|
Task ID: ${task.id}`;
|
|
98305
98304
|
}
|
|
@@ -98309,7 +98308,7 @@ Task ID: ${task.id}`;
|
|
|
98309
98308
|
}
|
|
98310
98309
|
if (!sessionID) {
|
|
98311
98310
|
cleanupReason = "Unstable task session start timed out before session became available";
|
|
98312
|
-
return formatDetailedError(new Error(
|
|
98311
|
+
return formatDetailedError(new Error(`\u4EFB\u52A1\u5728\u8D85\u65F6\u65F6\u95F4\u5185\u672A\u80FD\u542F\u52A8\uFF0830s\uFF09\u3002Task ID: ${task.id}\uFF0C\u72B6\u6001\uFF1A${task.status}`), {
|
|
98313
98312
|
operation: "Launch monitored background task",
|
|
98314
98313
|
args,
|
|
98315
98314
|
agent: agentToUse,
|
|
@@ -98343,7 +98342,7 @@ Task ID: ${task.id}`;
|
|
|
98343
98342
|
while (Date.now() - pollStart < (syncPollTimeoutMs ?? DEFAULT_SYNC_POLL_TIMEOUT_MS)) {
|
|
98344
98343
|
if (ctx.abort?.aborted) {
|
|
98345
98344
|
cleanupReason = "Parent aborted while monitoring unstable background task";
|
|
98346
|
-
return
|
|
98345
|
+
return `\u4EFB\u52A1\u5DF2\u4E2D\u6B62\uFF08\u6B63\u5728\u540E\u53F0\u6A21\u5F0F\u4E0B\u8FD0\u884C\uFF09\u3002
|
|
98347
98346
|
|
|
98348
98347
|
Session ID: ${sessionID}`;
|
|
98349
98348
|
}
|
|
@@ -98381,16 +98380,16 @@ Session ID: ${sessionID}`;
|
|
|
98381
98380
|
}
|
|
98382
98381
|
if (terminalStatus) {
|
|
98383
98382
|
const duration2 = formatDuration2(startTime);
|
|
98384
|
-
return
|
|
98383
|
+
return `\u53D7\u76D1\u63A7\u4EFB\u52A1\u5931\u8D25 (${terminalStatus.status})
|
|
98385
98384
|
|
|
98386
|
-
|
|
98387
|
-
${terminalStatus.error ?
|
|
98385
|
+
\u4EFB\u52A1\u5728\u53D7\u76D1\u63A7\u540E\u53F0\u6A21\u5F0F\u4E0B\u88AB\u4E2D\u65AD/\u5931\u8D25\u3002
|
|
98386
|
+
${terminalStatus.error ? `\u9519\u8BEF\uFF1A${terminalStatus.error}` : ""}
|
|
98388
98387
|
|
|
98389
|
-
|
|
98390
|
-
Agent
|
|
98391
|
-
Model
|
|
98388
|
+
\u8017\u65F6\uFF1A${duration2}
|
|
98389
|
+
Agent\uFF1A${agentToUse}${args.category ? `\uFF08category\uFF1A${args.category}\uFF09` : ""}
|
|
98390
|
+
Model\uFF1A${actualModel}
|
|
98392
98391
|
|
|
98393
|
-
|
|
98392
|
+
\u4EFB\u52A1\u4F1A\u8BDD\u53EF\u80FD\u5305\u542B\u90E8\u5206\u7ED3\u679C\u3002
|
|
98394
98393
|
|
|
98395
98394
|
${buildTaskMetadataBlock({
|
|
98396
98395
|
sessionId: sessionID,
|
|
@@ -98404,16 +98403,16 @@ ${buildTaskMetadataBlock({
|
|
|
98404
98403
|
cleanupReason = "Monitored unstable background task exceeded timeout budget";
|
|
98405
98404
|
const duration2 = formatDuration2(startTime);
|
|
98406
98405
|
const timeoutBudgetMs = syncPollTimeoutMs ?? DEFAULT_SYNC_POLL_TIMEOUT_MS;
|
|
98407
|
-
return
|
|
98406
|
+
return `\u53D7\u76D1\u63A7\u4EFB\u52A1\u8D85\u65F6
|
|
98408
98407
|
|
|
98409
|
-
|
|
98410
|
-
|
|
98408
|
+
\u4EFB\u52A1\u672A\u5728\u53D7\u76D1\u63A7\u8D85\u65F6\u65F6\u95F4\u5185\u8FBE\u5230\u7A33\u5B9A\u5B8C\u6210\u4FE1\u53F7\u3002
|
|
98409
|
+
\u8D85\u65F6\u65F6\u95F4\uFF1A${timeoutBudgetMs}ms
|
|
98411
98410
|
|
|
98412
|
-
|
|
98413
|
-
Agent
|
|
98414
|
-
Model
|
|
98411
|
+
\u8017\u65F6\uFF1A${duration2}
|
|
98412
|
+
Agent\uFF1A${agentToUse}${args.category ? `\uFF08category\uFF1A${args.category}\uFF09` : ""}
|
|
98413
|
+
Model\uFF1A${actualModel}
|
|
98415
98414
|
|
|
98416
|
-
|
|
98415
|
+
\u4EFB\u52A1\u4F1A\u8BDD\u53EF\u80FD\u4ECD\u5305\u542B\u90E8\u5206\u7ED3\u679C\u3002
|
|
98417
98416
|
|
|
98418
98417
|
${buildTaskMetadataBlock({
|
|
98419
98418
|
sessionId: sessionID,
|
|
@@ -98430,7 +98429,7 @@ ${buildTaskMetadataBlock({
|
|
|
98430
98429
|
const assistantMessages = messages.filter((m) => m.info?.role === "assistant").sort((a, b) => (b.info?.time?.created ?? 0) - (a.info?.time?.created ?? 0));
|
|
98431
98430
|
const lastMessage = assistantMessages[0];
|
|
98432
98431
|
if (!lastMessage) {
|
|
98433
|
-
return
|
|
98432
|
+
return `\u672A\u627E\u5230 assistant \u54CD\u5E94\uFF08\u4EFB\u52A1\u5728\u540E\u53F0\u6A21\u5F0F\u4E0B\u8FD0\u884C\uFF09\u3002
|
|
98434
98433
|
|
|
98435
98434
|
Session ID: ${sessionID}`;
|
|
98436
98435
|
}
|
|
@@ -98445,25 +98444,25 @@ Session ID: ${sessionID}`;
|
|
|
98445
98444
|
}
|
|
98446
98445
|
}
|
|
98447
98446
|
const duration = formatDuration2(startTime);
|
|
98448
|
-
return
|
|
98447
|
+
return `\u53D7\u76D1\u63A7\u4EFB\u52A1\u6210\u529F\u5B8C\u6210
|
|
98449
98448
|
|
|
98450
|
-
|
|
98451
|
-
|
|
98449
|
+
\u91CD\u8981\u63D0\u793A\uFF1A\u6B64\u6A21\u578B\uFF08${actualModel}\uFF09\u88AB\u6807\u8BB0\u4E3A\u4E0D\u7A33\u5B9A/\u5B9E\u9A8C\u6027\u3002
|
|
98450
|
+
\u4F60\u7684 run_in_background=false \u5DF2\u81EA\u52A8\u8F6C\u6362\u4E3A\u540E\u53F0\u6A21\u5F0F\u4EE5\u8FDB\u884C\u53EF\u9760\u6027\u76D1\u63A7\u3002
|
|
98452
98451
|
|
|
98453
|
-
|
|
98454
|
-
Agent
|
|
98452
|
+
\u8017\u65F6\uFF1A${duration}
|
|
98453
|
+
Agent\uFF1A${agentToUse}${args.category ? `\uFF08category\uFF1A${args.category}\uFF09` : ""}
|
|
98455
98454
|
|
|
98456
|
-
|
|
98457
|
-
-
|
|
98458
|
-
-
|
|
98459
|
-
-
|
|
98460
|
-
-
|
|
98455
|
+
\u76D1\u63A7\u8BF4\u660E\uFF1A
|
|
98456
|
+
- \u4EFB\u52A1\u5DF2\u6210\u529F\u76D1\u63A7\u5E76\u5B8C\u6210
|
|
98457
|
+
- \u5982\u679C\u4F60\u89C2\u5BDF\u5230\u8BE5 agent \u5728\u540E\u7EED\u8C03\u7528\u4E2D\u884C\u4E3A\u5F02\u5E38\uFF0C\u8BF7\u79EF\u6781\u76D1\u63A7\u5176\u8FDB\u5EA6
|
|
98458
|
+
- \u4F7F\u7528 background_cancel(task_id="...") \u6765\u4E2D\u6B62\u770B\u8D77\u6765\u5361\u4F4F\u6216\u4EA7\u751F\u5783\u573E\u8F93\u51FA\u7684 agent
|
|
98459
|
+
- \u770B\u5230\u6B64\u6D88\u606F\u65F6\u4E0D\u8981\u81EA\u52A8\u91CD\u8BD5\u2014\u2014\u4EFB\u52A1\u5DF2\u7ECF\u6210\u529F
|
|
98461
98460
|
|
|
98462
98461
|
---
|
|
98463
98462
|
|
|
98464
|
-
|
|
98463
|
+
\u7ED3\u679C\uFF1A
|
|
98465
98464
|
|
|
98466
|
-
${textContent || "
|
|
98465
|
+
${textContent || "\uFF08\u65E0\u6587\u672C\u8F93\u51FA\uFF09"}
|
|
98467
98466
|
|
|
98468
98467
|
${buildTaskMetadataBlock({
|
|
98469
98468
|
sessionId: sessionID,
|
|
@@ -98545,7 +98544,7 @@ async function executeBackgroundTask(args, ctx, executorCtx, parentContext, agen
|
|
|
98545
98544
|
while (!sessionId && Date.now() - waitStart < timing.WAIT_FOR_SESSION_TIMEOUT_MS) {
|
|
98546
98545
|
const updated = manager.getTask(task.id);
|
|
98547
98546
|
if (updated?.status === "error" || updated?.status === "cancelled" || updated?.status === "interrupt") {
|
|
98548
|
-
return
|
|
98547
|
+
return `\u4EFB\u52A1\u542F\u52A8\u5931\u8D25\uFF08\u72B6\u6001\uFF1A${updated.status}\uFF09\u3002
|
|
98549
98548
|
|
|
98550
98549
|
Task ID: ${task.id}`;
|
|
98551
98550
|
}
|
|
@@ -98600,16 +98599,16 @@ ${buildTaskMetadataBlock({
|
|
|
98600
98599
|
agent: task.agent,
|
|
98601
98600
|
category: args.category
|
|
98602
98601
|
})}` : "";
|
|
98603
|
-
return
|
|
98602
|
+
return `\u540E\u53F0\u4EFB\u52A1\u5DF2\u542F\u52A8\u3002
|
|
98604
98603
|
|
|
98605
98604
|
Background Task ID: ${task.id}
|
|
98606
98605
|
Description: ${task.description}
|
|
98607
|
-
Agent: ${task.agent}${args.category ?
|
|
98606
|
+
Agent: ${task.agent}${args.category ? `\uFF08category\uFF1A${args.category}\uFF09` : ""}
|
|
98608
98607
|
Status: ${task.status}
|
|
98609
98608
|
|
|
98610
|
-
|
|
98609
|
+
\u7CFB\u7EDF\u4F1A\u5728\u5B8C\u6210\u65F6\u901A\u77E5\u3002\u4F7F\u7528 \`background_output\` \u548C task_id="${task.id}" \u6765\u68C0\u67E5\u7ED3\u679C\u3002
|
|
98611
98610
|
|
|
98612
|
-
|
|
98611
|
+
\u73B0\u5728\u4E0D\u8981\u8C03\u7528 background_output\u3002\u8BF7\u5148\u7B49\u5F85 <system-reminder> \u901A\u77E5\u3002${taskMetadataBlock}`;
|
|
98613
98612
|
} catch (error) {
|
|
98614
98613
|
return formatDetailedError(error, {
|
|
98615
98614
|
operation: "Launch background task",
|
|
@@ -98637,7 +98636,7 @@ async function createSyncSession(client2, input) {
|
|
|
98637
98636
|
}
|
|
98638
98637
|
});
|
|
98639
98638
|
if (createResult.error) {
|
|
98640
|
-
return { ok: false, error:
|
|
98639
|
+
return { ok: false, error: `\u521B\u5EFA\u4F1A\u8BDD\u5931\u8D25\uFF1A${createResult.error}` };
|
|
98641
98640
|
}
|
|
98642
98641
|
return { ok: true, sessionID: createResult.data.id, parentDirectory };
|
|
98643
98642
|
}
|
|
@@ -98717,7 +98716,7 @@ async function sendSyncPrompt(client2, input, deps = sendSyncPromptDeps) {
|
|
|
98717
98716
|
}
|
|
98718
98717
|
const errorMessage = promptError instanceof Error ? promptError.message : String(promptError);
|
|
98719
98718
|
if (errorMessage.includes("agent.name") || errorMessage.includes("undefined")) {
|
|
98720
|
-
return formatDetailedError(new Error(
|
|
98719
|
+
return formatDetailedError(new Error(`\u672A\u627E\u5230 Agent "${input.agentToUse}"\u3002\u8BF7\u786E\u4FDD\u8BE5 agent \u5DF2\u5728 opencode.json \u4E2D\u6CE8\u518C\u6216\u7531\u63D2\u4EF6\u63D0\u4F9B\u3002`), {
|
|
98721
98720
|
operation: "Send prompt to agent",
|
|
98722
98721
|
args: input.args,
|
|
98723
98722
|
sessionID: input.sessionID,
|
|
@@ -98937,15 +98936,15 @@ async function executeSyncTask(args, ctx, executorCtx, parentContext, agentToUse
|
|
|
98937
98936
|
const actualModelStr = effectiveCategoryModel ? `${effectiveCategoryModel.providerID}/${effectiveCategoryModel.modelID}` : undefined;
|
|
98938
98937
|
const parentModelStr = parentContext.model ? `${parentContext.model.providerID}/${parentContext.model.modelID}` : undefined;
|
|
98939
98938
|
const modelRoutingNote = actualModelStr && parentModelStr && actualModelStr !== parentModelStr ? `
|
|
98940
|
-
\u26A0\uFE0F
|
|
98941
|
-
Model
|
|
98942
|
-
return
|
|
98939
|
+
\u26A0\uFE0F \u6A21\u578B\u8DEF\u7531\uFF1A\u7236\u7EA7\u4F7F\u7528 ${parentModelStr}\uFF0C\u6B64 subagent \u4F7F\u7528 ${actualModelStr}\uFF08\u901A\u8FC7 category\uFF1A${args.category ?? "unknown"}\uFF09` : actualModelStr ? `
|
|
98940
|
+
Model\uFF1A${actualModelStr}${args.category ? `\uFF08category\uFF1A${args.category}\uFF09` : ""}` : "";
|
|
98941
|
+
return `\u4EFB\u52A1\u5728 ${duration} \u5185\u5B8C\u6210\u3002
|
|
98943
98942
|
|
|
98944
|
-
Agent
|
|
98943
|
+
Agent\uFF1A${agentToUse}${args.category ? `\uFF08category\uFF1A${args.category}\uFF09` : ""}${modelRoutingNote}
|
|
98945
98944
|
|
|
98946
98945
|
---
|
|
98947
98946
|
|
|
98948
|
-
${result.textContent || "
|
|
98947
|
+
${result.textContent || "\uFF08\u65E0\u6587\u672C\u8F93\u51FA\uFF09"}
|
|
98949
98948
|
|
|
98950
98949
|
${buildTaskMetadataBlock({
|
|
98951
98950
|
sessionId: sessionID,
|
|
@@ -99270,7 +99269,7 @@ async function resolveCategoryExecution(args, executorCtx, inheritedModel, syste
|
|
|
99270
99269
|
modelInfo: undefined,
|
|
99271
99270
|
actualModel: undefined,
|
|
99272
99271
|
isUnstableAgent: false,
|
|
99273
|
-
error:
|
|
99272
|
+
error: `\u672A\u77E5\u7684 category\uFF1A"${categoryName}"\u3002\u53EF\u7528\uFF1A${allCategoryNames}`
|
|
99274
99273
|
};
|
|
99275
99274
|
}
|
|
99276
99275
|
const availableModels = await getAvailableModelsForDelegateTask(client2);
|
|
@@ -99292,13 +99291,13 @@ async function resolveCategoryExecution(args, executorCtx, inheritedModel, syste
|
|
|
99292
99291
|
modelInfo: undefined,
|
|
99293
99292
|
actualModel: undefined,
|
|
99294
99293
|
isUnstableAgent: false,
|
|
99295
|
-
error: `Category "${categoryName}"
|
|
99294
|
+
error: `Category "${categoryName}" \u9700\u8981 model "${requirement2.requiresModel}"\uFF0C\u4F46\u8BE5 model \u4E0D\u53EF\u7528\u3002
|
|
99296
99295
|
|
|
99297
|
-
|
|
99298
|
-
1.
|
|
99299
|
-
2.
|
|
99296
|
+
\u8981\u4F7F\u7528\u6B64 category\uFF1A
|
|
99297
|
+
1. \u8FDE\u63A5\u63D0\u4F9B\u6B64 model \u7684 provider\uFF1A${requirement2.requiresModel}
|
|
99298
|
+
2. \u6216\u5728\u4F60\u7684 ${CONFIG_BASENAME}.json \u4E2D\u4E3A\u8BE5 category \u914D\u7F6E\u66FF\u4EE3 model
|
|
99300
99299
|
|
|
99301
|
-
|
|
99300
|
+
\u53EF\u7528 categories\uFF1A${allCategoryNames}`
|
|
99302
99301
|
};
|
|
99303
99302
|
}
|
|
99304
99303
|
return {
|
|
@@ -99309,7 +99308,7 @@ Available categories: ${allCategoryNames}`
|
|
|
99309
99308
|
modelInfo: undefined,
|
|
99310
99309
|
actualModel: undefined,
|
|
99311
99310
|
isUnstableAgent: false,
|
|
99312
|
-
error:
|
|
99311
|
+
error: `\u672A\u77E5\u7684 category\uFF1A"${categoryName}"\u3002\u53EF\u7528\uFF1A${allCategoryNames}`
|
|
99313
99312
|
};
|
|
99314
99313
|
}
|
|
99315
99314
|
const requirement = CATEGORY_MODEL_REQUIREMENTS[args.category];
|
|
@@ -99369,7 +99368,7 @@ Available categories: ${allCategoryNames}`
|
|
|
99369
99368
|
modelInfo: undefined,
|
|
99370
99369
|
actualModel: undefined,
|
|
99371
99370
|
isUnstableAgent: false,
|
|
99372
|
-
error:
|
|
99371
|
+
error: `\u65E0\u6548\u7684\u6A21\u578B\u683C\u5F0F\uFF1A"${actualModel}"\u3002\u671F\u671B\u683C\u5F0F\u4E3A "provider/model"\uFF08\u4F8B\u5982 "anthropic/claude-sonnet-4-6"\uFF09\u3002`
|
|
99373
99372
|
};
|
|
99374
99373
|
}
|
|
99375
99374
|
const type2 = explicitCategoryModel || overrideModel ? "user-defined" : systemDefaultModel && actualModel === systemDefaultModel ? "system-default" : "category-default";
|
|
@@ -99395,15 +99394,15 @@ Available categories: ${allCategoryNames}`
|
|
|
99395
99394
|
modelInfo: undefined,
|
|
99396
99395
|
actualModel: undefined,
|
|
99397
99396
|
isUnstableAgent: false,
|
|
99398
|
-
error:
|
|
99397
|
+
error: `\u672A\u4E3A category "${args.category}" \u914D\u7F6E Model\u3002
|
|
99399
99398
|
|
|
99400
|
-
|
|
99401
|
-
1. OpenCode
|
|
99402
|
-
2. Oh-My-OpenCode
|
|
99403
|
-
3. Provider
|
|
99399
|
+
\u8BF7\u5728\u4EE5\u4E0B\u4F4D\u7F6E\u4E4B\u4E00\u914D\u7F6E\uFF1A
|
|
99400
|
+
1. OpenCode\uFF1A\u5728 opencode.json \u4E2D\u8BBE\u7F6E "model"
|
|
99401
|
+
2. Oh-My-OpenCode\uFF1A\u5728 ${CONFIG_BASENAME}.json \u4E2D\u8BBE\u7F6E category model
|
|
99402
|
+
3. Provider\uFF1A\u8FDE\u63A5\u63D0\u4F9B\u53EF\u7528 models \u7684 provider
|
|
99404
99403
|
|
|
99405
|
-
|
|
99406
|
-
|
|
99404
|
+
\u5F53\u524D category\uFF1A${args.category}
|
|
99405
|
+
\u53EF\u7528 categories\uFF1A${categoryNames.join(", ")}`
|
|
99407
99406
|
};
|
|
99408
99407
|
}
|
|
99409
99408
|
const resolvedModel = actualModel?.toLowerCase();
|
|
@@ -99794,18 +99793,18 @@ async function resolveSubagentExecution(args, executorCtx, parentAgent, category
|
|
|
99794
99793
|
return {
|
|
99795
99794
|
agentToUse: "",
|
|
99796
99795
|
categoryModel: undefined,
|
|
99797
|
-
error:
|
|
99796
|
+
error: `\u4E0D\u80FD\u76F4\u63A5\u4F7F\u7528 subagent_type="${SISYPHUS_JUNIOR_AGENT2}"\u3002\u8BF7\u6539\u7528 category \u53C2\u6570\uFF08\u4F8B\u5982 ${categoryExamples}\uFF09\u3002
|
|
99798
99797
|
|
|
99799
|
-
|
|
99798
|
+
\u5F53\u4F60\u6307\u5B9A category \u65F6\uFF0CSisyphus-Junior \u4F1A\u81EA\u52A8\u542F\u52A8\u3002\u8BF7\u4E3A\u4F60\u7684\u4EFB\u52A1\u9886\u57DF\u9009\u62E9\u5408\u9002\u7684 category\u3002`
|
|
99800
99799
|
};
|
|
99801
99800
|
}
|
|
99802
99801
|
if (isPlanFamily(agentName) && isPlanFamily(parentAgent)) {
|
|
99803
99802
|
return {
|
|
99804
99803
|
agentToUse: "",
|
|
99805
99804
|
categoryModel: undefined,
|
|
99806
|
-
error:
|
|
99805
|
+
error: `\u4F60\u662F plan-family agent\uFF08plan/prometheus\uFF09\u3002\u4F60\u4E0D\u80FD\u901A\u8FC7 task \u59D4\u6258\u7ED9\u5176\u4ED6 plan-family agent\u3002
|
|
99807
99806
|
|
|
99808
|
-
|
|
99807
|
+
\u8BF7\u76F4\u63A5\u521B\u5EFA\u5DE5\u4F5C\u8BA1\u5212\u2014\u2014\u8FD9\u662F\u4F60\u4F5C\u4E3A\u89C4\u5212 agent \u7684\u804C\u8D23\u3002`
|
|
99809
99808
|
};
|
|
99810
99809
|
}
|
|
99811
99810
|
let agentToUse = agentName;
|
|
@@ -99822,7 +99821,7 @@ Create the work plan directly - that's your job as the planning agent.`
|
|
|
99822
99821
|
return {
|
|
99823
99822
|
agentToUse: "",
|
|
99824
99823
|
categoryModel: undefined,
|
|
99825
|
-
error:
|
|
99824
|
+
error: `\u65E0\u6CD5\u901A\u8FC7 task \u59D4\u6258\u7ED9 primary agent "${stripAgentListSortPrefix(matchedPrimaryAgent.name)}"\u3002\u8BF7\u76F4\u63A5\u9009\u62E9\u8BE5 agent\u3002`
|
|
99826
99825
|
};
|
|
99827
99826
|
}
|
|
99828
99827
|
const matchedAgent = findCallableAgentMatch(mergedAgents, agentToUse);
|
|
@@ -99830,7 +99829,7 @@ Create the work plan directly - that's your job as the planning agent.`
|
|
|
99830
99829
|
return {
|
|
99831
99830
|
agentToUse: "",
|
|
99832
99831
|
categoryModel: undefined,
|
|
99833
|
-
error:
|
|
99832
|
+
error: `\u672A\u77E5\u7684 agent\uFF1A"${agentToUse}"\u3002\u53EF\u7528 agents\uFF1A${listCallableAgentNames(mergedAgents)}`
|
|
99834
99833
|
};
|
|
99835
99834
|
}
|
|
99836
99835
|
agentToUse = stripAgentListSortPrefix(matchedAgent.name);
|
|
@@ -99912,7 +99911,7 @@ Create the work plan directly - that's your job as the planning agent.`
|
|
|
99912
99911
|
return {
|
|
99913
99912
|
agentToUse: "",
|
|
99914
99913
|
categoryModel: undefined,
|
|
99915
|
-
error:
|
|
99914
|
+
error: `\u59D4\u6258\u7ED9 agent "${agentToUse}" \u5931\u8D25\uFF1A${errorMessage}`
|
|
99916
99915
|
};
|
|
99917
99916
|
}
|
|
99918
99917
|
return { agentToUse, categoryModel, fallbackChain };
|
|
@@ -100057,14 +100056,14 @@ function createDelegateTaskPresentation(options) {
|
|
|
100057
100056
|
|
|
100058
100057
|
// src/tools/delegate-task/tools.ts
|
|
100059
100058
|
var delegateTaskArgsSchema = {
|
|
100060
|
-
load_skills: tool.schema.array(tool.schema.string()).describe("Skill
|
|
100061
|
-
description: tool.schema.string().optional().describe("
|
|
100062
|
-
prompt: tool.schema.string().describe("
|
|
100063
|
-
run_in_background: tool.schema.boolean().describe("REQUIRED
|
|
100064
|
-
category: tool.schema.string().optional().describe("
|
|
100065
|
-
subagent_type: tool.schema.string().optional().describe("
|
|
100066
|
-
task_id: tool.schema.string().optional().describe("
|
|
100067
|
-
command: tool.schema.string().optional().describe("
|
|
100059
|
+
load_skills: tool.schema.array(tool.schema.string()).describe("\u8981\u6CE8\u5165\u7684 Skill \u540D\u79F0\u3002REQUIRED - \u65E0\u9700 skills \u65F6\u8BF7\u4F20\u5165 []\u3002"),
|
|
100060
|
+
description: tool.schema.string().optional().describe("\u7B80\u77ED\u7684\u4EFB\u52A1\u63CF\u8FF0\uFF083-5 \u4E2A\u8BCD\uFF09\u3002\u5982\u7701\u7565\u5C06\u4ECE prompt \u81EA\u52A8\u751F\u6210\u3002"),
|
|
100061
|
+
prompt: tool.schema.string().describe("\u7ED9 agent \u7684\u5B8C\u6574\u8BE6\u7EC6 prompt"),
|
|
100062
|
+
run_in_background: tool.schema.boolean().describe("REQUIRED\u3002true=\u5F02\u6B65\uFF08\u8FD4\u56DE task_id\uFF09\uFF0Cfalse=\u540C\u6B65\uFF08\u7B49\u5F85\uFF09\u3002\u4EFB\u52A1\u59D4\u6258\u8BF7\u4F7F\u7528 false\uFF0C\u4EC5\u5728\u5E76\u884C\u63A2\u7D22\u65F6\u4F7F\u7528 true\u3002"),
|
|
100063
|
+
category: tool.schema.string().optional().describe("\u672A\u63D0\u4F9B subagent_type \u65F6 REQUIRED\u3002\u8BF7\u52FF\u540C\u65F6\u63D0\u4F9B category \u548C subagent_type\u3002"),
|
|
100064
|
+
subagent_type: tool.schema.string().optional().describe("\u672A\u63D0\u4F9B category \u65F6 REQUIRED\u3002\u8BF7\u52FF\u540C\u65F6\u63D0\u4F9B category \u548C subagent_type\u3002"),
|
|
100065
|
+
task_id: tool.schema.string().optional().describe("\u8981\u7EE7\u7EED\u7684\u73B0\u6709\u4EFB\u52A1\u3002\u6807\u51C6\u7684\u6062\u590D\u6807\u8BC6\u7B26\u3002"),
|
|
100066
|
+
command: tool.schema.string().optional().describe("\u89E6\u53D1\u6B64\u4EFB\u52A1\u7684 command")
|
|
100068
100067
|
};
|
|
100069
100068
|
function createDelegateTask(options) {
|
|
100070
100069
|
const { availableCategories, availableSkills, categoryExamples, description } = createDelegateTaskPresentation(options);
|
|
@@ -100092,7 +100091,7 @@ function createDelegateTask(options) {
|
|
|
100092
100091
|
return executeSyncContinuation(delegateTaskArgs, ctx, options, parentContext);
|
|
100093
100092
|
}
|
|
100094
100093
|
if (!delegateTaskArgs.category && !delegateTaskArgs.subagent_type) {
|
|
100095
|
-
return
|
|
100094
|
+
return `\u53C2\u6570\u65E0\u6548\uFF1A\u5FC5\u987B\u63D0\u4F9B category \u6216 subagent_type \u4E2D\u7684\u4E00\u4E2A\u3002`;
|
|
100096
100095
|
}
|
|
100097
100096
|
let systemDefaultModel;
|
|
100098
100097
|
try {
|
|
@@ -100581,11 +100580,11 @@ import { join as join93 } from "path";
|
|
|
100581
100580
|
import { existsSync as existsSync87, readdirSync as readdirSync24 } from "fs";
|
|
100582
100581
|
function createTaskList(config2) {
|
|
100583
100582
|
return tool({
|
|
100584
|
-
description:
|
|
100585
|
-
|
|
100586
|
-
|
|
100587
|
-
|
|
100588
|
-
|
|
100583
|
+
description: `\u5217\u51FA\u6240\u6709\u6D3B\u8DC3 task\uFF0C\u5305\u542B\u6458\u8981\u4FE1\u606F\u3002
|
|
100584
|
+
|
|
100585
|
+
\u9ED8\u8BA4\u6392\u9664\u5DF2 completed \u548C deleted \u72B6\u6001\u7684 task\u3002
|
|
100586
|
+
\u5BF9\u6BCF\u4E2A task \u7684 blockedBy \u5B57\u6BB5\uFF0C\u4EC5\u4FDD\u7559\u672A\u89E3\u51B3\uFF08\u975E completed\uFF09\u7684\u963B\u585E\u9879\u3002
|
|
100587
|
+
\u8FD4\u56DE\u6458\u8981\u683C\u5F0F\uFF1Aid\u3001subject\u3001status\u3001owner\u3001blockedBy\uFF08\u4E0D\u542B\u5B8C\u6574 description\uFF09\u3002`,
|
|
100589
100588
|
args: {},
|
|
100590
100589
|
execute: async () => {
|
|
100591
100590
|
const taskDir = getTaskDir(config2);
|
|
@@ -100620,7 +100619,7 @@ Returns summary format: id, subject, status, owner, blockedBy (not full descript
|
|
|
100620
100619
|
});
|
|
100621
100620
|
return JSON.stringify({
|
|
100622
100621
|
tasks: summaries,
|
|
100623
|
-
reminder: "1 task = 1 task
|
|
100622
|
+
reminder: "1 task = 1 task\u3002\u901A\u8FC7\u5E76\u53D1\u8FD0\u884C\u72EC\u7ACB\u7684 task\uFF08blockedBy \u4E3A\u7A7A\u7684 task\uFF09\u6700\u5927\u5316\u5E76\u884C\u6267\u884C\u6548\u7387\u3002"
|
|
100624
100623
|
});
|
|
100625
100624
|
}
|
|
100626
100625
|
});
|
|
@@ -102107,23 +102106,23 @@ async function executeHashlineEditTool(args, context, pluginCtx) {
|
|
|
102107
102106
|
const filePath = args.filePath;
|
|
102108
102107
|
const { delete: deleteMode, rename } = args;
|
|
102109
102108
|
if (deleteMode && rename) {
|
|
102110
|
-
return "
|
|
102109
|
+
return "\u9519\u8BEF\uFF1Adelete \u548C rename \u4E0D\u80FD\u540C\u65F6\u4F7F\u7528";
|
|
102111
102110
|
}
|
|
102112
102111
|
if (deleteMode && args.edits.length > 0) {
|
|
102113
|
-
return "
|
|
102112
|
+
return "\u9519\u8BEF\uFF1Adelete \u6A21\u5F0F\u8981\u6C42 edits \u4E3A\u7A7A\u6570\u7EC4";
|
|
102114
102113
|
}
|
|
102115
102114
|
if (!deleteMode && (!args.edits || !Array.isArray(args.edits) || args.edits.length === 0)) {
|
|
102116
|
-
return "
|
|
102115
|
+
return "\u9519\u8BEF\uFF1Aedits \u53C2\u6570\u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4";
|
|
102117
102116
|
}
|
|
102118
102117
|
const edits = deleteMode ? [] : normalizeHashlineEdits(args.edits);
|
|
102119
102118
|
const file = Bun.file(filePath);
|
|
102120
102119
|
const exists = await file.exists();
|
|
102121
102120
|
if (!exists && !deleteMode && !canCreateFromMissingFile(edits)) {
|
|
102122
|
-
return
|
|
102121
|
+
return `\u9519\u8BEF\uFF1A\u672A\u627E\u5230\u6587\u4EF6\uFF1A${filePath}`;
|
|
102123
102122
|
}
|
|
102124
102123
|
if (deleteMode) {
|
|
102125
102124
|
if (!exists)
|
|
102126
|
-
return
|
|
102125
|
+
return `\u9519\u8BEF\uFF1A\u672A\u627E\u5230\u6587\u4EF6\uFF1A${filePath}`;
|
|
102127
102126
|
await Bun.file(filePath).delete();
|
|
102128
102127
|
return `Successfully deleted ${filePath}`;
|
|
102129
102128
|
}
|
|
@@ -102136,7 +102135,7 @@ async function executeHashlineEditTool(args, context, pluginCtx) {
|
|
|
102136
102135
|
if (applyResult.noopEdits > 0) {
|
|
102137
102136
|
diagnostic += ` No-op edits: ${applyResult.noopEdits}. Re-read the file and provide content that differs from current lines.`;
|
|
102138
102137
|
}
|
|
102139
|
-
return
|
|
102138
|
+
return `\u9519\u8BEF\uFF1A${diagnostic}`;
|
|
102140
102139
|
}
|
|
102141
102140
|
const writeContent = restoreFileText(canonicalNewContent, oldEnvelope);
|
|
102142
102141
|
await Bun.write(filePath, writeContent);
|
|
@@ -102169,10 +102168,10 @@ async function executeHashlineEditTool(args, context, pluginCtx) {
|
|
|
102169
102168
|
} catch (error) {
|
|
102170
102169
|
const message = error instanceof Error ? error.message : String(error);
|
|
102171
102170
|
if (error instanceof HashlineMismatchError) {
|
|
102172
|
-
return
|
|
102173
|
-
|
|
102171
|
+
return `\u9519\u8BEF\uFF1Ahash \u4E0D\u5339\u914D - ${message}
|
|
102172
|
+
\u63D0\u793A\uFF1A\u8BF7\u91CD\u7528\u6700\u65B0 read/edit \u8F93\u51FA\u4E2D\u7684 LINE#ID \u6761\u76EE\uFF0C\u6216\u5728\u4E00\u6B21\u8C03\u7528\u4E2D\u6279\u91CF\u76F8\u5173\u7F16\u8F91\u3002`;
|
|
102174
102173
|
}
|
|
102175
|
-
return
|
|
102174
|
+
return `\u9519\u8BEF\uFF1A${message}`;
|
|
102176
102175
|
}
|
|
102177
102176
|
}
|
|
102178
102177
|
|
|
@@ -129846,7 +129845,7 @@ class PostHog extends PostHogBackendClient {
|
|
|
129846
129845
|
// package.json
|
|
129847
129846
|
var package_default = {
|
|
129848
129847
|
name: "@skj1724/oh-my-opencode",
|
|
129849
|
-
version: "3.17.
|
|
129848
|
+
version: "3.17.11",
|
|
129850
129849
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
129851
129850
|
main: "./dist/index.js",
|
|
129852
129851
|
types: "dist/index.d.ts",
|
|
@@ -129935,8 +129934,8 @@ var package_default = {
|
|
|
129935
129934
|
"oh-my-opencode-linux-x64-baseline": "3.17.4",
|
|
129936
129935
|
"oh-my-opencode-linux-x64-musl": "3.17.4",
|
|
129937
129936
|
"oh-my-opencode-linux-x64-musl-baseline": "3.17.4",
|
|
129938
|
-
"oh-my-opencode-windows-x64": "3.17.
|
|
129939
|
-
"oh-my-opencode-windows-x64-baseline": "3.17.
|
|
129937
|
+
"oh-my-opencode-windows-x64": "3.17.11",
|
|
129938
|
+
"oh-my-opencode-windows-x64-baseline": "3.17.11"
|
|
129940
129939
|
},
|
|
129941
129940
|
overrides: {},
|
|
129942
129941
|
trustedDependencies: [
|