signetai 0.204.5 → 0.205.0

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/dist/mcp-stdio.js CHANGED
@@ -49062,6 +49062,303 @@ class DreamingBacklogTokenCache {
49062
49062
  }
49063
49063
  }
49064
49064
 
49065
+ // ../../platform/daemon/src/pipeline/dreaming-live-events.ts
49066
+ var DREAMING_LIVE_MAX_EVENTS = 256;
49067
+ var DREAMING_LIVE_MAX_SUBSCRIBERS = 16;
49068
+ var DREAMING_LIVE_MAX_PASSES = 32;
49069
+ var DREAMING_LIVE_MAX_EVENT_CHARS = 48000;
49070
+ var DREAMING_LIVE_MAX_RAW_CHARS = 16000;
49071
+ var DREAMING_LIVE_TERMINAL_RETENTION_MS = 10 * 60000;
49072
+ function nowIso() {
49073
+ return new Date().toISOString();
49074
+ }
49075
+ function asRecord(value) {
49076
+ return typeof value === "object" && value !== null && !Array.isArray(value) ? { ...value } : {};
49077
+ }
49078
+ function safeJson(value) {
49079
+ try {
49080
+ const json2 = JSON.stringify(value);
49081
+ return json2 === undefined ? "null" : json2;
49082
+ } catch (error51) {
49083
+ return JSON.stringify({ serializationError: error51 instanceof Error ? error51.message : String(error51) });
49084
+ }
49085
+ }
49086
+ function truncatedJsonValue(serialized, maxChars) {
49087
+ const base = { truncated: true, originalChars: serialized.length };
49088
+ let preview = serialized.slice(0, Math.max(0, maxChars - safeJson(base).length - 16));
49089
+ let result = { ...base, preview };
49090
+ while (safeJson(result).length > maxChars && preview.length > 0) {
49091
+ preview = preview.slice(0, Math.max(0, preview.length - Math.max(1, Math.ceil(preview.length / 10))));
49092
+ result = { ...base, preview };
49093
+ }
49094
+ return result;
49095
+ }
49096
+ function boundDreamingLiveValue(value, maxChars = DREAMING_LIVE_MAX_RAW_CHARS) {
49097
+ const json2 = safeJson(value);
49098
+ if (json2.length <= maxChars)
49099
+ return value;
49100
+ return truncatedJsonValue(json2, maxChars);
49101
+ }
49102
+ function boundString(value, maxChars) {
49103
+ return value.length <= maxChars ? value : `${value.slice(0, maxChars)}…`;
49104
+ }
49105
+ function boundMetadataString(value, maxChars = 512) {
49106
+ return boundString(value, maxChars);
49107
+ }
49108
+ function boundNullableMetadataString(value, maxChars) {
49109
+ return value == null ? null : boundString(value, maxChars);
49110
+ }
49111
+ function boundEventData(value) {
49112
+ const data = {};
49113
+ for (const [key, rawValue] of Object.entries(value)) {
49114
+ if (key === "raw") {
49115
+ data[key] = boundDreamingLiveValue(rawValue, DREAMING_LIVE_MAX_RAW_CHARS);
49116
+ } else if (typeof rawValue === "string") {
49117
+ data[key] = boundString(rawValue, 12000);
49118
+ } else {
49119
+ data[key] = boundDreamingLiveValue(rawValue, 12000);
49120
+ }
49121
+ }
49122
+ const serialized = safeJson(data);
49123
+ if (serialized.length <= DREAMING_LIVE_MAX_EVENT_CHARS)
49124
+ return data;
49125
+ const compact = {};
49126
+ for (const [key, rawValue] of Object.entries(data)) {
49127
+ if (key === "raw") {
49128
+ compact[key] = boundDreamingLiveValue(rawValue, 4000);
49129
+ } else if (typeof rawValue === "string") {
49130
+ compact[key] = boundString(rawValue, 2000);
49131
+ } else {
49132
+ compact[key] = boundDreamingLiveValue(rawValue, 4000);
49133
+ }
49134
+ }
49135
+ const compactSerialized = safeJson(compact);
49136
+ if (compactSerialized.length <= DREAMING_LIVE_MAX_EVENT_CHARS)
49137
+ return compact;
49138
+ return truncatedJsonValue(serialized, DREAMING_LIVE_MAX_EVENT_CHARS);
49139
+ }
49140
+ function metadataFromInput(input) {
49141
+ return {
49142
+ passId: boundMetadataString(input.passId),
49143
+ agentId: boundMetadataString(input.agentId),
49144
+ mode: boundMetadataString(input.mode),
49145
+ status: "running",
49146
+ startedAt: boundMetadataString(input.startedAt ?? nowIso(), 128),
49147
+ completedAt: null,
49148
+ summary: null,
49149
+ error: null
49150
+ };
49151
+ }
49152
+ function isTerminal2(status) {
49153
+ return status !== "running";
49154
+ }
49155
+ function isTerminalEvent(event) {
49156
+ return event.type === "pass_completed" || event.type === "pass_failed";
49157
+ }
49158
+
49159
+ class DreamingLiveEventHub {
49160
+ passes = new Map;
49161
+ startPass(input) {
49162
+ this.prune();
49163
+ const existing = this.passes.get(input.passId);
49164
+ if (existing) {
49165
+ existing.metadata = {
49166
+ ...existing.metadata,
49167
+ agentId: boundMetadataString(input.agentId),
49168
+ mode: boundMetadataString(input.mode),
49169
+ startedAt: boundMetadataString(input.startedAt ?? existing.metadata.startedAt, 128)
49170
+ };
49171
+ existing.lastTouchedAt = Date.now();
49172
+ return;
49173
+ }
49174
+ if (this.passes.size >= DREAMING_LIVE_MAX_PASSES)
49175
+ return;
49176
+ const pass = {
49177
+ metadata: metadataFromInput(input),
49178
+ nextCursor: 1,
49179
+ events: [],
49180
+ subscribers: new Set,
49181
+ lastTouchedAt: Date.now()
49182
+ };
49183
+ this.passes.set(input.passId, pass);
49184
+ this.append(pass, "pass_started", {
49185
+ agentId: input.agentId,
49186
+ mode: input.mode,
49187
+ startedAt: pass.metadata.startedAt
49188
+ });
49189
+ }
49190
+ ensurePass(input) {
49191
+ const existing = this.passes.get(input.passId);
49192
+ if (!existing) {
49193
+ this.startPass(input);
49194
+ const created = this.passes.get(input.passId);
49195
+ if (created) {
49196
+ created.metadata = {
49197
+ ...created.metadata,
49198
+ status: boundMetadataString(input.status ?? created.metadata.status),
49199
+ completedAt: boundNullableMetadataString(input.completedAt ?? created.metadata.completedAt, 128),
49200
+ summary: boundNullableMetadataString(input.summary ?? created.metadata.summary, 12000),
49201
+ error: boundNullableMetadataString(input.error ?? created.metadata.error, 12000)
49202
+ };
49203
+ this.appendRecoveredTerminal(created);
49204
+ }
49205
+ return;
49206
+ }
49207
+ if (isTerminal2(existing.metadata.status) && (input.status === undefined || input.status === "running")) {
49208
+ existing.lastTouchedAt = Date.now();
49209
+ return;
49210
+ }
49211
+ existing.metadata = {
49212
+ ...existing.metadata,
49213
+ status: boundMetadataString(input.status ?? existing.metadata.status),
49214
+ completedAt: boundNullableMetadataString(input.completedAt ?? existing.metadata.completedAt, 128),
49215
+ summary: boundNullableMetadataString(input.summary ?? existing.metadata.summary, 12000),
49216
+ error: boundNullableMetadataString(input.error ?? existing.metadata.error, 12000)
49217
+ };
49218
+ existing.lastTouchedAt = Date.now();
49219
+ this.appendRecoveredTerminal(existing);
49220
+ }
49221
+ publish(passId, type, data = {}) {
49222
+ const pass = this.passes.get(passId);
49223
+ if (!pass || isTerminal2(pass.metadata.status) && type !== "pass_completed" && type !== "pass_failed")
49224
+ return;
49225
+ this.append(pass, type, data);
49226
+ }
49227
+ finish(passId, status, data = {}) {
49228
+ const pass = this.passes.get(passId);
49229
+ if (!pass)
49230
+ return;
49231
+ if (isTerminal2(pass.metadata.status))
49232
+ return;
49233
+ const completedAt = nowIso();
49234
+ const summary = typeof data.summary === "string" ? boundString(data.summary, 12000) : null;
49235
+ const error51 = typeof data.error === "string" ? boundString(data.error, 12000) : null;
49236
+ pass.metadata = { ...pass.metadata, status, completedAt, summary, error: error51 };
49237
+ this.append(pass, status === "completed" ? "pass_completed" : "pass_failed", {
49238
+ ...data,
49239
+ status,
49240
+ completedAt,
49241
+ ...summary === null ? {} : { summary },
49242
+ ...error51 === null ? {} : { error: error51 }
49243
+ });
49244
+ }
49245
+ getSnapshot(passId) {
49246
+ const pass = this.passes.get(passId);
49247
+ if (!pass)
49248
+ return null;
49249
+ return this.snapshot(pass);
49250
+ }
49251
+ subscribe(passId, afterCursor, listener) {
49252
+ const pass = this.passes.get(passId);
49253
+ if (!pass)
49254
+ return null;
49255
+ if (pass.subscribers.size >= DREAMING_LIVE_MAX_SUBSCRIBERS) {
49256
+ throw new Error("Too many viewers are attached to this Dreaming pass");
49257
+ }
49258
+ pass.subscribers.add(listener);
49259
+ pass.lastTouchedAt = Date.now();
49260
+ const requested = afterCursor ?? 0;
49261
+ const latest = pass.nextCursor - 1;
49262
+ const first = pass.events[0]?.cursor ?? null;
49263
+ let gap = null;
49264
+ if (requested > latest) {
49265
+ gap = {
49266
+ requestedCursor: requested,
49267
+ availableFrom: first,
49268
+ availableTo: latest,
49269
+ reason: "cursor_ahead"
49270
+ };
49271
+ } else if (first !== null && requested < first - 1) {
49272
+ gap = {
49273
+ requestedCursor: requested,
49274
+ availableFrom: first,
49275
+ availableTo: latest,
49276
+ reason: "buffer_exhausted"
49277
+ };
49278
+ }
49279
+ const replay = pass.events.filter((event) => event.cursor > requested);
49280
+ let subscribed = true;
49281
+ return {
49282
+ snapshot: this.snapshot(pass),
49283
+ replay,
49284
+ gap,
49285
+ unsubscribe: () => {
49286
+ if (!subscribed)
49287
+ return;
49288
+ subscribed = false;
49289
+ pass.subscribers.delete(listener);
49290
+ pass.lastTouchedAt = Date.now();
49291
+ }
49292
+ };
49293
+ }
49294
+ getSubscriberCount(passId) {
49295
+ if (passId === undefined)
49296
+ return [...this.passes.values()].reduce((total, pass) => total + pass.subscribers.size, 0);
49297
+ return this.passes.get(passId)?.subscribers.size ?? 0;
49298
+ }
49299
+ reset() {
49300
+ this.passes.clear();
49301
+ }
49302
+ append(pass, type, input) {
49303
+ const event = {
49304
+ passId: pass.metadata.passId,
49305
+ agentId: pass.metadata.agentId,
49306
+ cursor: pass.nextCursor++,
49307
+ timestamp: nowIso(),
49308
+ type,
49309
+ data: boundEventData(asRecord(input))
49310
+ };
49311
+ pass.events.push(event);
49312
+ if (pass.events.length > DREAMING_LIVE_MAX_EVENTS)
49313
+ pass.events.splice(0, pass.events.length - DREAMING_LIVE_MAX_EVENTS);
49314
+ pass.lastTouchedAt = Date.now();
49315
+ for (const listener of [...pass.subscribers]) {
49316
+ try {
49317
+ listener(event);
49318
+ } catch {}
49319
+ }
49320
+ }
49321
+ snapshot(pass) {
49322
+ return {
49323
+ ...pass.metadata,
49324
+ cursor: pass.nextCursor - 1,
49325
+ replayFrom: pass.events[0]?.cursor ?? null,
49326
+ replayTo: pass.events.at(-1)?.cursor ?? null
49327
+ };
49328
+ }
49329
+ appendRecoveredTerminal(pass) {
49330
+ if (!isTerminal2(pass.metadata.status) || pass.events.some((event) => isTerminalEvent(event)))
49331
+ return;
49332
+ this.append(pass, pass.metadata.status === "completed" ? "pass_completed" : "pass_failed", {
49333
+ status: pass.metadata.status,
49334
+ completedAt: pass.metadata.completedAt,
49335
+ ...pass.metadata.summary === null ? {} : { summary: pass.metadata.summary },
49336
+ ...pass.metadata.error === null ? {} : { error: pass.metadata.error }
49337
+ });
49338
+ }
49339
+ prune() {
49340
+ const cutoff = Date.now() - DREAMING_LIVE_TERMINAL_RETENTION_MS;
49341
+ for (const [passId, pass] of this.passes) {
49342
+ if (pass.subscribers.size === 0 && isTerminal2(pass.metadata.status) && pass.lastTouchedAt < cutoff) {
49343
+ this.passes.delete(passId);
49344
+ }
49345
+ }
49346
+ if (this.passes.size < DREAMING_LIVE_MAX_PASSES)
49347
+ return;
49348
+ const candidates2 = [...this.passes.entries()].filter(([, pass]) => pass.subscribers.size === 0).sort(([, left], [, right]) => {
49349
+ const leftTerminal = isTerminal2(left.metadata.status) ? 0 : 1;
49350
+ const rightTerminal = isTerminal2(right.metadata.status) ? 0 : 1;
49351
+ return leftTerminal - rightTerminal || left.lastTouchedAt - right.lastTouchedAt;
49352
+ });
49353
+ for (const [passId] of candidates2) {
49354
+ if (this.passes.size < DREAMING_LIVE_MAX_PASSES)
49355
+ break;
49356
+ this.passes.delete(passId);
49357
+ }
49358
+ }
49359
+ }
49360
+ var dreamingLiveEvents = new DreamingLiveEventHub;
49361
+
49065
49362
  // ../../node_modules/.bun/js-tiktoken@1.0.21/node_modules/js-tiktoken/dist/chunk-VL2OQCWN.js
