@jianxx/dsh-cc-tool-search 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/README.zh.md +4 -1
- package/lib/index.d.ts +14 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +76 -5
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -31,10 +31,13 @@ The design rides the repo's effect conventions:
|
|
|
31
31
|
- **Restriction stays authoritative.** `registerDeferred` reserves the tool's name in the `dsh-tools` registry (known but not visible), so a scoped `restrict()` can deny it *before* it loads. ToolSearch checks that gate: a deferred tool a scope denies is **not** activated for that scope, and the result says why.
|
|
32
32
|
- **Search is scope-visible.** A deferred registration lands in the calling scope's layer, and ToolSearch searches the *calling agent's* scope chain (itself and ancestors) — so a tool an agent deferred is visible to that agent's search and its descendants, but a sibling scope or the global view never sees it. A globally-deferred tool remains globally visible as before.
|
|
33
33
|
- **Deferred names never leak into the prompt.** Only activated (`alwaysLoad` or loaded) tools enter the schema; reserved-but-unloaded names are known for restriction/`toolOrder` purposes but never model-visible.
|
|
34
|
+
- **ToolSearch itself is lazy, with hysteresis.** While the searchable pool is empty, only the `ToolSearch` *name* is reserved (restrictable, not visible); the first non-`alwaysLoad` deferred registration brings the tool into the model-visible set, and it then stays registered for the rest of the session even if the pool empties again — a mid-session removal would shift the assembled tool order and break the cached prefix. An empty pool also makes the tool's "tools are hidden, search to load them" description actively misleading, which is why it is withheld.
|
|
34
35
|
|
|
35
36
|
## Model Experience
|
|
36
37
|
|
|
37
|
-
Turn one, the model sees only `ToolSearch` plus whatever is already loaded (including `alwaysLoad` tools). It searches for a capability by keywords, and the result names the now-available tools. On the next turn those tools are first-class: declare them, call them. Already-loaded tools drop out of the deferred set, so a second search for them is correctly empty.
|
|
38
|
+
Turn one, the model sees only `ToolSearch` plus whatever is already loaded (including `alwaysLoad` tools) — or, in a session with no deferred tools at all, no `ToolSearch` either. It searches for a capability by keywords, and the result names the now-available tools. On the next turn those tools are first-class: declare them, call them. Already-loaded tools drop out of the deferred set, so a second search for them is correctly empty.
|
|
39
|
+
|
|
40
|
+
An empty search result always says *why*, so the model never mistakes "nothing deferred" for "I lack the capability": an empty pool yields "every tool you can use is already in your function list; call it directly", a fully-loaded pool yields "all deferred tools available to you are already loaded", and a simple miss on a non-empty pool appends "the capability may already be available — call it directly".
|
|
38
41
|
|
|
39
42
|
## Known Limitations and Deferred Work
|
|
40
43
|
|
package/README.zh.md
CHANGED
|
@@ -30,10 +30,13 @@ ctx.toolSearch.registerDeferred({
|
|
|
30
30
|
- **激活是幂等的。** 再次激活一个已加载的工具是空操作;重复注册(否则会因重名而抛错)绝不会发生。
|
|
31
31
|
- **限制仍然优先。** `registerDeferred` 会在 `dsh-tools` 注册表里预留这个工具名(已知但不可见),因此局部的 `restrict()` 可以在它*加载前*将其拒绝。ToolSearch 会检查这道闸:被某个作用域拒绝的延迟工具,绝不会为该作用域激活,结果里会说明原因。
|
|
32
32
|
- **延迟名字永不泄漏进提示词。** 只有已激活(`alwaysLoad` 或已加载)的工具才进 schema;被预留而未加载的名字仅用于限制/`toolOrder` 判定,不对外可见。
|
|
33
|
+
- **ToolSearch 自身懒注册、带迟滞。** 可搜索池为空时只预留 `ToolSearch` 这个名字(可限制、不可见);首个非 `alwaysLoad` 的延迟注册才把它带进模型可见集,此后即使池再次清空也保持注册——会话中途注销会移动组装后的工具顺序、击穿缓存前缀。空池时该工具"工具被隐藏、搜索后加载"的描述会主动误导模型,这正是它在空池时不展示的原因。
|
|
33
34
|
|
|
34
35
|
## 模型体验
|
|
35
36
|
|
|
36
|
-
第一轮,模型只看到 `ToolSearch` 加已加载的(包括 `alwaysLoad`
|
|
37
|
+
第一轮,模型只看到 `ToolSearch` 加已加载的(包括 `alwaysLoad` 的)工具——而在完全没有延迟工具的会话里,连 `ToolSearch` 也不出现。它按关键字搜索某个能力,结果里点名现在可用哪些工具。下一轮这些工具就成头等公民:声明它们,调用它们。已加载的工具会退出延迟集合,因此再次搜索它们会正确地得到空结果。
|
|
38
|
+
|
|
39
|
+
空搜索结果总会说明*原因*,模型绝不会把"没有延迟工具"误读为"我没有这个能力":池为空时回复"你可用的工具都已在 function list 中,直接调用";池已全部加载时回复"你可用的延迟工具都已加载,直接调用";池非空但无匹配时追加"该能力可能本已可用——直接调用试试"。
|
|
37
40
|
|
|
38
41
|
## 已知限制与暂缓事项
|
|
39
42
|
|
package/lib/index.d.ts
CHANGED
|
@@ -16,6 +16,14 @@
|
|
|
16
16
|
* model: {@link DeferredToolRegistry.registerDeferred} is itself an effect, and
|
|
17
17
|
* {@link registry.activate} gate the load behind the calling scope's tool
|
|
18
18
|
* restriction, so a deferred tool a scope denies is never loaded for it.
|
|
19
|
+
*
|
|
20
|
+
* The ToolSearch tool itself is registered LAZILY: while no searchable
|
|
21
|
+
* (non-alwaysLoad) deferred entry exists, only its name is reserved — an empty
|
|
22
|
+
* pool makes the tool useless, and its "tools are hidden, search to load them"
|
|
23
|
+
* description actively misleads models into believing they lack capabilities
|
|
24
|
+
* they actually hold. The first deferred registration brings ToolSearch into
|
|
25
|
+
* the model-visible set; it then stays (hysteresis) so the assembled tool
|
|
26
|
+
* order never shifts mid-session.
|
|
19
27
|
* @module @jianxx/dsh-cc-tool-search
|
|
20
28
|
*/
|
|
21
29
|
import { Context, Service } from '@deepseek-ai/cordis';
|
|
@@ -81,6 +89,10 @@ export type DeferredActivationResult = {
|
|
|
81
89
|
export declare class DeferredToolRegistry extends Service {
|
|
82
90
|
static inject: string[];
|
|
83
91
|
private readonly layers;
|
|
92
|
+
/** Non-alwaysLoad deferred entries registered on this registry instance. */
|
|
93
|
+
private searchableCount;
|
|
94
|
+
/** Disposer for the lazily-registered ToolSearch tool, once visible. */
|
|
95
|
+
private toolDisposer;
|
|
84
96
|
constructor(ctx: Context);
|
|
85
97
|
/**
|
|
86
98
|
* Register a deferred capability. The name+description (+hint) are searchable
|
|
@@ -125,6 +137,8 @@ export declare class DeferredToolRegistry extends Service {
|
|
|
125
137
|
* set — and its ancestors' — stays visible to it.
|
|
126
138
|
*/
|
|
127
139
|
private allDeferred;
|
|
140
|
+
/** Non-alwaysLoad deferred entries visible to a scope: total and not-yet-activated. */
|
|
141
|
+
private poolStats;
|
|
128
142
|
/** Run the entry's activation callback once and retain its disposer. */
|
|
129
143
|
private activateStore;
|
|
130
144
|
/** Tear down an activated tool's real registration, if any. */
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAEtD,OAAO,KAAK,EAAE,QAAQ,EAAc,MAAM,wBAAwB,CAAA;AAMlE,6CAA6C;AAC7C,eAAO,MAAM,gBAAgB,eAAe,CAAA;AAE5C,sFAAsF;AACtF,MAAM,WAAW,wBAAwB;IACvC,oFAAoF;IACpF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,8FAA8F;IAC9F,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,oFAAoF;IACpF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;IAC7B;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,MAAM,IAAI,CAAA;CACpC;AAED,qEAAqE;AACrE,MAAM,WAAW,iBAAiB;IAChC,8BAA8B;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,qCAAqC;IACrC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;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xE,OAAO,CAAC,aAAa;IAQrB,+DAA+D;IAC/D,OAAO,CAAC,eAAe;IAQvB,yEAAyE;IACzE,OAAO,CAAC,cAAc;CAgFvB;AA2CD,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QACf,UAAU,EAAE,oBAAoB,CAAA;KACjC;CACF;AAED,eAAe,oBAAoB,CAAA"}
|
package/lib/index.js
CHANGED
|
@@ -16,6 +16,14 @@
|
|
|
16
16
|
* model: {@link DeferredToolRegistry.registerDeferred} is itself an effect, and
|
|
17
17
|
* {@link registry.activate} gate the load behind the calling scope's tool
|
|
18
18
|
* restriction, so a deferred tool a scope denies is never loaded for it.
|
|
19
|
+
*
|
|
20
|
+
* The ToolSearch tool itself is registered LAZILY: while no searchable
|
|
21
|
+
* (non-alwaysLoad) deferred entry exists, only its name is reserved — an empty
|
|
22
|
+
* pool makes the tool useless, and its "tools are hidden, search to load them"
|
|
23
|
+
* description actively misleads models into believing they lack capabilities
|
|
24
|
+
* they actually hold. The first deferred registration brings ToolSearch into
|
|
25
|
+
* the model-visible set; it then stays (hysteresis) so the assembled tool
|
|
26
|
+
* order never shifts mid-session.
|
|
19
27
|
* @module @jianxx/dsh-cc-tool-search
|
|
20
28
|
*/
|
|
21
29
|
import { Service } from '@deepseek-ai/cordis';
|
|
@@ -85,11 +93,18 @@ export class DeferredToolRegistry extends Service {
|
|
|
85
93
|
// Deferred-set changes are not model-visible (deferred tools never enter
|
|
86
94
|
// the prompt); actual activations fire `tools/change` through `register()`.
|
|
87
95
|
() => { });
|
|
96
|
+
/** Non-alwaysLoad deferred entries registered on this registry instance. */
|
|
97
|
+
searchableCount = 0;
|
|
98
|
+
/** Disposer for the lazily-registered ToolSearch tool, once visible. */
|
|
99
|
+
toolDisposer;
|
|
88
100
|
constructor(ctx) {
|
|
89
101
|
super(ctx, 'toolSearch');
|
|
90
102
|
// The ToolSearch tool itself is never deferred: it is the load path, so it
|
|
91
|
-
// must be visible
|
|
92
|
-
|
|
103
|
+
// must be visible once a searchable pool exists. But it is also pointless
|
|
104
|
+
// — and its description actively misleading — while the pool is empty, so
|
|
105
|
+
// only the name is reserved here (keeping it restrictable); the real
|
|
106
|
+
// registration happens on the first non-alwaysLoad deferred entry.
|
|
107
|
+
ctx.tools.reserve(TOOL_SEARCH_NAME);
|
|
93
108
|
}
|
|
94
109
|
/**
|
|
95
110
|
* Register a deferred capability. The name+description (+hint) are searchable
|
|
@@ -119,9 +134,28 @@ export class DeferredToolRegistry extends Service {
|
|
|
119
134
|
// Reserve the name in the tools registry so a scoped restriction can gate
|
|
120
135
|
// it before its definition loads (restrict only names known capabilities).
|
|
121
136
|
const reserve = this.ctx.tools.reserve(reg.name);
|
|
137
|
+
// Lazy registration of the ToolSearch tool itself: the first non-alwaysLoad
|
|
138
|
+
// deferred entry brings the search tool into the model-visible set (0→1).
|
|
139
|
+
// It stays registered once added (hysteresis — never torn down on 1→0, so
|
|
140
|
+
// the assembled tool order never shifts mid-session), and unloads with the
|
|
141
|
+
// service context like any other registration.
|
|
142
|
+
let disposed = false;
|
|
143
|
+
if (!stored.alwaysLoad) {
|
|
144
|
+
this.searchableCount += 1;
|
|
145
|
+
// Guard on the disposer, not the count: with hysteresis the count can
|
|
146
|
+
// return to 0 while the registration stands, and re-registering would
|
|
147
|
+
// throw on the duplicate name.
|
|
148
|
+
if (this.toolDisposer === undefined)
|
|
149
|
+
this.toolDisposer = this.ctx.tools.register(this.toolDefinition());
|
|
150
|
+
}
|
|
122
151
|
return () => {
|
|
152
|
+
if (disposed)
|
|
153
|
+
return;
|
|
154
|
+
disposed = true;
|
|
123
155
|
unwind();
|
|
124
156
|
reserve();
|
|
157
|
+
if (!stored.alwaysLoad)
|
|
158
|
+
this.searchableCount -= 1;
|
|
125
159
|
};
|
|
126
160
|
}
|
|
127
161
|
/**
|
|
@@ -188,6 +222,19 @@ export class DeferredToolRegistry extends Service {
|
|
|
188
222
|
const key = scope ?? scopeOf(this.ctx) ?? undefined;
|
|
189
223
|
return [...this.layers.merge(key, layer => layer.tools).values()];
|
|
190
224
|
}
|
|
225
|
+
/** Non-alwaysLoad deferred entries visible to a scope: total and not-yet-activated. */
|
|
226
|
+
poolStats(scope) {
|
|
227
|
+
let total = 0;
|
|
228
|
+
let searchable = 0;
|
|
229
|
+
for (const stored of this.allDeferred(scope)) {
|
|
230
|
+
if (stored.alwaysLoad)
|
|
231
|
+
continue;
|
|
232
|
+
total += 1;
|
|
233
|
+
if (!stored.activated)
|
|
234
|
+
searchable += 1;
|
|
235
|
+
}
|
|
236
|
+
return { total, searchable };
|
|
237
|
+
}
|
|
191
238
|
/** Run the entry's activation callback once and retain its disposer. */
|
|
192
239
|
activateStore(stored) {
|
|
193
240
|
if (stored.activated)
|
|
@@ -212,7 +259,8 @@ export class DeferredToolRegistry extends Service {
|
|
|
212
259
|
description: 'Search for deferred tools that are NOT currently loaded, then load the ones you need by their name. '
|
|
213
260
|
+ 'Deferred tools are capabilities (e.g. filesystem, shell, or web tools) omitted from your function list to save prompt '
|
|
214
261
|
+ 'space. Search with the capability you need; loading a tool makes it available to call exactly like any tool defined at '
|
|
215
|
-
+ 'the top of the prompt. Loading is idempotent: loading an already-available tool is a harmless no-op.'
|
|
262
|
+
+ 'the top of the prompt. Loading is idempotent: loading an already-available tool is a harmless no-op. If a search returns '
|
|
263
|
+
+ 'nothing, the capability may already be available — call it directly.',
|
|
216
264
|
parameters: {
|
|
217
265
|
query: {
|
|
218
266
|
type: 'string',
|
|
@@ -230,6 +278,7 @@ export class DeferredToolRegistry extends Service {
|
|
|
230
278
|
additionalProperties: false,
|
|
231
279
|
properties: {
|
|
232
280
|
query: { type: 'string', required: true },
|
|
281
|
+
message: { type: 'string', required: true },
|
|
233
282
|
results: {
|
|
234
283
|
type: 'array',
|
|
235
284
|
required: true,
|
|
@@ -252,7 +301,7 @@ export class DeferredToolRegistry extends Service {
|
|
|
252
301
|
},
|
|
253
302
|
render: (_args, value) => [{
|
|
254
303
|
type: 'text',
|
|
255
|
-
text:
|
|
304
|
+
text: value.message,
|
|
256
305
|
}],
|
|
257
306
|
},
|
|
258
307
|
// Arrow bodies keep `this` bound to the registry service; the schema
|
|
@@ -271,13 +320,35 @@ export class DeferredToolRegistry extends Service {
|
|
|
271
320
|
...outcome.status === 'denied' ? { reason: outcome.reason } : {},
|
|
272
321
|
};
|
|
273
322
|
});
|
|
274
|
-
|
|
323
|
+
const { total, searchable } = this.poolStats(scope);
|
|
324
|
+
return Promise.resolve({
|
|
325
|
+
query: args.query,
|
|
326
|
+
message: composeSearchMessage(args.query, results, total, searchable),
|
|
327
|
+
results,
|
|
328
|
+
});
|
|
275
329
|
},
|
|
276
330
|
presentCall: (args) => ({ card: 'generic', title: 'Search deferred tools', kind: 'search', rawInput: args.query }),
|
|
277
331
|
presentResult: (_args, result) => ({ card: 'generic', title: 'Tool search', content: result.content }),
|
|
278
332
|
});
|
|
279
333
|
}
|
|
280
334
|
}
|
|
335
|
+
/**
|
|
336
|
+
* Compose the full model-facing ToolSearch outcome, branching on pool state so
|
|
337
|
+
* an empty search never reads as "you lack the capability" — the trap this
|
|
338
|
+
* copy exists to defuse is a model concluding it has no filesystem/shell tools
|
|
339
|
+
* when in fact the deferred pool is simply empty (or already fully loaded).
|
|
340
|
+
*/
|
|
341
|
+
function composeSearchMessage(query, results, total, searchable) {
|
|
342
|
+
if (results.length > 0)
|
|
343
|
+
return renderToolSearchText(query, results);
|
|
344
|
+
if (total === 0) {
|
|
345
|
+
return 'No deferred tools are available to you in this session — every tool you can use is already in your function list; call it directly.';
|
|
346
|
+
}
|
|
347
|
+
if (searchable === 0) {
|
|
348
|
+
return 'All deferred tools available to you are already loaded; call them directly.';
|
|
349
|
+
}
|
|
350
|
+
return `No deferred tools matched "${query}". If the capability you need is not deferred, it may already be available — call it directly.`;
|
|
351
|
+
}
|
|
281
352
|
/** Compose the model-facing summary of a ToolSearch outcome. */
|
|
282
353
|
function renderToolSearchText(query, results) {
|
|
283
354
|
if (results.length === 0) {
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAW,OAAO,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAE5E,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAKjD,6CAA6C;AAC7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,YAAY,CAAA;AA2C5C,wDAAwD;AACxD,MAAM,aAAa;IACR,KAAK,GAAG,IAAI,YAAY,CAC/B,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,SAAS,IAAI,mDAAmD,CAAC,CACpF,CAAA;IAED,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAA;IAC7B,CAAC;CACF;AAUD;;;;;;;;GAQG;AACH,SAAS,WAAW,CAAC,MAAsB,EAAE,KAAa;IACxD,MAAM,CAAC,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAA;IACpC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,CAAA;IAC5B,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;IAC3B,MAAM,MAAM,GAAqC;QAC/C,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,EAAE,CAAC;QACnC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAChD,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,WAAW,EAAE,EAAE,CAAC,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,IAAI,KAAK,MAAM,CAAC,WAAW,KAAK,WAAW,IAAI,IAAI,EAAE,CAAA;IAC1E,CAAC,CAAC,CAAA;IACF,OAAO,eAAe,KAAK,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAA;AACtD,CAAC;AAQD,eAAe,oBAAoB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jianxx/dsh-cc-tool-search",
|
|
3
3
|
"description": "Deferred tool registration and a ToolSearch model tool that loads heavy tools on demand",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/jianxx/dsh-cc.git",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@deepseek-ai/dsh-scope": ">=0.1.1-rc.2",
|
|
30
30
|
"@deepseek-ai/dsh-system-prompt": ">=0.1.1-rc.2",
|
|
31
31
|
"@deepseek-ai/cordis": ">=0.1.1-rc.2",
|
|
32
|
-
"@jianxx/dsh-cc-tools": "^0.
|
|
32
|
+
"@jianxx/dsh-cc-tools": "^0.4.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@deepseek-ai/dsh-agent": "link:../../../../deepseek-harness/packages/core/agent",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@deepseek-ai/dsh-session": "link:../../../../deepseek-harness/packages/core/session",
|
|
40
40
|
"@deepseek-ai/dsh-system-prompt": "link:../../../../deepseek-harness/packages/core/system-prompt",
|
|
41
41
|
"@deepseek-ai/cordis": "link:../../../../deepseek-harness/vendor/cordis",
|
|
42
|
-
"@jianxx/dsh-cc-tools": "^0.
|
|
42
|
+
"@jianxx/dsh-cc-tools": "^0.4.0"
|
|
43
43
|
},
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|