dsh-draw 0.1.1 → 0.1.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 CHANGED
@@ -1185,13 +1185,14 @@ var EngineRouter = class {
1185
1185
  //#region src/version.ts
1186
1186
  /**
1187
1187
  * The plugin version, hardcoded beside `package.json` so the release script
1188
- * bumps both and `tests/version.spec.ts` trips when they drift. Served in the
1189
- * `draw/status` snapshot so the settings panel shows which plugin build runs.
1188
+ * bumps both and the version tripwire in `tests/session-events.spec.ts` trips
1189
+ * when they drift. Served in the `draw/status` snapshot so the settings panel
1190
+ * shows which plugin build runs.
1190
1191
  *
1191
1192
  * @module dsh-draw/version
1192
1193
  */
1193
1194
  /** Plugin version; must equal the `version` field in `package.json`. */
1194
- const PLUGIN_VERSION = "0.1.1";
1195
+ const PLUGIN_VERSION = "0.1.3";
1195
1196
  //#endregion
1196
1197
  //#region src/service.ts
1197
1198
  /**
@@ -74,7 +74,9 @@ export interface PresentedDrawPanel {
74
74
  * Project the panel snapshot onto the settings row model.
75
75
  *
76
76
  * @param snapshot - the `draw/status` wire snapshot.
77
+ * @param now - clock override for the cooldown flag (default {@link Date.now});
78
+ * injected so the presenter stays a pure function of its inputs.
77
79
  * @returns the presented panel model.
78
80
  */
79
- export declare function presentDrawPanel(snapshot: DrawStatusSnapshot): PresentedDrawPanel;
81
+ export declare function presentDrawPanel(snapshot: DrawStatusSnapshot, now?: () => number): PresentedDrawPanel;
80
82
  //# sourceMappingURL=present.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"present.d.ts","sourceRoot":"","sources":["../../../src/client/present.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAEpD,8CAA8C;AAC9C,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,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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"}
@@ -60,9 +60,11 @@ export function presentDrawResult(block) {
60
60
  * Project the panel snapshot onto the settings row model.
61
61
  *
62
62
  * @param snapshot - the `draw/status` wire snapshot.
63
+ * @param now - clock override for the cooldown flag (default {@link Date.now});
64
+ * injected so the presenter stays a pure function of its inputs.
63
65
  * @returns the presented panel model.
64
66
  */
65
- export function presentDrawPanel(snapshot) {
67
+ export function presentDrawPanel(snapshot, now = Date.now) {
66
68
  return {
67
69
  pluginVersion: snapshot.pluginVersion,
68
70
  engines: snapshot.engines.map(engine => ({
@@ -76,7 +78,7 @@ export function presentDrawPanel(snapshot) {
76
78
  ...(engine.credential.source !== undefined ? { credentialSource: engine.credential.source } : {}),
77
79
  credentialWritable: engine.credential.writable,
78
80
  consecutiveFailures: engine.health.consecutiveFailures,
79
- coolingDown: engine.health.cooldownUntil !== null && engine.health.cooldownUntil > Date.now(),
81
+ coolingDown: engine.health.cooldownUntil !== null && engine.health.cooldownUntil > now(),
80
82
  lastError: engine.health.lastError,
81
83
  })),
82
84
  quota: { maxGenerationsPerSession: snapshot.quota.maxGenerationsPerSession, maxBytesPerSession: snapshot.quota.maxBytesPerSession },
@@ -1,10 +1,11 @@
1
1
  /**
2
2
  * The plugin version, hardcoded beside `package.json` so the release script
3
- * bumps both and `tests/version.spec.ts` trips when they drift. Served in the
4
- * `draw/status` snapshot so the settings panel shows which plugin build runs.
3
+ * bumps both and the version tripwire in `tests/session-events.spec.ts` trips
4
+ * when they drift. Served in the `draw/status` snapshot so the settings panel
5
+ * shows which plugin build runs.
5
6
  *
6
7
  * @module dsh-draw/version
7
8
  */
8
9
  /** Plugin version; must equal the `version` field in `package.json`. */
9
- export declare const PLUGIN_VERSION = "0.1.1";
10
+ export declare const PLUGIN_VERSION = "0.1.3";
10
11
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,wEAAwE;AACxE,eAAO,MAAM,cAAc,UAAU,CAAA"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,wEAAwE;AACxE,eAAO,MAAM,cAAc,UAAU,CAAA"}
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * The plugin version, hardcoded beside `package.json` so the release script
3
- * bumps both and `tests/version.spec.ts` trips when they drift. Served in the
4
- * `draw/status` snapshot so the settings panel shows which plugin build runs.
3
+ * bumps both and the version tripwire in `tests/session-events.spec.ts` trips
4
+ * when they drift. Served in the `draw/status` snapshot so the settings panel
5
+ * shows which plugin build runs.
5
6
  *
6
7
  * @module dsh-draw/version
7
8
  */
8
9
  /** Plugin version; must equal the `version` field in `package.json`. */
9
- export const PLUGIN_VERSION = '0.1.1';
10
+ export const PLUGIN_VERSION = '0.1.3';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-draw",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Unified static-image generation router for DeepSeek Harness: one image_generate tool with standard parameters, config-driven OpenAI-compatible engine routing (OpenAI Images, Zhipu CogView, and any compatible endpoint) with health-aware fallback, durable workspace attachment results, per-session quota accounting, an in-conversation result card, and a Plugins settings panel that stores API keys as credential references.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -89,7 +89,7 @@
89
89
  "attachments:write"
90
90
  ],
91
91
  "compatibility": {
92
- "dshVersions": ["0.1.0-rc.8"]
92
+ "dshVersions": ["0.1.1-rc.2"]
93
93
  },
94
94
  "capability": {
95
95
  "id": "image-generate-tool",
@@ -140,23 +140,23 @@
140
140
  "@deepseek-ai/cordis": "^4.0.1",
141
141
  "@deepseek-ai/cordis-plugin-include": "1.0.6",
142
142
  "@deepseek-ai/cordis-plugin-loader": "1.0.2",
143
- "@deepseek-ai/dsh-agent": "0.1.0-rc.8",
144
- "@deepseek-ai/dsh-api-remotes": "0.1.0-rc.8",
145
- "@deepseek-ai/dsh-attachment": "0.1.0-rc.8",
146
- "@deepseek-ai/dsh-attachment-local": "0.1.0-rc.8",
147
- "@deepseek-ai/dsh-brand": "0.1.0-rc.8",
148
- "@deepseek-ai/dsh-client-connection": "0.1.0-rc.8",
149
- "@deepseek-ai/dsh-client-locale": "0.1.0-rc.8",
150
- "@deepseek-ai/dsh-client-runtime": "0.1.0-rc.8",
151
- "@deepseek-ai/dsh-client-ui-settings": "0.1.0-rc.8",
152
- "@deepseek-ai/dsh-client-ui-slots": "0.1.0-rc.8",
153
- "@deepseek-ai/dsh-client-ui-tool": "0.1.0-rc.8",
154
- "@deepseek-ai/dsh-credentials": "0.1.0-rc.8",
155
- "@deepseek-ai/dsh-credentials-local": "0.1.0-rc.8",
156
- "@deepseek-ai/dsh-llm": "0.1.0-rc.8",
157
- "@deepseek-ai/dsh-session": "0.1.0-rc.8",
158
- "@deepseek-ai/dsh-tools": "0.1.0-rc.8",
159
- "@deepseek-ai/dsh-typert-protocol": "0.1.0-rc.8",
143
+ "@deepseek-ai/dsh-agent": "0.1.1-rc.2",
144
+ "@deepseek-ai/dsh-api-remotes": "0.1.1-rc.2",
145
+ "@deepseek-ai/dsh-attachment": "0.1.1-rc.2",
146
+ "@deepseek-ai/dsh-attachment-local": "0.1.1-rc.2",
147
+ "@deepseek-ai/dsh-brand": "0.1.1-rc.2",
148
+ "@deepseek-ai/dsh-client-connection": "0.1.1-rc.2",
149
+ "@deepseek-ai/dsh-client-locale": "0.1.1-rc.2",
150
+ "@deepseek-ai/dsh-client-runtime": "0.1.1-rc.2",
151
+ "@deepseek-ai/dsh-client-ui-settings": "0.1.1-rc.2",
152
+ "@deepseek-ai/dsh-client-ui-slots": "0.1.1-rc.2",
153
+ "@deepseek-ai/dsh-client-ui-tool": "0.1.1-rc.2",
154
+ "@deepseek-ai/dsh-credentials": "0.1.1-rc.2",
155
+ "@deepseek-ai/dsh-credentials-local": "0.1.1-rc.2",
156
+ "@deepseek-ai/dsh-llm": "0.1.1-rc.2",
157
+ "@deepseek-ai/dsh-session": "0.1.1-rc.2",
158
+ "@deepseek-ai/dsh-tools": "0.1.1-rc.2",
159
+ "@deepseek-ai/dsh-typert-protocol": "0.1.1-rc.2",
160
160
  "@deepseek-ai/schemastery": "^3.18.0",
161
161
  "@types/node": "^22.19.0",
162
162
  "@types/react": "18.3.31",
@@ -111,9 +111,11 @@ export interface PresentedDrawPanel {
111
111
  * Project the panel snapshot onto the settings row model.
112
112
  *
113
113
  * @param snapshot - the `draw/status` wire snapshot.
114
+ * @param now - clock override for the cooldown flag (default {@link Date.now});
115
+ * injected so the presenter stays a pure function of its inputs.
114
116
  * @returns the presented panel model.
115
117
  */
116
- export function presentDrawPanel(snapshot: DrawStatusSnapshot): PresentedDrawPanel {
118
+ export function presentDrawPanel(snapshot: DrawStatusSnapshot, now: () => number = Date.now): PresentedDrawPanel {
117
119
  return {
118
120
  pluginVersion: snapshot.pluginVersion,
119
121
  engines: snapshot.engines.map(engine => ({
@@ -127,7 +129,7 @@ export function presentDrawPanel(snapshot: DrawStatusSnapshot): PresentedDrawPan
127
129
  ...(engine.credential.source !== undefined ? { credentialSource: engine.credential.source } : {}),
128
130
  credentialWritable: engine.credential.writable,
129
131
  consecutiveFailures: engine.health.consecutiveFailures,
130
- coolingDown: engine.health.cooldownUntil !== null && engine.health.cooldownUntil > Date.now(),
132
+ coolingDown: engine.health.cooldownUntil !== null && engine.health.cooldownUntil > now(),
131
133
  lastError: engine.health.lastError,
132
134
  })),
133
135
  quota: { maxGenerationsPerSession: snapshot.quota.maxGenerationsPerSession, maxBytesPerSession: snapshot.quota.maxBytesPerSession },
package/src/version.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  /**
2
2
  * The plugin version, hardcoded beside `package.json` so the release script
3
- * bumps both and `tests/version.spec.ts` trips when they drift. Served in the
4
- * `draw/status` snapshot so the settings panel shows which plugin build runs.
3
+ * bumps both and the version tripwire in `tests/session-events.spec.ts` trips
4
+ * when they drift. Served in the `draw/status` snapshot so the settings panel
5
+ * shows which plugin build runs.
5
6
  *
6
7
  * @module dsh-draw/version
7
8
  */
8
9
 
9
10
  /** Plugin version; must equal the `version` field in `package.json`. */
10
- export const PLUGIN_VERSION = '0.1.1'
11
+ export const PLUGIN_VERSION = '0.1.3'