@stackstackstack/dsh-goal 0.1.5
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/LICENSE +21 -0
- package/README.i18n.yaml +6 -0
- package/README.md +58 -0
- package/README.zh.md +58 -0
- package/lib/index.js +827 -0
- package/lib/invariant.js +332 -0
- package/lib/typert.host.d.ts +3 -0
- package/lib/typert.host.js +815 -0
- package/lib/typert.remote-client.d.ts +41 -0
- package/lib/typert.remote-client.js +366 -0
- package/lib/types/client.d.ts +10 -0
- package/lib/types/client.js +10 -0
- package/lib/types/domain.d.ts +92 -0
- package/lib/types/domain.js +10 -0
- package/lib/types/fold.d.ts +50 -0
- package/lib/types/fold.js +322 -0
- package/lib/types/index.d.ts +155 -0
- package/lib/types/index.js +495 -0
- package/lib/types/invariant.d.ts +13 -0
- package/lib/types/invariant.js +70 -0
- package/lib/types/runtime.d.ts +21 -0
- package/lib/types/runtime.js +25 -0
- package/lib/types/types.d.ts +96 -0
- package/lib/types/types.js +13 -0
- package/package.json +82 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure types of the goal domain: the ONE home of the `goal` projection-key
|
|
3
|
+
* declaration plus the durable payload vocabulary it carries, free of this
|
|
4
|
+
* package's host-side imports (cordis events, dsh-agent, dsh-llm, the
|
|
5
|
+
* service). Two namespace projections serve it — `./types` for host
|
|
6
|
+
* consumers, `./client` (the browser half-entry's re-export) for client
|
|
7
|
+
* aggregates — with zero content duplication. Host-coupled domain
|
|
8
|
+
* vocabulary (message sources, events, fold shapes) lives in ./domain.ts.
|
|
9
|
+
*
|
|
10
|
+
* @module @stackstackstack/dsh-goal/types
|
|
11
|
+
*/
|
|
12
|
+
import type { Branded } from '@stackstackstack/dsh-brand';
|
|
13
|
+
/** Identifies one goal across its durable revisions. */
|
|
14
|
+
export type GoalId = Branded<'GoalId'>;
|
|
15
|
+
/** Compare-and-set identity for one exact goal revision. */
|
|
16
|
+
export interface GoalRef {
|
|
17
|
+
/** Stable goal identity. */
|
|
18
|
+
readonly id: GoalId;
|
|
19
|
+
/** Positive revision; every durable mutation increments it. */
|
|
20
|
+
readonly revision: number;
|
|
21
|
+
}
|
|
22
|
+
/** Input whose omitted round cap is resolved by the service configuration. */
|
|
23
|
+
export interface CreateGoalRequest {
|
|
24
|
+
readonly objective: string;
|
|
25
|
+
readonly maxGoalRounds?: number;
|
|
26
|
+
}
|
|
27
|
+
/** Wire-safe acknowledgement of one created goal. */
|
|
28
|
+
export interface CreateGoalResult {
|
|
29
|
+
readonly ref: GoalRef;
|
|
30
|
+
}
|
|
31
|
+
/** Fields changed by an edit; at least one must be present. */
|
|
32
|
+
export interface EditGoalRequest {
|
|
33
|
+
readonly objective?: string;
|
|
34
|
+
readonly maxGoalRounds?: number;
|
|
35
|
+
}
|
|
36
|
+
/** Durable continuation phase. Activation is process-local and separate. */
|
|
37
|
+
export type GoalPhase = 'active' | 'paused' | 'blocked' | 'complete';
|
|
38
|
+
/** Machine-routable and human-readable explanation for a blocked goal. */
|
|
39
|
+
export interface GoalBlockReason {
|
|
40
|
+
/** Stable lower-kebab-case classification chosen by the blocking policy. */
|
|
41
|
+
readonly code: string;
|
|
42
|
+
/** Non-empty explanation shown to humans and models. */
|
|
43
|
+
readonly message: string;
|
|
44
|
+
}
|
|
45
|
+
/** Full durable state written by every non-clear goal mutation. */
|
|
46
|
+
export interface GoalSnapshot extends GoalRef {
|
|
47
|
+
/** Human-requested completion objective. */
|
|
48
|
+
readonly objective: string;
|
|
49
|
+
/** Durable lifecycle phase. */
|
|
50
|
+
readonly phase: GoalPhase;
|
|
51
|
+
/** Present exactly while `phase` is `blocked`. */
|
|
52
|
+
readonly blockedReason?: GoalBlockReason;
|
|
53
|
+
/** Total admitted goal-round cap. */
|
|
54
|
+
readonly maxGoalRounds: number;
|
|
55
|
+
}
|
|
56
|
+
/** Whether this live process may automatically continue an active goal. */
|
|
57
|
+
export type GoalActivation = 'armed' | 'disarmed';
|
|
58
|
+
/** Current goal projection, including values derived from the session log. */
|
|
59
|
+
export interface GoalView extends GoalSnapshot {
|
|
60
|
+
/** Highest admitted round number for this goal. */
|
|
61
|
+
readonly roundsStarted: number;
|
|
62
|
+
/** Epoch milliseconds of the create mutation. */
|
|
63
|
+
readonly createdAt: number;
|
|
64
|
+
/** Epoch milliseconds of the latest mutation. */
|
|
65
|
+
readonly updatedAt: number;
|
|
66
|
+
/** Process-local continuation eligibility; never persisted. */
|
|
67
|
+
readonly activation: GoalActivation;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The `goal` projection value: the current durable goal with its replay
|
|
71
|
+
* counters, exactly as the latest `goal/change` event carried them.
|
|
72
|
+
* Activation is process-local (never persisted) and deliberately absent —
|
|
73
|
+
* the projection reflects durable phase only.
|
|
74
|
+
*/
|
|
75
|
+
export interface GoalProjection {
|
|
76
|
+
/** Current durable goal snapshot (the CAS ref for mutations rides on it). */
|
|
77
|
+
readonly goal: GoalSnapshot;
|
|
78
|
+
/** Highest admitted round number for this goal. */
|
|
79
|
+
readonly roundsStarted: number;
|
|
80
|
+
/** Epoch milliseconds of the create mutation. */
|
|
81
|
+
readonly createdAt: number;
|
|
82
|
+
/** Epoch milliseconds of the latest mutation. */
|
|
83
|
+
readonly updatedAt: number;
|
|
84
|
+
}
|
|
85
|
+
declare module '@stackstackstack/dsh-session-projection/types' {
|
|
86
|
+
interface SessionProjectionMap {
|
|
87
|
+
/**
|
|
88
|
+
* The session's current goal (the latest `goal/change` whole value), or
|
|
89
|
+
* `null` before the first create and after a clear tombstone.
|
|
90
|
+
* Whole-value rule: every goal change carries the complete post-change
|
|
91
|
+
* state, so the fold is last-wins.
|
|
92
|
+
*/
|
|
93
|
+
goal: GoalProjection | null;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure types of the goal domain: the ONE home of the `goal` projection-key
|
|
3
|
+
* declaration plus the durable payload vocabulary it carries, free of this
|
|
4
|
+
* package's host-side imports (cordis events, dsh-agent, dsh-llm, the
|
|
5
|
+
* service). Two namespace projections serve it — `./types` for host
|
|
6
|
+
* consumers, `./client` (the browser half-entry's re-export) for client
|
|
7
|
+
* aggregates — with zero content duplication. Host-coupled domain
|
|
8
|
+
* vocabulary (message sources, events, fold shapes) lives in ./domain.ts.
|
|
9
|
+
*
|
|
10
|
+
* @module @stackstackstack/dsh-goal/types
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=types.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stackstackstack/dsh-goal",
|
|
3
|
+
"description": "Event-sourced same-session goal state and lifecycle service for the DeepSeek Harness",
|
|
4
|
+
"version": "0.1.5",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
|
|
11
|
+
"directory": "packages/goal/goal"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "lib/index.js",
|
|
15
|
+
"types": "lib/types/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./lib/types/index.d.ts",
|
|
19
|
+
"default": "./lib/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./invariant": {
|
|
22
|
+
"types": "./lib/types/invariant.d.ts",
|
|
23
|
+
"default": "./lib/invariant.js"
|
|
24
|
+
},
|
|
25
|
+
"./types": {
|
|
26
|
+
"types": "./lib/types/types.d.ts",
|
|
27
|
+
"default": "./lib/types/types.js"
|
|
28
|
+
},
|
|
29
|
+
"./client": {
|
|
30
|
+
"types": "./lib/types/client.d.ts",
|
|
31
|
+
"default": "./lib/types/client.js"
|
|
32
|
+
},
|
|
33
|
+
"./typert": {
|
|
34
|
+
"types": "./lib/typert.host.d.ts",
|
|
35
|
+
"default": "./lib/typert.host.js"
|
|
36
|
+
},
|
|
37
|
+
"./remote": {
|
|
38
|
+
"types": "./lib/typert.remote-client.d.ts",
|
|
39
|
+
"default": "./lib/typert.remote-client.js"
|
|
40
|
+
},
|
|
41
|
+
"./src/*": "./src/*",
|
|
42
|
+
"./package.json": "./package.json"
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"lib/index.js",
|
|
46
|
+
"lib/invariant.js",
|
|
47
|
+
"lib/types/**/*.js",
|
|
48
|
+
"lib/types/**/*.d.ts",
|
|
49
|
+
"lib/typert.host.js",
|
|
50
|
+
"lib/typert.host.d.ts",
|
|
51
|
+
"lib/typert.remote-client.js",
|
|
52
|
+
"lib/typert.remote-client.d.ts"
|
|
53
|
+
],
|
|
54
|
+
"license": "MIT",
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"@stackstackstack/dsh-agent": "^0.1.5",
|
|
57
|
+
"@stackstackstack/dsh-session-projection": "^0.1.5",
|
|
58
|
+
"@stackstackstack/dsh-brand": "^0.1.5",
|
|
59
|
+
"@stackstackstack/dsh-invariants": "^0.1.5",
|
|
60
|
+
"@stackstackstack/dsh-scope": "^0.1.5",
|
|
61
|
+
"@stackstackstack/dsh-typert-protocol": "^0.1.5",
|
|
62
|
+
"@stackstackstack/dsh-llm": "^0.1.5",
|
|
63
|
+
"@stackstackstack/dsh-session": "^0.1.5",
|
|
64
|
+
"@deepseek-ai/cordis": "^4.0.1"
|
|
65
|
+
},
|
|
66
|
+
"dependencies": {
|
|
67
|
+
"zod": "^4.4.3",
|
|
68
|
+
"@deepseek-ai/schemastery": "^3.18.1"
|
|
69
|
+
},
|
|
70
|
+
"devDependencies": {
|
|
71
|
+
"@stackstackstack/dsh-agent": "^0.1.5",
|
|
72
|
+
"@stackstackstack/dsh-session-projection": "^0.1.5",
|
|
73
|
+
"@stackstackstack/dsh-brand": "^0.1.5",
|
|
74
|
+
"@stackstackstack/dsh-invariants": "^0.1.5",
|
|
75
|
+
"@stackstackstack/dsh-llm": "^0.1.5",
|
|
76
|
+
"@stackstackstack/dsh-loader-smoke": "^0.1.5",
|
|
77
|
+
"@stackstackstack/dsh-scope": "^0.1.5",
|
|
78
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
79
|
+
"@stackstackstack/dsh-session": "^0.1.5",
|
|
80
|
+
"@stackstackstack/dsh-typert-protocol": "^0.1.5"
|
|
81
|
+
}
|
|
82
|
+
}
|