@godv61/dsh-task-engine 0.23.2 → 0.23.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/.hook-test.mjs +191 -0
- package/.p0-test.mjs +50 -0
- package/docs/CHANGELOG.md +22 -8
- package/lib/client.js +38 -36
- package/lib/client.js.map +2 -2
- package/lib/controller.d.ts +23 -6
- package/lib/controller.js +83 -13
- package/lib/controller.js.map +1 -1
- package/package.json +10 -7
- package/lib/custom-flow.d.ts +0 -212
- package/lib/custom-flow.js +0 -50
- package/lib/custom-flow.js.map +0 -1
package/.hook-test.mjs
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* End-to-end test for the installed commit-msg hook.
|
|
3
|
+
*
|
|
4
|
+
* The P0 suite asserts on the hook SOURCE (that it disables path quoting, reads
|
|
5
|
+
* NUL-separated paths, bundles the frozen snapshot). Those assertions catch a
|
|
6
|
+
* hand-mirror regressing, but they cannot show the gate actually blocks a commit
|
|
7
|
+
* — a hook that refuses everything, or nothing, passes every one of them.
|
|
8
|
+
*
|
|
9
|
+
* This runs the real bundled hook inside a throwaway git repository and asserts
|
|
10
|
+
* both directions: an illegal commit is refused, a legal one proceeds.
|
|
11
|
+
*
|
|
12
|
+
* Run: `node --test .hook-test.mjs`
|
|
13
|
+
* @module dsh-task-engine/.hook-test
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import assert from 'node:assert/strict'
|
|
17
|
+
import { execFileSync } from 'node:child_process'
|
|
18
|
+
import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
|
|
19
|
+
import { tmpdir } from 'node:os'
|
|
20
|
+
import { join, resolve, sep } from 'node:path'
|
|
21
|
+
import { test } from 'node:test'
|
|
22
|
+
|
|
23
|
+
const HOOK = resolve('hooks/commit-msg')
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Git runs a hook by handing it to its own POSIX shell, which resolves
|
|
27
|
+
* `#!/usr/bin/env node` against PATH. On Windows a `node.cmd` shim on PATH is
|
|
28
|
+
* not executable from that shell, so the installed hook is wrapped in a
|
|
29
|
+
* launcher that names the very interpreter running this test. Without it the
|
|
30
|
+
* suite would read as the gate refusing everything, when in truth the hook
|
|
31
|
+
* never started.
|
|
32
|
+
*/
|
|
33
|
+
const NODE = process.execPath.replace(/\\/gu, '/')
|
|
34
|
+
|
|
35
|
+
/** Run a git command in `cwd`, returning stdout (throws on non-zero exit). */
|
|
36
|
+
function git(cwd, args) {
|
|
37
|
+
return execFileSync('git', args, { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] })
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Run `git commit` and report whether the hook allowed it.
|
|
42
|
+
* A refused commit surfaces as a non-zero exit whose stderr carries the gate's
|
|
43
|
+
* own Chinese refusal banner.
|
|
44
|
+
*/
|
|
45
|
+
function tryCommit(cwd, message) {
|
|
46
|
+
try {
|
|
47
|
+
execFileSync('git', ['commit', '-m', message], { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] })
|
|
48
|
+
return { allowed: true, stderr: '' }
|
|
49
|
+
} catch (error) {
|
|
50
|
+
return { allowed: false, stderr: String(error.stderr ?? '') }
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Build a throwaway repository with the real hook installed and one staged file. */
|
|
55
|
+
function repo(name, task) {
|
|
56
|
+
const root = mkdtempSync(join(tmpdir(), `engine-hook-${name}-`))
|
|
57
|
+
git(root, ['init', '-q', '-b', 'main'])
|
|
58
|
+
git(root, ['config', 'user.email', 'test@example.com'])
|
|
59
|
+
git(root, ['config', 'user.name', 'Test'])
|
|
60
|
+
git(root, ['config', 'commit.gpgsign', 'false'])
|
|
61
|
+
mkdirSync(join(root, '.dsh'), { recursive: true })
|
|
62
|
+
mkdirSync(join(root, 'src'), { recursive: true })
|
|
63
|
+
// The gate body stays byte-identical to the shipped hook; only the shebang is
|
|
64
|
+
// replaced, so the test exercises the real gate under a runnable interpreter.
|
|
65
|
+
const gate = readFileSync(HOOK, 'utf8').replace(/^#![^\n]*\n/u, '')
|
|
66
|
+
writeFileSync(join(root, '.git', 'hooks', 'commit-msg'), `#!${NODE}\n${gate}`)
|
|
67
|
+
writeFileSync(join(root, '.git', 'hooks', 'package.json'), '{\n "type": "commonjs"\n}\n')
|
|
68
|
+
writeFileSync(join(root, '.dsh', `task-${task.id}.json`), JSON.stringify(task, null, 2))
|
|
69
|
+
writeFileSync(join(root, 'src', 'app.js'), 'console.log(1)\n')
|
|
70
|
+
git(root, ['add', 'src/app.js'])
|
|
71
|
+
return root
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* A standard-flow task that has reached the commit checkpoint with a declared
|
|
76
|
+
* scope. `代码审核` is the checkpoint stage, and the engine only permits a
|
|
77
|
+
* commit there once that stage's OUTGOING guards already hold — so the fixture
|
|
78
|
+
* must also satisfy the review artifact and the review verdict.
|
|
79
|
+
*/
|
|
80
|
+
function approvedTask(overrides = {}) {
|
|
81
|
+
return {
|
|
82
|
+
schema: 1,
|
|
83
|
+
id: 'HOOK-1',
|
|
84
|
+
title: 'hook probe',
|
|
85
|
+
branch: 'main',
|
|
86
|
+
work_size: 'standard',
|
|
87
|
+
risk_level: 'standard',
|
|
88
|
+
stage: '代码审核',
|
|
89
|
+
requirement_confirmed: true,
|
|
90
|
+
solution_confirmed: true,
|
|
91
|
+
items: [{ id: 'i1', title: 'do the thing', status: 'done', review: { spec: { outcome: 'pass' }, quality: { outcome: 'pass' } } }],
|
|
92
|
+
verification: { passed: true, evidence: [] },
|
|
93
|
+
review: { outcome: 'pass' },
|
|
94
|
+
// The `代码审核 -> 完成` edge requires `review_passed` and `artifacts_present`.
|
|
95
|
+
artifacts: { review: { conclusion: 'looks good', issues: 'none' } },
|
|
96
|
+
files: ['src/app.js'],
|
|
97
|
+
commits: [],
|
|
98
|
+
flow: { flow: 'standard', version: 2, config: null },
|
|
99
|
+
...overrides,
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** Resolve the standard preset's config the same way the hook does. */
|
|
104
|
+
async function standardConfig() {
|
|
105
|
+
const { resolveFlow } = await import('./lib/workflows.js')
|
|
106
|
+
const resolved = resolveFlow('standard')
|
|
107
|
+
assert.equal(resolved.ok, true, 'the built-in standard preset resolves')
|
|
108
|
+
return resolved.config
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
test('a task at its checkpoint with the right message commits', async () => {
|
|
112
|
+
const config = await standardConfig()
|
|
113
|
+
const root = repo('allow', approvedTask({ flow: { flow: 'standard', version: 2, config } }))
|
|
114
|
+
try {
|
|
115
|
+
const result = tryCommit(root, '【HOOK-1】【TASK】probe the hook')
|
|
116
|
+
assert.equal(result.allowed, true, `expected the commit to proceed, stderr: ${result.stderr}`)
|
|
117
|
+
} finally {
|
|
118
|
+
assert.ok(resolve(root).startsWith(resolve(tmpdir()) + sep))
|
|
119
|
+
rmSync(root, { recursive: true, force: true })
|
|
120
|
+
}
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
test('a message that violates the configured pattern is refused', async () => {
|
|
124
|
+
const config = await standardConfig()
|
|
125
|
+
const root = repo('badmsg', approvedTask({ flow: { flow: 'standard', version: 2, config } }))
|
|
126
|
+
try {
|
|
127
|
+
const result = tryCommit(root, 'no task id here')
|
|
128
|
+
assert.equal(result.allowed, false, 'a malformed summary must be refused')
|
|
129
|
+
assert.match(result.stderr, /提交门禁拒绝/, 'the gate states its own refusal reason')
|
|
130
|
+
} finally {
|
|
131
|
+
rmSync(root, { recursive: true, force: true })
|
|
132
|
+
}
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
test('a commit touching files outside the declared scope is refused', async () => {
|
|
136
|
+
const config = await standardConfig()
|
|
137
|
+
const root = repo('scope', approvedTask({ flow: { flow: 'standard', version: 2, config } }))
|
|
138
|
+
try {
|
|
139
|
+
writeFileSync(join(root, 'src', 'other.js'), 'console.log(2)\n')
|
|
140
|
+
git(root, ['add', 'src/other.js'])
|
|
141
|
+
const result = tryCommit(root, '【HOOK-1】【TASK】probe the hook')
|
|
142
|
+
assert.equal(result.allowed, false, 'an out-of-scope path must be refused')
|
|
143
|
+
assert.match(result.stderr, /任务范围之外/, 'the refusal names the scope violation')
|
|
144
|
+
} finally {
|
|
145
|
+
rmSync(root, { recursive: true, force: true })
|
|
146
|
+
}
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
test('a commit before the checkpoint stage is refused', async () => {
|
|
150
|
+
const config = await standardConfig()
|
|
151
|
+
const root = repo('stage', approvedTask({ stage: '开发', flow: { flow: 'standard', version: 2, config } }))
|
|
152
|
+
try {
|
|
153
|
+
const result = tryCommit(root, '【HOOK-1】【TASK】probe the hook')
|
|
154
|
+
assert.equal(result.allowed, false, 'committing before the checkpoint must be refused')
|
|
155
|
+
assert.match(result.stderr, /提交门禁拒绝/, 'the gate states its refusal reason')
|
|
156
|
+
} finally {
|
|
157
|
+
rmSync(root, { recursive: true, force: true })
|
|
158
|
+
}
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
test('a task whose frozen snapshot was edited is refused', async () => {
|
|
162
|
+
const config = await standardConfig()
|
|
163
|
+
const tampered = { ...config, start_stage: '开发' }
|
|
164
|
+
const root = repo('tamper', approvedTask({
|
|
165
|
+
flow: { flow: 'standard', version: 2, config: tampered, hash: 'not-the-real-hash' },
|
|
166
|
+
}))
|
|
167
|
+
try {
|
|
168
|
+
const result = tryCommit(root, '【HOOK-1】【TASK】probe the hook')
|
|
169
|
+
assert.equal(result.allowed, false, 'a snapshot hash mismatch must be refused')
|
|
170
|
+
assert.match(result.stderr, /hash 不匹配/, 'the refusal names the integrity failure')
|
|
171
|
+
} finally {
|
|
172
|
+
rmSync(root, { recursive: true, force: true })
|
|
173
|
+
}
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
test('touching a sensitive path without a high-risk receipt is refused', async () => {
|
|
177
|
+
const config = await standardConfig()
|
|
178
|
+
const root = repo('sensitive', approvedTask({
|
|
179
|
+
files: ['src/app.js', '.env'],
|
|
180
|
+
flow: { flow: 'standard', version: 2, config },
|
|
181
|
+
}))
|
|
182
|
+
try {
|
|
183
|
+
writeFileSync(join(root, '.env'), 'SECRET=1\n')
|
|
184
|
+
git(root, ['add', '.env'])
|
|
185
|
+
const result = tryCommit(root, '【HOOK-1】【TASK】probe the hook')
|
|
186
|
+
assert.equal(result.allowed, false, 'a sensitive path without a high-risk receipt must be refused')
|
|
187
|
+
assert.match(result.stderr, /敏感路径/, 'the refusal names the sensitive path')
|
|
188
|
+
} finally {
|
|
189
|
+
rmSync(root, { recursive: true, force: true })
|
|
190
|
+
}
|
|
191
|
+
})
|
package/.p0-test.mjs
CHANGED
|
@@ -736,4 +736,54 @@ function memProbe(files) {
|
|
|
736
736
|
assert(JSON.parse(fs._files.get('.dsh/task-CAS-RACE.json')).title === 'concurrent writer', 'CAS preserves the concurrent writer record')
|
|
737
737
|
}
|
|
738
738
|
|
|
739
|
+
// ── 36. 0.23.3: the path guard normalizes BEFORE the forbidden-prefix test ──
|
|
740
|
+
// Testing the raw string let `D:/proj/../../Windows` through: it matches no
|
|
741
|
+
// forbidden prefix as written, yet every later join() resolves it to C:/Windows.
|
|
742
|
+
// NOTE: block 35 above already activated the module-level registry and strict
|
|
743
|
+
// mode, so every path asserted VALID here must be registered first.
|
|
744
|
+
{
|
|
745
|
+
const ctl = await import('./lib/controller.js')
|
|
746
|
+
const valid = ['D:/work/my project', 'D:/mydir/users-guide', 'D:/proj/one/']
|
|
747
|
+
for (const good of valid) ctl.registerWorkspace(good)
|
|
748
|
+
// Must still accept ordinary workspaces, including names that merely look risky.
|
|
749
|
+
for (const good of valid) {
|
|
750
|
+
try {
|
|
751
|
+
ctl.checkedPath(good)
|
|
752
|
+
} catch (error) {
|
|
753
|
+
throw new Error(`checkedPath wrongly rejected a valid workspace "${good}": ${error.message}`)
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
assert(ctl.checkedPath('D:/proj/one/') === 'D:/proj/one', 'trailing slash is still normalized away')
|
|
757
|
+
assert(ctl.checkedPath('D:/work/my project') === 'D:/work/my project', 'a space in a workspace name is preserved')
|
|
758
|
+
// Traversal must not smuggle a system directory past the guard.
|
|
759
|
+
await assertThrows(() => ctl.checkedPath('D:/proj/../../Windows'), 'not an allowed workspace', 'traversal into a system dir is rejected after normalization')
|
|
760
|
+
await assertThrows(() => ctl.checkedPath('C:/Users/x/../../Windows'), 'not an allowed workspace', 'traversal out of C:/Users into Windows is rejected')
|
|
761
|
+
await assertThrows(() => ctl.checkedPath('D:/proj/../../../Users'), 'not an allowed workspace', 'traversal into a user tree is rejected')
|
|
762
|
+
// The system list is drive-agnostic: matching only c:/windows left D:/Windows open.
|
|
763
|
+
await assertThrows(() => ctl.checkedPath('D:/Windows'), 'not an allowed workspace', 'a system dir on a non-C drive is rejected')
|
|
764
|
+
await assertThrows(() => ctl.checkedPath('E:/Program Files/x'), 'not an allowed workspace', 'Program Files on any drive is rejected')
|
|
765
|
+
await assertThrows(() => ctl.checkedPath('C:/ProgramData/x'), 'not an allowed workspace', 'ProgramData is rejected')
|
|
766
|
+
// A bare filesystem root is not a workspace.
|
|
767
|
+
await assertThrows(() => ctl.checkedPath('D:/'), 'filesystem root', 'a drive root is rejected')
|
|
768
|
+
await assertThrows(() => ctl.checkedPath('C:/'), 'filesystem root', 'C:/ is rejected')
|
|
769
|
+
// Regression guard for behaviour block 35 already covered.
|
|
770
|
+
await assertThrows(() => ctl.checkedPath('C:/Windows/system32'), 'not an allowed workspace', 'the original system-root case still fails closed')
|
|
771
|
+
await assertThrows(() => ctl.checkedPath('relative/path'), 'must be absolute', 'a relative path is still rejected')
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
// ── 37. 0.23.3: init writes never escape the authorized workspace ──────────
|
|
775
|
+
{
|
|
776
|
+
const ctl = await import('./lib/controller.js')
|
|
777
|
+
assert(typeof ctl.isInside === 'function', 'the containment helper is exported for host integrations')
|
|
778
|
+
// Segment-level comparison: a name-prefix sibling is NOT inside its neighbour.
|
|
779
|
+
assert(ctl.isInside('D:/a/b', 'D:/a/b/c') === true, 'a descendant is inside')
|
|
780
|
+
assert(ctl.isInside('D:/a/b', 'D:/a/b') === true, 'the root itself is inside')
|
|
781
|
+
assert(ctl.isInside('D:/a/b', 'D:/a/bc') === false, 'a name-prefix sibling is NOT inside')
|
|
782
|
+
assert(ctl.isInside('D:/a/b', 'D:/a') === false, 'a parent is not inside')
|
|
783
|
+
assert(ctl.isInside('D:/a/b', 'D:/a/b/../c') === false, 'a traversal out of the workspace is NOT inside')
|
|
784
|
+
const controllerSrc = readFileSync('./lib/controller.js', 'utf8')
|
|
785
|
+
assert(controllerSrc.includes('定位到工作区之外'), 'writeInit refuses a target located outside the workspace')
|
|
786
|
+
assert(controllerSrc.includes('INIT_MAX_ANCESTOR_CLIMB'), 'the ancestor walk is bounded rather than unbounded')
|
|
787
|
+
}
|
|
788
|
+
|
|
739
789
|
console.log(`\nP0 acceptance: ${passed} checks passed`)
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -4,14 +4,28 @@
|
|
|
4
4
|
|
|
5
5
|
按版本查阅功能变化。当前使用方式以[项目首页](../README.md)和使用指南为准;历史条目中的实现方式、限制与测试数量可能已被后续版本替代。
|
|
6
6
|
|
|
7
|
-
## 0.23.
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
## 0.23.4
|
|
8
|
+
|
|
9
|
+
- **关闭两处 Remote 路径边界漏洞**。`checkedPath` 此前用**原始字符串**比对禁止前缀,`D:/proj/../../Windows` 不匹配任何前缀,却被后续 `join()` 解析到 `C:/Windows`;实测 8 个越界样本中旧实现放过 7 个。现在先 `resolve()` 归一化再判断,禁止列表不再绑定盘符(`D:/Windows`、`E:/Program Files` 同样拒绝),并拒绝裸盘符根(`D:/`、`C:/`)。
|
|
10
|
+
- `writeInit` 不再写到工作区之外。`locateInitRoot` 的祖先回溯可能定位到工作区上一级:**读取**该文件是有意的(那才是真正拥有 `AGENTS.md` 的项目),但**写入**不是本工作区的事。现在越界写入直接拒绝并提示改选工作区,与 `dev_task init apply` 的 `assertInsideRoot` 一致;祖先回溯同时加上 8 层上限。新增 `isInside` 按**路径段**而非字符串前缀比较,`D:/a/bc` 不会被误判为在 `D:/a/b` 内。
|
|
11
|
+
- **新增 DSH 契约兼容性检查**(`scripts/verify-dsh-compat.mjs`,`npm run verify:dsh`)。它读取真实 DSH 检出里 typert 协议的类型声明,判断当前契约是 `schema` 还是 `create()`,再断言产物满足它、且 peer 范围确实覆盖该版本。这正是 0.23.3 修复的那类问题——单元测试看不到,因为测试从不通过真实注册表加载 descriptor。CI 新增 `dsh-contract` 作业:对固定基线 `dsh-v0.1.6-alpha.2` 失败即红,对 `master` 仅告警(`continue-on-error`),因此破坏性变更会在发布前暴露。已反向验证:把 peer 范围改回旧值,该检查会失败。
|
|
12
|
+
- **新增提交钩子端到端测试**(`.hook-test.mjs`,6 项)。此前的 P0 断言只检查钩子**源码**的字符串(关闭路径转义、NUL 分隔、捆绑冻结快照),能防手抄回潮,但**无法证明门禁真的拦住了提交**——一个全部拒绝或全部放行的钩子都能通过。新测试在临时 git 仓库里真实执行 `git commit`,双向断言:合法提交放行,消息格式错误、范围外文件、未到检查点、快照被篡改、敏感路径无高风险回执五类均被拒绝且给出对应理由。
|
|
13
|
+
- P0 断言从 126 增至 146;`npm test` 现包含钩子端到端用例(37 → 43 项)。
|
|
14
|
+
|
|
15
|
+
## 0.23.3
|
|
16
|
+
|
|
17
|
+
- **适配 DSH 0.1.6-alpha.2 的 typert strict codec 契约变更**。该版本把 codec 从直接携带 `schema` 改为惰性工厂 `create: () => TypertSchema`,并在注册时硬校验 `typeof codec.create === 'function'`;旧写法会在插件加载阶段抛 `strict codec has no create() factory`,整份 Remote 贡献被拒绝。`src/client/remote.ts` 的 36 个 strict codec 现在**同时携带 `create` 与 `schema`**,因此同一份产物在 0.1.2-rc.1(桌面版)与 0.1.6-alpha.2(源码版)上都能加载。两处内联的 `z.object({...})` 提为具名常量,与文件既有风格一致。
|
|
18
|
+
- peer 范围补上 `|| ^0.1.6-alpha.2`。此前声明未覆盖该版本,pnpm 只在安装时警告、运行时不拦,导致问题在启动时才暴露。
|
|
19
|
+
- 注意:npm 的 semver 不匹配未被范围显式点名的预发布版本,因此后续每个新的 DSH alpha 都需要在此处追加,否则会重新出现同类加载失败。
|
|
20
|
+
|
|
21
|
+
## 0.23.2
|
|
22
|
+
|
|
23
|
+
- 修复 verify / skill_result 先执行命令后审批、批准权限未传入 shell 的问题;拒绝、取消或审批不可用时不执行命令。
|
|
24
|
+
- 审批显示实际验证命令;批准模式只用于本次命令和回执写入,不改变会话策略,也不重复申请保存回执的审批。
|
|
25
|
+
- 修正提交规则与手册中的模块名示例,第一段使用当前任务 id,第二段使用 status 的 commit.label;自定义格式以任务冻结流程为准。
|
|
26
|
+
- dshtest 首轮在 0.23.1 复现权限问题;修复后连续两轮完整开发、验证、审核、本地提交及归档回退通过。专项覆盖审批拒绝、原命令批准执行、证据过期和单次权限恢复,详见[发布说明](release-0.23.2.md)与[测试报告](testing/0.23.2/测试报告.md)。
|
|
27
|
+
|
|
28
|
+
## 0.23.1
|
|
15
29
|
|
|
16
30
|
- 汇总本轮候选版的资源来源、Windows 技能加载、实施审核保留、派工状态、真实技能/验证/提交回执及状态一致性修复。
|
|
17
31
|
- 新增 status.artifact_requirements,提前披露当前阶段的记录字段和缺项;未知字段拒绝时给出恢复指引,整次写入保持不变。
|
package/lib/client.js
CHANGED
|
@@ -4251,6 +4251,8 @@ var resourceRequestSchema = external_exports.object({
|
|
|
4251
4251
|
expectedHash: external_exports.string().optional()
|
|
4252
4252
|
});
|
|
4253
4253
|
var resourcePreviewSchema = external_exports.object({ ok: external_exports.boolean(), name: external_exports.string(), description: external_exports.string(), content: external_exports.string(), target: external_exports.string(), files: external_exports.number(), bytes: external_exports.number(), hash: external_exports.string(), conflict: external_exports.boolean(), error: external_exports.string().optional() });
|
|
4254
|
+
var resourceRootsRequestSchema = external_exports.object({ kind: external_exports.enum(["skill", "rule"]), path: external_exports.string() });
|
|
4255
|
+
var resourceRootsSchema = external_exports.object({ project: external_exports.string(), user: external_exports.string() });
|
|
4254
4256
|
var PACKAGE = "@godv61/dsh-task-engine";
|
|
4255
4257
|
var TYPERT_REMOTE = {
|
|
4256
4258
|
package: PACKAGE,
|
|
@@ -4261,8 +4263,8 @@ var TYPERT_REMOTE = {
|
|
|
4261
4263
|
namespace: "task-engine",
|
|
4262
4264
|
method,
|
|
4263
4265
|
invocation: { kind: "direct" },
|
|
4264
|
-
parameters: [{ name: "request", wire: "request", source: "json", codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#ResourceImportRequest`, schema: resourceRequestSchema } }],
|
|
4265
|
-
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#ResourcePreview`, schema: resourcePreviewSchema }
|
|
4266
|
+
parameters: [{ name: "request", wire: "request", source: "json", codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#ResourceImportRequest`, create: () => resourceRequestSchema, schema: resourceRequestSchema } }],
|
|
4267
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#ResourcePreview`, create: () => resourcePreviewSchema, schema: resourcePreviewSchema }
|
|
4266
4268
|
})),
|
|
4267
4269
|
{
|
|
4268
4270
|
id: `${PACKAGE}#task-engine/resourceRoots`,
|
|
@@ -4270,8 +4272,8 @@ var TYPERT_REMOTE = {
|
|
|
4270
4272
|
namespace: "task-engine",
|
|
4271
4273
|
method: "resourceRoots",
|
|
4272
4274
|
invocation: { kind: "direct" },
|
|
4273
|
-
parameters: [{ name: "request", wire: "request", source: "json", codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#ResourceRootsRequest`,
|
|
4274
|
-
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#ResourceRoots`,
|
|
4275
|
+
parameters: [{ name: "request", wire: "request", source: "json", codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#ResourceRootsRequest`, create: () => resourceRootsRequestSchema, schema: resourceRootsRequestSchema } }],
|
|
4276
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#ResourceRoots`, create: () => resourceRootsSchema, schema: resourceRootsSchema }
|
|
4275
4277
|
},
|
|
4276
4278
|
{
|
|
4277
4279
|
id: `${PACKAGE}#task-engine/read`,
|
|
@@ -4284,10 +4286,10 @@ var TYPERT_REMOTE = {
|
|
|
4284
4286
|
name: "path",
|
|
4285
4287
|
wire: "path",
|
|
4286
4288
|
source: "json",
|
|
4287
|
-
codec: { mode: "strict", typeSymbol: "string", schema: external_exports.string() }
|
|
4289
|
+
codec: { mode: "strict", typeSymbol: "string", create: () => external_exports.string(), schema: external_exports.string() }
|
|
4288
4290
|
}
|
|
4289
4291
|
],
|
|
4290
|
-
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#EngConfigView`, schema: viewSchema }
|
|
4292
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#EngConfigView`, create: () => viewSchema, schema: viewSchema }
|
|
4291
4293
|
},
|
|
4292
4294
|
{
|
|
4293
4295
|
id: `${PACKAGE}#task-engine/write`,
|
|
@@ -4300,10 +4302,10 @@ var TYPERT_REMOTE = {
|
|
|
4300
4302
|
name: "request",
|
|
4301
4303
|
wire: "request",
|
|
4302
4304
|
source: "json",
|
|
4303
|
-
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#EngWriteRequest`, schema: writeRequestSchema }
|
|
4305
|
+
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#EngWriteRequest`, create: () => writeRequestSchema, schema: writeRequestSchema }
|
|
4304
4306
|
}
|
|
4305
4307
|
],
|
|
4306
|
-
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#EngConfigView`, schema: viewSchema }
|
|
4308
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#EngConfigView`, create: () => viewSchema, schema: viewSchema }
|
|
4307
4309
|
},
|
|
4308
4310
|
{
|
|
4309
4311
|
id: `${PACKAGE}#task-engine/listSkills`,
|
|
@@ -4316,10 +4318,10 @@ var TYPERT_REMOTE = {
|
|
|
4316
4318
|
name: "path",
|
|
4317
4319
|
wire: "path",
|
|
4318
4320
|
source: "json",
|
|
4319
|
-
codec: { mode: "strict", typeSymbol: "string", schema: external_exports.string() }
|
|
4321
|
+
codec: { mode: "strict", typeSymbol: "string", create: () => external_exports.string(), schema: external_exports.string() }
|
|
4320
4322
|
}
|
|
4321
4323
|
],
|
|
4322
|
-
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#SkillCatalog`, schema: skillCatalogSchema }
|
|
4324
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#SkillCatalog`, create: () => skillCatalogSchema, schema: skillCatalogSchema }
|
|
4323
4325
|
},
|
|
4324
4326
|
{
|
|
4325
4327
|
id: `${PACKAGE}#task-engine/listRules`,
|
|
@@ -4332,10 +4334,10 @@ var TYPERT_REMOTE = {
|
|
|
4332
4334
|
name: "path",
|
|
4333
4335
|
wire: "path",
|
|
4334
4336
|
source: "json",
|
|
4335
|
-
codec: { mode: "strict", typeSymbol: "string", schema: external_exports.string() }
|
|
4337
|
+
codec: { mode: "strict", typeSymbol: "string", create: () => external_exports.string(), schema: external_exports.string() }
|
|
4336
4338
|
}
|
|
4337
4339
|
],
|
|
4338
|
-
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#RuleCatalog`, schema: ruleCatalogSchema }
|
|
4340
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#RuleCatalog`, create: () => ruleCatalogSchema, schema: ruleCatalogSchema }
|
|
4339
4341
|
},
|
|
4340
4342
|
{
|
|
4341
4343
|
id: `${PACKAGE}#task-engine/writeSkill`,
|
|
@@ -4348,10 +4350,10 @@ var TYPERT_REMOTE = {
|
|
|
4348
4350
|
name: "request",
|
|
4349
4351
|
wire: "request",
|
|
4350
4352
|
source: "json",
|
|
4351
|
-
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#WriteSkillRequest`, schema: writeSkillRequestSchema }
|
|
4353
|
+
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#WriteSkillRequest`, create: () => writeSkillRequestSchema, schema: writeSkillRequestSchema }
|
|
4352
4354
|
}
|
|
4353
4355
|
],
|
|
4354
|
-
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#WriteResourceResult`, schema: writeResourceResultSchema }
|
|
4356
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#WriteResourceResult`, create: () => writeResourceResultSchema, schema: writeResourceResultSchema }
|
|
4355
4357
|
},
|
|
4356
4358
|
{
|
|
4357
4359
|
id: `${PACKAGE}#task-engine/installSkill`,
|
|
@@ -4364,10 +4366,10 @@ var TYPERT_REMOTE = {
|
|
|
4364
4366
|
name: "request",
|
|
4365
4367
|
wire: "request",
|
|
4366
4368
|
source: "json",
|
|
4367
|
-
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#InstallSkillRequest`, schema: installSkillRequestSchema }
|
|
4369
|
+
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#InstallSkillRequest`, create: () => installSkillRequestSchema, schema: installSkillRequestSchema }
|
|
4368
4370
|
}
|
|
4369
4371
|
],
|
|
4370
|
-
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#WriteResourceResult`, schema: writeResourceResultSchema }
|
|
4372
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#WriteResourceResult`, create: () => writeResourceResultSchema, schema: writeResourceResultSchema }
|
|
4371
4373
|
},
|
|
4372
4374
|
{
|
|
4373
4375
|
id: `${PACKAGE}#task-engine/listDirs`,
|
|
@@ -4380,10 +4382,10 @@ var TYPERT_REMOTE = {
|
|
|
4380
4382
|
name: "request",
|
|
4381
4383
|
wire: "request",
|
|
4382
4384
|
source: "json",
|
|
4383
|
-
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#ListDirsRequest`, schema: listDirsRequestSchema }
|
|
4385
|
+
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#ListDirsRequest`, create: () => listDirsRequestSchema, schema: listDirsRequestSchema }
|
|
4384
4386
|
}
|
|
4385
4387
|
],
|
|
4386
|
-
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#ListDirsView`, schema: listDirsViewSchema }
|
|
4388
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#ListDirsView`, create: () => listDirsViewSchema, schema: listDirsViewSchema }
|
|
4387
4389
|
},
|
|
4388
4390
|
{
|
|
4389
4391
|
id: `${PACKAGE}#task-engine/writeRule`,
|
|
@@ -4396,10 +4398,10 @@ var TYPERT_REMOTE = {
|
|
|
4396
4398
|
name: "request",
|
|
4397
4399
|
wire: "request",
|
|
4398
4400
|
source: "json",
|
|
4399
|
-
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#WriteRuleRequest`, schema: writeRuleRequestSchema }
|
|
4401
|
+
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#WriteRuleRequest`, create: () => writeRuleRequestSchema, schema: writeRuleRequestSchema }
|
|
4400
4402
|
}
|
|
4401
4403
|
],
|
|
4402
|
-
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#WriteResourceResult`, schema: writeResourceResultSchema }
|
|
4404
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#WriteResourceResult`, create: () => writeResourceResultSchema, schema: writeResourceResultSchema }
|
|
4403
4405
|
},
|
|
4404
4406
|
{
|
|
4405
4407
|
id: `${PACKAGE}#task-engine/readSkill`,
|
|
@@ -4412,10 +4414,10 @@ var TYPERT_REMOTE = {
|
|
|
4412
4414
|
name: "request",
|
|
4413
4415
|
wire: "request",
|
|
4414
4416
|
source: "json",
|
|
4415
|
-
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#ReadSkillRequest`, schema: readSkillRequestSchema }
|
|
4417
|
+
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#ReadSkillRequest`, create: () => readSkillRequestSchema, schema: readSkillRequestSchema }
|
|
4416
4418
|
}
|
|
4417
4419
|
],
|
|
4418
|
-
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#ReadSkillResult`, schema: readSkillResultSchema }
|
|
4420
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#ReadSkillResult`, create: () => readSkillResultSchema, schema: readSkillResultSchema }
|
|
4419
4421
|
},
|
|
4420
4422
|
{
|
|
4421
4423
|
id: `${PACKAGE}#task-engine/readRule`,
|
|
@@ -4428,10 +4430,10 @@ var TYPERT_REMOTE = {
|
|
|
4428
4430
|
name: "request",
|
|
4429
4431
|
wire: "request",
|
|
4430
4432
|
source: "json",
|
|
4431
|
-
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#ReadRuleRequest`, schema: readRuleRequestSchema }
|
|
4433
|
+
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#ReadRuleRequest`, create: () => readRuleRequestSchema, schema: readRuleRequestSchema }
|
|
4432
4434
|
}
|
|
4433
4435
|
],
|
|
4434
|
-
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#ReadRuleResult`, schema: readRuleResultSchema }
|
|
4436
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#ReadRuleResult`, create: () => readRuleResultSchema, schema: readRuleResultSchema }
|
|
4435
4437
|
},
|
|
4436
4438
|
{
|
|
4437
4439
|
id: `${PACKAGE}#task-engine/deleteSkill`,
|
|
@@ -4444,10 +4446,10 @@ var TYPERT_REMOTE = {
|
|
|
4444
4446
|
name: "request",
|
|
4445
4447
|
wire: "request",
|
|
4446
4448
|
source: "json",
|
|
4447
|
-
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#DeleteSkillRequest`, schema: deleteSkillRequestSchema }
|
|
4449
|
+
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#DeleteSkillRequest`, create: () => deleteSkillRequestSchema, schema: deleteSkillRequestSchema }
|
|
4448
4450
|
}
|
|
4449
4451
|
],
|
|
4450
|
-
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#WriteResourceResult`, schema: writeResourceResultSchema }
|
|
4452
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#WriteResourceResult`, create: () => writeResourceResultSchema, schema: writeResourceResultSchema }
|
|
4451
4453
|
},
|
|
4452
4454
|
{
|
|
4453
4455
|
id: `${PACKAGE}#task-engine/deleteRule`,
|
|
@@ -4460,10 +4462,10 @@ var TYPERT_REMOTE = {
|
|
|
4460
4462
|
name: "request",
|
|
4461
4463
|
wire: "request",
|
|
4462
4464
|
source: "json",
|
|
4463
|
-
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#DeleteRuleRequest`, schema: deleteRuleRequestSchema }
|
|
4465
|
+
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#DeleteRuleRequest`, create: () => deleteRuleRequestSchema, schema: deleteRuleRequestSchema }
|
|
4464
4466
|
}
|
|
4465
4467
|
],
|
|
4466
|
-
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#WriteResourceResult`, schema: writeResourceResultSchema }
|
|
4468
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#WriteResourceResult`, create: () => writeResourceResultSchema, schema: writeResourceResultSchema }
|
|
4467
4469
|
},
|
|
4468
4470
|
{
|
|
4469
4471
|
id: `${PACKAGE}#task-engine/readTasks`,
|
|
@@ -4476,10 +4478,10 @@ var TYPERT_REMOTE = {
|
|
|
4476
4478
|
name: "path",
|
|
4477
4479
|
wire: "path",
|
|
4478
4480
|
source: "json",
|
|
4479
|
-
codec: { mode: "strict", typeSymbol: "string", schema: external_exports.string() }
|
|
4481
|
+
codec: { mode: "strict", typeSymbol: "string", create: () => external_exports.string(), schema: external_exports.string() }
|
|
4480
4482
|
}
|
|
4481
4483
|
],
|
|
4482
|
-
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#TaskLedgerView`, schema: taskLedgerViewSchema }
|
|
4484
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#TaskLedgerView`, create: () => taskLedgerViewSchema, schema: taskLedgerViewSchema }
|
|
4483
4485
|
},
|
|
4484
4486
|
{
|
|
4485
4487
|
id: `${PACKAGE}#task-engine/readInit`,
|
|
@@ -4492,10 +4494,10 @@ var TYPERT_REMOTE = {
|
|
|
4492
4494
|
name: "path",
|
|
4493
4495
|
wire: "path",
|
|
4494
4496
|
source: "json",
|
|
4495
|
-
codec: { mode: "strict", typeSymbol: "string", schema: external_exports.string() }
|
|
4497
|
+
codec: { mode: "strict", typeSymbol: "string", create: () => external_exports.string(), schema: external_exports.string() }
|
|
4496
4498
|
}
|
|
4497
4499
|
],
|
|
4498
|
-
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#InitView`, schema: initViewSchema }
|
|
4500
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#InitView`, create: () => initViewSchema, schema: initViewSchema }
|
|
4499
4501
|
},
|
|
4500
4502
|
{
|
|
4501
4503
|
id: `${PACKAGE}#task-engine/writeInit`,
|
|
@@ -4508,10 +4510,10 @@ var TYPERT_REMOTE = {
|
|
|
4508
4510
|
name: "request",
|
|
4509
4511
|
wire: "request",
|
|
4510
4512
|
source: "json",
|
|
4511
|
-
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#InitWriteRequest`, schema: initWriteRequestSchema }
|
|
4513
|
+
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#InitWriteRequest`, create: () => initWriteRequestSchema, schema: initWriteRequestSchema }
|
|
4512
4514
|
}
|
|
4513
4515
|
],
|
|
4514
|
-
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#InitWriteResult`, schema: initWriteResultSchema }
|
|
4516
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#InitWriteResult`, create: () => initWriteResultSchema, schema: initWriteResultSchema }
|
|
4515
4517
|
},
|
|
4516
4518
|
{
|
|
4517
4519
|
id: `${PACKAGE}#task-engine/generateInit`,
|
|
@@ -4524,10 +4526,10 @@ var TYPERT_REMOTE = {
|
|
|
4524
4526
|
name: "request",
|
|
4525
4527
|
wire: "request",
|
|
4526
4528
|
source: "json",
|
|
4527
|
-
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#InitGenerateRequest`, schema: initGenerateRequestSchema }
|
|
4529
|
+
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#InitGenerateRequest`, create: () => initGenerateRequestSchema, schema: initGenerateRequestSchema }
|
|
4528
4530
|
}
|
|
4529
4531
|
],
|
|
4530
|
-
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#InitDraft`, schema: initDraftSchema }
|
|
4532
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#InitDraft`, create: () => initDraftSchema, schema: initDraftSchema }
|
|
4531
4533
|
}
|
|
4532
4534
|
]
|
|
4533
4535
|
};
|