49066
49363
  var import_base64_js = __toESM(require_base64_js(), 1);
49067
49364
  var __defProp3 = Object.defineProperty;
@@ -1,43 +1,43 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "version": "0.204.5",
3
+ "version": "0.205.0",
4
4
  "assets": [
5
5
  {
6
6
  "name": "signet-darwin-arm64",
7
7
  "platform": "darwin-arm64",
8
- "sha256": "e5043117edd929228aef331293d3e8cb9fb370c9f27162f0f9787ebe6acfcdc4",
9
- "size": 140013088
8
+ "sha256": "e42ec2e6c14f508555c7d8541988c3d3665967a66bb329e375201db2f59c08f8",
9
+ "size": 140062624
10
10
  },
11
11
  {
12
12
  "name": "signet-darwin-x64",
13
13
  "platform": "darwin-x64",
14
- "sha256": "e169bbde63261ad68b9e4fb67b01a46522fd9a3255d89faca6cd967030018b58",
15
- "size": 144869952
14
+ "sha256": "9baa2a2de27cbfc4f86f7232da386b24694fb848ac0198ef10bdf42c622c6b6f",
15
+ "size": 144919104
16
16
  },
17
17
  {
18
18
  "name": "signet-linux-arm64",
19
19
  "platform": "linux-arm64",
20
- "sha256": "381cffba0e803d3640f711499178ba24b61dd907129c1f6fdff7c4cee9ac30c5",
21
- "size": 184465846
20
+ "sha256": "6334b1297b638777d4080dd7c39638f9748f11c90b556b7cbaf394b1bd03179b",
21
+ "size": 184508656
22
22
  },
23
23
  {
24
24
  "name": "signet-linux-x64",
25
25
  "platform": "linux-x64",
26
- "sha256": "6ff1e08f4ffa9585fcc3edfa308a9d51ba314ef681a62a3559ef8049855d0149",
27
- "size": 186839213
26
+ "sha256": "72f0f586bee2ed9bc53e272890253fed89f0e4336a2590cbdf6e023c51701e36",
27
+ "size": 186882023
28
28
  },
29
29
  {
30
30
  "name": "signet-win32-x64.exe",
31
31
  "platform": "win32-x64",
32
- "sha256": "ea4eddc12a38298d1dbc2ecd7c589cb1d3e92118584d51cee5980a9853a6ae96",
33
- "size": 194911744
32
+ "sha256": "504ae86fefd1ec69f0fc3e73cde4f8fd13ffacd3bc2ef6103a673d0c6d85bdaf",
33
+ "size": 194954752
34
34
  }
35
35
  ],
