@deepseek-ai/dsh-goal 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/lib/index.js +2 -2
- package/lib/typert.host.js +33 -1
- package/lib/typert.remote-client.d.ts +28 -27
- package/lib/types/index.d.ts +2 -2
- package/lib/types/index.js +2 -2
- package/package.json +20 -22
- package/lib/typert.remote-client.d.ts.map +0 -1
- package/src/client.ts +0 -10
- package/src/domain.ts +0 -116
- package/src/fold.ts +0 -349
- package/src/index.ts +0 -592
- package/src/invariant.ts +0 -79
- package/src/runtime.ts +0 -30
- package/src/types.ts +0 -112
package/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { randomUUID } from "node:crypto";
|
|
|
2
2
|
import z from "@deepseek-ai/schemastery";
|
|
3
3
|
import { z as z$1 } from "zod";
|
|
4
4
|
import { agentEvents } from "@deepseek-ai/dsh-agent";
|
|
5
|
-
import {
|
|
5
|
+
import { Remote, TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
|
|
6
6
|
import { HarnessError } from "@deepseek-ai/dsh-llm";
|
|
7
7
|
//#region lib/types/runtime.js
|
|
8
8
|
/** Runtime constructors and protocol constants for the goal domain. */
|
|
@@ -419,7 +419,7 @@ function resolveBlockReason(reason) {
|
|
|
419
419
|
}
|
|
420
420
|
/** Goal service (`ctx.goals`) backed exclusively by the owning session log. */
|
|
421
421
|
let GoalService = (() => {
|
|
422
|
-
let _classSuper =
|
|
422
|
+
let _classSuper = TypertRemoteService;
|
|
423
423
|
let _instanceExtraInitializers = [];
|
|
424
424
|
let _edit_decorators;
|
|
425
425
|
let _pause_decorators;
|
package/lib/typert.host.js
CHANGED
|
@@ -462,6 +462,18 @@ export const TYPERT = {
|
|
|
462
462
|
"name": "AgentStatus",
|
|
463
463
|
"declaration": "export type AgentStatus = 'idle' | 'running';"
|
|
464
464
|
},
|
|
465
|
+
{
|
|
466
|
+
"name": "ApprovalOutcome",
|
|
467
|
+
"declaration": "export type ApprovalOutcome = 'allowed-once' | 'rejected' | 'cancelled' | 'unavailable';"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"name": "ApprovalPolicy",
|
|
471
|
+
"declaration": "export type ApprovalPolicy = 'ask' | 'never';"
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
"name": "ApprovalRequestId",
|
|
475
|
+
"declaration": "export type ApprovalRequestId = Branded<'ApprovalRequestId'>;"
|
|
476
|
+
},
|
|
465
477
|
{
|
|
466
478
|
"name": "AssistantMessage",
|
|
467
479
|
"declaration": "export interface AssistantMessage extends Message {\n readonly role: 'assistant';\n readonly source: ModelMessageSource;\n}"
|
|
@@ -486,6 +498,26 @@ export const TYPERT = {
|
|
|
486
498
|
"name": "CancelOptions",
|
|
487
499
|
"declaration": "export interface CancelOptions {\n keepInbox?: boolean | undefined;\n}"
|
|
488
500
|
},
|
|
501
|
+
{
|
|
502
|
+
"name": "CodeDispatchEventData",
|
|
503
|
+
"declaration": "export interface CodeDispatchEventData extends CodeDispatchStartEventData {\n isError: boolean;\n content: ContentBlock[];\n}"
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
"name": "CodeDispatchStartEventData",
|
|
507
|
+
"declaration": "export interface CodeDispatchStartEventData {\n rootCallId: CallId;\n parentCallId: CallId;\n subCallId: CallId;\n name: string;\n arguments: unknown;\n}"
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
"name": "CommandId",
|
|
511
|
+
"declaration": "export type CommandId = Branded<'CommandId'>;"
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"name": "CommandSource",
|
|
515
|
+
"declaration": "export type CommandSource = CommandSourceMap[keyof CommandSourceMap];"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"name": "CommandSourceMap",
|
|
519
|
+
"declaration": "export interface CommandSourceMap {\n user: { kind: 'user'; };\n}"
|
|
520
|
+
},
|
|
489
521
|
{
|
|
490
522
|
"name": "ContentBlock",
|
|
491
523
|
"declaration": "export type ContentBlock = ContentBlockMap[ContentBlockType];"
|
|
@@ -664,7 +696,7 @@ export const TYPERT = {
|
|
|
664
696
|
},
|
|
665
697
|
{
|
|
666
698
|
"name": "SessionEventMap",
|
|
667
|
-
"declaration": "export interface SessionEventMap {\n 'turn/start': { turn: number; };\n 'turn/end': { turn: number; reason: TurnEndReason; };\n 'step/start': { turn: number; step: number; };\n 'step/end': { turn: number; step: number; };\n 'user/message': UserMessage;\n 'assistant/chunk': { turn: number; step: number; chunk: StreamChunk; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; usage?: TokenUsage; };\n 'tool/call': { turn: number; step: number; callId: CallId; name: string; arguments: string; };\n 'tool/result': { turn: number; step: number; message: ToolResultMessage; error?: { name: string; code: string; }; meta?: JsonValue; };\n 'todo/write': { todos: TodoItem[]; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; };\n 'request/context': RequestContext;\n 'session/end-seed': Record<string, never>;\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\n 'goal/change': GoalChangeMeta;\n}"
|
|
699
|
+
"declaration": "export interface SessionEventMap {\n 'turn/start': { turn: number; };\n 'turn/end': { turn: number; reason: TurnEndReason; };\n 'step/start': { turn: number; step: number; };\n 'step/end': { turn: number; step: number; };\n 'user/message': UserMessage;\n 'assistant/chunk': { turn: number; step: number; chunk: StreamChunk; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; usage?: TokenUsage; };\n 'tool/call': { turn: number; step: number; callId: CallId; name: string; arguments: string; };\n 'tool/result': { turn: number; step: number; message: ToolResultMessage; error?: { name: string; code: string; }; meta?: JsonValue; };\n 'todo/write': { todos: TodoItem[]; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; };\n 'request/context': RequestContext;\n 'session/end-seed': Record<string, never>;\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\n 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: number; };\n 'approval/asked': { id: ApprovalRequestId; toolName: string; callId?: CallId; reason?: string; };\n 'approval/decided': { id: ApprovalRequestId; outcome: ApprovalOutcome; };\n 'approval/policy': { policy: ApprovalPolicy; source?: 'delegation'; };\n 'tool/code-dispatch-start': CodeDispatchStartEventData;\n 'tool/code-dispatch': CodeDispatchEventData;\n 'goal/change': GoalChangeMeta;\n}"
|
|
668
700
|
},
|
|
669
701
|
{
|
|
670
702
|
"name": "SessionEventType",
|
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
/* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
|
|
2
2
|
import type {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
RemoteResult,
|
|
4
|
+
TypertRemoteContribution,
|
|
5
|
+
} from '@deepseek-ai/dsh-typert-protocol'
|
|
5
6
|
import type { CreateGoalRequest, CreateGoalResult, EditGoalRequest, GoalRef, GoalView } from '@deepseek-ai/dsh-goal/client'
|
|
6
7
|
import type { SessionId } from '@deepseek-ai/dsh-session/types'
|
|
7
8
|
|
|
8
|
-
declare module '@deepseek-ai/dsh-
|
|
9
|
-
interface
|
|
10
|
-
clear: (agentId: SessionId, ref: GoalRef) => Promise<GoalRef
|
|
11
|
-
complete: (agentId: SessionId, ref: GoalRef) => Promise<GoalView
|
|
12
|
-
create: (agentId: SessionId, request: CreateGoalRequest) => Promise<CreateGoalResult
|
|
13
|
-
edit: (agentId: SessionId, ref: GoalRef, request: EditGoalRequest) => Promise<GoalView
|
|
14
|
-
pause: (agentId: SessionId, ref: GoalRef) => Promise<GoalView
|
|
15
|
-
resume: (agentId: SessionId, ref: GoalRef) => Promise<GoalView
|
|
9
|
+
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
10
|
+
interface TypertRemoteNamespace$676f616c73 {
|
|
11
|
+
clear: (agentId: SessionId, ref: GoalRef) => Promise<RemoteResult<GoalRef>>
|
|
12
|
+
complete: (agentId: SessionId, ref: GoalRef) => Promise<RemoteResult<GoalView>>
|
|
13
|
+
create: (agentId: SessionId, request: CreateGoalRequest) => Promise<RemoteResult<CreateGoalResult>>
|
|
14
|
+
edit: (agentId: SessionId, ref: GoalRef, request: EditGoalRequest) => Promise<RemoteResult<GoalView>>
|
|
15
|
+
pause: (agentId: SessionId, ref: GoalRef) => Promise<RemoteResult<GoalView>>
|
|
16
|
+
resume: (agentId: SessionId, ref: GoalRef) => Promise<RemoteResult<GoalView>>
|
|
16
17
|
}
|
|
17
|
-
interface
|
|
18
|
-
'goals/clear': (agentId: SessionId, ref: GoalRef) => Promise<GoalRef
|
|
19
|
-
'goals/complete': (agentId: SessionId, ref: GoalRef) => Promise<GoalView
|
|
20
|
-
'goals/create': (agentId: SessionId, request: CreateGoalRequest) => Promise<CreateGoalResult
|
|
21
|
-
'goals/edit': (agentId: SessionId, ref: GoalRef, request: EditGoalRequest) => Promise<GoalView
|
|
22
|
-
'goals/pause': (agentId: SessionId, ref: GoalRef) => Promise<GoalView
|
|
23
|
-
'goals/resume': (agentId: SessionId, ref: GoalRef) => Promise<GoalView
|
|
18
|
+
interface TypertRemoteMap {
|
|
19
|
+
'goals/clear': (agentId: SessionId, ref: GoalRef) => Promise<RemoteResult<GoalRef>>
|
|
20
|
+
'goals/complete': (agentId: SessionId, ref: GoalRef) => Promise<RemoteResult<GoalView>>
|
|
21
|
+
'goals/create': (agentId: SessionId, request: CreateGoalRequest) => Promise<RemoteResult<CreateGoalResult>>
|
|
22
|
+
'goals/edit': (agentId: SessionId, ref: GoalRef, request: EditGoalRequest) => Promise<RemoteResult<GoalView>>
|
|
23
|
+
'goals/pause': (agentId: SessionId, ref: GoalRef) => Promise<RemoteResult<GoalView>>
|
|
24
|
+
'goals/resume': (agentId: SessionId, ref: GoalRef) => Promise<RemoteResult<GoalView>>
|
|
24
25
|
}
|
|
25
|
-
interface
|
|
26
|
-
'goals':
|
|
26
|
+
interface TypertRemoteNamespaceMap {
|
|
27
|
+
'goals': TypertRemoteNamespace$676f616c73
|
|
27
28
|
}
|
|
28
|
-
interface
|
|
29
|
-
'agent:goals/clear': (ref: GoalRef) => Promise<GoalRef
|
|
30
|
-
'agent:goals/complete': (ref: GoalRef) => Promise<GoalView
|
|
31
|
-
'agent:goals/create': (request: CreateGoalRequest) => Promise<CreateGoalResult
|
|
32
|
-
'agent:goals/edit': (ref: GoalRef, request: EditGoalRequest) => Promise<GoalView
|
|
33
|
-
'agent:goals/pause': (ref: GoalRef) => Promise<GoalView
|
|
34
|
-
'agent:goals/resume': (ref: GoalRef) => Promise<GoalView
|
|
29
|
+
interface TypertRemoteScopeMap {
|
|
30
|
+
'agent:goals/clear': (ref: GoalRef) => Promise<RemoteResult<GoalRef>>
|
|
31
|
+
'agent:goals/complete': (ref: GoalRef) => Promise<RemoteResult<GoalView>>
|
|
32
|
+
'agent:goals/create': (request: CreateGoalRequest) => Promise<RemoteResult<CreateGoalResult>>
|
|
33
|
+
'agent:goals/edit': (ref: GoalRef, request: EditGoalRequest) => Promise<RemoteResult<GoalView>>
|
|
34
|
+
'agent:goals/pause': (ref: GoalRef) => Promise<RemoteResult<GoalView>>
|
|
35
|
+
'agent:goals/resume': (ref: GoalRef) => Promise<RemoteResult<GoalView>>
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
export declare const TYPERT_REMOTE:
|
|
39
|
+
export declare const TYPERT_REMOTE: TypertRemoteContribution
|
|
39
40
|
export default TYPERT_REMOTE
|
|
40
41
|
//# sourceMappingURL=typert.remote-client.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { Context } from '@deepseek-ai/cordis';
|
|
|
7
7
|
import z from '@deepseek-ai/schemastery';
|
|
8
8
|
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
9
9
|
import type { SessionEvent } from '@deepseek-ai/dsh-session';
|
|
10
|
-
import {
|
|
10
|
+
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
11
11
|
import type { CreateGoalRequest, CreateGoalResult, EditGoalRequest, GoalBlockReason, GoalProjection, GoalRef, GoalView } from './types.ts';
|
|
12
12
|
export type * from './types.ts';
|
|
13
13
|
export type * from './domain.ts';
|
|
@@ -43,7 +43,7 @@ export interface ResolvedConfig {
|
|
|
43
43
|
defaultMaxGoalRounds: number;
|
|
44
44
|
}
|
|
45
45
|
/** Goal service (`ctx.goals`) backed exclusively by the owning session log. */
|
|
46
|
-
export declare class GoalService extends
|
|
46
|
+
export declare class GoalService extends TypertRemoteService {
|
|
47
47
|
static inject: string[];
|
|
48
48
|
static Config: z<Config>;
|
|
49
49
|
private readonly resolved;
|
package/lib/types/index.js
CHANGED
|
@@ -41,7 +41,7 @@ import { randomUUID } from 'node:crypto';
|
|
|
41
41
|
import z from '@deepseek-ai/schemastery';
|
|
42
42
|
import { z as zod } from 'zod';
|
|
43
43
|
import { agentEvents } from '@deepseek-ai/dsh-agent';
|
|
44
|
-
import {
|
|
44
|
+
import { TypertRemoteService, Remote } from '@deepseek-ai/dsh-typert-protocol';
|
|
45
45
|
import { applyGoalEvent, decodeGoalChange, emptyGoalFoldState, goalChangeRef, } from "./fold.js";
|
|
46
46
|
import { GOAL_CHANGE_VERSION, GoalError, GoalId, } from "./runtime.js";
|
|
47
47
|
export { GOAL_CHANGE_VERSION, GoalError, GoalId } from "./runtime.js";
|
|
@@ -133,7 +133,7 @@ function resolveBlockReason(reason) {
|
|
|
133
133
|
}
|
|
134
134
|
/** Goal service (`ctx.goals`) backed exclusively by the owning session log. */
|
|
135
135
|
let GoalService = (() => {
|
|
136
|
-
let _classSuper =
|
|
136
|
+
let _classSuper = TypertRemoteService;
|
|
137
137
|
let _instanceExtraInitializers = [];
|
|
138
138
|
let _edit_decorators;
|
|
139
139
|
let _pause_decorators;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-goal",
|
|
3
3
|
"description": "Event-sourced same-session goal state and lifecycle service for the DeepSeek Harness",
|
|
4
|
-
"version": "0.0.1-rc.
|
|
4
|
+
"version": "0.0.1-rc.3",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "restricted"
|
|
7
7
|
},
|
|
@@ -49,36 +49,34 @@
|
|
|
49
49
|
"lib/typert.host.js",
|
|
50
50
|
"lib/typert.host.d.ts",
|
|
51
51
|
"lib/typert.remote-client.js",
|
|
52
|
-
"lib/typert.remote-client.d.ts"
|
|
53
|
-
"lib/typert.remote-client.d.ts.map",
|
|
54
|
-
"src"
|
|
52
|
+
"lib/typert.remote-client.d.ts"
|
|
55
53
|
],
|
|
56
54
|
"license": "BSD-3-Clause",
|
|
57
55
|
"peerDependencies": {
|
|
58
|
-
"@deepseek-ai/dsh-session-projection": "^0.0.1-rc.
|
|
59
|
-
"@deepseek-ai/dsh-
|
|
60
|
-
"@deepseek-ai/dsh-
|
|
61
|
-
"@deepseek-ai/dsh-llm": "^0.0.1-rc.
|
|
62
|
-
"@deepseek-ai/dsh-
|
|
63
|
-
"@deepseek-ai/
|
|
64
|
-
"@deepseek-ai/dsh-
|
|
65
|
-
"@deepseek-ai/dsh-
|
|
66
|
-
"@deepseek-ai/
|
|
56
|
+
"@deepseek-ai/dsh-session-projection": "^0.0.1-rc.3",
|
|
57
|
+
"@deepseek-ai/dsh-brand": "^0.0.1-rc.3",
|
|
58
|
+
"@deepseek-ai/dsh-agent": "^0.0.1-rc.3",
|
|
59
|
+
"@deepseek-ai/dsh-llm": "^0.0.1-rc.3",
|
|
60
|
+
"@deepseek-ai/dsh-session": "^0.0.1-rc.3",
|
|
61
|
+
"@deepseek-ai/cordis": "^4.0.1-rc.1",
|
|
62
|
+
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
|
|
63
|
+
"@deepseek-ai/dsh-scope": "^0.0.1-rc.3",
|
|
64
|
+
"@deepseek-ai/dsh-typert-protocol": "^0.0.1-rc.3"
|
|
67
65
|
},
|
|
68
66
|
"dependencies": {
|
|
69
67
|
"zod": "^4.4.3",
|
|
70
68
|
"@deepseek-ai/schemastery": "^3.18.1-rc.1"
|
|
71
69
|
},
|
|
72
70
|
"devDependencies": {
|
|
73
|
-
"@deepseek-ai/dsh-agent": "^0.0.1-rc.
|
|
74
|
-
"@deepseek-ai/dsh-session-projection": "^0.0.1-rc.
|
|
75
|
-
"@deepseek-ai/dsh-brand": "^0.0.1-rc.
|
|
76
|
-
"@deepseek-ai/dsh-
|
|
77
|
-
"@deepseek-ai/dsh-
|
|
78
|
-
"@deepseek-ai/dsh-
|
|
79
|
-
"@deepseek-ai/dsh-
|
|
80
|
-
"@deepseek-ai/dsh-
|
|
71
|
+
"@deepseek-ai/dsh-agent": "^0.0.1-rc.3",
|
|
72
|
+
"@deepseek-ai/dsh-session-projection": "^0.0.1-rc.3",
|
|
73
|
+
"@deepseek-ai/dsh-brand": "^0.0.1-rc.3",
|
|
74
|
+
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
|
|
75
|
+
"@deepseek-ai/dsh-llm": "^0.0.1-rc.3",
|
|
76
|
+
"@deepseek-ai/dsh-scope": "^0.0.1-rc.3",
|
|
77
|
+
"@deepseek-ai/dsh-loader-smoke": "^0.0.1-rc.3",
|
|
78
|
+
"@deepseek-ai/dsh-typert-protocol": "^0.0.1-rc.3",
|
|
81
79
|
"@deepseek-ai/cordis": "^4.0.1-rc.1",
|
|
82
|
-
"@deepseek-ai/dsh-
|
|
80
|
+
"@deepseek-ai/dsh-session": "^0.0.1-rc.3"
|
|
83
81
|
}
|
|
84
82
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typert.remote-client.d.ts","names":["clear","complete","create","edit","pause","resume"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;IAwXEA,K;IAxCAC,Q;IAyPAC,M;IArTAC,I;IAsBAC,K;IAYAC,M;;;IAkEAL,a;IAxCAC,gB;IAyPAC,c;IArTAC,Y;IAsBAC,a;IAYAC,c;;;;;;IAkEAL,mB;IAxCAC,sB;IAyPAC,oB;IArTAC,kB;IAsBAC,mB;IAYAC,oB","ignoreList":[]}
|
package/src/client.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Client-namespace projection of the goal domain: a pure re-export of the
|
|
3
|
-
* package's types outlet. Client code imports ONLY the client namespace
|
|
4
|
-
* (repo discipline), so `./client` projects the same single-source content
|
|
5
|
-
* `./types` serves to host consumers — zero duplication.
|
|
6
|
-
*
|
|
7
|
-
* @module @deepseek-ai/dsh-goal/client
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
export type * from './types.ts'
|
package/src/domain.ts
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Host-side vocabulary of the goal domain: live views, durable change
|
|
3
|
-
* payloads, message attribution, replay folds, and the scoped `goal/changed`
|
|
4
|
-
* event. Kept separate from ./types.ts (the pure client-safe outlet) because
|
|
5
|
-
* these declarations pull dsh-agent, dsh-llm, and cordis into the program —
|
|
6
|
-
* the one-program-per-side layout forbids that on client aggregates.
|
|
7
|
-
* @module @deepseek-ai/dsh-goal
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import type { Agent } from '@deepseek-ai/dsh-agent'
|
|
11
|
-
import type { GoalId, GoalRef, GoalSnapshot, GoalView } from './types.ts'
|
|
12
|
-
|
|
13
|
-
/** Goal state-changing verbs recorded in the durable source change. */
|
|
14
|
-
export type GoalOperation =
|
|
15
|
-
| 'create'
|
|
16
|
-
| 'edit'
|
|
17
|
-
| 'pause'
|
|
18
|
-
| 'resume'
|
|
19
|
-
| 'complete'
|
|
20
|
-
| 'block'
|
|
21
|
-
| 'clear'
|
|
22
|
-
|
|
23
|
-
/** Full-snapshot goal mutation committed by a durable `goal/change` event. */
|
|
24
|
-
export interface GoalSnapshotChangeMeta {
|
|
25
|
-
readonly kind: 'goal/change'
|
|
26
|
-
readonly version: 1
|
|
27
|
-
readonly operation: Exclude<GoalOperation, 'clear'>
|
|
28
|
-
readonly goal: GoalSnapshot
|
|
29
|
-
readonly roundsStarted: number
|
|
30
|
-
readonly createdAt: number
|
|
31
|
-
readonly updatedAt: number
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/** Tombstone retained when the current goal is cleared. */
|
|
35
|
-
export interface GoalClearChangeMeta {
|
|
36
|
-
readonly kind: 'goal/change'
|
|
37
|
-
readonly version: 1
|
|
38
|
-
readonly operation: 'clear'
|
|
39
|
-
readonly cleared: GoalRef
|
|
40
|
-
readonly clearedAt: number
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/** Durable change union carried by the goal domain's own session event. */
|
|
44
|
-
export type GoalChangeMeta = GoalSnapshotChangeMeta | GoalClearChangeMeta
|
|
45
|
-
|
|
46
|
-
/** Message attribution for admitted continuation rounds. */
|
|
47
|
-
export interface GoalMessageSource {
|
|
48
|
-
readonly kind: 'goal'
|
|
49
|
-
readonly goalId: GoalId
|
|
50
|
-
readonly revision: number
|
|
51
|
-
/** Positive admitted continuation round. */
|
|
52
|
-
readonly round: number
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
declare module '@deepseek-ai/dsh-llm' {
|
|
56
|
-
interface MessageSourceMap {
|
|
57
|
-
goal: GoalMessageSource
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
declare module '@deepseek-ai/dsh-session/types' {
|
|
62
|
-
interface SessionEventMap {
|
|
63
|
-
/**
|
|
64
|
-
* Complete post-mutation goal state or clear tombstone.
|
|
65
|
-
*/
|
|
66
|
-
'goal/change': GoalChangeMeta
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/** Pure replay fold of durable goal facts. */
|
|
71
|
-
export interface FoldedGoal {
|
|
72
|
-
/** Current goal, absent after a clear or before the first create. */
|
|
73
|
-
readonly goal?: GoalSnapshot
|
|
74
|
-
/** Highest admitted round for the current goal. */
|
|
75
|
-
readonly roundsStarted: number
|
|
76
|
-
/** Current goal creation time, absent without a current goal. */
|
|
77
|
-
readonly createdAt?: number
|
|
78
|
-
/** Current goal mutation time, absent without a current goal. */
|
|
79
|
-
readonly updatedAt?: number
|
|
80
|
-
/** Latest mutation ref, including a clear tombstone. */
|
|
81
|
-
readonly lastRef?: GoalRef
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/** Live notification after one durable goal mutation commits. */
|
|
85
|
-
export interface GoalChanged {
|
|
86
|
-
readonly operation: GoalOperation
|
|
87
|
-
readonly ref: GoalRef
|
|
88
|
-
/** Absent for a clear tombstone. */
|
|
89
|
-
readonly goal?: GoalView
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/** Stable error codes for rejected goal reads and mutations. */
|
|
93
|
-
export type GoalErrorCode =
|
|
94
|
-
| 'GOAL_AGENT_NOT_LIVE'
|
|
95
|
-
| 'GOAL_NOT_FOUND'
|
|
96
|
-
| 'GOAL_ALREADY_EXISTS'
|
|
97
|
-
| 'GOAL_STALE_REVISION'
|
|
98
|
-
| 'GOAL_INVALID_OBJECTIVE'
|
|
99
|
-
| 'GOAL_INVALID_MAX_ROUNDS'
|
|
100
|
-
| 'GOAL_INVALID_BLOCK_REASON'
|
|
101
|
-
| 'GOAL_INVALID_EDIT'
|
|
102
|
-
| 'GOAL_INVALID_TRANSITION'
|
|
103
|
-
|
|
104
|
-
declare module '@deepseek-ai/cordis' {
|
|
105
|
-
interface Events {
|
|
106
|
-
/**
|
|
107
|
-
* Goal mutation accepted by one live agent. The matching `goal/change`
|
|
108
|
-
* session event has already committed. Listener failures are contained.
|
|
109
|
-
* Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
|
|
110
|
-
* @param payload.agent - agent whose session owns the goal.
|
|
111
|
-
* @param payload.change - fresh current projection or clear tombstone.
|
|
112
|
-
* @mode emit
|
|
113
|
-
*/
|
|
114
|
-
'goal/changed'(this: import('@deepseek-ai/dsh-scope').Scoped<Agent>, payload: { agent: Agent; change: GoalChanged }): void
|
|
115
|
-
}
|
|
116
|
-
}
|