@nestos/kanban 0.0.0-stage → 0.5.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/README.md +121 -2
- package/dist/activity-C6xDM-cg.d.cts +232 -0
- package/dist/activity-Dw8DOw0L.d.ts +232 -0
- package/dist/activity.cjs +288 -0
- package/dist/activity.cjs.map +1 -0
- package/dist/activity.d.cts +34 -0
- package/dist/activity.d.ts +34 -0
- package/dist/activity.js +288 -0
- package/dist/activity.js.map +1 -0
- package/dist/chunk-2YFPV5GF.cjs +16 -0
- package/dist/chunk-2YFPV5GF.cjs.map +1 -0
- package/dist/chunk-4KF7KUAI.cjs +221 -0
- package/dist/chunk-4KF7KUAI.cjs.map +1 -0
- package/dist/chunk-4XF6LQSU.cjs +9 -0
- package/dist/chunk-4XF6LQSU.cjs.map +1 -0
- package/dist/chunk-5DLZWW5Y.js +148 -0
- package/dist/chunk-5DLZWW5Y.js.map +1 -0
- package/dist/chunk-5XKOCKY2.js +58 -0
- package/dist/chunk-5XKOCKY2.js.map +1 -0
- package/dist/chunk-6MN3H3YF.cjs +183 -0
- package/dist/chunk-6MN3H3YF.cjs.map +1 -0
- package/dist/chunk-ATUFFNLV.js +221 -0
- package/dist/chunk-ATUFFNLV.js.map +1 -0
- package/dist/chunk-DFTOTBGF.js +439 -0
- package/dist/chunk-DFTOTBGF.js.map +1 -0
- package/dist/chunk-G6FCDLDF.js +16 -0
- package/dist/chunk-G6FCDLDF.js.map +1 -0
- package/dist/chunk-IUI5CI2S.cjs +439 -0
- package/dist/chunk-IUI5CI2S.cjs.map +1 -0
- package/dist/chunk-KYNYPKKH.cjs +71 -0
- package/dist/chunk-KYNYPKKH.cjs.map +1 -0
- package/dist/chunk-L44TM4EE.cjs +1498 -0
- package/dist/chunk-L44TM4EE.cjs.map +1 -0
- package/dist/chunk-LSE6JG5I.cjs +20 -0
- package/dist/chunk-LSE6JG5I.cjs.map +1 -0
- package/dist/chunk-O4OGAAV4.js +71 -0
- package/dist/chunk-O4OGAAV4.js.map +1 -0
- package/dist/chunk-OHQTKGQN.js +1498 -0
- package/dist/chunk-OHQTKGQN.js.map +1 -0
- package/dist/chunk-PSKQAFDF.cjs +58 -0
- package/dist/chunk-PSKQAFDF.cjs.map +1 -0
- package/dist/chunk-QTMTBEBA.js +20 -0
- package/dist/chunk-QTMTBEBA.js.map +1 -0
- package/dist/chunk-RQP77ZTY.js +9 -0
- package/dist/chunk-RQP77ZTY.js.map +1 -0
- package/dist/chunk-T7P5EIC4.cjs +148 -0
- package/dist/chunk-T7P5EIC4.cjs.map +1 -0
- package/dist/chunk-TB2RZGDV.js +183 -0
- package/dist/chunk-TB2RZGDV.js.map +1 -0
- package/dist/content-CAIp1njn.d.cts +35 -0
- package/dist/content-CGMJdyH_.d.ts +35 -0
- package/dist/contracts/index.cjs +21 -0
- package/dist/contracts/index.cjs.map +1 -0
- package/dist/contracts/index.d.cts +4 -0
- package/dist/contracts/index.d.ts +4 -0
- package/dist/contracts/index.js +21 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/discovery-DxpirOz3.d.cts +61 -0
- package/dist/discovery-gSqWpuRm.d.ts +61 -0
- package/dist/discovery.cjs +379 -0
- package/dist/discovery.cjs.map +1 -0
- package/dist/discovery.d.cts +22 -0
- package/dist/discovery.d.ts +22 -0
- package/dist/discovery.js +379 -0
- package/dist/discovery.js.map +1 -0
- package/dist/execution.cjs +368 -0
- package/dist/execution.cjs.map +1 -0
- package/dist/execution.d.cts +89 -0
- package/dist/execution.d.ts +89 -0
- package/dist/execution.js +368 -0
- package/dist/execution.js.map +1 -0
- package/dist/index.cjs +76 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +61 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.js +76 -0
- package/dist/index.js.map +1 -0
- package/dist/module-BbvwdCDF.d.cts +11 -0
- package/dist/module-CWNK2BMj.d.ts +11 -0
- package/dist/planning-CcFZYdIL.d.cts +844 -0
- package/dist/planning-CcFZYdIL.d.ts +844 -0
- package/dist/ports-Bn6ro2FB.d.ts +142 -0
- package/dist/ports-CaL6geqR.d.cts +142 -0
- package/dist/storage.cjs +289 -0
- package/dist/storage.cjs.map +1 -0
- package/dist/storage.d.cts +71 -0
- package/dist/storage.d.ts +71 -0
- package/dist/storage.js +289 -0
- package/dist/storage.js.map +1 -0
- package/dist/store-Ct0gOAAg.d.ts +28 -0
- package/dist/store-q63eSMoT.d.cts +28 -0
- package/dist/ui/index.cjs +1961 -0
- package/dist/ui/index.cjs.map +1 -0
- package/dist/ui/index.d.cts +209 -0
- package/dist/ui/index.d.ts +209 -0
- package/dist/ui/index.js +1961 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/kanban.css +194 -0
- package/package.json +113 -4
package/README.md
CHANGED
|
@@ -1,3 +1,122 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @nestos/kanban
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
基于 VFS 的通用看板与工作协调库,仅依赖 `@nestos/vfs-core`。提供唯一责任人、估算与在制额度、依赖、验收、归档、日志和决策,以及持久派发意图。库不调用模型、不创建 Session/Task、不安装后台调度器。包含可独立挂载的 DOM UI;执行、来源与资源活动通过可选端口接入。
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import {SeqKanbanStore, createKanbanModule} from '@nestos/kanban';
|
|
7
|
+
|
|
8
|
+
const service = createKanbanModule({
|
|
9
|
+
store: await SeqKanbanStore.open(authorizedFS, '/work'),
|
|
10
|
+
actor: authenticatedPrincipal,
|
|
11
|
+
authorize: authorizeOperation,
|
|
12
|
+
verifyOutputs: verifyImmutableArtifacts,
|
|
13
|
+
onCommitted: async (boardId, source) => publishPersistedEvents(boardId, source),
|
|
14
|
+
log: logMetadata,
|
|
15
|
+
});
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`actor`、授权及产物核验均来自可信宿主,不能从命令 JSON 中采信。`create` 传入 scope、members、职责和 policy;`execute` 传入稳定 operationId、expectedRevision 和强类型 command。并发冲突由调用方重新读取后决定,不能换 ID 盲目重试外部执行。
|
|
19
|
+
|
|
20
|
+
## 公共入口
|
|
21
|
+
|
|
22
|
+
| 入口 | 内容 |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| 根入口 | `createKanban` 分组 API;`createKanbanModule` 服务工厂与 `SeqKanbanStore` |
|
|
25
|
+
| `/contracts` | 无副作用 DTO、命令、事件与默认配置 |
|
|
26
|
+
| `/storage` | `SeqKanbanStore`、`ConditionalKanbanStore`、内容安装与传输端口 |
|
|
27
|
+
| `/execution` | `createKanbanExecutionBridge`;宿主提供 prepare/start/inspect |
|
|
28
|
+
| `/discovery` | `createKanbanDiscovery`;宿主提供来源、分析和授权 |
|
|
29
|
+
| `/activity` | `createKanbanActivityModule`;注入来源和外部引用 namespace |
|
|
30
|
+
| `/ui`、`/ui.css` | DOM 工作区、`mountKanban` 与独立样式 |
|
|
31
|
+
|
|
32
|
+
`createKanban(options)` 提供 `boards.create/get/list/overview`、`items.get/query`、`records.get/query`、`planning.get`、`references.resolve/suggest`、`execute`、`events`、`tick` 和 `quiesce/dispose`。execute 返回 `{boardId, operationId, revision}`;幂等重放时 revision 是当前返回快照的版本。需要 KanbanService(例如 UI、执行桥)时直接使用 `createKanbanModule`,二者共享同一实现与命令协议。
|
|
33
|
+
|
|
34
|
+
主体 ID、Session/Task/Message ID 及历史持久格式保留。独立 Agent 可以只提供自己的 ID;若提供执行身份,所有权继续按该身份隔离。NestOS 在适配边界继续要求真实 Session/Task,宿主始终负责实际权限核验。
|
|
35
|
+
|
|
36
|
+
## 独立 UI
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import {mountKanban} from '@nestos/kanban/ui';
|
|
40
|
+
import '@nestos/kanban/ui.css';
|
|
41
|
+
|
|
42
|
+
const view = await mountKanban(container, {
|
|
43
|
+
service,
|
|
44
|
+
presentation: {
|
|
45
|
+
text: (key, values) => translations(key, values),
|
|
46
|
+
icons: {refreshView, more, close},
|
|
47
|
+
log: logMetadata,
|
|
48
|
+
referenceUrl: path => resourceUrl(path),
|
|
49
|
+
},
|
|
50
|
+
selected: path => saveNavigation(path),
|
|
51
|
+
openSession: id => openResource(id),
|
|
52
|
+
});
|
|
53
|
+
await view.open({boardId: 'work'});
|
|
54
|
+
await view.dispose();
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
文案 key 不带 `kanban.` 前缀;图标为可信宿主提供的 SVG/HTML。主题通过 `--kanban-*` CSS 变量设置;NestOS 在适配样式中映射原有主题变量。所有呈现配置按实例注入,不存在全局语言、当前宿主或跨实例回调。UI 不导入 NestOS、common 或 vfs-ui。资源活动为可选能力;未接入时不显示执行筛选,也不安装活动轮询。接入时可见且没有未保存输入才轮询,销毁后停止;通知不会覆盖草稿。错误只展示安全错误码与宿主文案,不输出正文或完整请求。
|
|
58
|
+
|
|
59
|
+
来源发现仅通过内置 `apply-discovery` 提交受校验的变更与检查点,二者同事务保存。宿主不提供可变 reducer 扩展。来源可声明 system/project/collection scope;历史 projectId 仍兼容。库不提供内部 mechanisms 入口。消费者直接从 `/contracts` 导入 DTO 和 KanbanClient,不经过应用包转出。
|
|
60
|
+
|
|
61
|
+
执行桥不解释模型或业务。执行桥和来源扫描的 `tick()`(兼容 `scan()`)由宿主显式驱动;扫描 `quiesce/dispose` 拒绝新准入并排空已接纳操作。只有注入 subscribe 才接收唤醒。executionReference 将实际执行 ID 映射为宿主命名空间,不在核心写死 NestOS 引用。`ConditionalKanbanStore` 只要求 query/transaction 与可选正文资产端口,适配器负责授权连接及 unknown 写入核对,不在 Store 内盲重试。
|
|
62
|
+
|
|
63
|
+
## 版本化内容安装
|
|
64
|
+
|
|
65
|
+
`/contracts` 自包含定义 `KanbanContent`、`KanbanClient` 及领域 DTO。`/storage` 的 `installKanbanContent({store, actor, authorize, log, content, operationId})` 安装宿主提供的内容;显式授权 action=install-content,在同一事务保存工作项、记录、修改建议、归档、事件、回执与安装版本。安装内容不授予执行或审核权限。库不携带 NestOS 示例、文案或模板。
|
|
66
|
+
|
|
67
|
+
默认只补充新版本新增的身份,保留用户修改和删除。显式 fillMissing 可以恢复缺失项,已存在或已归档身份不会重新创建。missingReferences=detach 是明确选择的引用修复策略,默认仍按领域约束拒绝无效关系。inspectKanbanContent 返回安装版本与完整性,不向宿主泄露 reducer 状态。
|
|
68
|
+
|
|
69
|
+
## 验证
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
pnpm --filter @nestos/kanban typecheck
|
|
73
|
+
pnpm --filter @nestos/kanban test
|
|
74
|
+
pnpm --filter @nestos/kanban build
|
|
75
|
+
pnpm --filter @nestos/kanban example
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
[独立示例](examples/standalone.ts) 只使用 VFS 与假执行器,完成两节点依赖计划,显式自动验收后关闭;没有 NestOS Runtime、模型或网络调用。内存后端用于演示,生产需提供持久后端和实际授权。
|
|
79
|
+
|
|
80
|
+
## 计划与执行
|
|
81
|
+
|
|
82
|
+
管理主体以 `publish-plan` 发布 `kanban.plan/1`:每项指定 assignee、dependsOn、验收条件及输入/输出名称。决策可保存 `coordination.manager/executor`,关联计划只允许该管理主体发布;成员和宿主权限仍需独立检查。计划校验循环、悬空依赖及版本冲突后,原子创建工作项。
|
|
83
|
+
|
|
84
|
+
执行主体提交 `prepare-dispatch`,同一事务完成认领、估算、依赖产物固定和派发意图持久化。可选 execution 入口负责冻结请求和提交前日志,再通过宿主端口调用既有执行器。`observe-execution` 只接收原 dispatchId/fence 的真实观察;`unknown` 保留责任,禁止自动重派。成功首先进入 review;默认需要独立主体 `accept-execution`。显式 review=assignee 时可信成功可自动验收。只有依赖已验收且输出存在,后续任务才能进入 ready。
|
|
85
|
+
|
|
86
|
+
`workflow(boardId)` 返回计划、派发和 ready 摘要。核心只解锁已发布 DAG;动态分解和业务决策仍由管理主体提交下一版计划。修改任务定义需要新任务 ID,未结算执行阻止替换计划或转交责任。`completedPlans` 仅说明已封闭计划中的事项完成,不能替代业务目标验收。
|
|
87
|
+
|
|
88
|
+
## 文件协议
|
|
89
|
+
|
|
90
|
+
默认存储 `/kanban/boards.seq`,可注入目录或完全替换 KanbanStore。SeqFile 必须支持 transaction。键中身份使用 encodeURIComponent:
|
|
91
|
+
|
|
92
|
+
| 键 | 内容 |
|
|
93
|
+
| --- | --- |
|
|
94
|
+
| `index` | 看板 ID 列表 |
|
|
95
|
+
| `board/<boardId>` | layout=2 清单:板元数据、摘要索引、workflow、序列及状态 |
|
|
96
|
+
| `item/<boardId>/<itemId>` | 工作项正文或内容寻址引用 |
|
|
97
|
+
| `record/<boardId>/<recordId>` | 日志/决策正文或引用 |
|
|
98
|
+
| `archive/<boardId>/<itemId>` | 已关闭归档项与关闭事实 |
|
|
99
|
+
| `event/<boardId>/<16位序号>` | 不可变事件/outbox |
|
|
100
|
+
| `receipt/<boardId>/<operationId>` | 请求指纹,防止重复或异义提交 |
|
|
101
|
+
|
|
102
|
+
看板编号使用同文件的计数器与反向索引。计划及派发目前在 board 清单的 state.workflow 中,不另建伪数据库键。一个命令的所有控制记录在同一事务提交;回滚不发布其中任一变化。
|
|
103
|
+
|
|
104
|
+
正文超过 8 KiB 时先保存为同 SeqFile 的 `<sha256>.json` 资产并核验摘要/长度,再提交引用。失败可留下未引用资产,不会发布半个正文;自动垃圾回收和历史裁剪尚未启用。产物引用 `{name,ref,sha256,bytes}` 的权限与实际内容由宿主核验,引用字符串本身不授予文件访问。
|
|
105
|
+
|
|
106
|
+
VFS `seq:committed` 可用于唤醒宿主,但持久状态与定期补扫才是恢复依据。`content:finished` 在读取关闭时也会发出,不能当成任务完成。禁止直接改内部 JSON 或用普通文件复制覆盖活动数据库;外部 Agent 应调用授权命令接口。
|
|
107
|
+
|
|
108
|
+
## 生命周期与宿主边界
|
|
109
|
+
|
|
110
|
+
关闭顺序:停止事件/定时准入 → service.quiesce(拒新操作、等待已准入事务)→ 排空执行适配器 → 最后关闭 VFS。宿主重启后扫描持久派发、检查原执行身份并补投 outbox。SeqFile 不能与模型调用、远程服务或另一数据库组成单一事务,执行桥必须保留提交前日志和 unknown 状态。
|
|
111
|
+
|
|
112
|
+
NestOS 的默认目录、远程 HttpSeqClient、Session 来源读取、发布 Agent/Flow、Kernel 回执、系统 notify 与调度接线均位于 `backend/app-core/src/kanban/`。扫描状态机、批量提交、远程事务编码与执行恢复归独立库;UI 的 NestOS 包装位于 `ui/app-shell/src/kanban/`。应用入口只导出实际 NestOS 绑定,不代转出库 API,核心没有这些运行依赖。完整规范见 [Kanban 协调设计](../../doc/design/kanban-coordination.md)。
|
|
113
|
+
|
|
114
|
+
会话活动入口 `executionSession(boardId, itemId)` 只读取当前执行摘要。显式传入 `{includeRelated: true}` 时,通过可选 `KanbanSessionSource.related` 合并宿主关联与已有执行绑定、参与者;返回的 `sessions` 按不透明 Session ID 去重,各自包含用途和 `executions` 执行记录。续办在同一 Session 下保留不同尝试,`current` 仅由正式执行绑定决定。UI 在展开「相关会话」时加载,支持刷新和宿主注入的原始资源链接;普通活动轮询不读取历史。资源属性由宿主提供,库不识别工作区、Git 或原生会话协议。
|
|
115
|
+
|
|
116
|
+
## Optional automation integration
|
|
117
|
+
|
|
118
|
+
Boards may store automation settings with opaque planner/executor references and trusted coordinator/worker principals. `configure-automation` changes configuration only; the host owns model calls and scheduling. Existing unassigned work may join a sealed plan with `expectedRevision`; adoption preserves its identity and manual dependencies. `edit-item` updates unplanned work while published definitions remain immutable. Execution bridges accept a dynamic `autoDispatch` predicate so pausing prevents new claims while existing admissions are still inspected. Optional client `automationCatalog` and `analysisStatus` ports supply the generic configuration UI and analysis details.
|
|
119
|
+
|
|
120
|
+
宿主已有工作区导航时,可直接构造 `KanbanWorkbench` 并省略 `sidebar`,通过 `createBoard()` 接入导航动作,通过 `committed` 刷新目录;`mountKanban` 的独立默认侧栏保持可用。父项详情提供子事项分页与新建入口,子项通过 `planning.parentId` 关联父项,执行依赖仍单独保存在 `planning.dependencies`。
|
|
121
|
+
|
|
122
|
+
Task 的持久 startAt、编辑租约、单一状态投影与文件协议见 [执行规范](../../doc/design/kanban-task-execution.md)。`item().task` 和 query 的 `task` 为相同宿主事实的投影,`phase` 过滤在服务端执行。
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { u as KanbanExternalReference, y as KanbanItemQuery, x as KanbanItemPage, z as KanbanItemSummary, r as KanbanDispatch, T as KanbanService, v as KanbanFixSession, f as KanbanAutomationCatalog, b as KanbanAnalysisStatus } from './planning-CcFZYdIL.cjs';
|
|
2
|
+
|
|
3
|
+
/** Hosts resolve opaque resources and execute records; the library owns no project policy. */
|
|
4
|
+
interface KanbanRecordResource {
|
|
5
|
+
reference: KanbanExternalReference;
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
interface KanbanItemResourceCatalog {
|
|
9
|
+
resources: KanbanRecordResource[];
|
|
10
|
+
selected?: KanbanExternalReference;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
readonly?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface KanbanRecordExecution {
|
|
15
|
+
id: string;
|
|
16
|
+
recordId: string;
|
|
17
|
+
recordRevision: number;
|
|
18
|
+
boardId: string;
|
|
19
|
+
rootItemId?: string;
|
|
20
|
+
itemIds?: string[];
|
|
21
|
+
state: 'preparing' | 'running' | 'blocked' | 'review' | 'completed' | 'failed';
|
|
22
|
+
createdAt: number;
|
|
23
|
+
updatedAt: number;
|
|
24
|
+
code?: string;
|
|
25
|
+
}
|
|
26
|
+
interface KanbanRecordRunRequest {
|
|
27
|
+
operationId: string;
|
|
28
|
+
recordId: string;
|
|
29
|
+
expectedRevision: number;
|
|
30
|
+
placement?: 'current-board' | 'new-board';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Host-owned execution resources; the coordination library does not interpret their backend. */
|
|
34
|
+
interface KanbanWorkResource {
|
|
35
|
+
id: string;
|
|
36
|
+
kind: string;
|
|
37
|
+
title: string;
|
|
38
|
+
location: string;
|
|
39
|
+
version: string;
|
|
40
|
+
state: 'associated' | 'in-use' | 'retained' | 'cleanup-ready' | 'cleaned' | 'unknown';
|
|
41
|
+
reasons: string[];
|
|
42
|
+
properties: Array<{
|
|
43
|
+
label: string;
|
|
44
|
+
value: string;
|
|
45
|
+
}>;
|
|
46
|
+
canCleanup: boolean;
|
|
47
|
+
}
|
|
48
|
+
interface KanbanWorkResourceQuery {
|
|
49
|
+
inspect?: boolean;
|
|
50
|
+
}
|
|
51
|
+
interface KanbanWorkResourceCleanup {
|
|
52
|
+
operationId: string;
|
|
53
|
+
itemId: string;
|
|
54
|
+
resourceId: string;
|
|
55
|
+
version: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface KanbanOperationChoice {
|
|
59
|
+
id: string;
|
|
60
|
+
label: string;
|
|
61
|
+
detail?: string;
|
|
62
|
+
}
|
|
63
|
+
interface KanbanOperationField {
|
|
64
|
+
id: string;
|
|
65
|
+
label: string;
|
|
66
|
+
choices: KanbanOperationChoice[];
|
|
67
|
+
selected?: string;
|
|
68
|
+
}
|
|
69
|
+
/** Host-owned operations; the portable view does not interpret deployment or Git policy. */
|
|
70
|
+
interface KanbanItemOperation {
|
|
71
|
+
id: string;
|
|
72
|
+
label: string;
|
|
73
|
+
state: 'unavailable' | 'ready' | 'running' | 'unknown' | 'succeeded' | 'failed' | 'waiting-confirmation';
|
|
74
|
+
enabled: boolean;
|
|
75
|
+
code?: string;
|
|
76
|
+
reason?: string;
|
|
77
|
+
runId?: string;
|
|
78
|
+
sessionId?: string;
|
|
79
|
+
summary?: string;
|
|
80
|
+
fields?: KanbanOperationField[];
|
|
81
|
+
confirmation?: string;
|
|
82
|
+
configurable?: boolean;
|
|
83
|
+
binding?: KanbanExternalReference;
|
|
84
|
+
openSessionOnRun?: boolean;
|
|
85
|
+
}
|
|
86
|
+
interface KanbanItemOperations {
|
|
87
|
+
revision: string;
|
|
88
|
+
operations: KanbanItemOperation[];
|
|
89
|
+
targets?: Array<{
|
|
90
|
+
label: string;
|
|
91
|
+
reference: KanbanExternalReference;
|
|
92
|
+
}>;
|
|
93
|
+
}
|
|
94
|
+
interface KanbanItemOperationRequest {
|
|
95
|
+
operationId: string;
|
|
96
|
+
itemId: string;
|
|
97
|
+
action: string;
|
|
98
|
+
expectedRevision: string;
|
|
99
|
+
selections?: Record<string, string>;
|
|
100
|
+
confirmed?: boolean;
|
|
101
|
+
}
|
|
102
|
+
interface KanbanItemOperationBinding {
|
|
103
|
+
operationId: string;
|
|
104
|
+
itemId: string;
|
|
105
|
+
action: string;
|
|
106
|
+
expectedRevision: string;
|
|
107
|
+
target: KanbanExternalReference;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
interface KanbanDeletionPreview {
|
|
111
|
+
boardId: string;
|
|
112
|
+
title: string;
|
|
113
|
+
revision: number;
|
|
114
|
+
version: string;
|
|
115
|
+
blockers: Array<{
|
|
116
|
+
code: string;
|
|
117
|
+
itemId?: string;
|
|
118
|
+
sessionId?: string;
|
|
119
|
+
}>;
|
|
120
|
+
pendingItems: number;
|
|
121
|
+
resources: Array<{
|
|
122
|
+
itemId: string;
|
|
123
|
+
resource: KanbanWorkResource;
|
|
124
|
+
}>;
|
|
125
|
+
}
|
|
126
|
+
interface KanbanDeletionRequest {
|
|
127
|
+
operationId: string;
|
|
128
|
+
version: string;
|
|
129
|
+
expectedRevision: number;
|
|
130
|
+
cleanup: boolean;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
type KanbanSessionPhase = 'running' | 'queued' | 'waiting' | 'waiting-input' | 'waiting-approval' | 'paused' | 'idle' | 'completed' | 'failed' | 'cancelled' | 'unknown';
|
|
134
|
+
interface KanbanExecutionSession {
|
|
135
|
+
sessionId: string;
|
|
136
|
+
resourceId?: string;
|
|
137
|
+
title?: string;
|
|
138
|
+
state: KanbanSessionPhase;
|
|
139
|
+
createdAt?: number;
|
|
140
|
+
lastActivityAt?: number;
|
|
141
|
+
observedAt?: number;
|
|
142
|
+
stale: boolean;
|
|
143
|
+
recent: boolean;
|
|
144
|
+
code?: string;
|
|
145
|
+
}
|
|
146
|
+
interface KanbanSessionActivityQuery extends KanbanItemQuery {
|
|
147
|
+
execution?: 'all' | 'running' | 'recent' | 'active';
|
|
148
|
+
}
|
|
149
|
+
interface KanbanSessionItemSummary extends KanbanItemSummary {
|
|
150
|
+
execution?: KanbanExecutionSession;
|
|
151
|
+
}
|
|
152
|
+
interface KanbanSessionItemPage extends Omit<KanbanItemPage, 'items'> {
|
|
153
|
+
items: KanbanSessionItemSummary[];
|
|
154
|
+
}
|
|
155
|
+
type KanbanSessionPurpose = 'execution' | 'planning' | 'fix' | 'finalization' | 'discussion';
|
|
156
|
+
/** A run belongs to a Session; continuing it does not create another Session. */
|
|
157
|
+
interface KanbanSessionExecution {
|
|
158
|
+
id: string;
|
|
159
|
+
purpose: KanbanSessionPurpose;
|
|
160
|
+
dispatchId?: string;
|
|
161
|
+
attempt?: number;
|
|
162
|
+
previousDispatchId?: string;
|
|
163
|
+
roundId?: string;
|
|
164
|
+
turnId?: string;
|
|
165
|
+
state?: KanbanSessionPhase;
|
|
166
|
+
outcome?: KanbanDispatch['outcome'];
|
|
167
|
+
createdAt?: number;
|
|
168
|
+
completedAt?: number;
|
|
169
|
+
code?: string;
|
|
170
|
+
resources?: Array<{
|
|
171
|
+
label: string;
|
|
172
|
+
value: string;
|
|
173
|
+
}>;
|
|
174
|
+
}
|
|
175
|
+
interface KanbanSessionAssociation {
|
|
176
|
+
sessionId: string;
|
|
177
|
+
purpose: KanbanSessionPurpose;
|
|
178
|
+
execution?: KanbanSessionExecution;
|
|
179
|
+
}
|
|
180
|
+
interface KanbanRelatedSession extends KanbanExecutionSession {
|
|
181
|
+
current: boolean;
|
|
182
|
+
purposes: KanbanSessionPurpose[];
|
|
183
|
+
executions: KanbanSessionExecution[];
|
|
184
|
+
}
|
|
185
|
+
interface KanbanSessionDetailQuery {
|
|
186
|
+
includeRelated?: boolean;
|
|
187
|
+
}
|
|
188
|
+
interface KanbanExecutionSessionDetail {
|
|
189
|
+
continuation?: {
|
|
190
|
+
previousDispatchId: string;
|
|
191
|
+
};
|
|
192
|
+
current?: KanbanExecutionSession;
|
|
193
|
+
history: Array<{
|
|
194
|
+
sessionId: string;
|
|
195
|
+
bindingId?: string;
|
|
196
|
+
current: boolean;
|
|
197
|
+
}>;
|
|
198
|
+
/** Loaded explicitly so activity polling never enumerates historical Sessions. */
|
|
199
|
+
sessions?: KanbanRelatedSession[];
|
|
200
|
+
sessionsCode?: string;
|
|
201
|
+
}
|
|
202
|
+
/** Transport-facing service with optional authorized resource activity. */
|
|
203
|
+
interface KanbanClient extends KanbanService {
|
|
204
|
+
previewDeletion?(boardId: string): Promise<KanbanDeletionPreview>;
|
|
205
|
+
deleteBoard?(boardId: string, request: KanbanDeletionRequest): Promise<void>;
|
|
206
|
+
itemOperations?(boardId: string, itemId: string): Promise<KanbanItemOperations>;
|
|
207
|
+
runItemOperation?(boardId: string, request: KanbanItemOperationRequest): Promise<KanbanItemOperations>;
|
|
208
|
+
bindItemOperation?(boardId: string, request: KanbanItemOperationBinding): Promise<KanbanItemOperations>;
|
|
209
|
+
workResources?(boardId: string, itemId: string, query?: KanbanWorkResourceQuery): Promise<KanbanWorkResource[]>;
|
|
210
|
+
cleanupWorkResource?(boardId: string, request: KanbanWorkResourceCleanup): Promise<KanbanWorkResource>;
|
|
211
|
+
replyTask?(boardId: string, request: {
|
|
212
|
+
itemId: string;
|
|
213
|
+
attemptId: string;
|
|
214
|
+
replyTo: string;
|
|
215
|
+
operationId: string;
|
|
216
|
+
content: string;
|
|
217
|
+
}): Promise<void>;
|
|
218
|
+
fixTask?(boardId: string, request: {
|
|
219
|
+
itemId: string;
|
|
220
|
+
operationId: string;
|
|
221
|
+
}): Promise<KanbanFixSession>;
|
|
222
|
+
itemResources?(boardId: string, parentId?: string): Promise<KanbanItemResourceCatalog>;
|
|
223
|
+
recordResources?(): Promise<KanbanRecordResource[]>;
|
|
224
|
+
runRecord?(boardId: string, request: KanbanRecordRunRequest): Promise<KanbanRecordExecution>;
|
|
225
|
+
recordExecutions?(boardId: string, recordId: string): Promise<KanbanRecordExecution[]>;
|
|
226
|
+
automationCatalog?(): Promise<KanbanAutomationCatalog>;
|
|
227
|
+
analysisStatus?(boardId: string, itemId: string): Promise<KanbanAnalysisStatus | null>;
|
|
228
|
+
queryActivity?(boardId: string, query?: KanbanSessionActivityQuery): Promise<KanbanSessionItemPage>;
|
|
229
|
+
executionSession?(boardId: string, itemId: string, query?: KanbanSessionDetailQuery): Promise<KanbanExecutionSessionDetail>;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export type { KanbanClient as K, KanbanDeletionPreview as a, KanbanDeletionRequest as b, KanbanExecutionSession as c, KanbanExecutionSessionDetail as d, KanbanItemOperation as e, KanbanItemOperationBinding as f, KanbanItemOperationRequest as g, KanbanItemOperations as h, KanbanItemResourceCatalog as i, KanbanOperationChoice as j, KanbanOperationField as k, KanbanRecordExecution as l, KanbanRecordResource as m, KanbanRecordRunRequest as n, KanbanRelatedSession as o, KanbanSessionActivityQuery as p, KanbanSessionAssociation as q, KanbanSessionDetailQuery as r, KanbanSessionExecution as s, KanbanSessionItemPage as t, KanbanSessionItemSummary as u, KanbanSessionPhase as v, KanbanSessionPurpose as w, KanbanWorkResource as x, KanbanWorkResourceCleanup as y, KanbanWorkResourceQuery as z };
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { u as KanbanExternalReference, y as KanbanItemQuery, x as KanbanItemPage, z as KanbanItemSummary, r as KanbanDispatch, T as KanbanService, v as KanbanFixSession, f as KanbanAutomationCatalog, b as KanbanAnalysisStatus } from './planning-CcFZYdIL.js';
|
|
2
|
+
|
|
3
|
+
/** Hosts resolve opaque resources and execute records; the library owns no project policy. */
|
|
4
|
+
interface KanbanRecordResource {
|
|
5
|
+
reference: KanbanExternalReference;
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
interface KanbanItemResourceCatalog {
|
|
9
|
+
resources: KanbanRecordResource[];
|
|
10
|
+
selected?: KanbanExternalReference;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
readonly?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface KanbanRecordExecution {
|
|
15
|
+
id: string;
|
|
16
|
+
recordId: string;
|
|
17
|
+
recordRevision: number;
|
|
18
|
+
boardId: string;
|
|
19
|
+
rootItemId?: string;
|
|
20
|
+
itemIds?: string[];
|
|
21
|
+
state: 'preparing' | 'running' | 'blocked' | 'review' | 'completed' | 'failed';
|
|
22
|
+
createdAt: number;
|
|
23
|
+
updatedAt: number;
|
|
24
|
+
code?: string;
|
|
25
|
+
}
|
|
26
|
+
interface KanbanRecordRunRequest {
|
|
27
|
+
operationId: string;
|
|
28
|
+
recordId: string;
|
|
29
|
+
expectedRevision: number;
|
|
30
|
+
placement?: 'current-board' | 'new-board';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Host-owned execution resources; the coordination library does not interpret their backend. */
|
|
34
|
+
interface KanbanWorkResource {
|
|
35
|
+
id: string;
|
|
36
|
+
kind: string;
|
|
37
|
+
title: string;
|
|
38
|
+
location: string;
|
|
39
|
+
version: string;
|
|
40
|
+
state: 'associated' | 'in-use' | 'retained' | 'cleanup-ready' | 'cleaned' | 'unknown';
|
|
41
|
+
reasons: string[];
|
|
42
|
+
properties: Array<{
|
|
43
|
+
label: string;
|
|
44
|
+
value: string;
|
|
45
|
+
}>;
|
|
46
|
+
canCleanup: boolean;
|
|
47
|
+
}
|
|
48
|
+
interface KanbanWorkResourceQuery {
|
|
49
|
+
inspect?: boolean;
|
|
50
|
+
}
|
|
51
|
+
interface KanbanWorkResourceCleanup {
|
|
52
|
+
operationId: string;
|
|
53
|
+
itemId: string;
|
|
54
|
+
resourceId: string;
|
|
55
|
+
version: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface KanbanOperationChoice {
|
|
59
|
+
id: string;
|
|
60
|
+
label: string;
|
|
61
|
+
detail?: string;
|
|
62
|
+
}
|
|
63
|
+
interface KanbanOperationField {
|
|
64
|
+
id: string;
|
|
65
|
+
label: string;
|
|
66
|
+
choices: KanbanOperationChoice[];
|
|
67
|
+
selected?: string;
|
|
68
|
+
}
|
|
69
|
+
/** Host-owned operations; the portable view does not interpret deployment or Git policy. */
|
|
70
|
+
interface KanbanItemOperation {
|
|
71
|
+
id: string;
|
|
72
|
+
label: string;
|
|
73
|
+
state: 'unavailable' | 'ready' | 'running' | 'unknown' | 'succeeded' | 'failed' | 'waiting-confirmation';
|
|
74
|
+
enabled: boolean;
|
|
75
|
+
code?: string;
|
|
76
|
+
reason?: string;
|
|
77
|
+
runId?: string;
|
|
78
|
+
sessionId?: string;
|
|
79
|
+
summary?: string;
|
|
80
|
+
fields?: KanbanOperationField[];
|
|
81
|
+
confirmation?: string;
|
|
82
|
+
configurable?: boolean;
|
|
83
|
+
binding?: KanbanExternalReference;
|
|
84
|
+
openSessionOnRun?: boolean;
|
|
85
|
+
}
|
|
86
|
+
interface KanbanItemOperations {
|
|
87
|
+
revision: string;
|
|
88
|
+
operations: KanbanItemOperation[];
|
|
89
|
+
targets?: Array<{
|
|
90
|
+
label: string;
|
|
91
|
+
reference: KanbanExternalReference;
|
|
92
|
+
}>;
|
|
93
|
+
}
|
|
94
|
+
interface KanbanItemOperationRequest {
|
|
95
|
+
operationId: string;
|
|
96
|
+
itemId: string;
|
|
97
|
+
action: string;
|
|
98
|
+
expectedRevision: string;
|
|
99
|
+
selections?: Record<string, string>;
|
|
100
|
+
confirmed?: boolean;
|
|
101
|
+
}
|
|
102
|
+
interface KanbanItemOperationBinding {
|
|
103
|
+
operationId: string;
|
|
104
|
+
itemId: string;
|
|
105
|
+
action: string;
|
|
106
|
+
expectedRevision: string;
|
|
107
|
+
target: KanbanExternalReference;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
interface KanbanDeletionPreview {
|
|
111
|
+
boardId: string;
|
|
112
|
+
title: string;
|
|
113
|
+
revision: number;
|
|
114
|
+
version: string;
|
|
115
|
+
blockers: Array<{
|
|
116
|
+
code: string;
|
|
117
|
+
itemId?: string;
|
|
118
|
+
sessionId?: string;
|
|
119
|
+
}>;
|
|
120
|
+
pendingItems: number;
|
|
121
|
+
resources: Array<{
|
|
122
|
+
itemId: string;
|
|
123
|
+
resource: KanbanWorkResource;
|
|
124
|
+
}>;
|
|
125
|
+
}
|
|
126
|
+
interface KanbanDeletionRequest {
|
|
127
|
+
operationId: string;
|
|
128
|
+
version: string;
|
|
129
|
+
expectedRevision: number;
|
|
130
|
+
cleanup: boolean;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
type KanbanSessionPhase = 'running' | 'queued' | 'waiting' | 'waiting-input' | 'waiting-approval' | 'paused' | 'idle' | 'completed' | 'failed' | 'cancelled' | 'unknown';
|
|
134
|
+
interface KanbanExecutionSession {
|
|
135
|
+
sessionId: string;
|
|
136
|
+
resourceId?: string;
|
|
137
|
+
title?: string;
|
|
138
|
+
state: KanbanSessionPhase;
|
|
139
|
+
createdAt?: number;
|
|
140
|
+
lastActivityAt?: number;
|
|
141
|
+
observedAt?: number;
|
|
142
|
+
stale: boolean;
|
|
143
|
+
recent: boolean;
|
|
144
|
+
code?: string;
|
|
145
|
+
}
|
|
146
|
+
interface KanbanSessionActivityQuery extends KanbanItemQuery {
|
|
147
|
+
execution?: 'all' | 'running' | 'recent' | 'active';
|
|
148
|
+
}
|
|
149
|
+
interface KanbanSessionItemSummary extends KanbanItemSummary {
|
|
150
|
+
execution?: KanbanExecutionSession;
|
|
151
|
+
}
|
|
152
|
+
interface KanbanSessionItemPage extends Omit<KanbanItemPage, 'items'> {
|
|
153
|
+
items: KanbanSessionItemSummary[];
|
|
154
|
+
}
|
|
155
|
+
type KanbanSessionPurpose = 'execution' | 'planning' | 'fix' | 'finalization' | 'discussion';
|
|
156
|
+
/** A run belongs to a Session; continuing it does not create another Session. */
|
|
157
|
+
interface KanbanSessionExecution {
|
|
158
|
+
id: string;
|
|
159
|
+
purpose: KanbanSessionPurpose;
|
|
160
|
+
dispatchId?: string;
|
|
161
|
+
attempt?: number;
|
|
162
|
+
previousDispatchId?: string;
|
|
163
|
+
roundId?: string;
|
|
164
|
+
turnId?: string;
|
|
165
|
+
state?: KanbanSessionPhase;
|
|
166
|
+
outcome?: KanbanDispatch['outcome'];
|
|
167
|
+
createdAt?: number;
|
|
168
|
+
completedAt?: number;
|
|
169
|
+
code?: string;
|
|
170
|
+
resources?: Array<{
|
|
171
|
+
label: string;
|
|
172
|
+
value: string;
|
|
173
|
+
}>;
|
|
174
|
+
}
|
|
175
|
+
interface KanbanSessionAssociation {
|
|
176
|
+
sessionId: string;
|
|
177
|
+
purpose: KanbanSessionPurpose;
|
|
178
|
+
execution?: KanbanSessionExecution;
|
|
179
|
+
}
|
|
180
|
+
interface KanbanRelatedSession extends KanbanExecutionSession {
|
|
181
|
+
current: boolean;
|
|
182
|
+
purposes: KanbanSessionPurpose[];
|
|
183
|
+
executions: KanbanSessionExecution[];
|
|
184
|
+
}
|
|
185
|
+
interface KanbanSessionDetailQuery {
|
|
186
|
+
includeRelated?: boolean;
|
|
187
|
+
}
|
|
188
|
+
interface KanbanExecutionSessionDetail {
|
|
189
|
+
continuation?: {
|
|
190
|
+
previousDispatchId: string;
|
|
191
|
+
};
|
|
192
|
+
current?: KanbanExecutionSession;
|
|
193
|
+
history: Array<{
|
|
194
|
+
sessionId: string;
|
|
195
|
+
bindingId?: string;
|
|
196
|
+
current: boolean;
|
|
197
|
+
}>;
|
|
198
|
+
/** Loaded explicitly so activity polling never enumerates historical Sessions. */
|
|
199
|
+
sessions?: KanbanRelatedSession[];
|
|
200
|
+
sessionsCode?: string;
|
|
201
|
+
}
|
|
202
|
+
/** Transport-facing service with optional authorized resource activity. */
|
|
203
|
+
interface KanbanClient extends KanbanService {
|
|
204
|
+
previewDeletion?(boardId: string): Promise<KanbanDeletionPreview>;
|
|
205
|
+
deleteBoard?(boardId: string, request: KanbanDeletionRequest): Promise<void>;
|
|
206
|
+
itemOperations?(boardId: string, itemId: string): Promise<KanbanItemOperations>;
|
|
207
|
+
runItemOperation?(boardId: string, request: KanbanItemOperationRequest): Promise<KanbanItemOperations>;
|
|
208
|
+
bindItemOperation?(boardId: string, request: KanbanItemOperationBinding): Promise<KanbanItemOperations>;
|
|
209
|
+
workResources?(boardId: string, itemId: string, query?: KanbanWorkResourceQuery): Promise<KanbanWorkResource[]>;
|
|
210
|
+
cleanupWorkResource?(boardId: string, request: KanbanWorkResourceCleanup): Promise<KanbanWorkResource>;
|
|
211
|
+
replyTask?(boardId: string, request: {
|
|
212
|
+
itemId: string;
|
|
213
|
+
attemptId: string;
|
|
214
|
+
replyTo: string;
|
|
215
|
+
operationId: string;
|
|
216
|
+
content: string;
|
|
217
|
+
}): Promise<void>;
|
|
218
|
+
fixTask?(boardId: string, request: {
|
|
219
|
+
itemId: string;
|
|
220
|
+
operationId: string;
|
|
221
|
+
}): Promise<KanbanFixSession>;
|
|
222
|
+
itemResources?(boardId: string, parentId?: string): Promise<KanbanItemResourceCatalog>;
|
|
223
|
+
recordResources?(): Promise<KanbanRecordResource[]>;
|
|
224
|
+
runRecord?(boardId: string, request: KanbanRecordRunRequest): Promise<KanbanRecordExecution>;
|
|
225
|
+
recordExecutions?(boardId: string, recordId: string): Promise<KanbanRecordExecution[]>;
|
|
226
|
+
automationCatalog?(): Promise<KanbanAutomationCatalog>;
|
|
227
|
+
analysisStatus?(boardId: string, itemId: string): Promise<KanbanAnalysisStatus | null>;
|
|
228
|
+
queryActivity?(boardId: string, query?: KanbanSessionActivityQuery): Promise<KanbanSessionItemPage>;
|
|
229
|
+
executionSession?(boardId: string, itemId: string, query?: KanbanSessionDetailQuery): Promise<KanbanExecutionSessionDetail>;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export type { KanbanClient as K, KanbanDeletionPreview as a, KanbanDeletionRequest as b, KanbanExecutionSession as c, KanbanExecutionSessionDetail as d, KanbanItemOperation as e, KanbanItemOperationBinding as f, KanbanItemOperationRequest as g, KanbanItemOperations as h, KanbanItemResourceCatalog as i, KanbanOperationChoice as j, KanbanOperationField as k, KanbanRecordExecution as l, KanbanRecordResource as m, KanbanRecordRunRequest as n, KanbanRelatedSession as o, KanbanSessionActivityQuery as p, KanbanSessionAssociation as q, KanbanSessionDetailQuery as r, KanbanSessionExecution as s, KanbanSessionItemPage as t, KanbanSessionItemSummary as u, KanbanSessionPhase as v, KanbanSessionPurpose as w, KanbanWorkResource as x, KanbanWorkResourceCleanup as y, KanbanWorkResourceQuery as z };
|