managed-deepagents 0.9.6-dev.15 → 0.9.6-dev.16
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/README.md +57 -953
- package/dist/agent-auth.d.ts +1 -1
- package/dist/agent-auth.d.ts.map +1 -1
- package/dist/agent-auth.js +12 -36
- package/dist/agent-auth.js.map +1 -1
- package/dist/channels/assistant-text.d.ts +0 -24
- package/dist/channels/assistant-text.d.ts.map +1 -1
- package/dist/channels/assistant-text.js +1 -65
- package/dist/channels/assistant-text.js.map +1 -1
- package/dist/channels/binding.d.ts +1 -20
- package/dist/channels/binding.d.ts.map +1 -1
- package/dist/channels/binding.js +10 -39
- package/dist/channels/binding.js.map +1 -1
- package/dist/channels/http/http.d.ts.map +1 -1
- package/dist/channels/http/http.js +65 -386
- package/dist/channels/http/http.js.map +1 -1
- package/dist/channels/http/index.d.ts +1 -2
- package/dist/channels/http/index.d.ts.map +1 -1
- package/dist/channels/http/index.js +10 -14
- package/dist/channels/http/index.js.map +1 -1
- package/dist/channels/http/ingress.d.ts +5 -65
- package/dist/channels/http/ingress.d.ts.map +1 -1
- package/dist/channels/http/ingress.js +33 -149
- package/dist/channels/http/ingress.js.map +1 -1
- package/dist/channels/http/types.d.ts +2 -143
- package/dist/channels/http/types.d.ts.map +1 -1
- package/dist/channels/message-schema.d.ts +0 -2
- package/dist/channels/message-schema.d.ts.map +1 -1
- package/dist/channels/message-schema.js +0 -4
- package/dist/channels/message-schema.js.map +1 -1
- package/dist/channels/messaging-registry.d.ts +0 -16
- package/dist/channels/messaging-registry.d.ts.map +1 -1
- package/dist/channels/messaging-registry.js +0 -29
- package/dist/channels/messaging-registry.js.map +1 -1
- package/dist/channels/runtime.d.ts +1 -1
- package/dist/channels/runtime.d.ts.map +1 -1
- package/dist/channels/runtime.js +1 -1
- package/dist/channels/runtime.js.map +1 -1
- package/dist/channels/schedule-delivery.d.ts +1 -1
- package/dist/channels/schedule-delivery.d.ts.map +1 -1
- package/dist/channels/schedule-delivery.js +23 -12
- package/dist/channels/schedule-delivery.js.map +1 -1
- package/dist/channels/slack/api.d.ts +0 -2
- package/dist/channels/slack/api.d.ts.map +1 -1
- package/dist/channels/slack/api.js +0 -6
- package/dist/channels/slack/api.js.map +1 -1
- package/dist/channels/slack/files.d.ts.map +1 -1
- package/dist/channels/slack/files.js +3 -2
- package/dist/channels/slack/files.js.map +1 -1
- package/dist/channels/slack/index.d.ts +2 -76
- package/dist/channels/slack/index.d.ts.map +1 -1
- package/dist/channels/slack/index.js +6 -177
- package/dist/channels/slack/index.js.map +1 -1
- package/dist/channels/slack/message-content.d.ts.map +1 -1
- package/dist/channels/slack/message-content.js +28 -23
- package/dist/channels/slack/message-content.js.map +1 -1
- package/dist/channels/source-providers.js +1 -1
- package/dist/channels/source-providers.js.map +1 -1
- package/dist/channels/trigger/client.d.ts.map +1 -1
- package/dist/channels/trigger/client.js +12 -6
- package/dist/channels/trigger/client.js.map +1 -1
- package/dist/channels/trigger/http.d.ts +3 -114
- package/dist/channels/trigger/http.d.ts.map +1 -1
- package/dist/channels/trigger/http.js +82 -314
- package/dist/channels/trigger/http.js.map +1 -1
- package/dist/channels/trigger/identity-context.d.ts +1 -1
- package/dist/channels/trigger/identity-context.d.ts.map +1 -1
- package/dist/channels/trigger/identity-context.js +3 -5
- package/dist/channels/trigger/identity-context.js.map +1 -1
- package/dist/channels/trigger/ingress.d.ts +1 -38
- package/dist/channels/trigger/ingress.d.ts.map +1 -1
- package/dist/channels/trigger/ingress.js +24 -49
- package/dist/channels/trigger/ingress.js.map +1 -1
- package/dist/channels/trigger/types.d.ts +3 -82
- package/dist/channels/trigger/types.d.ts.map +1 -1
- package/dist/channels/trigger/types.js +0 -36
- package/dist/channels/trigger/types.js.map +1 -1
- package/dist/channels/types.d.ts +3 -19
- package/dist/channels/types.d.ts.map +1 -1
- package/dist/channels/types.js +0 -2
- package/dist/channels/types.js.map +1 -1
- package/dist/concurrency/batch-processor.d.ts +51 -0
- package/dist/concurrency/batch-processor.d.ts.map +1 -0
- package/dist/concurrency/batch-processor.js +99 -0
- package/dist/concurrency/batch-processor.js.map +1 -0
- package/dist/connections.d.ts +1 -42
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +14 -127
- package/dist/connections.js.map +1 -1
- package/dist/credential-gate.d.ts +0 -2
- package/dist/credential-gate.d.ts.map +1 -1
- package/dist/credential-gate.js +3 -37
- package/dist/credential-gate.js.map +1 -1
- package/dist/define-deep-agent.d.ts.map +1 -1
- package/dist/define-deep-agent.js +0 -6
- package/dist/define-deep-agent.js.map +1 -1
- package/dist/identity/loopback.d.ts +7 -2
- package/dist/identity/loopback.d.ts.map +1 -1
- package/dist/identity/loopback.js +15 -4
- package/dist/identity/loopback.js.map +1 -1
- package/dist/identity/slack/links.js +3 -2
- package/dist/identity/slack/links.js.map +1 -1
- package/dist/index.d.ts +4 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/ingress/index.d.ts +8 -0
- package/dist/ingress/index.d.ts.map +1 -1
- package/dist/ingress/index.js +32 -2
- package/dist/ingress/index.js.map +1 -1
- package/dist/ingress/loopback.js +4 -3
- package/dist/ingress/loopback.js.map +1 -1
- package/dist/ingress/runs.d.ts +1 -74
- package/dist/ingress/runs.d.ts.map +1 -1
- package/dist/ingress/runs.js +16 -176
- package/dist/ingress/runs.js.map +1 -1
- package/dist/managed-composition.d.ts.map +1 -1
- package/dist/managed-composition.js +13 -8
- package/dist/managed-composition.js.map +1 -1
- package/dist/memory/instructions-middleware.d.ts.map +1 -1
- package/dist/memory/instructions-middleware.js +6 -5
- package/dist/memory/instructions-middleware.js.map +1 -1
- package/dist/namespaces.d.ts +21 -21
- package/dist/namespaces.d.ts.map +1 -1
- package/dist/namespaces.js +29 -4
- package/dist/namespaces.js.map +1 -1
- package/dist/resilience/retry.d.ts +21 -0
- package/dist/resilience/retry.d.ts.map +1 -0
- package/dist/resilience/retry.js +40 -0
- package/dist/resilience/retry.js.map +1 -0
- package/dist/runtime/auth.d.ts.map +1 -1
- package/dist/runtime/auth.js +21 -151
- package/dist/runtime/auth.js.map +1 -1
- package/dist/runtime/channel.d.ts +0 -6
- package/dist/runtime/channel.d.ts.map +1 -1
- package/dist/runtime/channel.js.map +1 -1
- package/dist/runtime/graph-build-timing.d.ts +30 -0
- package/dist/runtime/graph-build-timing.d.ts.map +1 -0
- package/dist/runtime/graph-build-timing.js +50 -0
- package/dist/runtime/graph-build-timing.js.map +1 -0
- package/dist/runtime/http.d.ts +15 -0
- package/dist/runtime/http.d.ts.map +1 -1
- package/dist/runtime/http.js +37 -0
- package/dist/runtime/http.js.map +1 -1
- package/dist/runtime/identity-http.d.ts +0 -2
- package/dist/runtime/identity-http.d.ts.map +1 -1
- package/dist/runtime/identity-http.js +16 -40
- package/dist/runtime/identity-http.js.map +1 -1
- package/dist/runtime/identity-runtime.d.ts +0 -10
- package/dist/runtime/identity-runtime.d.ts.map +1 -1
- package/dist/runtime/identity-runtime.js +0 -22
- package/dist/runtime/identity-runtime.js.map +1 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +47 -46
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/langsmith-env.d.ts +19 -0
- package/dist/runtime/langsmith-env.d.ts.map +1 -0
- package/dist/runtime/langsmith-env.js +38 -0
- package/dist/runtime/langsmith-env.js.map +1 -0
- package/dist/runtime/log.d.ts +8 -14
- package/dist/runtime/log.d.ts.map +1 -1
- package/dist/runtime/log.js +16 -7
- package/dist/runtime/log.js.map +1 -1
- package/dist/runtime/managed-middleware.d.ts.map +1 -1
- package/dist/runtime/managed-middleware.js +1 -14
- package/dist/runtime/managed-middleware.js.map +1 -1
- package/dist/runtime/managed-tools.d.ts +10 -10
- package/dist/runtime/managed-tools.d.ts.map +1 -1
- package/dist/runtime/managed-tools.js +24 -24
- package/dist/runtime/managed-tools.js.map +1 -1
- package/dist/runtime/memory/mounts.d.ts +82 -11
- package/dist/runtime/memory/mounts.d.ts.map +1 -1
- package/dist/runtime/memory/mounts.js +173 -34
- package/dist/runtime/memory/mounts.js.map +1 -1
- package/dist/runtime/memory/policy.d.ts.map +1 -1
- package/dist/runtime/memory/policy.js +3 -1
- package/dist/runtime/memory/policy.js.map +1 -1
- package/dist/runtime/run-input.d.ts +0 -10
- package/dist/runtime/run-input.d.ts.map +1 -1
- package/dist/runtime/run-input.js +19 -47
- package/dist/runtime/run-input.js.map +1 -1
- package/dist/runtime/sandbox-manager.d.ts +1 -1
- package/dist/runtime/sandbox-manager.d.ts.map +1 -1
- package/dist/runtime/sandbox-manager.js +10 -15
- package/dist/runtime/sandbox-manager.js.map +1 -1
- package/dist/runtime/schedule-auth.d.ts +0 -17
- package/dist/runtime/schedule-auth.d.ts.map +1 -1
- package/dist/runtime/schedule-auth.js +3 -40
- package/dist/runtime/schedule-auth.js.map +1 -1
- package/dist/runtime/selected-skills-backend.d.ts +3 -3
- package/dist/runtime/selected-skills-backend.d.ts.map +1 -1
- package/dist/runtime/selected-skills-backend.js +5 -5
- package/dist/runtime/selected-skills-backend.js.map +1 -1
- package/dist/runtime/types.d.ts +1 -5
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/runtime-schedules.d.ts +0 -13
- package/dist/runtime-schedules.d.ts.map +1 -1
- package/dist/runtime-schedules.js +22 -86
- package/dist/runtime-schedules.js.map +1 -1
- package/dist/sandbox.d.ts +6 -0
- package/dist/sandbox.d.ts.map +1 -1
- package/dist/sandbox.js +7 -3
- package/dist/sandbox.js.map +1 -1
- package/dist/schedule-channel.d.ts +2 -5
- package/dist/schedule-channel.d.ts.map +1 -1
- package/dist/schedule-channel.js +12 -13
- package/dist/schedule-channel.js.map +1 -1
- package/dist/telemetry/lifecycle.d.ts +26 -0
- package/dist/telemetry/lifecycle.d.ts.map +1 -0
- package/dist/telemetry/lifecycle.js +49 -0
- package/dist/telemetry/lifecycle.js.map +1 -0
- package/dist/telemetry/metadata.d.ts.map +1 -1
- package/dist/telemetry/metadata.js +4 -4
- package/dist/telemetry/metadata.js.map +1 -1
- package/dist/telemetry/otel/context.d.ts +57 -0
- package/dist/telemetry/otel/context.d.ts.map +1 -0
- package/dist/telemetry/otel/context.js +122 -0
- package/dist/telemetry/otel/context.js.map +1 -0
- package/dist/telemetry/otel/exporter.d.ts +53 -0
- package/dist/telemetry/otel/exporter.d.ts.map +1 -0
- package/dist/telemetry/otel/exporter.js +190 -0
- package/dist/telemetry/otel/exporter.js.map +1 -0
- package/dist/telemetry/otel/index.d.ts +6 -0
- package/dist/telemetry/otel/index.d.ts.map +1 -0
- package/dist/telemetry/otel/index.js +3 -0
- package/dist/telemetry/otel/index.js.map +1 -0
- package/dist/telemetry/otel/otlp.d.ts +44 -0
- package/dist/telemetry/otel/otlp.d.ts.map +1 -0
- package/dist/telemetry/otel/otlp.js +7 -0
- package/dist/telemetry/otel/otlp.js.map +1 -0
- package/dist/telemetry/otel/truncate.d.ts +10 -0
- package/dist/telemetry/otel/truncate.d.ts.map +1 -0
- package/dist/telemetry/otel/truncate.js +39 -0
- package/dist/telemetry/otel/truncate.js.map +1 -0
- package/dist/telemetry/run-listener.d.ts +1 -1
- package/dist/telemetry/run-listener.d.ts.map +1 -1
- package/dist/telemetry/run-listener.js +32 -2
- package/dist/telemetry/run-listener.js.map +1 -1
- package/dist/telemetry/transport/posthog.d.ts +13 -1
- package/dist/telemetry/transport/posthog.d.ts.map +1 -1
- package/dist/telemetry/transport/posthog.js +68 -30
- package/dist/telemetry/transport/posthog.js.map +1 -1
- package/package.json +11 -11
- package/dist/channels/actor.d.ts +0 -43
- package/dist/channels/actor.d.ts.map +0 -1
- package/dist/channels/actor.js +0 -2
- package/dist/channels/actor.js.map +0 -1
- package/dist/channels/delivery.d.ts +0 -21
- package/dist/channels/delivery.d.ts.map +0 -1
- package/dist/channels/delivery.js +0 -196
- package/dist/channels/delivery.js.map +0 -1
- package/dist/channels/github/connections.d.ts +0 -11
- package/dist/channels/github/connections.d.ts.map +0 -1
- package/dist/channels/github/connections.js +0 -14
- package/dist/channels/github/connections.js.map +0 -1
- package/dist/channels/github/index.d.ts +0 -8
- package/dist/channels/github/index.d.ts.map +0 -1
- package/dist/channels/github/index.js +0 -274
- package/dist/channels/github/index.js.map +0 -1
- package/dist/channels/github/mentions.d.ts +0 -12
- package/dist/channels/github/mentions.d.ts.map +0 -1
- package/dist/channels/github/mentions.js +0 -185
- package/dist/channels/github/mentions.js.map +0 -1
- package/dist/channels/github/schema.d.ts +0 -4165
- package/dist/channels/github/schema.d.ts.map +0 -1
- package/dist/channels/github/schema.js +0 -221
- package/dist/channels/github/schema.js.map +0 -1
- package/dist/channels/github/types.d.ts +0 -163
- package/dist/channels/github/types.d.ts.map +0 -1
- package/dist/channels/github/types.js +0 -2
- package/dist/channels/github/types.js.map +0 -1
- package/dist/channels/http/endpoint.d.ts +0 -95
- package/dist/channels/http/endpoint.d.ts.map +0 -1
- package/dist/channels/http/endpoint.js +0 -276
- package/dist/channels/http/endpoint.js.map +0 -1
- package/dist/channels/http/provider.d.ts +0 -119
- package/dist/channels/http/provider.d.ts.map +0 -1
- package/dist/channels/http/provider.js +0 -227
- package/dist/channels/http/provider.js.map +0 -1
- package/dist/channels/http/studio.d.ts +0 -24
- package/dist/channels/http/studio.d.ts.map +0 -1
- package/dist/channels/http/studio.js +0 -95
- package/dist/channels/http/studio.js.map +0 -1
- package/dist/channels/http/threads.d.ts +0 -7
- package/dist/channels/http/threads.d.ts.map +0 -1
- package/dist/channels/http/threads.js +0 -10
- package/dist/channels/http/threads.js.map +0 -1
- package/dist/channels/linear/connections.d.ts +0 -11
- package/dist/channels/linear/connections.d.ts.map +0 -1
- package/dist/channels/linear/connections.js +0 -14
- package/dist/channels/linear/connections.js.map +0 -1
- package/dist/channels/linear/graphql.d.ts +0 -57
- package/dist/channels/linear/graphql.d.ts.map +0 -1
- package/dist/channels/linear/graphql.js +0 -167
- package/dist/channels/linear/graphql.js.map +0 -1
- package/dist/channels/linear/index.d.ts +0 -9
- package/dist/channels/linear/index.d.ts.map +0 -1
- package/dist/channels/linear/index.js +0 -489
- package/dist/channels/linear/index.js.map +0 -1
- package/dist/channels/linear/schema.d.ts +0 -1050
- package/dist/channels/linear/schema.d.ts.map +0 -1
- package/dist/channels/linear/schema.js +0 -255
- package/dist/channels/linear/schema.js.map +0 -1
- package/dist/channels/linear/types.d.ts +0 -162
- package/dist/channels/linear/types.d.ts.map +0 -1
- package/dist/channels/linear/types.js +0 -2
- package/dist/channels/linear/types.js.map +0 -1
- package/dist/channels/reserved-connections.d.ts +0 -12
- package/dist/channels/reserved-connections.d.ts.map +0 -1
- package/dist/channels/reserved-connections.js +0 -55
- package/dist/channels/reserved-connections.js.map +0 -1
- package/dist/channels/run-input.d.ts +0 -71
- package/dist/channels/run-input.d.ts.map +0 -1
- package/dist/channels/run-input.js +0 -155
- package/dist/channels/run-input.js.map +0 -1
- package/dist/channels/slack/connections.d.ts +0 -6
- package/dist/channels/slack/connections.d.ts.map +0 -1
- package/dist/channels/slack/connections.js +0 -6
- package/dist/channels/slack/connections.js.map +0 -1
- package/dist/channels/slack/events.d.ts +0 -272
- package/dist/channels/slack/events.d.ts.map +0 -1
- package/dist/channels/slack/events.js +0 -235
- package/dist/channels/slack/events.js.map +0 -1
- package/dist/channels/slack/status.d.ts +0 -76
- package/dist/channels/slack/status.d.ts.map +0 -1
- package/dist/channels/slack/status.js +0 -427
- package/dist/channels/slack/status.js.map +0 -1
- package/dist/runtime/channel-icon.d.ts +0 -22
- package/dist/runtime/channel-icon.d.ts.map +0 -1
- package/dist/runtime/channel-icon.js +0 -70
- package/dist/runtime/channel-icon.js.map +0 -1
- package/dist/runtime/managed-thread.d.ts +0 -60
- package/dist/runtime/managed-thread.d.ts.map +0 -1
- package/dist/runtime/managed-thread.js +0 -76
- package/dist/runtime/managed-thread.js.map +0 -1
- package/dist/runtime/thread-record.d.ts +0 -81
- package/dist/runtime/thread-record.d.ts.map +0 -1
- package/dist/runtime/thread-record.js +0 -205
- package/dist/runtime/thread-record.js.map +0 -1
- package/dist/values.d.ts +0 -15
- package/dist/values.d.ts.map +0 -1
- package/dist/values.js +0 -31
- package/dist/values.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/channels/linear/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAM/C,kFAAkF;AAClF,eAAO,MAAM,mBAAmB;;;;;;;iBAO9B,CAAC;AA8EH;;;GAGG;AACH,eAAO,MAAM,qBAAqB,YAChC,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,UAAU,EACV,OAAO,EACP,aAAa,CACL,CAAC;AACX;;;GAGG;AACH,eAAO,MAAM,qBAAqB,YAAI,MAAM,CAAU,CAAC;AAyCvD,4EAA4E;AAC5E,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAiD/B,CAAC;AAEH,eAAO,MAAM,oBAAoB,qHAEhC,CAAC;AAqEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,YAAI,OAAO,CAAU,CAAC;AAG/D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkB5B,CAAC"}
|
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { nonblankStringSchema } from "../message-schema.js";
|
|
3
|
-
// Shared scalar constraints. Linear identifiers are UUIDs, but only their
|
|
4
|
-
// presence matters here.
|
|
5
|
-
const optionalTextSchema = z.string().nullish();
|
|
6
|
-
/** Receipt metadata only, not a complete Linear webhook payload specification. */
|
|
7
|
-
export const linearReceiptSchema = z.object({
|
|
8
|
-
deliveryId: nonblankStringSchema,
|
|
9
|
-
payload: z.looseObject({
|
|
10
|
-
type: nonblankStringSchema,
|
|
11
|
-
action: nonblankStringSchema,
|
|
12
|
-
organizationId: z.string().optional(),
|
|
13
|
-
}),
|
|
14
|
-
});
|
|
15
|
-
const teamSchema = z.looseObject({
|
|
16
|
-
id: nonblankStringSchema,
|
|
17
|
-
key: nonblankStringSchema,
|
|
18
|
-
name: z.string().optional(),
|
|
19
|
-
});
|
|
20
|
-
const actorSchema = z.looseObject({
|
|
21
|
-
id: nonblankStringSchema,
|
|
22
|
-
type: z.string().optional(),
|
|
23
|
-
name: z.string().optional(),
|
|
24
|
-
});
|
|
25
|
-
// Payload subjects. Loose objects retain unmodeled provider fields.
|
|
26
|
-
const issueSchema = z.looseObject({
|
|
27
|
-
id: nonblankStringSchema,
|
|
28
|
-
identifier: nonblankStringSchema,
|
|
29
|
-
title: z.string(),
|
|
30
|
-
description: optionalTextSchema,
|
|
31
|
-
url: z.string().optional(),
|
|
32
|
-
teamId: z.string().optional(),
|
|
33
|
-
team: teamSchema.optional(),
|
|
34
|
-
labelIds: z.array(z.string()).optional(),
|
|
35
|
-
labels: z
|
|
36
|
-
.array(z.looseObject({ id: z.string(), name: z.string() }))
|
|
37
|
-
.optional(),
|
|
38
|
-
botActor: z.unknown().optional(),
|
|
39
|
-
});
|
|
40
|
-
const commentSchema = z.looseObject({
|
|
41
|
-
id: nonblankStringSchema,
|
|
42
|
-
body: z.string(),
|
|
43
|
-
issueId: nonblankStringSchema,
|
|
44
|
-
parentId: z.string().nullish(),
|
|
45
|
-
userId: z.string().nullish(),
|
|
46
|
-
user: z
|
|
47
|
-
.looseObject({ id: z.string(), name: z.string().optional() })
|
|
48
|
-
.nullish(),
|
|
49
|
-
issue: z
|
|
50
|
-
.looseObject({
|
|
51
|
-
id: nonblankStringSchema,
|
|
52
|
-
identifier: z.string().optional(),
|
|
53
|
-
title: z.string().optional(),
|
|
54
|
-
url: z.string().optional(),
|
|
55
|
-
team: teamSchema.optional(),
|
|
56
|
-
})
|
|
57
|
-
.optional(),
|
|
58
|
-
botActor: z.unknown().optional(),
|
|
59
|
-
});
|
|
60
|
-
const sessionIssueSchema = z.looseObject({
|
|
61
|
-
id: nonblankStringSchema,
|
|
62
|
-
identifier: z.string().optional(),
|
|
63
|
-
title: z.string().optional(),
|
|
64
|
-
url: z.string().optional(),
|
|
65
|
-
description: optionalTextSchema,
|
|
66
|
-
team: teamSchema.optional(),
|
|
67
|
-
});
|
|
68
|
-
/** A Linear agent session: the app was mentioned or delegated an issue. */
|
|
69
|
-
const agentSessionSchema = z.looseObject({
|
|
70
|
-
id: nonblankStringSchema,
|
|
71
|
-
status: z.string().optional(),
|
|
72
|
-
url: z.string().optional(),
|
|
73
|
-
issueId: z.string().nullish(),
|
|
74
|
-
issue: sessionIssueSchema.nullish(),
|
|
75
|
-
// The comment that started the session, when a mention did.
|
|
76
|
-
commentId: z.string().nullish(),
|
|
77
|
-
comment: z
|
|
78
|
-
.looseObject({ id: nonblankStringSchema, body: z.string().optional() })
|
|
79
|
-
.nullish(),
|
|
80
|
-
creatorId: z.string().nullish(),
|
|
81
|
-
creator: z
|
|
82
|
-
.looseObject({ id: nonblankStringSchema, name: z.string().optional() })
|
|
83
|
-
.nullish(),
|
|
84
|
-
});
|
|
85
|
-
/**
|
|
86
|
-
* The activity content types Linear documents; one it adds later reads as
|
|
87
|
-
* `unknown`. A user's reply is a `prompt`.
|
|
88
|
-
*/
|
|
89
|
-
export const LINEAR_ACTIVITY_TYPES = [
|
|
90
|
-
"prompt",
|
|
91
|
-
"thought",
|
|
92
|
-
"action",
|
|
93
|
-
"response",
|
|
94
|
-
"error",
|
|
95
|
-
"elicitation",
|
|
96
|
-
];
|
|
97
|
-
/**
|
|
98
|
-
* The signals Linear documents on a user's activity; one it adds later reads
|
|
99
|
-
* as `unknown`. `stop` asks the agent to stop.
|
|
100
|
-
*/
|
|
101
|
-
export const LINEAR_PROMPT_SIGNALS = ["stop"];
|
|
102
|
-
/** What a user said in a session: a reply, or a signal such as `stop`. */
|
|
103
|
-
const agentActivitySchema = z.looseObject({
|
|
104
|
-
content: z.looseObject({
|
|
105
|
-
type: z.enum([...LINEAR_ACTIVITY_TYPES, "unknown"]).catch("unknown"),
|
|
106
|
-
body: z.string().optional(),
|
|
107
|
-
}),
|
|
108
|
-
signal: z
|
|
109
|
-
.enum([...LINEAR_PROMPT_SIGNALS, "unknown"])
|
|
110
|
-
.catch("unknown")
|
|
111
|
-
.nullish(),
|
|
112
|
-
signalMetadata: z.unknown().optional(),
|
|
113
|
-
sourceCommentId: z.string().nullish(),
|
|
114
|
-
userId: z.string().nullish(),
|
|
115
|
-
user: z
|
|
116
|
-
.looseObject({ id: nonblankStringSchema, name: z.string().optional() })
|
|
117
|
-
.nullish(),
|
|
118
|
-
});
|
|
119
|
-
// Common delivery context.
|
|
120
|
-
const envelopeSchema = z.looseObject({
|
|
121
|
-
organizationId: nonblankStringSchema,
|
|
122
|
-
webhookId: z.string().optional(),
|
|
123
|
-
webhookTimestamp: z.number(),
|
|
124
|
-
createdAt: z.string().optional(),
|
|
125
|
-
url: z.string().optional(),
|
|
126
|
-
actor: actorSchema.optional(),
|
|
127
|
-
});
|
|
128
|
-
function dispatchEventSchema(key, payloadSchema) {
|
|
129
|
-
return z.object({
|
|
130
|
-
key: z.literal(key),
|
|
131
|
-
deliveryId: nonblankStringSchema,
|
|
132
|
-
payload: payloadSchema,
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
/** Each supported event key requires its exact type, action and subject. */
|
|
136
|
-
export const linearDispatchSchema = z.discriminatedUnion("key", [
|
|
137
|
-
dispatchEventSchema("Issue.create", envelopeSchema.extend({
|
|
138
|
-
type: z.literal("Issue"),
|
|
139
|
-
action: z.literal("create"),
|
|
140
|
-
data: issueSchema,
|
|
141
|
-
})),
|
|
142
|
-
dispatchEventSchema("Issue.update", envelopeSchema.extend({
|
|
143
|
-
type: z.literal("Issue"),
|
|
144
|
-
action: z.literal("update"),
|
|
145
|
-
data: issueSchema,
|
|
146
|
-
// The changed fields' previous values.
|
|
147
|
-
updatedFrom: z.record(z.string(), z.unknown()).optional(),
|
|
148
|
-
})),
|
|
149
|
-
dispatchEventSchema("Comment.create", envelopeSchema.extend({
|
|
150
|
-
type: z.literal("Comment"),
|
|
151
|
-
action: z.literal("create"),
|
|
152
|
-
data: commentSchema,
|
|
153
|
-
})),
|
|
154
|
-
dispatchEventSchema("AgentSessionEvent.created", envelopeSchema.extend({
|
|
155
|
-
type: z.literal("AgentSessionEvent"),
|
|
156
|
-
action: z.literal("created"),
|
|
157
|
-
appUserId: z.string().optional(),
|
|
158
|
-
agentSession: agentSessionSchema,
|
|
159
|
-
// Linear's ready-made prompt: the issue, the thread and who asked.
|
|
160
|
-
promptContext: z.string().nullish(),
|
|
161
|
-
guidance: z.unknown().optional(),
|
|
162
|
-
})),
|
|
163
|
-
dispatchEventSchema("AgentSessionEvent.prompted", envelopeSchema.extend({
|
|
164
|
-
type: z.literal("AgentSessionEvent"),
|
|
165
|
-
action: z.literal("prompted"),
|
|
166
|
-
appUserId: z.string().optional(),
|
|
167
|
-
agentSession: agentSessionSchema,
|
|
168
|
-
agentActivity: agentActivitySchema,
|
|
169
|
-
})),
|
|
170
|
-
]);
|
|
171
|
-
export const SUPPORTED_EVENT_KEYS = linearDispatchSchema.options.map((option) => option.shape.key.value);
|
|
172
|
-
/** The issue an event is about, wherever its payload keeps it. */
|
|
173
|
-
function eventIssue(event) {
|
|
174
|
-
if (event.payload.type === "AgentSessionEvent") {
|
|
175
|
-
const session = event.payload.agentSession;
|
|
176
|
-
const id = session.issue?.id ?? session.issueId;
|
|
177
|
-
// Linear opens sessions on issues; one without could not be answered.
|
|
178
|
-
if (!id)
|
|
179
|
-
throw new TypeError("Linear agent session has no issue");
|
|
180
|
-
return { id, ...(session.issue?.team && { team: session.issue.team }) };
|
|
181
|
-
}
|
|
182
|
-
if (event.payload.type === "Comment") {
|
|
183
|
-
const { data } = event.payload;
|
|
184
|
-
return {
|
|
185
|
-
id: data.issueId,
|
|
186
|
-
...(data.issue?.team && { team: data.issue.team }),
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
const { data } = event.payload;
|
|
190
|
-
return { id: data.id, ...(data.team && { team: data.team }) };
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Who acted: the webhook's actor, or for a session the user who started it or
|
|
194
|
-
* replied in it.
|
|
195
|
-
*/
|
|
196
|
-
function eventActor(event) {
|
|
197
|
-
const payload = event.payload;
|
|
198
|
-
const person = payload.type !== "AgentSessionEvent"
|
|
199
|
-
? payload.actor
|
|
200
|
-
: payload.action === "prompted"
|
|
201
|
-
? (payload.agentActivity.user ??
|
|
202
|
-
(payload.agentActivity.userId
|
|
203
|
-
? { id: payload.agentActivity.userId }
|
|
204
|
-
: undefined))
|
|
205
|
-
: (payload.agentSession.creator ??
|
|
206
|
-
(payload.agentSession.creatorId
|
|
207
|
-
? { id: payload.agentSession.creatorId }
|
|
208
|
-
: undefined));
|
|
209
|
-
if (!person)
|
|
210
|
-
return undefined;
|
|
211
|
-
const { type, name } = person;
|
|
212
|
-
return {
|
|
213
|
-
provider: "linear",
|
|
214
|
-
id: person.id,
|
|
215
|
-
...(typeof type === "string" && { type }),
|
|
216
|
-
...(typeof name === "string" && { name }),
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
/** Routing metadata every event exposes next to its payload. */
|
|
220
|
-
function routing(event) {
|
|
221
|
-
const issue = eventIssue(event);
|
|
222
|
-
const actor = eventActor(event);
|
|
223
|
-
return {
|
|
224
|
-
organizationId: event.payload.organizationId,
|
|
225
|
-
issueId: issue.id,
|
|
226
|
-
...(issue.team && {
|
|
227
|
-
team: { id: issue.team.id, key: issue.team.key },
|
|
228
|
-
}),
|
|
229
|
-
...(actor && { actor }),
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* A Linear event's fields its endpoints are sent beside its key, delivery ID
|
|
234
|
-
* and payload: the one list of them, so `LinearEndpointRequest` is typed by it.
|
|
235
|
-
*/
|
|
236
|
-
export const LINEAR_ENDPOINT_EVENT_FIELDS = ["actor"];
|
|
237
|
-
// Expose common routing metadata while preserving the original payload.
|
|
238
|
-
export const linearEventSchema = linearDispatchSchema.transform((event) => {
|
|
239
|
-
if (event.key === "AgentSessionEvent.created" ||
|
|
240
|
-
event.key === "AgentSessionEvent.prompted")
|
|
241
|
-
return {
|
|
242
|
-
...event,
|
|
243
|
-
type: event.payload.type,
|
|
244
|
-
action: event.payload.action,
|
|
245
|
-
...routing(event),
|
|
246
|
-
sessionId: event.payload.agentSession.id,
|
|
247
|
-
};
|
|
248
|
-
return {
|
|
249
|
-
...event,
|
|
250
|
-
type: event.payload.type,
|
|
251
|
-
action: event.payload.action,
|
|
252
|
-
...routing(event),
|
|
253
|
-
};
|
|
254
|
-
});
|
|
255
|
-
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/channels/linear/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG5D,0EAA0E;AAC1E,yBAAyB;AACzB,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC;AAEhD,kFAAkF;AAClF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,UAAU,EAAE,oBAAoB;IAChC,OAAO,EAAE,CAAC,CAAC,WAAW,CAAC;QACrB,IAAI,EAAE,oBAAoB;QAC1B,MAAM,EAAE,oBAAoB;QAC5B,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACtC,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,UAAU,GAAG,CAAC,CAAC,WAAW,CAAC;IAC/B,EAAE,EAAE,oBAAoB;IACxB,GAAG,EAAE,oBAAoB;IACzB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,CAAC,CAAC,WA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AAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;SACjD,CAAC;QACF,GAAG,CAAC,KAAK,IAAI,EAAE,KAAK,EAAE,CAAC;KACxB,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,OAAO,CAAU,CAAC;AAE/D,wEAAwE;AACxE,MAAM,CAAC,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;IACxE,IACE,KAAK,CAAC,GAAG,KAAK,2BAA2B;QACzC,KAAK,CAAC,GAAG,KAAK,4BAA4B;QAE1C,OAAO;YACL,GAAG,KAAK;YACR,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI;YACxB,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM;YAC5B,GAAG,OAAO,CAAC,KAAK,CAAC;YACjB,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;SACzC,CAAC;IACJ,OAAO;QACL,GAAG,KAAK;QACR,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI;QACxB,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM;QAC5B,GAAG,OAAO,CAAC,KAAK,CAAC;KAClB,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import type { z } from "zod";
|
|
2
|
-
import type { MultitaskStrategy } from "../../ingress/runs.js";
|
|
3
|
-
import type { LINEAR_ENDPOINT_EVENT_FIELDS, linearEventSchema } from "./schema.js";
|
|
4
|
-
import type { ChannelRunResult } from "../run-input.js";
|
|
5
|
-
import type { EventFinished } from "../http/provider.js";
|
|
6
|
-
import type { EndpointRequest, EventEndpoint } from "../http/endpoint.js";
|
|
7
|
-
import type { ChannelReply } from "../types.js";
|
|
8
|
-
/** Handwritten schema subsets; unmodeled provider fields remain unknown. */
|
|
9
|
-
type EventUnion = z.output<typeof linearEventSchema>;
|
|
10
|
-
export type LinearEventKey = EventUnion["key"];
|
|
11
|
-
export type LinearEvent<K extends LinearEventKey = LinearEventKey> = Extract<EventUnion, {
|
|
12
|
-
key: K;
|
|
13
|
-
}>;
|
|
14
|
-
export type LinearPayloadFor<K extends LinearEventKey> = LinearEvent<K>["payload"];
|
|
15
|
-
/**
|
|
16
|
-
* The conversation's thread an event belongs to. A handler runs before any
|
|
17
|
-
* run exists, so this is not a run's runtime.
|
|
18
|
-
*/
|
|
19
|
-
export interface LinearChannelThread {
|
|
20
|
-
/**
|
|
21
|
-
* The conversation's thread, the issue's or an agent session's, which the
|
|
22
|
-
* run the handler starts runs on. Useful for run context that names the
|
|
23
|
-
* thread, such as a token a backend signs for it.
|
|
24
|
-
*/
|
|
25
|
-
id: string;
|
|
26
|
-
channel: {
|
|
27
|
-
name: string;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* What an event handler returns: a run's input, as `agent.invoke` takes it —
|
|
32
|
-
* a string, a message such as `new HumanMessage(...)`, state such as
|
|
33
|
-
* `{ messages: [...] }`, or `[input, { context, metadata }]`. `null` or `undefined`
|
|
34
|
-
* starts nothing.
|
|
35
|
-
*/
|
|
36
|
-
export type LinearEventResult = ChannelRunResult | null | undefined | void;
|
|
37
|
-
export type LinearEventCallback<K extends LinearEventKey> = (event: LinearEvent<K>, thread: LinearChannelThread) => LinearEventResult | Promise<LinearEventResult>;
|
|
38
|
-
/** The Linear app `mda deploy` sets up: how it looks, and what it may do. */
|
|
39
|
-
export interface LinearAppOptions {
|
|
40
|
-
/**
|
|
41
|
-
* The app's name, shown where people mention it and in its comments: 2–80
|
|
42
|
-
* characters, without "Linear" or a URL. Defaults to the agent's name.
|
|
43
|
-
*
|
|
44
|
-
* Applies only when deploy creates the app. Linear has no API to change an
|
|
45
|
-
* app, so changing it later does nothing: rename an existing app on its
|
|
46
|
-
* settings page in Linear. Deploy reminds you when it keeps an existing app.
|
|
47
|
-
*/
|
|
48
|
-
name?: string;
|
|
49
|
-
/**
|
|
50
|
-
* What the app does, shown when a workspace admin installs it: up to 1,000
|
|
51
|
-
* characters. Like `name`, it applies only when deploy creates the app;
|
|
52
|
-
* change an existing app's description on its settings page in Linear.
|
|
53
|
-
*/
|
|
54
|
-
description?: string;
|
|
55
|
-
/**
|
|
56
|
-
* The app's icon: a PNG or JPEG image, as a path relative to `channels/`
|
|
57
|
-
* like the Slack channel's `icon`, such as `assets/icon.png`. At least
|
|
58
|
-
* 256×256 pixels and at most 1 MB. The deployment serves it at
|
|
59
|
-
* `/channels/{name}/icon`, and deploy points the new app's icon there.
|
|
60
|
-
* Like `name`, it applies only when deploy creates the app.
|
|
61
|
-
*/
|
|
62
|
-
icon?: string;
|
|
63
|
-
/**
|
|
64
|
-
* Keys of the teams (as in `ENG-123`) the channel is limited to: events
|
|
65
|
-
* about other teams' issues start nothing. Defaults to every team the app
|
|
66
|
-
* can see. The app's token still reaches every team it was granted, so
|
|
67
|
-
* limit its team access in Linear too.
|
|
68
|
-
*/
|
|
69
|
-
teams?: string[];
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Options for `channels.linear(...)`: the app's scope and event handlers that
|
|
73
|
-
* start runs. Each issue is one conversation, and each agent session on it
|
|
74
|
-
* another.
|
|
75
|
-
*/
|
|
76
|
-
export interface LinearChannelOptions {
|
|
77
|
-
/** The Linear app `mda deploy` sets up: its name, description, icon and teams. */
|
|
78
|
-
app?: LinearAppOptions;
|
|
79
|
-
/**
|
|
80
|
-
* What an event that starts a run does while its conversation already
|
|
81
|
-
* runs: `enqueue` (the default) waits for the run and starts after it,
|
|
82
|
-
* `interrupt` cancels the run, keeping its progress, and starts at once,
|
|
83
|
-
* `rollback` cancels it and discards its progress, and `reject` starts
|
|
84
|
-
* nothing.
|
|
85
|
-
*
|
|
86
|
-
* @example
|
|
87
|
-
* ```ts
|
|
88
|
-
* // A newer comment replaces the work on an older one.
|
|
89
|
-
* channels.linear({ multitaskStrategy: "interrupt", onEvent })
|
|
90
|
-
* ```
|
|
91
|
-
*/
|
|
92
|
-
multitaskStrategy?: MultitaskStrategy;
|
|
93
|
-
/**
|
|
94
|
-
* Whether the channel posts the run's final answer, as a comment or the
|
|
95
|
-
* session's response: `auto` (the default) or `none`, to leave replying to
|
|
96
|
-
* the agent. Session acknowledgements, Stop and error notices still post.
|
|
97
|
-
*/
|
|
98
|
-
reply?: ChannelReply;
|
|
99
|
-
/**
|
|
100
|
-
* Event handlers that start runs. Return a prompt (string, message, or
|
|
101
|
-
* state), or nothing to skip. The run's final reply is posted as a comment
|
|
102
|
-
* on the issue, under the comment that started it.
|
|
103
|
-
*
|
|
104
|
-
* @example
|
|
105
|
-
* ```ts
|
|
106
|
-
* { "Issue.create": (e) => `Triage ${e.payload.data.identifier}` }
|
|
107
|
-
* ```
|
|
108
|
-
*
|
|
109
|
-
* In agent sessions the reply goes to the session instead.
|
|
110
|
-
*
|
|
111
|
-
* A handler may also be an endpoint, a URL or a `Request` carrying headers,
|
|
112
|
-
* to have a service of yours decide: MDA POSTs it the event and its thread,
|
|
113
|
-
* and starts the run it answers with. See the README's "Asking your service
|
|
114
|
-
* what to start".
|
|
115
|
-
*/
|
|
116
|
-
onEvent?: {
|
|
117
|
-
[K in LinearEventKey]?: LinearEventCallback<K> | EventEndpoint;
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* Answer Linear agent sessions, which open when someone mentions the app or
|
|
121
|
-
* delegates an issue to it. Defaults to `true`. Without a handler, a new
|
|
122
|
-
* session runs with Linear's prompt for it (`promptContext`), and a reply
|
|
123
|
-
* in the session continues the conversation. The run's progress and reply
|
|
124
|
-
* show in the session, and Stop cancels the run. A run that stops on
|
|
125
|
-
* interrupts answers with a link to its thread in LangSmith Studio, where
|
|
126
|
-
* they are resumed.
|
|
127
|
-
*
|
|
128
|
-
* @experimental Sessions use Linear's Agents API, a Developer Preview, so
|
|
129
|
-
* they may change as Linear changes it.
|
|
130
|
-
*/
|
|
131
|
-
sessions?: boolean;
|
|
132
|
-
/**
|
|
133
|
-
* Ignore changes made by other apps and integrations (a delivery whose
|
|
134
|
-
* actor isn't a person, or the creation of an issue or comment with a
|
|
135
|
-
* `botActor`), so automations don't trigger each other. Defaults to `true`.
|
|
136
|
-
* The app's own changes are always ignored.
|
|
137
|
-
*/
|
|
138
|
-
ignoreBots?: boolean;
|
|
139
|
-
/**
|
|
140
|
-
* A delivery of a handled event is done, once, with how, to switch on by
|
|
141
|
-
* `type`: the run it started and how that run ended, as LangGraph names it
|
|
142
|
-
* (`run`), why it started none (`skipped`, such as a Stop or a handler
|
|
143
|
-
* that returned nothing), or that MDA lost it (`failed`); and the
|
|
144
|
-
* decisions the thread waits on. Called after the channel's own
|
|
145
|
-
* activities, such as the session's elicitation or "Stopped.", in the
|
|
146
|
-
* background; failures are logged. See `channels.http`'s `onFinish` for
|
|
147
|
-
* its limits.
|
|
148
|
-
*
|
|
149
|
-
* @example
|
|
150
|
-
* ```ts
|
|
151
|
-
* onFinish: async (event, thread, finished) => {
|
|
152
|
-
* if (finished.type === "run" && finished.run.status === "success")
|
|
153
|
-
* await reportRun(thread.id, finished.run.id);
|
|
154
|
-
* }
|
|
155
|
-
* ```
|
|
156
|
-
*/
|
|
157
|
-
onFinish?: EventFinished<LinearEvent, LinearChannelThread>;
|
|
158
|
-
}
|
|
159
|
-
/** What a Linear channel POSTs an endpoint, for one event key or any. */
|
|
160
|
-
export type LinearEndpointRequest<K extends LinearEventKey = LinearEventKey> = EndpointRequest<LinearEvent<K>, (typeof LINEAR_ENDPOINT_EVENT_FIELDS)[number]>;
|
|
161
|
-
export {};
|
|
162
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/channels/linear/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAA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MAAM,WAAW,gBAAgB;IAC/B;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,kFAAkF;IAClF,GAAG,CAAC,EAAE,gBAAgB,CAAC;IACvB;;;;;;;;;;;;OAYG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC;;;;OAIG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,EAAE;SACP,CAAC,IAAI,cAAc,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,aAAa;KAC/D,CAAC;IACF;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;CAC5D;AAED,yEAAyE;AACzE,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,IACzE,eAAe,CACb,WAAW,CAAC,CAAC,CAAC,EACd,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAC9C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/channels/linear/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Why a channel's reserved agent connection cannot be read as a user
|
|
3
|
-
* connection, or undefined for any other slug. Reading an app's token as the
|
|
4
|
-
* person running the agent is not supported yet.
|
|
5
|
-
*/
|
|
6
|
-
export declare function reservedUserConnectionError(slug: string): string | undefined;
|
|
7
|
-
/**
|
|
8
|
-
* The connection that actually holds a channel's reserved agent connection;
|
|
9
|
-
* other slugs pass through unchanged.
|
|
10
|
-
*/
|
|
11
|
-
export declare function reservedAgentConnectionSlug(slug: string, deploymentId: string | undefined): string;
|
|
12
|
-
//# sourceMappingURL=reserved-connections.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reserved-connections.d.ts","sourceRoot":"","sources":["../../src/channels/reserved-connections.ts"],"names":[],"mappings":"AAiDA;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAS5E;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,GAAG,SAAS,GAC/B,MAAM,CAGR"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { GITHUB_TOKEN_SLUG, githubAppConnectionSlug, } from "./github/connections.js";
|
|
2
|
-
import { LINEAR_TOKEN_SLUG, linearAppConnectionSlug, } from "./linear/connections.js";
|
|
3
|
-
import { SLACK_BOT_TOKEN_SLUG } from "./slack/connections.js";
|
|
4
|
-
// First-party channels' reserved agent connection names, listed here so
|
|
5
|
-
// resolution does not depend on adapter modules being loaded.
|
|
6
|
-
const builtinReservedConnections = new Map([
|
|
7
|
-
[
|
|
8
|
-
GITHUB_TOKEN_SLUG,
|
|
9
|
-
{
|
|
10
|
-
resolve: githubAppConnectionSlug,
|
|
11
|
-
token: "the GitHub App's installation token",
|
|
12
|
-
actsAs: "act on GitHub as the App",
|
|
13
|
-
},
|
|
14
|
-
],
|
|
15
|
-
[
|
|
16
|
-
LINEAR_TOKEN_SLUG,
|
|
17
|
-
{
|
|
18
|
-
resolve: linearAppConnectionSlug,
|
|
19
|
-
token: "the Linear app's token",
|
|
20
|
-
actsAs: "act in Linear as the app",
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
[
|
|
24
|
-
SLACK_BOT_TOKEN_SLUG,
|
|
25
|
-
{
|
|
26
|
-
// The Slack app's connection has the reserved name itself.
|
|
27
|
-
resolve: () => SLACK_BOT_TOKEN_SLUG,
|
|
28
|
-
token: "the Slack app's bot token",
|
|
29
|
-
actsAs: "act in Slack as the app",
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
]);
|
|
33
|
-
/**
|
|
34
|
-
* Why a channel's reserved agent connection cannot be read as a user
|
|
35
|
-
* connection, or undefined for any other slug. Reading an app's token as the
|
|
36
|
-
* person running the agent is not supported yet.
|
|
37
|
-
*/
|
|
38
|
-
export function reservedUserConnectionError(slug) {
|
|
39
|
-
const reserved = builtinReservedConnections.get(slug);
|
|
40
|
-
if (!reserved)
|
|
41
|
-
return undefined;
|
|
42
|
-
const name = JSON.stringify(slug);
|
|
43
|
-
return (`${name} is not supported as a user connection yet: it is ${reserved.token}, ` +
|
|
44
|
-
`an agent connection. Use connections.get(${name}, { type: "agent" }) to ` +
|
|
45
|
-
`${reserved.actsAs}.`);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* The connection that actually holds a channel's reserved agent connection;
|
|
49
|
-
* other slugs pass through unchanged.
|
|
50
|
-
*/
|
|
51
|
-
export function reservedAgentConnectionSlug(slug, deploymentId) {
|
|
52
|
-
const reserved = builtinReservedConnections.get(slug);
|
|
53
|
-
return reserved && deploymentId ? reserved.resolve(deploymentId) : slug;
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=reserved-connections.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reserved-connections.js","sourceRoot":"","sources":["../../src/channels/reserved-connections.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,iBAAiB,EACjB,uBAAuB,GAC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|
|
1
|
-
/**
|
|
2
|
-
* What a channel handler starts a run with, in the shapes `agent.invoke`
|
|
3
|
-
* takes, normalized to the JSON the Agent Server accepts.
|
|
4
|
-
*/
|
|
5
|
-
import { type BaseMessage, type BaseMessageLike } from "@langchain/core/messages";
|
|
6
|
-
import type { LangGraphRunnableConfig } from "@langchain/langgraph";
|
|
7
|
-
import type { JsonObject } from "./manifest.js";
|
|
8
|
-
import type { JsonValue } from "./types.js";
|
|
9
|
-
/**
|
|
10
|
-
* State to start a run with, as `agent.invoke` takes it: `messages` plus any
|
|
11
|
-
* other keys of the agent's state.
|
|
12
|
-
*/
|
|
13
|
-
export interface ChannelStateInput {
|
|
14
|
-
messages?: BaseMessageLike[];
|
|
15
|
-
[key: string]: unknown;
|
|
16
|
-
}
|
|
17
|
-
/** A user message's text, a message, or state to start a run with. */
|
|
18
|
-
export type ChannelRunInput = string | BaseMessage | ChannelStateInput;
|
|
19
|
-
/** Run options a handler may set with its input, as `agent.invoke` takes them. */
|
|
20
|
-
export type ChannelRunOptions = Pick<LangGraphRunnableConfig<Record<string, unknown>>, "context"> & {
|
|
21
|
-
/**
|
|
22
|
-
* Metadata for the run, such as where it came from, to find it by in
|
|
23
|
-
* LangSmith. Keys are letters, digits, `_`, `.` or `-` and start with a
|
|
24
|
-
* letter. Keys the Agent Server and LangSmith set are reserved: those
|
|
25
|
-
* starting with `mda_`, `langgraph_` or `ls_`, and ids such as `thread_id`,
|
|
26
|
-
* `session_id`, `run_id` or `user_id`.
|
|
27
|
-
*/
|
|
28
|
-
metadata?: {
|
|
29
|
-
readonly [key: string]: JsonValue;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* A URL the Agent Server POSTs the finished run to (its status, metadata,
|
|
33
|
-
* values and any error), as LangGraph's `runs.create({ webhook })` does:
|
|
34
|
-
* from the server, so it reaches you even if the deployment restarts.
|
|
35
|
-
* http(s), without credentials in it.
|
|
36
|
-
*/
|
|
37
|
-
webhook?: string;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* What a channel handler may return to start a run: the input, or the input
|
|
41
|
-
* with run options, as `agent.invoke(input, options)` takes them.
|
|
42
|
-
*/
|
|
43
|
-
export type ChannelRunResult = ChannelRunInput | readonly [ChannelRunInput, ChannelRunOptions];
|
|
44
|
-
/** A handler's result as the Agent Server takes it. */
|
|
45
|
-
export interface NormalizedRunInput {
|
|
46
|
-
/** Messages as JSON, each with a `role`. */
|
|
47
|
-
messages: JsonObject[];
|
|
48
|
-
/** Other state keys. */
|
|
49
|
-
state: JsonObject;
|
|
50
|
-
context?: JsonObject;
|
|
51
|
-
metadata?: JsonObject;
|
|
52
|
-
webhook?: string;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* A handler's run input as `startIngressRun` takes it, with MDA's own
|
|
56
|
-
* `metadata` over the handler's, so a handler can't replace it. Empty state
|
|
57
|
-
* and metadata are left out.
|
|
58
|
-
*/
|
|
59
|
-
export declare function runStartOptions(input: NormalizedRunInput, metadata?: JsonObject): {
|
|
60
|
-
messages: JsonObject[];
|
|
61
|
-
state?: JsonObject;
|
|
62
|
-
metadata?: JsonObject;
|
|
63
|
-
webhook?: string;
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Normalize what a handler returned. `null` and `undefined` start nothing;
|
|
67
|
-
* anything else that is not valid input throws a `TypeError`. A run option
|
|
68
|
-
* that is `null` or `undefined` is not set.
|
|
69
|
-
*/
|
|
70
|
-
export declare function normalizeRunInput(value: unknown): NormalizedRunInput | undefined;
|
|
71
|
-
//# sourceMappingURL=run-input.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run-input.d.ts","sourceRoot":"","sources":["../../src/channels/run-input.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,eAAe,EAErB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAs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