@deepseek-ai/dsh-session-telemetry 0.1.2-alpha.2 → 0.1.2-alpha.4
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 +2 -0
- package/README.zh.md +2 -0
- package/lib/index.js +5 -4
- package/lib/types/coordinator.d.ts +2 -2
- package/package.json +6 -13
- package/lib/invariant.js +0 -25
- package/lib/types/invariant.d.ts +0 -16
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/session/session-telemetry/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 69fcaa76bb0d8146d419b4b69f93d70fa854afae
|
|
6
|
+
README.zh.md: e9c8266cc7012cfd4e18a3dd9b90fdd69cbca58c
|
package/README.md
CHANGED
|
@@ -125,3 +125,5 @@ These limits define the delivery and data-protection guarantees a deployment get
|
|
|
125
125
|
None.
|
|
126
126
|
|
|
127
127
|
</details>
|
|
128
|
+
|
|
129
|
+
**Runtime invariant:** No companion is published. The package's whole output is the backend handoff — a synchronous `emit()` call outside every authoritative event stream — and its capture side never appends session events, so no event/data relation exists for an independent companion to observe.
|
package/README.zh.md
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Service } from "@deepseek-ai/cordis";
|
|
2
|
+
import { SessionSeq } from "@deepseek-ai/dsh-session";
|
|
2
3
|
//#region lib/types/coordinator.js
|
|
3
4
|
/**
|
|
4
5
|
* Capture coordinator for the telemetry capability. Live capture subscribes to
|
|
@@ -110,8 +111,8 @@ var SessionTelemetryCoordinator = class {
|
|
|
110
111
|
* @param throughSeq - optional last sequence included in this capture.
|
|
111
112
|
*/
|
|
112
113
|
captureSession(session, throughSeq) {
|
|
113
|
-
const cursor = handoffCursor.get(session) ?? session.firstLiveSeq - 1;
|
|
114
|
-
for (const event of session.
|
|
114
|
+
const cursor = handoffCursor.get(session) ?? (session.firstLiveSeq === 0 ? -1 : SessionSeq(session.firstLiveSeq - 1));
|
|
115
|
+
for (const event of session.snapshotEvents()) {
|
|
115
116
|
if (throughSeq !== void 0 && event.seq > throughSeq) break;
|
|
116
117
|
this.contain(() => {
|
|
117
118
|
if (event.seq <= cursor) this.track(session, event);
|
|
@@ -258,10 +259,10 @@ function identityOf(session, event) {
|
|
|
258
259
|
"event.type": event.type,
|
|
259
260
|
"event.seq": event.seq
|
|
260
261
|
};
|
|
261
|
-
const { cwd, parentSession,
|
|
262
|
+
const { cwd, parentSession, isSeeded } = session.header;
|
|
262
263
|
if (cwd !== void 0) attributes["session.cwd"] = cwd;
|
|
263
264
|
if (parentSession !== void 0) attributes["session.parent_id"] = String(parentSession);
|
|
264
|
-
if (
|
|
265
|
+
if (isSeeded) attributes["session.seed_length"] = session.inheritedEventCount;
|
|
265
266
|
return attributes;
|
|
266
267
|
}
|
|
267
268
|
//#endregion
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* @module @deepseek-ai/dsh-session-telemetry/coordinator
|
|
15
15
|
*/
|
|
16
16
|
import type { Context } from '@deepseek-ai/cordis';
|
|
17
|
-
import type { Session } from '@deepseek-ai/dsh-session';
|
|
17
|
+
import type { Session, SessionSeq as SessionSeqType } from '@deepseek-ai/dsh-session';
|
|
18
18
|
import type { SessionTelemetrySink } from './index.ts';
|
|
19
19
|
/** Whether capture follows live events or reads the canonical log only when requested. */
|
|
20
20
|
export type SessionTelemetryCapture = 'live' | 'on-demand';
|
|
@@ -60,7 +60,7 @@ export declare class SessionTelemetryCoordinator {
|
|
|
60
60
|
* @param session - session whose current canonical-log prefix may be handed over.
|
|
61
61
|
* @param throughSeq - optional last sequence included in this capture.
|
|
62
62
|
*/
|
|
63
|
-
captureSession(session: Session, throughSeq?:
|
|
63
|
+
captureSession(session: Session, throughSeq?: SessionSeqType): void;
|
|
64
64
|
/**
|
|
65
65
|
* Adopt a session: replay its log THROUGH the projection from the handoff
|
|
66
66
|
* cursor, then rely on the firehose for everything after. When no cursor
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-session-telemetry",
|
|
3
3
|
"description": "SessionTelemetryBackend seam for the DeepSeek Harness: session-event capture, projection, redaction, and handoff to a reporting backend",
|
|
4
|
-
"version": "0.1.2-alpha.
|
|
4
|
+
"version": "0.1.2-alpha.4",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -18,29 +18,22 @@
|
|
|
18
18
|
"types": "./lib/types/index.d.ts",
|
|
19
19
|
"default": "./lib/index.js"
|
|
20
20
|
},
|
|
21
|
-
"./invariant": {
|
|
22
|
-
"types": "./lib/types/invariant.d.ts",
|
|
23
|
-
"default": "./lib/invariant.js"
|
|
24
|
-
},
|
|
25
21
|
"./src/*": "./src/*",
|
|
26
22
|
"./package.json": "./package.json"
|
|
27
23
|
},
|
|
28
24
|
"files": [
|
|
29
25
|
"lib/index.js",
|
|
30
|
-
"lib/invariant.js",
|
|
31
26
|
"lib/types/**/*.d.ts"
|
|
32
27
|
],
|
|
33
28
|
"license": "MIT",
|
|
34
29
|
"peerDependencies": {
|
|
35
|
-
"@deepseek-ai/dsh-
|
|
36
|
-
"@deepseek-ai/dsh-session": "^0.1.2-alpha.
|
|
37
|
-
"@deepseek-ai/cordis": "^4.0.2"
|
|
38
|
-
"@deepseek-ai/dsh-agent": "^0.1.2-alpha.2"
|
|
30
|
+
"@deepseek-ai/dsh-agent": "^0.1.2-alpha.4",
|
|
31
|
+
"@deepseek-ai/dsh-session": "^0.1.2-alpha.4",
|
|
32
|
+
"@deepseek-ai/cordis": "^4.0.2"
|
|
39
33
|
},
|
|
40
34
|
"devDependencies": {
|
|
41
|
-
"@deepseek-ai/dsh-agent": "^0.1.2-alpha.
|
|
42
|
-
"@deepseek-ai/dsh-
|
|
43
|
-
"@deepseek-ai/dsh-session": "^0.1.2-alpha.2",
|
|
35
|
+
"@deepseek-ai/dsh-agent": "^0.1.2-alpha.4",
|
|
36
|
+
"@deepseek-ai/dsh-session": "^0.1.2-alpha.4",
|
|
44
37
|
"@deepseek-ai/cordis": "^4.0.2"
|
|
45
38
|
}
|
|
46
39
|
}
|
package/lib/invariant.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//#region lib/types/invariant.js
|
|
2
|
-
/**
|
|
3
|
-
* Package-owned invariant companion for `@deepseek-ai/dsh-session-telemetry`.
|
|
4
|
-
* @module @deepseek-ai/dsh-session-telemetry/invariant
|
|
5
|
-
*/
|
|
6
|
-
const PACKAGE_NAME = "@deepseek-ai/dsh-session-telemetry";
|
|
7
|
-
/** Cordis companion plugin name. */
|
|
8
|
-
const name = "session-telemetry-invariant";
|
|
9
|
-
/** Service required before the companion can reserve package ownership. */
|
|
10
|
-
const inject = ["invariants"];
|
|
11
|
-
/**
|
|
12
|
-
* No runtime invariant: the package's whole output is the backend handoff — a
|
|
13
|
-
* synchronous `emit()` call outside every authoritative event stream — and its
|
|
14
|
-
* capture side never appends session events, so no event/data relation exists
|
|
15
|
-
* for an independent companion to observe.
|
|
16
|
-
*/
|
|
17
|
-
const install = () => {};
|
|
18
|
-
/**
|
|
19
|
-
* Register this package's invariant companion.
|
|
20
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
21
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
22
|
-
*/
|
|
23
|
-
const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
24
|
-
//#endregion
|
|
25
|
-
export { apply, inject, name };
|
package/lib/types/invariant.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Package-owned invariant companion for `@deepseek-ai/dsh-session-telemetry`.
|
|
3
|
-
* @module @deepseek-ai/dsh-session-telemetry/invariant
|
|
4
|
-
*/
|
|
5
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
-
/** Cordis companion plugin name. */
|
|
7
|
-
export declare const name = "session-telemetry-invariant";
|
|
8
|
-
/** Service required before the companion can reserve package ownership. */
|
|
9
|
-
export declare const inject: string[];
|
|
10
|
-
/**
|
|
11
|
-
* Register this package's invariant companion.
|
|
12
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
13
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
14
|
-
*/
|
|
15
|
-
export declare const apply: (ctx: Context) => Promise<() => void>;
|
|
16
|
-
//# sourceMappingURL=invariant.d.ts.map
|