@openclaw/msteams 2026.5.28 → 2026.5.31-beta.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.
@@ -1,5 +1,5 @@
1
- import { y as resolveMSTeamsCredentials } from "./errors-DZGI_mqq.js";
2
- import { i as msteamsSetupAdapter, t as msteamsSetupWizard } from "./setup-surface-C9IApOv3.js";
1
+ import { y as resolveMSTeamsCredentials } from "./errors-Dpn8B05h.js";
2
+ import { i as msteamsSetupAdapter, t as msteamsSetupWizard } from "./setup-surface-B7a1pD-K.js";
3
3
  import { t as MSTeamsChannelConfigSchema } from "./config-schema-BL4qQZiA.js";
4
4
  import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
5
5
  import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
@@ -1,4 +1,4 @@
1
- import { S as normalizeSecretInputString, _ as hasConfiguredMSTeamsCredentials, a as searchGraphUsers, b as saveDelegatedTokens, d as listTeamsByName, f as normalizeQuery, g as resolveGraphToken, r as formatUnknownError, u as listChannelsForTeam, y as resolveMSTeamsCredentials } from "./errors-DZGI_mqq.js";
1
+ import { S as normalizeSecretInputString, _ as hasConfiguredMSTeamsCredentials, a as searchGraphUsers, b as saveDelegatedTokens, d as listTeamsByName, f as normalizeQuery, g as resolveGraphToken, r as formatUnknownError, u as listChannelsForTeam, y as resolveMSTeamsCredentials } from "./errors-Dpn8B05h.js";
2
2
  import { mapAllowlistResolutionInputs } from "openclaw/plugin-sdk/allow-from";
3
3
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  import { DEFAULT_ACCOUNT_ID, createSetupTranslator, createStandardChannelSetupStatus, createTopLevelChannelAllowFromSetter, createTopLevelChannelDmPolicy, createTopLevelChannelGroupPolicySetter, mergeAllowFromEntries, splitSetupEntries } from "openclaw/plugin-sdk/setup";
@@ -1,8 +1,8 @@
1
1
  import { A as summarizeMapping, D as resolveDefaultGroupPolicy, E as resolveChannelMediaMaxBytes, M as getMSTeamsRuntime, N as getOptionalMSTeamsRuntime, _ as isDangerousNameMatchingEnabled, a as buildMediaPayload, b as logTypingFailure, c as createChannelMessageReplyPipeline, f as dispatchReplyFromConfigWithSettledDispatcher$1, l as createChannelPairingController, n as DEFAULT_WEBHOOK_MAX_BODY_BYTES, t as DEFAULT_ACCOUNT_ID, v as keepHttpServerTaskAlive, x as mergeAllowlist } from "./runtime-api-BlvMnDKz.js";
2
- import { $ as safeFetchWithPolicy, B as estimateBase64DecodedBytes, E as loadMSTeamsSdkWithAuth, F as ATTACHMENT_TAG_RE, G as isLikelyImageAttachment, H as extractInlineImageCandidates, I as GRAPH_ROOT, J as normalizeContentType, K as isRecord$1, L as IMG_SRC_RE, M as tryNormalizeBotFrameworkServiceUrl, N as resolveMSTeamsSdkCloudOptions, O as ensureUserAgentHeader, Q as resolveRequestUrl, R as applyAuthorizationHeaderForUrl, T as createMSTeamsTokenProvider, U as inferPlaceholder, V as extractHtmlFromAttachment, W as isDownloadableAttachment, X as resolveAttachmentFetchPolicy, Y as readNestedString, Z as resolveMediaSsrfPolicy, et as safeHostForUrl, l as fetchGraphJson, n as formatMSTeamsSendErrorHint, q as isUrlAllowed, r as formatUnknownError, t as classifyMSTeamsSendError, tt as tryBuildGraphSharesUrlForSharedLink, w as createMSTeamsExpressAdapter, x as resolveMSTeamsStorePath, y as resolveMSTeamsCredentials, z as encodeGraphShareId } from "./errors-DZGI_mqq.js";
3
- import { d as resolveMSTeamsUserAllowlist, u as resolveMSTeamsChannelAllowlist } from "./setup-surface-C9IApOv3.js";
4
- import { a as resolveMSTeamsReplyPolicy, i as resolveMSTeamsAllowlistMatch, o as resolveMSTeamsRouteConfig } from "./channel-2_L55KDI.js";
5
- import { C as readJsonFile, S as createMSTeamsConversationStoreFs, T as writeJsonFile, _ as buildFileInfoCard, b as createMSTeamsPollStoreFs, c as renderReplyPayloadsToMessages, d as withRevokedProxyFallback, f as resolveGraphChatId, g as removePendingUploadFs, h as getPendingUploadFs, l as sendMSTeamsMessages, m as removePendingUpload, p as getPendingUpload, s as buildConversationReference, u as sendMSTeamsActivityWithReference, v as parseFileConsentInvoke, w as withFileLock, x as extractMSTeamsPollVote, y as uploadToConsentUrl } from "./probe-BoUA5GpA.js";
2
+ import { $ as safeFetchWithPolicy, B as estimateBase64DecodedBytes, E as loadMSTeamsSdkWithAuth, F as ATTACHMENT_TAG_RE, G as isLikelyImageAttachment, H as extractInlineImageCandidates, I as GRAPH_ROOT, J as normalizeContentType, K as isRecord$1, L as IMG_SRC_RE, M as tryNormalizeBotFrameworkServiceUrl, N as resolveMSTeamsSdkCloudOptions, O as ensureUserAgentHeader, Q as resolveRequestUrl, R as applyAuthorizationHeaderForUrl, T as createMSTeamsTokenProvider, U as inferPlaceholder, V as extractHtmlFromAttachment, W as isDownloadableAttachment, X as resolveAttachmentFetchPolicy, Y as readNestedString, Z as resolveMediaSsrfPolicy, et as safeHostForUrl, l as fetchGraphJson, n as formatMSTeamsSendErrorHint, q as isUrlAllowed, r as formatUnknownError, t as classifyMSTeamsSendError, tt as tryBuildGraphSharesUrlForSharedLink, w as createMSTeamsExpressAdapter, x as resolveMSTeamsStorePath, y as resolveMSTeamsCredentials, z as encodeGraphShareId } from "./errors-Dpn8B05h.js";
3
+ import { d as resolveMSTeamsUserAllowlist, u as resolveMSTeamsChannelAllowlist } from "./setup-surface-B7a1pD-K.js";
4
+ import { a as resolveMSTeamsReplyPolicy, i as resolveMSTeamsAllowlistMatch, o as resolveMSTeamsRouteConfig } from "./channel-CqRTzeBc.js";
5
+ import { C as resolveMSTeamsSqliteStateEnv, E as readJsonFile, S as createMSTeamsConversationStoreState, T as withMSTeamsSqliteMutationLock, _ as buildFileInfoCard, b as createMSTeamsPollStoreState, c as renderReplyPayloadsToMessages, d as withRevokedProxyFallback, f as resolveGraphChatId, g as removePendingUploadFs, h as getPendingUploadFs, l as sendMSTeamsMessages, m as removePendingUpload, p as getPendingUpload, s as buildConversationReference, u as sendMSTeamsActivityWithReference, v as parseFileConsentInvoke, w as toPluginJsonValue, x as extractMSTeamsPollVote, y as uploadToConsentUrl } from "./probe-DMNefdBZ.js";
6
6
  import { formatAllowlistMatchMeta } from "openclaw/plugin-sdk/allow-from";
