@morlay/dsh-reference 0.0.1-alpha.2 → 0.0.1-alpha.4
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 +2 -2
- package/dist/index.mjs +35 -9
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
`<file_content>` 内容块(窗口与 `read` 一致)、skill 走正文与 `skill` 工具;读不出的引用静默保持普通文本。
|
|
5
5
|
|
|
6
6
|
它不依赖注入通道([`@morlay/dsh-context-assembler`](../dsh-context-assembler/README.md) 的
|
|
7
|
-
`ctx.contextAssembler`):自己挂 `agent/pre-step`、`inject` 只有 `skills
|
|
8
|
-
|
|
7
|
+
`ctx.contextAssembler`):自己挂 `agent/pre-step`、`inject` 只有 `skills`,不依赖通道服务,所以装在哪一层
|
|
8
|
+
装配面上都成立。装配落在 [`@morlay/better-session`](../../bundles/better-session/cordis.patch.yml)(一行
|
|
9
9
|
`@morlay/dsh-reference`)。
|
|
10
10
|
|
|
11
11
|
## 用法
|
package/dist/index.mjs
CHANGED
|
@@ -1272,7 +1272,8 @@ function gfmFootnoteFromMarkdown() {
|
|
|
1272
1272
|
};
|
|
1273
1273
|
}
|
|
1274
1274
|
//#endregion
|
|
1275
|
-
//#region ../../../node_modules/.pnpm/mdast-util-gfm-strikethrough@2.0.
|
|
1275
|
+
//#region ../../../node_modules/.pnpm/mdast-util-gfm-strikethrough@2.0.1_supports-color@9.4.0/node_modules/mdast-util-gfm-strikethrough/lib/index.js
|
|
1276
|
+
handleDelete.attention = attentionDelete;
|
|
1276
1277
|
handleDelete.peek = peekDelete;
|
|
1277
1278
|
/**
|
|
1278
1279
|
* Create an extension for `mdast-util-from-markdown` to enable GFM
|
|
@@ -1289,16 +1290,21 @@ function gfmStrikethroughFromMarkdown() {
|
|
|
1289
1290
|
};
|
|
1290
1291
|
}
|
|
1291
1292
|
/**
|
|
1293
|
+
* Enter strikethrough.
|
|
1294
|
+
*
|
|
1292
1295
|
* @this {CompileContext}
|
|
1293
1296
|
* @type {FromMarkdownHandle}
|
|
1294
1297
|
*/
|
|
1295
1298
|
function enterStrikethrough(token) {
|
|
1296
1299
|
this.enter({
|
|
1297
1300
|
type: "delete",
|
|
1298
|
-
children: []
|
|
1301
|
+
children: [],
|
|
1302
|
+
position: void 0
|
|
1299
1303
|
}, token);
|
|
1300
1304
|
}
|
|
1301
1305
|
/**
|
|
1306
|
+
* Exit strikethrough.
|
|
1307
|
+
*
|
|
1302
1308
|
* @this {CompileContext}
|
|
1303
1309
|
* @type {FromMarkdownHandle}
|
|
1304
1310
|
*/
|
|
@@ -1306,23 +1312,43 @@ function exitStrikethrough(token) {
|
|
|
1306
1312
|
this.exit(token);
|
|
1307
1313
|
}
|
|
1308
1314
|
/**
|
|
1315
|
+
* Serialize a delete node.
|
|
1316
|
+
*
|
|
1309
1317
|
* @type {ToMarkdownHandle}
|
|
1310
1318
|
* @param {Delete} node
|
|
1319
|
+
* Node to serialize.
|
|
1311
1320
|
*/
|
|
1312
1321
|
function handleDelete(node, _, state, info) {
|
|
1313
1322
|
const tracker = state.createTracker(info);
|
|
1323
|
+
const sequence = state.stack.includes("strikethrough") ? "~" : "~~";
|
|
1314
1324
|
const exit = state.enter("strikethrough");
|
|
1315
|
-
let value = tracker.move(
|
|
1325
|
+
let value = tracker.move(sequence);
|
|
1316
1326
|
value += state.containerPhrasing(node, {
|
|
1317
1327
|
...tracker.current(),
|
|
1318
1328
|
before: value,
|
|
1319
1329
|
after: "~"
|
|
1320
1330
|
});
|
|
1321
|
-
value += tracker.move(
|
|
1331
|
+
value += tracker.move(sequence);
|
|
1322
1332
|
exit();
|
|
1323
1333
|
return value;
|
|
1324
1334
|
}
|
|
1325
|
-
/**
|
|
1335
|
+
/**
|
|
1336
|
+
* Serialize a delete node as attention.
|
|
1337
|
+
*
|
|
1338
|
+
* @type {Attention}
|
|
1339
|
+
*/
|
|
1340
|
+
function attentionDelete() {
|
|
1341
|
+
return {
|
|
1342
|
+
construct: "strikethrough",
|
|
1343
|
+
markers: ["~"],
|
|
1344
|
+
sizes: [2, 1]
|
|
1345
|
+
};
|
|
1346
|
+
}
|
|
1347
|
+
/**
|
|
1348
|
+
* Peek the first character of a delete node.
|
|
1349
|
+
*
|
|
1350
|
+
* @type {ToMarkdownHandle}
|
|
1351
|
+
*/
|
|
1326
1352
|
function peekDelete() {
|
|
1327
1353
|
return "~";
|
|
1328
1354
|
}
|
|
@@ -2417,7 +2443,7 @@ function resolveAll(constructs, events, context) {
|
|
|
2417
2443
|
return events;
|
|
2418
2444
|
}
|
|
2419
2445
|
//#endregion
|
|
2420
|
-
//#region ../../../node_modules/.pnpm/micromark-factory-space@2.0
|
|
2446
|
+
//#region ../../../node_modules/.pnpm/micromark-factory-space@2.1.0/node_modules/micromark-factory-space/index.js
|
|
2421
2447
|
/**
|
|
2422
2448
|
* @import {Effects, State, TokenType} from 'micromark-util-types'
|
|
2423
2449
|
*/
|
|
@@ -2447,14 +2473,14 @@ function resolveAll(constructs, events, context) {
|
|
|
2447
2473
|
* @param {State} ok
|
|
2448
2474
|
* State switched to when successful.
|
|
2449
2475
|
* @param {TokenType} type
|
|
2450
|
-
* Type
|
|
2476
|
+
* Type of the whole whitespace.
|
|
2451
2477
|
* @param {number | undefined} [max=Infinity]
|
|
2452
2478
|
* Max (exclusive).
|
|
2453
2479
|
* @returns {State}
|
|
2454
2480
|
* Start state.
|
|
2455
2481
|
*/
|
|
2456
2482
|
function factorySpace(effects, ok, type, max) {
|
|
2457
|
-
const limit = max ? max - 1 :
|
|
2483
|
+
const limit = max ? max - 1 : Infinity;
|
|
2458
2484
|
let size = 0;
|
|
2459
2485
|
return start;
|
|
2460
2486
|
/** @type {State} */
|
|
@@ -2476,7 +2502,7 @@ function factorySpace(effects, ok, type, max) {
|
|
|
2476
2502
|
}
|
|
2477
2503
|
}
|
|
2478
2504
|
//#endregion
|
|
2479
|
-
//#region ../../../node_modules/.pnpm/micromark-core-commonmark@2.0.
|
|
2505
|
+
//#region ../../../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/blank-line.js
|
|
2480
2506
|
/**
|
|
2481
2507
|
* @import {
|
|
2482
2508
|
* Construct,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morlay/dsh-reference",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.4",
|
|
4
4
|
"description": "Reference expansion for dsh: `@path` / `skill:name` in a user message expand into injected content at pre-step. Independent of the injection channel; the reference parser it reuses is inlined into the artifact, so this package ships without a client-side dependency.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"context",
|
|
@@ -30,21 +30,21 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@deepseek-ai/cordis": "4.0.4",
|
|
33
|
-
"@deepseek-ai/dsh-agent": "0.1.7-
|
|
34
|
-
"@deepseek-ai/dsh-fs": "0.1.7-
|
|
35
|
-
"@deepseek-ai/dsh-llm": "0.1.7-
|
|
36
|
-
"@deepseek-ai/dsh-session": "0.1.7-
|
|
37
|
-
"@deepseek-ai/dsh-skill": "0.1.7-
|
|
38
|
-
"@morlay/dsh-client-ui-primitives": "0.0.2-alpha.
|
|
33
|
+
"@deepseek-ai/dsh-agent": "0.1.7-rc.2",
|
|
34
|
+
"@deepseek-ai/dsh-fs": "0.1.7-rc.2",
|
|
35
|
+
"@deepseek-ai/dsh-llm": "0.1.7-rc.2",
|
|
36
|
+
"@deepseek-ai/dsh-session": "0.1.7-rc.2",
|
|
37
|
+
"@deepseek-ai/dsh-skill": "0.1.7-rc.2",
|
|
38
|
+
"@morlay/dsh-client-ui-primitives": "0.0.2-alpha.9",
|
|
39
39
|
"@types/mdast": "^4.0.4"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@deepseek-ai/cordis": "4.0.4",
|
|
43
|
-
"@deepseek-ai/dsh-agent": "0.1.7-
|
|
44
|
-
"@deepseek-ai/dsh-fs": "0.1.7-
|
|
45
|
-
"@deepseek-ai/dsh-llm": "0.1.7-
|
|
46
|
-
"@deepseek-ai/dsh-session": "0.1.7-
|
|
47
|
-
"@deepseek-ai/dsh-skill": "0.1.7-
|
|
42
|
+
"@deepseek-ai/cordis": "^4.0.4",
|
|
43
|
+
"@deepseek-ai/dsh-agent": "^0.1.7-rc.2",
|
|
44
|
+
"@deepseek-ai/dsh-fs": "^0.1.7-rc.2",
|
|
45
|
+
"@deepseek-ai/dsh-llm": "^0.1.7-rc.2",
|
|
46
|
+
"@deepseek-ai/dsh-session": "^0.1.7-rc.2",
|
|
47
|
+
"@deepseek-ai/dsh-skill": "^0.1.7-rc.2"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "pnpm exec tsdown"
|