@mulmoclaude/core 5.11.4 → 5.12.1
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/assets/helps/spreadsheet.md +6 -6
- package/dist/remote-host/index.cjs +1 -1
- package/dist/remote-host/index.d.ts +7 -1
- package/dist/remote-host/index.js +1 -1
- package/dist/remote-host/server/hostRunner.d.ts +2 -1
- package/dist/remote-host/server/index.cjs +30 -25
- package/dist/remote-host/server/index.cjs.map +1 -1
- package/dist/remote-host/server/index.d.ts +2 -1
- package/dist/remote-host/server/index.js +30 -25
- package/dist/remote-host/server/index.js.map +1 -1
- package/dist/remote-host/server/lifecycle.d.ts +2 -0
- package/dist/remote-host/server/presenceProbe.d.ts +0 -2
- package/dist/remote-host/server/withTimeout.d.ts +2 -0
- package/dist/{remote-host-CoNX9JEC.js → remote-host-9NNAvUhU.js} +7 -3
- package/dist/remote-host-9NNAvUhU.js.map +1 -0
- package/dist/{remote-host-BMjh_F-6.cjs → remote-host-CR5W9uj4.cjs} +7 -3
- package/dist/remote-host-CR5W9uj4.cjs.map +1 -0
- package/package.json +4 -4
- package/dist/remote-host-BMjh_F-6.cjs.map +0 -1
- package/dist/remote-host-CoNX9JEC.js.map +0 -1
|
@@ -22,15 +22,15 @@ Never pre-calculate — let the spreadsheet compute using cell refs, functions,
|
|
|
22
22
|
|
|
23
23
|
## Available Functions
|
|
24
24
|
|
|
25
|
-
Only these are available. A formula that calls any other function shows an error (such as `#NAME?`) instead of a result.
|
|
25
|
+
Only these are available, plus any the workbook defines in its `functions` field. A formula that calls any other function shows an error (such as `#NAME?`) instead of a result.
|
|
26
26
|
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
- Logical: AND, FALSE, IF, IFERROR, IFNA, IFS, NOT, OR, TRUE
|
|
27
|
+
- Statistical: ANOVA.TEST, AUTOCORREL, AVEDEV, AVERAGE, AVERAGEA, AVERAGEIF, AVERAGEIFS, BETA.DIST, BETA.INV, BETAINV, BINOM.DIST, BINOM.INV, BINOMDIST, CHIDIST, CHIINV, CHISQ.DIST, CHISQ.DIST.RT, CHISQ.INV, CHISQ.INV.RT, CHISQ.TEST, CHITEST, CONFIDENCE.NORM, CONFIDENCE.T, CORREL, COUNT, COUNTA, COUNTBLANK, COUNTIF, COUNTIFS, COVARIANCE.P, COVARIANCE.S, CRITBINOM, DECOMPOSE, DEVSQ, EMA, EXPON.DIST, EXPONDIST, F.DIST, F.DIST.RT, F.INV, F.INV.RT, F.TEST, FDIST, FINV, FISHER, FISHERINV, FORECAST, FORECAST.ETS, FORECAST.ETS.CONFINT, FORECAST.ETS.SEASONALITY, FORECAST.LINEAR, FREQUENCY, FTEST, GAMMA.DIST, GAMMA.INV, GAMMADIST, GAMMAINV, GAMMALN, GAMMALN.PRECISE, GAUSS, GEOMEAN, GROWTH, HARMEAN, HYPGEOM.DIST, INTERCEPT, KENDALL, KS.TEST, KURT, LARGE, LINEST, LOGEST, LOGINV, LOGNORM.DIST, LOGNORM.INV, MANNWHITNEY.TEST, MAX, MAXA, MAXIFS, MEDIAN, MIN, MINA, MINIFS, MODE, MODE.SNGL, NEGBINOM.DIST, NORM.DIST, NORM.INV, NORM.S.DIST, NORM.S.INV, PEARSON, PERCENTILE, PERCENTILE.EXC, PERCENTILE.INC, PERCENTRANK, PERCENTRANK.EXC, PERCENTRANK.INC, PHI, POISSON, POISSON.DIST, PROB, QUARTILE, QUARTILE.EXC, QUARTILE.INC, RANK, RANK.AVG, RANK.EQ, RSQ, SHAPIRO.TEST, SKEW, SKEW.P, SLOPE, SMALL, SPEARMAN, STANDARDIZE, STDEV, STDEV.P, STDEV.S, STDEVP, STEYX, SUM, SUMIF, SUMIFS, T.DIST, T.DIST.2T, T.DIST.RT, T.INV, T.INV.2T, T.TEST, TREND, TRIMMEAN, TTEST, VAR, VAR.P, VAR.S, VARP, WEIBULL, WEIBULL.DIST, WILCOXON.TEST, Z.TEST, ZTEST
|
|
28
|
+
- Mathematical: ABS, CEILING, EXP, FLOOR, INT, LN, LOG, LOG10, MDETERM, MINVERSE, MMULT, MOD, MUNIT, PI, POWER, RAND, RANDARRAY, RANDBETWEEN, ROUND, ROUNDDOWN, ROUNDUP, SEQUENCE, SIGN, SQRT, SUMPRODUCT, TRUNC
|
|
29
|
+
- Logical: AND, BYCOL, BYROW, FALSE, IF, IFERROR, IFNA, IFS, LAMBDA, LET, MAP, NOT, OR, REDUCE, TRUE
|
|
30
30
|
- Text: CONCAT, CONCATENATE, EXACT, FIND, LEFT, LEN, LOWER, MID, PROPER, REPLACE, RIGHT, SEARCH, SUBSTITUTE, TEXT, TRIM, UPPER, VALUE
|
|
31
|
-
- Date & Time: DATE, DATEDIF, DAY, HOUR, MINUTE, MONTH, NOW, SECOND, TIME, TODAY, YEAR
|
|
32
|
-
- Lookup & Reference: HLOOKUP, INDEX, MATCH, VLOOKUP, XLOOKUP
|
|
33
31
|
- Financial: FV, IPMT, IRR, NPER, NPV, PMT, PPMT, PV, RATE
|
|
32
|
+
- Lookup & Reference: CHOOSECOLS, CHOOSEROWS, COLUMN, COLUMNS, DROP, FILTER, GROUPBY, HLOOKUP, HSTACK, INDEX, MATCH, PIVOTBY, ROW, ROWS, SORT, SORTBY, TAKE, TRANSPOSE, UNIQUE, VLOOKUP, VSTACK, XLOOKUP, XMATCH
|
|
33
|
+
- Date & Time: DATE, DATEDIF, DAY, DAYS, EDATE, EOMONTH, HOUR, MINUTE, MONTH, NETWORKDAYS, NOW, SECOND, TIME, TODAY, WEEKDAY, WORKDAY, YEAR
|
|
34
34
|
|
|
35
35
|
## Dates
|
|
36
36
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_remote_host = require("../remote-host-
|
|
2
|
+
const require_remote_host = require("../remote-host-CR5W9uj4.cjs");
|
|
3
3
|
exports.COMMAND_SCOPE_PARAM = require_remote_host.COMMAND_SCOPE_PARAM;
|
|
4
4
|
exports.REMOTE_HOST_PROTOCOL_VERSION = require_remote_host.REMOTE_HOST_PROTOCOL_VERSION;
|
|
5
5
|
exports.RUNNER_HEALTH_STATES = require_remote_host.RUNNER_HEALTH_STATES;
|
|
@@ -89,13 +89,19 @@ export declare const COMMAND_SCOPE_PARAM = "project";
|
|
|
89
89
|
* deliberately never sees a path. */
|
|
90
90
|
export declare const readCommandScope: (params: JsonObject) => string | undefined;
|
|
91
91
|
export declare const REMOTE_HOST_PROTOCOL_VERSION = 2;
|
|
92
|
+
export interface HostMachine {
|
|
93
|
+
machineId: string;
|
|
94
|
+
label: string;
|
|
95
|
+
}
|
|
92
96
|
export interface HostPresence {
|
|
93
97
|
online: boolean;
|
|
94
98
|
hostId: string;
|
|
95
99
|
protocolVersion: number;
|
|
96
100
|
capabilities: string[];
|
|
101
|
+
machineId?: string;
|
|
102
|
+
label?: string;
|
|
97
103
|
}
|
|
98
|
-
export declare const buildHostPresence: (channel: Channel, handlers: CommandHandlers, online: boolean) => HostPresence;
|
|
104
|
+
export declare const buildHostPresence: (channel: Channel, handlers: CommandHandlers, online: boolean, machine?: HostMachine) => HostPresence;
|
|
99
105
|
export declare const commandsCollection: (firestore: Firestore, channel: Channel) => CollectionReference<DocumentData>;
|
|
100
106
|
export declare const hostDoc: (firestore: Firestore, channel: Channel) => DocumentReference<DocumentData>;
|
|
101
107
|
export { RUNNER_HEALTH_STATES, isRunnerHealth, isRunnerHealthState } from './health.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as COMMAND_SCOPE_PARAM, n as REMOTE_HOST_PROTOCOL_VERSION, d as RUNNER_HEALTH_STATES, r as buildHostPresence, i as byCreatedAt, a as coerceJsonObject, o as commandsCollection, s as hostDoc, c as isExpired, f as isRunnerHealth, p as isRunnerHealthState, l as readCommandScope, u as toJsonObject } from "../remote-host-
|
|
1
|
+
export { t as COMMAND_SCOPE_PARAM, n as REMOTE_HOST_PROTOCOL_VERSION, d as RUNNER_HEALTH_STATES, r as buildHostPresence, i as byCreatedAt, a as coerceJsonObject, o as commandsCollection, s as hostDoc, c as isExpired, f as isRunnerHealth, p as isRunnerHealthState, l as readCommandScope, u as toJsonObject } from "../remote-host-9NNAvUhU.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Firestore } from 'firebase/firestore';
|
|
2
|
-
import { Channel, Command, CommandHandler, CommandHandlers } from '../index.js';
|
|
2
|
+
import { Channel, Command, CommandHandler, CommandHandlers, HostMachine } from '../index.js';
|
|
3
3
|
import { backoffDelayMs, classifyListenerError, LISTEN_RETRY_WINDOW_MS, shouldGiveUpListening } from '../../firestore/listen.js';
|
|
4
4
|
export declare const DEFAULT_HEARTBEAT_MS = 60000;
|
|
5
5
|
export { backoffDelayMs, classifyListenerError, LISTEN_RETRY_WINDOW_MS, shouldGiveUpListening };
|
|
@@ -14,6 +14,7 @@ export interface HostRunnerOptions {
|
|
|
14
14
|
onExpire?: ((command: Command, uid: string) => void | Promise<void>) | undefined;
|
|
15
15
|
heartbeatMs?: number | undefined;
|
|
16
16
|
expectedUndefined?: Record<string, readonly string[]>;
|
|
17
|
+
machine?: HostMachine | undefined;
|
|
17
18
|
}
|
|
18
19
|
export interface Claim {
|
|
19
20
|
method: string;
|
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_dist = require("../../dist-BZ62pKuU.cjs");
|
|
3
3
|
require("../../errorMessage-OEQzRwsi.cjs");
|
|
4
4
|
const require_listen = require("../../listen-N_8XdKz_.cjs");
|
|
5
|
-
const require_remote_host = require("../../remote-host-
|
|
5
|
+
const require_remote_host = require("../../remote-host-CR5W9uj4.cjs");
|
|
6
6
|
let firebase_firestore = require("firebase/firestore");
|
|
7
7
|
let node_perf_hooks = require("node:perf_hooks");
|
|
8
8
|
let firebase_auth = require("firebase/auth");
|
|
@@ -283,7 +283,7 @@ var buildPresenceBeat = (firestore, channel, handlers, options, onStale) => {
|
|
|
283
283
|
});
|
|
284
284
|
return createPresenceBeat({
|
|
285
285
|
write: (online) => (0, firebase_firestore.setDoc)(presence, {
|
|
286
|
-
...require_remote_host.buildHostPresence(channel, handlers, online),
|
|
286
|
+
...require_remote_host.buildHostPresence(channel, handlers, online, options.machine),
|
|
287
287
|
updatedAt: (0, firebase_firestore.serverTimestamp)()
|
|
288
288
|
}),
|
|
289
289
|
onError: (message) => report(`presence write failed: ${message}`),
|
|
@@ -326,13 +326,13 @@ var startHostRunner = (firestore, channel, handlers, options = {}) => {
|
|
|
326
326
|
};
|
|
327
327
|
//#endregion
|
|
328
328
|
//#region src/remote-host/server/resilientRunner.ts
|
|
329
|
-
var ONE_SECOND_MS$
|
|
330
|
-
var ONE_MINUTE_MS = 60 * ONE_SECOND_MS$
|
|
331
|
-
var RECONNECT_BASE_MS = ONE_SECOND_MS$
|
|
329
|
+
var ONE_SECOND_MS$2 = 1e3;
|
|
330
|
+
var ONE_MINUTE_MS = 60 * ONE_SECOND_MS$2;
|
|
331
|
+
var RECONNECT_BASE_MS = ONE_SECOND_MS$2;
|
|
332
332
|
var RECONNECT_MAX_MS = ONE_MINUTE_MS;
|
|
333
333
|
var SETTLE_MS = ONE_MINUTE_MS;
|
|
334
334
|
var GIVE_UP_MS = 5 * ONE_MINUTE_MS;
|
|
335
|
-
var PROBE_INTERVAL_MS = 90 * ONE_SECOND_MS$
|
|
335
|
+
var PROBE_INTERVAL_MS = 90 * ONE_SECOND_MS$2;
|
|
336
336
|
var RESUME_GAP_MS = ONE_MINUTE_MS;
|
|
337
337
|
var reconnectDelayMs = (attempt) => Math.min(RECONNECT_MAX_MS, RECONNECT_BASE_MS * 2 ** attempt);
|
|
338
338
|
var errorText = (error) => error instanceof Error ? error.message : String(error);
|
|
@@ -365,7 +365,7 @@ var after = (ctx, delayMs, task) => {
|
|
|
365
365
|
return ctx.schedule(() => {
|
|
366
366
|
const overshootMs = ctx.now() - dueMs;
|
|
367
367
|
if (overshootMs > RESUME_GAP_MS) {
|
|
368
|
-
ctx.deps.log.warn(`host runner resumed after a ${Math.round(overshootMs / ONE_SECOND_MS$
|
|
368
|
+
ctx.deps.log.warn(`host runner resumed after a ${Math.round(overshootMs / ONE_SECOND_MS$2)}s gap; that time does not count as outage`);
|
|
369
369
|
ctx.downSinceMs = null;
|
|
370
370
|
ctx.attempt = 0;
|
|
371
371
|
}
|
|
@@ -438,14 +438,14 @@ async function settle(ctx) {
|
|
|
438
438
|
var giveUp = (ctx) => {
|
|
439
439
|
ctx.stopped = true;
|
|
440
440
|
clearProbe(ctx);
|
|
441
|
-
ctx.deps.log.warn(`host runner stayed down for ${Math.round(GIVE_UP_MS / ONE_SECOND_MS$
|
|
441
|
+
ctx.deps.log.warn(`host runner stayed down for ${Math.round(GIVE_UP_MS / ONE_SECOND_MS$2)}s, giving up (${ctx.lastError ?? "no error reported"})`);
|
|
442
442
|
setState(ctx, "offline");
|
|
443
443
|
ctx.deps.options.onClosed?.();
|
|
444
444
|
};
|
|
445
445
|
function scheduleRelaunch(ctx) {
|
|
446
446
|
const delayMs = reconnectDelayMs(ctx.attempt);
|
|
447
447
|
ctx.attempt += 1;
|
|
448
|
-
ctx.deps.log.warn(`host runner closed (${ctx.lastError ?? "no error reported"}); re-subscribing in ${Math.round(delayMs / ONE_SECOND_MS$
|
|
448
|
+
ctx.deps.log.warn(`host runner closed (${ctx.lastError ?? "no error reported"}); re-subscribing in ${Math.round(delayMs / ONE_SECOND_MS$2)}s`);
|
|
449
449
|
if (ctx.state !== "reconnecting") setState(ctx, "reconnecting");
|
|
450
450
|
ctx.cancelTimer = after(ctx, delayMs, () => launch(ctx));
|
|
451
451
|
}
|
|
@@ -509,6 +509,21 @@ function startResilientHostRunner(deps) {
|
|
|
509
509
|
};
|
|
510
510
|
}
|
|
511
511
|
//#endregion
|
|
512
|
+
//#region src/remote-host/server/withTimeout.ts
|
|
513
|
+
var ONE_SECOND_MS$1 = 1e3;
|
|
514
|
+
/** Reject once `timeoutMs` has passed, so a stalled read answers instead of hanging. */
|
|
515
|
+
var withTimeout = async (work, timeoutMs, what = "presence read") => {
|
|
516
|
+
const timer = { handle: null };
|
|
517
|
+
const deadline = new Promise((_, reject) => {
|
|
518
|
+
timer.handle = setTimeout(() => reject(/* @__PURE__ */ new Error(`${what} did not answer within ${Math.round(timeoutMs / ONE_SECOND_MS$1)}s`)), timeoutMs);
|
|
519
|
+
});
|
|
520
|
+
try {
|
|
521
|
+
return await Promise.race([work, deadline]);
|
|
522
|
+
} finally {
|
|
523
|
+
if (timer.handle) clearTimeout(timer.handle);
|
|
524
|
+
}
|
|
525
|
+
};
|
|
526
|
+
//#endregion
|
|
512
527
|
//#region src/remote-host/server/presenceProbe.ts
|
|
513
528
|
var ONE_SECOND_MS = 1e3;
|
|
514
529
|
var PRESENCE_STALE_MS = presenceStaleAfterMs();
|
|
@@ -528,18 +543,6 @@ var presenceIsFresh = (data, now, staleAfterMs = PRESENCE_STALE_MS) => {
|
|
|
528
543
|
if (data.online === false) return null;
|
|
529
544
|
return now - updatedAt < staleAfterMs;
|
|
530
545
|
};
|
|
531
|
-
/** Reject once `timeoutMs` has passed, so a stalled read answers instead of hanging. */
|
|
532
|
-
var withTimeout = async (work, timeoutMs) => {
|
|
533
|
-
const timer = { handle: null };
|
|
534
|
-
const deadline = new Promise((_, reject) => {
|
|
535
|
-
timer.handle = setTimeout(() => reject(/* @__PURE__ */ new Error(`presence read did not answer within ${Math.round(timeoutMs / ONE_SECOND_MS)}s`)), timeoutMs);
|
|
536
|
-
});
|
|
537
|
-
try {
|
|
538
|
-
return await Promise.race([work, deadline]);
|
|
539
|
-
} finally {
|
|
540
|
-
if (timer.handle) clearTimeout(timer.handle);
|
|
541
|
-
}
|
|
542
|
-
};
|
|
543
546
|
/** Reads the host's own presence document from the server and reports whether it is fresh. */
|
|
544
547
|
var createPresenceProbe = (deps) => {
|
|
545
548
|
const now = deps.now ?? Date.now;
|
|
@@ -550,12 +553,14 @@ var createPresenceProbe = (deps) => {
|
|
|
550
553
|
//#endregion
|
|
551
554
|
//#region src/remote-host/server/lifecycle.ts
|
|
552
555
|
var noop$1 = () => void 0;
|
|
556
|
+
var RESOLVE_HOST_ID_TIMEOUT_MS = 3e4;
|
|
553
557
|
var silentLogger = {
|
|
554
558
|
info: noop$1,
|
|
555
559
|
warn: noop$1,
|
|
556
560
|
debug: noop$1
|
|
557
561
|
};
|
|
558
562
|
var eventText = (event) => event.message ? `${event.phase} ${event.method} — ${event.message}` : `${event.phase} ${event.method}`;
|
|
563
|
+
var hostIdFor = async (deps, uid) => deps.resolveHostId ? withTimeout(deps.resolveHostId(uid), deps.resolveHostIdTimeoutMs ?? RESOLVE_HOST_ID_TIMEOUT_MS, "resolveHostId") : deps.hostId;
|
|
559
564
|
var createRemoteHost = (deps) => {
|
|
560
565
|
const log = deps.log ?? silentLogger;
|
|
561
566
|
let stopRunner = null;
|
|
@@ -575,11 +580,11 @@ var createRemoteHost = (deps) => {
|
|
|
575
580
|
connected: stopRunner !== null,
|
|
576
581
|
uid: deps.currentUid()
|
|
577
582
|
});
|
|
578
|
-
const attach = (uid, verb) => {
|
|
579
|
-
|
|
583
|
+
const attach = async (uid, verb) => {
|
|
584
|
+
const hostId = await hostIdFor(deps, uid).finally(stopIfRunning);
|
|
580
585
|
const runner = deps.startRunner({
|
|
581
586
|
uid,
|
|
582
|
-
hostId
|
|
587
|
+
hostId
|
|
583
588
|
}, deps.handlers, {
|
|
584
589
|
onEvent: (event) => log.debug(`host event: ${eventText(event)}`),
|
|
585
590
|
onExpire: deps.onExpire,
|
|
@@ -591,7 +596,7 @@ var createRemoteHost = (deps) => {
|
|
|
591
596
|
}
|
|
592
597
|
});
|
|
593
598
|
stopRunner = runner;
|
|
594
|
-
log.info(`${verb} as ${uid}, host runner started (hostId=${
|
|
599
|
+
log.info(`${verb} as ${uid}, host runner started (hostId=${hostId})`);
|
|
595
600
|
return status();
|
|
596
601
|
};
|
|
597
602
|
const connect = (idToken) => serialize(async () => attach(await deps.signIn(idToken), "connected"));
|