tarsk 0.4.9 → 0.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/index.js +18 -36
  2. package/dist/public/assets/account-view-D1x7ZeLs.js +1 -0
  3. package/dist/public/assets/add-agent-view-Ctbm0EgW.js +1 -0
  4. package/dist/public/assets/add-rule-view-xKAYGOl5.js +7 -0
  5. package/dist/public/assets/add-skill-view-D63xCrVn.js +1 -0
  6. package/dist/public/assets/add-slash-command-view-paJjkCml.js +1 -0
  7. package/dist/public/assets/browser-tab-CWkk3b20.js +1 -0
  8. package/dist/public/assets/conversation-history-view-BdJJ-7zE.js +1 -0
  9. package/dist/public/assets/{dialogs-config-CdogKQE6.js → dialogs-config-CB7G-sX6.js} +13 -13
  10. package/dist/public/assets/diff-view-kPjfhf7_.js +3 -0
  11. package/dist/public/assets/file-tree-sidebar-D58ROyfi.js +1 -0
  12. package/dist/public/assets/files-tab-view-DhnLTfaB.js +2 -0
  13. package/dist/public/assets/files-view-C1vg37wD.js +1 -0
  14. package/dist/public/assets/history-view-D-hEB6Qt.js +1 -0
  15. package/dist/public/assets/index-D7yQjYyf.js +16 -0
  16. package/dist/public/assets/index-DVHw8RF4.css +1 -0
  17. package/dist/public/assets/{mcp-manager-BNA3V6Cy.js → mcp-manager-J9VCn8-1.js} +1 -1
  18. package/dist/public/assets/{mcp-server-edit-view-B_xPUXV1.js → mcp-server-edit-view-yd_q5UVd.js} +3 -3
  19. package/dist/public/assets/mcp-servers-sidebar-Bwg40dY8.js +1 -0
  20. package/dist/public/assets/mcp-view-BYzQiRVC.js +1 -0
  21. package/dist/public/assets/onboarding-CxK4aR2J.js +1 -0
  22. package/dist/public/assets/onboarding-dialog-DX7DCkK0.js +1 -0
  23. package/dist/public/assets/project-settings-view-CkAqtfjP.js +1 -0
  24. package/dist/public/assets/provider-details-view-CzsPzv6h.js +1 -0
  25. package/dist/public/assets/providers-sidebar-BokZx2tk.js +1 -0
  26. package/dist/public/assets/radio-group-BpmnaKJk.js +1 -0
  27. package/dist/public/assets/react-vendor-CR4cAsbx.js +17 -0
  28. package/dist/public/assets/settings-view-CoL0k8nt.js +2 -0
  29. package/dist/public/assets/side-panel-resizer-CVC2NC75.js +1 -0
  30. package/dist/public/assets/store-CxlaVYZ6.js +2 -0
  31. package/dist/public/assets/terminal-panel-Bv2hLEfW.js +2 -0
  32. package/dist/public/assets/todos-view-FJ5GkG21.js +1 -0
  33. package/dist/public/assets/{utils-B7eoN2Bj.js → utils-DVGxCyLB.js} +1 -1
  34. package/dist/public/index.html +9 -10
  35. package/package.json +1 -1
  36. package/dist/public/assets/account-view-D2dv34vY.js +0 -1
  37. package/dist/public/assets/add-agent-view-DM__lVyy.js +0 -1
  38. package/dist/public/assets/add-rule-view-BomwxNHB.js +0 -7
  39. package/dist/public/assets/add-skill-view-JiUioTS0.js +0 -1
  40. package/dist/public/assets/add-slash-command-view--JU5d22L.js +0 -1
  41. package/dist/public/assets/conversation-history-view-C2i3vP6t.js +0 -1
  42. package/dist/public/assets/diff-view-BOokQeYx.js +0 -3
  43. package/dist/public/assets/file-tree-sidebar-BXedO8ZD.js +0 -1
  44. package/dist/public/assets/files-view-BK-J3s66.js +0 -1
  45. package/dist/public/assets/history-view-DtTMEZIl.js +0 -1
  46. package/dist/public/assets/index-BR4u03pf.js +0 -17
  47. package/dist/public/assets/index-LCD_R39p.css +0 -1
  48. package/dist/public/assets/mcp-servers-sidebar-Cv-D6sy7.js +0 -1
  49. package/dist/public/assets/mcp-view-TSM0sRuR.js +0 -1
  50. package/dist/public/assets/onboarding-dialog-C3veuByQ.js +0 -1
  51. package/dist/public/assets/onboarding-gO0dp5Em.js +0 -1
  52. package/dist/public/assets/project-settings-view-CwvIMmXu.js +0 -1
  53. package/dist/public/assets/provider-details-view-Dcm9ZdOm.js +0 -1
  54. package/dist/public/assets/providers-sidebar-B5hxgXyK.js +0 -1
  55. package/dist/public/assets/radio-group-BQ7i054U.js +0 -1
  56. package/dist/public/assets/react-vendor-BNQTbRKd.js +0 -17
  57. package/dist/public/assets/settings-view-Di5K8IgA.js +0 -2
  58. package/dist/public/assets/store-CB5vVIg-.js +0 -2
  59. package/dist/public/assets/use-toast-DCmq-wgl.js +0 -1
  60. /package/dist/public/assets/{monaco-DKN4dKR5.js → monaco-Cp3BWanQ.js} +0 -0
