@bian-womp/spark-remote 0.2.70 → 0.2.72
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/cjs/index.cjs +9 -37
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/cjs/src/RuntimeApiClient.d.ts +2 -4
- package/lib/cjs/src/RuntimeApiClient.d.ts.map +1 -1
- package/lib/cjs/src/server/RuntimeApiServer.d.ts.map +1 -1
- package/lib/cjs/src/server/runtime.d.ts +5 -5
- package/lib/cjs/src/server/runtime.d.ts.map +1 -1
- package/lib/esm/index.js +9 -37
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/src/RuntimeApiClient.d.ts +2 -4
- package/lib/esm/src/RuntimeApiClient.d.ts.map +1 -1
- package/lib/esm/src/server/RuntimeApiServer.d.ts.map +1 -1
- package/lib/esm/src/server/runtime.d.ts +5 -5
- package/lib/esm/src/server/runtime.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/server/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,IAAI,EACJ,aAAa,
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/server/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,IAAI,EACJ,aAAa,EACb,eAAe,EACf,kBAAkB,EACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,MAAM,EAKP,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,CAAC,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AAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClE;AAED,MAAM,MAAM,mBAAmB,GAAG;KAC/B,CAAC,IAAI,MAAM,UAAU,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,GACnE,CACE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,EACvB,OAAO,EAAE,iBAAiB,EAC1B,GAAG,IAAI,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAC/B,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAC9B,KAAK;CACV,CAAC;AAEF,wBAAsB,oBAAoB,CACxC,cAAc,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,EACvC,IAAI,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC,KAAK,IAAI,EACzC,UAAU,CAAC,EAAE,mBAAmB,GAC/B,OAAO,CAAC,UAAU,CAAC,CA8WrB"}
|
package/lib/esm/index.js
CHANGED
|
@@ -384,11 +384,13 @@ async function createRuntimeAdapter(createRegistry, send, extensions) {
|
|
|
384
384
|
},
|
|
385
385
|
setExtData: (data) => {
|
|
386
386
|
if (!data || typeof data !== "object") {
|
|
387
|
+
// Clear all extData when called with non-object (backward-compatible)
|
|
387
388
|
extData = {};
|
|
388
389
|
return;
|
|
389
390
|
}
|
|
390
|
-
//
|
|
391
|
-
|
|
391
|
+
// Merge with existing extData so that callers can update a subset of fields
|
|
392
|
+
// (e.g., { ui } or { runtime }) without dropping the other ones.
|
|
393
|
+
extData = { ...extData, ...data };
|
|
392
394
|
},
|
|
393
395
|
getExtData: () => {
|
|
394
396
|
return extData;
|
|
@@ -449,8 +451,6 @@ async function createRuntimeAdapter(createRegistry, send, extensions) {
|
|
|
449
451
|
commit: async (reason) => { },
|
|
450
452
|
undo: async () => false,
|
|
451
453
|
redo: async () => false,
|
|
452
|
-
canUndo: async () => false,
|
|
453
|
-
canRedo: async () => false,
|
|
454
454
|
describeRegistry: () => {
|
|
455
455
|
// types (include enum options when available)
|
|
456
456
|
const types = Array.from(registry.types.entries()).map(([id, d]) => {
|
|
@@ -665,8 +665,6 @@ async function createRuntimeAdapter(createRegistry, send, extensions) {
|
|
|
665
665
|
cancelNodeRuns: wrapMethod("cancelNodeRuns", originalApi.cancelNodeRuns),
|
|
666
666
|
undo: wrapMethod("undo", originalApi.undo),
|
|
667
667
|
redo: wrapMethod("redo", originalApi.redo),
|
|
668
|
-
canUndo: wrapMethod("canUndo", originalApi.canUndo),
|
|
669
|
-
canRedo: wrapMethod("canRedo", originalApi.canRedo),
|
|
670
668
|
};
|
|
671
669
|
return extendedApi;
|
|
672
670
|
}
|
|
@@ -1181,9 +1179,11 @@ class RuntimeApiClient {
|
|
|
1181
1179
|
}
|
|
1182
1180
|
async commit(reason) {
|
|
1183
1181
|
const transport = await this.ensureConnected();
|
|
1184
|
-
await transport.request({
|
|
1182
|
+
const res = await transport.request({
|
|
1185
1183
|
message: { type: "Commit", payload: { reason } },
|
|
1186
1184
|
});
|
|
1185
|
+
const payload = res?.message || {};
|
|
1186
|
+
return payload.history;
|
|
1187
1187
|
}
|
|
1188
1188
|
async undo() {
|
|
1189
1189
|
const transport = await this.ensureConnected();
|
|
@@ -1201,22 +1201,6 @@ class RuntimeApiClient {
|
|
|
1201
1201
|
const payload = res?.message || {};
|
|
1202
1202
|
return payload.success ?? false;
|
|
1203
1203
|
}
|
|
1204
|
-
async canUndo() {
|
|
1205
|
-
const transport = await this.ensureConnected();
|
|
1206
|
-
const res = await transport.request({
|
|
1207
|
-
message: { type: "CanUndo" },
|
|
1208
|
-
});
|
|
1209
|
-
const payload = res?.message || {};
|
|
1210
|
-
return payload.canUndo ?? false;
|
|
1211
|
-
}
|
|
1212
|
-
async canRedo() {
|
|
1213
|
-
const transport = await this.ensureConnected();
|
|
1214
|
-
const res = await transport.request({
|
|
1215
|
-
message: { type: "CanRedo" },
|
|
1216
|
-
});
|
|
1217
|
-
const payload = res?.message || {};
|
|
1218
|
-
return payload.canRedo ?? false;
|
|
1219
|
-
}
|
|
1220
1204
|
/**
|
|
1221
1205
|
* Dispose the client and close the transport connection.
|
|
1222
1206
|
* Idempotent: safe to call multiple times.
|
|
@@ -1474,8 +1458,8 @@ class RuntimeApiServer {
|
|
|
1474
1458
|
}
|
|
1475
1459
|
case "Commit": {
|
|
1476
1460
|
this.logCommand("Commit", env);
|
|
1477
|
-
await this.runtimeApi.commit(msg.payload.reason);
|
|
1478
|
-
ack();
|
|
1461
|
+
const history = await this.runtimeApi.commit(msg.payload.reason);
|
|
1462
|
+
ack(history ? { history } : undefined);
|
|
1479
1463
|
break;
|
|
1480
1464
|
}
|
|
1481
1465
|
case "Undo": {
|
|
@@ -1490,18 +1474,6 @@ class RuntimeApiServer {
|
|
|
1490
1474
|
ack({ success });
|
|
1491
1475
|
break;
|
|
1492
1476
|
}
|
|
1493
|
-
case "CanUndo": {
|
|
1494
|
-
this.logCommand("CanUndo", env);
|
|
1495
|
-
const canUndo = await this.runtimeApi.canUndo();
|
|
1496
|
-
ack({ canUndo });
|
|
1497
|
-
break;
|
|
1498
|
-
}
|
|
1499
|
-
case "CanRedo": {
|
|
1500
|
-
this.logCommand("CanRedo", env);
|
|
1501
|
-
const canRedo = await this.runtimeApi.canRedo();
|
|
1502
|
-
ack({ canRedo });
|
|
1503
|
-
break;
|
|
1504
|
-
}
|
|
1505
1477
|
default: {
|
|
1506
1478
|
this.logCommand("Unknown type", env);
|
|
1507
1479
|
ack();
|