@blotout/qinto-cli 0.1.12 → 0.1.13
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/README.md +95 -0
- package/dist/index.js +4136 -3497
- package/dist/index.js.map +1 -1
- package/dist/worker-artifact/main/index.js +148 -121
- package/dist/worker-artifact/version.json +2 -2
- package/package.json +2 -2
|
@@ -19331,6 +19331,7 @@ var adoptAppSpans = /* @__PURE__ */ __name((response) => {
|
|
|
19331
19331
|
|
|
19332
19332
|
// src/apps/invoke.ts
|
|
19333
19333
|
var APP_INVOCATION_TIMEOUT_MS = 1e4;
|
|
19334
|
+
var APP_HOOK_TIMEOUT_MS = 25e3;
|
|
19334
19335
|
var MAX_EMIT_DEPTH = 2;
|
|
19335
19336
|
var HOOK_URL = "https://app/__qinto/hook";
|
|
19336
19337
|
var invocationContext = /* @__PURE__ */ __name((env) => {
|
|
@@ -19475,7 +19476,7 @@ var ingestEmit = /* @__PURE__ */ __name(async (env, { slug, ord, depth, emit, an
|
|
|
19475
19476
|
});
|
|
19476
19477
|
await ingest(env, action);
|
|
19477
19478
|
}, "ingestEmit");
|
|
19478
|
-
var deliverGroupPushes = /* @__PURE__ */ __name(({ slug, group, installs, deliverPush }) => {
|
|
19479
|
+
var deliverGroupPushes = /* @__PURE__ */ __name(async ({ slug, group, installs, deliverPush }) => {
|
|
19479
19480
|
const install = installs.find((entry) => entry.ord === group.ord);
|
|
19480
19481
|
for (const push of group.pushes) {
|
|
19481
19482
|
const { topic, data } = push;
|
|
@@ -19485,17 +19486,17 @@ var deliverGroupPushes = /* @__PURE__ */ __name(({ slug, group, installs, delive
|
|
|
19485
19486
|
addSpanEvent("push rejected: its group matches no invoked install", { level: "warn", attrs: { app: slug, ord: group.ord } });
|
|
19486
19487
|
break;
|
|
19487
19488
|
}
|
|
19488
|
-
deliverPush({ slug, installId: install.id, topic, data, scope: "app" });
|
|
19489
|
+
await deliverPush({ slug, installId: install.id, topic, data, scope: "app" });
|
|
19489
19490
|
break;
|
|
19490
19491
|
}
|
|
19491
19492
|
case "app": {
|
|
19492
|
-
deliverPush({ slug, installId: null, topic, data, scope: "app" });
|
|
19493
|
+
await deliverPush({ slug, installId: null, topic, data, scope: "app" });
|
|
19493
19494
|
break;
|
|
19494
19495
|
}
|
|
19495
19496
|
// Whether this app may broadcast site-wide is settled in `deliverAppPush`, the one path every
|
|
19496
19497
|
// delivery funnels through; re-deciding it here would be a second authority to keep in sync.
|
|
19497
19498
|
case "site": {
|
|
19498
|
-
deliverPush({ slug, installId: null, topic, data, scope: "site" });
|
|
19499
|
+
await deliverPush({ slug, installId: null, topic, data, scope: "site" });
|
|
19499
19500
|
break;
|
|
19500
19501
|
}
|
|
19501
19502
|
}
|
|
@@ -19511,7 +19512,7 @@ var applyEffects = /* @__PURE__ */ __name(async (env, { slug, groups, depth, ano
|
|
|
19511
19512
|
await writeContext2(slug, contextWrites);
|
|
19512
19513
|
}
|
|
19513
19514
|
for (const group of groups) {
|
|
19514
|
-
deliverGroupPushes({ slug, group, installs, deliverPush });
|
|
19515
|
+
await deliverGroupPushes({ slug, group, installs, deliverPush });
|
|
19515
19516
|
if (group.emits.length === 0) {
|
|
19516
19517
|
continue;
|
|
19517
19518
|
}
|
|
@@ -19536,14 +19537,14 @@ var hookResponseBody = /* @__PURE__ */ __name(async (response, slug) => {
|
|
|
19536
19537
|
}
|
|
19537
19538
|
return new TextDecoder().decode(bytes);
|
|
19538
19539
|
}, "hookResponseBody");
|
|
19539
|
-
var runInvokeApp = /* @__PURE__ */ __name(async (env, { target, trigger, snapshot, context,
|
|
19540
|
+
var runInvokeApp = /* @__PURE__ */ __name(async (env, { target, trigger, snapshot, context, deliverEffects, budget }) => {
|
|
19540
19541
|
try {
|
|
19541
19542
|
const key = await deriveAppInternalKey(context.master, context.domainId, target.slug);
|
|
19542
19543
|
const response = await postHookEnvelope(env, {
|
|
19543
19544
|
binding: target.app.binding,
|
|
19544
19545
|
key,
|
|
19545
19546
|
envelope: buildEnvelope(target, trigger, snapshot, context),
|
|
19546
|
-
timeoutMs:
|
|
19547
|
+
timeoutMs: APP_HOOK_TIMEOUT_MS
|
|
19547
19548
|
});
|
|
19548
19549
|
if (response === void 0) {
|
|
19549
19550
|
addSpanEvent("app service binding is missing", { level: "warn", attrs: { app: target.slug, binding: target.app.binding } });
|
|
@@ -19570,15 +19571,15 @@ var runInvokeApp = /* @__PURE__ */ __name(async (env, { target, trigger, snapsho
|
|
|
19570
19571
|
for (const ord of verdict.effects.rejectedOrds) {
|
|
19571
19572
|
addSpanEvent("app effects rejected over the per-install caps", { level: "warn", attrs: { app: target.slug, ord } });
|
|
19572
19573
|
}
|
|
19573
|
-
|
|
19574
|
+
if (verdict.effects.accepted.length === 0) {
|
|
19575
|
+
return;
|
|
19576
|
+
}
|
|
19577
|
+
await deliverEffects({
|
|
19578
|
+
anonId: snapshot.anonId,
|
|
19574
19579
|
slug: target.slug,
|
|
19575
19580
|
groups: verdict.effects.accepted,
|
|
19576
19581
|
depth: triggerDepth(trigger),
|
|
19577
|
-
anonId: snapshot.anonId,
|
|
19578
19582
|
installs: target.installs,
|
|
19579
|
-
deliverPush,
|
|
19580
|
-
writeAttribution: writeAttribution2,
|
|
19581
|
-
writeContext: writeContext2,
|
|
19582
19583
|
geo: trigger.kind === "event" ? trigger.action.geo : trigger.geo,
|
|
19583
19584
|
host: trigger.kind === "event" ? trigger.action.host : trigger.host,
|
|
19584
19585
|
context: trigger.kind === "event" ? trigger.action.context : void 0
|
|
@@ -19885,17 +19886,15 @@ var deliverRpcEffects = /* @__PURE__ */ __name(async (env, { body, userId, effec
|
|
|
19885
19886
|
for (const ord of effects.rejectedOrds) {
|
|
19886
19887
|
addSpanEvent("app effects rejected over the per-install caps", { level: "warn", attrs: { app: body.callee, ord } });
|
|
19887
19888
|
}
|
|
19888
|
-
const pushes = [];
|
|
19889
19889
|
await applyEffects(env, {
|
|
19890
19890
|
slug: body.callee,
|
|
19891
19891
|
groups: effects.accepted,
|
|
19892
19892
|
depth: body.depth,
|
|
19893
19893
|
anonId: userId,
|
|
19894
19894
|
installs: [install],
|
|
19895
|
-
deliverPush: /* @__PURE__ */ __name((push) => {
|
|
19896
|
-
|
|
19895
|
+
deliverPush: /* @__PURE__ */ __name(async (push) => {
|
|
19896
|
+
await anonStub(env, userId).appPush(push, currentTraceContext());
|
|
19897
19897
|
}, "deliverPush"),
|
|
19898
|
-
// The broker runs outside the user's AnonDO, so this reaches it the same way a push does.
|
|
19899
19898
|
writeAttribution: /* @__PURE__ */ __name(async (slug, writes) => {
|
|
19900
19899
|
await anonStub(env, userId).appAttribution({ slug, writes }, currentTraceContext());
|
|
19901
19900
|
}, "writeAttribution"),
|
|
@@ -19903,9 +19902,6 @@ var deliverRpcEffects = /* @__PURE__ */ __name(async (env, { body, userId, effec
|
|
|
19903
19902
|
await anonStub(env, userId).appContext({ slug, writes }, currentTraceContext());
|
|
19904
19903
|
}, "writeContext")
|
|
19905
19904
|
});
|
|
19906
|
-
for (const push of pushes) {
|
|
19907
|
-
await anonStub(env, userId).appPush(push, currentTraceContext());
|
|
19908
|
-
}
|
|
19909
19905
|
}, "deliverRpcEffects");
|
|
19910
19906
|
var runRelayRpc = /* @__PURE__ */ __name(async (env, { context, body, callee, install }) => {
|
|
19911
19907
|
let raw2;
|
|
@@ -24767,6 +24763,94 @@ var track = createApiRouter().openapi(definition8, async (c) => {
|
|
|
24767
24763
|
}
|
|
24768
24764
|
});
|
|
24769
24765
|
|
|
24766
|
+
// src/apps/fan-out-entrypoint.ts
|
|
24767
|
+
import { WorkerEntrypoint as WorkerEntrypoint2 } from "cloudflare:workers";
|
|
24768
|
+
|
|
24769
|
+
// src/apps/eligibility.ts
|
|
24770
|
+
var wantsTrigger = /* @__PURE__ */ __name((app2, trigger) => {
|
|
24771
|
+
if (trigger.kind === "connect") {
|
|
24772
|
+
return app2.hooks.onConnect;
|
|
24773
|
+
}
|
|
24774
|
+
return app2.hooks.onEvent.includes(trigger.action.type);
|
|
24775
|
+
}, "wantsTrigger");
|
|
24776
|
+
var gatePasses = /* @__PURE__ */ __name((entry, trigger, consent2, enforced) => {
|
|
24777
|
+
if (trigger.kind === "event" && trigger.action.origin?.app === entry.slug) {
|
|
24778
|
+
return false;
|
|
24779
|
+
}
|
|
24780
|
+
if (trigger.kind === "event" && trigger.action.type === "consent") {
|
|
24781
|
+
return true;
|
|
24782
|
+
}
|
|
24783
|
+
return consentAllows(consent2, entry.slug, entry.app.consent.category, enforced);
|
|
24784
|
+
}, "gatePasses");
|
|
24785
|
+
var eligibleApps = /* @__PURE__ */ __name((registry3, trigger, consent2, enforced) => {
|
|
24786
|
+
const targets = [];
|
|
24787
|
+
for (const slug of registry3.order) {
|
|
24788
|
+
const app2 = registry3.apps[slug];
|
|
24789
|
+
if (app2 === void 0 || !wantsTrigger(app2, trigger) || !gatePasses({ slug, app: app2 }, trigger, consent2, enforced)) {
|
|
24790
|
+
continue;
|
|
24791
|
+
}
|
|
24792
|
+
const installs = app2.installs.filter((install) => install.active).map(({ id, ord, label }) => ({ id, ord, label }));
|
|
24793
|
+
if (installs.length === 0) {
|
|
24794
|
+
continue;
|
|
24795
|
+
}
|
|
24796
|
+
targets.push({ slug, app: app2, installs });
|
|
24797
|
+
}
|
|
24798
|
+
return targets;
|
|
24799
|
+
}, "eligibleApps");
|
|
24800
|
+
|
|
24801
|
+
// src/apps/fan-out.ts
|
|
24802
|
+
var MAX_APPS_PER_DOMAIN = 50;
|
|
24803
|
+
var fanOutToApps = /* @__PURE__ */ __name(async (env, { trigger, snapshot, trace }, { deliverEffects }) => {
|
|
24804
|
+
const { registry: registry3, error: error51 } = siteRegistry();
|
|
24805
|
+
const targets = eligibleApps(registry3, trigger, snapshot.consent, consentEnforced(env));
|
|
24806
|
+
if (error51 === void 0 && targets.length === 0) {
|
|
24807
|
+
return;
|
|
24808
|
+
}
|
|
24809
|
+
await runInvocation({ name: "app.fan_out", trace, attrs: { "fan_out.kind": trigger.kind, "fan_out.apps": targets.length } }, async () => {
|
|
24810
|
+
if (error51 !== void 0) {
|
|
24811
|
+
addSpanEvent("apps registry is malformed; apps are off", { level: "error", attrs: { error: error51 } });
|
|
24812
|
+
return;
|
|
24813
|
+
}
|
|
24814
|
+
const context = invocationContext(env);
|
|
24815
|
+
if (context === void 0) {
|
|
24816
|
+
addSpanEvent("apps skipped: APPS_KEY_MASTER or QINTO_DOMAIN_ID is missing", { level: "warn" });
|
|
24817
|
+
return;
|
|
24818
|
+
}
|
|
24819
|
+
const capped = targets.slice(0, MAX_APPS_PER_DOMAIN);
|
|
24820
|
+
if (capped.length < targets.length) {
|
|
24821
|
+
addSpanEvent("eligible apps exceed the per-event budget", {
|
|
24822
|
+
level: "warn",
|
|
24823
|
+
attrs: { eligible: targets.length, cap: MAX_APPS_PER_DOMAIN }
|
|
24824
|
+
});
|
|
24825
|
+
}
|
|
24826
|
+
const budget = createDataPointBudget();
|
|
24827
|
+
await Promise.allSettled(
|
|
24828
|
+
capped.map((target) => {
|
|
24829
|
+
return invokeApp(env, { target, trigger, snapshot, context, deliverEffects, budget });
|
|
24830
|
+
})
|
|
24831
|
+
);
|
|
24832
|
+
});
|
|
24833
|
+
}, "fanOutToApps");
|
|
24834
|
+
|
|
24835
|
+
// src/apps/fan-out-entrypoint.ts
|
|
24836
|
+
var anonEffectsDelivery = /* @__PURE__ */ __name((env, anonId) => {
|
|
24837
|
+
return (effects) => {
|
|
24838
|
+
return anonStub(env, anonId).appEffects(effects, currentTraceContext());
|
|
24839
|
+
};
|
|
24840
|
+
}, "anonEffectsDelivery");
|
|
24841
|
+
var FanOut = class extends WorkerEntrypoint2 {
|
|
24842
|
+
static {
|
|
24843
|
+
__name(this, "FanOut");
|
|
24844
|
+
}
|
|
24845
|
+
run(job) {
|
|
24846
|
+
this.ctx.waitUntil(
|
|
24847
|
+
fanOutToApps(this.env, job, { deliverEffects: anonEffectsDelivery(this.env, job.snapshot.anonId) }).catch((error51) => {
|
|
24848
|
+
console.warn("app fan-out failed", { error: error51 });
|
|
24849
|
+
})
|
|
24850
|
+
);
|
|
24851
|
+
}
|
|
24852
|
+
};
|
|
24853
|
+
|
|
24770
24854
|
// src/id-graph/alias/do.ts
|
|
24771
24855
|
import { DurableObject } from "cloudflare:workers";
|
|
24772
24856
|
var ASSIGNMENT_KEY = "assignment";
|
|
@@ -24999,87 +25083,6 @@ var acceptedCaptures = /* @__PURE__ */ __name((registry3, consent2, apps, enforc
|
|
|
24999
25083
|
return accepted;
|
|
25000
25084
|
}, "acceptedCaptures");
|
|
25001
25085
|
|
|
25002
|
-
// src/apps/eligibility.ts
|
|
25003
|
-
var wantsTrigger = /* @__PURE__ */ __name((app2, trigger) => {
|
|
25004
|
-
if (trigger.kind === "connect") {
|
|
25005
|
-
return app2.hooks.onConnect;
|
|
25006
|
-
}
|
|
25007
|
-
return app2.hooks.onEvent.includes(trigger.action.type);
|
|
25008
|
-
}, "wantsTrigger");
|
|
25009
|
-
var gatePasses = /* @__PURE__ */ __name((entry, trigger, consent2, enforced) => {
|
|
25010
|
-
if (trigger.kind === "event" && trigger.action.origin?.app === entry.slug) {
|
|
25011
|
-
return false;
|
|
25012
|
-
}
|
|
25013
|
-
if (trigger.kind === "event" && trigger.action.type === "consent") {
|
|
25014
|
-
return true;
|
|
25015
|
-
}
|
|
25016
|
-
return consentAllows(consent2, entry.slug, entry.app.consent.category, enforced);
|
|
25017
|
-
}, "gatePasses");
|
|
25018
|
-
var eligibleApps = /* @__PURE__ */ __name((registry3, trigger, consent2, enforced) => {
|
|
25019
|
-
const targets = [];
|
|
25020
|
-
for (const slug of registry3.order) {
|
|
25021
|
-
const app2 = registry3.apps[slug];
|
|
25022
|
-
if (app2 === void 0 || !wantsTrigger(app2, trigger) || !gatePasses({ slug, app: app2 }, trigger, consent2, enforced)) {
|
|
25023
|
-
continue;
|
|
25024
|
-
}
|
|
25025
|
-
const installs = app2.installs.filter((install) => install.active).map(({ id, ord, label }) => ({ id, ord, label }));
|
|
25026
|
-
if (installs.length === 0) {
|
|
25027
|
-
continue;
|
|
25028
|
-
}
|
|
25029
|
-
targets.push({ slug, app: app2, installs });
|
|
25030
|
-
}
|
|
25031
|
-
return targets;
|
|
25032
|
-
}, "eligibleApps");
|
|
25033
|
-
|
|
25034
|
-
// src/apps/fan-out.ts
|
|
25035
|
-
var MAX_APPS_PER_DOMAIN = 50;
|
|
25036
|
-
var FAN_OUT_CONCURRENCY = 6;
|
|
25037
|
-
var runPool = /* @__PURE__ */ __name(async (limit, tasks) => {
|
|
25038
|
-
const running = /* @__PURE__ */ new Set();
|
|
25039
|
-
for (const task of tasks) {
|
|
25040
|
-
const invocation = task().finally(() => running.delete(invocation));
|
|
25041
|
-
running.add(invocation);
|
|
25042
|
-
if (running.size >= limit) {
|
|
25043
|
-
await Promise.race(running);
|
|
25044
|
-
}
|
|
25045
|
-
}
|
|
25046
|
-
await Promise.all(running);
|
|
25047
|
-
}, "runPool");
|
|
25048
|
-
var fanOutToApps = /* @__PURE__ */ __name(async (env, trigger, snapshot, { deliverPush, writeAttribution: writeAttribution2, writeContext: writeContext2, budget, trace }) => {
|
|
25049
|
-
const { registry: registry3, error: error51 } = siteRegistry();
|
|
25050
|
-
const targets = eligibleApps(registry3, trigger, snapshot.consent, consentEnforced(env));
|
|
25051
|
-
if (error51 === void 0 && targets.length === 0) {
|
|
25052
|
-
return;
|
|
25053
|
-
}
|
|
25054
|
-
await runInvocation(
|
|
25055
|
-
{ name: "do.anon.app_fan_out", trace, attrs: { "fan_out.kind": trigger.kind, "fan_out.apps": targets.length } },
|
|
25056
|
-
async () => {
|
|
25057
|
-
if (error51 !== void 0) {
|
|
25058
|
-
addSpanEvent("apps registry is malformed; apps are off", { level: "error", attrs: { error: error51 } });
|
|
25059
|
-
return;
|
|
25060
|
-
}
|
|
25061
|
-
const context = invocationContext(env);
|
|
25062
|
-
if (context === void 0) {
|
|
25063
|
-
addSpanEvent("apps skipped: APPS_KEY_MASTER or QINTO_DOMAIN_ID is missing", { level: "warn" });
|
|
25064
|
-
return;
|
|
25065
|
-
}
|
|
25066
|
-
const capped = targets.slice(0, MAX_APPS_PER_DOMAIN);
|
|
25067
|
-
if (capped.length < targets.length) {
|
|
25068
|
-
addSpanEvent("eligible apps exceed the per-event budget", {
|
|
25069
|
-
level: "warn",
|
|
25070
|
-
attrs: { eligible: targets.length, cap: MAX_APPS_PER_DOMAIN }
|
|
25071
|
-
});
|
|
25072
|
-
}
|
|
25073
|
-
await runPool(
|
|
25074
|
-
FAN_OUT_CONCURRENCY,
|
|
25075
|
-
capped.map((target) => {
|
|
25076
|
-
return () => invokeApp(env, { target, trigger, snapshot, context, deliverPush, writeAttribution: writeAttribution2, writeContext: writeContext2, budget });
|
|
25077
|
-
})
|
|
25078
|
-
);
|
|
25079
|
-
}
|
|
25080
|
-
);
|
|
25081
|
-
}, "fanOutToApps");
|
|
25082
|
-
|
|
25083
25086
|
// src/apps/transform.ts
|
|
25084
25087
|
var TRANSFORM_TIMEOUT_MS = 500;
|
|
25085
25088
|
var TRANSFORM_CHAIN_BUDGET_MS = 1e3;
|
|
@@ -26273,11 +26276,7 @@ var AnonDO = class extends DurableObject2 {
|
|
|
26273
26276
|
const attachment = connectionAttachment(request, geo);
|
|
26274
26277
|
server.serializeAttachment(attachment);
|
|
26275
26278
|
this.deliverSharedContext(server);
|
|
26276
|
-
this.appFanOut(
|
|
26277
|
-
{ kind: "connect", ...attachment.cf === void 0 ? {} : { geo: attachment.cf }, host: attachment.host },
|
|
26278
|
-
userId,
|
|
26279
|
-
createDataPointBudget()
|
|
26280
|
-
);
|
|
26279
|
+
this.appFanOut({ kind: "connect", ...attachment.cf === void 0 ? {} : { geo: attachment.cf }, host: attachment.host }, userId);
|
|
26281
26280
|
return new Response(null, { status: 101, webSocket: client });
|
|
26282
26281
|
});
|
|
26283
26282
|
}
|
|
@@ -26416,6 +26415,21 @@ var AnonDO = class extends DurableObject2 {
|
|
|
26416
26415
|
});
|
|
26417
26416
|
});
|
|
26418
26417
|
}
|
|
26418
|
+
// Returns without awaiting the chain: the fan-out worker must not wait on this object's queue. The
|
|
26419
|
+
// chain runs outside the queue turn on purpose — applyEffects awaits attributionDelivery and
|
|
26420
|
+
// contextDelivery, which enqueue, so a queued task would wait on work chained behind itself.
|
|
26421
|
+
appEffects(input, trace) {
|
|
26422
|
+
const run = runInvocation({ name: "do.anon.app_effects", trace, attrs: { "app.slug": input.slug } }, () => {
|
|
26423
|
+
return applyEffects(this.env, {
|
|
26424
|
+
...input,
|
|
26425
|
+
deliverPush: this.pushDelivery,
|
|
26426
|
+
writeAttribution: this.attributionDelivery,
|
|
26427
|
+
writeContext: this.contextDelivery
|
|
26428
|
+
});
|
|
26429
|
+
});
|
|
26430
|
+
this.ctx.waitUntil(run.catch((error51) => console.warn("app effects failed", { app: input.slug, error: error51 })));
|
|
26431
|
+
return Promise.resolve();
|
|
26432
|
+
}
|
|
26419
26433
|
// Returns what storage now holds, not what policy allowed: the browser memoes exactly these pairs,
|
|
26420
26434
|
// so a value the caps refused must never be reported as stored.
|
|
26421
26435
|
capture(input, trace) {
|
|
@@ -26632,7 +26646,7 @@ var AnonDO = class extends DurableObject2 {
|
|
|
26632
26646
|
consentReply(ref, userId) {
|
|
26633
26647
|
return { t: "consentState", ref, ...userId === null ? {} : { anonId: userId }, ...consentState2(this.kv) };
|
|
26634
26648
|
}
|
|
26635
|
-
pushDelivery = /* @__PURE__ */ __name((push) => {
|
|
26649
|
+
pushDelivery = /* @__PURE__ */ __name(async (push) => {
|
|
26636
26650
|
this.deliverAppPush(push);
|
|
26637
26651
|
}, "pushDelivery");
|
|
26638
26652
|
// Calls the public method directly: it enqueues internally, and both effect paths already run
|
|
@@ -26657,13 +26671,12 @@ var AnonDO = class extends DurableObject2 {
|
|
|
26657
26671
|
if (isNoopAction(action)) {
|
|
26658
26672
|
return;
|
|
26659
26673
|
}
|
|
26660
|
-
const
|
|
26661
|
-
const transformed = await this.transformAction(action, dataPoints);
|
|
26674
|
+
const transformed = await this.transformAction(action, createDataPointBudget());
|
|
26662
26675
|
if (transformed === null) {
|
|
26663
26676
|
return;
|
|
26664
26677
|
}
|
|
26665
26678
|
recorded = transformed.action;
|
|
26666
|
-
await this.runAction(transformed.action, transformed.releaseEmissions
|
|
26679
|
+
await this.runAction(transformed.action, transformed.releaseEmissions);
|
|
26667
26680
|
} finally {
|
|
26668
26681
|
this.recordActionBlocks(recorded);
|
|
26669
26682
|
}
|
|
@@ -26673,9 +26686,9 @@ var AnonDO = class extends DurableObject2 {
|
|
|
26673
26686
|
actionBlocks(action, this.appsSnapshot(action.userId), this.wiped ? [] : allIdentifiers(this.sql, this.identifiersMirror))
|
|
26674
26687
|
);
|
|
26675
26688
|
}
|
|
26676
|
-
async runAction(current, releaseEmissions
|
|
26689
|
+
async runAction(current, releaseEmissions) {
|
|
26677
26690
|
if (current.type !== "alias" && isDeliveryOnlyAction(current)) {
|
|
26678
|
-
this.appFanOut({ kind: "event", action: current }, current.userId
|
|
26691
|
+
this.appFanOut({ kind: "event", action: current }, current.userId);
|
|
26679
26692
|
this.releaseTransformEmissions(releaseEmissions);
|
|
26680
26693
|
return;
|
|
26681
26694
|
}
|
|
@@ -26711,7 +26724,7 @@ var AnonDO = class extends DurableObject2 {
|
|
|
26711
26724
|
} else {
|
|
26712
26725
|
await this.ingestConsent(current);
|
|
26713
26726
|
}
|
|
26714
|
-
this.appFanOut({ kind: "event", action: current }, current.userId
|
|
26727
|
+
this.appFanOut({ kind: "event", action: current }, current.userId);
|
|
26715
26728
|
this.releaseTransformEmissions(releaseEmissions);
|
|
26716
26729
|
} finally {
|
|
26717
26730
|
if (novelIdentifier) {
|
|
@@ -26766,16 +26779,16 @@ var AnonDO = class extends DurableObject2 {
|
|
|
26766
26779
|
}
|
|
26767
26780
|
this.ctx.waitUntil(release().catch((error51) => console.warn("transform emission release failed", { error: error51 })));
|
|
26768
26781
|
}
|
|
26769
|
-
appFanOut(trigger, anonId
|
|
26770
|
-
const
|
|
26782
|
+
appFanOut(trigger, anonId) {
|
|
26783
|
+
const { registry: registry3, error: error51 } = siteRegistry();
|
|
26784
|
+
if (error51 === void 0 && eligibleApps(registry3, trigger, consentState2(this.kv), consentEnforced(this.env)).length === 0) {
|
|
26785
|
+
return;
|
|
26786
|
+
}
|
|
26787
|
+
const job = { trigger, snapshot: this.appsSnapshot(anonId), trace: currentTraceContext() };
|
|
26771
26788
|
this.ctx.waitUntil(
|
|
26772
|
-
|
|
26773
|
-
|
|
26774
|
-
|
|
26775
|
-
writeContext: this.contextDelivery,
|
|
26776
|
-
budget: dataPoints,
|
|
26777
|
-
trace: currentTraceContext()
|
|
26778
|
-
}).catch((error51) => console.warn("app fan-out failed", { error: error51 }))
|
|
26789
|
+
traced("rpc fan_out.run", {}, () => {
|
|
26790
|
+
return this.ctx.exports.FanOut.run(job);
|
|
26791
|
+
}).catch((error52) => console.warn("app fan-out hand-off failed", { error: error52 }))
|
|
26779
26792
|
);
|
|
26780
26793
|
}
|
|
26781
26794
|
getProperties(trace) {
|
|
@@ -27122,6 +27135,19 @@ var AnonDO = class extends DurableObject2 {
|
|
|
27122
27135
|
// src/id-graph/global/do.ts
|
|
27123
27136
|
import { DurableObject as DurableObject3 } from "cloudflare:workers";
|
|
27124
27137
|
|
|
27138
|
+
// src/helpers/run-pool.ts
|
|
27139
|
+
var runPool = /* @__PURE__ */ __name(async (limit, tasks) => {
|
|
27140
|
+
const running = /* @__PURE__ */ new Set();
|
|
27141
|
+
for (const task of tasks) {
|
|
27142
|
+
const invocation = task().finally(() => running.delete(invocation));
|
|
27143
|
+
running.add(invocation);
|
|
27144
|
+
if (running.size >= limit) {
|
|
27145
|
+
await Promise.race(running);
|
|
27146
|
+
}
|
|
27147
|
+
}
|
|
27148
|
+
await Promise.all(running);
|
|
27149
|
+
}, "runPool");
|
|
27150
|
+
|
|
27125
27151
|
// src/id-graph/global/facts.ts
|
|
27126
27152
|
var FACT_KINDS2 = [...PROJECTION_KINDS, "identifier", "conversion", "anon"];
|
|
27127
27153
|
var FACT_COLUMNS = "kind, scope, key, value, source, amount, currency, event_id, data_json, first_at, observed_at";
|
|
@@ -27476,6 +27502,7 @@ export {
|
|
|
27476
27502
|
AliasDO,
|
|
27477
27503
|
AnonDO,
|
|
27478
27504
|
Broker,
|
|
27505
|
+
FanOut,
|
|
27479
27506
|
GlobalDO,
|
|
27480
27507
|
app,
|
|
27481
27508
|
index_default as default
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"main": {
|
|
3
3
|
"version": "0.1.0",
|
|
4
|
-
"gitSha": "
|
|
5
|
-
"builtAt": "2026-
|
|
4
|
+
"gitSha": "d2c28f81511d0b1e69a222d04905c6cbea53bb89",
|
|
5
|
+
"builtAt": "2026-09-01T16:47:48.958Z",
|
|
6
6
|
"compatibilityDate": "2026-06-23",
|
|
7
7
|
"compatibilityFlags": [
|
|
8
8
|
"nodejs_compat"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blotout/qinto-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Qinto CLI: authenticate against the Qinto platform and operate it from the terminal or from an agent.",
|
|
6
6
|
"repository": {
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"typescript": "6.0.3",
|
|
41
41
|
"vite": "^8.0.0",
|
|
42
42
|
"vitest": "4.1.10",
|
|
43
|
-
"@qinto/app-manifest": "0.0.0",
|
|
44
43
|
"@qinto/app-dev": "0.0.0",
|
|
44
|
+
"@qinto/app-manifest": "0.0.0",
|
|
45
45
|
"@qinto/app-build": "0.0.0",
|
|
46
46
|
"@qinto/oauth-grammar": "0.0.0"
|
|
47
47
|
},
|