@sparkelf/dsh-patch-legacy-code-preset 0.1.0-rc.14 → 0.1.0-rc.26

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 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 patches/npm/legacy-code-preset/README.md
5
- README.md: dd7d80a595574e0c3b0d63379221ce7d53676976
6
- README.zh.md: 80834862a9a18ca6cda3330f7772c5264ad168c3
5
+ README.md: 9f9623b4ee704768729f3a8afd3293c9eb377eb9
6
+ README.zh.md: 782564481ba7230e382afa498304e07e8f6f5357
package/README.md CHANGED
@@ -4,6 +4,6 @@ English | [中文](README.zh.md)
4
4
 
5
5
  This data-only package preserves sessions created before the official `code` agent preset was renamed to `ptc`. Resume first resolves a real `code` preset, then falls back to `ptc` only when `code` is absent; the browser labels that persisted legacy id as the localized PTC preset. Session logs remain unchanged.
6
6
 
7
- The target is exact official source revision `0a53fb55bea101816fa226bb964ae2bed71c343b`. The payload is applied before that source tree is built. The package has no JavaScript entry, lifecycle script, Cordis plugin, accepted-fork fallback, or alternate variant.
7
+ The target is exact official source revision `fb2c4b9e698e30edb738bca4cf0618587db7d203`. The payload is applied before that source tree is built. The package has no JavaScript entry, lifecycle script, Cordis plugin, accepted-fork fallback, or alternate variant.
8
8
 
9
9
  Retire this package when official DSH provides equivalent legacy preset resolution and display behavior.
package/README.zh.md CHANGED
@@ -4,6 +4,6 @@
4
4
 
5
5
  该data-only package让official `code` agent preset改名为`ptc`之前创建的会话仍可恢复。恢复时先解析真实存在的`code` preset;只有`code`不存在时才回退到`ptc`。浏览器把该持久化旧id显示为本地化PTC preset,Session日志保持原样。
6
6
 
7
- target是exact official source revision `0a53fb55bea101816fa226bb964ae2bed71c343b`,payload在该source tree build前应用。本package没有JavaScript entry、lifecycle script、Cordis plugin、accepted-fork fallback或alternate variant。
7
+ target是exact official source revision `fb2c4b9e698e30edb738bca4cf0618587db7d203`,payload在该source tree build前应用。本package没有JavaScript entry、lifecycle script、Cordis plugin、accepted-fork fallback或alternate variant。
8
8
 
9
9
  official DSH提供同等legacy preset解析与显示行为后,retire本package。
package/package.json CHANGED
@@ -4,11 +4,11 @@
4
4
  "formatVersion": 1,