7
7
  import { buildChannelProgressDraftLine, buildChannelProgressDraftLineForEntry, createChannelProgressDraftGate, formatChannelProgressDraftText, isChannelProgressDraftWorkToolName, mergeChannelProgressDraftLine, normalizeChannelProgressDraftLineIdentity, resolveChannelPreviewStreamMode, resolveChannelProgressDraftMaxLines, resolveChannelStreamingBlockEnabled, resolveChannelStreamingPreviewToolProgress, resolveChannelStreamingSuppressDefaultToolProgressMessages } from "openclaw/plugin-sdk/channel-outbound";
8
8
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -10,10 +10,11 @@ import { parseMediaContentLength, saveResponseMedia } from "openclaw/plugin-sdk/
10
10
  import { buildChannelInboundEventContext, dispatchReplyFromConfigWithSettledDispatcher, hasFinalInboundReplyDispatch, logInboundDrop, resolveInboundMentionDecision, resolveInboundReplyDispatchCounts, resolveInboundSessionEnvelopeContext } from "openclaw/plugin-sdk/channel-inbound";
11
11
  import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
12
12
  import path from "node:path";
13
+ import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
13
14
  import { appendRegularFile } from "openclaw/plugin-sdk/security-runtime";
14
- import { writeJsonFileAtomically } from "openclaw/plugin-sdk/json-store";
15
- import { resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
15
+ import crypto, { createHash } from "node:crypto";
16
16
  import fs from "node:fs/promises";
17
+ import { resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
17
18
  import { channelIngressRoutes, resolveStableChannelMessageIngress } from "openclaw/plugin-sdk/channel-ingress-runtime";
18
19
  import { filterSupplementalContextItems, resolveChannelContextVisibilityMode } from "openclaw/plugin-sdk/context-visibility-runtime";
19
20
  import { DEFAULT_GROUP_HISTORY_LIMIT, createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
@@ -70,32 +71,16 @@ function parseReflectionResponse(text) {
70
71
  const lastReflectionBySession = /* @__PURE__ */ new Map();
71
72
  /** Maximum cooldown entries before pruning expired ones. */
72
73
  const MAX_COOLDOWN_ENTRIES = 500;
73
- function legacySanitizeSessionKey(sessionKey) {
74
- return sessionKey.replace(/[^a-zA-Z0-9_-]/g, "_");
75
- }
76
- function encodeSessionKey(sessionKey) {
77
- return Buffer.from(sessionKey, "utf8").toString("base64url");
78
- }
79
- function resolveLearningsFilePath(storePath, sessionKey) {
80
- return `${storePath}/${encodeSessionKey(sessionKey)}.learnings.json`;
81
- }
82
- function resolveLegacyLearningsFilePath(storePath, sessionKey) {
83
- return `${storePath}/${legacySanitizeSessionKey(sessionKey)}.learnings.json`;
84
- }
85
- async function readLearningsFile(filePath) {
86
- try {
87
- const content = await fs.readFile(filePath, "utf-8");
88
- const parsed = JSON.parse(content);
89
- return {
90
- exists: true,
91
- learnings: Array.isArray(parsed) ? parsed : []
92
- };
93
- } catch {
94
- return {
95
- exists: false,
96
- learnings: []
97
- };
98
- }
74
+ const LEARNINGS_NAMESPACE = "feedback-learnings";
75
+ const MAX_LEARNING_ENTRIES = 1e4;
76
+ function learningStoreKey(storePath, sessionKey) {
77
+ return crypto.createHash("sha256").update(`${storePath}\0${sessionKey}`, "utf8").digest("hex");
78
+ }
79
+ function openLearningStore() {
80
+ return getMSTeamsRuntime().state.openKeyedStore({
81
+ namespace: LEARNINGS_NAMESPACE,
82
+ maxEntries: MAX_LEARNING_ENTRIES
83
+ });
99
84
  }
100
85
  /** Prune expired cooldown entries to prevent unbounded memory growth. */
101
86
  function pruneExpiredCooldowns(cooldownMs) {
@@ -115,17 +100,18 @@ function recordReflectionTime(sessionKey, cooldownMs) {
115
100
  lastReflectionBySession.set(sessionKey, Date.now());
116
101
  pruneExpiredCooldowns(cooldownMs ?? 3e5);
117
102
  }
118
- /** Store a learning derived from feedback reflection in a session companion file. */
103
+ /** Store a learning derived from feedback reflection. */
119
104
  async function storeSessionLearning(params) {
120
- const learningsFile = resolveLearningsFilePath(params.storePath, params.sessionKey);
121
- const legacyLearningsFile = resolveLegacyLearningsFilePath(params.storePath, params.sessionKey);
122
- const { exists, learnings: existingLearnings } = await readLearningsFile(learningsFile);
123
- const { learnings: legacyLearnings } = exists || legacyLearningsFile === learningsFile ? { learnings: [] } : await readLearningsFile(legacyLearningsFile);
124
- let learnings = exists ? existingLearnings : legacyLearnings;
105
+ const store = openLearningStore();
106
+ const key = learningStoreKey(params.storePath, params.sessionKey);
107
+ let learnings = (await store.lookup(key))?.learnings ?? [];
125
108
  learnings.push(params.learning);
126
109
  if (learnings.length > 10) learnings = learnings.slice(-10);
127
- await writeJsonFileAtomically(learningsFile, learnings);
128
- if (!exists && legacyLearningsFile !== learningsFile) await fs.rm(legacyLearningsFile, { force: true }).catch(() => void 0);
110
+ await store.register(key, {
111
+ sessionKey: params.sessionKey,
112
+ learnings,
113
+ updatedAt: Date.now()
114
+ });
129
115
  }
130
116
  //#endregion
131
117
  //#region extensions/msteams/src/feedback-reflection.ts
@@ -1327,6 +1313,10 @@ function buildMSTeamsMediaPayload(mediaList) {
1327
1313
  //#region extensions/msteams/src/graph-thread.ts
1328
1314
  const teamGroupIdCache = /* @__PURE__ */ new Map();
1329
1315
  const CACHE_TTL_MS = 600 * 1e3;
1316
+ function resolveTeamGroupIdCacheExpiresAt(nowRaw = Date.now()) {
1317
+ const now = asDateTimestampMs(nowRaw);
1318
+ return now === void 0 ? void 0 : resolveExpiresAtMsFromDurationMs(CACHE_TTL_MS, { nowMs: now });
1319
+ }
1330
1320
  /**
1331
1321
  * Strip HTML tags from Teams message content, preserving @mention display names.
1332
1322
  * Teams wraps mentions in <at>Name</at> tags.
@@ -1343,15 +1333,21 @@ function stripHtmlFromTeamsMessage(html) {
1343
1333
  */
1344
1334
  async function resolveTeamGroupId(token, conversationTeamId) {
1345
1335
  const cached = teamGroupIdCache.get(conversationTeamId);
1346
- if (cached && cached.expiresAt > Date.now()) return cached.groupId;
1336
+ if (cached) {
1337
+ const now = asDateTimestampMs(Date.now());
1338
+ const expiresAt = asDateTimestampMs(cached.expiresAt);
1339
+ if (now !== void 0 && expiresAt !== void 0 && expiresAt > now) return cached.groupId;
1340
+ teamGroupIdCache.delete(conversationTeamId);
1341
+ }
1347
1342
  try {
1348
1343
  const groupId = (await fetchGraphJson({
1349
1344
  token,
1350
1345
  path: `/teams/${encodeURIComponent(conversationTeamId)}?$select=id`
1351
1346
  })).id ?? conversationTeamId;
1352
- teamGroupIdCache.set(conversationTeamId, {
1347
+ const expiresAt = resolveTeamGroupIdCacheExpiresAt();
1348
+ if (expiresAt !== void 0) teamGroupIdCache.set(conversationTeamId, {
1353
1349
  groupId,
1354
- expiresAt: Date.now() + CACHE_TTL_MS
1350
+ expiresAt
1355
1351
  });
1356
1352
  return groupId;
1357
1353
  } catch {
@@ -1424,6 +1420,10 @@ function touchLru(map, key, value, max) {
1424
1420
  function buildParentCacheKey(groupId, channelId, parentId) {
1425
1421
  return `${groupId}\u0000${channelId}\u0000${parentId}`;
1426
1422
  }
1423
+ function resolveParentCacheExpiresAt(nowRaw) {
1424
+ const nowMs = asDateTimestampMs(nowRaw);
1425
+ return nowMs === void 0 ? void 0 : resolveExpiresAtMsFromDurationMs(PARENT_CACHE_TTL_MS, { nowMs });
1426
+ }
1427
1427
  /**
1428
1428
  * Fetch a channel parent message with an LRU+TTL cache.
1429
1429
  *
@@ -1432,17 +1432,20 @@ function buildParentCacheKey(groupId, channelId, parentId) {
1432
1432
  */
1433
1433
  async function fetchParentMessageCached(token, groupId, channelId, parentId, fetchParent = fetchChannelMessage) {
1434
1434
  const key = buildParentCacheKey(groupId, channelId, parentId);
1435
- const now = Date.now();
1435
+ const now = asDateTimestampMs(Date.now());
1436
1436
  const cached = parentCache.get(key);
1437
- if (cached && cached.expiresAt > now) {
1437
+ const cachedExpiresAt = cached ? asDateTimestampMs(cached.expiresAt) : void 0;
1438
+ if (cached && now !== void 0 && cachedExpiresAt !== void 0 && cachedExpiresAt > now) {
1438
1439
  parentCache.delete(key);
1439
1440
  parentCache.set(key, cached);
1440
1441
  return cached.message;
1441
1442
  }
1443
+ if (cached) parentCache.delete(key);
1442
1444
  const message = await fetchParent(token, groupId, channelId, parentId);
1443
- touchLru(parentCache, key, {
1445
+ const expiresAt = resolveParentCacheExpiresAt(Date.now());
1446
+ if (expiresAt !== void 0) touchLru(parentCache, key, {
1444
1447
  message,
1445
- expiresAt: now + PARENT_CACHE_TTL_MS
1448
+ expiresAt
1446
1449
  }, PARENT_CACHE_MAX);
1447
1450
  return message;
1448
1451
  }
@@ -3424,7 +3427,7 @@ async function runMSTeamsFileConsentInvokeHandler(context, log) {
3424
3427
  //#endregion
3425
3428
  //#region extensions/msteams/src/sso-token-store.ts
3426
3429
  /**
3427
- * File-backed store for Bot Framework OAuth SSO tokens.
3430
+ * SQLite-backed store for Bot Framework OAuth SSO tokens.
3428
3431
  *
3429
3432
  * Tokens are keyed by (connectionName, userId). `userId` should be the
3430
3433
  * stable AAD object ID (`activity.from.aadObjectId`) when available,
@@ -3436,9 +3439,33 @@ async function runMSTeamsFileConsentInvokeHandler(context, log) {
3436
3439
  * valid token without reaching back into Bot Framework every turn.
3437
3440
  */
3438
3441
  const STORE_FILENAME = "msteams-sso-tokens.json";
3442
+ const SSO_TOKENS_NAMESPACE = "sso-tokens";
3443
+ const SSO_TOKEN_MIGRATIONS_NAMESPACE = "sso-token-migrations";
3444
+ const SSO_TOKEN_LOCK_FILENAME = "msteams-sso-tokens.sqlite.lock";
3445
+ const MAX_SSO_TOKENS = 5e3;
3439
3446
  const STORE_KEY_VERSION_PREFIX = "v2:";
3440
3447
  function makeKey(connectionName, userId) {
3441
- return `${STORE_KEY_VERSION_PREFIX}${Buffer.from(JSON.stringify([connectionName, userId]), "utf8").toString("base64url")}`;
3448
+ return `${STORE_KEY_VERSION_PREFIX}${createHash("sha256").update(JSON.stringify([connectionName, userId])).digest("hex")}`;
3449
+ }
3450
+ function buildMigrationKey(filePath) {
3451
+ return `legacy-json:${createHash("sha256").update(filePath).digest("hex")}`;
3452
+ }
3453
+ function buildMigrationContentKey(filePath, value) {
3454
+ return `legacy-json-content:${createHash("sha256").update(filePath).update("\0").update(JSON.stringify(value) ?? "undefined").digest("hex")}`;
3455
+ }
3456
+ function createTokenStore(params) {
3457
+ return getMSTeamsRuntime().state.openKeyedStore({
3458
+ namespace: SSO_TOKENS_NAMESPACE,
3459
+ maxEntries: MAX_SSO_TOKENS,
3460
+ env: resolveMSTeamsSqliteStateEnv(params)
3461
+ });
3462
+ }
3463
+ function createMigrationStore(params) {
3464
+ return getMSTeamsRuntime().state.openKeyedStore({
3465
+ namespace: SSO_TOKEN_MIGRATIONS_NAMESPACE,
3466
+ maxEntries: 100,
3467
+ env: resolveMSTeamsSqliteStateEnv(params)
3468
+ });
3442
3469
  }
3443
3470
  function normalizeStoredToken(value) {
3444
3471
  if (!value || typeof value !== "object") return null;
@@ -3458,7 +3485,7 @@ function isSsoStoreData(value) {
3458
3485
  return obj.version === 1 && typeof obj.tokens === "object" && obj.tokens !== null;
3459
3486
  }
3460
3487
  function createMSTeamsSsoTokenStoreFs(params) {
3461
- const filePath = resolveMSTeamsStorePath({
3488
+ const legacyFilePath = resolveMSTeamsStorePath({
3462
3489
  filename: STORE_FILENAME,
3463
3490
  env: params?.env,
3464
3491
  homedir: params?.homedir,
@@ -3469,45 +3496,46 @@ function createMSTeamsSsoTokenStoreFs(params) {
3469
3496
  version: 1,
3470
3497
  tokens: {}
3471
3498
  };
3472
- const readStore = async () => {
3473
- const { value } = await readJsonFile(filePath, empty);
3474
- if (!isSsoStoreData(value)) return {
3475
- version: 1,
3476
- tokens: {}
3477
- };
3478
- const tokens = {};
3479
- for (const stored of Object.values(value.tokens)) {
3499
+ const tokenStore = createTokenStore(params);
3500
+ const migrationStore = createMigrationStore(params);
3501
+ const migrationKey = buildMigrationKey(legacyFilePath);
3502
+ let legacyImportPromise = null;
3503
+ const importLegacyStore = async () => {
3504
+ const imported = await migrationStore.lookup(migrationKey) !== void 0;
3505
+ const { value, exists } = await readJsonFile(legacyFilePath, empty);
3506
+ const contentKey = exists ? buildMigrationContentKey(legacyFilePath, value) : null;
3507
+ if (contentKey && await migrationStore.lookup(contentKey)) return;
3508
+ if (exists && isSsoStoreData(value)) for (const stored of Object.values(value.tokens)) {
3480
3509
  const normalized = normalizeStoredToken(stored);
3481
3510
  if (!normalized) continue;
3482
- tokens[makeKey(normalized.connectionName, normalized.userId)] = normalized;
3511
+ await tokenStore.registerIfAbsent(makeKey(normalized.connectionName, normalized.userId), toPluginJsonValue(normalized));
3483
3512
  }
3484
- return {
3485
- version: 1,
3486
- tokens
3487
- };
3513
+ if (contentKey) await migrationStore.register(contentKey, { importedAt: (/* @__PURE__ */ new Date()).toISOString() });
3514
+ if (!imported) await migrationStore.register(migrationKey, { importedAt: (/* @__PURE__ */ new Date()).toISOString() });
3515
+ if (exists) await fs.rm(legacyFilePath, { force: true }).catch(() => {});
3516
+ };
3517
+ const ensureLegacyImported = async () => {
3518
+ if (!legacyImportPromise) legacyImportPromise = withMSTeamsSqliteMutationLock(params, SSO_TOKEN_LOCK_FILENAME, () => importLegacyStore()).finally(() => {
3519
+ legacyImportPromise = null;
3520
+ });
3521
+ await legacyImportPromise;
3488
3522
  };
3489
3523
  return {
3490
3524
  async get({ connectionName, userId }) {
3491
- return (await readStore()).tokens[makeKey(connectionName, userId)] ?? null;
3525
+ await ensureLegacyImported();
3526
+ return await tokenStore.lookup(makeKey(connectionName, userId)) ?? null;
3492
3527
  },
3493
3528
  async save(token) {
3494
- await withFileLock(filePath, empty, async () => {
3495
- const store = await readStore();
3496
- const key = makeKey(token.connectionName, token.userId);
3497
- store.tokens[key] = { ...token };
3498
- await writeJsonFile(filePath, store);
3529
+ await withMSTeamsSqliteMutationLock(params, SSO_TOKEN_LOCK_FILENAME, async () => {
3530
+ await importLegacyStore();
3531
+ await tokenStore.register(makeKey(token.connectionName, token.userId), toPluginJsonValue({ ...token }));
3499
3532
  });
3500
3533
  },
3501
3534
  async remove({ connectionName, userId }) {
3502
3535
  let removed = false;
3503
- await withFileLock(filePath, empty, async () => {
3504
- const store = await readStore();
3505
- const key = makeKey(connectionName, userId);
3506
- if (store.tokens[key]) {
3507
- delete store.tokens[key];
3508
- removed = true;
3509
- await writeJsonFile(filePath, store);
3510
- }
3536
+ await withMSTeamsSqliteMutationLock(params, SSO_TOKEN_LOCK_FILENAME, async () => {
3537
+ await importLegacyStore();
3538
+ removed = await tokenStore.delete(makeKey(connectionName, userId));
3511
3539
  });
3512
3540
  return removed;
3513
3541
  }
@@ -3698,8 +3726,8 @@ async function monitorMSTeamsProvider(opts) {
3698
3726
  const MB = 1024 * 1024;
3699
3727
  const agentDefaults = cfg.agents?.defaults;
3700
3728
  const mediaMaxBytes = typeof agentDefaults?.mediaMaxMb === "number" && agentDefaults.mediaMaxMb > 0 ? Math.floor(agentDefaults.mediaMaxMb * MB) : 8 * MB;
3701
- const conversationStore = opts.conversationStore ?? createMSTeamsConversationStoreFs();
3702
- const pollStore = opts.pollStore ?? createMSTeamsPollStoreFs();
3729
+ const conversationStore = opts.conversationStore ?? createMSTeamsConversationStoreState();
3730
+ const pollStore = opts.pollStore ?? createMSTeamsPollStoreState();
3703
3731
  log.info(`starting provider (port ${port})`);
3704
3732
  const express = await import("express");
3705
3733
  const expressApp = express.default();
@@ -5,33 +5,40 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [v1.1.1](https://github.com/ljharb/es-object-atoms/compare/v1.1.0...v1.1.1) - 2025-01-14
8
+ ## [v1.1.2](https://github.com/es-shims/es-object-atoms/compare/v1.1.1...v1.1.2) - 2026-05-22
9
9
 
10
10
  ### Commits
11
11
 
12
- - [types] `ToObject`: improve types [`cfe8c8a`](https://github.com/ljharb/es-object-atoms/commit/cfe8c8a105c44820cb22e26f62d12ef0ad9715c8)
12
+ - [Dev Deps] update `@ljharb/eslint-config`, `@ljharb/tsconfig`, `auto-changelog`, `eslint`, `npmignore` [`41e3d94`](https://github.com/es-shims/es-object-atoms/commit/41e3d94f6b49237fa490ec598e068f170c8b161e)
13
+ - [types] improve `isObject` type [`758edc2`](https://github.com/es-shims/es-object-atoms/commit/758edc2280fa6993a294a55957a43cee5951bf51)
13
14
 
14
- ## [v1.1.0](https://github.com/ljharb/es-object-atoms/compare/v1.0.1...v1.1.0) - 2025-01-14
15
+ ## [v1.1.1](https://github.com/es-shims/es-object-atoms/compare/v1.1.0...v1.1.1) - 2025-01-14
15
16
 
16
17
  ### Commits
17
18
 
18
- - [New] add `isObject` [`51e4042`](https://github.com/ljharb/es-object-atoms/commit/51e4042df722eb3165f40dc5f4bf33d0197ecb07)
19
+ - [types] `ToObject`: improve types [`cfe8c8a`](https://github.com/es-shims/es-object-atoms/commit/cfe8c8a105c44820cb22e26f62d12ef0ad9715c8)
19
20
 
20
- ## [v1.0.1](https://github.com/ljharb/es-object-atoms/compare/v1.0.0...v1.0.1) - 2025-01-13
21
+ ## [v1.1.0](https://github.com/es-shims/es-object-atoms/compare/v1.0.1...v1.1.0) - 2025-01-14
21
22
 
22
23
  ### Commits
23
24
 
24
- - [Dev Deps] update `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/tape`, `auto-changelog`, `tape` [`38ab9eb`](https://github.com/ljharb/es-object-atoms/commit/38ab9eb00b62c2f4668644f5e513d9b414ebd595)
25
- - [types] improve types [`7d1beb8`](https://github.com/ljharb/es-object-atoms/commit/7d1beb887958b78b6a728a210a1c8370ab7e2aa1)
26
- - [Tests] replace `aud` with `npm audit` [`25863ba`](https://github.com/ljharb/es-object-atoms/commit/25863baf99178f1d1ad33d1120498db28631907e)
27
- - [Dev Deps] add missing peer dep [`c012309`](https://github.com/ljharb/es-object-atoms/commit/c0123091287e6132d6f4240496340c427433df28)
25
+ - [New] add `isObject` [`51e4042`](https://github.com/es-shims/es-object-atoms/commit/51e4042df722eb3165f40dc5f4bf33d0197ecb07)
26
+
27
+ ## [v1.0.1](https://github.com/es-shims/es-object-atoms/compare/v1.0.0...v1.0.1) - 2025-01-13
28
+
29
+ ### Commits
30
+
31
+ - [Dev Deps] update `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/tape`, `auto-changelog`, `tape` [`38ab9eb`](https://github.com/es-shims/es-object-atoms/commit/38ab9eb00b62c2f4668644f5e513d9b414ebd595)
32
+ - [types] improve types [`7d1beb8`](https://github.com/es-shims/es-object-atoms/commit/7d1beb887958b78b6a728a210a1c8370ab7e2aa1)
33
+ - [Tests] replace `aud` with `npm audit` [`25863ba`](https://github.com/es-shims/es-object-atoms/commit/25863baf99178f1d1ad33d1120498db28631907e)
34
+ - [Dev Deps] add missing peer dep [`c012309`](https://github.com/es-shims/es-object-atoms/commit/c0123091287e6132d6f4240496340c427433df28)
28
35
 
29
36
  ## v1.0.0 - 2024-03-16
30
37
 
31
38
  ### Commits
32
39
 
33
- - Initial implementation, tests, readme, types [`f1499db`](https://github.com/ljharb/es-object-atoms/commit/f1499db7d3e1741e64979c61d645ab3137705e82)
34
- - Initial commit [`99eedc7`](https://github.com/ljharb/es-object-atoms/commit/99eedc7b5fde38a50a28d3c8b724706e3e4c5f6a)
35
- - [meta] rename repo [`fc851fa`](https://github.com/ljharb/es-object-atoms/commit/fc851fa70616d2d182aaf0bd02c2ed7084dea8fa)
36
- - npm init [`b909377`](https://github.com/ljharb/es-object-atoms/commit/b909377c50049bd0ec575562d20b0f9ebae8947f)
37
- - Only apps should have lockfiles [`7249edd`](https://github.com/ljharb/es-object-atoms/commit/7249edd2178c1b9ddfc66ffcc6d07fdf0d28efc1)
40
+ - Initial implementation, tests, readme, types [`f1499db`](https://github.com/es-shims/es-object-atoms/commit/f1499db7d3e1741e64979c61d645ab3137705e82)
41
+ - Initial commit [`99eedc7`](https://github.com/es-shims/es-object-atoms/commit/99eedc7b5fde38a50a28d3c8b724706e3e4c5f6a)
42
+ - [meta] rename repo [`fc851fa`](https://github.com/es-shims/es-object-atoms/commit/fc851fa70616d2d182aaf0bd02c2ed7084dea8fa)
43
+ - npm init [`b909377`](https://github.com/es-shims/es-object-atoms/commit/b909377c50049bd0ec575562d20b0f9ebae8947f)
44
+ - Only apps should have lockfiles [`7249edd`](https://github.com/es-shims/es-object-atoms/commit/7249edd2178c1b9ddfc66ffcc6d07fdf0d28efc1)
@@ -1,3 +1,3 @@
1
- declare function isObject(x: unknown): x is object;
1
+ declare function isObject<T>(x: T): x is T & object & Record<PropertyKey, unknown>;
2
2
 
3
3
  export = isObject;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-object-atoms",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "ES Object-related atoms: Object, ToObject, RequireObjectCoercible",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -46,16 +46,15 @@
46
46
  "es-errors": "^1.3.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@ljharb/eslint-config": "^21.1.1",
50
- "@ljharb/tsconfig": "^0.2.3",
49
+ "@ljharb/eslint-config": "^22.2.3",
50
+ "@ljharb/tsconfig": "^0.3.2",
51
51
  "@types/tape": "^5.8.1",
52
- "auto-changelog": "^2.5.0",
52
+ "auto-changelog": "^2.5.1",
53
53
  "eclint": "^2.8.1",
54
- "encoding": "^0.1.13",
55
- "eslint": "^8.8.0",
54
+ "eslint": "^8.57.1",
56
55
  "evalmd": "^0.0.19",
57
56
  "in-publish": "^2.0.1",
58
- "npmignore": "^0.3.1",
57
+ "npmignore": "^0.3.5",
59
58
  "nyc": "^10.3.2",
60
59
  "safe-publish-latest": "^2.0.0",
61
60
  "tape": "^5.9.0",
@@ -2,5 +2,6 @@
2
2
  "extends": "@ljharb/tsconfig",
3
3
  "compilerOptions": {
4
4
  "target": "es5",
5
+ "ignoreDeprecations": "6.0",
5
6
  },
6
7
  }
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [v2.0.4](https://github.com/inspect-js/hasOwn/compare/v2.0.3...v2.0.4) - 2026-05-28
9
+
10
+ ### Commits
11
+
12
+ - [types] drop the dead key-narrowing overload [`fdab00e`](https://github.com/inspect-js/hasOwn/commit/fdab00e2703e65411424e19bf86a7e72a8f10da9)
13
+ - [Dev Deps] update `@ljharb/eslint-config`, `auto-changelog`, `eslint` [`91f6247`](https://github.com/inspect-js/hasOwn/commit/91f624768dd0f7db0d019b89d4d86bd66e20ec30)
14
+
8
15
  ## [v2.0.3](https://github.com/inspect-js/hasOwn/compare/v2.0.2...v2.0.3) - 2026-04-17
9
16
 
10
17
  ### Commits
@@ -1,4 +1,3 @@
1
- declare function hasOwn<O, K extends PropertyKey>(o: O, p: K): p is K & keyof O;
2
1
  declare function hasOwn<O, K extends PropertyKey, V = unknown>(o: O, p: K): o is O & Record<K, V>;
3
2
 
4
3
  export = hasOwn;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hasown",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "A robust, ES3 compatible, \"has own property\" predicate.",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -52,13 +52,12 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "@arethetypeswrong/cli": "^0.18.2",
55
- "@ljharb/eslint-config": "^22.2.2",
55
+ "@ljharb/eslint-config": "^22.2.3",
56
56
  "@ljharb/tsconfig": "^0.3.2",
57
57
  "@types/function-bind": "^1.1.10",
58
58
  "@types/tape": "^5.8.1",
59
- "auto-changelog": "^2.5.0",
60
- "encoding": "^0.1.13",
61
- "eslint": "^10.2.0",
59
+ "auto-changelog": "^2.5.1",
60
+ "eslint": "^10.4.0",
62
61
  "evalmd": "^0.0.19",
63
62
  "in-publish": "^2.0.1",
64
63
  "jiti": "^0.0.0",
@@ -164,10 +164,13 @@ export type TExtendsMapping<Input extends [unknown, unknown, unknown, unknown, u
164
164
  export declare function ExtendsMapping(input: [unknown, unknown, unknown, unknown, unknown, unknown] | []): unknown;
165
165
  export type TBaseMapping<Input extends [unknown, unknown, unknown] | unknown> = (Input extends ['(', infer Type extends T.TSchema, ')'] ? Type : Input extends infer Type extends T.TSchema ? Type : never);
166
166
  export declare function BaseMapping(input: [unknown, unknown, unknown] | unknown): unknown;
167
+ export type TWithMapping<Input extends [unknown, unknown] | []> = (Input extends ['with', infer Options extends Record<PropertyKey, unknown>] ? Options : []);
168
+ export declare function WithMapping(input: [unknown, unknown] | []): unknown;
167
169
  type TFactorIndexArray<Type extends T.TSchema, IndexArray extends unknown[]> = (IndexArray extends [infer Left extends T.TSchema[], ...infer Right extends unknown[]] ? (Left extends [infer Indexer extends T.TSchema] ? TFactorIndexArray<C.TIndexDeferred<Type, Indexer>, Right> : Left extends [] ? TFactorIndexArray<T.TArray<Type>, Right> : T.TNever) : Type);
168
170
  type TFactorExtends<Type extends T.TSchema, Extends extends unknown[]> = (Extends extends [infer Right extends T.TSchema, infer True extends T.TSchema, infer False extends T.TSchema] ? C.TConditionalDeferred<Type, Right, True, False> : Type);
169
- export type TFactorMapping<Input extends [unknown, unknown, unknown, unknown]> = (Input extends [infer KeyOf extends boolean, infer Type extends T.TSchema, infer IndexArray extends unknown[], infer Extend extends unknown[]] ? KeyOf extends true ? TFactorExtends<C.TKeyOfDeferred<TFactorIndexArray<Type, IndexArray>>, Extend> : TFactorExtends<TFactorIndexArray<Type, IndexArray>, Extend> : never);
170
- export declare function FactorMapping(input: [unknown, unknown, unknown, unknown]): unknown;
171
+ type TFactorWith<Type extends T.TSchema, With extends unknown> = (With extends Record<PropertyKey, unknown> ? C.TOptionsDeferred<Type, With> : Type);
172
+ export type TFactorMapping<Input extends [unknown, unknown, unknown, unknown, unknown]> = (Input extends [infer KeyOf extends boolean, infer Type extends T.TSchema, infer IndexArray extends unknown[], infer Extend extends unknown[], infer WithClause extends unknown] ? TFactorWith<KeyOf extends true ? TFactorExtends<C.TKeyOfDeferred<TFactorIndexArray<Type, IndexArray>>, Extend> : TFactorExtends<TFactorIndexArray<Type, IndexArray>, Extend>, WithClause> : never);
173
+ export declare function FactorMapping(input: [unknown, unknown, unknown, unknown, unknown]): unknown;
171
174
  type TExprBinaryMapping<Left extends T.TSchema, Rest extends unknown[]> = (Rest extends [infer Operator extends unknown, infer Right extends T.TSchema, infer Next extends unknown[]] ? (TExprBinaryMapping<Right, Next> extends infer Schema extends T.TSchema ? (Operator extends '&' ? (Schema extends T.TIntersect<infer Types extends T.TSchema[]> ? T.TIntersect<[Left, ...Types]> : T.TIntersect<[Left, Schema]>) : Operator extends '|' ? (Schema extends T.TUnion<infer Types extends T.TSchema[]> ? T.TUnion<[Left, ...Types]> : T.TUnion<[Left, Schema]>) : never) : never) : Left);
172
175
  export type TExprTermTailMapping<Input extends [unknown, unknown, unknown] | []> = (Input);
173
176
  export declare function ExprTermTailMapping(input: [unknown, unknown, unknown] | []): unknown;
@@ -185,27 +185,34 @@ export function BaseMapping(input) {
185
185
  ? input[1]
186
186
  : input;
187
187
  }
188
+ export function WithMapping(input) {
189
+ return Guard.IsEqual(input.length, 2) ? input[1] : [];
190
+ }
188
191
  // deno-coverage-ignore-start
189
- // ...
190
- const FactorIndexArray = (Type, indexArray) => {
192
+ function FactorIndexArray(Type, indexArray) {
191
193
  return indexArray.reduce((result, left) => {
192
194
  const _left = left;
193
195
  return (Guard.IsEqual(_left.length, 1) ? C.IndexDeferred(result, _left[0]) :
194
196
  Guard.IsEqual(_left.length, 0) ? T.Array(result) :
195
197
  Unreachable());
196
198
  }, Type);
197
- };
199
+ }
198
200
  // deno-coverage-ignore-stop
199
- const FactorExtends = (type, extend) => {
201
+ function FactorExtends(type, extend) {
200
202
  return Guard.IsEqual(extend.length, 3)
201
203
  ? C.ConditionalDeferred(type, extend[0], extend[1], extend[2])
202
204
  : type;
203
- };
205
+ }
206
+ function FactorWith(type, withClause) {
207
+ return Guard.IsArray(withClause) && Guard.IsEqual(withClause.length, 0)
208
+ ? type
209
+ : C.OptionsDeferred(type, withClause);
210
+ }
204
211
  export function FactorMapping(input) {
205
- const [keyOf, type, indexArray, extend] = input;
206
- return keyOf
212
+ const [keyOf, type, indexArray, extend, withClause] = input;
213
+ return FactorWith(keyOf
207
214
  ? FactorExtends(C.KeyOfDeferred(FactorIndexArray(type, indexArray)), extend)
208
- : FactorExtends(FactorIndexArray(type, indexArray), extend);
215
+ : FactorExtends(FactorIndexArray(type, indexArray), extend), withClause);
209
216
  }
210
217
  // deno-coverage-ignore-start
211
218
  function ExprBinaryMapping(left, rest) {
@@ -43,7 +43,8 @@ export type TIndexArray_0<Input extends string, Result extends unknown[] = []> =
43
43
  export type TIndexArray<Input extends string> = TIndexArray_0<Input> extends [infer _0 extends ([unknown, unknown, unknown] | [unknown, unknown])[], infer Input extends string] ? [S.TIndexArrayMapping<_0>, Input] : [];
44
44
  export type TExtends<Input extends string> = ((Token.TConst<'extends', Input> extends [infer _0, infer Input extends string] ? (TType<Input> extends [infer _1, infer Input extends string] ? (Token.TConst<'?', Input> extends [infer _2, infer Input extends string] ? (TType<Input> extends [infer _3, infer Input extends string] ? (Token.TConst<':', Input> extends [infer _4, infer Input extends string] ? (TType<Input> extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : []) : []) : []) : []) : []) : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown] | [], infer Input extends string] ? [S.TExtendsMapping<_0>, Input] : [];
45
45
  export type TBase<Input extends string> = ((Token.TConst<'(', Input> extends [infer _0, infer Input extends string] ? (TType<Input> extends [infer _1, infer Input extends string] ? (Token.TConst<')', Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : []) : []) : []) extends [infer _0, infer Input extends string] ? [_0, Input] : TKeyword<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : T_Object_<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TTuple<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TTemplateLiteral<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TLiteral<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TConstructor<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : T_Function_<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TMapped<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TOptions<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TGenericCall<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TReference<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown, unknown] | unknown, infer Input extends string] ? [S.TBaseMapping<_0>, Input] : [];
46
- export type TFactor<Input extends string> = (TKeyOf<Input> extends [infer _0, infer Input extends string] ? (TBase<Input> extends [infer _1, infer Input extends string] ? (TIndexArray<Input> extends [infer _2, infer Input extends string] ? (TExtends<Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : []) : []) : []) : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TFactorMapping<_0>, Input] : [];
46
+ export type TWith<Input extends string> = ((Token.TConst<'with', Input> extends [infer _0, infer Input extends string] ? (TJsonObject<Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown] | [], infer Input extends string] ? [S.TWithMapping<_0>, Input] : [];
47
+ export type TFactor<Input extends string> = (TKeyOf<Input> extends [infer _0, infer Input extends string] ? (TBase<Input> extends [infer _1, infer Input extends string] ? (TIndexArray<Input> extends [infer _2, infer Input extends string] ? (TExtends<Input> extends [infer _3, infer Input extends string] ? (TWith<Input> extends [infer _4, infer Input extends string] ? [[_0, _1, _2, _3, _4], Input] : []) : []) : []) : []) : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TFactorMapping<_0>, Input] : [];
47
48
  export type TExprTermTail<Input extends string> = ((Token.TConst<'&', Input> extends [infer _0, infer Input extends string] ? (TFactor<Input> extends [infer _1, infer Input extends string] ? (TExprTermTail<Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : []) : []) : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown, unknown] | [], infer Input extends string] ? [S.TExprTermTailMapping<_0>, Input] : [];
48
49
  export type TExprTerm<Input extends string> = (TFactor<Input> extends [infer _0, infer Input extends string] ? (TExprTermTail<Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TExprTermMapping<_0>, Input] : [];
49
50
  export type TExprTail<Input extends string> = ((Token.TConst<'|', Input> extends [infer _0, infer Input extends string] ? (TExprTerm<Input> extends [infer _1, infer Input extends string] ? (TExprTail<Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : []) : []) : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown, unknown] | [], infer Input extends string] ? [S.TExprTailMapping<_0>, Input] : [];
@@ -172,6 +173,7 @@ export declare const IndexArray_0: (input: string, result?: unknown[]) => [unkno
172
173
  export declare const IndexArray: (input: string) => [unknown, string] | [];
173
174
  export declare const Extends: (input: string) => [unknown, string] | [];
174
175
  export declare const Base: (input: string) => [unknown, string] | [];
176
+ export declare const With: (input: string) => [unknown, string] | [];
175
177
  export declare const Factor: (input: string) => [unknown, string] | [];
176
178
  export declare const ExprTermTail: (input: string) => [unknown, string] | [];
177
179
  export declare const ExprTerm: (input: string) => [unknown, string] | [];
@@ -47,7 +47,8 @@ export const IndexArray_0 = (input, result = []) => If(If(If(Token.Const('[', in
47
47
  export const IndexArray = (input) => If(IndexArray_0(input), ([_0, input]) => [S.IndexArrayMapping(_0), input]);
48
48
  export const Extends = (input) => If(If(If(Token.Const('extends', input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Token.Const('?', input), ([_2, input]) => If(Type(input), ([_3, input]) => If(Token.Const(':', input), ([_4, input]) => If(Type(input), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ExtendsMapping(_0), input]);
49
49
  export const Base = (input) => If(If(If(Token.Const('(', input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Token.Const(')', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If(Keyword(input), ([_0, input]) => [_0, input], () => If(_Object_(input), ([_0, input]) => [_0, input], () => If(Tuple(input), ([_0, input]) => [_0, input], () => If(TemplateLiteral(input), ([_0, input]) => [_0, input], () => If(Literal(input), ([_0, input]) => [_0, input], () => If(Constructor(input), ([_0, input]) => [_0, input], () => If(_Function_(input), ([_0, input]) => [_0, input], () => If(Mapped(input), ([_0, input]) => [_0, input], () => If(Options(input), ([_0, input]) => [_0, input], () => If(GenericCall(input), ([_0, input]) => [_0, input], () => If(Reference(input), ([_0, input]) => [_0, input], () => [])))))))))))), ([_0, input]) => [S.BaseMapping(_0), input]);
50
- export const Factor = (input) => If(If(KeyOf(input), ([_0, input]) => If(Base(input), ([_1, input]) => If(IndexArray(input), ([_2, input]) => If(Extends(input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.FactorMapping(_0), input]);
50
+ export const With = (input) => If(If(If(Token.Const('with', input), ([_0, input]) => If(JsonObject(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.WithMapping(_0), input]);
51
+ export const Factor = (input) => If(If(KeyOf(input), ([_0, input]) => If(Base(input), ([_1, input]) => If(IndexArray(input), ([_2, input]) => If(Extends(input), ([_3, input]) => If(With(input), ([_4, input]) => [[_0, _1, _2, _3, _4], input]))))), ([_0, input]) => [S.FactorMapping(_0), input]);
51
52
  export const ExprTermTail = (input) => If(If(If(Token.Const('&', input), ([_0, input]) => If(Factor(input), ([_1, input]) => If(ExprTermTail(input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ExprTermTailMapping(_0), input]);
52
53
  export const ExprTerm = (input) => If(If(Factor(input), ([_0, input]) => If(ExprTermTail(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ExprTermMapping(_0), input]);
53
54
  export const ExprTail = (input) => If(If(If(Token.Const('|', input), ([_0, input]) => If(ExprTerm(input), ([_1, input]) => If(ExprTail(input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ExprTailMapping(_0), input]);