@deepseek-ai/dsh-workspace 0.0.1-rc.2 → 0.0.1-rc.3
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.i18n.yaml +2 -2
- package/README.md +8 -7
- package/README.zh.md +8 -7
- package/lib/index.js +43 -3
- package/lib/invariant.js +4 -4
- package/lib/types/index.d.ts +18 -2
- package/lib/types/index.js +40 -2
- package/lib/types/invariant.js +4 -4
- package/package.json +15 -15
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/workspace/workspace/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: c1c4309efdc85f4bc7a6b0f128df6d9f4f810ae1
|
|
6
|
+
README.zh.md: f44ad04be0c63061200a256c5ce8cb24a4d3c54b
|
package/README.md
CHANGED
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
English | [中文](README.zh.md)
|
|
4
4
|
|
|
5
|
-
Workspace entity registry (`ctx.
|
|
5
|
+
Workspace entity registry (`ctx.workspaceRegistry`) for the DeepSeek Harness: durable workspace records, stable workspace order, and a newest-first candidate session index stored through the domain data form. Consumers see the `Workspace` interface; the entity implementation stays package-private.
|
|
6
6
|
|
|
7
7
|
The entity/storage rationale lives in the [domain Agent Note](../../../.agents/notes/proposed/architecture/2026-07-24-domain-kv-storage-and-workspace.md); header-only bootstrap and GUI ordering live in the [Workspace UI product-flow Agent Note](../../../.agents/notes/implemented/feature/2026-07-25-workspace-ui-product-flow.md).
|
|
8
8
|
|
|
9
9
|
## Shape
|
|
10
10
|
|
|
11
|
-
- `ctx.
|
|
12
|
-
- `ctx.
|
|
13
|
-
- `ctx.
|
|
11
|
+
- `ctx.workspaceRegistry.create(path, title?)` — canonicalizes `path` via `fs.realpath`, rejects a nonexistent or non-directory path, creates at most one record per canonical path, and prepends a new record to durable workspace order. Repeated calls for that path return the existing workspace without changing its title; different paths may share a display title.
|
|
12
|
+
- `ctx.workspaceRegistry.get(id)` / `list()` / `resolveByPath(path)` — cache-served lookups. `list()` is synchronous and follows durable registry order; `resolveByPath` is async because it applies the same `realpath` canon and rejects a missing path rather than creating it.
|
|
13
|
+
- `ctx.workspaceRegistry.insertBefore(id, before?)` — moves a registered Workspace within durable registry order, DOM-insertBefore-like: before the anchor, or appended when the anchor is omitted. A source or anchor absent from the registry rejects without writing; a self-anchor or move to the current position resolves without writing. The returned id list is the complete committed order.
|
|
14
|
+
- `ctx.workspaceRegistry.delete(id)` — removes only the Workspace registration, its durable order entry, and its session account. Unknown ids return `false`; a removed record returns `true`. The directory, user files, live Sessions, and persisted session logs are never touched, so those Sessions become Ungrouped. A table-write failure restores the prior order and published entity.
|
|
14
15
|
- `Workspace.attachSession(id)` — validates a live or persisted session header cwd against the workspace path and prepends a new id. Unknown sessions, absent/unresolvable/non-directory cwd values, and mismatches reject without writing. `detachSession` removes only the candidate index entry.
|
|
15
|
-
- `Workspace.insertSessionBefore(id, before?)` — moves an accounted session within the manual order, DOM-insertBefore-like: before the anchor, or appended when the anchor is omitted. A session or anchor absent from the account rejects without writing; a move to the current position resolves without writing. Workspace order never changes.
|
|
16
|
-
- `ctx.
|
|
16
|
+
- `Workspace.insertSessionBefore(id, before?)` — moves an accounted session within the manual order, DOM-insertBefore-like: before the anchor, or appended when the anchor is omitted. A session or anchor absent from the account rejects without writing; a move to the current position resolves without writing. Registry Workspace order never changes.
|
|
17
|
+
- `ctx.workspaceRegistry.archiveSession(id)` / `archivedSessionIds` — the registry-global archive set, layered over workspace accounting: an archived session disappears from grouping surfaces but keeps its session log and its `sessionIds` slot, so a future unarchive restores its position. Archiving accepts any live or persisted session (accounted or Ungrouped), resolves without writing for an already archived id, and rejects an unknown id. State written before the field existed parses with an empty set.
|
|
17
18
|
- `Workspace.sessionIds` — synchronous id-plus-canonical-cwd membership projection in durable candidate order. Missing headers, invalid cwd values, and mismatches are filtered; the next workspace mutation prunes them. A medium indexing one session under two workspaces, claiming one path from two records, or diverging from durable workspace order rejects at startup.
|
|
18
19
|
- `Workspace.status()` — uncached directory check, `'ok' | 'missing-dir'`; a missing directory never mutates the record.
|
|
19
20
|
|
|
@@ -27,7 +28,7 @@ Create and delete persist an explicit pending-mutation marker before their recor
|
|
|
27
28
|
|
|
28
29
|
#### What the model sees
|
|
29
30
|
|
|
30
|
-
Nothing. `ctx.
|
|
31
|
+
Nothing. `ctx.workspaceRegistry` serves workspace records to host-side consumers only: the package registers no tools, injects no prompts, and writes no session events, so no request field ever carries this package's data.
|
|
31
32
|
|
|
32
33
|
#### Token effect
|
|
33
34
|
|
package/README.zh.md
CHANGED
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md) | 中文
|
|
4
4
|
|
|
5
|
-
DeepSeek Harness 的 Workspace 实体注册表(`ctx.
|
|
5
|
+
DeepSeek Harness 的 Workspace 实体注册表(`ctx.workspaceRegistry`):通过领域数据形式存储持久 workspace 记录、稳定 workspace 顺序和按新到旧排列的候选会话索引。消费方看到 `Workspace` 接口;实体实现保持包私有。
|
|
6
6
|
|
|
7
7
|
实体/存储理由见[领域 Agent Note](../../../.agents/notes/proposed/architecture/2026-07-24-domain-kv-storage-and-workspace.md);仅使用头部的引导初始化和 GUI 排序见 [Workspace UI 产品流 Agent Note](../../../.agents/notes/implemented/feature/2026-07-25-workspace-ui-product-flow.md)。
|
|
8
8
|
|
|
9
9
|
## 结构
|
|
10
10
|
|
|
11
|
-
- `ctx.
|
|
12
|
-
- `ctx.
|
|
13
|
-
- `ctx.
|
|
11
|
+
- `ctx.workspaceRegistry.create(path, title?)`:规范化 `path` 时使用 `fs.realpath`,拒绝不存在或非目录的路径,每个规范路径最多创建一条记录,并将新记录前置到持久 workspace 顺序。对同一路径重复调用会返回现有 workspace,且不改变其标题;不同路径可以共用显示标题。
|
|
12
|
+
- `ctx.workspaceRegistry.get(id)`/`list()`/`resolveByPath(path)`:由缓存提供的查找。`list()` 为同步操作,并遵循持久注册表顺序;`resolveByPath` 为异步操作,因为它采用相同的 `realpath` 规范化方式,并会拒绝缺失路径,而不是创建路径。
|
|
13
|
+
- `ctx.workspaceRegistry.insertBefore(id, before?)`:在持久注册表顺序内移动一个已注册 Workspace,语义类似 DOM 的 insertBefore:插到锚点之前,省略锚点则追加到末尾。来源或锚点不在注册表中时拒绝且不写入;以自身为锚点或移动到当前位置时直接完成且不写入。返回的 id 列表是完整的已提交顺序。
|
|
14
|
+
- `ctx.workspaceRegistry.delete(id)`:只移除 Workspace 注册记录、对应的持久顺序条目及会话归属记录。未知 id 返回 `false`,成功移除记录则返回 `true`。目录、用户文件、活跃会话和持久化会话日志绝不受影响,因此相关会话会进入 Ungrouped。表写入失败时会恢复原顺序和此前发布的实体。
|
|
14
15
|
- `Workspace.attachSession(id)`:对照 workspace 路径验证实时或已持久化的会话头 cwd,并将新 id 前置。未知会话、缺失/无法解析/非目录的 cwd 值和不匹配情况都会在不写入的前提下被拒绝。`detachSession` 只移除候选索引条目。
|
|
15
|
-
- `Workspace.insertSessionBefore(id, before?)`:在手动顺序内移动一个已记账的会话,语义类似 DOM 的 insertBefore
|
|
16
|
-
- `ctx.
|
|
16
|
+
- `Workspace.insertSessionBefore(id, before?)`:在手动顺序内移动一个已记账的会话,语义类似 DOM 的 insertBefore:插到锚点之前,省略锚点则追加到末尾。会话或锚点不在记账中时拒绝且不写入;移动到当前位置时直接完成且不写入。注册表中的 Workspace 顺序绝不改变。
|
|
17
|
+
- `ctx.workspaceRegistry.archiveSession(id)`/`archivedSessionIds`:覆盖在 workspace 记账之上的注册表级全局归档集合:被归档的会话从各分组视图中消失,但其会话日志和 `sessionIds` 席位保持不变,未来取消归档时可恢复原位置。归档接受任何实时或已持久化的会话(无论已记账还是 Ungrouped),对已归档的 id 直接完成而不写入,并拒绝未知 id。在该字段出现之前写入的状态解析为一个空集合。
|
|
17
18
|
- `Workspace.sessionIds`:按持久候选顺序提供同步 id 加规范 cwd 成员投影。缺失头部、无效 cwd 值和不匹配情况都被过滤;下一次 workspace 变更会剪除它们。如果同一存储介质将一个会话索引到两个 workspace 下、用两条记录声明同一路径,或偏离持久 workspace 顺序,启动会被拒绝。
|
|
18
19
|
- `Workspace.status()`:未缓存的目录检查,返回 `'ok' | 'missing-dir'`;目录缺失绝不会改动记录。
|
|
19
20
|
|
|
@@ -27,7 +28,7 @@ DeepSeek Harness 的 Workspace 实体注册表(`ctx.workspace`):通过领
|
|
|
27
28
|
|
|
28
29
|
#### 模型看到的内容
|
|
29
30
|
|
|
30
|
-
没有。`ctx.
|
|
31
|
+
没有。`ctx.workspaceRegistry` 只向宿主侧消费方提供 workspace 记录:此包不注册工具、不注入提示词、不写入会话事件,因此没有请求字段会携带此包数据。
|
|
31
32
|
|
|
32
33
|
#### Token 影响
|
|
33
34
|
|
package/lib/index.js
CHANGED
|
@@ -237,7 +237,7 @@ const workspaceDomainSpec = defineDomain({
|
|
|
237
237
|
//#endregion
|
|
238
238
|
//#region lib/types/index.js
|
|
239
239
|
/**
|
|
240
|
-
* Workspace entity registry (`ctx.
|
|
240
|
+
* Workspace entity registry (`ctx.workspaceRegistry`): durable workspace records,
|
|
241
241
|
* stable registry order, and header-validated session membership over the
|
|
242
242
|
* domain data form.
|
|
243
243
|
* @module @deepseek-ai/dsh-workspace
|
|
@@ -265,6 +265,18 @@ var WorkspaceUnknownSessionError = class extends Error {
|
|
|
265
265
|
this.name = "WorkspaceUnknownSessionError";
|
|
266
266
|
}
|
|
267
267
|
};
|
|
268
|
+
/** A workspace reorder named a source or anchor absent from the durable registry order. */
|
|
269
|
+
var WorkspaceOrderInvalidError = class extends Error {
|
|
270
|
+
workspaceId;
|
|
271
|
+
/**
|
|
272
|
+
* @param workspaceId - Missing source or anchor id.
|
|
273
|
+
*/
|
|
274
|
+
constructor(workspaceId) {
|
|
275
|
+
super(`cannot reorder unknown workspace '${workspaceId}'`);
|
|
276
|
+
this.workspaceId = workspaceId;
|
|
277
|
+
this.name = "WorkspaceOrderInvalidError";
|
|
278
|
+
}
|
|
279
|
+
};
|
|
268
280
|
const sameIds = (left, right) => left.length === right.length && left.every((id, index) => id === right[index]);
|
|
269
281
|
const compareHeaders = (left, right) => right.createdAt - left.createdAt || String(left.id).localeCompare(String(right.id));
|
|
270
282
|
/**
|
|
@@ -294,7 +306,7 @@ var WorkspaceRegistry = class extends Service {
|
|
|
294
306
|
}
|
|
295
307
|
};
|
|
296
308
|
constructor(ctx) {
|
|
297
|
-
super(ctx, "
|
|
309
|
+
super(ctx, "workspaceRegistry");
|
|
298
310
|
}
|
|
299
311
|
/** Open the domain, finish bootstrap when required, and rebuild the ordered cache. */
|
|
300
312
|
async [Service.init]() {
|
|
@@ -364,6 +376,34 @@ var WorkspaceRegistry = class extends Service {
|
|
|
364
376
|
return this.enqueueOperation(() => this.deleteKnown(id));
|
|
365
377
|
}
|
|
366
378
|
/**
|
|
379
|
+
* Move one workspace within the durable display order, DOM-insertBefore-like.
|
|
380
|
+
* With an anchor it lands before that workspace; without one it appends.
|
|
381
|
+
* @param id - Workspace to move.
|
|
382
|
+
* @param beforeId - Workspace anchor; omitted appends.
|
|
383
|
+
* @returns the complete committed workspace order.
|
|
384
|
+
*/
|
|
385
|
+
insertBefore(id, beforeId) {
|
|
386
|
+
return this.enqueueOperation(async () => {
|
|
387
|
+
const state = this.requireState();
|
|
388
|
+
if (!state.workspaceIds.includes(id)) throw new WorkspaceOrderInvalidError(id);
|
|
389
|
+
if (beforeId !== void 0 && !state.workspaceIds.includes(beforeId)) throw new WorkspaceOrderInvalidError(beforeId);
|
|
390
|
+
if (beforeId === id) return state.workspaceIds;
|
|
391
|
+
const without = state.workspaceIds.filter((workspaceId) => workspaceId !== id);
|
|
392
|
+
const at = beforeId === void 0 ? without.length : without.indexOf(beforeId);
|
|
393
|
+
const workspaceIds = [
|
|
394
|
+
...without.slice(0, at),
|
|
395
|
+
id,
|
|
396
|
+
...without.slice(at)
|
|
397
|
+
];
|
|
398
|
+
if (sameIds(workspaceIds, state.workspaceIds)) return state.workspaceIds;
|
|
399
|
+
await this.setState({
|
|
400
|
+
...state,
|
|
401
|
+
workspaceIds
|
|
402
|
+
});
|
|
403
|
+
return workspaceIds;
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
367
407
|
* The registry-global archive set: sessions hidden from every grouping
|
|
368
408
|
* surface. Archiving never touches workspace accounting — an archived
|
|
369
409
|
* session keeps its `sessionIds` slot so unarchiving restores its position.
|
|
@@ -714,4 +754,4 @@ var WorkspaceRegistry = class extends Service {
|
|
|
714
754
|
};
|
|
715
755
|
const sameSessionIds = (left, right) => left.length === right.length && left.every((id, index) => id === right[index]);
|
|
716
756
|
//#endregion
|
|
717
|
-
export { WorkspaceId, WorkspaceMoveInvalidError, WorkspaceRegistry, WorkspaceRegistry as default, WorkspaceUnknownSessionError, realpathNormalize, workspaceDomainSpec, workspaceDomainState, workspaceRecord };
|
|
757
|
+
export { WorkspaceId, WorkspaceMoveInvalidError, WorkspaceOrderInvalidError, WorkspaceRegistry, WorkspaceRegistry as default, WorkspaceUnknownSessionError, realpathNormalize, workspaceDomainSpec, workspaceDomainState, workspaceRecord };
|
package/lib/invariant.js
CHANGED
|
@@ -60,7 +60,7 @@ defineDomain({
|
|
|
60
60
|
//#endregion
|
|
61
61
|
//#region src/index.ts
|
|
62
62
|
/**
|
|
63
|
-
* Workspace entity registry (`ctx.
|
|
63
|
+
* Workspace entity registry (`ctx.workspaceRegistry`): durable workspace records,
|
|
64
64
|
* stable registry order, and header-validated session membership over the
|
|
65
65
|
* domain data form.
|
|
66
66
|
* @module @deepseek-ai/dsh-workspace
|
|
@@ -98,12 +98,12 @@ const install = Object.assign((ctx, fail) => {
|
|
|
98
98
|
ctx.on("domain/changed", (change) => {
|
|
99
99
|
if (change.domain !== "workspace" || change.table !== "workspaces") return;
|
|
100
100
|
if (change.operation === "deleted") {
|
|
101
|
-
if (ctx.
|
|
101
|
+
if (ctx.workspaceRegistry.get(WorkspaceId(change.key)) !== void 0) fail(`workspace record '${change.key}' was deleted while the registry cache still publishes it — some write path bypassed ctx.workspaceRegistry`);
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
|
-
if (ctx.
|
|
104
|
+
if (ctx.workspaceRegistry.get(WorkspaceId(change.key)) === void 0) fail(`workspace record '${change.key}' landed durably but the registry cache holds no entity for it — the cache and the domain table have diverged`);
|
|
105
105
|
});
|
|
106
|
-
}, { inject: ["
|
|
106
|
+
}, { inject: ["workspaceRegistry"] });
|
|
107
107
|
/**
|
|
108
108
|
* Register this package's invariant companion.
|
|
109
109
|
* @param ctx - Cordis context carrying the invariant service.
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Workspace entity registry (`ctx.
|
|
2
|
+
* Workspace entity registry (`ctx.workspaceRegistry`): durable workspace records,
|
|
3
3
|
* stable registry order, and header-validated session membership over the
|
|
4
4
|
* domain data form.
|
|
5
5
|
* @module @deepseek-ai/dsh-workspace
|
|
@@ -31,9 +31,17 @@ export declare class WorkspaceUnknownSessionError extends Error {
|
|
|
31
31
|
*/
|
|
32
32
|
constructor(sessionId: SessionId);
|
|
33
33
|
}
|
|
34
|
+
/** A workspace reorder named a source or anchor absent from the durable registry order. */
|
|
35
|
+
export declare class WorkspaceOrderInvalidError extends Error {
|
|
36
|
+
readonly workspaceId: WorkspaceId;
|
|
37
|
+
/**
|
|
38
|
+
* @param workspaceId - Missing source or anchor id.
|
|
39
|
+
*/
|
|
40
|
+
constructor(workspaceId: WorkspaceId);
|
|
41
|
+
}
|
|
34
42
|
declare module '@deepseek-ai/cordis' {
|
|
35
43
|
interface Context {
|
|
36
|
-
|
|
44
|
+
workspaceRegistry: WorkspaceRegistry;
|
|
37
45
|
}
|
|
38
46
|
}
|
|
39
47
|
/**
|
|
@@ -91,6 +99,14 @@ export declare class WorkspaceRegistry extends Service {
|
|
|
91
99
|
* @returns `true` when a record was deleted, `false` when it was unknown.
|
|
92
100
|
*/
|
|
93
101
|
delete(id: WorkspaceId): Promise<boolean>;
|
|
102
|
+
/**
|
|
103
|
+
* Move one workspace within the durable display order, DOM-insertBefore-like.
|
|
104
|
+
* With an anchor it lands before that workspace; without one it appends.
|
|
105
|
+
* @param id - Workspace to move.
|
|
106
|
+
* @param beforeId - Workspace anchor; omitted appends.
|
|
107
|
+
* @returns the complete committed workspace order.
|
|
108
|
+
*/
|
|
109
|
+
insertBefore(id: WorkspaceId, beforeId?: WorkspaceId): Promise<readonly WorkspaceId[]>;
|
|
94
110
|
/**
|
|
95
111
|
* The registry-global archive set: sessions hidden from every grouping
|
|
96
112
|
* surface. Archiving never touches workspace accounting — an archived
|
package/lib/types/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Workspace entity registry (`ctx.
|
|
2
|
+
* Workspace entity registry (`ctx.workspaceRegistry`): durable workspace records,
|
|
3
3
|
* stable registry order, and header-validated session membership over the
|
|
4
4
|
* domain data form.
|
|
5
5
|
* @module @deepseek-ai/dsh-workspace
|
|
@@ -37,6 +37,18 @@ export class WorkspaceUnknownSessionError extends Error {
|
|
|
37
37
|
this.name = 'WorkspaceUnknownSessionError';
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
+
/** A workspace reorder named a source or anchor absent from the durable registry order. */
|
|
41
|
+
export class WorkspaceOrderInvalidError extends Error {
|
|
42
|
+
workspaceId;
|
|
43
|
+
/**
|
|
44
|
+
* @param workspaceId - Missing source or anchor id.
|
|
45
|
+
*/
|
|
46
|
+
constructor(workspaceId) {
|
|
47
|
+
super(`cannot reorder unknown workspace '${workspaceId}'`);
|
|
48
|
+
this.workspaceId = workspaceId;
|
|
49
|
+
this.name = 'WorkspaceOrderInvalidError';
|
|
50
|
+
}
|
|
51
|
+
}
|
|
40
52
|
const sameIds = (left, right) => left.length === right.length && left.every((id, index) => id === right[index]);
|
|
41
53
|
const compareHeaders = (left, right) => right.createdAt - left.createdAt || String(left.id).localeCompare(String(right.id));
|
|
42
54
|
/**
|
|
@@ -66,7 +78,7 @@ export class WorkspaceRegistry extends Service {
|
|
|
66
78
|
},
|
|
67
79
|
};
|
|
68
80
|
constructor(ctx) {
|
|
69
|
-
super(ctx, '
|
|
81
|
+
super(ctx, 'workspaceRegistry');
|
|
70
82
|
}
|
|
71
83
|
/** Open the domain, finish bootstrap when required, and rebuild the ordered cache. */
|
|
72
84
|
async [Service.init]() {
|
|
@@ -147,6 +159,32 @@ export class WorkspaceRegistry extends Service {
|
|
|
147
159
|
delete(id) {
|
|
148
160
|
return this.enqueueOperation(() => this.deleteKnown(id));
|
|
149
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Move one workspace within the durable display order, DOM-insertBefore-like.
|
|
164
|
+
* With an anchor it lands before that workspace; without one it appends.
|
|
165
|
+
* @param id - Workspace to move.
|
|
166
|
+
* @param beforeId - Workspace anchor; omitted appends.
|
|
167
|
+
* @returns the complete committed workspace order.
|
|
168
|
+
*/
|
|
169
|
+
insertBefore(id, beforeId) {
|
|
170
|
+
return this.enqueueOperation(async () => {
|
|
171
|
+
const state = this.requireState();
|
|
172
|
+
if (!state.workspaceIds.includes(id))
|
|
173
|
+
throw new WorkspaceOrderInvalidError(id);
|
|
174
|
+
if (beforeId !== undefined && !state.workspaceIds.includes(beforeId)) {
|
|
175
|
+
throw new WorkspaceOrderInvalidError(beforeId);
|
|
176
|
+
}
|
|
177
|
+
if (beforeId === id)
|
|
178
|
+
return state.workspaceIds;
|
|
179
|
+
const without = state.workspaceIds.filter(workspaceId => workspaceId !== id);
|
|
180
|
+
const at = beforeId === undefined ? without.length : without.indexOf(beforeId);
|
|
181
|
+
const workspaceIds = [...without.slice(0, at), id, ...without.slice(at)];
|
|
182
|
+
if (sameIds(workspaceIds, state.workspaceIds))
|
|
183
|
+
return state.workspaceIds;
|
|
184
|
+
await this.setState({ ...state, workspaceIds });
|
|
185
|
+
return workspaceIds;
|
|
186
|
+
});
|
|
187
|
+
}
|
|
150
188
|
/**
|
|
151
189
|
* The registry-global archive set: sessions hidden from every grouping
|
|
152
190
|
* surface. Archiving never touches workspace accounting — an archived
|
package/lib/types/invariant.js
CHANGED
|
@@ -22,18 +22,18 @@ const install = Object.assign((ctx, fail) => {
|
|
|
22
22
|
if (change.domain !== 'workspace' || change.table !== 'workspaces')
|
|
23
23
|
return;
|
|
24
24
|
if (change.operation === 'deleted') {
|
|
25
|
-
if (ctx.
|
|
25
|
+
if (ctx.workspaceRegistry.get(WorkspaceId(change.key)) !== undefined) {
|
|
26
26
|
fail(`workspace record '${change.key}' was deleted while the registry cache still `
|
|
27
|
-
+ 'publishes it — some write path bypassed ctx.
|
|
27
|
+
+ 'publishes it — some write path bypassed ctx.workspaceRegistry');
|
|
28
28
|
}
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
if (ctx.
|
|
31
|
+
if (ctx.workspaceRegistry.get(WorkspaceId(change.key)) === undefined) {
|
|
32
32
|
fail(`workspace record '${change.key}' landed durably but the registry cache holds `
|
|
33
33
|
+ 'no entity for it — the cache and the domain table have diverged');
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
-
}, { inject: ['
|
|
36
|
+
}, { inject: ['workspaceRegistry'] });
|
|
37
37
|
/**
|
|
38
38
|
* Register this package's invariant companion.
|
|
39
39
|
* @param ctx - Cordis context carrying the invariant service.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-workspace",
|
|
3
|
-
"description": "Workspace entity registry (ctx.
|
|
4
|
-
"version": "0.0.1-rc.
|
|
3
|
+
"description": "Workspace entity registry (ctx.workspaceRegistry): durable workspace records with validated session attachment over the domain data form for the DeepSeek Harness",
|
|
4
|
+
"version": "0.0.1-rc.3",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "restricted"
|
|
7
7
|
},
|
|
@@ -37,24 +37,24 @@
|
|
|
37
37
|
],
|
|
38
38
|
"license": "BSD-3-Clause",
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@deepseek-ai/dsh-
|
|
41
|
-
"@deepseek-ai/dsh-
|
|
42
|
-
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.
|
|
43
|
-
"@deepseek-ai/dsh-session": "^0.0.1-rc.
|
|
44
|
-
"@deepseek-ai/dsh-
|
|
45
|
-
"@deepseek-ai/
|
|
46
|
-
"@deepseek-ai/
|
|
40
|
+
"@deepseek-ai/dsh-storage-domain": "^0.0.1-rc.3",
|
|
41
|
+
"@deepseek-ai/dsh-brand": "^0.0.1-rc.3",
|
|
42
|
+
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
|
|
43
|
+
"@deepseek-ai/dsh-session": "^0.0.1-rc.3",
|
|
44
|
+
"@deepseek-ai/dsh-storage": "^0.0.1-rc.3",
|
|
45
|
+
"@deepseek-ai/dsh-session-persistence": "^0.0.1-rc.3",
|
|
46
|
+
"@deepseek-ai/cordis": "^4.0.1-rc.1"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"zod": "^4.4.3"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@deepseek-ai/dsh-
|
|
53
|
-
"@deepseek-ai/dsh-
|
|
54
|
-
"@deepseek-ai/dsh-
|
|
55
|
-
"@deepseek-ai/dsh-session
|
|
56
|
-
"@deepseek-ai/dsh-
|
|
57
|
-
"@deepseek-ai/dsh-
|
|
52
|
+
"@deepseek-ai/dsh-brand": "^0.0.1-rc.3",
|
|
53
|
+
"@deepseek-ai/dsh-storage-domain": "^0.0.1-rc.3",
|
|
54
|
+
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
|
|
55
|
+
"@deepseek-ai/dsh-session": "^0.0.1-rc.3",
|
|
56
|
+
"@deepseek-ai/dsh-session-persistence": "^0.0.1-rc.3",
|
|
57
|
+
"@deepseek-ai/dsh-storage": "^0.0.1-rc.3",
|
|
58
58
|
"@deepseek-ai/cordis": "^4.0.1-rc.1"
|
|
59
59
|
}
|
|
60
60
|
}
|