tarsk 0.6.87 → 0.6.89
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/README.md +63 -24
- package/dist/bundled-skills/email-me/SKILL.md +15 -0
- package/dist/bundled-skills/email-me/scripts/__tests__/email_me.test.js +64 -0
- package/dist/bundled-skills/email-me/scripts/email_me.js +45 -0
- package/dist/bundled-skills/handoff/SKILL.md +19 -0
- package/dist/bundled-skills/tarsk-agent/SKILL.md +372 -0
- package/dist/bundled-skills/tarsk-ask-user/SKILL.md +18 -0
- package/dist/bundled-skills/tarsk-ask-user/scripts/ask_user.js +101 -0
- package/dist/bundled-skills/tarsk-bash/SKILL.md +17 -0
- package/dist/bundled-skills/tarsk-bash/scripts/bash.js +248 -0
- package/dist/bundled-skills/tarsk-browser/SKILL.md +17 -0
- package/dist/bundled-skills/tarsk-browser/scripts/browser.js +252 -0
- package/dist/bundled-skills/tarsk-chat-title/SKILL.md +14 -0
- package/dist/bundled-skills/tarsk-chat-title/scripts/chat_title.js +37 -0
- package/dist/bundled-skills/tarsk-connect-mcp/SKILL.md +23 -0
- package/dist/bundled-skills/tarsk-connect-mcp/scripts/__tests__/connect_mcp.test.js +68 -0
- package/dist/bundled-skills/tarsk-connect-mcp/scripts/connect_mcp.js +119 -0
- package/dist/bundled-skills/tarsk-create-project/SKILL.md +25 -0
- package/dist/bundled-skills/tarsk-create-project/scripts/__tests__/create_project.test.js +94 -0
- package/dist/bundled-skills/tarsk-create-project/scripts/create_project.js +88 -0
- package/dist/bundled-skills/tarsk-edit/SKILL.md +18 -0
- package/dist/bundled-skills/tarsk-edit/scripts/edit.js +118 -0
- package/dist/bundled-skills/tarsk-execute-skill-script/SKILL.md +19 -0
- package/dist/bundled-skills/tarsk-execute-skill-script/scripts/execute_skill_script.js +77 -0
- package/dist/bundled-skills/tarsk-fetch/SKILL.md +18 -0
- package/dist/bundled-skills/tarsk-fetch/scripts/fetch.js +38 -0
- package/dist/bundled-skills/tarsk-find/SKILL.md +16 -0
- package/dist/bundled-skills/tarsk-find/scripts/find.js +78 -0
- package/dist/bundled-skills/tarsk-find-images/SKILL.md +18 -0
- package/dist/bundled-skills/tarsk-find-images/scripts/find_images.js +78 -0
- package/dist/bundled-skills/tarsk-generate-image/SKILL.md +18 -0
- package/dist/bundled-skills/tarsk-generate-image/scripts/generate_image.js +55 -0
- package/dist/bundled-skills/tarsk-get-observation/SKILL.md +19 -0
- package/dist/bundled-skills/tarsk-get-observation/scripts/get_observation.js +293 -0
- package/dist/bundled-skills/tarsk-grep/SKILL.md +16 -0
- package/dist/bundled-skills/tarsk-grep/scripts/grep.js +174 -0
- package/dist/bundled-skills/tarsk-history/SKILL.md +15 -0
- package/dist/bundled-skills/tarsk-history/scripts/history.js +68 -0
- package/dist/bundled-skills/tarsk-improve/SKILL.md +232 -0
- package/dist/bundled-skills/tarsk-improve/references/signals.md +16 -0
- package/dist/bundled-skills/tarsk-improve/scripts/durable-runs.ts +635 -0
- package/dist/bundled-skills/tarsk-improve/scripts/ensure-exported.ts +238 -0
- package/dist/bundled-skills/tarsk-improve/scripts/export-tool-skills-lib.ts +299 -0
- package/dist/bundled-skills/tarsk-improve/scripts/summarize-session.ts +126 -0
- package/dist/bundled-skills/tarsk-jobs/SKILL.md +18 -0
- package/dist/bundled-skills/tarsk-jobs/scripts/job_kill.js +45 -0
- package/dist/bundled-skills/tarsk-jobs/scripts/job_list.js +64 -0
- package/dist/bundled-skills/tarsk-jobs/scripts/job_output.js +66 -0
- package/dist/bundled-skills/tarsk-notes/SKILL.md +17 -0
- package/dist/bundled-skills/tarsk-notes/scripts/notes.js +86 -0
- package/dist/bundled-skills/tarsk-projects/SKILL.md +18 -0
- package/dist/bundled-skills/tarsk-projects/scripts/projects.js +54 -0
- package/dist/bundled-skills/tarsk-prompt-project/SKILL.md +18 -0
- package/dist/bundled-skills/tarsk-prompt-project/scripts/prompt_project.js +58 -0
- package/dist/bundled-skills/tarsk-propose-branch/SKILL.md +16 -0
- package/dist/bundled-skills/tarsk-propose-branch/scripts/propose_branch.js +45 -0
- package/dist/bundled-skills/tarsk-read/SKILL.md +17 -0
- package/dist/bundled-skills/tarsk-read/scripts/read.js +331 -0
- package/dist/bundled-skills/tarsk-read-skill/SKILL.md +16 -0
- package/dist/bundled-skills/tarsk-read-skill/scripts/read_skill.js +37 -0
- package/dist/bundled-skills/tarsk-read-skill-reference/SKILL.md +19 -0
- package/dist/bundled-skills/tarsk-read-skill-reference/scripts/read_skill_reference.js +60 -0
- package/dist/bundled-skills/tarsk-run-js/SKILL.md +18 -0
- package/dist/bundled-skills/tarsk-run-js/scripts/run_js.js +192 -0
- package/dist/bundled-skills/tarsk-tasks/SKILL.md +18 -0
- package/dist/bundled-skills/tarsk-tasks/scripts/tasks.js +96 -0
- package/dist/bundled-skills/tarsk-todo/SKILL.md +16 -0
- package/dist/bundled-skills/tarsk-todo/scripts/todo.js +165 -0
- package/dist/bundled-skills/tarsk-web-search/SKILL.md +15 -0
- package/dist/bundled-skills/tarsk-web-search/scripts/web_search.js +120 -0
- package/dist/bundled-skills/tarsk-write/SKILL.md +16 -0
- package/dist/bundled-skills/tarsk-write/scripts/write.js +57 -0
- package/dist/index.js +217754 -211927
- package/dist/public/assets/{alert-dialog-DVaEQlVa.js → alert-dialog-BcZULJsX.js} +1 -1
- package/dist/public/assets/api-8Rp2LlXt.js +1 -0
- package/dist/public/assets/api-Cp9I7CxD.js +2 -0
- package/dist/public/assets/{async-error-boundary-DH6Sqgmt.js → async-error-boundary-CFVUPiuG.js} +1 -1
- package/dist/public/assets/browser-tab-CPPorbL6.js +12 -0
- package/dist/public/assets/button-DDaJhJP1.js +1 -0
- package/dist/public/assets/{card-BkOGFps5.js → card-DAc45J1v.js} +1 -1
- package/dist/public/assets/chat-dock-context-DbiJNr3O.js +1 -0
- package/dist/public/assets/chat-handlers-context-DYU2LQ5V.js +9 -0
- package/dist/public/assets/commit-dialog-DPaci3dp.js +1 -0
- package/dist/public/assets/{commit-error-dialog-D3S6kRVr.js → commit-error-dialog-Dnlkgb_H.js} +1 -1
- package/dist/public/assets/{commit-method-fields-BEKfSRyW.js → commit-method-fields-Xt3vbwUg.js} +1 -1
- package/dist/public/assets/conversation-history-view-CqIugfyO.js +1 -0
- package/dist/public/assets/{create-project-dialog-nquqlloK.js → create-project-dialog-DStWPoDE.js} +2 -2
- package/dist/public/assets/{create-project-workspace-C4tXAUWJ.js → create-project-workspace-CJ94yHAB.js} +2 -2
- package/dist/public/assets/create-repo-dialog-B_QiEz-v.js +1 -0
- package/dist/public/assets/{delete-confirm-dialog-SpYpU1AX.js → delete-confirm-dialog-D1N86piR.js} +1 -1
- package/dist/public/assets/dialog-D_12AsZd.js +1 -0
- package/dist/public/assets/diff-view-4koPcOcE.js +4 -0
- package/dist/public/assets/{dist-NcyjV9Gu.js → dist-2xH_pFmV.js} +1 -1
- package/dist/public/assets/{dist-BTu7PDzc.js → dist-AbkJBHH5.js} +1 -1
- package/dist/public/assets/{dist-lFBinzor.js → dist-B-h6Wj39.js} +1 -1
- package/dist/public/assets/dist-CgbWuuq4.js +1 -0
- package/dist/public/assets/{dist-f54JuzFV.js → dist-DOz2WXwX.js} +1 -1
- package/dist/public/assets/{dist-CqrmQxmV.js → dist-DfnQ9YJh.js} +1 -1
- package/dist/public/assets/{dist-BOfRC57H.js → dist-JGbQ_EJY.js} +1 -1
- package/dist/public/assets/{dist-ButPmyjr.js → dist-pCVg1Jdl.js} +1 -1
- package/dist/public/assets/dist-v_MvKS2-.js +2 -0
- package/dist/public/assets/{es2015-CE7VcoOH.js → es2015-eNVkKfFF.js} +1 -1
- package/dist/public/assets/{explorer-file-drop-CEbBlDEp.js → explorer-file-drop-DAP7ha-E.js} +1 -1
- package/dist/public/assets/{explorer-monaco-editor-Bgo9Y1cP.js → explorer-monaco-editor-ChJZBFy5.js} +1 -1
- package/dist/public/assets/explorer-tab-view-Bt9hRZUm.js +2 -0
- package/dist/public/assets/explorer-tree-CAs89lPz.js +1 -0
- package/dist/public/assets/{explorer-view-BuTa_0Uq.js → explorer-view-B1JuejkU.js} +3 -3
- package/dist/public/assets/git-history-dialog-Dqj1p35g.js +1 -0
- package/dist/public/assets/index-CcAwxnT5.js +97 -0
- package/dist/public/assets/index-dNrgKdYv.css +1 -0
- package/dist/public/assets/{label-C31qF5zZ.js → label-BCs5CZEs.js} +1 -1
- package/dist/public/assets/markdown-renderer-DQONI6WG.js +10 -0
- package/dist/public/assets/{mcp-manager-C3K_62H2.js → mcp-manager-D2FG-h2e.js} +1 -1
- package/dist/public/assets/{minus-l6BdrAEk.js → minus-CgQcbBQT.js} +1 -1
- package/dist/public/assets/{model-list-controls-DwW8S18v.js → model-list-controls-B6ofHWh3.js} +1 -1
- package/dist/public/assets/onboarding-dialog-DAut3X4K.js +1 -0
- package/dist/public/assets/{pill-tabs-CmvvHdKG.js → pill-tabs-BAhOHad7.js} +1 -1
- package/dist/public/assets/progress-indicator-hJ74ac5W.js +1 -0
- package/dist/public/assets/project-coding-view-B2FpHeiO.js +1 -0
- package/dist/public/assets/{project-danger-zone-view-D18k4pUF.js → project-danger-zone-view-BqP1dcRT.js} +1 -1
- package/dist/public/assets/{project-env-vars-view-BWFqoaFD.js → project-env-vars-view-zhigkQFG.js} +1 -1
- package/dist/public/assets/project-model-aliases-view-APAVFfym.js +1 -0
- package/dist/public/assets/project-settings-view-FnK-LRsv.js +1 -0
- package/dist/public/assets/project-tools-view-Dmp5ViRC.js +1 -0
- package/dist/public/assets/providers-list-view-Clbp73Hh.js +1 -0
- package/dist/public/assets/pull-request-dialog-D40BQPMk.js +1 -0
- package/dist/public/assets/pull-with-changes-dialog-pkXK-VP2.js +1 -0
- package/dist/public/assets/push-before-pr-dialog-DH91JHEC.js +1 -0
- package/dist/public/assets/query-keys-CcnonAAG.js +1 -0
- package/dist/public/assets/remote-media-url-C-GdJb-D.js +1 -0
- package/dist/public/assets/{scroll-area-BWc4OPsj.js → scroll-area-DGF9wUqQ.js} +1 -1
- package/dist/public/assets/{select-B6RizwDW.js → select-DMcNYwgt.js} +1 -1
- package/dist/public/assets/settings-general-tabs-view-DBZQbihJ.js +2 -0
- package/dist/public/assets/settings-general-view-0dhBET2R.js +1 -0
- package/dist/public/assets/{settings-list-D35rpAof.js → settings-list-Co3JPr9w.js} +1 -1
- package/dist/public/assets/settings-logs-view-DvHXUDko.js +5 -0
- package/dist/public/assets/settings-mcp-servers-view-414Dt5py.js +5 -0
- package/dist/public/assets/settings-models-view-ByeR7Enb.js +1 -0
- package/dist/public/assets/settings-plugins-view-8te2MPyh.js +2 -0
- package/dist/public/assets/settings-providers-view-BAuv9gam.js +2 -0
- package/dist/public/assets/settings-remote-machines-view-CHyywazU.js +1 -0
- package/dist/public/assets/settings-setup-view-Btp46Vh_.js +2 -0
- package/dist/public/assets/settings-skills-view-BNVx4bZl.js +2 -0
- package/dist/public/assets/{settings-slack-view-DkclyaBc.js → settings-slack-view-Caly5yGt.js} +1 -1
- package/dist/public/assets/settings-slash-commands-view-m6mp1knu.js +1 -0
- package/dist/public/assets/{settings-statistics-view-B03ZZjEy.js → settings-statistics-view-BnOxr4sZ.js} +1 -1
- package/dist/public/assets/settings-storage-view-Dg8xfpTG.js +1 -0
- package/dist/public/assets/settings-subagents-view-CucwEk2A.js +2 -0
- package/dist/public/assets/settings-system-prompt-view-CEDU2saT.js +1 -0
- package/dist/public/assets/{settings-tab-bar-ajzyt79U.js → settings-tab-bar-CdIbQ0WI.js} +1 -1
- package/dist/public/assets/settings-view-XcJhRclT.js +2 -0
- package/dist/public/assets/{slug-utils-D2jhPz-o.js → slug-utils-CO6nui1C.js} +1 -1
- package/dist/public/assets/square-CtxvwmM2.js +1 -0
- package/dist/public/assets/store-W78TGOIO.js +8 -0
- package/dist/public/assets/{table-C3Hc0Gwy.js → table-CQMqIW_-.js} +1 -1
- package/dist/public/assets/task-utils-Cnq9Eszt.js +1 -0
- package/dist/public/assets/tasks-view-B8_jkq_a.js +1 -0
- package/dist/public/assets/{terminal-panel-DCKqScJu.js → terminal-panel-xoLVfA-h.js} +2 -2
- package/dist/public/assets/{toggle-group-DqSxGqvP.js → toggle-group-CPmseZfb.js} +1 -1
- package/dist/public/assets/{tooltip-CJKJfu0l.js → tooltip-CqwCZ7wt.js} +1 -1
- package/dist/public/assets/{use-account-settings-query-AUeOqKvo.js → use-account-settings-query-D_qL1I4w.js} +1 -1
- package/dist/public/assets/{use-active-dock-panel-instance-BvAhUd_V.js → use-active-dock-panel-instance-kmJOnmL7.js} +1 -1
- package/dist/public/assets/use-browser-overlay-block-CO1pUEAZ.js +1 -0
- package/dist/public/assets/{use-git-check-B_5Jak2s.js → use-git-check-BD9gdXpK.js} +1 -1
- package/dist/public/assets/{use-installed-ai-files-iy_AB0dN.js → use-installed-ai-files-Nn-sN_V2.js} +1 -1
- package/dist/public/assets/use-open-chat-dock-panel-CXzpgxVs.js +1 -0
- package/dist/public/assets/{use-projects-BmhAMgxB.js → use-projects-B0xTjTaA.js} +2 -2
- package/dist/public/assets/utils-CqsIXqSC.js +1 -0
- package/dist/public/assets/web-BNWoiS4w.js +1 -0
- package/dist/public/assets/web-C1tBQoCB.js +1 -0
- package/dist/public/assets/web-Dlo3GwCf.js +1 -0
- package/dist/public/assets/web-cJXG33sT.js +1 -0
- package/dist/public/fonts/schibsted-grotesk-latin-ext-wght-normal.woff2 +0 -0
- package/dist/public/fonts/schibsted-grotesk-latin-wght-normal.woff2 +0 -0
- package/dist/public/index.html +46 -46
- package/package.json +9 -9
- package/dist/public/assets/account-view-5q3pHEHY.js +0 -1
- package/dist/public/assets/ai-spinner-DHwhlk4j.js +0 -1
- package/dist/public/assets/api-BdebJfuN.js +0 -1
- package/dist/public/assets/api-COO2LfdU.js +0 -2
- package/dist/public/assets/browser-overlay-block-CiDtkfup.js +0 -1
- package/dist/public/assets/browser-tab-CVdYLmW5.js +0 -12
- package/dist/public/assets/button-Dp5XDZNR.js +0 -1
- package/dist/public/assets/chat-dock-context-ymLoO90X.js +0 -1
- package/dist/public/assets/checkbox-D-BV8-Z_.js +0 -1
- package/dist/public/assets/commit-dialog-CEbCFh1x.js +0 -1
- package/dist/public/assets/conversation-history-view-CVMD8hUU.js +0 -1
- package/dist/public/assets/create-repo-dialog-B5IE3pUJ.js +0 -1
- package/dist/public/assets/dialog-pHPeIGaB.js +0 -1
- package/dist/public/assets/diff-view-Cy6nPdX-.js +0 -4
- package/dist/public/assets/dist-D5vgS4RP.js +0 -2
- package/dist/public/assets/explorer-tab-view-C-8QZO9S.js +0 -2
- package/dist/public/assets/explorer-tree-HrLSFgcI.js +0 -1
- package/dist/public/assets/git-history-dialog-ClfF5IOn.js +0 -1
- package/dist/public/assets/index-BBLA5zVt.css +0 -1
- package/dist/public/assets/index-CalVAwXj.js +0 -104
- package/dist/public/assets/markdown-renderer-DXRBG7uP.js +0 -10
- package/dist/public/assets/onboarding-dialog-BtLy0wjC.js +0 -1
- package/dist/public/assets/progress-indicator-4zQXqOqP.js +0 -1
- package/dist/public/assets/project-coding-view-CyJwnJes.js +0 -1
- package/dist/public/assets/project-model-aliases-view-D3tYNkkM.js +0 -1
- package/dist/public/assets/project-settings-view-0oN9vFvD.js +0 -1
- package/dist/public/assets/project-tools-view-DT87KPjE.js +0 -1
- package/dist/public/assets/providers-list-view-DCnh0W-5.js +0 -1
- package/dist/public/assets/pull-request-dialog-BdJxYQwu.js +0 -1
- package/dist/public/assets/pull-with-changes-dialog-Do9x9neW.js +0 -1
- package/dist/public/assets/push-before-pr-dialog-C-9z2O0-.js +0 -1
- package/dist/public/assets/query-keys-BwswkbMn.js +0 -1
- package/dist/public/assets/remote-media-url-B8OFqxOM.js +0 -1
- package/dist/public/assets/settings-general-tabs-view-Dcek-ysB.js +0 -2
- package/dist/public/assets/settings-general-view-DhA2N6G5.js +0 -1
- package/dist/public/assets/settings-logs-view-eEUTIMeb.js +0 -5
- package/dist/public/assets/settings-mcp-servers-view-_oeuVkUe.js +0 -5
- package/dist/public/assets/settings-models-view-DW-ZmVup.js +0 -1
- package/dist/public/assets/settings-plugins-view-DTooco_c.js +0 -2
- package/dist/public/assets/settings-providers-view-CEeJkhg9.js +0 -2
- package/dist/public/assets/settings-remote-machines-view--UB8GlCK.js +0 -1
- package/dist/public/assets/settings-setup-view-DFL6DlYS.js +0 -2
- package/dist/public/assets/settings-skills-view-xS569-Kb.js +0 -2
- package/dist/public/assets/settings-slash-commands-view-DrCiayfq.js +0 -1
- package/dist/public/assets/settings-storage-view-CQnaVOt_.js +0 -1
- package/dist/public/assets/settings-subagents-view-DIctUJcE.js +0 -2
- package/dist/public/assets/settings-system-prompt-view-BMDbrFRR.js +0 -1
- package/dist/public/assets/settings-view-8M6sbGiX.js +0 -2
- package/dist/public/assets/store-CxUwqrZ5.js +0 -8
- package/dist/public/assets/task-utils-WAei2PDi.js +0 -1
- package/dist/public/assets/tasks-view-DKyqgGdE.js +0 -1
- package/dist/public/assets/use-browser-overlay-block-z9imTmiZ.js +0 -1
- package/dist/public/assets/use-open-chat-dock-panel-w3hc5Vxn.js +0 -1
- package/dist/public/assets/utils-mYB1USG6.js +0 -1
- package/dist/public/assets/web-C6Gm4nQ0.js +0 -1
- package/dist/public/assets/web-DFlyNg8o.js +0 -1
- package/dist/public/assets/web-DlEPs8Xe.js +0 -1
- package/dist/public/assets/web-Gx3xReQH.js +0 -1
- package/dist/public/backgrounds/arctic-tundra.avif +0 -0
- package/dist/public/backgrounds/autumn-leaves.avif +0 -0
- package/dist/public/backgrounds/coastal-cliff.avif +0 -0
- package/dist/public/backgrounds/floating-waterfall.avif +0 -0
- package/dist/public/backgrounds/forest-path.avif +0 -0
- package/dist/public/backgrounds/garden-path.avif +0 -0
- package/dist/public/backgrounds/glow-marsh.avif +0 -0
- package/dist/public/backgrounds/golden-wheat.avif +0 -0
- package/dist/public/backgrounds/moon-desert.avif +0 -0
- package/dist/public/backgrounds/night-pond.avif +0 -0
- package/dist/public/backgrounds/prairie-grassland.avif +0 -0
- package/dist/public/backgrounds/river-winding.avif +0 -0
- package/dist/public/backgrounds/salt-flat.avif +0 -0
- package/dist/public/backgrounds/salt-marsh.avif +0 -0
- package/dist/public/backgrounds/sandy-beach.avif +0 -0
- package/dist/public/backgrounds/snow-river.avif +0 -0
- package/dist/public/backgrounds/sunset-pond.avif +0 -0
- package/dist/public/fonts/plus-jakarta-sans-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/public/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2 +0 -0
- package/dist/public/fonts/plus-jakarta-sans-latin-wght-normal.woff2 +0 -0
- package/dist/public/fonts/plus-jakarta-sans-vietnamese-wght-normal.woff2 +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* chat_title Tool — logic in the Skill; normalize via context.chat (host).
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export const description = `Rename the chat — the label above the chat and in the Chats list — when asked to title, name, rename, or label it, including a literal \`/chat-title\` in the prompt, which stays as typed.
|
|
6
|
+
|
|
7
|
+
Title the work, not the sentence: 100 characters or fewer, plain sentence case, no surrounding quotes, no trailing punctuation, no emoji. Call once per request with the final title, then carry on with any other work the prompt asked for; don't announce the title in your reply.
|
|
8
|
+
|
|
9
|
+
- Good: "Fix flaky auth test"
|
|
10
|
+
- Bad: "Please set the chat title"`;
|
|
11
|
+
|
|
12
|
+
export const parameters = {
|
|
13
|
+
type: "object",
|
|
14
|
+
properties: {
|
|
15
|
+
title: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: 'Short chat title, for example "Fix flaky auth test"',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
required: ["title"],
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
function textResult(text) {
|
|
24
|
+
return {
|
|
25
|
+
content: [{ type: "text", text }],
|
|
26
|
+
details: undefined,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** @param {{ title?: string }} args @param {{ chat: { normalizeTitle(title: string): string } }} context */
|
|
31
|
+
export async function execute(args, context) {
|
|
32
|
+
const title = context.chat.normalizeTitle(String(args.title ?? ""));
|
|
33
|
+
if (!title) {
|
|
34
|
+
return textResult("Error: title is required");
|
|
35
|
+
}
|
|
36
|
+
return textResult(`Chat title set to "${title}".`);
|
|
37
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tarsk-connect-mcp
|
|
3
|
+
description: >-
|
|
4
|
+
Connect a remote MCP server from chat. Ask for its name, URL, transport, and
|
|
5
|
+
whether it needs OAuth; save it to this project and discover its tools. Use
|
|
6
|
+
when the user asks to connect or configure a Model Context Protocol server.
|
|
7
|
+
version: 1.0.0
|
|
8
|
+
tools:
|
|
9
|
+
- connect_mcp
|
|
10
|
+
deferred-tools:
|
|
11
|
+
- connect_mcp
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Connect an MCP server
|
|
15
|
+
|
|
16
|
+
Use connect_mcp to ask the user for the remote MCP server details and connect
|
|
17
|
+
it to the current project. The tool saves the server configuration, optionally
|
|
18
|
+
runs browser-based OAuth, and discovers the server's tools. The current run's
|
|
19
|
+
tool set is fixed. The discovered tools become available on the next message in
|
|
20
|
+
the same conversation. Then search for the server name and call the selected tool.
|
|
21
|
+
|
|
22
|
+
Do not ask the user to paste a bearer token or put credentials in the URL.
|
|
23
|
+
Use OAuth or configure credentials through Settings.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
import { description, execute, parameters } from "../connect_mcp.js";
|
|
4
|
+
|
|
5
|
+
test("publishes a searchable no-argument MCP setup tool", () => {
|
|
6
|
+
assert.match(description, /connect a remote MCP server/i);
|
|
7
|
+
assert.deepEqual(parameters, { type: "object", properties: {} });
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
function runtime(answers, connectRemoteServer) {
|
|
11
|
+
return {
|
|
12
|
+
ask: {
|
|
13
|
+
wait: async function wait(questions, options) {
|
|
14
|
+
assert.equal(questions.length, 4);
|
|
15
|
+
assert.equal(options.toolCallId, "call-1");
|
|
16
|
+
return answers;
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
mcp: { connectRemoteServer },
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
test("asks for server settings, connects, and reports tools for the next message", async () => {
|
|
24
|
+
let connectArgs;
|
|
25
|
+
const result = await execute(
|
|
26
|
+
{},
|
|
27
|
+
runtime(
|
|
28
|
+
["OWF", "https://mcp.example.com/mcp", "Streamable HTTP (Recommended)", "No OAuth"],
|
|
29
|
+
async function connect(input) {
|
|
30
|
+
connectArgs = input;
|
|
31
|
+
return {
|
|
32
|
+
serverName: "OWF",
|
|
33
|
+
state: "ok",
|
|
34
|
+
tools: ["search", "fetch"],
|
|
35
|
+
authenticated: false,
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
),
|
|
39
|
+
{ toolCallId: "call-1" },
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
assert.deepEqual(connectArgs, {
|
|
43
|
+
serverName: "OWF",
|
|
44
|
+
url: "https://mcp.example.com/mcp",
|
|
45
|
+
transport: "streamableHttp",
|
|
46
|
+
useOAuth: false,
|
|
47
|
+
});
|
|
48
|
+
assert.match(result.content[0].text, /search, fetch/);
|
|
49
|
+
assert.match(result.content[0].text, /next message in this conversation/);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test("does not save configuration when the user omits a required answer", async () => {
|
|
53
|
+
let connectCalled = false;
|
|
54
|
+
const result = await execute(
|
|
55
|
+
{},
|
|
56
|
+
runtime(
|
|
57
|
+
["", "https://mcp.example.com/mcp", "Streamable HTTP", "No OAuth"],
|
|
58
|
+
async function connect() {
|
|
59
|
+
connectCalled = true;
|
|
60
|
+
return { serverName: "", state: "ok", tools: [], authenticated: false };
|
|
61
|
+
},
|
|
62
|
+
),
|
|
63
|
+
{ toolCallId: "call-1" },
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
assert.equal(connectCalled, false);
|
|
67
|
+
assert.match(result.content[0].text, /no configuration was saved/);
|
|
68
|
+
});
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
export const description =
|
|
2
|
+
"Connect a remote MCP server during this conversation. Ask for its name, URL, HTTP transport, and whether it needs OAuth; save it to the project, sign in if needed, and discover its tools. The tools are available on the next message in this conversation.";
|
|
3
|
+
|
|
4
|
+
export const parameters = {
|
|
5
|
+
type: "object",
|
|
6
|
+
properties: {},
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const questions = [
|
|
10
|
+
{
|
|
11
|
+
header: "Server name",
|
|
12
|
+
question: "What name should I use for this MCP server in the project?",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
header: "Server URL",
|
|
16
|
+
question:
|
|
17
|
+
"What is the remote MCP server URL? Do not include credentials, tokens, or query parameters in the URL.",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
header: "Transport",
|
|
21
|
+
question: "Which HTTP transport does this MCP server use?",
|
|
22
|
+
options: [
|
|
23
|
+
{
|
|
24
|
+
label: "Streamable HTTP (Recommended)",
|
|
25
|
+
description: "Use the current MCP HTTP transport.",
|
|
26
|
+
},
|
|
27
|
+
{ label: "Server-Sent Events (SSE)", description: "Use the legacy SSE transport." },
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
header: "Sign-in",
|
|
32
|
+
question: "Does this MCP server require browser-based OAuth sign-in?",
|
|
33
|
+
options: [
|
|
34
|
+
{ label: "No OAuth", description: "Connect without starting a sign-in flow." },
|
|
35
|
+
{ label: "OAuth", description: "Open the server's sign-in page in your browser." },
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
function answerText(answer) {
|
|
41
|
+
return Array.isArray(answer) ? (answer[0] ?? "") : (answer ?? "");
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function parseAnswers(answers) {
|
|
45
|
+
const serverName = answerText(answers[0]).trim();
|
|
46
|
+
const url = answerText(answers[1]).trim();
|
|
47
|
+
if (!serverName || !url) return null;
|
|
48
|
+
const transportAnswer = answerText(answers[2]);
|
|
49
|
+
const oauthAnswer = answerText(answers[3]);
|
|
50
|
+
return {
|
|
51
|
+
serverName,
|
|
52
|
+
url,
|
|
53
|
+
transport: transportAnswer.toLowerCase().includes("sse") ? "sse" : "streamableHttp",
|
|
54
|
+
useOAuth: oauthAnswer.toLowerCase() === "oauth",
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function textResult(text) {
|
|
59
|
+
return { content: [{ type: "text", text }], details: undefined };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function formatConnectedResult(result) {
|
|
63
|
+
if (result.state !== "ok") {
|
|
64
|
+
return (
|
|
65
|
+
"Saved " +
|
|
66
|
+
result.serverName +
|
|
67
|
+
", but tool discovery returned " +
|
|
68
|
+
result.state +
|
|
69
|
+
": " +
|
|
70
|
+
(result.error ?? "no details") +
|
|
71
|
+
". Check the URL, transport, and sign-in settings."
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
if (result.tools.length === 0) {
|
|
75
|
+
return (
|
|
76
|
+
"Connected to " +
|
|
77
|
+
result.serverName +
|
|
78
|
+
". It did not report any tools. The server configuration is saved in this project."
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
return formatDiscoveredTools(result);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function formatDiscoveredTools(result) {
|
|
85
|
+
const authText = result.authenticated ? " and completed OAuth sign-in" : "";
|
|
86
|
+
return (
|
|
87
|
+
"Connected to " +
|
|
88
|
+
result.serverName +
|
|
89
|
+
authText +
|
|
90
|
+
". Discovered tools: " +
|
|
91
|
+
result.tools.join(", ") +
|
|
92
|
+
". The tool set is fixed for this run, so these tools will be available on your next message in this conversation. Then search for " +
|
|
93
|
+
result.serverName +
|
|
94
|
+
" and use the matching tool."
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
async function connectAndFormat(context, input, options) {
|
|
99
|
+
try {
|
|
100
|
+
const result = await context.mcp.connectRemoteServer(input, options);
|
|
101
|
+
return textResult(formatConnectedResult(result));
|
|
102
|
+
} catch (error) {
|
|
103
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
104
|
+
return textResult("Could not connect to " + input.serverName + ": " + message);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** @param {Record<string, unknown>} args @param {import("../../../src/tools/agent-runtime/types.js").AgentRuntime} context @param {{ signal?: AbortSignal, toolCallId?: string }} [options] */
|
|
109
|
+
export async function execute(args, context, options) {
|
|
110
|
+
void args;
|
|
111
|
+
const answers = await context.ask.wait(questions, options);
|
|
112
|
+
const input = parseAnswers(answers);
|
|
113
|
+
if (!input) {
|
|
114
|
+
return textResult(
|
|
115
|
+
"Connection cancelled. A server name and URL are required; no configuration was saved.",
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
return connectAndFormat(context, input, options);
|
|
119
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tarsk-create-project
|
|
3
|
+
description: >-
|
|
4
|
+
Create a web application from the scaffold templates shown in Tarsk Create Project.
|
|
5
|
+
Use this when the user asks to create a new scaffolded application or project.
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
tools:
|
|
8
|
+
- create_project
|
|
9
|
+
deferred-tools:
|
|
10
|
+
- create_project
|
|
11
|
+
disable-model-invocation: true
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Create a project
|
|
15
|
+
|
|
16
|
+
This skill runs only when the user invokes it or explicitly requests it. Guide the user through creating a scaffolded web application with the same template catalog and project creation path as the Create Project UI.
|
|
17
|
+
|
|
18
|
+
1. Call create_project with action list_templates. Use only the returned template type and variation names. Do not invent options.
|
|
19
|
+
2. Use ask_user to ask which application type they want, unless they already named a type that matches an available option. Show the available types and short descriptions.
|
|
20
|
+
3. Use ask_user to ask which variation they want within that type, unless they already chose one. Show only variations for that type.
|
|
21
|
+
4. Use ask_user to ask for the project name, unless they already provided one.
|
|
22
|
+
5. Create the project with the selected template ID and name. Use Bun as the package manager unless the user asks for another supported manager. Do not ask for a second confirmation after the user has provided these choices.
|
|
23
|
+
6. Report success only after the tool confirms it. If it returns an error or cancellation, report that result and do not claim the project exists.
|
|
24
|
+
|
|
25
|
+
Do not use this workflow for cloning a repository, opening an existing folder, or creating a blank folder project. Those are separate Create Project UI modes.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
|
|
4
|
+
import { execute } from "../create_project.js";
|
|
5
|
+
|
|
6
|
+
function contextWithProjects(projects) {
|
|
7
|
+
return { projects };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
void test("lists only the host scaffold catalog", async () => {
|
|
11
|
+
const calls = { list: 0, create: 0 };
|
|
12
|
+
const context = contextWithProjects({
|
|
13
|
+
async listScaffoldTemplates() {
|
|
14
|
+
calls.list += 1;
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
id: "react-starter",
|
|
18
|
+
typeName: "React",
|
|
19
|
+
variationName: "Starter",
|
|
20
|
+
description: "React app",
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
},
|
|
24
|
+
async createScaffoldProject() {
|
|
25
|
+
calls.create += 1;
|
|
26
|
+
return { ok: true, projectId: "project-1", projectName: "Demo", threadId: "thread-1" };
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const result = await execute({ action: "list_templates" }, context);
|
|
31
|
+
|
|
32
|
+
assert.deepEqual(JSON.parse(result.content[0].text), {
|
|
33
|
+
templates: [
|
|
34
|
+
{
|
|
35
|
+
id: "react-starter",
|
|
36
|
+
typeName: "React",
|
|
37
|
+
variationName: "Starter",
|
|
38
|
+
description: "React app",
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
});
|
|
42
|
+
assert.deepEqual(calls, { list: 1, create: 0 });
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
void test("creates the chosen template with the default package manager", async () => {
|
|
46
|
+
const calls = [];
|
|
47
|
+
const options = { signal: new AbortController().signal };
|
|
48
|
+
const context = contextWithProjects({
|
|
49
|
+
async listScaffoldTemplates() {
|
|
50
|
+
return [];
|
|
51
|
+
},
|
|
52
|
+
async createScaffoldProject(input, receivedOptions) {
|
|
53
|
+
calls.push({ input, receivedOptions });
|
|
54
|
+
return { ok: true, projectId: "project-1", projectName: "Demo", threadId: "thread-1" };
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const result = await execute(
|
|
59
|
+
{ action: "create", projectName: " Demo ", templateId: "react-starter" },
|
|
60
|
+
context,
|
|
61
|
+
options,
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
assert.deepEqual(calls, [
|
|
65
|
+
{
|
|
66
|
+
input: { projectName: "Demo", templateId: "react-starter", packageManager: "bun" },
|
|
67
|
+
receivedOptions: options,
|
|
68
|
+
},
|
|
69
|
+
]);
|
|
70
|
+
assert.deepEqual(JSON.parse(result.content[0].text), {
|
|
71
|
+
ok: true,
|
|
72
|
+
projectName: "Demo",
|
|
73
|
+
projectId: "project-1",
|
|
74
|
+
threadId: "thread-1",
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
void test("rejects incomplete creation requests without creating a project", async () => {
|
|
79
|
+
let createCount = 0;
|
|
80
|
+
const context = contextWithProjects({
|
|
81
|
+
async listScaffoldTemplates() {
|
|
82
|
+
return [];
|
|
83
|
+
},
|
|
84
|
+
async createScaffoldProject() {
|
|
85
|
+
createCount += 1;
|
|
86
|
+
return { ok: true, projectId: "project-1", projectName: "Demo", threadId: "thread-1" };
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
const result = await execute({ action: "create", projectName: "Demo" }, context);
|
|
91
|
+
|
|
92
|
+
assert.match(result.content[0].text, /templateId is required/i);
|
|
93
|
+
assert.equal(createCount, 0);
|
|
94
|
+
});
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/** Create Project UI scaffold workflow, exposed only by explicit skill invocation. */
|
|
2
|
+
|
|
3
|
+
export const description =
|
|
4
|
+
"List Tarsk web-app scaffold types and variations, or create a project from a selected built-in template. Use list_templates first. Creating a project runs the selected template and package-manager setup commands.";
|
|
5
|
+
|
|
6
|
+
export const parameters = {
|
|
7
|
+
type: "object",
|
|
8
|
+
properties: {
|
|
9
|
+
action: {
|
|
10
|
+
type: "string",
|
|
11
|
+
enum: ["list_templates", "create"],
|
|
12
|
+
description:
|
|
13
|
+
"List available templates, or create one after the user chooses its type, variation, and project name.",
|
|
14
|
+
},
|
|
15
|
+
projectName: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "Required for create. The project name the user chose.",
|
|
18
|
+
},
|
|
19
|
+
templateId: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Required for create. The id of a template returned by list_templates.",
|
|
22
|
+
},
|
|
23
|
+
packageManager: {
|
|
24
|
+
type: "string",
|
|
25
|
+
enum: ["bun", "npm", "pnpm", "yarn"],
|
|
26
|
+
description: "Package manager for the scaffold and dependency installation. Defaults to bun.",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
required: ["action"],
|
|
30
|
+
additionalProperties: false,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
function textResult(text) {
|
|
34
|
+
return { content: [{ type: "text", text }] };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function resolveCreateInput(args) {
|
|
38
|
+
if (typeof args.projectName !== "string" || !args.projectName.trim()) {
|
|
39
|
+
return { error: "Error: projectName is required for create" };
|
|
40
|
+
}
|
|
41
|
+
if (typeof args.templateId !== "string" || !args.templateId.trim()) {
|
|
42
|
+
return { error: "Error: templateId is required for create" };
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
input: {
|
|
46
|
+
projectName: args.projectName.trim(),
|
|
47
|
+
templateId: args.templateId.trim(),
|
|
48
|
+
packageManager: args.packageManager ?? "bun",
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function formatCreateResult(result) {
|
|
54
|
+
if (!result.ok) return textResult("Project creation was cancelled.");
|
|
55
|
+
return textResult(
|
|
56
|
+
JSON.stringify({
|
|
57
|
+
ok: true,
|
|
58
|
+
projectName: result.projectName,
|
|
59
|
+
projectId: result.projectId,
|
|
60
|
+
threadId: result.threadId,
|
|
61
|
+
}),
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function formatError(error) {
|
|
66
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
67
|
+
return textResult("Error: " + message);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export async function execute(args, context, options) {
|
|
71
|
+
if (args.action === "list_templates") {
|
|
72
|
+
try {
|
|
73
|
+
const templates = await context.projects.listScaffoldTemplates();
|
|
74
|
+
return textResult(JSON.stringify({ templates }));
|
|
75
|
+
} catch (error) {
|
|
76
|
+
return formatError(error);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (args.action !== "create") return textResult("Error: action must be list_templates or create");
|
|
80
|
+
const resolved = resolveCreateInput(args);
|
|
81
|
+
if (resolved.error) return textResult(resolved.error);
|
|
82
|
+
try {
|
|
83
|
+
const result = await context.projects.createScaffoldProject(resolved.input, options);
|
|
84
|
+
return formatCreateResult(result);
|
|
85
|
+
} catch (error) {
|
|
86
|
+
return formatError(error);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tarsk-edit
|
|
3
|
+
description: >-
|
|
4
|
+
Tarsk Tool skill publishing: edit.
|
|
5
|
+
version: 3.0.1
|
|
6
|
+
tools:
|
|
7
|
+
- edit
|
|
8
|
+
disable-model-invocation: true
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# tarsk-edit
|
|
12
|
+
|
|
13
|
+
Publishes: edit.
|
|
14
|
+
|
|
15
|
+
Success / skip / after-proof copy lives in `scripts/edit.js` (tune for tokens).
|
|
16
|
+
|
|
17
|
+
Host `context.fs.applyEdit`: path lock, cwd containment, hunk matching, write,
|
|
18
|
+
structured proof lines + after-window body.
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* edit — model-facing copy lives here (malleable).
|
|
3
|
+
* Host: context.fs.applyEdit (path lock, cwd check, hunk apply).
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export const description =
|
|
7
|
+
"Replace exact text (unique unless replaceAll/line/occurrenceIndex). oldText and newText must differ. Prefer in-place edits over insert-before-anchor; insert retries duplicate lines and are skipped when already present. To append, copy the last unique lines into oldText (never empty oldText or newText alone); use write only to replace the entire file. On an ambiguous match, choose a listed site with occurrenceIndex or line — never both (do not assume the first). After apply, a numbered after-window (~30 lines) surrounds the change; do not re-read the file unless the next hunk is outside that window. Parallelize independent files. Concurrent edits to the same path are serialized; prefer one replacements call.";
|
|
8
|
+
|
|
9
|
+
export const parameters = {
|
|
10
|
+
type: "object",
|
|
11
|
+
required: ["path"],
|
|
12
|
+
properties: {
|
|
13
|
+
path: { type: "string" },
|
|
14
|
+
oldText: { type: "string" },
|
|
15
|
+
newText: { type: "string" },
|
|
16
|
+
replaceAll: { type: "boolean" },
|
|
17
|
+
replacements: {
|
|
18
|
+
minItems: 1,
|
|
19
|
+
description: "batch hunks, applied in order",
|
|
20
|
+
type: "array",
|
|
21
|
+
items: {
|
|
22
|
+
type: "object",
|
|
23
|
+
required: ["oldText", "newText"],
|
|
24
|
+
properties: {
|
|
25
|
+
oldText: { type: "string" },
|
|
26
|
+
newText: { type: "string" },
|
|
27
|
+
replaceAll: { type: "boolean" },
|
|
28
|
+
line: { description: "1-based start line", minimum: 1, type: "integer" },
|
|
29
|
+
occurrenceIndex: {
|
|
30
|
+
description: "1-based; first match is 1",
|
|
31
|
+
minimum: 1,
|
|
32
|
+
type: "integer",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
line: { description: "1-based start line", minimum: 1, type: "integer" },
|
|
38
|
+
occurrenceIndex: {
|
|
39
|
+
description: "1-based; first match is 1",
|
|
40
|
+
minimum: 1,
|
|
41
|
+
type: "integer",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/** Format apply outcomes for the model — edit to tune tokens / next-hunk guidance. */
|
|
47
|
+
function formatEditApplyForModel(outcome) {
|
|
48
|
+
if (outcome.status === "aborted") {
|
|
49
|
+
return { content: [], details: undefined };
|
|
50
|
+
}
|
|
51
|
+
if (outcome.status === "reverted_tool_skill_load_failed") {
|
|
52
|
+
return {
|
|
53
|
+
content: [{ type: "text", text: outcome.message }],
|
|
54
|
+
details: undefined,
|
|
55
|
+
isError: true,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (outcome.status === "unchanged_already_applied") {
|
|
59
|
+
if (outcome.proved) {
|
|
60
|
+
const block = outcome.afterProofLines.join("\n");
|
|
61
|
+
const text = block
|
|
62
|
+
? `already applied (skipped): ${outcome.path}\n${block}`
|
|
63
|
+
: `already applied (skipped): ${outcome.path}`;
|
|
64
|
+
return {
|
|
65
|
+
content: [{ type: "text", text }],
|
|
66
|
+
details: {
|
|
67
|
+
diff: "",
|
|
68
|
+
replacementCount: 0,
|
|
69
|
+
afterProof: outcome.afterProofLines,
|
|
70
|
+
proved: true,
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
content: [
|
|
76
|
+
{
|
|
77
|
+
type: "text",
|
|
78
|
+
text:
|
|
79
|
+
`already applied (skipped): ${outcome.path}, but newText is not on disk ` +
|
|
80
|
+
`(${JSON.stringify(outcome.missing)}). File was not changed. Last lines:\n${outcome.fileTail}\n` +
|
|
81
|
+
`To append, copy the last unique lines into oldText and put those same lines plus the suffix in newText.`,
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
details: {
|
|
85
|
+
diff: "",
|
|
86
|
+
replacementCount: 0,
|
|
87
|
+
afterProof: outcome.afterProofLines,
|
|
88
|
+
proved: false,
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
const hunkLabel = outcome.hunkCount === 1 ? "text" : `${outcome.hunkCount} hunks`;
|
|
93
|
+
const snapNotice = outcome.lineSnaps.length > 0 ? `\n${outcome.lineSnaps.join("\n")}` : "";
|
|
94
|
+
let summary = `Successfully replaced ${hunkLabel} in ${outcome.path}.${snapNotice}`;
|
|
95
|
+
if (outcome.proved) {
|
|
96
|
+
const block = outcome.afterProofLines.join("\n");
|
|
97
|
+
if (block) summary = `${summary}\n${block}`;
|
|
98
|
+
} else {
|
|
99
|
+
summary =
|
|
100
|
+
`${summary}\n` +
|
|
101
|
+
`after-proof warning: could not find ${JSON.stringify(outcome.missing)} as a contiguous substring; ` +
|
|
102
|
+
`the file was still written. Do not re-apply the same hunk.`;
|
|
103
|
+
}
|
|
104
|
+
let text = outcome.afterWindow ? `${summary}\n${outcome.afterWindow}` : summary;
|
|
105
|
+
if (outcome.syntaxDiagnostics) {
|
|
106
|
+
text = `${text}\n\n${outcome.syntaxDiagnostics}`;
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
content: [{ type: "text", text }],
|
|
110
|
+
details: outcome.details,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** @param {Record<string, unknown>} args @param {import("../../../../src/tools/agent-runtime/types.js").AgentRuntime} context @param {{ signal?: AbortSignal }} [options] */
|
|
115
|
+
export async function execute(args, context, options) {
|
|
116
|
+
const outcome = await context.fs.applyEdit(args, { signal: options?.signal });
|
|
117
|
+
return formatEditApplyForModel(outcome);
|
|
118
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tarsk-execute-skill-script
|
|
3
|
+
description: >-
|
|
4
|
+
Tarsk Tool skill publishing: execute_skill_script.
|
|
5
|
+
version: 2.0.0
|
|
6
|
+
tools:
|
|
7
|
+
- execute_skill_script
|
|
8
|
+
deferred-tools:
|
|
9
|
+
- execute_skill_script
|
|
10
|
+
disable-model-invocation: true
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# tarsk-execute-skill-script
|
|
14
|
+
|
|
15
|
+
Publishes: execute_skill_script.
|
|
16
|
+
|
|
17
|
+
STDOUT/STDERR / miss / cancel / timeout copy in
|
|
18
|
+
`scripts/execute_skill_script.js`. Host `context.skillsCatalog.executeScript`
|
|
19
|
+
returns structured capture (permission gate + sandbox + spawn).
|