instar 1.3.537 → 1.3.538
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/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +59 -1
- package/dist/commands/server.js.map +1 -1
- package/dist/core/CredentialLocationGate.d.ts +99 -0
- package/dist/core/CredentialLocationGate.d.ts.map +1 -0
- package/dist/core/CredentialLocationGate.js +127 -0
- package/dist/core/CredentialLocationGate.js.map +1 -0
- package/dist/core/CredentialSwapExecutor.d.ts +10 -0
- package/dist/core/CredentialSwapExecutor.d.ts.map +1 -1
- package/dist/core/CredentialSwapExecutor.js +19 -0
- package/dist/core/CredentialSwapExecutor.js.map +1 -1
- package/dist/core/InUseAccountResolver.d.ts +28 -1
- package/dist/core/InUseAccountResolver.d.ts.map +1 -1
- package/dist/core/InUseAccountResolver.js +34 -1
- package/dist/core/InUseAccountResolver.js.map +1 -1
- package/dist/core/QuotaPoller.d.ts +22 -0
- package/dist/core/QuotaPoller.d.ts.map +1 -1
- package/dist/core/QuotaPoller.js +42 -8
- package/dist/core/QuotaPoller.js.map +1 -1
- package/dist/core/SessionManager.d.ts +19 -0
- package/dist/core/SessionManager.d.ts.map +1 -1
- package/dist/core/SessionManager.js +37 -5
- package/dist/core/SessionManager.js.map +1 -1
- package/dist/monitoring/AccountSwitcher.d.ts.map +1 -1
- package/dist/monitoring/AccountSwitcher.js +12 -1
- package/dist/monitoring/AccountSwitcher.js.map +1 -1
- package/dist/monitoring/CredentialProvider.d.ts +32 -1
- package/dist/monitoring/CredentialProvider.d.ts.map +1 -1
- package/dist/monitoring/CredentialProvider.js +32 -2
- package/dist/monitoring/CredentialProvider.js.map +1 -1
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +15 -0
- package/dist/server/routes.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +47 -47
- package/upgrades/1.3.538.md +51 -0
- package/upgrades/side-effects/ws52-step6-census-rerou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SAAS,GACpD,IAAI,CA8eN;AA2lBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA67atE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
|
package/dist/commands/server.js
CHANGED
|
@@ -8515,6 +8515,60 @@ export async function startServer(options) {
|
|
|
8515
8515
|
if (subscriptionPool.size() > 0) {
|
|
8516
8516
|
console.log(pc.green(` Subscription pool: ${subscriptionPool.size()} account(s) registered`));
|
|
8517
8517
|
}
|
|
8518
|
+
// ── Live credential re-pointing — census consumer re-routing (WS5.2 Step 6) ──
|
|
8519
|
+
// The CredentialLocationLedger is the machine-local source of truth for "which account is in
|
|
8520
|
+
// which config-home slot" once re-pointing is enabled. The CredentialLocationGate re-routes
|
|
8521
|
+
// the §2.2 census consumers (quota poll, spawn placement, in-use badge) through it. Ships DARK:
|
|
8522
|
+
// the gate reads `subscriptionPool.credentialRepointing.enabled` LIVE per call — with the flag
|
|
8523
|
+
// off (always, while dark) every gate read returns the enrollment-home fallback, so every
|
|
8524
|
+
// consumer is byte-for-byte today's behavior. A never-seeded ledger is the same fallback (back-
|
|
8525
|
+
// compat); only UNKNOWN mode (corrupt on-disk) raises a HIGH attention item, never throws.
|
|
8526
|
+
const { CredentialLocationLedger } = await import('../core/CredentialLocationLedger.js');
|
|
8527
|
+
const { CredentialIdentityOracle } = await import('../core/CredentialIdentityOracle.js');
|
|
8528
|
+
const { CredentialLocationGate } = await import('../core/CredentialLocationGate.js');
|
|
8529
|
+
const credentialGateEmitAttention = telegram
|
|
8530
|
+
? (item) => void telegram.createAttentionItem({
|
|
8531
|
+
id: item.id,
|
|
8532
|
+
title: item.title,
|
|
8533
|
+
summary: item.summary,
|
|
8534
|
+
description: item.description,
|
|
8535
|
+
category: item.category,
|
|
8536
|
+
priority: item.priority,
|
|
8537
|
+
sourceContext: item.sourceContext,
|
|
8538
|
+
})
|
|
8539
|
+
: undefined;
|
|
8540
|
+
const credentialLocationLedger = new CredentialLocationLedger({
|
|
8541
|
+
stateDir: config.stateDir,
|
|
8542
|
+
pool: subscriptionPool,
|
|
8543
|
+
oracle: new CredentialIdentityOracle(),
|
|
8544
|
+
emitAttention: credentialGateEmitAttention,
|
|
8545
|
+
});
|
|
8546
|
+
const credentialLocationGate = new CredentialLocationGate({
|
|
8547
|
+
// Live flag read — a restartless config flip is honored on the next read.
|
|
8548
|
+
isEnabled: () => config.subscriptionPool?.credentialRepointing?.enabled === true,
|
|
8549
|
+
ledger: credentialLocationLedger,
|
|
8550
|
+
emitAttention: credentialGateEmitAttention,
|
|
8551
|
+
});
|
|
8552
|
+
// Census #9: the manager-level competing-writer refusal gate. Installed process-wide so
|
|
8553
|
+
// AccountSwitcher / `/switch-account` / autoMigrate refuse a write to a repointing-owned slot
|
|
8554
|
+
// at the funnel chokepoint, not just on a route. Refuses ONLY when re-pointing is enabled AND
|
|
8555
|
+
// the ledger holds a tenant for the (canonicalized) slot.
|
|
8556
|
+
const { setCredentialWriteRefusalGate } = await import('../monitoring/CredentialProvider.js');
|
|
8557
|
+
const { credentialSlotKey: canonicalizeSlot } = await import('../core/OAuthRefresher.js');
|
|
8558
|
+
setCredentialWriteRefusalGate({
|
|
8559
|
+
shouldRefuse: (canonicalSlot) => {
|
|
8560
|
+
if (config.subscriptionPool?.credentialRepointing?.enabled !== true)
|
|
8561
|
+
return false;
|
|
8562
|
+
// The funnel passes a canonicalized slot key, but the ledger stores raw enrollment-home
|
|
8563
|
+
// spellings (`~/.claude`, an enrollment path). Compare canonical-to-canonical so a
|
|
8564
|
+
// repointing-owned slot is recognized regardless of spelling.
|
|
8565
|
+
return credentialLocationLedger
|
|
8566
|
+
.getAssignments()
|
|
8567
|
+
.some((a) => !!a.accountId && canonicalizeSlot(a.slot) === canonicalSlot);
|
|
8568
|
+
},
|
|
8569
|
+
});
|
|
8570
|
+
// Census #5/#6: spawn placement resolves a pinned account's home through the gate (no-op dark).
|
|
8571
|
+
sessionManager.setCredentialLocationGate(credentialLocationGate);
|
|
8518
8572
|
// QuotaPoller — per-account live quota reader (P1.2 of the Subscription &
|
|
8519
8573
|
// Auth Standard). Reads each account's 5h/weekly utilization + reset dates
|
|
8520
8574
|
// via the OAuth usage endpoint (transient per-account token, never persisted)
|
|
@@ -8526,6 +8580,8 @@ export async function startServer(options) {
|
|
|
8526
8580
|
const quotaPoller = new QuotaPoller({
|
|
8527
8581
|
pool: subscriptionPool,
|
|
8528
8582
|
logger: { log: (m) => console.log(m), warn: (m) => console.warn(m) },
|
|
8583
|
+
// Census #1–#4: resolve each account's LIVE slot through the ledger (no-op while dark).
|
|
8584
|
+
locationGate: credentialLocationGate,
|
|
8529
8585
|
});
|
|
8530
8586
|
if (subscriptionPool.size() > 0) {
|
|
8531
8587
|
quotaPoller.start();
|
|
@@ -8535,7 +8591,9 @@ export async function startServer(options) {
|
|
|
8535
8591
|
// right now" for the dashboard "in use" badge (read-only; cached probe of
|
|
8536
8592
|
// `claude auth status`). One shared instance so the TTL cache is honored.
|
|
8537
8593
|
const { InUseAccountResolver } = await import('../core/InUseAccountResolver.js');
|
|
8538
|
-
|
|
8594
|
+
// Census #8 (the E4a liar): when re-pointing is enabled and the ledger knows the `~/.claude`
|
|
8595
|
+
// tenant, the badge resolves from the ledger — NOT a stale `claude auth status` re-probe.
|
|
8596
|
+
const inUseAccountResolver = new InUseAccountResolver({ locationGate: credentialLocationGate });
|
|
8539
8597
|
// EnrollmentWizard — mobile-first new-account login (P2.1 of the Subscription
|
|
8540
8598
|
// & Auth Standard). Dark with the pool: the /subscription-pool/enroll routes
|
|
8541
8599
|
// do nothing until an operator starts an enrollment. The login driver reuses
|