5
5
  "variants": [
6
6
  {
7
- "dsh": ">=0.1.2-alpha.2",
7
+ "dsh": ">=0.1.5-rc.2",
8
8
  "file": "./patches/legacy-code-preset.patch",
9
9
  "id": "legacy-code-preset-ptc-compatibility",
10
10
  "target": {
11
- "baseRevision": "0a53fb55bea101816fa226bb964ae2bed71c343b",
11
+ "baseRevision": "fb2c4b9e698e30edb738bca4cf0618587db7d203",
12
12
  "kind": "dsh-source",
13
13
  "paths": [
14
14
  "packages/api/session-controller/src/",
@@ -34,5 +34,5 @@
34
34
  "url": "git+https://github.com/SparkElf/deepseek-harness-plus.git"
35
35
  },
36
36
  "type": "module",
37
- "version": "0.1.0-rc.14"
37
+ "version": "0.1.0-rc.26"
38
38
  }
@@ -1,10 +1,10 @@
1
1
  diff --git a/packages/api/session-controller/src/agent.ts b/packages/api/session-controller/src/agent.ts
2
- index c17929af5c..8fd0e9e590 100644
2
+ index dd41090c22..8c2cd5029b 100644
3
3
  --- a/packages/api/session-controller/src/agent.ts
4
4
  +++ b/packages/api/session-controller/src/agent.ts
5
- @@ -11,10 +11,13 @@ import type {} from '@deepseek-ai/dsh-agent-presets'
6
- import { ReasoningEffortId } from '@deepseek-ai/dsh-llm'
7
- import type { Session, SessionEvent, SessionHeader, SessionId } from '@deepseek-ai/dsh-session'
5
+ @@ -12,10 +12,13 @@ import { ReasoningEffortId } from '@deepseek-ai/dsh-llm'
6
+ import type { Session, SessionId } from '@deepseek-ai/dsh-session'
7
+ import type { SessionInspection } from '@deepseek-ai/dsh-session-persistence'
8
8
  import { SessionQueryError, type SessionObservation } from '@deepseek-ai/dsh-session-query'
9
9
  -import { RemoteError } from '@deepseek-ai/dsh-typert-protocol'
10
10
  +import { RemoteError, remoteErrorOf } from '@deepseek-ai/dsh-typert-protocol'
@@ -17,10 +17,10 @@ index c17929af5c..8fd0e9e590 100644
17
17
  /** Cold Session identity absent from persistence. */
18
18
  export class ApiSessionNotFound extends Error {}
19
19
 
20
- @@ -372,7 +375,15 @@ export class ApiSessionAgentController {
21
- }> {
22
- const presets = this.ctx.get('agentPresets')
23
- if (presets === undefined) return { setup: (agentCtx) => { this.installSelection(agentCtx) } }
20
+ @@ -379,7 +382,15 @@ export class ApiSessionAgentController {
21
+ if (presets === undefined) {
22
+ return { setup: (_agentCtx, agent) => { this.installSelection(agent) } }
23
+ }
24
24
  - const resolvedId = (await presets.resolve(presetId)).id
25
25
  + let resolved
26
26
  + try {
@@ -33,20 +33,20 @@ index c17929af5c..8fd0e9e590 100644
33
33
  + const resolvedId = resolved.id
34
34
  return {
35
35
  agentPreset: resolvedId,
36
- setup: async (agentCtx) => {
36
+ setup: async (agentCtx, agent) => {
37
37
  diff --git a/packages/api/session-controller/tests/agent.host.spec.ts b/packages/api/session-controller/tests/agent.host.spec.ts
38
- index 6bfea1609d..62bdef2405 100644
38
+ index 586d7b4e7b..8f3d42a404 100644
39
39
  --- a/packages/api/session-controller/tests/agent.host.spec.ts
40
40
  +++ b/packages/api/session-controller/tests/agent.host.spec.ts
41
41
  @@ -8,6 +8,7 @@ import { agentPresetProjectionDefinition } from '@deepseek-ai/dsh-agent-presets'
42
- import SessionStore, { SessionId } from '@deepseek-ai/dsh-session'
42
+ import SessionStore, { SESSION_FORMAT_VERSION, SessionLogOffset, SessionId } from '@deepseek-ai/dsh-session'
43
43
  import type { SessionEvent, SessionHeader } from '@deepseek-ai/dsh-session'
44
44
  import type { SessionObservation } from '@deepseek-ai/dsh-session-query'
45
45
  +import { RemoteError } from '@deepseek-ai/dsh-typert-protocol'
46
46
  import TypertRegistry from '@deepseek-ai/dsh-typert-registry'
47
47
  import { afterEach, describe, expect, it, vi } from 'vitest'
48
48
  import {
49
- @@ -390,6 +391,38 @@ describe('ApiSession create or adoption', () => {
49
+ @@ -413,6 +414,38 @@ describe('ApiSession create or adoption', () => {
50
50
  expect(resume).toHaveBeenCalledWith(expect.objectContaining({ resumeSessionId: meta.id }))
51
51
  })
52
52
 
@@ -85,9 +85,9 @@ index 6bfea1609d..62bdef2405 100644
85
85
  it('rejects an ownership race before resume and a persisted cwd conflict', async () => {
86
86
  const child = await harness()
87
87
  const childMeta = header('resume-child-race')
88
- @@ -431,4 +464,29 @@ describe('ApiSession create or adoption', () => {
89
- const composition = await agents.composeAgent(undefined)
90
- expect(() => composition.setup(new Context())).toThrow('Agent setup has no scoped Agent')
88
+ @@ -452,4 +485,29 @@ describe('ApiSession create or adoption', () => {
89
+ await expect(agents.ensureSession(SessionId('mkdir-failure'), join(file, 'child'), false))
90
+ .rejects.toThrow('failed to ensure project directory')
91
91
  })
92
92
  +
93
93
  + it('falls back from a missing legacy code preset to ptc', async () => {