36
36
  "components": {
37
37
  "connectors": {
38
- "url": "signet-connectors-0.204.5.tar.gz",
39
- "sha256": "ff7041466138922ea9be222f8651f32be720692a7aad8286aea65c357e3c29fe",
40
- "size": 21945
38
+ "url": "signet-connectors-0.205.0.tar.gz",
39
+ "sha256": "d2b9c818c1bbce8e7210c9afe6c97301c7d3d0ea71acae92e24c7e0c8f05e251",
40
+ "size": 21943
41
41
  }
42
42
  }
43
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "signetai",
3
- "version": "0.204.5",
3
+ "version": "0.205.0",
4
4
  "description": "Signet native CLI installer wrapper",
5
5
  "type": "module",
6
6
  "bin": {
@@ -65,10 +65,10 @@
65
65
  "access": "public"
66
66
  },
67
67
  "optionalDependencies": {
68
- "signetai-darwin-arm64": "https://github.com/Signet-AI/signetai/releases/download/v0.204.5/signetai-darwin-arm64-0.204.5.tgz",
69
- "signetai-darwin-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.204.5/signetai-darwin-x64-0.204.5.tgz",
70
- "signetai-linux-arm64": "https://github.com/Signet-AI/signetai/releases/download/v0.204.5/signetai-linux-arm64-0.204.5.tgz",
71
- "signetai-linux-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.204.5/signetai-linux-x64-0.204.5.tgz",
72
- "signetai-win32-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.204.5/signetai-win32-x64-0.204.5.tgz"
68
+ "signetai-darwin-arm64": "https://github.com/Signet-AI/signetai/releases/download/v0.205.0/signetai-darwin-arm64-0.205.0.tgz",
69
+ "signetai-darwin-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.205.0/signetai-darwin-x64-0.205.0.tgz",
70
+ "signetai-linux-arm64": "https://github.com/Signet-AI/signetai/releases/download/v0.205.0/signetai-linux-arm64-0.205.0.tgz",
71
+ "signetai-linux-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.205.0/signetai-linux-x64-0.205.0.tgz",
72
+ "signetai-win32-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.205.0/signetai-win32-x64-0.205.0.tgz"
73
73
  }
74
74
  }