@microi.net/cli 5.1.0 → 5.1.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/.codebuddy-plugin/marketplace.json +2 -2
- package/.codebuddy-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.workbuddy-plugin/marketplace.json +2 -2
- package/.workbuddy-plugin/plugin.json +1 -1
- package/assets/build-meta.json +3 -3
- package/cordis.patch.yml +1 -1
- package/package.json +1 -1
- package/scripts/microi-skills.meta.json +178 -178
- package/skills/.microi-skills-version.json +2 -2
- package/skills/v8-tcp-integration/SKILL.md +151 -148
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
"url": "https://microi.net"
|
|
6
6
|
},
|
|
7
7
|
"description": "Microi吾码官方 AI 插件市场",
|
|
8
|
-
"version": "5.1.
|
|
8
|
+
"version": "5.1.1",
|
|
9
9
|
"plugins": [
|
|
10
10
|
{
|
|
11
11
|
"name": "microi",
|
|
12
12
|
"source": ".",
|
|
13
13
|
"description": "Microi吾码 AI 开发插件:服务器连接、Skills、MCP、V8 全量同步与低代码交付",
|
|
14
|
-
"version": "5.1.
|
|
14
|
+
"version": "5.1.1",
|
|
15
15
|
"strict": true
|
|
16
16
|
}
|
|
17
17
|
]
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
"url": "https://microi.net"
|
|
6
6
|
},
|
|
7
7
|
"description": "Microi吾码官方 AI 插件市场",
|
|
8
|
-
"version": "5.1.
|
|
8
|
+
"version": "5.1.1",
|
|
9
9
|
"plugins": [
|
|
10
10
|
{
|
|
11
11
|
"name": "microi",
|
|
12
12
|
"source": ".",
|
|
13
13
|
"description": "Microi吾码 AI 开发插件:服务器连接、Skills、MCP、V8 全量同步与低代码交付",
|
|
14
|
-
"version": "5.1.
|
|
14
|
+
"version": "5.1.1",
|
|
15
15
|
"strict": true
|
|
16
16
|
}
|
|
17
17
|
]
|
package/assets/build-meta.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"builtAt": "2026-08-
|
|
3
|
-
"version": "5.1.
|
|
2
|
+
"builtAt": "2026-08-18T18:48:14.956Z",
|
|
3
|
+
"version": "5.1.1",
|
|
4
4
|
"sourceProducts": [
|
|
5
5
|
"vscode-extension",
|
|
6
6
|
"microi-cli",
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
"cli": "5edab92236a3bea1e10a878584b97bbef20610b4448f655d7c42d2ab832532cb",
|
|
14
14
|
"router": "ffc14787fc2d3d6173b7a779b77139b759eb1d482cea787f71283f4017a4e223",
|
|
15
15
|
"broker": "42a9d89ad7b960a324da949939ef46266aa66e21068e6fbfd040cecc58b7c956",
|
|
16
|
-
"dshBundle": "
|
|
16
|
+
"dshBundle": "e23cca3a809f95cc8297945969f252ab32660b78e8f6740b8f54eab9df39f7bc"
|
|
17
17
|
}
|
|
18
18
|
}
|
package/cordis.patch.yml
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
serverName: microi
|
|
8
8
|
transport: stdio
|
|
9
9
|
command: !!js process.execPath
|
|
10
|
-
args: ["-e","/*\n * DeepSeek Harness 通过 profile bundle 加载此 `node -e` 引导脚本。\n * DSH 不保证 MCP 子进程 cwd 位于 npm 包根,因此按 DSH_HOME/profile 定位\n * 当前版本的 @microi.net/cli,再复用 Codex 同源适配器与多连接路由器。\n */\nconst fs = require('node:fs');\nconst os = require('node:os');\nconst path = require('node:path');\nconst packageName = '@microi.net/cli';\nconst expectedVersion = '5.1.
|
|
10
|
+
args: ["-e","/*\n * DeepSeek Harness 通过 profile bundle 加载此 `node -e` 引导脚本。\n * DSH 不保证 MCP 子进程 cwd 位于 npm 包根,因此按 DSH_HOME/profile 定位\n * 当前版本的 @microi.net/cli,再复用 Codex 同源适配器与多连接路由器。\n */\nconst fs = require('node:fs');\nconst os = require('node:os');\nconst path = require('node:path');\nconst packageName = '@microi.net/cli';\nconst expectedVersion = '5.1.1';\n\nfunction readJson(filePath) {\n try { return JSON.parse(fs.readFileSync(filePath, 'utf8')); }\n catch { return undefined; }\n}\n\nfunction expandHome(value) {\n if (value === '~') return os.homedir();\n if (value.startsWith('~/') || value.startsWith('~\\\\')) return path.join(os.homedir(), value.slice(2));\n return value;\n}\n\nfunction validRoot(value) {\n const root = path.resolve(value);\n const pkg = readJson(path.join(root, 'package.json'));\n const patch = path.join(root, 'cordis.patch.yml');\n const adapter = path.join(root, 'scripts', 'mcp-codex-stdio-adapter.js');\n const router = path.join(root, 'scripts', 'microi-codex-router.js');\n if (pkg?.name !== packageName || pkg?.version !== expectedVersion) return undefined;\n if (pkg?.dsh?.bundle?.patch !== './cordis.patch.yml') return undefined;\n if (![patch, adapter, router].every(filePath => fs.existsSync(filePath))) return undefined;\n return { root: fs.realpathSync(root), adapter, router, modifiedAt: fs.statSync(router).mtimeMs };\n}\n\nfunction findPlugin() {\n const explicit = String(process.env.MICROI_DSH_PLUGIN_ROOT || '').trim();\n if (explicit) {\n const plugin = validRoot(explicit);\n if (!plugin) throw new Error(`MICROI_DSH_PLUGIN_ROOT 不是版本 ${expectedVersion} 的有效 Microi DSH bundle:${explicit}`);\n return plugin;\n }\n const configuredHome = String(process.env.DSH_HOME || '').trim();\n const dshHome = path.resolve(expandHome(configuredHome || path.join(os.homedir(), '.dsh')));\n const profilesRoot = path.join(dshHome, 'profiles');\n const candidates = [];\n if (fs.existsSync(profilesRoot)) {\n for (const entry of fs.readdirSync(profilesRoot, { withFileTypes: true })) {\n if (!entry.isDirectory() || entry.name === 'node_modules') continue;\n const root = path.join(profilesRoot, entry.name, 'node_modules', '@microi.net', 'cli');\n const plugin = validRoot(root);\n if (plugin) candidates.push(plugin);\n }\n }\n candidates.sort((left, right) => right.modifiedAt - left.modifiedAt);\n if (!candidates[0]) throw new Error(`未在 ${profilesRoot} 找到版本 ${expectedVersion} 的 ${packageName}`);\n return candidates[0];\n}\n\ntry {\n const plugin = findPlugin();\n process.env.MICROI_DSH_PLUGIN_ROOT = plugin.root;\n process.env.MICROI_CODEX_PLUGIN_ROOT = plugin.root;\n process.env.MICROI_TOOL_SOURCE = 'dsh';\n process.env.MICROI_TOOL_VERSION = expectedVersion;\n process.env.MICROI_WORKSPACE_ROOT = process.env.MICROI_WORKSPACE_ROOT || process.cwd();\n process.argv[2] = plugin.router;\n require(plugin.adapter);\n} catch (error) {\n console.error(`[microi-dsh-bootstrap] ${error instanceof Error ? error.message : String(error)}`);\n process.exit(1);\n}\n"]
|
|
11
11
|
env:
|
|
12
12
|
MICROI_TOOL_SOURCE: dsh
|
|
13
13
|
cwd: !!js process.cwd()
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
"builtAt": "2026-08-
|
|
2
|
+
"builtAt": "2026-08-18T18:48:13.688Z",
|
|
3
3
|
"source": "../microi.skills",
|
|
4
4
|
"extension": {
|
|
5
5
|
"name": "v8-engine",
|
|
6
|
-
"version": "5.1.
|
|
6
|
+
"version": "5.1.1",
|
|
7
7
|
"publisher": "Microi"
|
|
8
8
|
},
|
|
9
9
|
"skills": {
|
|
10
|
-
"version": "5.1.
|
|
10
|
+
"version": "5.1.1",
|
|
11
11
|
"versionRule": "Microi version uses three numeric parts. Each publish increments the last part; when a part exceeds 9 it carries to the previous part: 1.0.9 -> 1.1.0, 1.9.9 -> 2.0.0.",
|
|
12
12
|
"managedBy": "Microi.VSCode/bump-version.js"
|
|
13
13
|
},
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"dir": "dist/microi.skills",
|
|
16
16
|
"files": 172,
|
|
17
17
|
"skills": 63,
|
|
18
|
-
"bytes":
|
|
18
|
+
"bytes": 2102023
|
|
19
19
|
},
|
|
20
20
|
"fileHashes": {
|
|
21
|
-
".microi-skills-version.json": "
|
|
21
|
+
".microi-skills-version.json": "2cbe12fb55c3edb813467260c7d1249cb4804d15130b942005d79c0b9c617193",
|
|
22
22
|
".progressive-disclosure-manifest.json": "dc5cfc483df88dfd1f9f5bfba62bceddec5bb28ab551d07b6ed9a91ec33c8e51",
|
|
23
23
|
"README.md": "e4c36c39515953ac1953622f19671d2c377a8828aae20f877bdd39ab1dcb0cb1",
|
|
24
24
|
"ai-engine/SKILL.md": "a9d3b152c6d8ca03bfa37669d4e81cf33c7361f3105165e40cb357f1b23b2bfb",
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
"v8-table-event/SKILL.md": "8479380d0583279ee350534b7ed8d6c73ff0fe92ede028f15f80b9f02972f283",
|
|
178
178
|
"v8-table-event/references/progressive-01-informv8-js-表单打开事件.md": "baa4e6670f693d62ab5fc9d5bd692dfd801ed30a530c5224c7c149088712b5d7",
|
|
179
179
|
"v8-table-event/references/progressive-02-前端事件名-v8-eventname-可能的值.md": "e72d4ddf9dd29c7f96cdfc2efbeede33e7a50049b5d8971356a54f596d44e2bd",
|
|
180
|
-
"v8-tcp-integration/SKILL.md": "
|
|
180
|
+
"v8-tcp-integration/SKILL.md": "1150cc84826eb38155ca14af68073ff3421b45e5b7d166e5f6d2617826957edf",
|
|
181
181
|
"v8-tcp-integration/agents/openai.yaml": "0de66958f5fe4f3410c42578a5462daa0d9d282efd4a1f5a1fad1f8541110515",
|
|
182
182
|
"v8-template-engine/SKILL.md": "19363a9e047737b62236f187946ac8398ee6cb19907de70ce0888681b75afb15",
|
|
183
183
|
"v8-utilities/SKILL.md": "8313a3e0e0c5f7a29cb22231b751a52107e3efa3b790e994343e54807fcb7285",
|
|
@@ -192,178 +192,178 @@
|
|
|
192
192
|
"workspace-conventions/references/progressive-03-cli-与-ide-插件错版共存约定.md": "86db1f03700fd54dd824d28c553c678202e8f74b796fd0f9d91f63bf53a530b1"
|
|
193
193
|
},
|
|
194
194
|
"fileVersions": {
|
|
195
|
-
".microi-skills-version.json": "5.1.
|
|
196
|
-
".progressive-disclosure-manifest.json": "5.1.
|
|
197
|
-
"README.md": "5.1.
|
|
198
|
-
"ai-engine/SKILL.md": "5.1.
|
|
199
|
-
"ai-engine/agents/openai.yaml": "5.1.
|
|
200
|
-
"ai-platform-governance/SKILL.md": "5.1.
|
|
201
|
-
"ai-platform-governance/references/progressive-01-功能开关.md": "5.1.
|
|
202
|
-
"app-store/SKILL.md": "5.1.
|
|
203
|
-
"app-store/agents/openai.yaml": "5.1.
|
|
204
|
-
"business-blueprint/SKILL.md": "5.1.
|
|
205
|
-
"datasource-engine/SKILL.md": "5.1.
|
|
206
|
-
"datasource-engine/agents/openai.yaml": "5.1.
|
|
207
|
-
"dos-orm/SKILL.md": "5.1.
|
|
208
|
-
"dos-orm/references/api-reference.md": "5.1.
|
|
209
|
-
"job-engine/SKILL.md": "5.1.
|
|
210
|
-
"job-engine/agents/openai.yaml": "5.1.
|
|
211
|
-
"message-notification/SKILL.md": "5.1.
|
|
212
|
-
"message-notification/agents/openai.yaml": "5.1.
|
|
213
|
-
"message-notification/references/contracts.md": "5.1.
|
|
214
|
-
"microi-ai-app-auth.js": "5.1.
|
|
215
|
-
"microi-ai-application/SKILL.md": "5.1.
|
|
216
|
-
"microi-ai-application/agents/openai.yaml": "5.1.
|
|
217
|
-
"microi-ai-application/references/frontend-baseline.md": "5.1.
|
|
218
|
-
"microi-client-frontend/SKILL.md": "5.1.
|
|
219
|
-
"microi-client-frontend/references/progressive-01-3-动态按钮系统.md": "5.1.
|
|
220
|
-
"microi-client-frontend/references/progressive-02-8-运行时高频坑复盘.md": "5.1.
|
|
221
|
-
"microi-client-frontend/references/progressive-03-vue3-前端微服务宿主规则.md": "5.1.
|
|
222
|
-
"microi-codex-installer/SKILL.md": "5.1.
|
|
223
|
-
"microi-codex-installer/agents/openai.yaml": "5.1.
|
|
224
|
-
"microi-codex/SKILL.md": "5.1.
|
|
225
|
-
"microi-datasource-mapping/SKILL.md": "5.1.
|
|
226
|
-
"microi-db-schema/SKILL.md": "5.1.
|
|
227
|
-
"microi-db-schema/agents/openai.yaml": "5.1.
|
|
228
|
-
"microi-db-schema/references/core-tables.md": "5.1.
|
|
229
|
-
"microi-db-schema/references/form-component-options.md": "5.1.
|
|
230
|
-
"microi-db-schema/references/schema-overview.md": "5.1.
|
|
231
|
-
"microi-db-schema/references/schema.md": "5.1.
|
|
232
|
-
"microi-db-schema/references/table-catalog.md": "5.1.
|
|
233
|
-
"microi-deployment/SKILL.md": "5.1.
|
|
234
|
-
"microi-deployment/references/deployment-matrix.md": "5.1.
|
|
235
|
-
"microi-docs-coverage/SKILL.md": "5.1.
|
|
236
|
-
"microi-docs-coverage/references/capability-map.md": "5.1.
|
|
237
|
-
"microi-docs-coverage/scripts/audit-doc-skill-coverage.mjs": "5.1.
|
|
238
|
-
"microi-form-engine/SKILL.md": "5.1.
|
|
239
|
-
"microi-form-engine/references/component-catalog.md": "5.1.
|
|
240
|
-
"microi-form-engine/references/data-source-events.md": "5.1.
|
|
241
|
-
"microi-form-layout/SKILL.md": "5.1.
|
|
242
|
-
"microi-form-layout/references/progressive-01-3-三种分组的存储与配置.md": "5.1.
|
|
243
|
-
"microi-frontend-sdk/SKILL.md": "5.1.
|
|
244
|
-
"microi-frontend-sdk/references/progressive-01-token-当前登录用户与当前终端登录协议.md": "5.1.
|
|
245
|
-
"microi-left-right-layout/SKILL.md": "5.1.
|
|
246
|
-
"microi-microservice/SKILL.md": "5.1.
|
|
247
|
-
"microi-microservice/references/runtime-delivery.md": "5.1.
|
|
248
|
-
"microi-mobile-app-quality/SKILL.md": "5.1.
|
|
249
|
-
"microi-mobile-app-quality/references/progressive-01-4-重要按钮必须带图标.md": "5.1.
|
|
250
|
-
"microi-mobile-app-quality/references/progressive-02-9-主题切换必须真实且全局生效.md": "5.1.
|
|
251
|
-
"microi-solution-quotation/SKILL.md": "5.1.
|
|
252
|
-
"microi-solution-quotation/agents/openai.yaml": "5.1.
|
|
253
|
-
"microi-solution-quotation/scripts/build_solution_quote.py": "5.1.
|
|
254
|
-
"microi-system-delivery/SKILL.md": "5.1.
|
|
255
|
-
"microi-system-delivery/references/progressive-01-标准工作流.md": "5.1.
|
|
256
|
-
"microi-system-delivery/references/progressive-02-自动化测试必须覆盖的坑.md": "5.1.
|
|
257
|
-
"microi-ui/SKILL.md": "5.1.
|
|
258
|
-
"microi-ui/references/progressive-01-移动端场景蓝图.md": "5.1.
|
|
259
|
-
"microi-uniapp-frontend/SKILL.md": "5.1.
|
|
260
|
-
"microi-uniapp-frontend/references/progressive-01-移动端分类-双栏列表独立滚动.md": "5.1.
|
|
261
|
-
"microi-uniapp-frontend/references/progressive-02-关键业务资产不得默认选中.md": "5.1.
|
|
262
|
-
"microi.v8.js": "5.1.
|
|
263
|
-
"module-engine/SKILL.md": "5.1.
|
|
264
|
-
"module-engine/references/module-config.md": "5.1.
|
|
265
|
-
"ocr-engine/SKILL.md": "5.1.
|
|
266
|
-
"ocr-engine/agents/openai.yaml": "5.1.
|
|
267
|
-
"page-engine/SKILL.md": "5.1.
|
|
268
|
-
"page-engine/references/progressive-01-所有组件类型.md": "5.1.
|
|
269
|
-
"page-engine/references/progressive-02-版本历史-并发保存与回滚.md": "5.1.
|
|
270
|
-
"performance-testing/SKILL.md": "5.1.
|
|
271
|
-
"playwright-e2e/SKILL.md": "5.1.
|
|
272
|
-
"playwright-e2e/references/progressive-01-全自动登录-免验证码-但不免密码-必读.md": "5.1.
|
|
273
|
-
"playwright-e2e/references/progressive-02-文字对比度与可读性自动化检查-必做.md": "5.1.
|
|
274
|
-
"playwright-e2e/references/progressive-03-microi-helper-模板.md": "5.1.
|
|
275
|
-
"playwright-e2e/references/progressive-04-ci-建议.md": "5.1.
|
|
276
|
-
"print-engine/SKILL.md": "5.1.
|
|
277
|
-
"production-readonly-audit/SKILL.md": "5.1.
|
|
278
|
-
"report-engine/SKILL.md": "5.1.
|
|
279
|
-
"report-engine/agents/openai.yaml": "5.1.
|
|
280
|
-
"scripts/optimize-progressive-disclosure.mjs": "5.1.
|
|
281
|
-
"scripts/refresh-progressive-disclosure.mjs": "5.1.
|
|
282
|
-
"scripts/validate-progressive-disclosure.mjs": "5.1.
|
|
283
|
-
"search-engine/SKILL.md": "5.1.
|
|
284
|
-
"search-engine/agents/openai.yaml": "5.1.
|
|
285
|
-
"spider-engine/SKILL.md": "5.1.
|
|
286
|
-
"translate-engine/SKILL.md": "5.1.
|
|
287
|
-
"translate-engine/agents/openai.yaml": "5.1.
|
|
288
|
-
"ui-design/SKILL.md": "5.1.
|
|
289
|
-
"ui-design/assets/pattern-showcase/app.js": "5.1.
|
|
290
|
-
"ui-design/assets/pattern-showcase/index.html": "5.1.
|
|
291
|
-
"ui-design/assets/pattern-showcase/styles.css": "5.1.
|
|
292
|
-
"ui-design/assets/templates/MCI-DESIGN.md": "5.1.
|
|
293
|
-
"ui-design/references/design-pattern-library.md": "5.1.
|
|
294
|
-
"ui-design/references/mci-design-contract.md": "5.1.
|
|
295
|
-
"ui-design/references/motion-and-media.md": "5.1.
|
|
296
|
-
"ui-design/references/product-flow-recipes.md": "5.1.
|
|
297
|
-
"ui-design/references/progressive-01-颜色体系-css-variables-支持主题切换.md": "5.1.
|
|
298
|
-
"ui-design/references/progressive-02-字体.md": "5.1.
|
|
299
|
-
"ui-design/references/progressive-03-动效规范-丰富但不卡.md": "5.1.
|
|
300
|
-
"ui-design/references/progressive-04-组件风格速查.md": "5.1.
|
|
301
|
-
"ui-design/references/progressive-05-移动端专用规范.md": "5.1.
|
|
302
|
-
"ui-design/references/progressive-06-主题切换实现.md": "5.1.
|
|
303
|
-
"ui-design/references/progressive-07-速查-从头搭建一个移动端页面.md": "5.1.
|
|
304
|
-
"ui-design/references/progressive-08-表单分组规范-tabs-vs-collapsegroup-强制.md": "5.1.
|
|
305
|
-
"uniapp-mall-assets/SKILL.md": "5.1.
|
|
306
|
-
"unity-integration/SKILL.md": "5.1.
|
|
307
|
-
"unity-integration/agents/openai.yaml": "5.1.
|
|
308
|
-
"unity-integration/references/ai-app-delivery.md": "5.1.
|
|
309
|
-
"unity-integration/references/sdk-api.md": "5.1.
|
|
310
|
-
"unity-integration/references/toolbox-migration.md": "5.1.
|
|
311
|
-
"unity-integration/references/webgl-hosting.md": "5.1.
|
|
312
|
-
"v8-api-config/SKILL.md": "5.1.
|
|
313
|
-
"v8-cache-pattern/SKILL.md": "5.1.
|
|
314
|
-
"v8-crud-api/SKILL.md": "5.1.
|
|
315
|
-
"v8-crud-api/references/progressive-01-查询列表-分页.md": "5.1.
|
|
316
|
-
"v8-crud-api/references/progressive-02-where-条件语法速查.md": "5.1.
|
|
317
|
-
"v8-debugging/SKILL.md": "5.1.
|
|
318
|
-
"v8-explorer-tree/SKILL.md": "5.1.
|
|
319
|
-
"v8-export-import/SKILL.md": "5.1.
|
|
320
|
-
"v8-export-import/references/progressive-01-excellayout-高级自由布局.md": "5.1.
|
|
321
|
-
"v8-export-import/references/progressive-02-powerpoint-导出.md": "5.1.
|
|
322
|
-
"v8-export-import/references/progressive-03-安全-性能注意.md": "5.1.
|
|
323
|
-
"v8-file-upload/SKILL.md": "5.1.
|
|
324
|
-
"v8-file-upload/references/progressive-01-公有桶-vs-私有桶.md": "5.1.
|
|
325
|
-
"v8-file-upload/references/progressive-02-office-文件在线编辑版本号规则.md": "5.1.
|
|
326
|
-
"v8-formengine-http/SKILL.md": "5.1.
|
|
327
|
-
"v8-frontend-events/SKILL.md": "5.1.
|
|
328
|
-
"v8-frontend-events/references/bluetooth-print-api.md": "5.1.
|
|
329
|
-
"v8-frontend-events/references/bluetooth-print.md": "5.1.
|
|
330
|
-
"v8-frontend-events/references/progressive-01-列表事件.md": "5.1.
|
|
331
|
-
"v8-http-integration/SKILL.md": "5.1.
|
|
332
|
-
"v8-http-integration/references/progressive-01-get-请求.md": "5.1.
|
|
333
|
-
"v8-http-integration/references/progressive-02-错误处理模式.md": "5.1.
|
|
334
|
-
"v8-image-processing/SKILL.md": "5.1.
|
|
335
|
-
"v8-image-processing/agents/openai.yaml": "5.1.
|
|
336
|
-
"v8-image-processing/references/api-reference.md": "5.1.
|
|
337
|
-
"v8-menu-buttons/SKILL.md": "5.1.
|
|
338
|
-
"v8-menu-buttons/references/progressive-01-2-按钮对象-schema.md": "5.1.
|
|
339
|
-
"v8-menu-buttons/references/progressive-02-8-模式-f-后台任务按钮-长任务.md": "5.1.
|
|
340
|
-
"v8-menu-buttons/references/progressive-03-10-反模式-避免.md": "5.1.
|
|
341
|
-
"v8-mongodb/SKILL.md": "5.1.
|
|
342
|
-
"v8-mq-mqtt/SKILL.md": "5.1.
|
|
343
|
-
"v8-mq-mqtt/references/mqtt-production.md": "5.1.
|
|
344
|
-
"v8-mq-mqtt/references/progressive-01-v8-mqtt-iot-物联网.md": "5.1.
|
|
345
|
-
"v8-mq-mqtt/scripts/check-mqtt-skill-coverage.mjs": "5.1.
|
|
346
|
-
"v8-saas-multi-tenant/SKILL.md": "5.1.
|
|
347
|
-
"v8-security/SKILL.md": "5.1.
|
|
348
|
-
"v8-security/references/progressive-01-2-权限校验.md": "5.1.
|
|
349
|
-
"v8-security/references/progressive-02-7-日志记录.md": "5.1.
|
|
350
|
-
"v8-sql-query/SKILL.md": "5.1.
|
|
351
|
-
"v8-table-event/SKILL.md": "5.1.
|
|
352
|
-
"v8-table-event/references/progressive-01-informv8-js-表单打开事件.md": "5.1.
|
|
353
|
-
"v8-table-event/references/progressive-02-前端事件名-v8-eventname-可能的值.md": "5.1.
|
|
354
|
-
"v8-tcp-integration/SKILL.md": "5.1.
|
|
355
|
-
"v8-tcp-integration/agents/openai.yaml": "5.1.
|
|
356
|
-
"v8-template-engine/SKILL.md": "5.1.
|
|
357
|
-
"v8-utilities/SKILL.md": "5.1.
|
|
358
|
-
"v8-utilities/references/client-api-index.md": "5.1.
|
|
359
|
-
"v8-utilities/references/platform-http-routes.md": "5.1.
|
|
360
|
-
"v8-utilities/references/server-api-index.md": "5.1.
|
|
361
|
-
"v8-workflow/SKILL.md": "5.1.
|
|
362
|
-
"v8-workflow/references/progressive-01-节点开始-v8-事件.md": "5.1.
|
|
363
|
-
"workspace-conventions/SKILL.md": "5.1.
|
|
364
|
-
"workspace-conventions/references/progressive-01-版本更新日志保护规则-强制.md": "5.1.
|
|
365
|
-
"workspace-conventions/references/progressive-02-microi-net-api-本地启动约定.md": "5.1.
|
|
366
|
-
"workspace-conventions/references/progressive-03-cli-与-ide-插件错版共存约定.md": "5.1.
|
|
195
|
+
".microi-skills-version.json": "5.1.1",
|
|
196
|
+
".progressive-disclosure-manifest.json": "5.1.1",
|
|
197
|
+
"README.md": "5.1.1",
|
|
198
|
+
"ai-engine/SKILL.md": "5.1.1",
|
|
199
|
+
"ai-engine/agents/openai.yaml": "5.1.1",
|
|
200
|
+
"ai-platform-governance/SKILL.md": "5.1.1",
|
|
201
|
+
"ai-platform-governance/references/progressive-01-功能开关.md": "5.1.1",
|
|
202
|
+
"app-store/SKILL.md": "5.1.1",
|
|
203
|
+
"app-store/agents/openai.yaml": "5.1.1",
|
|
204
|
+
"business-blueprint/SKILL.md": "5.1.1",
|
|
205
|
+
"datasource-engine/SKILL.md": "5.1.1",
|
|
206
|
+
"datasource-engine/agents/openai.yaml": "5.1.1",
|
|
207
|
+
"dos-orm/SKILL.md": "5.1.1",
|
|
208
|
+
"dos-orm/references/api-reference.md": "5.1.1",
|
|
209
|
+
"job-engine/SKILL.md": "5.1.1",
|
|
210
|
+
"job-engine/agents/openai.yaml": "5.1.1",
|
|
211
|
+
"message-notification/SKILL.md": "5.1.1",
|
|
212
|
+
"message-notification/agents/openai.yaml": "5.1.1",
|
|
213
|
+
"message-notification/references/contracts.md": "5.1.1",
|
|
214
|
+
"microi-ai-app-auth.js": "5.1.1",
|
|
215
|
+
"microi-ai-application/SKILL.md": "5.1.1",
|
|
216
|
+
"microi-ai-application/agents/openai.yaml": "5.1.1",
|
|
217
|
+
"microi-ai-application/references/frontend-baseline.md": "5.1.1",
|
|
218
|
+
"microi-client-frontend/SKILL.md": "5.1.1",
|
|
219
|
+
"microi-client-frontend/references/progressive-01-3-动态按钮系统.md": "5.1.1",
|
|
220
|
+
"microi-client-frontend/references/progressive-02-8-运行时高频坑复盘.md": "5.1.1",
|
|
221
|
+
"microi-client-frontend/references/progressive-03-vue3-前端微服务宿主规则.md": "5.1.1",
|
|
222
|
+
"microi-codex-installer/SKILL.md": "5.1.1",
|
|
223
|
+
"microi-codex-installer/agents/openai.yaml": "5.1.1",
|
|
224
|
+
"microi-codex/SKILL.md": "5.1.1",
|
|
225
|
+
"microi-datasource-mapping/SKILL.md": "5.1.1",
|
|
226
|
+
"microi-db-schema/SKILL.md": "5.1.1",
|
|
227
|
+
"microi-db-schema/agents/openai.yaml": "5.1.1",
|
|
228
|
+
"microi-db-schema/references/core-tables.md": "5.1.1",
|
|
229
|
+
"microi-db-schema/references/form-component-options.md": "5.1.1",
|
|
230
|
+
"microi-db-schema/references/schema-overview.md": "5.1.1",
|
|
231
|
+
"microi-db-schema/references/schema.md": "5.1.1",
|
|
232
|
+
"microi-db-schema/references/table-catalog.md": "5.1.1",
|
|
233
|
+
"microi-deployment/SKILL.md": "5.1.1",
|
|
234
|
+
"microi-deployment/references/deployment-matrix.md": "5.1.1",
|
|
235
|
+
"microi-docs-coverage/SKILL.md": "5.1.1",
|
|
236
|
+
"microi-docs-coverage/references/capability-map.md": "5.1.1",
|
|
237
|
+
"microi-docs-coverage/scripts/audit-doc-skill-coverage.mjs": "5.1.1",
|
|
238
|
+
"microi-form-engine/SKILL.md": "5.1.1",
|
|
239
|
+
"microi-form-engine/references/component-catalog.md": "5.1.1",
|
|
240
|
+
"microi-form-engine/references/data-source-events.md": "5.1.1",
|
|
241
|
+
"microi-form-layout/SKILL.md": "5.1.1",
|
|
242
|
+
"microi-form-layout/references/progressive-01-3-三种分组的存储与配置.md": "5.1.1",
|
|
243
|
+
"microi-frontend-sdk/SKILL.md": "5.1.1",
|
|
244
|
+
"microi-frontend-sdk/references/progressive-01-token-当前登录用户与当前终端登录协议.md": "5.1.1",
|
|
245
|
+
"microi-left-right-layout/SKILL.md": "5.1.1",
|
|
246
|
+
"microi-microservice/SKILL.md": "5.1.1",
|
|
247
|
+
"microi-microservice/references/runtime-delivery.md": "5.1.1",
|
|
248
|
+
"microi-mobile-app-quality/SKILL.md": "5.1.1",
|
|
249
|
+
"microi-mobile-app-quality/references/progressive-01-4-重要按钮必须带图标.md": "5.1.1",
|
|
250
|
+
"microi-mobile-app-quality/references/progressive-02-9-主题切换必须真实且全局生效.md": "5.1.1",
|
|
251
|
+
"microi-solution-quotation/SKILL.md": "5.1.1",
|
|
252
|
+
"microi-solution-quotation/agents/openai.yaml": "5.1.1",
|
|
253
|
+
"microi-solution-quotation/scripts/build_solution_quote.py": "5.1.1",
|
|
254
|
+
"microi-system-delivery/SKILL.md": "5.1.1",
|
|
255
|
+
"microi-system-delivery/references/progressive-01-标准工作流.md": "5.1.1",
|
|
256
|
+
"microi-system-delivery/references/progressive-02-自动化测试必须覆盖的坑.md": "5.1.1",
|
|
257
|
+
"microi-ui/SKILL.md": "5.1.1",
|
|
258
|
+
"microi-ui/references/progressive-01-移动端场景蓝图.md": "5.1.1",
|
|
259
|
+
"microi-uniapp-frontend/SKILL.md": "5.1.1",
|
|
260
|
+
"microi-uniapp-frontend/references/progressive-01-移动端分类-双栏列表独立滚动.md": "5.1.1",
|
|
261
|
+
"microi-uniapp-frontend/references/progressive-02-关键业务资产不得默认选中.md": "5.1.1",
|
|
262
|
+
"microi.v8.js": "5.1.1",
|
|
263
|
+
"module-engine/SKILL.md": "5.1.1",
|
|
264
|
+
"module-engine/references/module-config.md": "5.1.1",
|
|
265
|
+
"ocr-engine/SKILL.md": "5.1.1",
|
|
266
|
+
"ocr-engine/agents/openai.yaml": "5.1.1",
|
|
267
|
+
"page-engine/SKILL.md": "5.1.1",
|
|
268
|
+
"page-engine/references/progressive-01-所有组件类型.md": "5.1.1",
|
|
269
|
+
"page-engine/references/progressive-02-版本历史-并发保存与回滚.md": "5.1.1",
|
|
270
|
+
"performance-testing/SKILL.md": "5.1.1",
|
|
271
|
+
"playwright-e2e/SKILL.md": "5.1.1",
|
|
272
|
+
"playwright-e2e/references/progressive-01-全自动登录-免验证码-但不免密码-必读.md": "5.1.1",
|
|
273
|
+
"playwright-e2e/references/progressive-02-文字对比度与可读性自动化检查-必做.md": "5.1.1",
|
|
274
|
+
"playwright-e2e/references/progressive-03-microi-helper-模板.md": "5.1.1",
|
|
275
|
+
"playwright-e2e/references/progressive-04-ci-建议.md": "5.1.1",
|
|
276
|
+
"print-engine/SKILL.md": "5.1.1",
|
|
277
|
+
"production-readonly-audit/SKILL.md": "5.1.1",
|
|
278
|
+
"report-engine/SKILL.md": "5.1.1",
|
|
279
|
+
"report-engine/agents/openai.yaml": "5.1.1",
|
|
280
|
+
"scripts/optimize-progressive-disclosure.mjs": "5.1.1",
|
|
281
|
+
"scripts/refresh-progressive-disclosure.mjs": "5.1.1",
|
|
282
|
+
"scripts/validate-progressive-disclosure.mjs": "5.1.1",
|
|
283
|
+
"search-engine/SKILL.md": "5.1.1",
|
|
284
|
+
"search-engine/agents/openai.yaml": "5.1.1",
|
|
285
|
+
"spider-engine/SKILL.md": "5.1.1",
|
|
286
|
+
"translate-engine/SKILL.md": "5.1.1",
|
|
287
|
+
"translate-engine/agents/openai.yaml": "5.1.1",
|
|
288
|
+
"ui-design/SKILL.md": "5.1.1",
|
|
289
|
+
"ui-design/assets/pattern-showcase/app.js": "5.1.1",
|
|
290
|
+
"ui-design/assets/pattern-showcase/index.html": "5.1.1",
|
|
291
|
+
"ui-design/assets/pattern-showcase/styles.css": "5.1.1",
|
|
292
|
+
"ui-design/assets/templates/MCI-DESIGN.md": "5.1.1",
|
|
293
|
+
"ui-design/references/design-pattern-library.md": "5.1.1",
|
|
294
|
+
"ui-design/references/mci-design-contract.md": "5.1.1",
|
|
295
|
+
"ui-design/references/motion-and-media.md": "5.1.1",
|
|
296
|
+
"ui-design/references/product-flow-recipes.md": "5.1.1",
|
|
297
|
+
"ui-design/references/progressive-01-颜色体系-css-variables-支持主题切换.md": "5.1.1",
|
|
298
|
+
"ui-design/references/progressive-02-字体.md": "5.1.1",
|
|
299
|
+
"ui-design/references/progressive-03-动效规范-丰富但不卡.md": "5.1.1",
|
|
300
|
+
"ui-design/references/progressive-04-组件风格速查.md": "5.1.1",
|
|
301
|
+
"ui-design/references/progressive-05-移动端专用规范.md": "5.1.1",
|
|
302
|
+
"ui-design/references/progressive-06-主题切换实现.md": "5.1.1",
|
|
303
|
+
"ui-design/references/progressive-07-速查-从头搭建一个移动端页面.md": "5.1.1",
|
|
304
|
+
"ui-design/references/progressive-08-表单分组规范-tabs-vs-collapsegroup-强制.md": "5.1.1",
|
|
305
|
+
"uniapp-mall-assets/SKILL.md": "5.1.1",
|
|
306
|
+
"unity-integration/SKILL.md": "5.1.1",
|
|
307
|
+
"unity-integration/agents/openai.yaml": "5.1.1",
|
|
308
|
+
"unity-integration/references/ai-app-delivery.md": "5.1.1",
|
|
309
|
+
"unity-integration/references/sdk-api.md": "5.1.1",
|
|
310
|
+
"unity-integration/references/toolbox-migration.md": "5.1.1",
|
|
311
|
+
"unity-integration/references/webgl-hosting.md": "5.1.1",
|
|
312
|
+
"v8-api-config/SKILL.md": "5.1.1",
|
|
313
|
+
"v8-cache-pattern/SKILL.md": "5.1.1",
|
|
314
|
+
"v8-crud-api/SKILL.md": "5.1.1",
|
|
315
|
+
"v8-crud-api/references/progressive-01-查询列表-分页.md": "5.1.1",
|
|
316
|
+
"v8-crud-api/references/progressive-02-where-条件语法速查.md": "5.1.1",
|
|
317
|
+
"v8-debugging/SKILL.md": "5.1.1",
|
|
318
|
+
"v8-explorer-tree/SKILL.md": "5.1.1",
|
|
319
|
+
"v8-export-import/SKILL.md": "5.1.1",
|
|
320
|
+
"v8-export-import/references/progressive-01-excellayout-高级自由布局.md": "5.1.1",
|
|
321
|
+
"v8-export-import/references/progressive-02-powerpoint-导出.md": "5.1.1",
|
|
322
|
+
"v8-export-import/references/progressive-03-安全-性能注意.md": "5.1.1",
|
|
323
|
+
"v8-file-upload/SKILL.md": "5.1.1",
|
|
324
|
+
"v8-file-upload/references/progressive-01-公有桶-vs-私有桶.md": "5.1.1",
|
|
325
|
+
"v8-file-upload/references/progressive-02-office-文件在线编辑版本号规则.md": "5.1.1",
|
|
326
|
+
"v8-formengine-http/SKILL.md": "5.1.1",
|
|
327
|
+
"v8-frontend-events/SKILL.md": "5.1.1",
|
|
328
|
+
"v8-frontend-events/references/bluetooth-print-api.md": "5.1.1",
|
|
329
|
+
"v8-frontend-events/references/bluetooth-print.md": "5.1.1",
|
|
330
|
+
"v8-frontend-events/references/progressive-01-列表事件.md": "5.1.1",
|
|
331
|
+
"v8-http-integration/SKILL.md": "5.1.1",
|
|
332
|
+
"v8-http-integration/references/progressive-01-get-请求.md": "5.1.1",
|
|
333
|
+
"v8-http-integration/references/progressive-02-错误处理模式.md": "5.1.1",
|
|
334
|
+
"v8-image-processing/SKILL.md": "5.1.1",
|
|
335
|
+
"v8-image-processing/agents/openai.yaml": "5.1.1",
|
|
336
|
+
"v8-image-processing/references/api-reference.md": "5.1.1",
|
|
337
|
+
"v8-menu-buttons/SKILL.md": "5.1.1",
|
|
338
|
+
"v8-menu-buttons/references/progressive-01-2-按钮对象-schema.md": "5.1.1",
|
|
339
|
+
"v8-menu-buttons/references/progressive-02-8-模式-f-后台任务按钮-长任务.md": "5.1.1",
|
|
340
|
+
"v8-menu-buttons/references/progressive-03-10-反模式-避免.md": "5.1.1",
|
|
341
|
+
"v8-mongodb/SKILL.md": "5.1.1",
|
|
342
|
+
"v8-mq-mqtt/SKILL.md": "5.1.1",
|
|
343
|
+
"v8-mq-mqtt/references/mqtt-production.md": "5.1.1",
|
|
344
|
+
"v8-mq-mqtt/references/progressive-01-v8-mqtt-iot-物联网.md": "5.1.1",
|
|
345
|
+
"v8-mq-mqtt/scripts/check-mqtt-skill-coverage.mjs": "5.1.1",
|
|
346
|
+
"v8-saas-multi-tenant/SKILL.md": "5.1.1",
|
|
347
|
+
"v8-security/SKILL.md": "5.1.1",
|
|
348
|
+
"v8-security/references/progressive-01-2-权限校验.md": "5.1.1",
|
|
349
|
+
"v8-security/references/progressive-02-7-日志记录.md": "5.1.1",
|
|
350
|
+
"v8-sql-query/SKILL.md": "5.1.1",
|
|
351
|
+
"v8-table-event/SKILL.md": "5.1.1",
|
|
352
|
+
"v8-table-event/references/progressive-01-informv8-js-表单打开事件.md": "5.1.1",
|
|
353
|
+
"v8-table-event/references/progressive-02-前端事件名-v8-eventname-可能的值.md": "5.1.1",
|
|
354
|
+
"v8-tcp-integration/SKILL.md": "5.1.1",
|
|
355
|
+
"v8-tcp-integration/agents/openai.yaml": "5.1.1",
|
|
356
|
+
"v8-template-engine/SKILL.md": "5.1.1",
|
|
357
|
+
"v8-utilities/SKILL.md": "5.1.1",
|
|
358
|
+
"v8-utilities/references/client-api-index.md": "5.1.1",
|
|
359
|
+
"v8-utilities/references/platform-http-routes.md": "5.1.1",
|
|
360
|
+
"v8-utilities/references/server-api-index.md": "5.1.1",
|
|
361
|
+
"v8-workflow/SKILL.md": "5.1.1",
|
|
362
|
+
"v8-workflow/references/progressive-01-节点开始-v8-事件.md": "5.1.1",
|
|
363
|
+
"workspace-conventions/SKILL.md": "5.1.1",
|
|
364
|
+
"workspace-conventions/references/progressive-01-版本更新日志保护规则-强制.md": "5.1.1",
|
|
365
|
+
"workspace-conventions/references/progressive-02-microi-net-api-本地启动约定.md": "5.1.1",
|
|
366
|
+
"workspace-conventions/references/progressive-03-cli-与-ide-插件错版共存约定.md": "5.1.1"
|
|
367
367
|
},
|
|
368
368
|
"files": [
|
|
369
369
|
".microi-skills-version.json",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "5.1.
|
|
2
|
+
"version": "5.1.1",
|
|
3
3
|
"versionRule": "Microi version uses three numeric parts. Each publish increments the last part; when a part exceeds 9 it carries to the previous part: 1.0.9 -> 1.1.0, 1.9.9 -> 2.0.0.",
|
|
4
4
|
"managedBy": "Microi.VSCode/bump-version.js",
|
|
5
|
-
"updatedAt": "2026-08-
|
|
5
|
+
"updatedAt": "2026-08-18T18:44:26.205Z"
|
|
6
6
|
}
|
|
@@ -1,148 +1,151 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: v8-tcp-integration
|
|
3
|
-
description: Microi 后端 V8 TCP 原始字节集成规范。用于通过 V8.Tcp.Send/SendAsync/SendAndReceive/SendAndReceiveAsync 连接网络小票机、串口服务器、PLC 或其它 TCP 设备,处理 Byte/Base64/Hex/Text 载荷、GBK/GB18030、超时、响应、幂等与出站安全。
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
> **Codex 非阻塞自动更新:** 当前宿主为 Codex 时,吾码 CLI、Codex 插件与工作区 AI/MCP 由后台自动更新;需要诊断时读取 `../microi-codex-installer/SKILL.md`。更新失败、等待空闲或尚未重载均不得阻断当前、正在进行或新建任务。非 Codex 宿主跳过此项。
|
|
7
|
-
|
|
8
|
-
# Microi V8 TCP 原始字节集成
|
|
9
|
-
|
|
10
|
-
使用后端 `V8.Tcp` 完成一次性 TCP 连接、原始字节写入和可选的有界响应读取。典型场景是 RAW/JetDirect 9100 网络小票机、串口服务器和 PLC;具体协议帧、校验码与打印业务仍由接口引擎编排。
|
|
11
|
-
|
|
12
|
-
文档维护时,只在 `microi.doc/docs/doc/v8-engine/v8-server.md` 原位更新后端 API;不要新建重复页面,也不要手工维护英文文档。改变公共契约时同步后端源码/测试、Microi.Client Monaco 定义、Microi.VSCode 类型与生成知识、AI Skill 镜像。
|
|
13
|
-
|
|
14
|
-
## 先判断是否适用
|
|
15
|
-
|
|
16
|
-
| 需求 | 选择 |
|
|
17
|
-
|---|---|
|
|
18
|
-
| 后端向设备 TCP 端口发送原始字节 | `V8.Tcp` |
|
|
19
|
-
| HTTP/HTTPS API | `V8.Http`,不要用 TCP 重写 HTTP |
|
|
20
|
-
| RabbitMQ/MQTT | `V8.MQ` 或 MQTT 引擎 |
|
|
21
|
-
| 浏览器/5+App 蓝牙或 SPP 打印 | 前端 `V8.Print`,读取 `v8-frontend-events/references/bluetooth-print.md` |
|
|
22
|
-
| 长连接、TCP 服务端监听、TLS、自定义连接池 | 当前 `V8.Tcp` 不提供;设计独立网关/Worker |
|
|
23
|
-
|
|
24
|
-
平台已经提供可复用原子能力后,打印模板、设备选择、订单状态、幂等和审计优先写在接口引擎/表单事件;不要为单个打印业务再写 C# Controller。
|
|
25
|
-
|
|
26
|
-
## API 契约
|
|
27
|
-
|
|
28
|
-
| 方法 | 行为 |
|
|
29
|
-
|---|---|
|
|
30
|
-
| `V8.Tcp.Send({...})` | 连接、发送、关闭,返回 `DosResult` |
|
|
31
|
-
| `await V8.Tcp.SendAsync({...})` | 当前请求内异步发送 |
|
|
32
|
-
| `V8.Tcp.SendAndReceive({...})` | 发送后读取响应,再关闭 |
|
|
33
|
-
| `await V8.Tcp.SendAndReceiveAsync({...})` | 当前请求内异步发送并读取响应 |
|
|
34
|
-
|
|
35
|
-
必填目标参数:
|
|
36
|
-
|
|
37
|
-
- `Host`:主机名或 IP;只允许主机,不传 `tcp://` URL。
|
|
38
|
-
- `Port`:1-65535。
|
|
39
|
-
|
|
40
|
-
发送内容必须且只能选择一组:
|
|
41
|
-
|
|
42
|
-
- `Bytes`(别名 `RawBytes`、`ByteArray`):每项为 0-255 的整数。
|
|
43
|
-
- `ByteBase64`(别名 `BytesBase64`、`Base64`)。
|
|
44
|
-
- `Hex`:允许空格、`0x`、`-`、`:`、逗号和下划线分隔。
|
|
45
|
-
- `Text`:按 `Encoding` 编码。默认 `utf-8`,还支持 `ascii`、`gb18030`、`gbk/gb2312`、UTF-16/UTF-32 大小端。
|
|
46
|
-
|
|
47
|
-
边界参数:
|
|
48
|
-
|
|
49
|
-
| 参数 | 默认 | 范围 |
|
|
50
|
-
|---|---:|---:|
|
|
51
|
-
| `ConnectTimeout` | 10 秒 | 1-120 秒 |
|
|
52
|
-
| `SendTimeout` | 10 秒 | 1-120 秒 |
|
|
53
|
-
| `ReceiveTimeout` | 3 秒 | 1-120 秒 |
|
|
54
|
-
| `MaxReceiveBytes` | 65536 | 1-1048576 |
|
|
55
|
-
| `NoDelay` | `true` | 布尔值 |
|
|
56
|
-
|
|
57
|
-
单次发送最多 4 MiB。`Send` 成功数据为 `{BytesSent, RemoteEndPoint}`。收发方法另有 `BytesReceived`、`RawBytes`、`ByteBase64`、`Hex`、`ReceiveEndReason`、`Truncated`;`ReceiveEndReason` 为 `RemoteClosed`、`Timeout` 或 `MaxReceiveBytes`。
|
|
58
|
-
|
|
59
|
-
## 实现流程
|
|
60
|
-
|
|
61
|
-
### 1. 固定并授权设备目标
|
|
62
|
-
|
|
63
|
-
从 SaaS 可信配置或受行权限保护的设备表读取 `Host`、`Port`,按当前用户/门店/租户决定可用设备,再与精确白名单比较。禁止这样写:
|
|
64
|
-
|
|
65
|
-
```javascript
|
|
66
|
-
// 错误:匿名或普通调用者可扫描后端可达内网。
|
|
67
|
-
return V8.Tcp.Send({
|
|
68
|
-
Host: V8.Param.Host,
|
|
69
|
-
Port: V8.Param.Port,
|
|
70
|
-
Hex: V8.Param.Hex
|
|
71
|
-
});
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### 2. 形成一个完整帧
|
|
75
|
-
|
|
76
|
-
ESC/POS、Modbus TCP 或设备私有协议的命令、正文和校验码应先合成一个完整字节载荷。不要为了拼帧而打开多次连接;包含中文和控制命令时,优先在可信后端/上游把完整帧编码为 `Bytes`、`ByteBase64` 或 `Hex`。
|
|
77
|
-
|
|
78
|
-
```javascript
|
|
79
|
-
var result = V8.Tcp.Send({
|
|
80
|
-
Host: '192.168.1.88', // 示例;生产从可信配置读取
|
|
81
|
-
Port: 9100,
|
|
82
|
-
Bytes: [
|
|
83
|
-
27, 64, // ESC @ 初始化
|
|
84
|
-
77, 105, 99, 114, 111, 105, 10,
|
|
85
|
-
10, 10,
|
|
86
|
-
29, 86, 0 // GS V 0 切纸
|
|
87
|
-
],
|
|
88
|
-
ConnectTimeout: 5,
|
|
89
|
-
SendTimeout: 5
|
|
90
|
-
});
|
|
91
|
-
if (result.Code !== 1) return result;
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
只有纯文本时可使用打印机常见编码:
|
|
95
|
-
|
|
96
|
-
```javascript
|
|
97
|
-
var result = await V8.Tcp.SendAsync({
|
|
98
|
-
Host: '192.168.1.88',
|
|
99
|
-
Port: 9100,
|
|
100
|
-
Text: '吾码小票\n合计:12.00\n\n',
|
|
101
|
-
Encoding: 'gb18030'
|
|
102
|
-
});
|
|
103
|
-
if (result.Code !== 1) return result;
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### 3. 需要协议响应时显式收取
|
|
107
|
-
|
|
108
|
-
```javascript
|
|
109
|
-
var result = V8.Tcp.SendAndReceive({
|
|
110
|
-
Host: '192.168.1.20',
|
|
111
|
-
Port: 4001,
|
|
112
|
-
Hex: '01 03 00 00 00 02 C4 0B',
|
|
113
|
-
ReceiveTimeout: 3,
|
|
114
|
-
MaxReceiveBytes: 4096
|
|
115
|
-
});
|
|
116
|
-
if (result.Code !== 1) return result;
|
|
117
|
-
|
|
118
|
-
var bytes = result.Data.RawBytes;
|
|
119
|
-
var hex = result.Data.Hex;
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
接收超时是整段接收的总时间。已收到部分数据后超时会返回成功和已有数据,并标记 `ReceiveEndReason='Timeout'`;未收到任何字节则失败。协议必须知道响应长度或结束条件,不能把超时默认当作完整帧。
|
|
123
|
-
|
|
124
|
-
### 4. 分开判断写入、设备执行和实物结果
|
|
125
|
-
|
|
126
|
-
- `Code=1` 只表示字节已写入 TCP 连接。
|
|
127
|
-
- 设备协议回执可证明设备接受/处理到哪一步,但仍不一定证明机械动作完成。
|
|
128
|
-
- “小票已打印”需要打印机状态、设备回执或实物/硬件验收证据。
|
|
129
|
-
|
|
130
|
-
打印不是天然幂等。不确定失败时自动重试可能重复出纸;需要可靠打印时使用业务打印单号、设备回执、状态机以及 Job/MQ/outbox,且重试策略必须识别“尚未发送”和“结果未知”。
|
|
131
|
-
|
|
132
|
-
## 安全与运行约束
|
|
133
|
-
|
|
134
|
-
1. TCP 不经过 `V8.Http` 的 SSRF 防护。容器网络策略/防火墙只放行目标设备网段和端口;匿名接口不得暴露任意目标。
|
|
135
|
-
2. 不把票据正文、设备口令、原始帧和响应秘密写入日志;日志只记录脱敏设备标识、业务单号、字节数、耗时和错误分类。
|
|
136
|
-
3. `SendAsync` 只是在当前请求内等待 I/O,不能替代后台任务。不要遗留未等待 Promise、`setTimeout` 或 `Task.Run`。
|
|
137
|
-
4. 每次调用都会创建并关闭连接;不能假设设备会保持会话状态。
|
|
138
|
-
5. Docker 内的 `localhost` 指容器自身。验收前从实际后端容器验证到设备 IP/端口的路由和出站策略。
|
|
139
|
-
6. 载荷、超时和响应均有硬上限;不要通过拆成无限循环规避限制。
|
|
140
|
-
|
|
141
|
-
## 修改公共能力时的同步门禁
|
|
142
|
-
|
|
143
|
-
- 源码:`Microi.Server/Microi.V8Engine/Extend/Tcp/V8Tcp.cs` 与 `V8Extend.cs`。
|
|
144
|
-
- 测试:真实 Jint 注入、Byte/Base64/Hex/Text、回环收发、超时/上限/非法参数。
|
|
145
|
-
- 编辑器:`Microi.Client/.../v8-api-server-definitions.js` 与 `Microi.VSCode/src/editor/typingsManager.ts`。
|
|
146
|
-
- 文档与知识:官网中文后端 V8 页面、`microi.skills/README.md`、`v8-utilities` 索引、`Microi.AI/Resource` 镜像和向量资源列表。
|
|
147
|
-
- 验收:目标测试、后端构建、精确重启与健康检查、独立 TCP 回环;真实打印机出纸必须单独报告,不能用回环测试替代。
|
|
148
|
-
|
|
1
|
+
---
|
|
2
|
+
name: v8-tcp-integration
|
|
3
|
+
description: Microi 后端 V8 TCP 原始字节集成规范。用于通过 V8.Tcp.Send/SendAsync/SendAndReceive/SendAndReceiveAsync 连接网络小票机、串口服务器、PLC 或其它 TCP 设备,处理 Byte/Base64/Hex/Text 载荷、GBK/GB18030、超时、响应、幂等与出站安全。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
> **Codex 非阻塞自动更新:** 当前宿主为 Codex 时,吾码 CLI、Codex 插件与工作区 AI/MCP 由后台自动更新;需要诊断时读取 `../microi-codex-installer/SKILL.md`。更新失败、等待空闲或尚未重载均不得阻断当前、正在进行或新建任务。非 Codex 宿主跳过此项。
|
|
7
|
+
|
|
8
|
+
# Microi V8 TCP 原始字节集成
|
|
9
|
+
|
|
10
|
+
使用后端 `V8.Tcp` 完成一次性 TCP 连接、原始字节写入和可选的有界响应读取。典型场景是 RAW/JetDirect 9100 网络小票机、串口服务器和 PLC;具体协议帧、校验码与打印业务仍由接口引擎编排。
|
|
11
|
+
|
|
12
|
+
文档维护时,只在 `microi.doc/docs/doc/v8-engine/v8-server.md` 原位更新后端 API;不要新建重复页面,也不要手工维护英文文档。改变公共契约时同步后端源码/测试、Microi.Client Monaco 定义、Microi.VSCode 类型与生成知识、AI Skill 镜像。
|
|
13
|
+
|
|
14
|
+
## 先判断是否适用
|
|
15
|
+
|
|
16
|
+
| 需求 | 选择 |
|
|
17
|
+
|---|---|
|
|
18
|
+
| 后端向设备 TCP 端口发送原始字节 | `V8.Tcp` |
|
|
19
|
+
| HTTP/HTTPS API | `V8.Http`,不要用 TCP 重写 HTTP |
|
|
20
|
+
| RabbitMQ/MQTT | `V8.MQ` 或 MQTT 引擎 |
|
|
21
|
+
| 浏览器/5+App 蓝牙或 SPP 打印 | 前端 `V8.Print`,读取 `v8-frontend-events/references/bluetooth-print.md` |
|
|
22
|
+
| 长连接、TCP 服务端监听、TLS、自定义连接池 | 当前 `V8.Tcp` 不提供;设计独立网关/Worker |
|
|
23
|
+
|
|
24
|
+
平台已经提供可复用原子能力后,打印模板、设备选择、订单状态、幂等和审计优先写在接口引擎/表单事件;不要为单个打印业务再写 C# Controller。
|
|
25
|
+
|
|
26
|
+
## API 契约
|
|
27
|
+
|
|
28
|
+
| 方法 | 行为 |
|
|
29
|
+
|---|---|
|
|
30
|
+
| `V8.Tcp.Send({...})` | 连接、发送、关闭,返回 `DosResult` |
|
|
31
|
+
| `await V8.Tcp.SendAsync({...})` | 当前请求内异步发送 |
|
|
32
|
+
| `V8.Tcp.SendAndReceive({...})` | 发送后读取响应,再关闭 |
|
|
33
|
+
| `await V8.Tcp.SendAndReceiveAsync({...})` | 当前请求内异步发送并读取响应 |
|
|
34
|
+
|
|
35
|
+
必填目标参数:
|
|
36
|
+
|
|
37
|
+
- `Host`:主机名或 IP;只允许主机,不传 `tcp://` URL。
|
|
38
|
+
- `Port`:1-65535。
|
|
39
|
+
|
|
40
|
+
发送内容必须且只能选择一组:
|
|
41
|
+
|
|
42
|
+
- `Bytes`(别名 `RawBytes`、`ByteArray`):每项为 0-255 的整数。
|
|
43
|
+
- `ByteBase64`(别名 `BytesBase64`、`Base64`)。
|
|
44
|
+
- `Hex`:允许空格、`0x`、`-`、`:`、逗号和下划线分隔。
|
|
45
|
+
- `Text`:按 `Encoding` 编码。默认 `utf-8`,还支持 `ascii`、`gb18030`、`gbk/gb2312`、UTF-16/UTF-32 大小端。
|
|
46
|
+
|
|
47
|
+
边界参数:
|
|
48
|
+
|
|
49
|
+
| 参数 | 默认 | 范围 |
|
|
50
|
+
|---|---:|---:|
|
|
51
|
+
| `ConnectTimeout` | 10 秒 | 1-120 秒 |
|
|
52
|
+
| `SendTimeout` | 10 秒 | 1-120 秒 |
|
|
53
|
+
| `ReceiveTimeout` | 3 秒 | 1-120 秒 |
|
|
54
|
+
| `MaxReceiveBytes` | 65536 | 1-1048576 |
|
|
55
|
+
| `NoDelay` | `true` | 布尔值 |
|
|
56
|
+
|
|
57
|
+
单次发送最多 4 MiB。`Send` 成功数据为 `{BytesSent, RemoteEndPoint}`。收发方法另有 `BytesReceived`、`RawBytes`、`ByteBase64`、`Hex`、`ReceiveEndReason`、`Truncated`;`ReceiveEndReason` 为 `RemoteClosed`、`Timeout` 或 `MaxReceiveBytes`。
|
|
58
|
+
|
|
59
|
+
## 实现流程
|
|
60
|
+
|
|
61
|
+
### 1. 固定并授权设备目标
|
|
62
|
+
|
|
63
|
+
从 SaaS 可信配置或受行权限保护的设备表读取 `Host`、`Port`,按当前用户/门店/租户决定可用设备,再与精确白名单比较。禁止这样写:
|
|
64
|
+
|
|
65
|
+
```javascript
|
|
66
|
+
// 错误:匿名或普通调用者可扫描后端可达内网。
|
|
67
|
+
return V8.Tcp.Send({
|
|
68
|
+
Host: V8.Param.Host,
|
|
69
|
+
Port: V8.Param.Port,
|
|
70
|
+
Hex: V8.Param.Hex
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 2. 形成一个完整帧
|
|
75
|
+
|
|
76
|
+
ESC/POS、Modbus TCP 或设备私有协议的命令、正文和校验码应先合成一个完整字节载荷。不要为了拼帧而打开多次连接;包含中文和控制命令时,优先在可信后端/上游把完整帧编码为 `Bytes`、`ByteBase64` 或 `Hex`。
|
|
77
|
+
|
|
78
|
+
```javascript
|
|
79
|
+
var result = V8.Tcp.Send({
|
|
80
|
+
Host: '192.168.1.88', // 示例;生产从可信配置读取
|
|
81
|
+
Port: 9100,
|
|
82
|
+
Bytes: [
|
|
83
|
+
27, 64, // ESC @ 初始化
|
|
84
|
+
77, 105, 99, 114, 111, 105, 10,
|
|
85
|
+
10, 10,
|
|
86
|
+
29, 86, 0 // GS V 0 切纸
|
|
87
|
+
],
|
|
88
|
+
ConnectTimeout: 5,
|
|
89
|
+
SendTimeout: 5
|
|
90
|
+
});
|
|
91
|
+
if (result.Code !== 1) return result;
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
只有纯文本时可使用打印机常见编码:
|
|
95
|
+
|
|
96
|
+
```javascript
|
|
97
|
+
var result = await V8.Tcp.SendAsync({
|
|
98
|
+
Host: '192.168.1.88',
|
|
99
|
+
Port: 9100,
|
|
100
|
+
Text: '吾码小票\n合计:12.00\n\n',
|
|
101
|
+
Encoding: 'gb18030'
|
|
102
|
+
});
|
|
103
|
+
if (result.Code !== 1) return result;
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### 3. 需要协议响应时显式收取
|
|
107
|
+
|
|
108
|
+
```javascript
|
|
109
|
+
var result = V8.Tcp.SendAndReceive({
|
|
110
|
+
Host: '192.168.1.20',
|
|
111
|
+
Port: 4001,
|
|
112
|
+
Hex: '01 03 00 00 00 02 C4 0B',
|
|
113
|
+
ReceiveTimeout: 3,
|
|
114
|
+
MaxReceiveBytes: 4096
|
|
115
|
+
});
|
|
116
|
+
if (result.Code !== 1) return result;
|
|
117
|
+
|
|
118
|
+
var bytes = result.Data.RawBytes;
|
|
119
|
+
var hex = result.Data.Hex;
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
接收超时是整段接收的总时间。已收到部分数据后超时会返回成功和已有数据,并标记 `ReceiveEndReason='Timeout'`;未收到任何字节则失败。协议必须知道响应长度或结束条件,不能把超时默认当作完整帧。
|
|
123
|
+
|
|
124
|
+
### 4. 分开判断写入、设备执行和实物结果
|
|
125
|
+
|
|
126
|
+
- `Code=1` 只表示字节已写入 TCP 连接。
|
|
127
|
+
- 设备协议回执可证明设备接受/处理到哪一步,但仍不一定证明机械动作完成。
|
|
128
|
+
- “小票已打印”需要打印机状态、设备回执或实物/硬件验收证据。
|
|
129
|
+
|
|
130
|
+
打印不是天然幂等。不确定失败时自动重试可能重复出纸;需要可靠打印时使用业务打印单号、设备回执、状态机以及 Job/MQ/outbox,且重试策略必须识别“尚未发送”和“结果未知”。
|
|
131
|
+
|
|
132
|
+
## 安全与运行约束
|
|
133
|
+
|
|
134
|
+
1. TCP 不经过 `V8.Http` 的 SSRF 防护。容器网络策略/防火墙只放行目标设备网段和端口;匿名接口不得暴露任意目标。
|
|
135
|
+
2. 不把票据正文、设备口令、原始帧和响应秘密写入日志;日志只记录脱敏设备标识、业务单号、字节数、耗时和错误分类。
|
|
136
|
+
3. `SendAsync` 只是在当前请求内等待 I/O,不能替代后台任务。不要遗留未等待 Promise、`setTimeout` 或 `Task.Run`。
|
|
137
|
+
4. 每次调用都会创建并关闭连接;不能假设设备会保持会话状态。
|
|
138
|
+
5. Docker 内的 `localhost` 指容器自身。验收前从实际后端容器验证到设备 IP/端口的路由和出站策略。
|
|
139
|
+
6. 载荷、超时和响应均有硬上限;不要通过拆成无限循环规避限制。
|
|
140
|
+
|
|
141
|
+
## 修改公共能力时的同步门禁
|
|
142
|
+
|
|
143
|
+
- 源码:`Microi.Server/Microi.V8Engine/Extend/Tcp/V8Tcp.cs` 与 `V8Extend.cs`。
|
|
144
|
+
- 测试:真实 Jint 注入、Byte/Base64/Hex/Text、回环收发、超时/上限/非法参数。
|
|
145
|
+
- 编辑器:`Microi.Client/.../v8-api-server-definitions.js` 与 `Microi.VSCode/src/editor/typingsManager.ts`。
|
|
146
|
+
- 文档与知识:官网中文后端 V8 页面、`microi.skills/README.md`、`v8-utilities` 索引、`Microi.AI/Resource` 镜像和向量资源列表。
|
|
147
|
+
- 验收:目标测试、后端构建、精确重启与健康检查、独立 TCP 回环;真实打印机出纸必须单独报告,不能用回环测试替代。
|
|
148
|
+
<<<<<<< HEAD
|
|
149
|
+
|
|
150
|
+
=======
|
|
151
|
+
>>>>>>> 79781472ddad81fb5217c2f25438dec3c9894dba
|