@sparkelf/dsh-patch-session-envelope-ignorable 0.2.1-alpha.20 → 0.2.1-alpha.21

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/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "file": "./patches/session-envelope-ignorable.patch",
9
9
  "id": "session-envelope-ignorable-at-append",
10
10
  "target": {
11
- "baseRevision": "5badb15009ae1756c3afe0ae0cef1faafc290ccc",
11
+ "baseRevision": "6851e496285b2c9670066fdd142e7e46da586649",
12
12
  "kind": "dsh-source",
13
13
  "paths": [
14
14
  "packages/core/session/src/"
@@ -31,5 +31,5 @@
31
31
  "url": "git+https://github.com/SparkElf/deepseek-harness-plus.git"
32
32
  },
33
33
  "type": "module",
34
- "version": "0.2.1-alpha.20"
34
+ "version": "0.2.1-alpha.21"
35
35
  }
@@ -1,37 +1,17 @@
1
- --- a/packages/core/session/src/types.ts
2
- +++ b/packages/core/session/src/types.ts
3
- @@ -478,6 +478,18 @@
4
- })
5
-
6
- /**
7
- + * Envelope markers a log-only event may declare at {@link Session.append}.
8
- + *
9
- + * `ignorable` lets a reader that does not know the event type skip it instead of refusing the
10
- + * whole log. Only a producer whose record cannot affect reconstruction may set it, so it is
11
- + * opt-in per append rather than a property of the event type.
12
- + */
13
- +export type EnvelopeIntent = {
14
- + /** Marks an event a reader may skip when it does not recognize the type. */
15
- + ignorable?: true
16
- +}
17
- +
18
- +/**
19
- * One immutable entry in the session log.
20
- *
21
- * A proper discriminated union over `type` (not independent `type`/`data`
1
+ diff --git a/packages/core/session/src/index.ts b/packages/core/session/src/index.ts
2
+ index e97585e463..0ea183a357 100644
22
3
  --- a/packages/core/session/src/index.ts
23
4
  +++ b/packages/core/session/src/index.ts
24
- @@ -15,7 +15,8 @@
5
+ @@ -15,7 +15,7 @@ import type { Scoped } from '@deepseek-ai/dsh-scope'
25
6
  import type { Message } from '@deepseek-ai/dsh-llm'
26
7
  import { SESSION_FORMAT_VERSION, SessionLogOffset, SessionSeq } from './types.ts'
27
8
  import type { TypertLookup } from '@deepseek-ai/dsh-typert-protocol'
28
- -import type { CreateSessionOptions, EpochHeader, PrepareSessionOptions, RequestContext, SessionEvent, SessionEventMap, SessionEventType, SessionHeader, SessionId, SessionSeedEventState, SurfaceIntent, SurfaceEventType } from './types.ts'
29
- +import type { CreateSessionOptions, EpochHeader, PrepareSessionOptions, RequestContext, SessionEvent, SessionEventMap, SessionEventType, SessionHeader, SessionId, SessionSeedEventState, EnvelopeIntent,
30
- + SurfaceIntent, SurfaceEventType } from './types.ts'
9
+ -import type { CreateSessionOptions, EpochHeader, PluginRecord, PluginRecordMap, PluginRecordType, PrepareSessionOptions, RequestContext, SessionEvent, SessionEventMap, SessionEventType, SessionHeader, SessionId, SessionSeedEventState, SurfaceIntent, SurfaceEventType } from './types.ts'
10
+ +import type { CreateSessionOptions, EpochHeader, PluginRecord, PluginRecordMap, PluginRecordType, PrepareSessionOptions, RequestContext, SessionEvent, SessionEventMap, SessionEventType, SessionHeader, SessionId, SessionSeedEventState, SurfaceIntent, EnvelopeIntent, SurfaceEventType } from './types.ts'
31
11
  import { SurfaceManager, validateSessionEventData, validateSurfaceMetadata } from './surface.ts'
32
12
  import type { SessionSurface, SessionMessageProjection } from './surface.ts'
33
13
  import { foldRequestHeader } from './request-header.ts'
34
- @@ -722,9 +723,12 @@
14
+ @@ -798,9 +798,12 @@ export class Session {
35
15
  append<T extends SessionEventType>(
36
16
  type: T,
37
17
  data: SessionEventMap[T],
@@ -46,7 +26,7 @@
46
26
  const surfaceMetadata = {
47
27
  ...surfaceOpts?.sourceEventSeqs === undefined ? {} : { sourceEventSeqs: surfaceOpts.sourceEventSeqs },
48
28
  ...surfaceOpts?.surfaceOp === undefined ? {} : { surfaceOp: surfaceOpts.surfaceOp },
49
- @@ -747,6 +751,10 @@
29
+ @@ -820,6 +823,10 @@ export class Session {
50
30
  time: Date.now(),
51
31
  data: dataSnapshot,
52
32
  ...(surfaceMetadataSnapshot as { surfaceOp?: unknown; sourceEventSeqs?: unknown }),
@@ -56,4 +36,27 @@
56
36
  + ...(intent.ignorable === true ? { ignorable: true } : {}),
57
37
  } as unknown as SessionEvent<T>)
58
38
  validateSessionEventData(event, `session event "${type}" at seq ${event.seq}`)
59
- this.surfaceManager.validateNext(event as SessionEvent)
39
+ this.commit(event as SessionEvent, entry)
40
+ diff --git a/packages/core/session/src/types.ts b/packages/core/session/src/types.ts
41
+ index fbc9a9cccb..26485e478d 100644
42
+ --- a/packages/core/session/src/types.ts
43
+ +++ b/packages/core/session/src/types.ts
44
+ @@ -477,6 +477,18 @@ export type SurfaceIntent<T extends SurfaceEventType = SurfaceEventType> = {
45
+ sourceEventSeqs?: SessionSeq[]
46
+ })
47
+
48
+ +/**
49
+ + * Envelope markers a log-only event may declare at {@link Session.append}.
50
+ + *
51
+ + * `ignorable` lets a reader that does not know the event type skip it instead of refusing the
52
+ + * whole log. Only a producer whose record cannot affect reconstruction may set it, so it is
53
+ + * opt-in per append rather than a property of the event type.
54
+ + */
55
+ +export type EnvelopeIntent = {
56
+ + /** Marks an event a reader may skip when it does not recognize the type. */
57
+ + ignorable?: true
58
+ +}
59
+ +
60
+ /**
61
+ * One immutable entry in the session log.
62
+ *