managed-deepagents 0.5.0-dev.88 → 0.5.0-dev.89
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 +2 -2
- package/dist/channels/index.d.ts +1 -1
- package/dist/channels/index.d.ts.map +1 -1
- package/dist/channels/index.js.map +1 -1
- package/dist/channels/manifest.d.ts +0 -30
- package/dist/channels/manifest.d.ts.map +1 -1
- package/dist/channels/registry-types.d.ts +2 -2
- package/dist/channels/registry-types.d.ts.map +1 -1
- package/dist/connectors/github/http.d.ts +1 -1
- package/dist/connectors/github/http.js +1 -1
- package/dist/connectors/langsmith/index.d.ts +1 -1
- package/dist/connectors/langsmith/index.d.ts.map +1 -1
- package/dist/connectors/langsmith/index.js.map +1 -1
- package/dist/connectors/langsmith/routes.d.ts +3 -3
- package/dist/connectors/langsmith/routes.d.ts.map +1 -1
- package/dist/connectors/langsmith/routes.js +7 -26
- package/dist/connectors/langsmith/routes.js.map +1 -1
- package/dist/connectors/slack/adapter.d.ts.map +1 -1
- package/dist/connectors/slack/adapter.js +0 -1
- package/dist/connectors/slack/adapter.js.map +1 -1
- package/dist/connectors/slack/http.d.ts +1 -1
- package/dist/connectors/slack/http.d.ts.map +1 -1
- package/dist/connectors/slack/http.js +2 -6
- package/dist/connectors/slack/http.js.map +1 -1
- package/dist/connectors/slack/index.d.ts +2 -17
- package/dist/connectors/slack/index.d.ts.map +1 -1
- package/dist/connectors/slack/index.js +6 -30
- package/dist/connectors/slack/index.js.map +1 -1
- package/dist/connectors/slack/normalize.d.ts +0 -1
- package/dist/connectors/slack/normalize.d.ts.map +1 -1
- package/dist/connectors/slack/normalize.js +0 -4
- package/dist/connectors/slack/normalize.js.map +1 -1
- package/dist/identity/claims.d.ts +0 -2
- package/dist/identity/claims.d.ts.map +1 -1
- package/dist/identity/claims.js +0 -4
- package/dist/identity/claims.js.map +1 -1
- package/dist/identity/index.d.ts +4 -4
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/identity/index.js +27 -15
- package/dist/identity/index.js.map +1 -1
- package/dist/identity/memory-slices.d.ts +4 -7
- package/dist/identity/memory-slices.d.ts.map +1 -1
- package/dist/identity/memory-slices.js +27 -49
- package/dist/identity/memory-slices.js.map +1 -1
- package/dist/identity/options.d.ts +4 -23
- package/dist/identity/options.d.ts.map +1 -1
- package/dist/identity/options.js +22 -58
- package/dist/identity/options.js.map +1 -1
- package/dist/identity/types.d.ts +11 -59
- package/dist/identity/types.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/ingress/index.d.ts +0 -2
- package/dist/ingress/index.d.ts.map +1 -1
- package/dist/ingress/index.js +1 -6
- package/dist/ingress/index.js.map +1 -1
- package/dist/runtime/auth.d.ts +10 -12
- package/dist/runtime/auth.d.ts.map +1 -1
- package/dist/runtime/auth.js +16 -51
- package/dist/runtime/auth.js.map +1 -1
- package/dist/runtime/connector.d.ts +2 -2
- package/dist/runtime/credentials.d.ts +6 -6
- package/dist/runtime/credentials.js +8 -10
- package/dist/runtime/credentials.js.map +1 -1
- package/dist/runtime/identity-runtime.d.ts +13 -13
- package/dist/runtime/identity-runtime.d.ts.map +1 -1
- package/dist/runtime/identity-runtime.js +14 -41
- package/dist/runtime/identity-runtime.js.map +1 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +3 -5
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/memory/lazy-context-backend.d.ts +2 -2
- package/dist/runtime/memory/lazy-context-backend.js +2 -2
- package/dist/runtime/memory/mounts.js +1 -1
- package/dist/runtime/memory/mounts.js.map +1 -1
- package/dist/runtime/memory/user-repo.d.ts.map +1 -1
- package/dist/runtime/memory/user-repo.js +3 -4
- package/dist/runtime/memory/user-repo.js.map +1 -1
- package/dist/runtime/validated-token.d.ts +1 -1
- package/dist/runtime/validated-token.d.ts.map +1 -1
- package/dist/runtime/validated-token.js +3 -16
- package/dist/runtime/validated-token.js.map +1 -1
- package/package.json +7 -7
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Memory slice helpers shared by identity normalize and the runtime.
|
|
3
3
|
*
|
|
4
4
|
* Resolved memory is always a list of concrete slices (empty = no memory).
|
|
5
|
+
* Mounts are always read/write.
|
|
5
6
|
*/
|
|
6
|
-
const DEFAULT_ACCESS = "rw";
|
|
7
7
|
/** True when the agent (deployment-shared) slice is enabled. */
|
|
8
8
|
export function hasAgentMemorySlice(memory) {
|
|
9
9
|
return memory.some((slice) => slice.kind === "agent");
|
|
@@ -12,11 +12,6 @@ export function hasAgentMemorySlice(memory) {
|
|
|
12
12
|
export function hasUserMemorySlice(memory) {
|
|
13
13
|
return memory.some((slice) => slice.kind === "user");
|
|
14
14
|
}
|
|
15
|
-
/** Partition for the user slice, or `null` when user memory is disabled. */
|
|
16
|
-
export function userMemoryPartition(memory) {
|
|
17
|
-
const user = memory.find((slice) => slice.kind === "user");
|
|
18
|
-
return user?.partition ?? null;
|
|
19
|
-
}
|
|
20
15
|
/** Hot-memory paths for enabled slices (agent first, user last). */
|
|
21
16
|
export function hotMemoryPaths(memory) {
|
|
22
17
|
const paths = [];
|
|
@@ -31,8 +26,8 @@ export function hotMemoryPaths(memory) {
|
|
|
31
26
|
/**
|
|
32
27
|
* Normalize authoring `scope.memory` into a resolved slice list.
|
|
33
28
|
*
|
|
34
|
-
* Rejects legacy flat `"organization"
|
|
35
|
-
*
|
|
29
|
+
* Rejects object slice syntax, legacy flat `"organization"`, any `partition`
|
|
30
|
+
* field, and any `access` field (mounts are always R/W).
|
|
36
31
|
*/
|
|
37
32
|
export function normalizeMemoryScope(input) {
|
|
38
33
|
if (input === "none") {
|
|
@@ -41,8 +36,7 @@ export function normalizeMemoryScope(input) {
|
|
|
41
36
|
// Runtime guard for pre-slice authoring (`"organization"` is not in the type).
|
|
42
37
|
if (input === "organization") {
|
|
43
38
|
throw new Error('defineIdentity(...) `scope.memory: "organization"` is not supported. ' +
|
|
44
|
-
|
|
45
|
-
'`memory: ["agent", { kind: "user", partition: "organization" }]`.');
|
|
39
|
+
"Organization identity is not supported.");
|
|
46
40
|
}
|
|
47
41
|
const raw = Array.isArray(input) ? input : [input];
|
|
48
42
|
if (raw.length === 0) {
|
|
@@ -77,51 +71,35 @@ export function normalizeMemoryScope(input) {
|
|
|
77
71
|
}
|
|
78
72
|
function normalizeMemorySlice(entry) {
|
|
79
73
|
if (entry === "user") {
|
|
80
|
-
return { kind: "user"
|
|
74
|
+
return { kind: "user" };
|
|
81
75
|
}
|
|
82
76
|
if (entry === "agent") {
|
|
83
|
-
return { kind: "agent"
|
|
84
|
-
}
|
|
85
|
-
if (entry === null || typeof entry !== "object" || !("kind" in entry)) {
|
|
86
|
-
throw new Error(`defineIdentity(...) unknown \`scope.memory\` entry ${JSON.stringify(entry)}. ` +
|
|
87
|
-
'Use "user", "agent", or { kind: "user" | "agent", … }.');
|
|
88
|
-
}
|
|
89
|
-
if (entry.kind === "agent") {
|
|
90
|
-
return {
|
|
91
|
-
kind: "agent",
|
|
92
|
-
access: assertAccess(entry.access) ?? DEFAULT_ACCESS,
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
if (entry.kind === "user") {
|
|
96
|
-
return {
|
|
97
|
-
kind: "user",
|
|
98
|
-
partition: assertPartition(entry.partition) ?? "user",
|
|
99
|
-
access: assertAccess(entry.access) ?? DEFAULT_ACCESS,
|
|
100
|
-
};
|
|
77
|
+
return { kind: "agent" };
|
|
101
78
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
if (value !== "rw" && value !== "ro") {
|
|
109
|
-
throw new Error(`defineIdentity(...) unknown memory \`access\` "${String(value)}". Valid values: rw, ro.`);
|
|
79
|
+
// Runtime guard: object form is not in MemorySliceInput (reserved for later).
|
|
80
|
+
const unknownEntry = entry;
|
|
81
|
+
if (unknownEntry !== null && typeof unknownEntry === "object") {
|
|
82
|
+
assertNoRetiredSliceFields(unknownEntry);
|
|
83
|
+
throw new Error(`defineIdentity(...) unknown \`scope.memory\` entry ${JSON.stringify(unknownEntry)}. ` +
|
|
84
|
+
'Use string shorthands "user" or "agent".');
|
|
110
85
|
}
|
|
111
|
-
|
|
86
|
+
throw new Error(`defineIdentity(...) unknown \`scope.memory\` entry ${JSON.stringify(unknownEntry)}. ` +
|
|
87
|
+
'Use string shorthands "user" or "agent".');
|
|
112
88
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
89
|
+
/** Reject retired / vestigial fields on slice objects. */
|
|
90
|
+
function assertNoRetiredSliceFields(entry) {
|
|
91
|
+
if ("partition" in entry) {
|
|
92
|
+
const partition = entry.partition;
|
|
93
|
+
if (partition === "organization") {
|
|
94
|
+
throw new Error('defineIdentity(...) memory `partition: "organization"` is not supported. ' +
|
|
95
|
+
"Organization identity is not supported.");
|
|
96
|
+
}
|
|
97
|
+
throw new Error("defineIdentity(...) memory `partition` is not supported. " +
|
|
98
|
+
"User memory is always per-caller keyed — omit `partition`.");
|
|
116
99
|
}
|
|
117
|
-
if (
|
|
118
|
-
throw new Error(
|
|
119
|
-
|
|
100
|
+
if ("access" in entry) {
|
|
101
|
+
throw new Error("defineIdentity(...) memory `access` is not supported. " +
|
|
102
|
+
"Memory mounts are always read/write — omit `access`.");
|
|
120
103
|
}
|
|
121
|
-
return value;
|
|
122
|
-
}
|
|
123
|
-
/** True when memory config requires an organization id (user partition org). */
|
|
124
|
-
export function memoryRequiresOrganization(memory) {
|
|
125
|
-
return userMemoryPartition(memory) === "organization";
|
|
126
104
|
}
|
|
127
105
|
//# sourceMappingURL=memory-slices.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-slices.js","sourceRoot":"","sources":["../../src/identity/memory-slices.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"memory-slices.js","sourceRoot":"","sources":["../../src/identity/memory-slices.ts"],"names":[],"mappings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C,IAAI,YAAY,KAAK,IAAI,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;QAC9D,0BAA0B,CAAC,YAAY,CAAC,CAAC;QACzC,MAAM,IAAI,KAAK,CACb,sDAAsD,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI;YACpF,0CAA0C,CAC7C,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,KAAK,CACb,sDAAsD,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI;QACpF,0CAA0C,CAC7C,CAAC;AACJ,CAAC;AAED,0DAA0D;AAC1D,SAAS,0BAA0B,CAAC,KAAa;IAC/C,IAAI,WAAW,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,SAAS,GAAI,KAAiC,CAAC,SAAS,CAAC;QAC/D,IAAI,SAAS,KAAK,cAAc,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CACb,2EAA2E;gBACzE,yCAAyC,CAC5C,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,KAAK,CACb,2DAA2D;YACzD,4DAA4D,CAC/D,CAAC;IACJ,CAAC;IACD,IAAI,QAAQ,IAAI,KAAK,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CACb,wDAAwD;YACtD,sDAAsD,CACzD,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -6,11 +6,9 @@
|
|
|
6
6
|
* isolation boundary is — in two keys. Everything else the runtime needs is
|
|
7
7
|
* derived here, so the resolved contract stays free to grow axes without the
|
|
8
8
|
* authoring surface growing a knob per axis.
|
|
9
|
-
*
|
|
10
|
-
* See `docs/design/identity-model-review.md` for the rationale.
|
|
11
9
|
*/
|
|
12
10
|
import type { IdentityConnectProvider } from "./connect-provider-types.js";
|
|
13
|
-
import type { CredentialResolverConfig, CredentialResolvers, CredentialScope, IdentityConfig, MemoryScope, MemoryScopeInput,
|
|
11
|
+
import type { CredentialResolverConfig, CredentialResolvers, CredentialScope, IdentityConfig, MemoryScope, MemoryScopeInput, ValidatedTokenProvider } from "./types.js";
|
|
14
12
|
/**
|
|
15
13
|
* How MDA learns who is calling.
|
|
16
14
|
*
|
|
@@ -28,20 +26,18 @@ export type IdentityAuth = "backend" | ValidatedTokenProvider | ValidatedTokenPr
|
|
|
28
26
|
* with the shared LangSmith vault (`mda connect` / Settings → Integrations).
|
|
29
27
|
* - `"user"` — private threads, per-caller credentials, and both agent
|
|
30
28
|
* (procedural) + user (personal) memory slices.
|
|
31
|
-
* - `"organization"` — callers must present an organization; private memory is
|
|
32
|
-
* partitioned by org, plus shared agent memory.
|
|
33
29
|
* - `"none"` — no durable memory and no downstream credentials.
|
|
34
30
|
*/
|
|
35
|
-
export type IdentityScope = "user" | "
|
|
31
|
+
export type IdentityScope = "user" | "agent" | "none";
|
|
36
32
|
/**
|
|
37
33
|
* Per-axis overrides for authors whose deployment does not fit a single
|
|
38
34
|
* {@link IdentityScope}. Anything left unset follows `default`.
|
|
35
|
+
*
|
|
36
|
+
* Threads are always user-owned; there is no `threads` override.
|
|
39
37
|
*/
|
|
40
38
|
export interface IdentityScopeOverrides {
|
|
41
39
|
/** Base scope the unset axes follow. Defaults to `"agent"`. */
|
|
42
40
|
default?: IdentityScope;
|
|
43
|
-
/** Who can open or resume a conversation. */
|
|
44
|
-
threads?: ThreadScope;
|
|
45
41
|
/**
|
|
46
42
|
* Which memory slices a run may use.
|
|
47
43
|
*
|
|
@@ -62,21 +58,6 @@ export interface IdentityOptions {
|
|
|
62
58
|
auth?: IdentityAuth;
|
|
63
59
|
/** The isolation boundary, or per-axis overrides. Defaults to `"agent"`. */
|
|
64
60
|
scope?: IdentityScope | IdentityScopeOverrides;
|
|
65
|
-
/**
|
|
66
|
-
* Whether every caller must present an organization id.
|
|
67
|
-
*
|
|
68
|
-
* Inferred from `scope`: organization-scoped threads/credentials or a user
|
|
69
|
-
* memory partition of `"organization"` → `"required"`, otherwise
|
|
70
|
-
* `"optional"`. Set this explicitly only when you need org partitioning of
|
|
71
|
-
* per-user memory without org-partitioned memory:
|
|
72
|
-
*
|
|
73
|
-
* ```ts
|
|
74
|
-
* defineIdentity({ scope: "user", organization: "required" })
|
|
75
|
-
* ```
|
|
76
|
-
*
|
|
77
|
-
* Cannot be `"optional"` when an axis requires an organization.
|
|
78
|
-
*/
|
|
79
|
-
organization?: OrganizationRequirement;
|
|
80
61
|
/**
|
|
81
62
|
* Mint your own downstream credentials per caller. Providing this puts the
|
|
82
63
|
* credentials axis in custom mode — there is no separate flag to set.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/identity/options.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/identity/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAG3E,OAAO,KAAK,EACV,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAEpB;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,sBAAsB,GACtB,sBAAsB,EAAE,CAAC;AAE7B;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,+DAA+D;IAC/D,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B;AAED,uDAAuD;AACvD,MAAM,WAAW,eAAe;IAC9B,yDAAyD;IACzD,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,aAAa,GAAG,sBAAsB,CAAC;IAC/C;;;;;;;;;;;;;OAaG;IACH,WAAW,CAAC,EAAE,wBAAwB,GAAG,mBAAmB,CAAC;IAC7D;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,uBAAuB,EAAE,CAAC;CACrC;AA0BD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,GAAE,eAAoB,GAC5B,cAAc,CAkBhB;AA6ID,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC"}
|
package/dist/identity/options.js
CHANGED
|
@@ -6,22 +6,11 @@
|
|
|
6
6
|
* isolation boundary is — in two keys. Everything else the runtime needs is
|
|
7
7
|
* derived here, so the resolved contract stays free to grow axes without the
|
|
8
8
|
* authoring surface growing a knob per axis.
|
|
9
|
-
*
|
|
10
|
-
* See `docs/design/identity-model-review.md` for the rationale.
|
|
11
9
|
*/
|
|
12
10
|
import { credentialConnectProviders } from "./credential-resolvers.js";
|
|
13
|
-
import {
|
|
14
|
-
const AGENT_SLICE = { kind: "agent"
|
|
15
|
-
const USER_SLICE = {
|
|
16
|
-
kind: "user",
|
|
17
|
-
partition: "user",
|
|
18
|
-
access: "rw",
|
|
19
|
-
};
|
|
20
|
-
const ORG_USER_SLICE = {
|
|
21
|
-
kind: "user",
|
|
22
|
-
partition: "organization",
|
|
23
|
-
access: "rw",
|
|
24
|
-
};
|
|
11
|
+
import { normalizeMemoryScope } from "./memory-slices.js";
|
|
12
|
+
const AGENT_SLICE = { kind: "agent" };
|
|
13
|
+
const USER_SLICE = { kind: "user" };
|
|
25
14
|
/**
|
|
26
15
|
* Axis defaults per {@link IdentityScope}.
|
|
27
16
|
*
|
|
@@ -29,23 +18,12 @@ const ORG_USER_SLICE = {
|
|
|
29
18
|
*/
|
|
30
19
|
const SCOPE_AXES = {
|
|
31
20
|
user: {
|
|
32
|
-
threads: "user",
|
|
33
21
|
memory: [AGENT_SLICE, USER_SLICE],
|
|
34
22
|
credentials: "user",
|
|
35
23
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
memory: [AGENT_SLICE, ORG_USER_SLICE],
|
|
39
|
-
credentials: "none",
|
|
40
|
-
},
|
|
41
|
-
agent: { threads: "user", memory: [AGENT_SLICE], credentials: "agent" },
|
|
42
|
-
none: { threads: "user", memory: [], credentials: "none" },
|
|
24
|
+
agent: { memory: [AGENT_SLICE], credentials: "agent" },
|
|
25
|
+
none: { memory: [], credentials: "none" },
|
|
43
26
|
};
|
|
44
|
-
const THREAD_SCOPES = [
|
|
45
|
-
"user",
|
|
46
|
-
"conversation",
|
|
47
|
-
"organization",
|
|
48
|
-
];
|
|
49
27
|
const CREDENTIAL_SCOPES = [
|
|
50
28
|
"user",
|
|
51
29
|
"agent",
|
|
@@ -62,11 +40,8 @@ const CREDENTIAL_SCOPES = [
|
|
|
62
40
|
export function normalizeIdentity(options = {}) {
|
|
63
41
|
assertOptionKeys(options);
|
|
64
42
|
const scope = resolveScope(options);
|
|
65
|
-
const organization = options.organization ?? inferOrganizationRequirement(scope);
|
|
66
|
-
assertOrganizationRequirement(options.organization, scope, organization);
|
|
67
43
|
const config = {
|
|
68
44
|
ingress: { http: resolveIngress(options.auth) },
|
|
69
|
-
organization,
|
|
70
45
|
scope,
|
|
71
46
|
};
|
|
72
47
|
if (options.credentials !== undefined) {
|
|
@@ -91,12 +66,16 @@ function resolveIngress(auth) {
|
|
|
91
66
|
function resolveScope(options) {
|
|
92
67
|
const scope = options.scope ?? "agent";
|
|
93
68
|
const overrides = typeof scope === "string" ? { default: scope } : scope;
|
|
69
|
+
if (typeof scope !== "string" &&
|
|
70
|
+
scope !== null &&
|
|
71
|
+
typeof scope === "object") {
|
|
72
|
+
assertNoThreads(scope);
|
|
73
|
+
}
|
|
94
74
|
const base = SCOPE_AXES[overrides.default ?? "agent"];
|
|
95
75
|
if (base === undefined) {
|
|
96
76
|
throw new Error(`defineIdentity(...) unknown \`scope\` "${String(overrides.default)}". ` +
|
|
97
77
|
`Valid scopes: ${Object.keys(SCOPE_AXES).join(", ")}.`);
|
|
98
78
|
}
|
|
99
|
-
const threads = assertAxis("threads", overrides.threads, THREAD_SCOPES) ?? base.threads;
|
|
100
79
|
const memory = overrides.memory !== undefined
|
|
101
80
|
? normalizeMemoryScope(overrides.memory)
|
|
102
81
|
: base.memory;
|
|
@@ -105,7 +84,14 @@ function resolveScope(options) {
|
|
|
105
84
|
? requireCustomCompatible(overrides.credentials)
|
|
106
85
|
: (assertAxis("credentials", overrides.credentials, CREDENTIAL_SCOPES) ??
|
|
107
86
|
base.credentials);
|
|
108
|
-
return {
|
|
87
|
+
return { memory, credentials };
|
|
88
|
+
}
|
|
89
|
+
function assertNoThreads(scope) {
|
|
90
|
+
if (!("threads" in scope)) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
throw new Error("defineIdentity(...) `scope.threads` is not supported. " +
|
|
94
|
+
"Threads are always user-owned — omit `threads`.");
|
|
109
95
|
}
|
|
110
96
|
function assertAxis(axis, value, allowed) {
|
|
111
97
|
if (value === undefined) {
|
|
@@ -128,25 +114,6 @@ function requireCustomCompatible(declared) {
|
|
|
128
114
|
}
|
|
129
115
|
return "custom";
|
|
130
116
|
}
|
|
131
|
-
/** Organization-scoped axes / memory partitions make an organization mandatory. */
|
|
132
|
-
function inferOrganizationRequirement(scope) {
|
|
133
|
-
if (scope.threads === "organization" ||
|
|
134
|
-
memoryRequiresOrganization(scope.memory)) {
|
|
135
|
-
return "required";
|
|
136
|
-
}
|
|
137
|
-
return "optional";
|
|
138
|
-
}
|
|
139
|
-
function assertOrganizationRequirement(declared, scope, resolved) {
|
|
140
|
-
if (declared !== undefined &&
|
|
141
|
-
declared !== "optional" &&
|
|
142
|
-
declared !== "required") {
|
|
143
|
-
throw new Error(`defineIdentity(...) \`organization\` must be "optional" or "required" (received "${String(declared)}").`);
|
|
144
|
-
}
|
|
145
|
-
if (resolved === "optional" &&
|
|
146
|
-
inferOrganizationRequirement(scope) === "required") {
|
|
147
|
-
throw new Error('defineIdentity(...) organization-scoped isolation requires `organization: "required"`.');
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
117
|
/**
|
|
151
118
|
* Connect providers the deployment declared, plus the ones its credential
|
|
152
119
|
* resolvers depend on. A resolver that reads per-user OAuth tokens needs a place
|
|
@@ -167,13 +134,7 @@ function resolveConnect(options) {
|
|
|
167
134
|
}
|
|
168
135
|
return out;
|
|
169
136
|
}
|
|
170
|
-
const KNOWN_OPTION_KEYS = new Set([
|
|
171
|
-
"auth",
|
|
172
|
-
"scope",
|
|
173
|
-
"organization",
|
|
174
|
-
"credentials",
|
|
175
|
-
"connect",
|
|
176
|
-
]);
|
|
137
|
+
const KNOWN_OPTION_KEYS = new Set(["auth", "scope", "credentials", "connect"]);
|
|
177
138
|
/**
|
|
178
139
|
* Reject unknown keys so a typo fails loudly instead of being silently ignored.
|
|
179
140
|
*/
|
|
@@ -181,6 +142,9 @@ function assertOptionKeys(options) {
|
|
|
181
142
|
if (options === null || typeof options !== "object") {
|
|
182
143
|
throw new Error("defineIdentity(...) accepts an options object ({ auth, scope, … }) or no arguments.");
|
|
183
144
|
}
|
|
145
|
+
if ("organization" in options) {
|
|
146
|
+
throw new Error("defineIdentity(...) `organization` is not supported. Organization identity has been removed.");
|
|
147
|
+
}
|
|
184
148
|
const unknown = Object.keys(options).filter((key) => !KNOWN_OPTION_KEYS.has(key));
|
|
185
149
|
if (unknown.length > 0) {
|
|
186
150
|
throw new Error(`defineIdentity(...) unknown option(s): ${unknown.join(", ")}. ` +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/identity/options.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/identity/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AA4F1D,MAAM,WAAW,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okenProvider {
|
|
|
97
97
|
export interface ClaimMapping {
|
|
98
98
|
/** Claim used as `runtime.identity.user.id` (e.g. "sub", "email"). */
|
|
99
99
|
user?: string;
|
|
100
|
-
/** Claim used as `runtime.identity.organization.id` (e.g. "org_id"). */
|
|
101
|
-
organization?: string;
|
|
102
100
|
/**
|
|
103
101
|
* Claim carrying every group the caller belongs to. Accepts a JSON array, or a
|
|
104
|
-
* comma/space-delimited string. Read by tools for authorization
|
|
105
|
-
* isolation key (see `organization` for that).
|
|
102
|
+
* comma/space-delimited string. Read by tools for authorization.
|
|
106
103
|
*/
|
|
107
104
|
groups?: string;
|
|
108
105
|
/** Claim used as `runtime.identity.user.email`. */
|
|
@@ -125,7 +122,7 @@ export interface CredentialTarget {
|
|
|
125
122
|
export interface ResolvedCredential {
|
|
126
123
|
/** Headers MDA attaches to the downstream call (usually Authorization). */
|
|
127
124
|
headers: Record<string, string>;
|
|
128
|
-
/** ISO expiry; MDA caches per (user,
|
|
125
|
+
/** ISO expiry; MDA caches per (user, target) until then. */
|
|
129
126
|
expiresAt?: string;
|
|
130
127
|
}
|
|
131
128
|
/** The frozen identity envelope tools and middleware see. */
|
|
@@ -136,13 +133,9 @@ export interface RuntimeIdentity {
|
|
|
136
133
|
id: string;
|
|
137
134
|
email?: string;
|
|
138
135
|
};
|
|
139
|
-
/** The organization this run is scoped to, when the caller presents one. */
|
|
140
|
-
organization?: {
|
|
141
|
-
id: string;
|
|
142
|
-
};
|
|
143
136
|
/**
|
|
144
137
|
* Every group the caller's token asserts. For authorization decisions in tools
|
|
145
|
-
* and middleware
|
|
138
|
+
* and middleware.
|
|
146
139
|
*/
|
|
147
140
|
groups?: readonly string[];
|
|
148
141
|
source: {
|
|
@@ -192,63 +185,31 @@ export type CredentialResolverConfig = ({
|
|
|
192
185
|
* folded into a hand-written switch.
|
|
193
186
|
*/
|
|
194
187
|
export type CredentialResolvers = Record<string, CredentialResolverConfig>;
|
|
195
|
-
/**
|
|
196
|
-
* Whether every caller must present an organization id.
|
|
197
|
-
*
|
|
198
|
-
* - `"optional"` — callers may omit an organization; memory / thread keys do
|
|
199
|
-
* not partition by org.
|
|
200
|
-
* - `"required"` — requests without an organization are rejected. When the
|
|
201
|
-
* user memory slice uses partition `"user"` and organization is required,
|
|
202
|
-
* per-user repos are also namespaced by org
|
|
203
|
-
* (`{deploy}--t--{org}--u--{user}`), so the same user in two orgs cannot
|
|
204
|
-
* share memory.
|
|
205
|
-
*
|
|
206
|
-
* Usually inferred from {@link IdentityConfig.scope}: organization-scoped
|
|
207
|
-
* threads/credentials, or a user memory slice with `partition: "organization"`,
|
|
208
|
-
* forces `"required"`. Set it explicitly for combinations inference cannot
|
|
209
|
-
* reach — e.g. `scope: "user"` with `organization: "required"`.
|
|
210
|
-
*/
|
|
211
|
-
export type OrganizationRequirement = "optional" | "required";
|
|
212
|
-
/** Who can open/resume the conversation. */
|
|
213
|
-
export type ThreadScope = "user" | "conversation" | "organization";
|
|
214
|
-
/** Reserved per-slice access mode (currently unused; mounts are R/W). */
|
|
215
|
-
export type MemoryAccess = "rw" | "ro";
|
|
216
|
-
/** How the private `/memories/user` Hub repo is keyed. */
|
|
217
|
-
export type MemoryPartition = "user" | "organization";
|
|
218
|
-
/** One enabled memory mount after normalize. */
|
|
188
|
+
/** One enabled memory mount after normalize. Mounts are always read/write. */
|
|
219
189
|
export type ResolvedMemorySlice = {
|
|
220
190
|
kind: "user";
|
|
221
|
-
partition: MemoryPartition;
|
|
222
|
-
access: MemoryAccess;
|
|
223
191
|
} | {
|
|
224
192
|
kind: "agent";
|
|
225
|
-
access: MemoryAccess;
|
|
226
193
|
};
|
|
227
194
|
/**
|
|
228
195
|
* Resolved durable memory config: which slices are mounted.
|
|
229
196
|
*
|
|
230
197
|
* Empty array means no durable memory. Order is agent then user when both are
|
|
231
|
-
* present.
|
|
198
|
+
* present. User memory is always per-caller keyed (`{deploy}--u--{user}`).
|
|
232
199
|
*/
|
|
233
200
|
export type MemoryScope = ResolvedMemorySlice[];
|
|
234
|
-
/** Authoring form of a single memory slice
|
|
235
|
-
export type MemorySliceInput = "user" | "agent"
|
|
236
|
-
kind: "user";
|
|
237
|
-
partition?: MemoryPartition;
|
|
238
|
-
access?: MemoryAccess;
|
|
239
|
-
} | {
|
|
240
|
-
kind: "agent";
|
|
241
|
-
access?: MemoryAccess;
|
|
242
|
-
};
|
|
201
|
+
/** Authoring form of a single memory slice. */
|
|
202
|
+
export type MemorySliceInput = "user" | "agent";
|
|
243
203
|
/**
|
|
244
204
|
* Authoring form of `scope.memory`.
|
|
245
205
|
*
|
|
246
206
|
* - `"none"` / `[]` — no durable memory
|
|
247
207
|
* - `"user"` / `"agent"` — that slice only
|
|
248
208
|
* - `["agent", "user"]` — both (procedural + personal)
|
|
249
|
-
* - `{ kind: "user", partition: "organization" }` — org-keyed private slice
|
|
250
209
|
*
|
|
251
|
-
*
|
|
210
|
+
* Object slice syntax (`{ kind }`) is not part of the authoring surface yet.
|
|
211
|
+
* Legacy flat `"organization"`, any `partition` field, and any `access` field
|
|
212
|
+
* are rejected (mounts are always R/W).
|
|
252
213
|
*/
|
|
253
214
|
export type MemoryScopeInput = "none" | MemorySliceInput | MemorySliceInput[];
|
|
254
215
|
/**
|
|
@@ -274,17 +235,8 @@ export interface IdentityConfig {
|
|
|
274
235
|
ingress: {
|
|
275
236
|
http: HttpIngress;
|
|
276
237
|
};
|
|
277
|
-
/**
|
|
278
|
-
* Whether every caller must present an organization id on the request.
|
|
279
|
-
* See {@link OrganizationRequirement}. Distinct from
|
|
280
|
-
* {@link RuntimeIdentity.organization}, which is the caller's org for a
|
|
281
|
-
* single run.
|
|
282
|
-
*/
|
|
283
|
-
organization: OrganizationRequirement;
|
|
284
|
-
/** The three isolation axes. */
|
|
238
|
+
/** Isolation axes. Threads are always user-owned. */
|
|
285
239
|
scope: {
|
|
286
|
-
/** Who can open/resume the conversation. */
|
|
287
|
-
threads?: ThreadScope;
|
|
288
240
|
/** Enabled memory slices (empty = none). */
|
|
289
241
|
memory: MemoryScope;
|
|
290
242
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/identity/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAE3E,YAAY,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAE3E,8DAA8D;AAC9D,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,qBAAqB,CAAC;AAE5D;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,iBAAiB,CAAC;IACxB;;;;OAIG;IACH,SAAS,EAAE,sBAAsB,EAAE,CAAC;CACrC;AAED,qDAAqD;AACrD,MAAM,WAAW,sBAAsB;IACrC,kFAAkF;IAClF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,wFAAwF;IACxF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,UAAU,CAAC,EAAE;QACX,uDAAuD;QACvD,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,sFAAsF;QACtF,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB;;;;WAIG;QACH,OAAO,CAAC,EAAE,MAAM,CACd,MAAM,EACN,MAAM,GAAG;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;SAAE,CA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,EAAE,cAAc,CAAC;CACjC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,14 +5,14 @@ export { auth, connect, connectors, credentials, sandboxes, } from "./namespaces
|
|
|
5
5
|
export type { Connect, Connectors, LangSmithConnectorsNamespace, } from "./namespaces.js";
|
|
6
6
|
export type { DeepAgentDefinition, DefineDeepAgentConfig, ManagedDeepAgentKey, } from "./types.js";
|
|
7
7
|
export type { ScheduleConfig, ScheduleDefinition, ScheduleDeliveryTarget, ScheduleThreadConfig, } from "./schedules.js";
|
|
8
|
-
export type { ClaimMapping, CredentialConnectRequirements, CredentialResolver, CredentialResolverConfig, CredentialResolvers, CredentialScope, CredentialTarget, GitHubAppJwtArgs, GitHubCredentialsOptions, GitHubTokenSource, GitHubUserTokenArgs, HttpIngress, IdentityAuth, IdentityConfig, IdentityConnectProvider, IdentityDefinition, IdentityOptions, IdentityScope, IdentityScopeOverrides,
|
|
8
|
+
export type { ClaimMapping, CredentialConnectRequirements, CredentialResolver, CredentialResolverConfig, CredentialResolvers, CredentialScope, CredentialTarget, GitHubAppJwtArgs, GitHubCredentialsOptions, GitHubTokenSource, GitHubUserTokenArgs, HttpIngress, IdentityAuth, IdentityConfig, IdentityConnectProvider, IdentityDefinition, IdentityOptions, IdentityScope, IdentityScopeOverrides, MemoryScope, MemoryScopeInput, MemorySliceInput, ResolvedCredential, ResolvedMemorySlice, RuntimeIdentity, ValidatedTokenIngress, ValidatedTokenProvider, } from "./identity/index.js";
|
|
9
9
|
export type { GitHubCheckoutReuse, GitHubConnector, GitHubConnectorConfig, GitHubRepositoryCheckout, } from "./connectors/github/index.js";
|
|
10
10
|
export type { LangSmithCallerSurface, LangSmithCapability, LangSmithCapabilityScope, LangSmithConnector, LangSmithConnectorConfig, LangSmithResource, LangSmithResponseShape, } from "./connectors/langsmith/index.js";
|
|
11
11
|
export type { HttpMcpServerConfig, McpServersConfig, McpServersDefinition, McpToolSelectionConfig, RemoteMcpServerBaseConfig, RemoteMcpServerConfig, SseMcpServerConfig, } from "./connectors/mcp/index.js";
|
|
12
12
|
export type { ToolSelection, ToolSelectionConnectorConfig, } from "./connectors/tool-selection.js";
|
|
13
13
|
export type { ToolServerConnector, ToolServerConnectorConfig, ToolServerConnectorFactory, ToolServerConnectorFactoryFor, ToolServerConnectors, ToolServerFactoryName, ToolServerIntegration, ToolServerIntegrationEntry, ToolServerSlug, ToolServerToolSelection, ToolsForFactory, } from "./connectors/toolserver/index.js";
|
|
14
14
|
export { integrationForFactory } from "./connectors/toolserver/index.js";
|
|
15
|
-
export type { ChannelManifest, RequiredSlackConnectorConfig,
|
|
15
|
+
export type { ChannelManifest, RequiredSlackConnectorConfig, SlackChannelFilters, SlackChannelTrigger, SlackConnector, SlackConnectorConfig, SlackConversationPolicy, SlackMentionBehavior, } from "./connectors/slack/index.js";
|
|
16
16
|
export type { GitHubChannelConfig, GitHubChannelDefinition, GitHubChannelHandler, GitHubChannelTrigger, GitHubWebhookPromptEvent, } from "./connectors/github/define.js";
|
|
17
17
|
export type { LangSmithSandboxOptions, SandboxDefinition, SandboxScope, } from "./sandbox.js";
|
|
18
18
|
export type { ManagedDeepAgentRuntime, ManagedRuntimeExtras, } from "./runtime/managed-tools.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EACL,IAAI,EACJ,OAAO,EACP,UAAU,EACV,WAAW,EACX,SAAS,GACV,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,OAAO,EACP,UAAU,EACV,4BAA4B,GAC7B,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACV,YAAY,EACZ,6BAA6B,EAC7B,kBAAkB,EAClB,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,wBAAwB,EACxB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,cAAc,EACd,uBAAuB,EACvB,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,sBAAsB,EACtB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EACL,IAAI,EACJ,OAAO,EACP,UAAU,EACV,WAAW,EACX,SAAS,GACV,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,OAAO,EACP,UAAU,EACV,4BAA4B,GAC7B,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACV,YAAY,EACZ,6BAA6B,EAC7B,kBAAkB,EAClB,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,wBAAwB,EACxB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,cAAc,EACd,uBAAuB,EACvB,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,sBAAsB,EACtB,WAAW,E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@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EACL,IAAI,EACJ,OAAO,EACP,UAAU,EACV,WAAW,EACX,SAAS,GACV,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EACL,IAAI,EACJ,OAAO,EACP,UAAU,EACV,WAAW,EACX,SAAS,GACV,MAAM,iBAAiB,CAAC;AA2FzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC"}
|
package/dist/ingress/index.d.ts
CHANGED
|
@@ -11,11 +11,9 @@ import { type ChannelBinding } from "../channels/binding.js";
|
|
|
11
11
|
export interface SourceThreadExistsInput {
|
|
12
12
|
sourceThreadKey: string;
|
|
13
13
|
userId: string;
|
|
14
|
-
organizationId?: string;
|
|
15
14
|
}
|
|
16
15
|
export interface InvokeIngressAgentInput {
|
|
17
16
|
userId: string;
|
|
18
|
-
organizationId?: string;
|
|
19
17
|
sourceThreadKey: string;
|
|
20
18
|
binding: ChannelBinding;
|
|
21
19
|
text: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ingress/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ingress/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,wBAAwB,CAAC;AAchC,6EAA6E;AAC7E,MAAM,WAAW,uBAAuB;IACtC,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,cAAc,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,cAAc,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;CAC7C;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACzB,OAAO,EAAE;IACP,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;CAChD,GACA,IAAI,CASN;AAED;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,uBAAuB,GAC7B,OAAO,CAAC,OAAO,CAAC,CAiBlB;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,uBAAuB,GAC7B,OAAO,CAAC,wBAAwB,CAAC,CA+CnC;AAuBD,2EAA2E;AAC3E,wBAAgB,cAAc,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAS9D"}
|
package/dist/ingress/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import { extractAssistantText } from "../channels/assistant-text.js";
|
|
|
12
12
|
import { CHANNEL_BINDING_KEY, } from "../channels/binding.js";
|
|
13
13
|
import { ChannelError } from "../channels/errors.js";
|
|
14
14
|
import { resolveLoopbackApiKey, resolveLoopbackApiUrl, } from "../identity/loopback.js";
|
|
15
|
-
import { USER_HEADER, INGRESS_SECRET_ENV, INGRESS_SECRET_HEADER, SOURCE_PROVIDER_HEADER, SOURCE_THREAD_HEADER,
|
|
15
|
+
import { USER_HEADER, INGRESS_SECRET_ENV, INGRESS_SECRET_HEADER, SOURCE_PROVIDER_HEADER, SOURCE_THREAD_HEADER, } from "../runtime/auth.js";
|
|
16
16
|
/**
|
|
17
17
|
* Schedule background work after the provider ACK. Defaults to fire-and-forget
|
|
18
18
|
* with error logging; tests pass an inline runner.
|
|
@@ -39,7 +39,6 @@ export async function ingressSourceThreadExists(input) {
|
|
|
39
39
|
}
|
|
40
40
|
const client = createIngressLoopbackClient({
|
|
41
41
|
userId: input.userId,
|
|
42
|
-
organizationId: input.organizationId,
|
|
43
42
|
sourceThreadKey: input.sourceThreadKey,
|
|
44
43
|
ingressSecret,
|
|
45
44
|
});
|
|
@@ -64,7 +63,6 @@ export async function invokeIngressAgent(input) {
|
|
|
64
63
|
}
|
|
65
64
|
const client = createIngressLoopbackClient({
|
|
66
65
|
userId: input.userId,
|
|
67
|
-
organizationId: input.organizationId,
|
|
68
66
|
sourceThreadKey: input.sourceThreadKey,
|
|
69
67
|
ingressSecret,
|
|
70
68
|
sourceProvider: input.sourceProvider ?? input.binding.provider,
|
|
@@ -105,9 +103,6 @@ function createIngressLoopbackClient(input) {
|
|
|
105
103
|
[SOURCE_PROVIDER_HEADER]: input.sourceProvider ?? "slack",
|
|
106
104
|
[SOURCE_THREAD_HEADER]: input.sourceThreadKey,
|
|
107
105
|
};
|
|
108
|
-
if (input.organizationId) {
|
|
109
|
-
headers[ORGANIZATION_HEADER] = input.organizationId;
|
|
110
|
-
}
|
|
111
106
|
return new Client({
|
|
112
107
|
apiUrl,
|
|
113
108
|
apiKey,
|