@moxt-ai/cli 0.11.0-beta.1 → 0.11.0-beta.2
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/index.cjs +33 -8
- package/dist/index.cjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -8753,6 +8753,24 @@ function boundedPayload(kind, payload) {
|
|
|
8753
8753
|
truncated: true
|
|
8754
8754
|
};
|
|
8755
8755
|
}
|
|
8756
|
+
function sanitizeJsonbValue(value) {
|
|
8757
|
+
if (typeof value === "string") {
|
|
8758
|
+
return value.replaceAll("\0", "");
|
|
8759
|
+
}
|
|
8760
|
+
if (Array.isArray(value)) {
|
|
8761
|
+
return value.map(sanitizeJsonbValue);
|
|
8762
|
+
}
|
|
8763
|
+
if (value !== null && typeof value === "object") {
|
|
8764
|
+
return sanitizeJsonbRecord(value);
|
|
8765
|
+
}
|
|
8766
|
+
return value;
|
|
8767
|
+
}
|
|
8768
|
+
function sanitizeJsonbRecord(value) {
|
|
8769
|
+
return Object.fromEntries(Object.entries(value).map(([key, item]) => [
|
|
8770
|
+
key,
|
|
8771
|
+
sanitizeJsonbValue(item)
|
|
8772
|
+
]));
|
|
8773
|
+
}
|
|
8756
8774
|
var import_node_crypto7, maximumEventBytes, maximumSpoolBytes, DurableLocalCodexAttempt;
|
|
8757
8775
|
var init_durable_attempt = __esm({
|
|
8758
8776
|
"../machine-connector/dist/runtime/local-codex-runtime/durable-attempt.js"() {
|
|
@@ -8832,7 +8850,7 @@ var init_durable_attempt = __esm({
|
|
|
8832
8850
|
async appendEvent(kind, payload, correlation = {}, occurredAt = (/* @__PURE__ */ new Date()).toISOString()) {
|
|
8833
8851
|
const holder = {};
|
|
8834
8852
|
await this.mutate(async () => {
|
|
8835
|
-
const safePayload = boundedPayload(kind, payload);
|
|
8853
|
+
const safePayload = boundedPayload(kind, sanitizeJsonbRecord(payload));
|
|
8836
8854
|
const event2 = {
|
|
8837
8855
|
eventId: (0, import_node_crypto7.randomUUID)(),
|
|
8838
8856
|
kind,
|
|
@@ -8861,7 +8879,10 @@ var init_durable_attempt = __esm({
|
|
|
8861
8879
|
return structuredClone(holder.value);
|
|
8862
8880
|
}
|
|
8863
8881
|
pendingEvents() {
|
|
8864
|
-
return structuredClone(this.state.events.filter((event2) => event2.sequence > this.state.acknowledgedSequence))
|
|
8882
|
+
return structuredClone(this.state.events.filter((event2) => event2.sequence > this.state.acknowledgedSequence).map((event2) => ({
|
|
8883
|
+
...event2,
|
|
8884
|
+
payload: sanitizeJsonbRecord(event2.payload)
|
|
8885
|
+
})));
|
|
8865
8886
|
}
|
|
8866
8887
|
async acknowledgeEvents(sequence) {
|
|
8867
8888
|
await this.mutate(async () => {
|
|
@@ -11539,6 +11560,7 @@ var init_daemon = __esm({
|
|
|
11539
11560
|
settleLifetime;
|
|
11540
11561
|
startupSettled;
|
|
11541
11562
|
settleStartup;
|
|
11563
|
+
startupComplete = false;
|
|
11542
11564
|
stopping = false;
|
|
11543
11565
|
leaseSafetyMarginMilliseconds;
|
|
11544
11566
|
leaseSeconds;
|
|
@@ -11604,6 +11626,8 @@ var init_daemon = __esm({
|
|
|
11604
11626
|
if (this.connections.length === 0) {
|
|
11605
11627
|
await this.logger.info("No Local Machine connections are configured");
|
|
11606
11628
|
}
|
|
11629
|
+
this.throwIfStopping();
|
|
11630
|
+
this.startupComplete = true;
|
|
11607
11631
|
this.settleStartup();
|
|
11608
11632
|
await Promise.all(this.connections.map(async (connection) => {
|
|
11609
11633
|
await this.runConnection(connection);
|
|
@@ -11682,6 +11706,7 @@ var init_daemon = __esm({
|
|
|
11682
11706
|
...worker.status()
|
|
11683
11707
|
})),
|
|
11684
11708
|
pid: process.pid,
|
|
11709
|
+
startupComplete: this.startupComplete,
|
|
11685
11710
|
startedAt: this.startedAt,
|
|
11686
11711
|
shellEnvironment: this.shellEnvironmentManager.status(),
|
|
11687
11712
|
version: connectorVersion
|
|
@@ -15284,7 +15309,7 @@ function getApiKeyOrUndefined() {
|
|
|
15284
15309
|
|
|
15285
15310
|
// src/utils/http.ts
|
|
15286
15311
|
function getUserAgent() {
|
|
15287
|
-
return `moxt-cli/${"0.11.0-beta.
|
|
15312
|
+
return `moxt-cli/${"0.11.0-beta.2"} (${(0, import_os.platform)()}/${(0, import_os.arch)()}) node/${process.versions.node}`;
|
|
15288
15313
|
}
|
|
15289
15314
|
async function sendRequest(method, path4, init) {
|
|
15290
15315
|
return await fetch(`${getApiBaseUrl()}${path4}`, {
|
|
@@ -29796,7 +29821,7 @@ var FLUSH_TIMEOUT_MS = 3e3;
|
|
|
29796
29821
|
var MAX_BATCH_SIZE = 100;
|
|
29797
29822
|
function commonLabels() {
|
|
29798
29823
|
return {
|
|
29799
|
-
cli_version: "0.11.0-beta.
|
|
29824
|
+
cli_version: "0.11.0-beta.2",
|
|
29800
29825
|
node_version: process.versions.node,
|
|
29801
29826
|
os: (0, import_node_os11.platform)(),
|
|
29802
29827
|
arch: (0, import_node_os11.arch)(),
|
|
@@ -29842,7 +29867,7 @@ async function flush() {
|
|
|
29842
29867
|
}
|
|
29843
29868
|
const batch = buffer.splice(0, MAX_BATCH_SIZE);
|
|
29844
29869
|
const payload = {
|
|
29845
|
-
release_id: "0.11.0-beta.
|
|
29870
|
+
release_id: "0.11.0-beta.2",
|
|
29846
29871
|
client_type: "cli",
|
|
29847
29872
|
metric_data_list: batch.map((m) => ({
|
|
29848
29873
|
profile: "cli",
|
|
@@ -30225,9 +30250,9 @@ function commandPath3(command) {
|
|
|
30225
30250
|
}
|
|
30226
30251
|
|
|
30227
30252
|
// src/index.ts
|
|
30228
|
-
var program2 = createProgram("0.11.0-beta.
|
|
30229
|
-
installDaemonReconcileHook(program2, "0.11.0-beta.
|
|
30230
|
-
installUpdateHook(program2, "0.11.0-beta.
|
|
30253
|
+
var program2 = createProgram("0.11.0-beta.2");
|
|
30254
|
+
installDaemonReconcileHook(program2, "0.11.0-beta.2");
|
|
30255
|
+
installUpdateHook(program2, "0.11.0-beta.2");
|
|
30231
30256
|
instrumentProgram(program2);
|
|
30232
30257
|
installExitHandler();
|
|
30233
30258
|
program2.parseAsync(process.argv).then(async () => {
|