@openclaw/teams-meetings 2026.8.1-beta.2 → 2026.8.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/dist/cli-metadata.js +1 -9
- package/dist/cli-output-mode-DfEjC8Y8.js +19 -0
- package/dist/index.js +37 -218
- package/node_modules/typebox/build/format/date.d.mts +1 -1
- package/node_modules/typebox/build/format/date.mjs +1 -1
- package/node_modules/typebox/build/format/date_time.d.mts +2 -2
- package/node_modules/typebox/build/format/date_time.mjs +3 -3
- package/node_modules/typebox/build/format/email.d.mts +1 -1
- package/node_modules/typebox/build/format/email.mjs +2 -2
- package/node_modules/typebox/build/format/hostname.mjs +2 -10
- package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
- package/node_modules/typebox/build/format/idn_email.mjs +3 -3
- package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
- package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
- package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
- package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +23 -0
- package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
- package/node_modules/typebox/build/format/idna/index.mjs +2 -0
- package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
- package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
- package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
- package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
- package/node_modules/typebox/build/format/ipv4.mjs +2 -32
- package/node_modules/typebox/build/format/ipv6.mjs +2 -61
- package/node_modules/typebox/build/format/iri.d.mts +2 -2
- package/node_modules/typebox/build/format/iri.mjs +26 -8
- package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
- package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
- package/node_modules/typebox/build/format/regex.d.mts +1 -2
- package/node_modules/typebox/build/format/regex.mjs +2 -6
- package/node_modules/typebox/build/format/time.d.mts +2 -2
- package/node_modules/typebox/build/format/time.mjs +19 -14
- package/node_modules/typebox/build/format/uri.d.mts +1 -1
- package/node_modules/typebox/build/format/uri.mjs +3 -130
- package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
- package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
- package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
- package/node_modules/typebox/build/format/uri_template.mjs +4 -5
- package/node_modules/typebox/build/format/url.d.mts +3 -3
- package/node_modules/typebox/build/format/url.mjs +4 -5
- package/node_modules/typebox/build/guard/emit.d.mts +3 -1
- package/node_modules/typebox/build/guard/emit.mjs +12 -5
- package/node_modules/typebox/build/guard/guard.d.mts +8 -2
- package/node_modules/typebox/build/guard/guard.mjs +25 -4
- package/node_modules/typebox/build/guard/string.d.mts +2 -2
- package/node_modules/typebox/build/guard/string.mjs +7 -7
- package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
- package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
- package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
- package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
- package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
- package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
- package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
- package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
- package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
- package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
- package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
- package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
- package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
- package/node_modules/typebox/build/schema/types/index.mjs +0 -2
- package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
- package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
- package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
- package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
- package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
- package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
- package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
- package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
- package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
- package/node_modules/typebox/build/type/script/parser.mjs +27 -23
- package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
- package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
- package/node_modules/typebox/package.json +27 -27
- package/node_modules/typebox/readme.md +79 -82
- package/openclaw.plugin.json +7 -0
- package/package.json +5 -5
- package/node_modules/typebox/build/format/_idna.d.mts +0 -2
- package/node_modules/typebox/build/format/_idna.mjs +0 -246
- package/node_modules/typebox/build/format/_puny.d.mts +0 -1
- package/node_modules/typebox/build/format/_puny.mjs +0 -77
- package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
- package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
- package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
- package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
package/dist/cli-metadata.js
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region extensions/teams-meetings/src/cli-output-mode.ts
|
|
3
|
-
const TEAMS_MEETINGS_CLI_METADATA = MeetingPlatformAdapter.createCliMetadata({
|
|
4
|
-
commandName: "teamsmeetings",
|
|
5
|
-
description: "Join and manage Microsoft Teams meeting guests",
|
|
6
|
-
id: "teams-meetings",
|
|
7
|
-
name: "Microsoft Teams meetings"
|
|
8
|
-
});
|
|
9
|
-
//#endregion
|
|
1
|
+
import { t as TEAMS_MEETINGS_CLI_METADATA } from "./cli-output-mode-DfEjC8Y8.js";
|
|
10
2
|
export { TEAMS_MEETINGS_CLI_METADATA as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { getRootOptionAwareCommandPath } from "openclaw/plugin-sdk/cli-argv";
|
|
2
|
+
//#region extensions/teams-meetings/src/cli-output-mode.ts
|
|
3
|
+
const descriptor = {
|
|
4
|
+
name: "teamsmeetings",
|
|
5
|
+
description: "Join and manage Microsoft Teams meeting guests",
|
|
6
|
+
hasSubcommands: true,
|
|
7
|
+
machineOutput: ({ argv }) => getRootOptionAwareCommandPath(argv, 2).length === 2
|
|
8
|
+
};
|
|
9
|
+
const TEAMS_MEETINGS_CLI_METADATA = {
|
|
10
|
+
id: "teams-meetings",
|
|
11
|
+
name: "Microsoft Teams meetings",
|
|
12
|
+
description: "Microsoft Teams meetings CLI metadata",
|
|
13
|
+
descriptor,
|
|
14
|
+
register(api) {
|
|
15
|
+
api.registerCli(() => {}, { descriptors: [descriptor] });
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { TEAMS_MEETINGS_CLI_METADATA as t };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { t as TEAMS_MEETINGS_CLI_METADATA } from "./cli-output-mode-DfEjC8Y8.js";
|
|
1
2
|
import { t as teamsMeetingsConfig } from "./config-BIqv-97D.js";
|
|
2
3
|
import { MeetingPlatformAdapter } from "openclaw/plugin-sdk/meeting-runtime";
|
|
3
4
|
import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
|
|
4
5
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
6
|
import { Type } from "typebox";
|
|
7
|
+
import { createMeetingLeaveSource, createMeetingTranscriptSource } from "openclaw/plugin-sdk/meeting-page-script-runtime";
|
|
6
8
|
//#region extensions/teams-meetings/src/errors.ts
|
|
7
9
|
var TeamsMeetingsInvalidRequestError = class extends Error {};
|
|
8
10
|
function teamsMeetingsInvalidRequest(message) {
|
|
@@ -565,7 +567,6 @@ function isRecoverableTeamsMeetingTab(tab, url) {
|
|
|
565
567
|
}
|
|
566
568
|
//#endregion
|
|
567
569
|
//#region extensions/teams-meetings/src/transports/teams-meetings-page-scripts.ts
|
|
568
|
-
const TEAMS_MEETING_TRANSCRIPT_MAX_LINES = 500;
|
|
569
570
|
function pageIdentityFunctionSource() {
|
|
570
571
|
return `const meetingIdentity = (rawUrl) => {
|
|
571
572
|
try {
|
|
@@ -651,158 +652,23 @@ function teamsMeetingStatusScript(params) {
|
|
|
651
652
|
}) + teamsMeetingStatusCallSource();
|
|
652
653
|
}
|
|
653
654
|
function teamsMeetingTranscriptScript(meetingUrl, meetingSessionId, finalize) {
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
: archivedCaptions;
|
|
667
|
-
// A same-session finalized buffer belongs to the departed call even if Teams
|
|
668
|
-
// immediately navigated this tab into another meeting before transcript pickup.
|
|
669
|
-
const useFinalizedCaptions = Boolean(
|
|
670
|
-
captions?.finalized === true &&
|
|
671
|
-
captions?.identity === expectedIdentity &&
|
|
672
|
-
(!captions?.sessionId || captions.sessionId === expectedSessionId)
|
|
673
|
-
);
|
|
674
|
-
const effectiveIdentity = useFinalizedCaptions
|
|
675
|
-
? captions.identity
|
|
676
|
-
: currentIdentity || state?.identity || captions?.identity;
|
|
677
|
-
if (!expectedIdentity || effectiveIdentity !== expectedIdentity) {
|
|
678
|
-
return JSON.stringify({ urlMatched: false, droppedLines: 0, lines: [] });
|
|
679
|
-
}
|
|
680
|
-
if (!useFinalizedCaptions && state?.sessionId && state.sessionId !== expectedSessionId) {
|
|
681
|
-
return JSON.stringify({ urlMatched: true, sessionMatched: false, droppedLines: 0, lines: [] });
|
|
682
|
-
}
|
|
683
|
-
if (captions?.sessionId && captions.sessionId !== expectedSessionId) {
|
|
684
|
-
return JSON.stringify({ urlMatched: true, sessionMatched: false, droppedLines: 0, lines: [] });
|
|
685
|
-
}
|
|
686
|
-
if (${JSON.stringify(finalize)} && Array.isArray(captions?.visible) && captions.visible.length > 0) {
|
|
687
|
-
if (captions.settleTimer !== undefined) clearTimeout(captions.settleTimer);
|
|
688
|
-
captions.settleTimer = undefined;
|
|
689
|
-
captions.lines = Array.isArray(captions.lines) ? captions.lines : [];
|
|
690
|
-
captions.lines.push(...captions.visible.map((entry) => ({
|
|
691
|
-
at: entry.at,
|
|
692
|
-
speaker: entry.speaker,
|
|
693
|
-
text: entry.text,
|
|
694
|
-
})));
|
|
695
|
-
captions.visible = [];
|
|
696
|
-
const excess = captions.lines.length - ${TEAMS_MEETING_TRANSCRIPT_MAX_LINES};
|
|
697
|
-
if (excess > 0) {
|
|
698
|
-
captions.lines.splice(0, excess);
|
|
699
|
-
captions.droppedLines = (captions.droppedLines || 0) + excess;
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
if (${JSON.stringify(finalize)} && captions) {
|
|
703
|
-
if (captions.settleTimer !== undefined) clearTimeout(captions.settleTimer);
|
|
704
|
-
captions.settleTimer = undefined;
|
|
705
|
-
captions.observer?.disconnect?.();
|
|
706
|
-
captions.observer = undefined;
|
|
707
|
-
captions.observerInstalled = false;
|
|
708
|
-
captions.identity = expectedIdentity;
|
|
709
|
-
captions.finalized = true;
|
|
710
|
-
captions.finalizedAt = Date.now();
|
|
711
|
-
}
|
|
712
|
-
const allLines = [
|
|
713
|
-
...(Array.isArray(captions?.lines) ? captions.lines : []),
|
|
714
|
-
...(${JSON.stringify(finalize)} || !Array.isArray(captions?.visible) ? [] : captions.visible),
|
|
715
|
-
];
|
|
716
|
-
const visibleOverflow = Math.max(0, allLines.length - ${TEAMS_MEETING_TRANSCRIPT_MAX_LINES});
|
|
717
|
-
const lines = allLines.slice(-${TEAMS_MEETING_TRANSCRIPT_MAX_LINES});
|
|
718
|
-
const result = {
|
|
719
|
-
urlMatched: true,
|
|
720
|
-
sessionMatched: true,
|
|
721
|
-
epoch: typeof captions?.epoch === "string" ? captions.epoch : undefined,
|
|
722
|
-
droppedLines: (Number.isFinite(captions?.droppedLines)
|
|
723
|
-
? Math.max(0, Math.trunc(captions.droppedLines))
|
|
724
|
-
: 0) + visibleOverflow,
|
|
725
|
-
lines: lines.map((line) => ({
|
|
726
|
-
at: typeof line?.at === "string" ? line.at : undefined,
|
|
727
|
-
speaker: typeof line?.speaker === "string" ? line.speaker : undefined,
|
|
728
|
-
text: typeof line?.text === "string" ? line.text : "",
|
|
729
|
-
})).filter((line) => line.text),
|
|
730
|
-
};
|
|
731
|
-
return JSON.stringify(result);
|
|
732
|
-
}`;
|
|
655
|
+
return createMeetingTranscriptSource({
|
|
656
|
+
expectedIdentity: normalizeTeamsMeetingUrlForReuse(meetingUrl),
|
|
657
|
+
finalize,
|
|
658
|
+
globals: {
|
|
659
|
+
captionArchive: "__openclawTeamsCaptionArchive",
|
|
660
|
+
captions: "__openclawTeamsCaptions",
|
|
661
|
+
meeting: "__openclawTeamsMeeting"
|
|
662
|
+
},
|
|
663
|
+
meetingSessionId,
|
|
664
|
+
pageIdentitySource: pageIdentityFunctionSource(),
|
|
665
|
+
platformDisplayName: "Teams"
|
|
666
|
+
});
|
|
733
667
|
}
|
|
734
668
|
function teamsMeetingLeaveScript(params) {
|
|
735
669
|
const selectors = JSON.stringify(TEAMS_MEETING_SELECTORS);
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
${pageIdentityFunctionSource()}
|
|
739
|
-
const selectors = ${selectors};
|
|
740
|
-
const expectedIdentity = ${JSON.stringify(expectedIdentity)};
|
|
741
|
-
const expectedSessionId = ${JSON.stringify(params.meetingSessionId)};
|
|
742
|
-
const leaveInitiated = ${JSON.stringify(params.leaveInitiated)};
|
|
743
|
-
const currentIdentity = meetingIdentity(location.href);
|
|
744
|
-
const state = window.__openclawTeamsMeeting;
|
|
745
|
-
const enforceSessionOwnership = Boolean(expectedSessionId);
|
|
746
|
-
if (enforceSessionOwnership && state?.sessionId && state.sessionId !== expectedSessionId) {
|
|
747
|
-
return JSON.stringify({ departed: false, sessionConflict: true, sessionMatched: false, urlMatched: true });
|
|
748
|
-
}
|
|
749
|
-
const sessionMatched = !enforceSessionOwnership || state?.sessionId === expectedSessionId;
|
|
750
|
-
const retainedLeaveOwnership = Boolean(!sessionMatched && leaveInitiated);
|
|
751
|
-
if (!sessionMatched && !retainedLeaveOwnership) {
|
|
752
|
-
return JSON.stringify({ departed: false, sessionMatched: false, urlMatched: true });
|
|
753
|
-
}
|
|
754
|
-
const retireOwnedAudioBridges = () => {
|
|
755
|
-
const entries = Array.isArray(window.__openclawTeamsAudioOutputs)
|
|
756
|
-
? window.__openclawTeamsAudioOutputs
|
|
757
|
-
: [];
|
|
758
|
-
const retained = [];
|
|
759
|
-
const activeSessionId = expectedSessionId || state?.sessionId;
|
|
760
|
-
for (const entry of entries) {
|
|
761
|
-
const ownedByActiveSession = Boolean(
|
|
762
|
-
!entry?.sessionId || (activeSessionId && entry.sessionId === activeSessionId)
|
|
763
|
-
);
|
|
764
|
-
if (!ownedByActiveSession) {
|
|
765
|
-
retained.push(entry);
|
|
766
|
-
continue;
|
|
767
|
-
}
|
|
768
|
-
const mediaSourceUrl = (element) => String(element?.currentSrc || element?.src || "");
|
|
769
|
-
const sources = Array.isArray(entry?.sources)
|
|
770
|
-
? entry.sources
|
|
771
|
-
: entry?.source
|
|
772
|
-
? [{ element: entry.source, muted: Boolean(entry.sourceMuted), stream: entry.stream, url: entry.sourceUrl }]
|
|
773
|
-
: [];
|
|
774
|
-
for (const source of sources) {
|
|
775
|
-
const element = source?.element;
|
|
776
|
-
const sourceMatches = source?.stream || element?.srcObject
|
|
777
|
-
? element?.srcObject === source?.stream
|
|
778
|
-
: Boolean(source?.url && mediaSourceUrl(element) === source.url);
|
|
779
|
-
const sourceIsEmpty = Boolean(element && !element.srcObject && !mediaSourceUrl(element));
|
|
780
|
-
if (!element) continue;
|
|
781
|
-
if (sourceIsEmpty) {
|
|
782
|
-
element.muted = true;
|
|
783
|
-
continue;
|
|
784
|
-
}
|
|
785
|
-
if (!sourceMatches) continue;
|
|
786
|
-
const detachedLiveSource = Boolean(
|
|
787
|
-
element.isConnected === false &&
|
|
788
|
-
element.srcObject?.getAudioTracks?.().some((track) => track.readyState === "live")
|
|
789
|
-
);
|
|
790
|
-
if (detachedLiveSource) {
|
|
791
|
-
element.muted = true;
|
|
792
|
-
element.pause?.();
|
|
793
|
-
element.srcObject = null;
|
|
794
|
-
} else {
|
|
795
|
-
element.muted = Boolean(source.muted);
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
entry?.bridge?.pause?.();
|
|
799
|
-
if (entry?.bridge) entry.bridge.srcObject = null;
|
|
800
|
-
entry?.bridge?.remove?.();
|
|
801
|
-
}
|
|
802
|
-
if (retained.length > 0) window.__openclawTeamsAudioOutputs = retained;
|
|
803
|
-
else delete window.__openclawTeamsAudioOutputs;
|
|
804
|
-
};
|
|
805
|
-
const first = (list) => {
|
|
670
|
+
return createMeetingLeaveSource({
|
|
671
|
+
controlSource: `const first = (list) => {
|
|
806
672
|
for (const selector of list) {
|
|
807
673
|
const node = document.querySelector(selector);
|
|
808
674
|
if (!node) continue;
|
|
@@ -813,72 +679,22 @@ function teamsMeetingLeaveScript(params) {
|
|
|
813
679
|
const leave = first(selectors.leave);
|
|
814
680
|
const confirmation = first(selectors.leaveConfirmation);
|
|
815
681
|
const postCall = first(selectors.postCall);
|
|
816
|
-
const currentUrlMatches = Boolean(expectedIdentity && currentIdentity === expectedIdentity)
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
);
|
|
833
|
-
const rerenderPendingMatches = Boolean(
|
|
834
|
-
expectedIdentity &&
|
|
835
|
-
!currentIdentity &&
|
|
836
|
-
state?.identity === expectedIdentity &&
|
|
837
|
-
state?.inCallControl?.isConnected === false &&
|
|
838
|
-
state?.inCallUrl === location.href &&
|
|
839
|
-
Date.now() - state?.verifiedAt < 5_000 &&
|
|
840
|
-
!leave
|
|
841
|
-
);
|
|
842
|
-
const meetingIdentityMatches = Boolean(
|
|
843
|
-
currentUrlMatches || preservedCallMatches || pendingLeaveMatches || rerenderPendingMatches
|
|
844
|
-
);
|
|
845
|
-
// Teams can replace the document between our Leave click and its post-call marker.
|
|
846
|
-
// Retain request ownership only while no identity or live-call control contradicts it.
|
|
847
|
-
const initiatedLeaveTransitionMatches = Boolean(
|
|
848
|
-
leaveInitiated &&
|
|
849
|
-
!currentIdentity &&
|
|
850
|
-
!leave &&
|
|
851
|
-
(!state?.identity || state.identity === expectedIdentity)
|
|
852
|
-
);
|
|
853
|
-
if (postCall && (meetingIdentityMatches || initiatedLeaveTransitionMatches)) {
|
|
854
|
-
retireOwnedAudioBridges();
|
|
855
|
-
if (sessionMatched) delete window.__openclawTeamsMeeting;
|
|
856
|
-
return JSON.stringify({ departed: true, sessionMatched: true, urlMatched: true });
|
|
857
|
-
}
|
|
858
|
-
if (!meetingIdentityMatches && !initiatedLeaveTransitionMatches) {
|
|
859
|
-
return JSON.stringify({ departed: false, urlMatched: false });
|
|
860
|
-
}
|
|
861
|
-
if (!sessionMatched) {
|
|
862
|
-
return JSON.stringify({ departed: false, urlMatched: true });
|
|
863
|
-
}
|
|
864
|
-
if (confirmation) {
|
|
865
|
-
confirmation.click();
|
|
866
|
-
return JSON.stringify({ departed: false, leaveAction: "confirm", urlMatched: true });
|
|
867
|
-
}
|
|
868
|
-
if (leave) {
|
|
869
|
-
window.__openclawTeamsMeeting = {
|
|
870
|
-
...state,
|
|
871
|
-
identity: expectedIdentity,
|
|
872
|
-
inCallControl: leave,
|
|
873
|
-
inCallUrl: location.href,
|
|
874
|
-
leavePending: true,
|
|
875
|
-
leavePendingAt: Date.now(),
|
|
876
|
-
};
|
|
877
|
-
leave.click();
|
|
878
|
-
return JSON.stringify({ departed: false, leaveAction: "leave", urlMatched: true });
|
|
879
|
-
}
|
|
880
|
-
return JSON.stringify({ departed: false, urlMatched: true });
|
|
881
|
-
}`;
|
|
682
|
+
const currentUrlMatches = Boolean(expectedIdentity && currentIdentity === expectedIdentity);`,
|
|
683
|
+
departedMarkerSource: "postCall",
|
|
684
|
+
expectedIdentity: normalizeTeamsMeetingUrlForReuse(params.meetingUrl),
|
|
685
|
+
leaveInitiated: params.leaveInitiated,
|
|
686
|
+
meetingSessionId: params.meetingSessionId,
|
|
687
|
+
pageIdentitySource: pageIdentityFunctionSource(),
|
|
688
|
+
platform: {
|
|
689
|
+
displayName: "Teams",
|
|
690
|
+
globals: {
|
|
691
|
+
audioOutputs: "__openclawTeamsAudioOutputs",
|
|
692
|
+
meeting: "__openclawTeamsMeeting"
|
|
693
|
+
}
|
|
694
|
+
},
|
|
695
|
+
selectors,
|
|
696
|
+
sessionMatchSource: "const sessionMatched = !enforceSessionOwnership || state?.sessionId === expectedSessionId;"
|
|
697
|
+
});
|
|
882
698
|
}
|
|
883
699
|
//#endregion
|
|
884
700
|
//#region extensions/teams-meetings/src/transports/teams-meetings-platform-constants.ts
|
|
@@ -1014,7 +830,7 @@ const probes = MeetingPlatformAdapter.createRuntimeProbes({
|
|
|
1014
830
|
defaultSpeechMessage: "Say exactly: Microsoft Teams speech test complete.",
|
|
1015
831
|
invalidRequest: teamsMeetingsInvalidRequest,
|
|
1016
832
|
resolveTimeoutMs: (input, fallback) => MeetingPlatformAdapter.resolveProbeTimeoutMs(input, fallback, teamsMeetingsInvalidRequest),
|
|
1017
|
-
shouldWaitForListening: (
|
|
833
|
+
shouldWaitForListening: ({ chrome }) => Boolean(chrome?.launched || chrome?.browserTab?.targetId),
|
|
1018
834
|
talkBackMode: MeetingPlatformAdapter.isTalkBackMode
|
|
1019
835
|
});
|
|
1020
836
|
const testTeamsMeetingListening = probes.testListening;
|
|
@@ -1149,7 +965,10 @@ var teams_meetings_default = MeetingPlatformAdapter.createPluginShellEntry({
|
|
|
1149
965
|
nodeHandler: handleTeamsMeetingsNodeHostCommand,
|
|
1150
966
|
createNodePolicy: createTeamsMeetingsNodeInvokePolicy,
|
|
1151
967
|
registerNodeWhen: () => true,
|
|
1152
|
-
cli: {
|
|
968
|
+
cli: {
|
|
969
|
+
descriptor: TEAMS_MEETINGS_CLI_METADATA.descriptor,
|
|
970
|
+
load: async () => (await import("./cli-D3dhbuKV.js")).registerTeamsMeetingsCli
|
|
971
|
+
}
|
|
1153
972
|
});
|
|
1154
973
|
//#endregion
|
|
1155
974
|
export { teams_meetings_default as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Returns true if the value is a ISO8601 DateTime string
|
|
3
|
-
* @
|
|
3
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc3339
|
|
4
4
|
* @example `2020-12-12T20:20:40+00:00`
|
|
5
5
|
*/
|
|
6
|
-
export declare function IsDateTime(value: string
|
|
6
|
+
export declare function IsDateTime(value: string): boolean;
|
|
@@ -2,10 +2,10 @@ import { IsDate } from './date.mjs';
|
|
|
2
2
|
import { IsTime } from './time.mjs';
|
|
3
3
|
/**
|
|
4
4
|
* Returns true if the value is a ISO8601 DateTime string
|
|
5
|
-
* @
|
|
5
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc3339
|
|
6
6
|
* @example `2020-12-12T20:20:40+00:00`
|
|
7
7
|
*/
|
|
8
|
-
export function IsDateTime(value
|
|
8
|
+
export function IsDateTime(value) {
|
|
9
9
|
const dateTime = value.split(/T/i);
|
|
10
|
-
return dateTime.length === 2 && IsDate(dateTime[0]) && IsTime(dateTime[1]
|
|
10
|
+
return dateTime.length === 2 && IsDate(dateTime[0]) && IsTime(dateTime[1]);
|
|
11
11
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const Email = /^(
|
|
1
|
+
const Email = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\.)*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i;
|
|
2
2
|
/**
|
|
3
3
|
* Returns true if the value is an Email
|
|
4
|
-
* @specification
|
|
4
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc5322
|
|
5
5
|
*/
|
|
6
6
|
export function IsEmail(value) {
|
|
7
7
|
return Email.test(value);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as Idna from './
|
|
1
|
+
import * as Idna from './idna/index.mjs';
|
|
2
2
|
/**
|
|
3
3
|
* Returns true if the value is a valid hostname.
|
|
4
4
|
* @specification https://tools.ietf.org/html/rfc1123
|
|
@@ -6,13 +6,5 @@ import * as Idna from './_idna.mjs';
|
|
|
6
6
|
* @specification https://tools.ietf.org/html/rfc5892
|
|
7
7
|
*/
|
|
8
8
|
export function IsHostname(value) {
|
|
9
|
-
|
|
10
|
-
return false;
|
|
11
|
-
if (value.charCodeAt(value.length - 1) === 46)
|
|
12
|
-
return false;
|
|
13
|
-
for (const label of value.split('.')) {
|
|
14
|
-
if (!Idna.IsLabel(label))
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
return true;
|
|
9
|
+
return Idna.IsHostname(value);
|
|
18
10
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const IdnEmail = /^(
|
|
1
|
+
const IdnEmail = /^(?:[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+(?:\.[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+)*|"(?:[^"\\]|\\.)*")@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-)(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-))*$/iu;
|
|
2
2
|
/**
|
|
3
3
|
* Returns true if the value is an IdnEmail
|
|
4
|
-
* @specification
|
|
4
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc4952
|
|
5
5
|
*/
|
|
6
6
|
export function IsIdnEmail(value) {
|
|
7
|
-
return IdnEmail.test(value);
|
|
7
|
+
return IdnEmail.test(value.normalize('NFC'));
|
|
8
8
|
}
|
|
@@ -3,5 +3,6 @@
|
|
|
3
3
|
* @specification https://tools.ietf.org/html/rfc3490
|
|
4
4
|
* @specification https://tools.ietf.org/html/rfc5891
|
|
5
5
|
* @specification https://tools.ietf.org/html/rfc5892
|
|
6
|
+
* @specification https://tools.ietf.org/html/rfc5893
|
|
6
7
|
*/
|
|
7
8
|
export declare function IsIdnHostname(value: string): boolean;
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Idna from './idna/index.mjs';
|
|
2
2
|
/**
|
|
3
3
|
* Returns true if the value is a valid internationalized (IDN) hostname.
|
|
4
4
|
* @specification https://tools.ietf.org/html/rfc3490
|
|
5
5
|
* @specification https://tools.ietf.org/html/rfc5891
|
|
6
6
|
* @specification https://tools.ietf.org/html/rfc5892
|
|
7
|
+
* @specification https://tools.ietf.org/html/rfc5893
|
|
7
8
|
*/
|
|
8
9
|
export function IsIdnHostname(value) {
|
|
9
|
-
|
|
10
|
-
return false;
|
|
11
|
-
const canonical = value.normalize('NFC').replace(/[\u002E\u3002\uFF0E\uFF61]/g, '.');
|
|
12
|
-
if (canonical.length > 253)
|
|
13
|
-
return false;
|
|
14
|
-
for (const label of canonical.split('.')) {
|
|
15
|
-
if (!IsIdnLabel(label))
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
return true;
|
|
10
|
+
return Idna.IsIdnHostname(value);
|
|
19
11
|
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// deno-fmt-ignore-file
|
|
2
|
+
import * as FormatPuny from './puny.mjs';
|
|
3
|
+
import * as Pattern from '../pattern/pattern.mjs';
|
|
4
|
+
// ------------------------------------------------------------------
|
|
5
|
+
// LOCAL REGEX: Allowed Bidi classes per direction (RFC 5893)
|
|
6
|
+
// ------------------------------------------------------------------
|
|
7
|
+
const RE_RTL_ALLOWED = /^(?:R|AL|AN|EN|ES|CS|ET|ON|BN|NSM)$/;
|
|
8
|
+
const RE_LTR_ALLOWED = /^(?:L|EN|ES|CS|ET|ON|BN|NSM)$/;
|
|
9
|
+
const RE_RTL_CLASSES = /^(?:R|AL|AN)$/;
|
|
10
|
+
// ------------------------------------------------------------------
|
|
11
|
+
// HasBidiChars
|
|
12
|
+
//
|
|
13
|
+
// Decodes a punycode label to its Unicode form (if it is one) and
|
|
14
|
+
// checks whether the result is an RTL label per RFC 5893 §1.4.
|
|
15
|
+
// ------------------------------------------------------------------
|
|
16
|
+
export function HasBidiChars(value) {
|
|
17
|
+
if (FormatPuny.IsAcePrefixed(value)) {
|
|
18
|
+
try {
|
|
19
|
+
return HasRightToLeftCharacters(FormatPuny.Decode(value.slice(4).toLowerCase()));
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return HasRightToLeftCharacters(value);
|
|
26
|
+
}
|
|
27
|
+
// ------------------------------------------------------------------
|
|
28
|
+
// GetBidiClass
|
|
29
|
+
// ------------------------------------------------------------------
|
|
30
|
+
function GetBidiClass(codePoint) {
|
|
31
|
+
const char = String.fromCodePoint(codePoint);
|
|
32
|
+
return (Pattern.RE_EUROPEAN_NUMBER.test(char) ? 'EN' :
|
|
33
|
+
Pattern.RE_ARABIC_INDIC_DIGIT.test(char) ? 'AN' :
|
|
34
|
+
// Pattern.RE_EUROPEAN_SEPARATOR.test(char) ? 'ES' : // (no-spec-coverage)
|
|
35
|
+
// Pattern.RE_COMMON_SEPARATOR.test(char) ? 'CS' : // (no-spec-coverage)
|
|
36
|
+
Pattern.RE_MARK_NONSPACING.test(char) ? 'NSM' :
|
|
37
|
+
Pattern.RE_SCRIPT_HEBREW.test(char) ? 'R' :
|
|
38
|
+
Pattern.RE_SCRIPT_ARABIC_LETTER.test(char) ? 'AL' :
|
|
39
|
+
Pattern.RE_LETTER.test(char) ? 'L' :
|
|
40
|
+
'ON');
|
|
41
|
+
}
|
|
42
|
+
// ------------------------------------------------------------------
|
|
43
|
+
// HasRightToLeftCharacters
|
|
44
|
+
//
|
|
45
|
+
// Per RFC 5893 §1.4: "An RTL label is a label that contains at least
|
|
46
|
+
// one character of type R, AL, or AN." Used to determine whether a
|
|
47
|
+
// domain name is a "Bidi domain name" (RFC 5893 §1.4), in which case
|
|
48
|
+
// the Bidi Rule applies to every label in the domain.
|
|
49
|
+
// ------------------------------------------------------------------
|
|
50
|
+
export function HasRightToLeftCharacters(value) {
|
|
51
|
+
for (const ch of value)
|
|
52
|
+
if (RE_RTL_CLASSES.test(GetBidiClass(ch.codePointAt(0))))
|
|
53
|
+
return true;
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
// ------------------------------------------------------------------
|
|
57
|
+
// SatisfiesBidiRule
|
|
58
|
+
// ------------------------------------------------------------------
|
|
59
|
+
export function SatisfiesBidiRule(value) {
|
|
60
|
+
let isRtl = false;
|
|
61
|
+
let allowed = RE_LTR_ALLOWED;
|
|
62
|
+
let sawEN = false;
|
|
63
|
+
let sawAN = false;
|
|
64
|
+
let isFirst = true;
|
|
65
|
+
// let lastClass: string | null = null // (no-spec-coverage)
|
|
66
|
+
for (const ch of value) {
|
|
67
|
+
const bidiClass = GetBidiClass(ch.codePointAt(0));
|
|
68
|
+
if (isFirst) {
|
|
69
|
+
// 1. The first character must be a character with Bidi property L, R, or AL.
|
|
70
|
+
if (bidiClass !== 'L' && bidiClass !== 'R' && bidiClass !== 'AL')
|
|
71
|
+
return false;
|
|
72
|
+
isRtl = bidiClass === 'R' || bidiClass === 'AL';
|
|
73
|
+
allowed = isRtl ? RE_RTL_ALLOWED : RE_LTR_ALLOWED;
|
|
74
|
+
isFirst = false;
|
|
75
|
+
}
|
|
76
|
+
// 2 / 5. Only characters in the allowed set for this direction may appear.
|
|
77
|
+
if (!allowed.test(bidiClass))
|
|
78
|
+
return false;
|
|
79
|
+
if (bidiClass === 'EN')
|
|
80
|
+
sawEN = true;
|
|
81
|
+
else if (bidiClass === 'AN')
|
|
82
|
+
sawAN = true;
|
|
83
|
+
// if (bidiClass !== 'NSM') lastClass = bidiClass // (no-spec-coverage)
|
|
84
|
+
}
|
|
85
|
+
if (isRtl && sawEN && sawAN)
|
|
86
|
+
return false; // spec coverage path
|
|
87
|
+
// (no-spec-coverage)
|
|
88
|
+
// if (isRtl) {
|
|
89
|
+
// // 3. The end of the label must be R, AL, EN, or AN (ignoring trailing NSM).
|
|
90
|
+
// // if (lastClass !== 'R' && lastClass !== 'AL' && lastClass !== 'EN' && lastClass !== 'AN') return false
|
|
91
|
+
// // 4. If an EN is present, no AN may be present, and vice versa.
|
|
92
|
+
// if (sawEN && sawAN) return false
|
|
93
|
+
// } else {
|
|
94
|
+
// // 6. The end of the label must be L or EN (ignoring trailing NSM).
|
|
95
|
+
// // if (lastClass !== 'L' && lastClass !== 'EN') return false
|
|
96
|
+
// }
|
|
97
|
+
return true;
|
|
98
|
+
}
|