zen-code 4.6.0 → 4.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MultiLineTextInput-B4NEXnFm.mjs +23343 -0
- package/dist/devtools-BHqoL8a6.mjs +11653 -0
- package/dist/graphBuilder-B3IJ7dB2.mjs +2641 -0
- package/dist/{index-B6kFMamn.mjs → index-DEcMgCTj.mjs} +1 -1
- package/dist/{memories-DirsFRdm.mjs → memories-rSGKIPk5.mjs} +1 -1
- package/dist/nonInteractive.mjs +7 -6
- package/dist/{subTasks-Bt97OwvY.mjs → subTasks-5KLIr9iy.mjs} +2 -2
- package/dist/zen-code.mjs +8654 -2
- package/dist/zen-keyboard.mjs +7 -6
- package/package.json +7 -9
- package/dist/MultiLineTextInput-e7hD79Wp.mjs +0 -24631
- package/dist/app-CM8R0ZR6.mjs +0 -16249
- package/dist/assets/worker-I4QjJYba.js +0 -1
- package/dist/checkpoint-1sAx_j1E-DrVPlSLR.mjs +0 -319
- package/dist/checkpoint-DxiUsHMy-Cjy5WGNC.mjs +0 -394
- package/dist/chunk-YWE62C55-DID9N9eS.mjs +0 -193
- package/dist/devtools-CzaVuYnh.mjs +0 -2667
- package/dist/graphBuilder-mpLrx9tk.mjs +0 -49189
- package/dist/index-BUGHAUbY.mjs +0 -117
- package/dist/index-C5j-48Ft.mjs +0 -75
- package/dist/index-ChCbbHFS.mjs +0 -463
- package/dist/index-DS5HVciX.mjs +0 -216
- package/dist/index-FHDPQ2Qk.mjs +0 -211
- package/dist/kysely-Bchvsze0.mjs +0 -4316
- package/dist/load-Cjl9cJ0o.mjs +0 -105
- package/dist/migrator-BatO36Tk.mjs +0 -592
- package/dist/pg-adapter-BFtir1GE-BU2H39HC.mjs +0 -62
- package/dist/postgres-dialect-DaHvQ_AZ.mjs +0 -211
- package/dist/queue-Cu_nO_wt-ChzSaooi.mjs +0 -106
- package/dist/remote-threads-CrG03ZS7-C9duTCnB.mjs +0 -157
- package/dist/shallow-tfhh5rlz.mjs +0 -331
- package/dist/sql-CJsUpKEQ.mjs +0 -8106
- package/dist/sqlite-adapter-BKOLSdoL-BlGKN04G.mjs +0 -71
package/dist/index-DS5HVciX.mjs
DELETED
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
import { z as s, B as r, E as o, r as d, G as i, A as t, o as l, H as n, s as N, I as u, n as p, J as C, d as O, C as c, c as B, b as T, j as m, L as y, l as A, M as S, e as R, N as D, f as I, P as b, p as g, Q as E, x as f, D as h, V as P, W as M, X as Q, k as _, Y as x, m as L, Z as F, g as U, _ as V, h as J, $ as W, q as v, a0 as w, t as K, F as G, a1 as q, a2 as Y, K as z, ab as H, a3 as k, O as X, a5 as j, a4 as Z, a6 as $, R as ee, U as ae, a7 as se, a8 as re, S as oe, y as de, u as ie, v as te, T as le, a as ne, a9 as Ne, aa as ue, i as pe, w as Ce } from "./kysely-Bchvsze0.mjs";
|
|
2
|
-
import { az as ce, p as Be, X as Te, Y as me, q as ye, R as Ae, A as Se, v as Re, Z as De, b as Ie, aB as be, _ as ge, ay as Ee, C as fe, t as he, $ as Pe, r as Me, s as Qe, a0 as _e, a1 as xe, a2 as Le, a3 as Fe, a4 as Ue, a5 as Ve, a6 as Je, a8 as We, D as ve, a9 as we, j as Ke, K as Ge, P as qe, aa as Ye, E as ze, ab as He, ac as ke, ad as Xe, ae as je, af as Ze, ag as $e, ah as ea, I as aa, ai as sa, h as ra, ak as oa, u as da, al as ia, am as ta, an as la, aA as na, J as Na, aj as ua, ao as pa, ap as Ca, aq as Oa, w as ca, M as Ba, ar as Ta, y as ma, H as ya, N as Aa, G as Sa, x as Ra, aE as Da, as as Ia, m as ba, n as ga, at as Ea, o as fa, au as ha, av as Pa, ax as Ma, aF as Qa, aH as _a, aI as xa, O as La, z as Fa, aJ as Ua, aK as Va, aL as Ja, aM as Wa, aN as va, aO as wa, aP as Ka, aQ as Ga, Q as qa, aR as Ya, aS as za, aT as Ha, aU as ka, aV as Xa, aW as ja, aX as Za, aY as $a, aZ as es, a_ as as, a$ as ss, b0 as rs, T as os, b1 as ds, aC as is, aD as ts, b2 as ls, U as ns, b3 as Ns, k as us, b4 as ps, b5 as Cs, b6 as Os, b7 as cs, b8 as Bs, W as Ts, b9 as ms, ba as ys, V as As, g as Ss, c as Rs, B as Ds, d as Is, e as bs, S as gs, a as Es, a7 as fs, L as hs, i as Ps, aG as Ms, f as Qs, aw as _s, l as xs, F as Ls } from "./sql-CJsUpKEQ.mjs";
|
|
3
|
-
import { C as Us, c as Vs, b as Js, D as Ws, a as vs, O as ws } from "./migrator-BatO36Tk.mjs";
|
|
4
|
-
import { b as Gs, d as qs, c as Ys, a as zs, P as Hs } from "./postgres-dialect-DaHvQ_AZ.mjs";
|
|
5
|
-
import { b as Xs, a as js, S as Zs } from "./chunk-YWE62C55-DID9N9eS.mjs";
|
|
6
|
-
export {
|
|
7
|
-
ce as ARITHMETIC_OPERATORS,
|
|
8
|
-
s as AddColumnNode,
|
|
9
|
-
r as AddConstraintNode,
|
|
10
|
-
o as AddIndexNode,
|
|
11
|
-
Be as AggregateFunctionBuilder,
|
|
12
|
-
Te as AggregateFunctionNode,
|
|
13
|
-
me as AliasNode,
|
|
14
|
-
ye as AliasedAggregateFunctionBuilder,
|
|
15
|
-
Ae as AliasedDynamicTableBuilder,
|
|
16
|
-
Se as AliasedExpressionWrapper,
|
|
17
|
-
Re as AliasedJSONPathBuilder,
|
|
18
|
-
d as AlterColumnBuilder,
|
|
19
|
-
i as AlterColumnNode,
|
|
20
|
-
t as AlterTableBuilder,
|
|
21
|
-
l as AlterTableColumnAlteringBuilder,
|
|
22
|
-
n as AlterTableNode,
|
|
23
|
-
N as AlteredColumnBuilder,
|
|
24
|
-
De as AndNode,
|
|
25
|
-
Ie as AndWrapper,
|
|
26
|
-
be as BINARY_OPERATORS,
|
|
27
|
-
ge as BinaryOperationNode,
|
|
28
|
-
Ee as COMPARISON_OPERATORS,
|
|
29
|
-
fe as CaseBuilder,
|
|
30
|
-
he as CaseEndBuilder,
|
|
31
|
-
Pe as CaseNode,
|
|
32
|
-
Me as CaseThenBuilder,
|
|
33
|
-
Qe as CaseWhenBuilder,
|
|
34
|
-
_e as CastNode,
|
|
35
|
-
u as CheckConstraintNode,
|
|
36
|
-
xe as CollateNode,
|
|
37
|
-
p as ColumnDefinitionBuilder,
|
|
38
|
-
C as ColumnDefinitionNode,
|
|
39
|
-
Le as ColumnNode,
|
|
40
|
-
Fe as ColumnUpdateNode,
|
|
41
|
-
O as Command,
|
|
42
|
-
Ue as CommonTableExpressionNameNode,
|
|
43
|
-
Ve as CommonTableExpressionNode,
|
|
44
|
-
Us as CompiledQuery,
|
|
45
|
-
c as ConnectionBuilder,
|
|
46
|
-
B as ControlledTransaction,
|
|
47
|
-
T as ControlledTransactionBuilder,
|
|
48
|
-
m as CreateIndexBuilder,
|
|
49
|
-
y as CreateIndexNode,
|
|
50
|
-
A as CreateSchemaBuilder,
|
|
51
|
-
S as CreateSchemaNode,
|
|
52
|
-
R as CreateTableBuilder,
|
|
53
|
-
D as CreateTableNode,
|
|
54
|
-
I as CreateTypeBuilder,
|
|
55
|
-
b as CreateTypeNode,
|
|
56
|
-
g as CreateViewBuilder,
|
|
57
|
-
E as CreateViewNode,
|
|
58
|
-
Vs as DEFAULT_MIGRATION_LOCK_TABLE,
|
|
59
|
-
Js as DEFAULT_MIGRATION_TABLE,
|
|
60
|
-
Je as DataTypeNode,
|
|
61
|
-
f as DefaultConnectionProvider,
|
|
62
|
-
We as DefaultInsertValueNode,
|
|
63
|
-
Ws as DefaultQueryCompiler,
|
|
64
|
-
h as DefaultQueryExecutor,
|
|
65
|
-
P as DefaultValueNode,
|
|
66
|
-
ve as DeleteQueryBuilder,
|
|
67
|
-
we as DeleteQueryNode,
|
|
68
|
-
Ke as DeleteResult,
|
|
69
|
-
vs as DialectAdapterBase,
|
|
70
|
-
M as DropColumnNode,
|
|
71
|
-
Q as DropConstraintNode,
|
|
72
|
-
_ as DropIndexBuilder,
|
|
73
|
-
x as DropIndexNode,
|
|
74
|
-
L as DropSchemaBuilder,
|
|
75
|
-
F as DropSchemaNode,
|
|
76
|
-
U as DropTableBuilder,
|
|
77
|
-
V as DropTableNode,
|
|
78
|
-
J as DropTypeBuilder,
|
|
79
|
-
W as DropTypeNode,
|
|
80
|
-
v as DropViewBuilder,
|
|
81
|
-
w as DropViewNode,
|
|
82
|
-
K as DynamicModule,
|
|
83
|
-
Ge as DynamicReferenceBuilder,
|
|
84
|
-
qe as DynamicTableBuilder,
|
|
85
|
-
Ye as ExplainNode,
|
|
86
|
-
ze as ExpressionWrapper,
|
|
87
|
-
He as FetchNode,
|
|
88
|
-
G as ForeignKeyConstraintBuilder,
|
|
89
|
-
q as ForeignKeyConstraintNode,
|
|
90
|
-
ke as FromNode,
|
|
91
|
-
Xe as FunctionNode,
|
|
92
|
-
Y as GeneratedNode,
|
|
93
|
-
je as GroupByItemNode,
|
|
94
|
-
Ze as GroupByNode,
|
|
95
|
-
$e as HavingNode,
|
|
96
|
-
ea as IdentifierNode,
|
|
97
|
-
aa as InsertQueryBuilder,
|
|
98
|
-
sa as InsertQueryNode,
|
|
99
|
-
ra as InsertResult,
|
|
100
|
-
oa as JSONOperatorChainNode,
|
|
101
|
-
da as JSONPathBuilder,
|
|
102
|
-
ia as JSONPathLegNode,
|
|
103
|
-
ta as JSONPathNode,
|
|
104
|
-
la as JSONReferenceNode,
|
|
105
|
-
na as JSON_OPERATORS,
|
|
106
|
-
Na as JoinBuilder,
|
|
107
|
-
ua as JoinNode,
|
|
108
|
-
z as Kysely,
|
|
109
|
-
pa as LimitNode,
|
|
110
|
-
Ca as ListNode,
|
|
111
|
-
H as Log,
|
|
112
|
-
Oa as MatchedNode,
|
|
113
|
-
ca as MatchedThenableMergeQueryBuilder,
|
|
114
|
-
Ba as MergeQueryBuilder,
|
|
115
|
-
Ta as MergeQueryNode,
|
|
116
|
-
ma as MergeResult,
|
|
117
|
-
k as ModifyColumnNode,
|
|
118
|
-
ya as NOOP_QUERY_EXECUTOR,
|
|
119
|
-
Aa as NoResultError,
|
|
120
|
-
Sa as NoopQueryExecutor,
|
|
121
|
-
Ra as NotMatchedThenableMergeQueryBuilder,
|
|
122
|
-
X as ON_COMMIT_ACTIONS,
|
|
123
|
-
j as ON_MODIFY_FOREIGN_ACTIONS,
|
|
124
|
-
Da as OPERATORS,
|
|
125
|
-
Ia as OffsetNode,
|
|
126
|
-
ba as OnConflictBuilder,
|
|
127
|
-
ga as OnConflictDoNothingBuilder,
|
|
128
|
-
Ea as OnConflictNode,
|
|
129
|
-
fa as OnConflictUpdateBuilder,
|
|
130
|
-
ha as OnDuplicateKeyNode,
|
|
131
|
-
Pa as OnNode,
|
|
132
|
-
Ma as OperationNodeTransformer,
|
|
133
|
-
ws as OperationNodeVisitor,
|
|
134
|
-
Qa as OperatorNode,
|
|
135
|
-
_a as OrActionNode,
|
|
136
|
-
xa as OrNode,
|
|
137
|
-
La as OrWrapper,
|
|
138
|
-
Fa as OrderByItemBuilder,
|
|
139
|
-
Ua as OrderByItemNode,
|
|
140
|
-
Va as OrderByNode,
|
|
141
|
-
Ja as OutputNode,
|
|
142
|
-
Wa as OverNode,
|
|
143
|
-
va as ParensNode,
|
|
144
|
-
wa as PartitionByItemNode,
|
|
145
|
-
Ka as PartitionByNode,
|
|
146
|
-
Gs as PostgresAdapter,
|
|
147
|
-
qs as PostgresDialect,
|
|
148
|
-
Ys as PostgresDriver,
|
|
149
|
-
zs as PostgresIntrospector,
|
|
150
|
-
Hs as PostgresQueryCompiler,
|
|
151
|
-
Z as PrimaryKeyConstraintNode,
|
|
152
|
-
Ga as PrimitiveValueListNode,
|
|
153
|
-
qa as QueryCreator,
|
|
154
|
-
Ya as QueryNode,
|
|
155
|
-
za as RawNode,
|
|
156
|
-
Ha as ReferenceNode,
|
|
157
|
-
$ as ReferencesNode,
|
|
158
|
-
ee as RefreshMaterializedViewBuilder,
|
|
159
|
-
ae as RefreshMaterializedViewNode,
|
|
160
|
-
se as RenameColumnNode,
|
|
161
|
-
re as RenameConstraintNode,
|
|
162
|
-
ka as ReturningNode,
|
|
163
|
-
oe as SchemaModule,
|
|
164
|
-
Xa as SchemableIdentifierNode,
|
|
165
|
-
ja as SelectAllNode,
|
|
166
|
-
Za as SelectModifierNode,
|
|
167
|
-
$a as SelectQueryNode,
|
|
168
|
-
es as SelectionNode,
|
|
169
|
-
as as SetOperationNode,
|
|
170
|
-
de as SingleConnectionProvider,
|
|
171
|
-
Xs as SqliteAdapter,
|
|
172
|
-
js as SqliteIntrospector,
|
|
173
|
-
Zs as SqliteQueryCompiler,
|
|
174
|
-
ie as TRANSACTION_ACCESS_MODES,
|
|
175
|
-
te as TRANSACTION_ISOLATION_LEVELS,
|
|
176
|
-
ss as TableNode,
|
|
177
|
-
rs as TopNode,
|
|
178
|
-
le as Transaction,
|
|
179
|
-
ne as TransactionBuilder,
|
|
180
|
-
os as TraversedJSONPathBuilder,
|
|
181
|
-
ds as TupleNode,
|
|
182
|
-
is as UNARY_FILTER_OPERATORS,
|
|
183
|
-
ts as UNARY_OPERATORS,
|
|
184
|
-
ls as UnaryOperationNode,
|
|
185
|
-
Ne as UniqueConstraintNode,
|
|
186
|
-
ns as UpdateQueryBuilder,
|
|
187
|
-
Ns as UpdateQueryNode,
|
|
188
|
-
us as UpdateResult,
|
|
189
|
-
ps as UsingNode,
|
|
190
|
-
Cs as ValueListNode,
|
|
191
|
-
Os as ValueNode,
|
|
192
|
-
cs as ValuesNode,
|
|
193
|
-
Bs as WhenNode,
|
|
194
|
-
Ts as WheneableMergeQueryBuilder,
|
|
195
|
-
ms as WhereNode,
|
|
196
|
-
ys as WithNode,
|
|
197
|
-
As as WithSchemaPlugin,
|
|
198
|
-
Ss as createFunctionModule,
|
|
199
|
-
Rs as createQueryId,
|
|
200
|
-
Ds as createRawBuilder,
|
|
201
|
-
Is as createSelectQueryBuilder,
|
|
202
|
-
bs as expressionBuilder,
|
|
203
|
-
gs as isAliasedDynamicTableBuilder,
|
|
204
|
-
Es as isAliasedExpression,
|
|
205
|
-
fs as isColumnDataType,
|
|
206
|
-
ue as isCompilable,
|
|
207
|
-
hs as isDynamicReferenceBuilder,
|
|
208
|
-
Ps as isExpression,
|
|
209
|
-
Ms as isJSONOperator,
|
|
210
|
-
pe as isKyselyProps,
|
|
211
|
-
Qs as isNoResultErrorConstructor,
|
|
212
|
-
_s as isOperationNodeSource,
|
|
213
|
-
xs as logOnce,
|
|
214
|
-
Ls as sql,
|
|
215
|
-
Ce as validateTransactionSettings
|
|
216
|
-
};
|
package/dist/index-FHDPQ2Qk.mjs
DELETED
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
import { l as n } from "./graphBuilder-mpLrx9tk.mjs";
|
|
2
|
-
import { D as b, u as j, y as v, t as R, B as T, z as L, E as x, G as A, r as $, w as _, s as C, M as I, P as E, x as z, q as U, v as F, p as W, H as K } from "./graphBuilder-mpLrx9tk.mjs";
|
|
3
|
-
import r from "node:fs/promises";
|
|
4
|
-
import { join as m } from "node:path";
|
|
5
|
-
import { l as d } from "./load-Cjl9cJ0o.mjs";
|
|
6
|
-
const k = `
|
|
7
|
-
|
|
8
|
-
## Project Documentation
|
|
9
|
-
|
|
10
|
-
{docs_content}`;
|
|
11
|
-
class g {
|
|
12
|
-
name = "AgentsMdMiddleware";
|
|
13
|
-
stateSchema = void 0;
|
|
14
|
-
contextSchema = void 0;
|
|
15
|
-
tools = [];
|
|
16
|
-
projectRoot;
|
|
17
|
-
systemPromptTemplate;
|
|
18
|
-
/**
|
|
19
|
-
* Initialize the documentation middleware.
|
|
20
|
-
*
|
|
21
|
-
* @param projectRoot - Path to the project root directory (defaults to process.cwd())
|
|
22
|
-
*/
|
|
23
|
-
constructor(s = {}) {
|
|
24
|
-
this.projectRoot = s.projectRoot || process.cwd(), this.systemPromptTemplate = k;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Find and read the project documentation file.
|
|
28
|
-
* Priority: CLAUDE.md > AGENTS.md
|
|
29
|
-
*
|
|
30
|
-
* @returns The content of the first found documentation file, or null if none exist
|
|
31
|
-
*/
|
|
32
|
-
async findDocumentationFile() {
|
|
33
|
-
const s = ["CLAUDE.md", "AGENTS.md"];
|
|
34
|
-
for (const i of s) {
|
|
35
|
-
const l = m(this.projectRoot, i);
|
|
36
|
-
try {
|
|
37
|
-
return await r.access(l), { content: await r.readFile(l, "utf-8"), filename: i };
|
|
38
|
-
} catch {
|
|
39
|
-
continue;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Inject project documentation into the system prompt.
|
|
46
|
-
*
|
|
47
|
-
* This runs on every model call to ensure documentation info is always available.
|
|
48
|
-
*
|
|
49
|
-
* @param request - The model request being processed
|
|
50
|
-
* @param handler - The handler function to call with the modified request
|
|
51
|
-
* @returns The model response from the handler
|
|
52
|
-
*/
|
|
53
|
-
async wrapModelCall(s, i) {
|
|
54
|
-
const l = await this.findDocumentationFile();
|
|
55
|
-
if (!l)
|
|
56
|
-
return await i(s);
|
|
57
|
-
const t = this.systemPromptTemplate.replace("{docs_content}", l.content);
|
|
58
|
-
let e;
|
|
59
|
-
s.systemPrompt ? e = s.systemPrompt + `
|
|
60
|
-
|
|
61
|
-
` + t : e = t;
|
|
62
|
-
const a = new n(e), o = {
|
|
63
|
-
...s,
|
|
64
|
-
systemMessage: a
|
|
65
|
-
};
|
|
66
|
-
return await i(o);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
const u = `
|
|
70
|
-
|
|
71
|
-
## Skills System
|
|
72
|
-
|
|
73
|
-
You have access to a skills library that provides specialized capabilities and domain knowledge.
|
|
74
|
-
|
|
75
|
-
{skills_locations}
|
|
76
|
-
|
|
77
|
-
**Available Skills:**
|
|
78
|
-
|
|
79
|
-
{skills_list}
|
|
80
|
-
|
|
81
|
-
**How to Use Skills (Progressive Disclosure):**
|
|
82
|
-
|
|
83
|
-
Skills follow a **progressive disclosure** pattern - you know they exist (name + description above), but you only read the full instructions when needed:
|
|
84
|
-
|
|
85
|
-
1. **Recognize when a skill applies**: Check if the user's task matches any skill's description
|
|
86
|
-
2. **Read the skill's full instructions**: The skill list above shows the exact path to use with read_file
|
|
87
|
-
3. **Follow the skill's instructions**: SKILL.md contains step-by-step workflows, best practices, and examples
|
|
88
|
-
4. **Access supporting files**: Skills may include Python scripts, configs, or reference docs - use absolute paths
|
|
89
|
-
|
|
90
|
-
**When to Use Skills:**
|
|
91
|
-
- When the user's request matches a skill's domain (e.g., "research X" → web-research skill)
|
|
92
|
-
- When you need specialized knowledge or structured workflows
|
|
93
|
-
- When a skill provides proven patterns for complex tasks
|
|
94
|
-
|
|
95
|
-
**Skills are Self-Documenting:**
|
|
96
|
-
- Each SKILL.md tells you exactly what the skill does and how to use it
|
|
97
|
-
- The skill list above shows the full path for each skill's SKILL.md file
|
|
98
|
-
|
|
99
|
-
**Executing Skill Scripts:**
|
|
100
|
-
Skills may contain Python scripts or other executable files. Always use absolute paths from the skill list.
|
|
101
|
-
|
|
102
|
-
**Example Workflow:**
|
|
103
|
-
|
|
104
|
-
User: "Can you research the latest developments in quantum computing?"
|
|
105
|
-
|
|
106
|
-
1. Check available skills above → See "web-research" skill with its full path
|
|
107
|
-
2. Read the skill using the path shown in the list
|
|
108
|
-
3. Follow the skill's research workflow (search → organize → synthesize)
|
|
109
|
-
4. Use any helper scripts with absolute paths
|
|
110
|
-
|
|
111
|
-
Remember: Skills are tools to make you more capable and consistent. When in doubt, check if a skill exists for the task!
|
|
112
|
-
`;
|
|
113
|
-
class P {
|
|
114
|
-
name = "SkillsMiddleware";
|
|
115
|
-
// No context schema needed
|
|
116
|
-
stateSchema = void 0;
|
|
117
|
-
// No context schema needed
|
|
118
|
-
contextSchema = void 0;
|
|
119
|
-
// No additional tools
|
|
120
|
-
tools = [];
|
|
121
|
-
skillsDir;
|
|
122
|
-
assistantId;
|
|
123
|
-
projectSkillsDir;
|
|
124
|
-
userSkillsDisplay;
|
|
125
|
-
systemPromptTemplate;
|
|
126
|
-
/**
|
|
127
|
-
* Initialize the skills middleware.
|
|
128
|
-
*
|
|
129
|
-
* @param skillsDir - Path to the user-level skills directory (per-agent)
|
|
130
|
-
* @param assistantId - The agent identifier for path references in prompts
|
|
131
|
-
* @param projectSkillsDir - Optional path to project-level skills directory
|
|
132
|
-
*/
|
|
133
|
-
constructor(s = {}) {
|
|
134
|
-
this.skillsDir = s.skillsDir, this.assistantId = s.assistantId, this.projectSkillsDir = s.projectSkillsDir || "./.claude/skills", this.skillsDir && !this.assistantId && console.warn("user skills directory is provided, but assistant id is not provided"), this.assistantId && (this.userSkillsDisplay = `~/.claude/${this.assistantId}/skills`), this.systemPromptTemplate = u;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Format skills locations for display in system prompt.
|
|
138
|
-
*/
|
|
139
|
-
formatSkillsLocations() {
|
|
140
|
-
const s = [];
|
|
141
|
-
return this.userSkillsDisplay && s.push(`**User Skills**: \`${this.userSkillsDisplay}\``), this.projectSkillsDir && s.push(`**Project Skills**: \`${this.projectSkillsDir}\` (overrides user skills)`), s.join(`
|
|
142
|
-
`);
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Format skills metadata for display in system prompt.
|
|
146
|
-
*/
|
|
147
|
-
formatSkillsList(s) {
|
|
148
|
-
if (!s.length) {
|
|
149
|
-
const e = [`${this.userSkillsDisplay}/`];
|
|
150
|
-
return this.projectSkillsDir && e.push(`${this.projectSkillsDir}/`), `(No skills available yet. You can create skills in ${e.join(" or ")})`;
|
|
151
|
-
}
|
|
152
|
-
const i = s.filter((e) => e.source === "user"), l = s.filter((e) => e.source === "project"), t = [];
|
|
153
|
-
if (i.length) {
|
|
154
|
-
t.push("**User Skills:**");
|
|
155
|
-
for (const e of i)
|
|
156
|
-
t.push(`- **${e.name}**: ${e.description}`), t.push(` → Read \`${e.path}\` for full instructions`);
|
|
157
|
-
t.push("");
|
|
158
|
-
}
|
|
159
|
-
if (l.length) {
|
|
160
|
-
t.push("**Project Skills:**");
|
|
161
|
-
for (const e of l)
|
|
162
|
-
t.push(`- **${e.name}**: ${e.description}`), t.push(` → Read \`${e.path}\` for full instructions`);
|
|
163
|
-
}
|
|
164
|
-
return t.join(`
|
|
165
|
-
`);
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Inject skills documentation into the system prompt.
|
|
169
|
-
*
|
|
170
|
-
* This runs on every model call to ensure skills info is always available.
|
|
171
|
-
*
|
|
172
|
-
* @param request - The model request being processed
|
|
173
|
-
* @param handler - The handler function to call with the modified request
|
|
174
|
-
* @returns The model response from the handler
|
|
175
|
-
*/
|
|
176
|
-
async wrapModelCall(s, i) {
|
|
177
|
-
const l = d(this.skillsDir, this.projectSkillsDir), t = this.formatSkillsLocations(), e = this.formatSkillsList(l), a = this.systemPromptTemplate.replace("{skills_locations}", t).replace("{skills_list}", e);
|
|
178
|
-
let o;
|
|
179
|
-
s.systemPrompt ? o = s.systemPrompt + `
|
|
180
|
-
|
|
181
|
-
` + a : o = a;
|
|
182
|
-
const h = new n(o), p = {
|
|
183
|
-
...s,
|
|
184
|
-
systemMessage: h
|
|
185
|
-
};
|
|
186
|
-
return await i(p);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
export {
|
|
190
|
-
b as AgentPackage,
|
|
191
|
-
j as AgentPackageSchema,
|
|
192
|
-
v as AgentRepository,
|
|
193
|
-
R as AgentSchema,
|
|
194
|
-
T as AgentSerializer,
|
|
195
|
-
L as AgentValidator,
|
|
196
|
-
g as AgentsMdMiddleware,
|
|
197
|
-
x as BaseStorage,
|
|
198
|
-
A as MemoryStorage,
|
|
199
|
-
$ as MiddlewareCustomParamsSchema,
|
|
200
|
-
_ as MiddlewareRegistry,
|
|
201
|
-
C as MiddlewareSchema,
|
|
202
|
-
I as ModelSchema,
|
|
203
|
-
E as PromptSchema,
|
|
204
|
-
P as SkillsMiddleware,
|
|
205
|
-
z as StandardAgent,
|
|
206
|
-
U as ToolCustomParamsSchema,
|
|
207
|
-
F as ToolRegistry,
|
|
208
|
-
W as ToolSchema,
|
|
209
|
-
K as anthropicPromptCachingMiddleware,
|
|
210
|
-
d as listSkills
|
|
211
|
-
};
|