@sentry/junior-scheduler 0.104.2 → 0.106.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/dist/index.js +10 -6
- package/dist/tool-support.d.ts +2 -2
- package/package.json +2 -2
- package/src/plugin.ts +4 -0
- package/src/tool-support.ts +6 -5
- package/src/tools/create-task.ts +4 -1
package/dist/index.js
CHANGED
|
@@ -1281,17 +1281,17 @@ function requireActor(context, destination) {
|
|
|
1281
1281
|
function isDmChannel(channelId) {
|
|
1282
1282
|
return channelId.startsWith("D");
|
|
1283
1283
|
}
|
|
1284
|
-
function getConversationAccess(destination) {
|
|
1284
|
+
function getConversationAccess(destination, source) {
|
|
1285
1285
|
if (isDmChannel(destination.channelId)) {
|
|
1286
1286
|
return { audience: "direct", visibility: "private" };
|
|
1287
1287
|
}
|
|
1288
1288
|
if (destination.channelId.startsWith("G")) {
|
|
1289
1289
|
return { audience: "group", visibility: "private" };
|
|
1290
1290
|
}
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1291
|
+
return {
|
|
1292
|
+
audience: "channel",
|
|
1293
|
+
visibility: source?.type === "pub" ? "public" : "private"
|
|
1294
|
+
};
|
|
1295
1295
|
}
|
|
1296
1296
|
function sameDestination(task, destination) {
|
|
1297
1297
|
const taskDestination = task.destination;
|
|
@@ -1496,7 +1496,10 @@ function createSlackScheduleCreateTaskTool(context) {
|
|
|
1496
1496
|
nextRunAtMs,
|
|
1497
1497
|
timezone
|
|
1498
1498
|
});
|
|
1499
|
-
const conversationAccess = getConversationAccess(
|
|
1499
|
+
const conversationAccess = getConversationAccess(
|
|
1500
|
+
destination,
|
|
1501
|
+
context.source
|
|
1502
|
+
);
|
|
1500
1503
|
const task = {
|
|
1501
1504
|
id: buildTaskId(),
|
|
1502
1505
|
createdAtMs: nowMs,
|
|
@@ -2123,6 +2126,7 @@ function createSchedulerPlugin() {
|
|
|
2123
2126
|
idempotencyKey: run.id,
|
|
2124
2127
|
...credentialSubject ? { credentialSubject } : {},
|
|
2125
2128
|
destination: task.destination,
|
|
2129
|
+
destinationVisibility: task.conversationAccess?.visibility === "public" ? "public" : "private",
|
|
2126
2130
|
input: task.task.text,
|
|
2127
2131
|
metadata: dispatchMetadata,
|
|
2128
2132
|
source: scheduledTaskDispatchSource(task)
|
package/dist/tool-support.d.ts
CHANGED
|
@@ -158,8 +158,8 @@ export declare function throwToolInputError(error: string): never;
|
|
|
158
158
|
export declare function requireActiveConversation(context: SchedulerToolContext): SlackDestination;
|
|
159
159
|
/** Require a concrete Slack actor before creating scheduler ownership state. */
|
|
160
160
|
export declare function requireActor(context: SchedulerToolContext, destination: SlackDestination): ScheduledTaskPrincipal;
|
|
161
|
-
/** Preserve
|
|
162
|
-
export declare function getConversationAccess(destination: SlackDestination): ScheduledTaskConversationAccess;
|
|
161
|
+
/** Preserve the active destination's ingress-confirmed access classification. */
|
|
162
|
+
export declare function getConversationAccess(destination: SlackDestination, source: SlackSource | undefined): ScheduledTaskConversationAccess;
|
|
163
163
|
/** Keep scheduler management operations bound to the task's original Slack destination. */
|
|
164
164
|
export declare function sameDestination(task: ScheduledTask, destination: SlackDestination): boolean;
|
|
165
165
|
/** Look up a mutable task only after enforcing active-conversation ownership. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior-scheduler",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.106.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"drizzle-orm": "^0.45.2",
|
|
27
27
|
"zod": "^4.4.3",
|
|
28
|
-
"@sentry/junior-plugin-api": "0.
|
|
28
|
+
"@sentry/junior-plugin-api": "0.106.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^25.9.1",
|
package/src/plugin.ts
CHANGED
|
@@ -544,6 +544,10 @@ export function createSchedulerPlugin() {
|
|
|
544
544
|
idempotencyKey: run.id,
|
|
545
545
|
...(credentialSubject ? { credentialSubject } : {}),
|
|
546
546
|
destination: task.destination,
|
|
547
|
+
destinationVisibility:
|
|
548
|
+
task.conversationAccess?.visibility === "public"
|
|
549
|
+
? "public"
|
|
550
|
+
: "private",
|
|
547
551
|
input: task.task.text,
|
|
548
552
|
metadata: dispatchMetadata,
|
|
549
553
|
source: scheduledTaskDispatchSource(task),
|
package/src/tool-support.ts
CHANGED
|
@@ -153,9 +153,10 @@ function isDmChannel(channelId: string): boolean {
|
|
|
153
153
|
return channelId.startsWith("D");
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
/** Preserve
|
|
156
|
+
/** Preserve the active destination's ingress-confirmed access classification. */
|
|
157
157
|
export function getConversationAccess(
|
|
158
158
|
destination: SlackDestination,
|
|
159
|
+
source: SlackSource | undefined,
|
|
159
160
|
): ScheduledTaskConversationAccess {
|
|
160
161
|
if (isDmChannel(destination.channelId)) {
|
|
161
162
|
return { audience: "direct", visibility: "private" };
|
|
@@ -163,10 +164,10 @@ export function getConversationAccess(
|
|
|
163
164
|
if (destination.channelId.startsWith("G")) {
|
|
164
165
|
return { audience: "group", visibility: "private" };
|
|
165
166
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
167
|
+
return {
|
|
168
|
+
audience: "channel",
|
|
169
|
+
visibility: source?.type === "pub" ? "public" : "private",
|
|
170
|
+
};
|
|
170
171
|
}
|
|
171
172
|
|
|
172
173
|
/** Keep scheduler management operations bound to the task's original Slack destination. */
|
package/src/tools/create-task.ts
CHANGED
|
@@ -88,7 +88,10 @@ export function createSlackScheduleCreateTaskTool(
|
|
|
88
88
|
nextRunAtMs,
|
|
89
89
|
timezone,
|
|
90
90
|
});
|
|
91
|
-
const conversationAccess = getConversationAccess(
|
|
91
|
+
const conversationAccess = getConversationAccess(
|
|
92
|
+
destination,
|
|
93
|
+
context.source,
|
|
94
|
+
);
|
|
92
95
|
|
|
93
96
|
const task: ScheduledTask = {
|
|
94
97
|
id: buildTaskId(),
|