dsh-draw 0.2.1 → 0.2.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/CHANGELOG.md +32 -0
- package/README.es.md +39 -32
- package/README.hi.md +39 -32
- package/README.md +39 -32
- package/README.pt.md +39 -32
- package/README.zh.md +39 -32
- package/lib/client.js +1889 -921
- package/lib/client.js.map +1 -1
- package/lib/index.js +12 -8
- package/lib/typert.host.js +1 -1
- package/lib/types/client/DrawResultCard.d.ts +1 -1
- package/lib/types/client/DrawResultCard.d.ts.map +1 -1
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/index.js +3 -2
- package/lib/types/client/present.d.ts +40 -1
- package/lib/types/client/present.d.ts.map +1 -1
- package/lib/types/event-gate.d.ts +8 -5
- package/lib/types/event-gate.d.ts.map +1 -1
- package/lib/types/event-gate.js +8 -5
- package/lib/types/session-events.d.ts +10 -8
- package/lib/types/session-events.d.ts.map +1 -1
- package/lib/types/session-events.js +12 -9
- package/lib/types/version.d.ts +1 -1
- package/lib/types/version.js +1 -1
- package/lib/{wire-Cc4JZ3jR.js → wire-DLW8WmDW.js} +1886 -919
- package/package.json +30 -30
- package/src/client/DrawResultCard.tsx +1 -2
- package/src/client/index.ts +18 -3
- package/src/client/present.ts +42 -1
- package/src/event-gate.ts +9 -6
- package/src/session-events.ts +13 -10
- package/src/tool.ts +1 -1
- package/src/version.ts +1 -1
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as statusToView, n as imageToWire, r as probeToWire, t as DRAW_INVOCATIONS } from "./wire-
|
|
1
|
+
import { i as statusToView, n as imageToWire, r as probeToWire, t as DRAW_INVOCATIONS } from "./wire-DLW8WmDW.js";
|
|
2
2
|
import { credentialRef } from "@deepseek-ai/dsh-credentials";
|
|
3
3
|
import z from "@deepseek-ai/schemastery";
|
|
4
4
|
import { Context } from "@deepseek-ai/cordis";
|
|
@@ -233,7 +233,8 @@ function appendDrawGenerated(session, event) {
|
|
|
233
233
|
}
|
|
234
234
|
/**
|
|
235
235
|
* In-memory accounting ledger for hosts whose session log cannot carry
|
|
236
|
-
* `draw/generated` safely (rc.6/rc.7 static whitelist
|
|
236
|
+
* `draw/generated` safely (rc.6/rc.7 static whitelist and the envelope-less
|
|
237
|
+
* `0.1.2-alpha.1`, which fails closed on unknown types at read).
|
|
237
238
|
* Keyed by Session identity: the entries live exactly as long as the session.
|
|
238
239
|
*/
|
|
239
240
|
const fallbackLedger = /* @__PURE__ */ new WeakMap();
|
|
@@ -573,9 +574,11 @@ var Drawer = class {
|
|
|
573
574
|
* package's types, so it sits outside every host's `KNOWN_SESSION_EVENT_TYPES`:
|
|
574
575
|
* hosts whose session reader validates a static whitelist (rc.6/rc.7) refuse to
|
|
575
576
|
* reopen a session containing the event unless it carries the `ignorable`
|
|
576
|
-
* envelope — and those hosts' `Session.append` cannot stamp it. The
|
|
577
|
-
*
|
|
578
|
-
*
|
|
577
|
+
* envelope — and those hosts' `Session.append` cannot stamp it. The
|
|
578
|
+
* `0.1.2-alpha.1` host removed the envelope entirely and fails closed on
|
|
579
|
+
* unknown event types at read, so the probe never reports support there. The
|
|
580
|
+
* gate therefore appends only when the type is host-known or a mount-time
|
|
581
|
+
* probe proves envelope support; otherwise the accounting payload goes to the
|
|
579
582
|
* in-memory fallback ledger (see session-events.ts) so quota keeps working for
|
|
580
583
|
* the live session without poisoning the log.
|
|
581
584
|
*
|
|
@@ -611,8 +614,9 @@ function makeEventGate(knownTypes, ignorableAppend = false) {
|
|
|
611
614
|
* Probe whether the host `Session.append` stamps the ignorable envelope. Runs
|
|
612
615
|
* on a fully detached SessionStore — never host persistence — appending one
|
|
613
616
|
* probe event with `{ ignorable: true }` and reading the marker back. rc.6's
|
|
614
|
-
* append silently drops the unknown options key (probe false)
|
|
615
|
-
*
|
|
617
|
+
* append silently drops the unknown options key (probe false), and the
|
|
618
|
+
* envelope-less `0.1.2-alpha.1` append takes no options at all (probe false);
|
|
619
|
+
* every failure is contained as "unsupported".
|
|
616
620
|
*
|
|
617
621
|
* @returns whether the envelope is honored.
|
|
618
622
|
*/
|
|
@@ -1355,7 +1359,7 @@ var EngineRouter = class {
|
|
|
1355
1359
|
* @module dsh-draw/version
|
|
1356
1360
|
*/
|
|
1357
1361
|
/** Plugin version; must equal the `version` field in `package.json`. */
|
|
1358
|
-
const PLUGIN_VERSION = "0.2.
|
|
1362
|
+
const PLUGIN_VERSION = "0.2.3";
|
|
1359
1363
|
//#endregion
|
|
1360
1364
|
//#region src/service.ts
|
|
1361
1365
|
/**
|
package/lib/typert.host.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { type ReactElement } from 'react';
|
|
14
14
|
import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
15
|
-
import type
|
|
15
|
+
import { type ToolCallBlock } from './present.js';
|
|
16
16
|
/**
|
|
17
17
|
* Standard owner currency for one keyed tool view (mirror of the harness
|
|
18
18
|
* ui-tool contract `ToolCallOwnerProps`, which the package index does not
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawResultCard.d.ts","sourceRoot":"","sources":["../../../src/client/DrawResultCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAgC,KAAK,YAAY,EAAE,MAAM,OAAO,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAC7F,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"DrawResultCard.d.ts","sourceRoot":"","sources":["../../../src/client/DrawResultCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAgC,KAAK,YAAY,EAAE,MAAM,OAAO,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAC7F,OAAO,EAAqB,KAAK,aAAa,EAAE,MAAM,cAAc,CAAA;AAEpE;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAA;IACd,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;IAChB,kDAAkD;IAClD,KAAK,EAAE,aAAa,CAAA;IACpB,qDAAqD;IACrD,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,kDAAkD;IAClD,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB;AAED,OAAO,QAAQ,kCAAkC,CAAC;IAChD,UAAU,OAAO;QACf,qEAAqE;QACrE,oBAAoB,EAAE;YAAE,IAAI,EAAE,OAAO,CAAC;YAAC,KAAK,EAAE,SAAS,CAAC;YAAC,KAAK,EAAE,kBAAkB,CAAA;SAAE,CAAA;KACrF;CACF;AAED,8EAA8E;AAC9E,MAAM,WAAW,sBAAsB;IACrC,yEAAyE;IACzE,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC7D;AAED,qEAAqE;AACrE,MAAM,MAAM,mBAAmB,GAC7B,YAAY,CAAC,oBAAoB,CAAC,GAChC,WAAW,CAAC,MAAM,CAAC,GACnB,UAAU,CAAC,sBAAsB,CAAC,CAAA;AAEtC;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,CAqCvE"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module dsh-draw/client
|
|
9
9
|
*/
|
|
10
|
-
import type { ClientContext } from '@deepseek-ai/
|
|
10
|
+
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
11
11
|
import { type DrawLocaleKey } from './locales.js';
|
|
12
12
|
export type { DrawResultCardInjected, DrawResultCardProps } from './DrawResultCard.js';
|
|
13
13
|
export type { DrawSettingsTabInjected, DrawSettingsTabProps } from './DrawSettingsTab.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAWnE,OAAO,EAAU,KAAK,aAAa,EAAE,MAAM,cAAc,CAAA;AAMzD,YAAY,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AACvF,YAAY,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAC1F,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,KAAK,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAE9I,OAAO,QAAQ,kCAAkC,CAAC;IAChD,UAAU,kBAAkB;QAC1B,4CAA4C;QAC5C,MAAM,EAAE,aAAa,CAAA;KACtB;CACF;AAED,iDAAiD;AACjD,eAAO,MAAM,EAAE,SAAS,CAAA;AAExB,kFAAkF;AAClF,eAAO,MAAM,IAAI,aAAa,CAAA;AAE9B,2FAA2F;AAC3F,eAAO,MAAM,MAAM,UAA4C,CAAA;AAc/D;;;;;GAKG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAsD7D"}
|
|
@@ -34,13 +34,14 @@ export async function apply(ctx) {
|
|
|
34
34
|
await ctx.remote.$mount(DRAW_REMOTE);
|
|
35
35
|
ctx.inject(['remote.draw'], (scope) => {
|
|
36
36
|
const t = scope.locale.bind(NS);
|
|
37
|
+
const slots = scope.get('slots');
|
|
37
38
|
const unwrap = (result, method) => {
|
|
38
39
|
if (!result.ok) {
|
|
39
40
|
throw new Error(`draw.${method} failed: ${result.error.code}: ${result.error.message}`);
|
|
40
41
|
}
|
|
41
42
|
return result.value;
|
|
42
43
|
};
|
|
43
|
-
|
|
44
|
+
slots.inject('tool.call.toolview', () => slots.register({
|
|
44
45
|
name: 'tool.call.toolview',
|
|
45
46
|
key: 'image_generate',
|
|
46
47
|
locale: NS,
|
|
@@ -53,7 +54,7 @@ export async function apply(ctx) {
|
|
|
53
54
|
},
|
|
54
55
|
}),
|
|
55
56
|
}, DrawResultCard));
|
|
56
|
-
|
|
57
|
+
slots.inject('settings.plugins.tab', () => slots.register({
|
|
57
58
|
name: 'settings.plugins.tab',
|
|
58
59
|
id: 'draw',
|
|
59
60
|
order: 40,
|
|
@@ -6,8 +6,47 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module dsh-draw/client/present
|
|
8
8
|
*/
|
|
9
|
-
import type { ToolCallBlock } from '@deepseek-ai/dsh-client-runtime/client';
|
|
10
9
|
import type { DrawStatusSnapshot } from '../wire.js';
|
|
10
|
+
/**
|
|
11
|
+
* Local structural contract for the frozen tool-call block the card reads.
|
|
12
|
+
* Declared locally because the owning packages publish the block union
|
|
13
|
+
* differently across host lines: the published `0.1.1-rc.2` line keeps it in
|
|
14
|
+
* the removed `dsh-client-runtime` package, and the unreleased
|
|
15
|
+
* `0.1.2-alpha.1` host owns it in the unpublished `dsh-client-ui-chat`. The
|
|
16
|
+
* runtime contract is structural — the presenter only discriminates on
|
|
17
|
+
* `kind` and reads the call head, error flag, and meta.
|
|
18
|
+
*/
|
|
19
|
+
/** One frozen running tool call (no `kind`; the presenter's first guard drops it). */
|
|
20
|
+
export interface RunningToolCallBlock {
|
|
21
|
+
/** Tool call identity, stable across running and settled forms. */
|
|
22
|
+
callId: string;
|
|
23
|
+
/** Wire tool name. */
|
|
24
|
+
name: string;
|
|
25
|
+
/** Verbatim serialized arguments. */
|
|
26
|
+
argsRaw: string;
|
|
27
|
+
/** Owning turn. */
|
|
28
|
+
turn: number;
|
|
29
|
+
/** Owning step. */
|
|
30
|
+
step: number;
|
|
31
|
+
/** Unix epoch ms when the call was logged. */
|
|
32
|
+
time: number;
|
|
33
|
+
}
|
|
34
|
+
/** One settled tool result (fields the presenter reads). */
|
|
35
|
+
export interface SettledToolResultBlock {
|
|
36
|
+
kind: 'tool-result';
|
|
37
|
+
isError: boolean;
|
|
38
|
+
/** Call head; null when window truncation left the call outside. */
|
|
39
|
+
call: {
|
|
40
|
+
name: string;
|
|
41
|
+
argsRaw: string;
|
|
42
|
+
} | null;
|
|
43
|
+
/** Tool-owned presentation metadata (the card's engine/quota/limits facts). */
|
|
44
|
+
meta?: unknown;
|
|
45
|
+
}
|
|
46
|
+
/** Frozen running-or-settled tool block. */
|
|
47
|
+
export type ToolCallBlock = RunningToolCallBlock | SettledToolResultBlock;
|
|
48
|
+
/** Settled tool-result node only. */
|
|
49
|
+
export type ToolResultNode = SettledToolResultBlock;
|
|
11
50
|
/** One image of the presented result card. */
|
|
12
51
|
export interface PresentedImage {
|
|
13
52
|
attachmentId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"present.d.ts","sourceRoot":"","sources":["../../../src/client/present.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"present.d.ts","sourceRoot":"","sources":["../../../src/client/present.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAEpD;;;;;;;;GAQG;AAEH,sFAAsF;AACtF,MAAM,WAAW,oBAAoB;IACnC,mEAAmE;IACnE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IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;CAC1C;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,GAAG,mBAAmB,GAAG,SAAS,CAuCvF;AAED,sDAAsD;AACtD,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,EAAE,OAAO,CAAA;IAClB,oBAAoB,EAAE,OAAO,CAAA;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,kBAAkB,EAAE,OAAO,CAAA;IAC3B,mBAAmB,EAAE,MAAM,CAAA;IAC3B,WAAW,EAAE,OAAO,CAAA;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,uCAAuC;AACvC,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAA;IACtC,KAAK,EAAE;QAAE,wBAAwB,EAAE,MAAM,CAAC;QAAC,kBAAkB,EAAE,MAAM,CAAA;KAAE,CAAA;IACvE,gBAAgB,EAAE,MAAM,CAAA;IACxB,gBAAgB,EAAE,MAAM,CAAA;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,GAAG,GAAE,MAAM,MAAiB,GAAG,kBAAkB,CAqB/G"}
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
* package's types, so it sits outside every host's `KNOWN_SESSION_EVENT_TYPES`:
|
|
4
4
|
* hosts whose session reader validates a static whitelist (rc.6/rc.7) refuse to
|
|
5
5
|
* reopen a session containing the event unless it carries the `ignorable`
|
|
6
|
-
* envelope — and those hosts' `Session.append` cannot stamp it. The
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* envelope — and those hosts' `Session.append` cannot stamp it. The
|
|
7
|
+
* `0.1.2-alpha.1` host removed the envelope entirely and fails closed on
|
|
8
|
+
* unknown event types at read, so the probe never reports support there. The
|
|
9
|
+
* gate therefore appends only when the type is host-known or a mount-time
|
|
10
|
+
* probe proves envelope support; otherwise the accounting payload goes to the
|
|
9
11
|
* in-memory fallback ledger (see session-events.ts) so quota keeps working for
|
|
10
12
|
* the live session without poisoning the log.
|
|
11
13
|
*
|
|
@@ -35,8 +37,9 @@ export declare function makeEventGate(knownTypes: ReadonlySet<string>, ignorable
|
|
|
35
37
|
* Probe whether the host `Session.append` stamps the ignorable envelope. Runs
|
|
36
38
|
* on a fully detached SessionStore — never host persistence — appending one
|
|
37
39
|
* probe event with `{ ignorable: true }` and reading the marker back. rc.6's
|
|
38
|
-
* append silently drops the unknown options key (probe false)
|
|
39
|
-
*
|
|
40
|
+
* append silently drops the unknown options key (probe false), and the
|
|
41
|
+
* envelope-less `0.1.2-alpha.1` append takes no options at all (probe false);
|
|
42
|
+
* every failure is contained as "unsupported".
|
|
40
43
|
*
|
|
41
44
|
* @returns whether the envelope is honored.
|
|
42
45
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-gate.d.ts","sourceRoot":"","sources":["../../src/event-gate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"event-gate.d.ts","sourceRoot":"","sources":["../../src/event-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,2EAA2E;AAC3E,MAAM,WAAW,iBAAiB;IAChC,2CAA2C;IAC3C,MAAM,EAAE,OAAO,CAAA;IACf,oEAAoE;IACpE,SAAS,EAAE,OAAO,CAAA;CACnB;AAED,kDAAkD;AAClD,MAAM,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,iBAAiB,CAAA;AAE3D;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,eAAe,UAAQ,GAAG,SAAS,CAMjG;AAKD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAoB9C;AAED,6EAA6E;AAC7E,wBAAgB,iBAAiB,IAAI,SAAS,CAE7C"}
|
package/lib/types/event-gate.js
CHANGED
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
* package's types, so it sits outside every host's `KNOWN_SESSION_EVENT_TYPES`:
|
|
4
4
|
* hosts whose session reader validates a static whitelist (rc.6/rc.7) refuse to
|
|
5
5
|
* reopen a session containing the event unless it carries the `ignorable`
|
|
6
|
-
* envelope — and those hosts' `Session.append` cannot stamp it. The
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* envelope — and those hosts' `Session.append` cannot stamp it. The
|
|
7
|
+
* `0.1.2-alpha.1` host removed the envelope entirely and fails closed on
|
|
8
|
+
* unknown event types at read, so the probe never reports support there. The
|
|
9
|
+
* gate therefore appends only when the type is host-known or a mount-time
|
|
10
|
+
* probe proves envelope support; otherwise the accounting payload goes to the
|
|
9
11
|
* in-memory fallback ledger (see session-events.ts) so quota keeps working for
|
|
10
12
|
* the live session without poisoning the log.
|
|
11
13
|
*
|
|
@@ -36,8 +38,9 @@ export function makeEventGate(knownTypes, ignorableAppend = false) {
|
|
|
36
38
|
* Probe whether the host `Session.append` stamps the ignorable envelope. Runs
|
|
37
39
|
* on a fully detached SessionStore — never host persistence — appending one
|
|
38
40
|
* probe event with `{ ignorable: true }` and reading the marker back. rc.6's
|
|
39
|
-
* append silently drops the unknown options key (probe false)
|
|
40
|
-
*
|
|
41
|
+
* append silently drops the unknown options key (probe false), and the
|
|
42
|
+
* envelope-less `0.1.2-alpha.1` append takes no options at all (probe false);
|
|
43
|
+
* every failure is contained as "unsupported".
|
|
41
44
|
*
|
|
42
45
|
* @returns whether the envelope is honored.
|
|
43
46
|
*/
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The dsh-draw session event: one durable record per completed generation
|
|
3
3
|
* (tool call or panel regenerate), appended to the owning session log. It is
|
|
4
|
-
* log-only
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* log-only and exists so quota accounting and the durable audit trail are
|
|
5
|
+
* reconstructable from the log alone. The model-visible input and output of
|
|
6
|
+
* the call ride the loop-owned `tool/call` and `tool/result` events; this
|
|
7
|
+
* event carries the accounting facts those events do not.
|
|
8
8
|
*
|
|
9
9
|
* The event type is declared only here, so plugin paths append it through
|
|
10
10
|
* {@link commitDrawGenerated}: the adaptive gate (event-gate.ts) appends only
|
|
11
|
-
* when the host knows the type or honors the `ignorable` envelope
|
|
12
|
-
* otherwise records the payload in the in-memory fallback
|
|
13
|
-
* quota keeps working; the durable trail resumes once
|
|
14
|
-
* event surface).
|
|
11
|
+
* when the host knows the type or honors the `ignorable` envelope (pre-0.1.2
|
|
12
|
+
* host lines), and otherwise records the payload in the in-memory fallback
|
|
13
|
+
* ledger (live-session quota keeps working; the durable trail resumes once
|
|
14
|
+
* the host gains a plugin event surface). `0.1.2-alpha.1` removed the
|
|
15
|
+
* envelope and fails closed on unknown event types at read, so the probe
|
|
16
|
+
* reports no support there and every commit degrades to the ledger. On 0.1.2-alpha.3 the envelope field is retained for stored-log read compatibility only - its Session.append still cannot stamp the marker, so the gate behavior is unchanged.
|
|
15
17
|
*
|
|
16
18
|
* @module dsh-draw/session-events
|
|
17
19
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-events.d.ts","sourceRoot":"","sources":["../../src/session-events.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"session-events.d.ts","sourceRoot":"","sources":["../../src/session-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,KAAK,EAAE,SA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AAC,gBAAgB,CAAC,EAAE,CAElI"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The dsh-draw session event: one durable record per completed generation
|
|
3
3
|
* (tool call or panel regenerate), appended to the owning session log. It is
|
|
4
|
-
* log-only
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* log-only and exists so quota accounting and the durable audit trail are
|
|
5
|
+
* reconstructable from the log alone. The model-visible input and output of
|
|
6
|
+
* the call ride the loop-owned `tool/call` and `tool/result` events; this
|
|
7
|
+
* event carries the accounting facts those events do not.
|
|
8
8
|
*
|
|
9
9
|
* The event type is declared only here, so plugin paths append it through
|
|
10
10
|
* {@link commitDrawGenerated}: the adaptive gate (event-gate.ts) appends only
|
|
11
|
-
* when the host knows the type or honors the `ignorable` envelope
|
|
12
|
-
* otherwise records the payload in the in-memory fallback
|
|
13
|
-
* quota keeps working; the durable trail resumes once
|
|
14
|
-
* event surface).
|
|
11
|
+
* when the host knows the type or honors the `ignorable` envelope (pre-0.1.2
|
|
12
|
+
* host lines), and otherwise records the payload in the in-memory fallback
|
|
13
|
+
* ledger (live-session quota keeps working; the durable trail resumes once
|
|
14
|
+
* the host gains a plugin event surface). `0.1.2-alpha.1` removed the
|
|
15
|
+
* envelope and fails closed on unknown event types at read, so the probe
|
|
16
|
+
* reports no support there and every commit degrades to the ledger. On 0.1.2-alpha.3 the envelope field is retained for stored-log read compatibility only - its Session.append still cannot stamp the marker, so the gate behavior is unchanged.
|
|
15
17
|
*
|
|
16
18
|
* @module dsh-draw/session-events
|
|
17
19
|
*/
|
|
@@ -29,7 +31,8 @@ export function appendDrawGenerated(session, event) {
|
|
|
29
31
|
}
|
|
30
32
|
/**
|
|
31
33
|
* In-memory accounting ledger for hosts whose session log cannot carry
|
|
32
|
-
* `draw/generated` safely (rc.6/rc.7 static whitelist
|
|
34
|
+
* `draw/generated` safely (rc.6/rc.7 static whitelist and the envelope-less
|
|
35
|
+
* `0.1.2-alpha.1`, which fails closed on unknown types at read).
|
|
33
36
|
* Keyed by Session identity: the entries live exactly as long as the session.
|
|
34
37
|
*/
|
|
35
38
|
const fallbackLedger = new WeakMap();
|
package/lib/types/version.d.ts
CHANGED
package/lib/types/version.js
CHANGED