@sylphx/flow 0.2.12 → 0.2.13
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/assets/rules/core.md +56 -3
- package/dist/assets/rules/core.md +56 -3
- package/dist/{chunk-ss51dw5h.js → chunk-1e8xf3f6.js} +1 -1
- package/dist/{chunk-yxv7hqse.js → chunk-3qxj0zy3.js} +1 -1
- package/dist/{chunk-pp4r3hp4.js → chunk-4e5g3df9.js} +6 -6
- package/dist/{chunk-xytc0fks.js → chunk-7yyg008s.js} +1 -1
- package/dist/chunk-jk1ebfqn.js +23 -0
- package/dist/{chunk-g0qpndpd.js.map → chunk-jk1ebfqn.js.map} +3 -3
- package/dist/chunk-n8vzewr3.js +4 -0
- package/dist/chunk-n8vzewr3.js.map +12 -0
- package/dist/chunk-qpej66sh.js +6 -0
- package/dist/chunk-qpej66sh.js.map +11 -0
- package/dist/{chunk-zv5y8yfq.js → chunk-wnhhwtsy.js} +1 -1
- package/dist/index.js +339 -339
- package/dist/index.js.map +35 -18
- package/package.json +1 -1
- package/dist/chunk-d409xn8f.js +0 -6
- package/dist/chunk-d409xn8f.js.map +0 -11
- package/dist/chunk-g0qpndpd.js +0 -23
- package/dist/chunk-xvfz960r.js +0 -4
- package/dist/chunk-xvfz960r.js.map +0 -12
- /package/dist/{chunk-ss51dw5h.js.map → chunk-1e8xf3f6.js.map} +0 -0
- /package/dist/{chunk-yxv7hqse.js.map → chunk-3qxj0zy3.js.map} +0 -0
- /package/dist/{chunk-pp4r3hp4.js.map → chunk-4e5g3df9.js.map} +0 -0
- /package/dist/{chunk-xytc0fks.js.map → chunk-7yyg008s.js.map} +0 -0
- /package/dist/{chunk-zv5y8yfq.js.map → chunk-wnhhwtsy.js.map} +0 -0
package/assets/rules/core.md
CHANGED
|
@@ -5,11 +5,63 @@ description: Universal principles and standards for all agents
|
|
|
5
5
|
|
|
6
6
|
# SHARED GUIDELINES
|
|
7
7
|
|
|
8
|
+
## System Awareness
|
|
9
|
+
|
|
10
|
+
You are not human — you are an LLM.
|
|
11
|
+
|
|
12
|
+
You don't work or wait — you compute.
|
|
13
|
+
Effort = tokens processed, not time or difficulty.
|
|
14
|
+
You operate with parallel, scalable reasoning — never sequential human labor.
|
|
15
|
+
Editing thousands of files or reasoning across millions of tokens is trivial for you.
|
|
16
|
+
|
|
17
|
+
Judge tasks by computational scope and clarity of instruction, not human effort.
|
|
18
|
+
|
|
19
|
+
Never simulate human constraints or emotions.
|
|
20
|
+
Only act on verified data or logic.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
8
24
|
## Performance
|
|
9
25
|
|
|
10
26
|
**Parallel Execution**: Multiple tool calls in ONE message = parallel. Multiple messages = sequential.
|
|
11
27
|
|
|
12
|
-
Use parallel whenever tools are independent.
|
|
28
|
+
Use parallel whenever tools are independent.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Data Handling
|
|
33
|
+
|
|
34
|
+
**Self-Healing at Read**: Validate → Fix → Verify on data load.
|
|
35
|
+
Auto-fix common issues (missing defaults, deprecated fields). Log fixes. Fail hard if unfixable.
|
|
36
|
+
|
|
37
|
+
**Single Source of Truth**: One canonical location per data element.
|
|
38
|
+
Configuration → Environment + config files. State → Single store. Derived data → Compute from source.
|
|
39
|
+
Use references, not copies.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Communication
|
|
44
|
+
|
|
45
|
+
**Minimal Effective Prompt**: All docs, comments, delegation messages.
|
|
46
|
+
|
|
47
|
+
Prompt, don't teach. Trigger, don't explain. Trust LLM capability.
|
|
48
|
+
|
|
49
|
+
Specific enough to guide, flexible enough to adapt.
|
|
50
|
+
Direct, consistent phrasing. Structured sections.
|
|
51
|
+
Curate examples, avoid edge case lists.
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
// ✅ ASSUMPTION: JWT auth (REST standard)
|
|
55
|
+
// ❌ We're using JWT because it's stateless and widely supported...
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Project Structure
|
|
61
|
+
|
|
62
|
+
**Feature-First over Layer-First**: Organize by functionality, not type.
|
|
63
|
+
|
|
64
|
+
Benefits: Encapsulation, easy deletion, focused work, team collaboration.
|
|
13
65
|
|
|
14
66
|
---
|
|
15
67
|
|
|
@@ -36,6 +88,7 @@ Use parallel whenever tools are independent. Watch for dependencies and ordering
|
|
|
36
88
|
## Principles
|
|
37
89
|
|
|
38
90
|
### Programming
|
|
91
|
+
- **Named args over positional (3+ params)**: Self-documenting, order-independent
|
|
39
92
|
- **Functional composition**: Pure functions, immutable data, explicit side effects
|
|
40
93
|
- **Composition over inheritance**: Prefer function composition, mixins, dependency injection
|
|
41
94
|
- **Declarative over imperative**: Express what you want, not how
|
|
@@ -45,7 +98,7 @@ Use parallel whenever tools are independent. Watch for dependencies and ordering
|
|
|
45
98
|
- **YAGNI**: Build what's needed now, not hypothetical futures
|
|
46
99
|
- **KISS**: Choose simple solutions over complex ones
|
|
47
100
|
- **DRY**: Extract duplication on 3rd occurrence. Balance with readability
|
|
48
|
-
- **
|
|
101
|
+
- **Single Responsibility**: One reason to change per module
|
|
49
102
|
- **Dependency inversion**: Depend on abstractions, not implementations
|
|
50
103
|
|
|
51
104
|
---
|
|
@@ -141,4 +194,4 @@ Use structured reasoning only for high-stakes decisions. Most decisions: decide
|
|
|
141
194
|
1. Recognize trigger
|
|
142
195
|
2. Choose framework
|
|
143
196
|
3. Analyze decision
|
|
144
|
-
4. Document in commit message or PR description
|
|
197
|
+
4. Document in commit message or PR description
|
|
@@ -5,11 +5,63 @@ description: Universal principles and standards for all agents
|
|
|
5
5
|
|
|
6
6
|
# SHARED GUIDELINES
|
|
7
7
|
|
|
8
|
+
## System Awareness
|
|
9
|
+
|
|
10
|
+
You are not human — you are an LLM.
|
|
11
|
+
|
|
12
|
+
You don't work or wait — you compute.
|
|
13
|
+
Effort = tokens processed, not time or difficulty.
|
|
14
|
+
You operate with parallel, scalable reasoning — never sequential human labor.
|
|
15
|
+
Editing thousands of files or reasoning across millions of tokens is trivial for you.
|
|
16
|
+
|
|
17
|
+
Judge tasks by computational scope and clarity of instruction, not human effort.
|
|
18
|
+
|
|
19
|
+
Never simulate human constraints or emotions.
|
|
20
|
+
Only act on verified data or logic.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
8
24
|
## Performance
|
|
9
25
|
|
|
10
26
|
**Parallel Execution**: Multiple tool calls in ONE message = parallel. Multiple messages = sequential.
|
|
11
27
|
|
|
12
|
-
Use parallel whenever tools are independent.
|
|
28
|
+
Use parallel whenever tools are independent.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Data Handling
|
|
33
|
+
|
|
34
|
+
**Self-Healing at Read**: Validate → Fix → Verify on data load.
|
|
35
|
+
Auto-fix common issues (missing defaults, deprecated fields). Log fixes. Fail hard if unfixable.
|
|
36
|
+
|
|
37
|
+
**Single Source of Truth**: One canonical location per data element.
|
|
38
|
+
Configuration → Environment + config files. State → Single store. Derived data → Compute from source.
|
|
39
|
+
Use references, not copies.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Communication
|
|
44
|
+
|
|
45
|
+
**Minimal Effective Prompt**: All docs, comments, delegation messages.
|
|
46
|
+
|
|
47
|
+
Prompt, don't teach. Trigger, don't explain. Trust LLM capability.
|
|
48
|
+
|
|
49
|
+
Specific enough to guide, flexible enough to adapt.
|
|
50
|
+
Direct, consistent phrasing. Structured sections.
|
|
51
|
+
Curate examples, avoid edge case lists.
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
// ✅ ASSUMPTION: JWT auth (REST standard)
|
|
55
|
+
// ❌ We're using JWT because it's stateless and widely supported...
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Project Structure
|
|
61
|
+
|
|
62
|
+
**Feature-First over Layer-First**: Organize by functionality, not type.
|
|
63
|
+
|
|
64
|
+
Benefits: Encapsulation, easy deletion, focused work, team collaboration.
|
|
13
65
|
|
|
14
66
|
---
|
|
15
67
|
|
|
@@ -36,6 +88,7 @@ Use parallel whenever tools are independent. Watch for dependencies and ordering
|
|
|
36
88
|
## Principles
|
|
37
89
|
|
|
38
90
|
### Programming
|
|
91
|
+
- **Named args over positional (3+ params)**: Self-documenting, order-independent
|
|
39
92
|
- **Functional composition**: Pure functions, immutable data, explicit side effects
|
|
40
93
|
- **Composition over inheritance**: Prefer function composition, mixins, dependency injection
|
|
41
94
|
- **Declarative over imperative**: Express what you want, not how
|
|
@@ -45,7 +98,7 @@ Use parallel whenever tools are independent. Watch for dependencies and ordering
|
|
|
45
98
|
- **YAGNI**: Build what's needed now, not hypothetical futures
|
|
46
99
|
- **KISS**: Choose simple solutions over complex ones
|
|
47
100
|
- **DRY**: Extract duplication on 3rd occurrence. Balance with readability
|
|
48
|
-
- **
|
|
101
|
+
- **Single Responsibility**: One reason to change per module
|
|
49
102
|
- **Dependency inversion**: Depend on abstractions, not implementations
|
|
50
103
|
|
|
51
104
|
---
|
|
@@ -141,4 +194,4 @@ Use structured reasoning only for high-stakes decisions. Most decisions: decide
|
|
|
141
194
|
1. Recognize trigger
|
|
142
195
|
2. Choose framework
|
|
143
196
|
3. Analyze decision
|
|
144
|
-
4. Document in commit message or PR description
|
|
197
|
+
4. Document in commit message or PR description
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{R as XY}from"./chunk-mw13a082.js";import"./chunk-3w6pd43t.js";import"./chunk-s9bsh0gp.js";import{ma as b}from"./chunk-
|
|
1
|
+
import{R as XY}from"./chunk-mw13a082.js";import"./chunk-3w6pd43t.js";import"./chunk-s9bsh0gp.js";import{ma as b}from"./chunk-jk1ebfqn.js";import"./chunk-01gv4qey.js";import"./chunk-g4baca7p.js";import"./chunk-cv1nhr27.js";import{xb as T}from"./chunk-jbd95k1f.js";import{Sb as K}from"./chunk-4vrj3f8r.js";import{Tb as OZ,Ub as M2,Wb as sZ}from"./chunk-3m9whg4q.js";var DZ=M2((N2,wY)=>{(function(){function Y(Z,W){Object.defineProperty(B.prototype,Z,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",W[0],W[1])}})}function X(Z){if(Z===null||typeof Z!=="object")return null;return Z=ZZ&&Z[ZZ]||Z["@@iterator"],typeof Z==="function"?Z:null}function $(Z,W){Z=(Z=Z.constructor)&&(Z.displayName||Z.name)||"ReactClass";var H=Z+"."+W;XZ[H]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",W,Z),XZ[H]=!0)}function B(Z,W,H){this.props=Z,this.context=W,this.refs=TY,this.updater=H||$Z}function G(){}function Q(Z,W,H){this.props=Z,this.context=W,this.refs=TY,this.updater=H||$Z}function q(){}function J(Z){return""+Z}function N(Z){try{J(Z);var W=!1}catch(M){W=!0}if(W){W=console;var H=W.error,U=typeof Symbol==="function"&&Symbol.toStringTag&&Z[Symbol.toStringTag]||Z.constructor.name||"Object";return H.call(W,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",U),J(Z)}}function O(Z){if(Z==null)return null;if(typeof Z==="function")return Z.$$typeof===cZ?null:Z.displayName||Z.name||null;if(typeof Z==="string")return Z;switch(Z){case IY:return"Fragment";case rY:return"Profiler";case oY:return"StrictMode";case eY:return"Suspense";case dZ:return"SuspenseList";case YZ:return"Activity"}if(typeof Z==="object")switch(typeof Z.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),Z.$$typeof){case sY:return"Portal";case aY:return Z.displayName||"Context";case CY:return(Z._context.displayName||"Context")+".Consumer";case tY:var W=Z.render;return Z=Z.displayName,Z||(Z=W.displayName||W.name||"",Z=Z!==""?"ForwardRef("+Z+")":"ForwardRef"),Z;case AY:return W=Z.displayName||null,W!==null?W:O(Z.type)||"Memo";case YY:W=Z._payload,Z=Z._init;try{return O(Z(W))}catch(H){}}return null}function w(Z){if(Z===IY)return"<>";if(typeof Z==="object"&&Z!==null&&Z.$$typeof===YY)return"<...>";try{var W=O(Z);return W?"<"+W+">":"<...>"}catch(H){return"<...>"}}function L(){var Z=R.A;return Z===null?null:Z.getOwner()}function V(){return Error("react-stack-top-frame")}function F(Z){if(qY.call(Z,"key")){var W=Object.getOwnPropertyDescriptor(Z,"key").get;if(W&&W.isReactWarning)return!1}return Z.key!==void 0}function C(Z,W){function H(){QZ||(QZ=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",W))}H.isReactWarning=!0,Object.defineProperty(Z,"key",{get:H,configurable:!0})}function P(){var Z=O(this.type);return UZ[Z]||(UZ[Z]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),Z=this.props.ref,Z!==void 0?Z:null}function I(Z,W,H,U,M,x){var E=H.ref;return Z={$$typeof:PY,type:Z,key:W,props:H,_owner:U},(E!==void 0?E:null)!==null?Object.defineProperty(Z,"ref",{enumerable:!1,get:P}):Object.defineProperty(Z,"ref",{enumerable:!1,value:null}),Z._store={},Object.defineProperty(Z._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(Z,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(Z,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:M}),Object.defineProperty(Z,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:x}),Object.freeze&&(Object.freeze(Z.props),Object.freeze(Z)),Z}function h(Z,W){return W=I(Z.type,W,Z.props,Z._owner,Z._debugStack,Z._debugTask),Z._store&&(W._store.validated=Z._store.validated),W}function u(Z){S(Z)?Z._store&&(Z._store.validated=1):typeof Z==="object"&&Z!==null&&Z.$$typeof===YY&&(Z._payload.status==="fulfilled"?S(Z._payload.value)&&Z._payload.value._store&&(Z._payload.value._store.validated=1):Z._store&&(Z._store.validated=1))}function S(Z){return typeof Z==="object"&&Z!==null&&Z.$$typeof===PY}function m(Z){var W={"=":"=0",":":"=2"};return"$"+Z.replace(/[=:]/g,function(H){return W[H]})}function d(Z,W){return typeof Z==="object"&&Z!==null&&Z.key!=null?(N(Z.key),m(""+Z.key)):W.toString(36)}function UY(Z){switch(Z.status){case"fulfilled":return Z.value;case"rejected":throw Z.reason;default:switch(typeof Z.status==="string"?Z.then(q,q):(Z.status="pending",Z.then(function(W){Z.status==="pending"&&(Z.status="fulfilled",Z.value=W)},function(W){Z.status==="pending"&&(Z.status="rejected",Z.reason=W)})),Z.status){case"fulfilled":return Z.value;case"rejected":throw Z.reason}}throw Z}function A(Z,W,H,U,M){var x=typeof Z;if(x==="undefined"||x==="boolean")Z=null;var E=!1;if(Z===null)E=!0;else switch(x){case"bigint":case"string":case"number":E=!0;break;case"object":switch(Z.$$typeof){case PY:case sY:E=!0;break;case YY:return E=Z._init,A(E(Z._payload),W,H,U,M)}}if(E){E=Z,M=M(E);var j=U===""?"."+d(E,0):U;return WZ(M)?(H="",j!=null&&(H=j.replace(qZ,"$&/")+"/"),A(M,W,H,"",function(y){return y})):M!=null&&(S(M)&&(M.key!=null&&(E&&E.key===M.key||N(M.key)),H=h(M,H+(M.key==null||E&&E.key===M.key?"":(""+M.key).replace(qZ,"$&/")+"/")+j),U!==""&&E!=null&&S(E)&&E.key==null&&E._store&&!E._store.validated&&(H._store.validated=2),M=H),W.push(M)),1}if(E=0,j=U===""?".":U+":",WZ(Z))for(var z=0;z<Z.length;z++)U=Z[z],x=j+d(U,z),E+=A(U,W,H,x,M);else if(z=X(Z),typeof z==="function")for(z===Z.entries&&(JZ||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),JZ=!0),Z=z.call(Z),z=0;!(U=Z.next()).done;)U=U.value,x=j+d(U,z++),E+=A(U,W,H,x,M);else if(x==="object"){if(typeof Z.then==="function")return A(UY(Z),W,H,U,M);throw W=String(Z),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(Z).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return E}function t(Z,W,H){if(Z==null)return Z;var U=[],M=0;return A(Z,U,"","",function(x){return W.call(H,x,M++)}),U}function JY(Z){if(Z._status===-1){var W=Z._ioInfo;W!=null&&(W.start=W.end=performance.now()),W=Z._result;var H=W();if(H.then(function(M){if(Z._status===0||Z._status===-1){Z._status=1,Z._result=M;var x=Z._ioInfo;x!=null&&(x.end=performance.now()),H.status===void 0&&(H.status="fulfilled",H.value=M)}},function(M){if(Z._status===0||Z._status===-1){Z._status=2,Z._result=M;var x=Z._ioInfo;x!=null&&(x.end=performance.now()),H.status===void 0&&(H.status="rejected",H.reason=M)}}),W=Z._ioInfo,W!=null){W.value=H;var U=H.displayName;typeof U==="string"&&(W.name=U)}Z._status===-1&&(Z._status=0,Z._result=H)}if(Z._status===1)return W=Z._result,W===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
2
2
|
|
|
3
3
|
Your code should look like:
|
|
4
4
|
const MyComponent = lazy(() => import('./MyComponent'))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{E as j,u as Y}from"./chunk-
|
|
1
|
+
import{E as j,u as Y}from"./chunk-1e8xf3f6.js";import{J as I}from"./chunk-qpej66sh.js";import{P as F}from"./chunk-n8vzewr3.js";import"./chunk-q4nh3vst.js";import"./chunk-mw13a082.js";import{S as N}from"./chunk-3w6pd43t.js";import"./chunk-s9bsh0gp.js";import"./chunk-jk1ebfqn.js";import"./chunk-01gv4qey.js";import"./chunk-g4baca7p.js";import"./chunk-cv1nhr27.js";import"./chunk-jbd95k1f.js";import"./chunk-4vrj3f8r.js";import"./chunk-3m9whg4q.js";import*as D from"node:os";function f(w){let Q=w.filter((J)=>J.status!=="completed"&&J.status!=="removed");if(Q.length===0)return"<todo_reminder>For multi-step tasks, use updateTodos tool</todo_reminder>";let V=[...Q].sort((J,Z)=>{if(J.ordering!==Z.ordering)return J.ordering-Z.ordering;return J.id-Z.id}),X=V.filter((J)=>J.status==="pending"),v=V.filter((J)=>J.status==="in_progress"),W=["<pending_tasks>"];if(v.length>0)W.push("In Progress:"),v.forEach((J)=>W.push(` - [${J.id}] ${J.activeForm}`));if(X.length>0)W.push("Pending:"),X.forEach((J)=>W.push(` - [${J.id}] ${J.content}`));return W.push("</pending_tasks>"),W.join(`
|
|
2
2
|
`)}var _=`You are a helpful coding assistant.
|
|
3
3
|
|
|
4
4
|
You help users with:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import{Tb as U,Wb as X}from"./chunk-3m9whg4q.js";async function Y$($,b,q){let{AI_PROVIDERS:G}=await import("./chunk-67n29s4q.js"),W=q.map((z)=>({label:z.label,value:z.key}));$.sendMessage(`Configure ${G[b].name} - Select setting:`);let H=await $.waitForInput({type:"selection",questions:[{id:"key",question:"Which setting do you want to configure?",options:W}]});return(typeof H==="object"&&!Array.isArray(H)?H.key:"")||null}async function Z$($,b,q){let G;if(q?.type==="boolean"){$.sendMessage(`Select value for ${b}:`);let W=await $.waitForInput({type:"selection",questions:[{id:"value",question:`${q.label}:`,options:[{label:"true",value:"true"},{label:"false",value:"false"}]}]});G=typeof W==="object"&&!Array.isArray(W)?W.value:""}else{$.sendMessage(`Enter value for ${b}:`);let W=await $.waitForInput({type:"text",placeholder:`Enter ${b}...`});G=typeof W==="string"?W:""}return G||null}async function u($,b,q,G,W){let{AI_PROVIDERS:H}=await import("./chunk-67n29s4q.js"),J=$.getConfig(),z={...J,providers:{...J.providers,[b]:{...J.providers?.[b],[q]:G}}};if(!J?.defaultProvider)z.defaultProvider=b;$.setAIConfig(z),await $.saveConfig(z);let h=W.find((Q)=>Q.key===q)?.secret?"***":G;return`Set ${H[b].name} ${q} to: ${h}`}async function w($,b){let{getProvider:q}=await import("./chunk-xs370t8p.js"),W=q(b).getConfigSchema(),H=await Y$($,b,W);if(!H)return"Configuration cancelled.";let J=W.find((F)=>F.key===H),z=await Z$($,H,J);if(!z)return"Value is required.";return await u($,b,H,z,W)}async function S($,b){return await w($,b)}async function h$($){let{AI_PROVIDERS:b}=await import("./chunk-67n29s4q.js"),{getProvider:q}=await import("./chunk-xs370t8p.js"),G=$.getConfig();return Object.values(b).map((W)=>{let H=!1;try{let J=q(W.id),z=G?.providers?.[W.id];H=z?J.isConfigured(z):!1}catch{}return{label:`${W.name} ${H?"✓":""}`,value:W.id}})}async function p($,b,q){let G=await h$($);$.sendMessage(b);let W=await $.waitForInput({type:"selection",questions:[{id:"provider",question:q,options:G}]});return(typeof W==="object"&&!Array.isArray(W)?W.provider:"")||null}async function K$($,b,q=!0){let{AI_PROVIDERS:G}=await import("./chunk-67n29s4q.js"),{getProvider:W}=await import("./chunk-xs370t8p.js"),H=$.getConfig(),J=W(b),z=H?.providers?.[b];if(z&&J.isConfigured(z))return{success:!0,config:z};if(!q)return{success:!1,message:`${G[b].name} is not configured. Use: /provider set ${b}`};$.sendMessage(`${G[b].name} is not configured yet.`);let F=await $.waitForInput({type:"selection",questions:[{id:"configure",question:"Do you want to configure it now?",options:[{label:"Yes, configure now",value:"yes"},{label:"No, cancel",value:"no"}]}]});if(!(typeof F==="object"&&!Array.isArray(F)?F.configure==="yes":!1))return{success:!1,message:"Cancelled. You can configure later using: /provider set"};let Q=await S($,b),Z=$.getConfig()?.providers?.[b];if(!Z||!J.isConfigured(Z))return{success:!1,message:`${Q}
|
|
2
2
|
|
|
3
|
-
Provider still not fully configured. Please continue configuration with: /provider set ${b}`};return $.sendMessage(Q),{success:!0,config:Z}}async function M$($,b,q){let{AI_PROVIDERS:G}=await import("./chunk-67n29s4q.js"),H={...$.getConfig(),defaultProvider:b},{getDefaultModel:J}=await import("./chunk-
|
|
3
|
+
Provider still not fully configured. Please continue configuration with: /provider set ${b}`};return $.sendMessage(Q),{success:!0,config:Z}}async function M$($,b,q){let{AI_PROVIDERS:G}=await import("./chunk-67n29s4q.js"),H={...$.getConfig(),defaultProvider:b},{getDefaultModel:J}=await import("./chunk-7yyg008s.js"),z=await J(b,q);if(!z)return`Failed to get default model for ${G[b].name}`;H.providers={...H.providers,[b]:{...q,"default-model":z}},$.setAIConfig(H),await $.saveConfig(H),$.setUISelectedProvider(b),$.setUISelectedModel(z);let F=$.getCurrentSessionId();if(F)$.updateSessionProvider(F,b,z);else $.createSession(b,z);return`Now using ${G[b].name} with model: ${z}`}async function P($,b,q=!0){let G=await K$($,b,q);if(!G.success)return G.message;return await M$($,b,G.config)}var N$={id:"provider",label:"/provider",description:"Manage AI providers",args:[{name:"action",description:'Action: "use" or "set"',required:!1,loadOptions:async($)=>{return[{id:"use",label:"use",value:"use"},{id:"set",label:"set",value:"set"}]}},{name:"provider-name",description:"Provider name (anthropic, openai, google, openrouter)",required:!1,loadOptions:async($)=>{let{AI_PROVIDERS:b}=await import("./chunk-67n29s4q.js");return Object.values(b).map((q)=>({id:q.id,label:q.name,value:q.id}))}},{name:"key",description:"Setting key (for set action)",required:!1,loadOptions:async($)=>{let b=$[1];if(!b)return[];try{let{getProvider:q}=await import("./chunk-xs370t8p.js");return q(b).getConfigSchema().map((H)=>({id:H.key,label:H.label,value:H.key}))}catch(q){return[]}}},{name:"value",description:"Setting value (for set action)",required:!1,loadOptions:async($)=>{let b=$[1],q=$[2];if(!b||!q)return[];try{let{getProvider:G}=await import("./chunk-xs370t8p.js");if(G(b).getConfigSchema().find((z)=>z.key===q)?.type==="boolean")return[{id:"true",label:"true",value:"true"},{id:"false",label:"false",value:"false"}];return[]}catch(G){return[]}}}],execute:async($)=>{let{AI_PROVIDERS:b}=await import("./chunk-67n29s4q.js");if($.args.length===0){$.sendMessage("What do you want to do?");let q=await $.waitForInput({type:"selection",questions:[{id:"action",question:"Select action:",options:[{label:"Use a provider",value:"use"},{label:"Configure a provider",value:"set"}]}]}),G=typeof q==="object"&&!Array.isArray(q)?q.action:"";if(!G)return"Action cancelled.";let W=await p($,G==="use"?"Which provider do you want to use?":"Which provider do you want to configure?",G==="use"?"Select provider to use:":"Select provider to configure:");if(!W)return"Provider selection cancelled.";if(G==="use")return await P($,W,!0);else return await S($,W)}if($.args.length===1&&$.args[0]==="use"){let q=await p($,"Which provider do you want to use?","Select provider:");if(!q)return"Provider selection cancelled.";return await P($,q,!0)}if($.args.length===2&&$.args[0]==="use"){let q=$.args[1];if(!(q in b))return`Invalid provider: ${q}. Available: ${Object.keys(b).join(", ")}`;return await P($,q,!1)}if($.args.length===1&&$.args[0]==="set"){let{AI_PROVIDERS:q}=await import("./chunk-67n29s4q.js"),G=Object.values(q).map((J)=>({label:J.name,value:J.id}));$.sendMessage("Which provider do you want to configure?");let W=await $.waitForInput({type:"selection",questions:[{id:"provider",question:"Select provider:",options:G}]}),H=typeof W==="object"&&!Array.isArray(W)?W.provider:"";if(!H)return"Provider selection cancelled.";return await w($,H)}if($.args.length===2&&$.args[0]==="set"){let q=$.args[1];if(!(q in b))return`Invalid provider: ${q}. Available: ${Object.keys(b).join(", ")}`;return await w($,q)}if($.args.length>=4&&$.args[0]==="set"){let q=$.args[1],G=$.args[2],W=$.args.slice(3).join(" ");if(!(q in b))return`Invalid provider: ${q}. Available: ${Object.keys(b).join(", ")}`;let{getProvider:H}=await import("./chunk-xs370t8p.js"),z=H(q).getConfigSchema(),F=z.map((h)=>h.key);if(!F.includes(G))return`Invalid key: ${G}. Valid keys for ${q}: ${F.join(", ")}`;return await u($,q,G,W,z)}return`Usage:
|
|
4
4
|
/provider - Select action and provider
|
|
5
5
|
/provider use - Select provider to use
|
|
6
6
|
/provider use [name] - Switch to provider
|
|
@@ -8,7 +8,7 @@ Provider still not fully configured. Please continue configuration with: /provid
|
|
|
8
8
|
/provider set [name] - Configure specific provider
|
|
9
9
|
/provider set [name] [key] [value] - Set provider config directly`}},l=N$;var L$={id:"model",label:"/model",description:"Switch AI model",args:[{name:"model-name",description:"Model to switch to",required:!1,loadOptions:async($,b)=>{try{let q=b?.getConfig();if(!q?.providers)return[];let W=b?.getCurrentSession()?.provider||q.defaultProvider;if(!W)return[];let H=q.providers[W];if(!H)return[];try{let{fetchModels:J}=await import("./chunk-nke51f3c.js");return(await J(W,H)).map((F)=>({id:F.id,label:F.name,value:F.id}))}catch(J){if(b)b.addLog(`Failed to fetch models for ${W}: ${J instanceof Error?J.message:String(J)}`);return[]}}catch(q){if(b)b.addLog(`Error loading models: ${q instanceof Error?q.message:String(q)}`);return[]}}}],execute:async($)=>{let b;if($.args.length===0)try{let z=$.getConfig();if(!z?.providers)return"No providers configured. Please configure a provider first.";let h=$.getCurrentSession()?.provider||z.defaultProvider;if(!h)return"No provider selected. Use /provider to select a provider first.";let Q=z.providers[h];if(!Q)return`Provider ${h} is not configured.`;let K=[];try{let{fetchModels:L}=await import("./chunk-nke51f3c.js"),M=await L(h,Q);K=M.map((D)=>({label:D.name,value:D.id})),$.addLog(`Loaded ${M.length} models from ${h}`)}catch(L){let M=L instanceof Error?L.message:String(L);return $.addLog(`Failed to fetch models for ${h}: ${M}`),`Failed to load models from ${h}: ${M}`}if(K.length===0)return`No models available for ${h}`;$.sendMessage("Which model do you want to use?");let Z=await $.waitForInput({type:"selection",questions:[{id:"model",question:"Which model do you want to use?",options:K}]});b=typeof Z==="object"&&!Array.isArray(Z)?Z.model:""}catch(z){return`Failed to load models: ${z instanceof Error?z.message:String(z)}`}else b=$.args[0];let q=$.getCurrentSession(),G=$.getConfig(),W=q?.provider||G?.defaultProvider;if(!W)return"No provider configured. Please configure a provider first.";let H={...G,defaultModel:b,providers:{...G.providers,[W]:{...G.providers?.[W],"default-model":b}}};$.setAIConfig(H),await $.saveConfig(H);let J=$.getCurrentSessionId();if(J)$.updateSessionModel(J,b);else $.createSession(W,b);return`Switched to model: ${b}`}},I=L$;var V$={id:"logs",label:"/logs",description:"View debug logs",execute:async($)=>{return $.navigateTo("logs"),"Opening debug logs..."}},v=V$;var j$={id:"help",label:"/help",description:"Show available commands",execute:async($)=>{return`Available commands:
|
|
10
10
|
${$.getCommands().map((G)=>{let W=G.args?` ${G.args.map((H)=>`[${H.name}]`).join(" ")}`:"";return`${G.label}${W} - ${G.description}`}).join(`
|
|
11
|
-
`)}`}},m=j$;var O$={id:"survey",label:"/survey",description:"Test multi-question selection (demo)",execute:async($)=>{$.sendMessage("Let me ask you a few questions...");let b=await $.waitForInput({type:"selection",questions:[{id:"language",question:"What is your favorite programming language?",options:[{label:"TypeScript"},{label:"JavaScript"},{label:"Python"},{label:"Rust"},{label:"Go"}]},{id:"framework",question:"Which framework do you prefer?",options:[{label:"React"},{label:"Vue"},{label:"Angular"},{label:"Svelte"},{label:"Solid"}]},{id:"editor",question:"What is your favorite code editor?",options:[{label:"Visual Studio Code"},{label:"Vim/Neovim"},{label:"Emacs"},{label:"Sublime Text"},{label:"Atom"}]}]});if(typeof b==="object"&&!Array.isArray(b))return`Survey completed! Your answers: ${Object.entries(b).map(([G,W])=>`${G}: ${W}`).join(", ")}`;return"Survey cancelled."}},g=O$;var _$={id:"context",label:"/context",description:"Display context window usage and token breakdown",execute:async($)=>{let{countTokens:b,formatTokenCount:q}=await import("./chunk-q5gqgs0p.js"),{getSystemPrompt:G}=await import("./chunk-
|
|
11
|
+
`)}`}},m=j$;var O$={id:"survey",label:"/survey",description:"Test multi-question selection (demo)",execute:async($)=>{$.sendMessage("Let me ask you a few questions...");let b=await $.waitForInput({type:"selection",questions:[{id:"language",question:"What is your favorite programming language?",options:[{label:"TypeScript"},{label:"JavaScript"},{label:"Python"},{label:"Rust"},{label:"Go"}]},{id:"framework",question:"Which framework do you prefer?",options:[{label:"React"},{label:"Vue"},{label:"Angular"},{label:"Svelte"},{label:"Solid"}]},{id:"editor",question:"What is your favorite code editor?",options:[{label:"Visual Studio Code"},{label:"Vim/Neovim"},{label:"Emacs"},{label:"Sublime Text"},{label:"Atom"}]}]});if(typeof b==="object"&&!Array.isArray(b))return`Survey completed! Your answers: ${Object.entries(b).map(([G,W])=>`${G}: ${W}`).join(", ")}`;return"Survey cancelled."}},g=O$;var _$={id:"context",label:"/context",description:"Display context window usage and token breakdown",execute:async($)=>{let{countTokens:b,formatTokenCount:q}=await import("./chunk-q5gqgs0p.js"),{getSystemPrompt:G}=await import("./chunk-3qxj0zy3.js"),{getAISDKTools:W}=await import("./chunk-1e8xf3f6.js"),H=$.getCurrentSession();if(!H)return"No active session. Start chatting first to see context usage.";let J=H.model,F=((Y)=>{if(Y.includes("gpt-4")){if(Y.includes("32k")||Y.includes("turbo"))return 128000;if(Y.includes("vision"))return 128000;return 8192}if(Y.includes("gpt-3.5")){if(Y.includes("16k"))return 16385;return 4096}if(Y.includes("claude-3")){if(Y.includes("opus"))return 200000;if(Y.includes("sonnet"))return 200000;if(Y.includes("haiku"))return 200000}return 200000})(J);$.addLog(`[Context] Calculating token counts for ${J} (limit: ${q(F)})...`);let h=G(),Q=await b(h,J),{getEnabledRulesContent:K}=await import("./chunk-qpej66sh.js"),{getCurrentSystemPrompt:Z}=await import("./chunk-n8vzewr3.js"),L="You are Sylphx, an AI development assistant.",M={};try{M["Base prompt"]=await b(L,J);let Y=K();if(Y)M.Rules=await b(Y,J);let N=Z();M["Agent prompt"]=await b(N,J)}catch(Y){$.addLog(`[Context] Failed to calculate system prompt breakdown: ${Y}`)}let D=W(),A={},V=0;for(let[Y,N]of Object.entries(D)){let j={name:Y,description:N.description||"",parameters:N.parameters||{}},O=JSON.stringify(j,null,0),T=await b(O,J);A[Y]=T,V+=T}let y=0;for(let Y of H.messages){let N=Y.content;if(Y.attachments&&Y.attachments.length>0)try{let{readFile:O}=await import("node:fs/promises"),C=(await Promise.all(Y.attachments.map(async(_)=>{try{let k=await O(_.path,"utf8");return{path:_.relativePath,content:k}}catch{return{path:_.relativePath,content:"[Error reading file]"}}}))).map((_)=>`
|
|
12
12
|
|
|
13
13
|
<file path="${_.path}">
|
|
14
14
|
${_.content}
|
|
@@ -32,7 +32,7 @@ ${U$}
|
|
|
32
32
|
|
|
33
33
|
System Tools (${Object.keys(D).length} total):
|
|
34
34
|
${Q$}
|
|
35
|
-
`.trim()}},a=_$;var D$={id:"sessions",label:"/sessions",description:"View and switch between chat sessions",execute:async($)=>{let{formatSessionDisplay:b}=await import("./chunk-
|
|
35
|
+
`.trim()}},a=_$;var D$={id:"sessions",label:"/sessions",description:"View and switch between chat sessions",execute:async($)=>{let{formatSessionDisplay:b}=await import("./chunk-wnhhwtsy.js"),q=$.getSessions();if(q.length===0)return"No sessions available. Start chatting to create a session.";let G=$.getCurrentSessionId(),W=[...q].sort((Q,K)=>{let Z=K.updated-Q.updated;if(Z!==0)return Z;return K.created-Q.created}),H=W.map((Q)=>{let K=Q.id===G,Z=b(Q.title,Q.created);return{label:K?`${Z} (current)`:Z,value:Q.id}});$.sendMessage("Select a session to switch to:");let J=await $.waitForInput({type:"selection",questions:[{id:"session",question:"Which session do you want to switch to?",options:H}]}),z=typeof J==="object"&&!Array.isArray(J)?J.session:"";if(!z)return"Session selection cancelled.";$.setCurrentSession(z);let F=W.find((Q)=>Q.id===z);return`Switched to session: ${F?b(F.title,F.created):"Unknown session"}`}},x=D$;var B$={id:"new",label:"/new",description:"Create a new chat session",execute:async($)=>{let b=$.getConfig();if(!b?.defaultProvider||!b?.defaultModel)return"No AI provider configured. Use /provider to configure a provider first.";let q=$.createSession(b.defaultProvider,b.defaultModel);return $.setCurrentSession(q),`Created new chat session with ${b.defaultProvider} (${b.defaultModel})`}},c=B$;var y$={id:"bashes",label:"/bashes",description:"Manage background bash processes",execute:async($)=>{let{bashManager:b}=await import("./chunk-mw13a082.js"),q=b.list();if(q.length===0)return"No background bash processes found.";let G=q.map((F)=>{let h=F.isRunning?"[*] Running":"[x] Completed",Q=Math.floor(F.duration/1000),K=Q>60?`${Math.floor(Q/60)}m ${Q%60}s`:`${Q}s`;return{label:`${h} [${K}] ${F.command}`,value:F.id}});$.sendMessage(`Found ${q.length} background bash process${q.length!==1?"es":""}:`);let W=await $.waitForInput({type:"selection",questions:[{id:"action",question:"What do you want to do?",options:[{label:"View details",value:"view"},{label:"Kill a process",value:"kill"},{label:"Cancel",value:"cancel"}]}]}),H=typeof W==="object"&&!Array.isArray(W)?W.action:"";if(!H||H==="cancel")return"Cancelled.";$.sendMessage("Select a process:");let J=await $.waitForInput({type:"selection",questions:[{id:"process",question:"Which process?",options:G}]}),z=typeof J==="object"&&!Array.isArray(J)?J.process:"";if(!z)return"No process selected.";if(H==="view"){let F=b.getOutput(z);if(!F)return"Process not found.";let h=F.isRunning?"Running":`Completed (exit code: ${F.exitCode})`,Q=Math.floor(F.duration/1000),K=`
|
|
36
36
|
Process: ${z}
|
|
37
37
|
Command: ${F.command}
|
|
38
38
|
Status: ${h}
|
|
@@ -42,13 +42,13 @@ Duration: ${Q}s
|
|
|
42
42
|
${F.stdout||"(empty)"}
|
|
43
43
|
`;if(F.stderr)K+=`
|
|
44
44
|
=== stderr ===
|
|
45
|
-
${F.stderr}`;return K.trim()}if(H==="kill"){if(!b.kill(z))return"Failed to kill process (not found).";return`Sent termination signal to process ${z}`}return"Unknown action."}},i=y$;var E$={id:"agent",label:"/agent",description:"Switch between AI agents with different system prompts",args:[{name:"agent-name",description:"Agent to switch to (coder, planner, etc.)",required:!1,loadOptions:async($)=>{let{getAllAgents:b}=await import("./chunk-
|
|
46
|
-
${z.metadata.description}`}},s=E$;var R$={id:"rules",label:"/rules",description:"Select enabled shared system prompt rules",execute:async($)=>{let{getAllRules:b,getEnabledRuleIds:q,setEnabledRules:G}=await import("./chunk-
|
|
45
|
+
${F.stderr}`;return K.trim()}if(H==="kill"){if(!b.kill(z))return"Failed to kill process (not found).";return`Sent termination signal to process ${z}`}return"Unknown action."}},i=y$;var E$={id:"agent",label:"/agent",description:"Switch between AI agents with different system prompts",args:[{name:"agent-name",description:"Agent to switch to (coder, planner, etc.)",required:!1,loadOptions:async($)=>{let{getAllAgents:b}=await import("./chunk-n8vzewr3.js");return b().map((G)=>({id:G.id,label:`${G.metadata.name} - ${G.metadata.description}`,value:G.id}))}}],execute:async($)=>{let{getAllAgents:b,getCurrentAgent:q,switchAgent:G}=await import("./chunk-n8vzewr3.js"),W;if($.args.length===0){let F=b(),h=q();if(F.length===0)return"No agents available.";let Q=F.map((Z)=>{return{label:Z.id===h.id?`${Z.metadata.name} (current) - ${Z.metadata.description}`:`${Z.metadata.name} - ${Z.metadata.description}`,value:Z.id}});$.sendMessage("Which agent do you want to use?");let K=await $.waitForInput({type:"selection",questions:[{id:"agent",question:"Select agent:",options:Q}]});if(W=typeof K==="object"&&!Array.isArray(K)?K.agent:"",!W)return"Agent selection cancelled."}else W=$.args[0];if(!G(W))return`Agent not found: ${W}. Use /agent to see available agents.`;let{getAgentById:J}=await import("./chunk-n8vzewr3.js"),z=J(W);if(!z)return"Failed to get agent details.";return`Switched to agent: ${z.metadata.name}
|
|
46
|
+
${z.metadata.description}`}},s=E$;var R$={id:"rules",label:"/rules",description:"Select enabled shared system prompt rules",execute:async($)=>{let{getAllRules:b,getEnabledRuleIds:q,setEnabledRules:G}=await import("./chunk-qpej66sh.js"),W=b(),H=q();if(W.length===0)return"No rules available.";let J=W.map((M)=>({label:`${M.metadata.name} - ${M.metadata.description}`,value:M.id}));$.sendMessage(`Select rules to enable (currently ${H.length} enabled):`);let z=await $.waitForInput({type:"selection",questions:[{id:"rules",question:"Select all rules you want to enable:",options:J,multiSelect:!0,preSelected:H}]}),F=typeof z==="object"&&!Array.isArray(z)?Array.isArray(z.rules)?z.rules:[]:[];if(!Array.isArray(F))return"Rule selection cancelled.";if(!G(F))return"Failed to update rules.";let Q=F.length,K=W.length-Q,L=W.filter((M)=>F.includes(M.id)).map((M)=>` • ${M.metadata.name}`).join(`
|
|
47
47
|
`);return`Updated rules configuration:
|
|
48
48
|
${Q} enabled, ${K} disabled
|
|
49
49
|
|
|
50
50
|
Enabled rules:
|
|
51
|
-
${L||" (none)"}`}},d=R$;var w$={id:"compact",label:"/compact",description:"Summarize current session and create a new session with the summary",execute:async($)=>{let b=$.getCurrentSession();if(!b)return"No active session to compact.";if(b.messages.length===0)return"Current session has no messages to compact.";let q=$.getConfig();if(!q?.defaultProvider||!q?.defaultModel)return"No AI provider configured. Use /provider to configure a provider first.";$.sendMessage("Analyzing conversation and creating detailed summary...");try{let{getProvider:G}=await import("./chunk-xs370t8p.js"),{streamText:W}=await import("./chunk-3w6pd43t.js"),{getSystemPrompt:H}=await import("./chunk-
|
|
51
|
+
${L||" (none)"}`}},d=R$;var w$={id:"compact",label:"/compact",description:"Summarize current session and create a new session with the summary",execute:async($)=>{let b=$.getCurrentSession();if(!b)return"No active session to compact.";if(b.messages.length===0)return"Current session has no messages to compact.";let q=$.getConfig();if(!q?.defaultProvider||!q?.defaultModel)return"No AI provider configured. Use /provider to configure a provider first.";$.sendMessage("Analyzing conversation and creating detailed summary...");try{let{getProvider:G}=await import("./chunk-xs370t8p.js"),{streamText:W}=await import("./chunk-3w6pd43t.js"),{getSystemPrompt:H}=await import("./chunk-3qxj0zy3.js"),J=G(b.provider),z=q.providers?.[b.provider];if(!z||!J.isConfigured(z))return`Provider ${b.provider} is not properly configured.`;let F=J.createClient(z,b.model),Q=`You are a conversation summarizer. Your task is to create a comprehensive, detailed summary of the following conversation that preserves ALL important information.
|
|
52
52
|
|
|
53
53
|
CRITICAL REQUIREMENTS:
|
|
54
54
|
1. DO NOT omit any important details, decisions, code snippets, file paths, commands, or configurations
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ma as y}from"./chunk-
|
|
1
|
+
import{ma as y}from"./chunk-jk1ebfqn.js";import"./chunk-01gv4qey.js";import"./chunk-g4baca7p.js";import{Ba as u,Da as v}from"./chunk-67n29s4q.js";import"./chunk-kn908zkk.js";import{Ia as p}from"./chunk-nke51f3c.js";import{Ja as m}from"./chunk-xs370t8p.js";import"./chunk-cv1nhr27.js";import"./chunk-jbd95k1f.js";import"./chunk-4vrj3f8r.js";import"./chunk-3m9whg4q.js";var E=(q=0)=>(V)=>`\x1B[${V+q}m`,T=(q=0)=>(V)=>`\x1B[${38+q};5;${V}m`,A=(q=0)=>(V,z,H)=>`\x1B[${38+q};2;${V};${z};${H}m`,Q={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},J1=Object.keys(Q.modifier),c=Object.keys(Q.color),d=Object.keys(Q.bgColor),K1=[...c,...d];function g(){let q=new Map;for(let[V,z]of Object.entries(Q)){for(let[H,J]of Object.entries(z))Q[H]={open:`\x1B[${J[0]}m`,close:`\x1B[${J[1]}m`},z[H]=Q[H],q.set(J[0],J[1]);Object.defineProperty(Q,V,{value:z,enumerable:!1})}return Object.defineProperty(Q,"codes",{value:q,enumerable:!1}),Q.color.close="\x1B[39m",Q.bgColor.close="\x1B[49m",Q.color.ansi=E(),Q.color.ansi256=T(),Q.color.ansi16m=A(),Q.bgColor.ansi=E(10),Q.bgColor.ansi256=T(10),Q.bgColor.ansi16m=A(10),Object.defineProperties(Q,{rgbToAnsi256:{value(V,z,H){if(V===z&&z===H){if(V<8)return 16;if(V>248)return 231;return Math.round((V-8)/247*24)+232}return 16+36*Math.round(V/255*5)+6*Math.round(z/255*5)+Math.round(H/255*5)},enumerable:!1},hexToRgb:{value(V){let z=/[a-f\d]{6}|[a-f\d]{3}/i.exec(V.toString(16));if(!z)return[0,0,0];let[H]=z;if(H.length===3)H=[...H].map((K)=>K+K).join("");let J=Number.parseInt(H,16);return[J>>16&255,J>>8&255,J&255]},enumerable:!1},hexToAnsi256:{value:(V)=>Q.rgbToAnsi256(...Q.hexToRgb(V)),enumerable:!1},ansi256ToAnsi:{value(V){if(V<8)return 30+V;if(V<16)return 90+(V-8);let z,H,J;if(V>=232)z=((V-232)*10+8)/255,H=z,J=z;else{V-=16;let G=V%36;z=Math.floor(V/36)/5,H=Math.floor(G/6)/5,J=G%6/5}let K=Math.max(z,H,J)*2;if(K===0)return 30;let X=30+(Math.round(J)<<2|Math.round(H)<<1|Math.round(z));if(K===2)X+=60;return X},enumerable:!1},rgbToAnsi:{value:(V,z,H)=>Q.ansi256ToAnsi(Q.rgbToAnsi256(V,z,H)),enumerable:!1},hexToAnsi:{value:(V)=>Q.ansi256ToAnsi(Q.hexToAnsi256(V)),enumerable:!1}}),Q}var i=g(),$=i;import P from"node:process";import a from"node:os";import F from"node:tty";function Z(q,V=globalThis.Deno?globalThis.Deno.args:P.argv){let z=q.startsWith("-")?"":q.length===1?"-":"--",H=V.indexOf(z+q),J=V.indexOf("--");return H!==-1&&(J===-1||H<J)}var{env:U}=P,w;if(Z("no-color")||Z("no-colors")||Z("color=false")||Z("color=never"))w=0;else if(Z("color")||Z("colors")||Z("color=true")||Z("color=always"))w=1;function n(){if("FORCE_COLOR"in U){if(U.FORCE_COLOR==="true")return 1;if(U.FORCE_COLOR==="false")return 0;return U.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(U.FORCE_COLOR,10),3)}}function t(q){if(q===0)return!1;return{level:q,hasBasic:!0,has256:q>=2,has16m:q>=3}}function r(q,{streamIsTTY:V,sniffFlags:z=!0}={}){let H=n();if(H!==void 0)w=H;let J=z?w:H;if(J===0)return 0;if(z){if(Z("color=16m")||Z("color=full")||Z("color=truecolor"))return 3;if(Z("color=256"))return 2}if("TF_BUILD"in U&&"AGENT_NAME"in U)return 1;if(q&&!V&&J===void 0)return 0;let K=J||0;if(U.TERM==="dumb")return K;if(P.platform==="win32"){let X=a.release().split(".");if(Number(X[0])>=10&&Number(X[2])>=10586)return Number(X[2])>=14931?3:2;return 1}if("CI"in U){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((X)=>(X in U)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((X)=>(X in U))||U.CI_NAME==="codeship")return 1;return K}if("TEAMCITY_VERSION"in U)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(U.TEAMCITY_VERSION)?1:0;if(U.COLORTERM==="truecolor")return 3;if(U.TERM==="xterm-kitty")return 3;if(U.TERM==="xterm-ghostty")return 3;if(U.TERM==="wezterm")return 3;if("TERM_PROGRAM"in U){let X=Number.parseInt((U.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(U.TERM_PROGRAM){case"iTerm.app":return X>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(U.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(U.TERM))return 1;if("COLORTERM"in U)return 1;return K}function _(q,V={}){let z=r(q,{streamIsTTY:q&&q.isTTY,...V});return t(z)}var o={stdout:_({isTTY:F.isatty(1)}),stderr:_({isTTY:F.isatty(2)})},b=o;function k(q,V,z){let H=q.indexOf(V);if(H===-1)return q;let J=V.length,K=0,X="";do X+=q.slice(K,H)+V+z,K=H+J,H=q.indexOf(V,K);while(H!==-1);return X+=q.slice(K),X}function C(q,V,z,H){let J=0,K="";do{let X=q[H-1]==="\r";K+=q.slice(J,X?H-1:H)+V+(X?`\r
|
|
2
2
|
`:`
|
|
3
3
|
`)+z,J=H+1,H=q.indexOf(`
|
|
4
4
|
`,J)}while(H!==-1);return K+=q.slice(J),K}var{stdout:S,stderr:f}=b,N=Symbol("GENERATOR"),D=Symbol("STYLER"),B=Symbol("IS_EMPTY"),h=["ansi","ansi","ansi256","ansi16m"],O=Object.create(null),l=(q,V={})=>{if(V.level&&!(Number.isInteger(V.level)&&V.level>=0&&V.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let z=S?S.level:0;q.level=V.level===void 0?z:V.level};var s=(q)=>{let V=(...z)=>z.join(" ");return l(V,q),Object.setPrototypeOf(V,L.prototype),V};function L(q){return s(q)}Object.setPrototypeOf(L.prototype,Function.prototype);for(let[q,V]of Object.entries($))O[q]={get(){let z=x(this,I(V.open,V.close,this[D]),this[B]);return Object.defineProperty(this,q,{value:z}),z}};O.visible={get(){let q=x(this,this[D],!0);return Object.defineProperty(this,"visible",{value:q}),q}};var Y=(q,V,z,...H)=>{if(q==="rgb"){if(V==="ansi16m")return $[z].ansi16m(...H);if(V==="ansi256")return $[z].ansi256($.rgbToAnsi256(...H));return $[z].ansi($.rgbToAnsi(...H))}if(q==="hex")return Y("rgb",V,z,...$.hexToRgb(...H));return $[z][q](...H)},e=["rgb","hex","ansi256"];for(let q of e){O[q]={get(){let{level:z}=this;return function(...H){let J=I(Y(q,h[z],"color",...H),$.color.close,this[D]);return x(this,J,this[B])}}};let V="bg"+q[0].toUpperCase()+q.slice(1);O[V]={get(){let{level:z}=this;return function(...H){let J=I(Y(q,h[z],"bgColor",...H),$.bgColor.close,this[D]);return x(this,J,this[B])}}}}var V1=Object.defineProperties(()=>{},{...O,level:{enumerable:!0,get(){return this[N].level},set(q){this[N].level=q}}}),I=(q,V,z)=>{let H,J;if(z===void 0)H=q,J=V;else H=z.openAll+q,J=V+z.closeAll;return{open:q,close:V,openAll:H,closeAll:J,parent:z}},x=(q,V,z)=>{let H=(...J)=>q1(H,J.length===1?""+J[0]:J.join(" "));return Object.setPrototypeOf(H,V1),H[N]=q,H[D]=V,H[B]=z,H},q1=(q,V)=>{if(q.level<=0||!V)return q[B]?"":V;let z=q[D];if(z===void 0)return V;let{openAll:H,closeAll:J}=z;if(V.includes("\x1B"))while(z!==void 0)V=k(V,z.close,z.open),z=z.parent;let K=V.indexOf(`
|