package/dist/index.js CHANGED
@@ -9645,17 +9645,6 @@ import { rm as rm3 } from "fs/promises";
9645
9645
  // src/agent/agent.process-manager.ts
9646
9646
  init_utils();
9647
9647
  import { EventEmitter } from "events";
9648
- var Utils = null;
9649
- var utilsLoaded = false;
9650
- async function loadUtils() {
9651
- if (utilsLoaded) return;
9652
- utilsLoaded = true;
9653
- try {
9654
- const electrobun = await import("electrobun/bun");
9655
- Utils = electrobun.Utils;
9656
- } catch {
9657
- }
9658
- }
9659
9648
  var URL_PATTERNS = [
9660
9649
  // http(s)://localhost:PORT
9661
9650
  /https?:\/\/localhost[:/](\d+)/i,
@@ -9692,7 +9681,6 @@ var ProcessManager = class extends EventEmitter {
9692
9681
  "cwd:",
9693
9682
  cwd
9694
9683
  );
9695
- await loadUtils();
9696
9684
  if (this.processes.has(projectId)) {
9697
9685
  console.log("CLI ProcessManager: Process already running for project:", projectId);
9698
9686
  yield {
@@ -9747,9 +9735,6 @@ var ProcessManager = class extends EventEmitter {
9747
9735
  urlDetected = true;
9748
9736
  this.detectedUrls.set(projectId, detectedUrl);
9749
9737
  devServerCache.setUrl(threadId, detectedUrl);
9750
- if (Utils) {
9751
- Utils.openExternal(detectedUrl);
9752
- }
9753
9738
  addToQueue({ type: "url", url: detectedUrl });
9754
9739
  }
9755
9740
  }
@@ -9764,9 +9749,6 @@ var ProcessManager = class extends EventEmitter {
9764
9749
  urlDetected = true;
9765
9750
  this.detectedUrls.set(projectId, detectedUrl);
9766
9751
  devServerCache.setUrl(threadId, detectedUrl);
9767
- if (Utils) {
9768
- Utils.openExternal(detectedUrl);
9769
- }
9770
9752
  addToQueue({ type: "url", url: detectedUrl });
9771
9753
  }
9772
9754
  }
@@ -10854,14 +10836,14 @@ function generateRandomThreadName() {
10854
10836
  }
10855
10837
 
10856
10838
  // src/features/projects/projects.creator.ts
10857
- var Utils2 = null;
10858
- var utilsLoaded2 = false;
10859
- async function loadUtils2() {
10860
- if (utilsLoaded2) return;
10861
- utilsLoaded2 = true;
10839
+ var Utils = null;
10840
+ var utilsLoaded = false;
10841
+ async function loadUtils() {
10842
+ if (utilsLoaded) return;
10843
+ utilsLoaded = true;
10862
10844
  try {
10863
10845
  const electrobun = await import("electrobun/bun");
10864
- Utils2 = electrobun.Utils;
10846
+ Utils = electrobun.Utils;
10865
10847
  } catch {
10866
10848
  }
10867
10849
  }
@@ -11156,12 +11138,12 @@ var ProjectCreator = class {
11156
11138
  return join16(this.rootFolder, threadId);
11157
11139
  }
11158
11140
  async *createProjectFromFolder() {
11159
- await loadUtils2();
11160
- if (!Utils2) {
11141
+ await loadUtils();
11142
+ if (!Utils) {
11161
11143
  yield { type: "error", message: "File dialog not available in server mode" };
11162
11144
  return;
11163
11145
  }
11164
- const chosenPaths = await Utils2.openFileDialog({
11146
+ const chosenPaths = await Utils.openFileDialog({
11165
11147
  canChooseFiles: false,
11166
11148
  canChooseDirectory: true,
11167
11149
  allowsMultipleSelection: false
@@ -12044,20 +12026,20 @@ async function getProviderCredits(c, metadataManager) {
12044
12026
  }
12045
12027
 
12046
12028
  // src/features/providers/providers-open-external.route.ts
12047
- var Utils3 = null;
12048
- var utilsLoaded3 = false;
12049
- async function loadUtils3() {
12050
- if (utilsLoaded3) return;
12051
- utilsLoaded3 = true;
12029
+ var Utils2 = null;
12030
+ var utilsLoaded2 = false;
12031
+ async function loadUtils2() {
12032
+ if (utilsLoaded2) return;
12033
+ utilsLoaded2 = true;
12052
12034
  try {
12053
12035
  const electrobun = await import("electrobun/bun");
12054
- Utils3 = electrobun.Utils;
12036
+ Utils2 = electrobun.Utils;
12055
12037
  } catch {
12056
12038
  }
12057
12039
  }
12058
12040
  async function openExternalUrl(c) {
12059
12041
  try {
12060
- await loadUtils3();
12042
+ await loadUtils2();
12061
12043
  const { url } = await c.req.json();
12062
12044
  if (!url || typeof url !== "string") {
12063
12045
  return c.json({ error: "URL is required and must be a string" }, 400);
@@ -12067,8 +12049,8 @@ async function openExternalUrl(c) {
12067
12049
  } catch {
12068
12050
  return c.json({ error: "Invalid URL format" }, 400);
12069
12051
  }
12070
- if (Utils3) {
12071
- await Utils3.openExternal(url);
12052
+ if (Utils2) {
12053
+ await Utils2.openExternal(url);
12072
12054
  return c.json({ success: true });
12073
12055
  } else {
12074
12056
  console.error(`External URL opening not available in server mode: ${url}`);
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{Nt as t,Pi as n,Rr as r,Vr as i,X as a,dn as o,er as s,li as c,wi as l}from"./dialogs-config-CB7G-sX6.js";import{a as u}from"./index-D7yQjYyf.js";var d=e(n(),1),f=s();function p(){let[e,n]=(0,d.useState)(null),[s,p]=(0,d.useState)(!0);(0,d.useEffect)(()=>{m();let e=()=>{document.visibilityState===`visible`&&m()};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]);async function m(){p(!0);try{n(await a())}catch(e){u({title:`Error`,description:e instanceof Error?e.message:`Failed to load account info`,variant:`destructive`})}finally{p(!1)}}function h(){t(`https://buy.stripe.com/14AcN6feK0Jjbheb2H3Nm03?client_reference_id=${e?.clientReferenceId??``}`)}function g(){t(`https://buy.stripe.com/9B67sMd6CgIh70Y0o33Nm04?client_reference_id=${e?.clientReferenceId??``}`)}if(s)return(0,f.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,f.jsx)(i,{className:`h-5 w-5 animate-spin text-muted-foreground`})});let _=e?.plan===`unlimited-pro`;return(0,f.jsxs)(`div`,{className:`max-w-2xl mx-auto p-6`,children:[(0,f.jsxs)(`div`,{className:`mb-6`,children:[(0,f.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Account`}),(0,f.jsx)(`p`,{className:`text-muted-foreground`,children:`Manage your Tarsk plan and prompt balance.`})]}),(0,f.jsxs)(`div`,{className:`space-y-6`,children:[(0,f.jsxs)(`div`,{className:`flex gap-4`,children:[(0,f.jsxs)(`div`,{className:`flex-1 rounded-xl border bg-card p-5 space-y-2`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-muted-foreground`,children:[(0,f.jsx)(r,{className:`h-4 w-4`}),`Balance`]}),(0,f.jsx)(`div`,{className:`flex items-end gap-2`,children:_?(0,f.jsx)(`span`,{className:`text-3xl font-bold`,children:`Unlimited`}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`span`,{className:`text-3xl font-bold`,children:e?.promptsRemaining.toLocaleString()??0}),(0,f.jsx)(`span`,{className:`text-muted-foreground mb-1 text-sm`,children:`prompts remaining`})]})})]}),(0,f.jsxs)(`div`,{className:`flex-1 rounded-xl border bg-card p-5 space-y-3`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-muted-foreground`,children:[(0,f.jsx)(c,{className:`h-4 w-4`}),`Current Plan`]}),(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,f.jsx)(`span`,{className:`text-lg font-semibold`,children:_?`Unlimited Pro`:`Pay as you go`}),_&&(0,f.jsx)(`span`,{className:`rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary`,children:`Active`})]}),(0,f.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:_?`You have unlimited prompts with no restrictions.`:`Purchase prompts as needed. Upgrade to Pro for unlimited access.`})]})]}),!_&&(0,f.jsxs)(`div`,{className:`space-y-3`,children:[(0,f.jsx)(`h2`,{className:`text-sm font-semibold text-muted-foreground uppercase tracking-wide`,children:`Add Prompts`}),(0,f.jsxs)(`div`,{className:`rounded-xl border bg-card p-5 flex items-center justify-between gap-4`,children:[(0,f.jsxs)(`div`,{className:`space-y-1`,children:[(0,f.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,f.jsx)(`span`,{className:`font-semibold`,children:`1,000 Prompts`})}),(0,f.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Top up your balance with 1,000 additional prompts for $5.`})]}),(0,f.jsx)(o,{onClick:h,className:`shrink-0`,children:`Top Up Balance`})]}),(0,f.jsxs)(`div`,{className:`rounded-xl border bg-card p-5 flex items-center justify-between gap-4`,children:[(0,f.jsxs)(`div`,{className:`space-y-1`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,f.jsx)(c,{className:`h-4 w-4 text-primary`}),(0,f.jsx)(`span`,{className:`font-semibold`,children:`Unlimited Pro Plan`})]}),(0,f.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Unlimited prompts for $100 and lifetime access to Tarsk.`}),(0,f.jsxs)(`ul`,{className:`text-sm text-muted-foreground space-y-0.5`,children:[(0,f.jsxs)(`li`,{className:`flex items-center gap-1.5`,children:[(0,f.jsx)(l,{className:`h-3 w-3 text-primary`}),`Unlimited prompts`]}),(0,f.jsxs)(`li`,{className:`flex items-center gap-1.5`,children:[(0,f.jsx)(l,{className:`h-3 w-3 text-primary`}),`Priority access`]})]})]}),(0,f.jsx)(o,{onClick:g,className:`shrink-0`,children:`Purchase`})]})]})]})]})}export{p as default};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{I as t,Pi as n,Vr as r,c as i,dn as a,er as o,l as s,xi as c}from"./dialogs-config-CB7G-sX6.js";import"./react-vendor-CR4cAsbx.js";import"./history-view-D-hEB6Qt.js";import{a as l,c as u}from"./index-D7yQjYyf.js";import{n as d,t as f}from"./radio-group-BpmnaKJk.js";var p=e(n(),1),m=o();function h({threadId:e,onAgentCreated:n}){let[o,h]=(0,p.useState)(``),[g,_]=(0,p.useState)(``),[v,y]=(0,p.useState)(``),[b,x]=(0,p.useState)(`local`),[S,C]=(0,p.useState)(!1),w=o.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),T=w.length>0&&w.length<=64;return e?(0,m.jsxs)(`div`,{className:`max-w-2xl mx-auto p-6`,children:[(0,m.jsxs)(`div`,{className:`mb-6`,children:[(0,m.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Add Agent`}),(0,m.jsx)(`p`,{className:`text-muted-foreground`,children:`Create a new subagent. The agent will be saved as an AGENT.md file in the .agents/agents folder.`})]}),(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(s,{htmlFor:`agentName`,children:`Agent Name`}),(0,m.jsx)(i,{id:`agentName`,value:o,onChange:e=>h(e.target.value),placeholder:`e.g. Security Reviewer`,disabled:S}),o&&(0,m.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Folder name: `,(0,m.jsx)(`span`,{className:`font-mono`,children:w||`...`})]})]}),(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(s,{htmlFor:`agentDescription`,children:`Description`}),(0,m.jsx)(u,{id:`agentDescription`,value:g,onChange:e=>_(e.target.value),placeholder:`Describe what this agent does and when it should be invoked`,className:`resize-none min-h-[120px]`,disabled:S})]}),(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(s,{htmlFor:`agentTools`,children:`Allowed Tools (optional)`}),(0,m.jsx)(i,{id:`agentTools`,value:v,onChange:e=>y(e.target.value),placeholder:`e.g. read grep glob`,disabled:S}),(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Space-separated list of tools this agent can use. Leave empty to allow all coding tools.`})]}),(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(s,{children:`Scope`}),(0,m.jsxs)(f,{value:b,onValueChange:e=>x(e),className:`flex gap-4`,disabled:S,children:[(0,m.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,m.jsx)(d,{value:`local`,id:`scope-local`}),(0,m.jsx)(s,{htmlFor:`scope-local`,className:`font-normal cursor-pointer`,children:`Local (this project)`})]}),(0,m.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,m.jsx)(d,{value:`global`,id:`scope-global`,disabled:!0}),(0,m.jsx)(s,{htmlFor:`scope-global`,className:`font-normal cursor-pointer text-muted-foreground`,children:`Global (coming soon)`})]})]}),(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:b===`local`?`This agent will only be available for this project.`:`This agent will be available across all projects (coming soon).`})]}),(0,m.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,m.jsx)(a,{onClick:async()=>{if(!(!T||!g.trim()||!e)){C(!0);try{let r=await t(e,w,g.trim(),v.trim()||void 0);l({title:`Agent created`,description:`Agent '${w}' was created successfully.`}),h(``),_(``),y(``),x(`local`),n?.(r.path,`AGENT.md`)}catch(e){l({title:`Error`,description:e instanceof Error?e.message:`Failed to create agent`,variant:`destructive`})}finally{C(!1)}}},disabled:!T||!g.trim()||S,children:S?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(r,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,m.jsxs)(m.Fragment,{children:[`Continue`,(0,m.jsx)(c,{className:`ml-2 h-4 w-4`})]})})})]})]}):(0,m.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,m.jsxs)(`div`,{className:`text-center`,children:[(0,m.jsx)(`h2`,{className:`text-lg font-semibold text-muted-foreground mb-2`,children:`No Thread Selected`}),(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Please select a thread to add an agent.`})]})})}export{h as default};
@@ -0,0 +1,7 @@
1
+ import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{Mi as t,Pi as n,Ut as r,Vr as i,c as a,dn as o,er as s,l as c,xi as l,xn as u}from"./dialogs-config-CB7G-sX6.js";import{i as d,r as f}from"./react-vendor-CR4cAsbx.js";import"./history-view-D-hEB6Qt.js";import{a as p,c as m}from"./index-D7yQjYyf.js";import{n as h,t as g}from"./radio-group-BpmnaKJk.js";var _=t(),v=e(n(),1),y=s(),b=v.forwardRef((e,t)=>{let n=(0,_.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,r),n[3]=r,n[4]=a);let o;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,y.jsx)(d,{className:u(`pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0`)}),n[5]=o):o=n[5];let s;return n[6]!==i||n[7]!==t||n[8]!==a?(s=(0,y.jsx)(f,{className:a,...i,ref:t,children:o}),n[6]=i,n[7]=t,n[8]=a,n[9]=s):s=n[9],s});b.displayName=f.displayName;function x({threadId:e,onRuleCreated:t}){let[n,s]=(0,v.useState)(``),[u,d]=(0,v.useState)(``),[f,_]=(0,v.useState)(!1),[x,S]=(0,v.useState)(`local`),[C,w]=(0,v.useState)(!1),T=n.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),E=T.length>0&&T.length<=64;return e?(0,y.jsxs)(`div`,{className:`max-w-2xl mx-auto p-6`,children:[(0,y.jsxs)(`div`,{className:`mb-6`,children:[(0,y.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Add Rule`}),(0,y.jsx)(`p`,{className:`text-muted-foreground`,children:`Create a new agent rule. The rule will be saved as a .md file in the .agents/rules folder.`})]}),(0,y.jsxs)(`div`,{className:`space-y-6`,children:[(0,y.jsxs)(`div`,{className:`space-y-2`,children:[(0,y.jsx)(c,{htmlFor:`ruleName`,children:`Rule Name`}),(0,y.jsx)(a,{id:`ruleName`,value:n,onChange:e=>s(e.target.value),placeholder:`e.g. Code Style Guide`,disabled:C}),n&&(0,y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`File name: `,(0,y.jsxs)(`span`,{className:`font-mono`,children:[T||`...`,`.md`]})]})]}),(0,y.jsxs)(`div`,{className:`space-y-2`,children:[(0,y.jsx)(c,{htmlFor:`ruleDescription`,children:`Description`}),(0,y.jsx)(m,{id:`ruleDescription`,value:u,onChange:e=>d(e.target.value),placeholder:`Describe when Tarsk should apply this rule...`,className:`resize-none min-h-[120px]`,disabled:C})]}),(0,y.jsxs)(`div`,{className:`space-y-2`,children:[(0,y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,y.jsx)(c,{htmlFor:`alwaysApply`,children:`Always Apply`}),(0,y.jsx)(b,{id:`alwaysApply`,checked:f,onCheckedChange:_,disabled:C})]}),(0,y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:f?`This rule will be automatically added to context for all conversations.`:`Only the rule description will be added to context, allowing the agent to read the rule file when needed.`})]}),(0,y.jsxs)(`div`,{className:`space-y-2`,children:[(0,y.jsx)(c,{children:`Scope`}),(0,y.jsxs)(g,{value:x,onValueChange:e=>S(e),className:`flex gap-4`,disabled:C,children:[(0,y.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,y.jsx)(h,{value:`local`,id:`scope-local`}),(0,y.jsx)(c,{htmlFor:`scope-local`,className:`font-normal cursor-pointer`,children:`Local (this project)`})]}),(0,y.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,y.jsx)(h,{value:`global`,id:`scope-global`,disabled:!0}),(0,y.jsx)(c,{htmlFor:`scope-global`,className:`font-normal cursor-pointer text-muted-foreground`,children:`Global (coming soon)`})]})]}),(0,y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:x===`local`?`This rule will only be available for this project.`:`This rule will be available across all projects (coming soon).`})]}),(0,y.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,y.jsx)(o,{onClick:async()=>{if(!(!E||!e)){w(!0);try{let n=`---
2
+ description: ${u.trim()}
3
+ alwaysApply: ${f}
4
+ ---
5
+
6
+ Place your rule instructions here as markdown.
7
+ `;await r(e,`.agents/rules/${T}.md`,n),p({title:`Rule created`,description:`Rule '${T}' was created successfully.`}),s(``),d(``),_(!1),S(`local`),t?.(T)}catch(e){p({title:`Error`,description:e instanceof Error?e.message:`Failed to create rule`,variant:`destructive`})}finally{w(!1)}}},disabled:!E||!u.trim()||C,children:C?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(i,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,y.jsxs)(y.Fragment,{children:[`Continue`,(0,y.jsx)(l,{className:`ml-2 h-4 w-4`})]})})})]})]}):(0,y.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,y.jsxs)(`div`,{className:`text-center`,children:[(0,y.jsx)(`h2`,{className:`text-lg font-semibold text-muted-foreground mb-2`,children:`No Thread Selected`}),(0,y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Please select a thread to add a rule.`})]})})}export{x as default};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{L as t,Pi as n,Vr as r,c as i,dn as a,er as o,l as s,xi as c}from"./dialogs-config-CB7G-sX6.js";import"./react-vendor-CR4cAsbx.js";import"./history-view-D-hEB6Qt.js";import{a as l,c as u}from"./index-D7yQjYyf.js";import{n as d,t as f}from"./radio-group-BpmnaKJk.js";var p=e(n(),1),m=o();function h({threadId:e,onSkillCreated:n}){let[o,h]=(0,p.useState)(``),[g,_]=(0,p.useState)(``),[v,y]=(0,p.useState)(`local`),[b,x]=(0,p.useState)(!1),S=o.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),C=S.length>0&&S.length<=64;return e?(0,m.jsxs)(`div`,{className:`max-w-2xl mx-auto p-6`,children:[(0,m.jsxs)(`div`,{className:`mb-6`,children:[(0,m.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Add Skill`}),(0,m.jsx)(`p`,{className:`text-muted-foreground`,children:`Create a new agent skill. The skill will be saved as a SKILL.md file in the .agents/skills folder.`})]}),(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(s,{htmlFor:`skillName`,children:`Skill Name`}),(0,m.jsx)(i,{id:`skillName`,value:o,onChange:e=>h(e.target.value),placeholder:`e.g. Code Review`,disabled:b}),o&&(0,m.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Folder name: `,(0,m.jsx)(`span`,{className:`font-mono`,children:S||`...`})]})]}),(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(s,{htmlFor:`skillDescription`,children:`Description`}),(0,m.jsx)(u,{id:`skillDescription`,value:g,onChange:e=>_(e.target.value),placeholder:`Describe when Tarsk should apply this skill`,className:`resize-none min-h-[120px]`,disabled:b})]}),(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(s,{children:`Scope`}),(0,m.jsxs)(f,{value:v,onValueChange:e=>y(e),className:`flex gap-4`,disabled:b,children:[(0,m.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,m.jsx)(d,{value:`local`,id:`scope-local`}),(0,m.jsx)(s,{htmlFor:`scope-local`,className:`font-normal cursor-pointer`,children:`Local (this project)`})]}),(0,m.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,m.jsx)(d,{value:`global`,id:`scope-global`,disabled:!0}),(0,m.jsx)(s,{htmlFor:`scope-global`,className:`font-normal cursor-pointer text-muted-foreground`,children:`Global (coming soon)`})]})]}),(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:v===`local`?`This skill will only be available for this project.`:`This skill will be available across all projects (coming soon).`})]}),(0,m.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,m.jsx)(a,{onClick:async()=>{if(!(!C||!g.trim()||!e)){x(!0);try{let r=await t(e,S,g.trim());l({title:`Skill created`,description:`Skill '${S}' was created successfully.`}),h(``),_(``),y(`local`),n?.(r.path,`SKILL.md`)}catch(e){l({title:`Error`,description:e instanceof Error?e.message:`Failed to create skill`,variant:`destructive`})}finally{x(!1)}}},disabled:!C||!g.trim()||b,children:b?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(r,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,m.jsxs)(m.Fragment,{children:[`Continue`,(0,m.jsx)(c,{className:`ml-2 h-4 w-4`})]})})})]})]}):(0,m.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,m.jsxs)(`div`,{className:`text-center`,children:[(0,m.jsx)(`h2`,{className:`text-lg font-semibold text-muted-foreground mb-2`,children:`No Thread Selected`}),(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Please select a thread to add a skill.`})]})})}export{h as default};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{P as t,Pi as n,Vr as r,c as i,dn as a,er as o,l as s,xi as c}from"./dialogs-config-CB7G-sX6.js";import"./react-vendor-CR4cAsbx.js";import"./history-view-D-hEB6Qt.js";import{a as l}from"./index-D7yQjYyf.js";import{n as u,t as d}from"./radio-group-BpmnaKJk.js";var f=e(n(),1),p=o();function m({projectId:e,threadId:n,onCommandCreated:o}){let[m,h]=(0,f.useState)(``),[g,_]=(0,f.useState)(``),[v,y]=(0,f.useState)(``),[b,x]=(0,f.useState)(`default`),[S,C]=(0,f.useState)(`local`),[w,T]=(0,f.useState)(!1),E=m.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),D=E.length>0&&E.length<=64;return e?(0,p.jsxs)(`div`,{className:`max-w-2xl mx-auto p-6`,children:[(0,p.jsxs)(`div`,{className:`mb-6`,children:[(0,p.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Add Slash Command`}),(0,p.jsx)(`p`,{className:`text-muted-foreground`,children:`Create a new slash command. The command will be saved as a .md file in the ~/.agents/commands folder.`})]}),(0,p.jsxs)(`div`,{className:`space-y-6`,children:[(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(s,{htmlFor:`commandName`,children:`Command Name`}),(0,p.jsx)(i,{id:`commandName`,value:m,onChange:e=>h(e.target.value),placeholder:`e.g. review`,disabled:w}),m&&(0,p.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Command: `,(0,p.jsxs)(`span`,{className:`font-mono`,children:[`/`,E||`...`]})]})]}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(s,{htmlFor:`commandDescription`,children:`Description`}),(0,p.jsx)(i,{id:`commandDescription`,value:g,onChange:e=>_(e.target.value),placeholder:`Brief description shown in autocomplete`,disabled:w})]}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(s,{htmlFor:`argumentHint`,children:`Argument Hint (optional)`}),(0,p.jsx)(i,{id:`argumentHint`,value:v,onChange:e=>y(e.target.value),placeholder:`e.g. <focus-area> or <branch-name>`,disabled:w}),(0,p.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Shows after the command name to guide users what to type`})]}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(s,{children:`Mode`}),(0,p.jsxs)(d,{value:b,onValueChange:e=>x(e),className:`flex gap-4`,disabled:w,children:[(0,p.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,p.jsx)(u,{value:`default`,id:`mode-default`}),(0,p.jsx)(s,{htmlFor:`mode-default`,className:`font-normal cursor-pointer`,children:`Default`})]}),(0,p.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,p.jsx)(u,{value:`plan`,id:`mode-plan`}),(0,p.jsx)(s,{htmlFor:`mode-plan`,className:`font-normal cursor-pointer`,children:`Plan`})]})]}),(0,p.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:b===`default`?`Standard chat mode`:`Activates plan mode when this command is used`})]}),(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(s,{children:`Scope`}),(0,p.jsxs)(d,{value:S,onValueChange:e=>C(e),className:`flex gap-4`,disabled:w,children:[(0,p.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,p.jsx)(u,{value:`local`,id:`scope-local`}),(0,p.jsx)(s,{htmlFor:`scope-local`,className:`font-normal cursor-pointer`,children:`Local (this project)`})]}),(0,p.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,p.jsx)(u,{value:`global`,id:`scope-global`,disabled:!0}),(0,p.jsx)(s,{htmlFor:`scope-global`,className:`font-normal cursor-pointer text-muted-foreground`,children:`Global (coming soon)`})]})]}),(0,p.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:S===`local`?`This command will only be available for this project.`:`This command will be available across all projects (coming soon).`})]}),(0,p.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,p.jsx)(a,{onClick:async()=>{if(!(!D||!e)){T(!0);try{await t(E,``,{description:g.trim()||void 0,argumentHint:v.trim()||void 0,mode:b===`plan`?`plan`:void 0},S===`global`?`global`:`project`,n??void 0),l({title:`Command created`,description:`Command '/${E}' was created successfully.`}),h(``),_(``),y(``),x(`default`),C(`local`),o?.(E)}catch(e){l({title:`Error`,description:e instanceof Error?e.message:`Failed to create command`,variant:`destructive`})}finally{T(!1)}}},disabled:!D||w,children:w?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(r,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,p.jsxs)(p.Fragment,{children:[`Continue`,(0,p.jsx)(c,{className:`ml-2 h-4 w-4`})]})})})]})]}):(0,p.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,p.jsxs)(`div`,{className:`text-center`,children:[(0,p.jsx)(`h2`,{className:`text-lg font-semibold text-muted-foreground mb-2`,children:`No Project Selected`}),(0,p.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Please select a project to add a slash command.`})]})})}export{m as default};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{Mi as t,Nt as n,Pi as r,er as i,oi as a}from"./dialogs-config-CB7G-sX6.js";import{i as o}from"./index-D7yQjYyf.js";var s=t(),c=e(r(),1),l=i();function u(){let e=(0,s.c)(20),{devServerUrl:t}=o(),[r,i]=(0,c.useState)(``),[u,d]=(0,c.useState)(``),f=(0,c.useRef)(null),p,m;e[0]===t?(p=e[1],m=e[2]):(p=()=>{t&&(i(t),d(t))},m=[t],e[0]=t,e[1]=p,e[2]=m),(0,c.useEffect)(p,m);let h;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>{let t=e.trim();t&&(!t.startsWith(`http://`)&&!t.startsWith(`https://`)&&(t=`http://`+t),i(t),d(t))},e[3]=h):h=e[3];let g=h,_;e[4]===r?_=e[5]:(_=e=>{e.key===`Enter`&&g(r)},e[4]=r,e[5]=_);let v=_,y;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>i(e.target.value),e[6]=y):y=e[6];let b;e[7]!==v||e[8]!==r?(b=(0,l.jsx)(`input`,{type:`text`,value:r,onChange:y,onKeyDown:v,placeholder:`Enter URL...`,className:`flex-1 px-4 py-1.5 text-sm bg-muted rounded-full border border-border outline-none focus:ring-1 focus:ring-ring font-mono`,spellCheck:!1}),e[7]=v,e[8]=r,e[9]=b):b=e[9];let x;e[10]===u?x=e[11]:(x=u&&(0,l.jsx)(`button`,{onClick:()=>void n(u),title:`Open in external browser`,className:`p-1.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors`,children:(0,l.jsx)(a,{size:15})}),e[10]=u,e[11]=x);let S;e[12]!==b||e[13]!==x?(S=(0,l.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 border-b border-border shrink-0`,children:[b,x]}),e[12]=b,e[13]=x,e[14]=S):S=e[14];let C;e[15]===u?C=e[16]:(C=u?(0,l.jsx)(`iframe`,{ref:f,src:u,className:`flex-1 w-full border-none`,title:`Browser`}):(0,l.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-muted-foreground text-sm`,children:`Enter a URL to browse`}),e[15]=u,e[16]=C);let w;return e[17]!==S||e[18]!==C?(w=(0,l.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden`,children:[S,C]}),e[17]=S,e[18]=C,e[19]=w):w=e[19],w}export{u as BrowserTab};
@@ -0,0 +1 @@
1
+ import"./dialogs-config-CB7G-sX6.js";import{t as e}from"./history-view-D-hEB6Qt.js";export{e as ConversationHistoryView,e as default};