@open-everywhere/provider-slack 0.3.0 → 0.4.0
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/agent/app-manifest.ts +1 -0
- package/agent/channels/slack-events.ts +19 -19
- package/agent/channels/slack-front.ts +8 -9
- package/agent/channels/slack-wake-backscroll.ts +3 -2
- package/agent/channels/slack.ts +2 -2
- package/agent/docs-generated.ts +1 -1
- package/dist/agent/app-manifest.d.ts.map +1 -1
- package/dist/agent/app-manifest.js +1 -0
- package/dist/agent/app-manifest.js.map +1 -1
- package/dist/agent/channels/slack-events.d.ts +5 -5
- package/dist/agent/channels/slack-events.js +17 -17
- package/dist/agent/channels/slack-events.js.map +1 -1
- package/dist/agent/channels/slack-front.d.ts.map +1 -1
- package/dist/agent/channels/slack-front.js +8 -9
- package/dist/agent/channels/slack-front.js.map +1 -1
- package/dist/agent/channels/slack-wake-backscroll.d.ts +2 -2
- package/dist/agent/channels/slack-wake-backscroll.d.ts.map +1 -1
- package/dist/agent/channels/slack-wake-backscroll.js +3 -3
- package/dist/agent/channels/slack-wake-backscroll.js.map +1 -1
- package/dist/agent/channels/slack.js +2 -2
- package/dist/agent/channels/slack.js.map +1 -1
- package/dist/agent/docs-generated.js +1 -1
- package/dist/agent/docs-generated.js.map +1 -1
- package/package.json +2 -2
|
@@ -598,7 +598,7 @@ export declare function auditDmBotAuthorDrop(ev: ParsedMessageEvent, dmKind: "im
|
|
|
598
598
|
* DM leg in the pack exercised a synthetic envelope and a regression in Slack's own DM delivery to
|
|
599
599
|
* us was invisible. This carve-out lets the driver in through the real front door.
|
|
600
600
|
*
|
|
601
|
-
* WHY IT IS NOT THE `
|
|
601
|
+
* WHY IT IS NOT THE `wake.driverAllowlist` SETTING, which already lifts the same bot at the
|
|
602
602
|
* engagement and mention doors. A DM seat holds a window token, delegation and memory, so admitting
|
|
603
603
|
* a bot into a DM is a strictly larger grant than admitting one into a watched channel. Reusing the
|
|
604
604
|
* channel allowlist would have widened the DM door for every deployment that already sets it, on
|
|
@@ -780,7 +780,7 @@ export interface NameDropRouteDeps {
|
|
|
780
780
|
}) => Promise<WakeBackscrollLines | null>;
|
|
781
781
|
/** The per-author membership probe the hydrated-context withhold uses (OPE-525,
|
|
782
782
|
* {@link withholdNameDropContext}). Defaults to the live {@link slackAuthorIsMember}; injectable
|
|
783
|
-
* so the withhold is testable without Slack. Never called on the
|
|
783
|
+
* so the withhold is testable without Slack. Never called on the `taint` opt-out grain. */
|
|
784
784
|
readonly authorIsMember?: SlackMemberProbe;
|
|
785
785
|
/** Start the judged turn in a thread rooted at the triggering message. `context` (when present)
|
|
786
786
|
* is the backscroll — ADDITIONAL history the channel appends before the delivery turn. */
|
|
@@ -1024,7 +1024,7 @@ export declare function applySlackExternalPolicy(ev: ParsedMessageEvent, p: Part
|
|
|
1024
1024
|
* other in the plane. A `bot` line carries a bot id, and a machine author is never excluded, so only
|
|
1025
1025
|
* `senderType: "user"` lines are asked about.
|
|
1026
1026
|
*
|
|
1027
|
-
* COSTS NOTHING ON THE
|
|
1027
|
+
* COSTS NOTHING ON THE OPT-OUT GRAIN: `taint` returns the wake by reference before any probe runs.
|
|
1028
1028
|
* On `withhold` it costs one TTL-cached `users.info` per DISTINCT hydrated author, resolved in
|
|
1029
1029
|
* parallel, and the render budget caps the hydration at ten lines.
|
|
1030
1030
|
*/
|
|
@@ -1332,7 +1332,7 @@ export interface SupervisorRouteDeps {
|
|
|
1332
1332
|
* {@link withholdNameDropContext}) — the same dep, spelled the same way, as the native route it
|
|
1333
1333
|
* replaces ({@link NameDropRouteDeps.authorIsMember}). Defaults to the live
|
|
1334
1334
|
* {@link slackAuthorIsMember}; injectable so the withhold is testable without Slack. Never called
|
|
1335
|
-
* on the
|
|
1335
|
+
* on the `taint` opt-out grain, and never on a wake that carries no hydrated lines. */
|
|
1336
1336
|
readonly authorIsMember?: SlackMemberProbe;
|
|
1337
1337
|
/**
|
|
1338
1338
|
* Start/continue the supervisor session under its reserved token. `window` is present ONLY on
|
|
@@ -1404,7 +1404,7 @@ export interface SupervisorRouteDeps {
|
|
|
1404
1404
|
* Route one unowned message to the channel supervisor: pure disqualifiers, then the
|
|
1405
1405
|
* fail-closed internal-channel confirmation (which also surfaces the member count for the
|
|
1406
1406
|
* envelope), then create-or-fetch the supervisor session and deliver the judged wake. The
|
|
1407
|
-
* caller (slack-front) only reaches here once the domain has
|
|
1407
|
+
* caller (slack-front) only reaches here once the domain has ambientSupervisor on (the default).
|
|
1408
1408
|
*
|
|
1409
1409
|
* `opts.directMention` (SINGLE-WINDOW @mention routing — the GitHub reference's
|
|
1410
1410
|
* `treatMentionAsDirect`/`directMention` shape): the trigger is the `message.channels` SIBLING of
|
|
@@ -1070,8 +1070,8 @@ export async function routeMessageEvent(ev, deps) {
|
|
|
1070
1070
|
...(ev.enterpriseId === undefined ? {} : { enterpriseId: ev.enterpriseId }),
|
|
1071
1071
|
});
|
|
1072
1072
|
// ── THE EXTERNAL-PARTICIPANT POLICY (OPE-507 / OPE-504) ────────────────────────────────────────
|
|
1073
|
-
// Inert on the
|
|
1074
|
-
//
|
|
1073
|
+
// Inert only on the `taint` / `engage` opt-out, where it is byte-identical to before it
|
|
1074
|
+
// existed; the shipped grains suppress here. It sits here because this is where the author evidence first exists — see the
|
|
1075
1075
|
// block comment on `slackExternalVerdict` for why that is lower than Discord's gate.
|
|
1076
1076
|
{
|
|
1077
1077
|
const verdict = await applySlackExternalPolicy(ev, p, { trust: wakeTrust, refuted: authorFacts.refuted }, "routeMessageEvent");
|
|
@@ -1450,7 +1450,7 @@ export async function auditDmBotAuthorDrop(ev, dmKind, selfBotId) {
|
|
|
1450
1450
|
dmKind,
|
|
1451
1451
|
botId: ev.botId,
|
|
1452
1452
|
team: ev.teamId ?? null,
|
|
1453
|
-
// TRUE ⇒ the `
|
|
1453
|
+
// TRUE ⇒ the `wake.driverAllowlist` setting vouches for this bot at the engagement and mention
|
|
1454
1454
|
// doors, and the DM door dropped it anyway. That is not a defect: the DM door reads its OWN,
|
|
1455
1455
|
// narrower lever (`wake.e2eDrivers`, {@link dmDoorAdmitsDriver}), so a bot on the channel
|
|
1456
1456
|
// allowlist has no DM standing. The row carries the distinction as data.
|
|
@@ -1471,7 +1471,7 @@ export async function auditDmBotAuthorDrop(ev, dmKind, selfBotId) {
|
|
|
1471
1471
|
* DM leg in the pack exercised a synthetic envelope and a regression in Slack's own DM delivery to
|
|
1472
1472
|
* us was invisible. This carve-out lets the driver in through the real front door.
|
|
1473
1473
|
*
|
|
1474
|
-
* WHY IT IS NOT THE `
|
|
1474
|
+
* WHY IT IS NOT THE `wake.driverAllowlist` SETTING, which already lifts the same bot at the
|
|
1475
1475
|
* engagement and mention doors. A DM seat holds a window token, delegation and memory, so admitting
|
|
1476
1476
|
* a bot into a DM is a strictly larger grant than admitting one into a watched channel. Reusing the
|
|
1477
1477
|
* channel allowlist would have widened the DM door for every deployment that already sets it, on
|
|
@@ -1871,7 +1871,7 @@ export async function routeNameDropEvent(ev, deps) {
|
|
|
1871
1871
|
// reference-only and marks the taint join too — not just the trigger's own author. Fail-soft:
|
|
1872
1872
|
// a regrade failure keeps the fetched (ungraded) lines, exactly like every other backscroll leg.
|
|
1873
1873
|
// 🔴 THE REGRADE KEEPS THE LIVE PROBE, and `deps.authorIsMember` must NOT be threaded here. That
|
|
1874
|
-
// dep is the WITHHOLD's probe and its contract is "never called on the
|
|
1874
|
+
// dep is the WITHHOLD's probe and its contract is "never called on the `taint` opt-out grain"
|
|
1875
1875
|
// (OPE-525); this regrade runs on every hydration, whatever the grain, so sharing the dep would
|
|
1876
1876
|
// break that contract and make a grain-gated lookup look grain-blind. The two share the
|
|
1877
1877
|
// TTL-cached probe underneath, which is where the call is actually saved.
|
|
@@ -1988,7 +1988,7 @@ export async function routeNameDropEvent(ev, deps) {
|
|
|
1988
1988
|
});
|
|
1989
1989
|
// ── THE EXTERNAL-PARTICIPANT POLICY (OPE-507 / OPE-504) ────────────────────────────────────────
|
|
1990
1990
|
// A name-drop is AMBIENT by construction (the gate above disqualifies an @mention), so an excluded
|
|
1991
|
-
// author's name-drop is owed nothing and is suppressed in silence. Inert on the
|
|
1991
|
+
// author's name-drop is owed nothing and is suppressed in silence. Inert only on the opt-out grains.
|
|
1992
1992
|
{
|
|
1993
1993
|
const verdict = await applySlackExternalPolicy(ev, p, { trust: wakeTrust, refuted: authorFacts.refuted }, "routeNameDropEvent");
|
|
1994
1994
|
if (verdict !== "proceed")
|
|
@@ -2005,7 +2005,7 @@ export async function routeNameDropEvent(ev, deps) {
|
|
|
2005
2005
|
// about the people quoted in that hydration: a member name-drops the bot in a channel where a
|
|
2006
2006
|
// refuted guest has been talking, and without this the guest's bytes reach the model verbatim.
|
|
2007
2007
|
// `withholdNameDropContext` runs the shared transform and returns the wake BY REFERENCE on the
|
|
2008
|
-
//
|
|
2008
|
+
// `taint` opt-out grain, so nothing moves for a deployment that opted out.
|
|
2009
2009
|
const rendered = renderWake(await withholdNameDropContext(slackNameDropWake(ev, name, {
|
|
2010
2010
|
trust: wakeTrust,
|
|
2011
2011
|
triggerAuthorName: triggerName.authorName,
|
|
@@ -2491,7 +2491,7 @@ function externalPolicyDropReason(verdict) {
|
|
|
2491
2491
|
* other in the plane. A `bot` line carries a bot id, and a machine author is never excluded, so only
|
|
2492
2492
|
* `senderType: "user"` lines are asked about.
|
|
2493
2493
|
*
|
|
2494
|
-
* COSTS NOTHING ON THE
|
|
2494
|
+
* COSTS NOTHING ON THE OPT-OUT GRAIN: `taint` returns the wake by reference before any probe runs.
|
|
2495
2495
|
* On `withhold` it costs one TTL-cached `users.info` per DISTINCT hydrated author, resolved in
|
|
2496
2496
|
* parallel, and the render budget caps the hydration at ten lines.
|
|
2497
2497
|
*/
|
|
@@ -3077,8 +3077,8 @@ export function liveNameDropDeps(send) {
|
|
|
3077
3077
|
}
|
|
3078
3078
|
// --- channel-supervisor delivery (Slack Claude-Tag parity, T1.3) ---------------
|
|
3079
3079
|
//
|
|
3080
|
-
// The "always-on teammate" leg. When a channel's domain
|
|
3081
|
-
// (memory/domain.ts,
|
|
3080
|
+
// The "always-on teammate" leg. When a channel's domain has ambientSupervisor on
|
|
3081
|
+
// (memory/domain.ts, default ON since OPE-2409) AND the channel is POSITIVELY confirmed internal,
|
|
3082
3082
|
// an unowned message (top-level, or in-thread but not engaged) is delivered to a single
|
|
3083
3083
|
// long-lived CHANNEL-SUPERVISOR session instead of the name-drop-only path. The supervisor
|
|
3084
3084
|
// is one durable eve session per channel, addressed by a RESERVED continuation token
|
|
@@ -3148,7 +3148,7 @@ export function shouldSupervisorWake(input) {
|
|
|
3148
3148
|
* Route one unowned message to the channel supervisor: pure disqualifiers, then the
|
|
3149
3149
|
* fail-closed internal-channel confirmation (which also surfaces the member count for the
|
|
3150
3150
|
* envelope), then create-or-fetch the supervisor session and deliver the judged wake. The
|
|
3151
|
-
* caller (slack-front) only reaches here once the domain has
|
|
3151
|
+
* caller (slack-front) only reaches here once the domain has ambientSupervisor on (the default).
|
|
3152
3152
|
*
|
|
3153
3153
|
* `opts.directMention` (SINGLE-WINDOW @mention routing — the GitHub reference's
|
|
3154
3154
|
* `treatMentionAsDirect`/`directMention` shape): the trigger is the `message.channels` SIBLING of
|
|
@@ -3280,7 +3280,7 @@ export async function routeSupervisorEvent(ev, deps, opts) {
|
|
|
3280
3280
|
});
|
|
3281
3281
|
// ── THE EXTERNAL-PARTICIPANT POLICY (OPE-507 / OPE-504) ────────────────────────────────────────
|
|
3282
3282
|
// ABOVE THE SESSION MINT, deliberately: a suppressed wake must not rotate a generation or claim a
|
|
3283
|
-
// fresh generation's first-wake backscroll. Inert on the
|
|
3283
|
+
// fresh generation's first-wake backscroll. Inert only on the `taint` / `engage` opt-out.
|
|
3284
3284
|
const externalPolicy = slackExternalPolicyForRoom(domainKeyOf(p));
|
|
3285
3285
|
{
|
|
3286
3286
|
const verdict = await applySlackExternalPolicy(ev, p, { trust: wakeTrust, refuted: authorFacts.refuted }, "routeSupervisorEvent");
|
|
@@ -3417,8 +3417,8 @@ export async function routeSupervisorEvent(ev, deps, opts) {
|
|
|
3417
3417
|
// BEHAVIOUR 3 (OPE-507) — the ARRIVED-MARKER over the first-wake backscroll. The trigger author
|
|
3418
3418
|
// cleared the gate above, so this wake fires; a SIBLING the probe refuted has not, and under
|
|
3419
3419
|
// `withhold` their bytes must not enter. The transform replaces the body, the pre-edit body and the
|
|
3420
|
-
// attachments, and it returns the SAME ARRAY by reference on the
|
|
3421
|
-
// golden moves on a deployment that
|
|
3420
|
+
// attachments, and it returns the SAME ARRAY by reference on the `taint` opt-out grain, so no
|
|
3421
|
+
// golden moves on a deployment that opted out.
|
|
3422
3422
|
const backscroll = priorContext.map((m) => (withholdsBody(m, externalPolicy) ? withheldWakeMessage(m) : m));
|
|
3423
3423
|
// POSITIVELY confirmed internal → stamp the trust verdict into the wake auth, exactly like the
|
|
3424
3424
|
// name-drop / engaged-thread paths. An UNSTAMPED wake auth downgrades the whole session to
|
|
@@ -3432,7 +3432,7 @@ export async function routeSupervisorEvent(ev, deps, opts) {
|
|
|
3432
3432
|
//
|
|
3433
3433
|
// 🔴 A WITHHELD SIBLING NEVER KEYS TAINT. `ingestedAfterWithholding` REMOVES the entries the
|
|
3434
3434
|
// transform above stripped, because their bytes did not enter — a join over a message that did not
|
|
3435
|
-
// ingest would claim an exposure that did not happen. On the
|
|
3435
|
+
// ingest would claim an exposure that did not happen. On the `taint` opt-out grain it returns the
|
|
3436
3436
|
// SAME ARRAY by reference, so the auth bag is byte-identical.
|
|
3437
3437
|
//
|
|
3438
3438
|
// 🔴 THE HYDRATED NAME-DROP LINES JOIN TOO (OPE-475/OPE-525, carried onto the seat road by
|
|
@@ -3531,8 +3531,8 @@ export async function routeSupervisorEvent(ev, deps, opts) {
|
|
|
3531
3531
|
// and without this the guest's bytes reach the model verbatim. It is the SAME function the
|
|
3532
3532
|
// native route calls, over the WHOLE wake — so the envelope backscroll's own withholding (the
|
|
3533
3533
|
// `priorContext` map above) and the hydrated lines are decided by one transform, and it returns
|
|
3534
|
-
// the wake BY REFERENCE on the
|
|
3535
|
-
//
|
|
3534
|
+
// the wake BY REFERENCE on the `taint` opt-out grain, so nothing moves for a deployment that
|
|
3535
|
+
// opted out. Run only on the name-drop tier, which is the only tier that carries the slot.
|
|
3536
3536
|
const wake = slackChannelWatchWake(ev, {
|
|
3537
3537
|
mode: "supervisor",
|
|
3538
3538
|
trust: wakeTrust,
|