@agent-native/dispatch 0.27.3 → 0.27.4
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/actions/create-workspace-resource.d.ts +13 -13
- package/dist/actions/delete-destination.d.ts +12 -12
- package/dist/actions/import-agent.d.ts +13 -13
- package/dist/server/lib/app-creation-store.d.ts.map +1 -1
- package/dist/server/lib/app-creation-store.js +80 -5
- package/dist/server/lib/app-creation-store.js.map +1 -1
- package/dist/server/lib/mcp-gateway.d.ts.map +1 -1
- package/dist/server/lib/mcp-gateway.js +42 -10
- package/dist/server/lib/mcp-gateway.js.map +1 -1
- package/dist/server/lib/workspace-app-action-auth.d.ts +9 -0
- package/dist/server/lib/workspace-app-action-auth.d.ts.map +1 -0
- package/dist/server/lib/workspace-app-action-auth.js +71 -0
- package/dist/server/lib/workspace-app-action-auth.js.map +1 -0
- package/dist/server/plugins/agent-chat.js +3 -0
- package/dist/server/plugins/agent-chat.js.map +1 -1
- package/package.json +2 -2
- package/src/server/lib/app-creation-store.spec.ts +57 -0
- package/src/server/lib/app-creation-store.ts +92 -9
- package/src/server/lib/mcp-gateway.spec.ts +49 -0
- package/src/server/lib/mcp-gateway.ts +34 -5
- package/src/server/lib/workspace-app-action-auth.spec.ts +173 -0
- package/src/server/lib/workspace-app-action-auth.ts +90 -0
- package/src/server/plugins/agent-chat.spec.ts +4 -0
- package/src/server/plugins/agent-chat.ts +6 -0
|
@@ -6,19 +6,6 @@ declare const _default: import("@agent-native/core").ActionDefinition<{
|
|
|
6
6
|
content: string;
|
|
7
7
|
scope: "all" | "selected";
|
|
8
8
|
}, {
|
|
9
|
-
id: string;
|
|
10
|
-
ownerEmail: string;
|
|
11
|
-
orgId: string | null;
|
|
12
|
-
kind: string;
|
|
13
|
-
name: string;
|
|
14
|
-
description: string | null;
|
|
15
|
-
path: string;
|
|
16
|
-
content: string;
|
|
17
|
-
scope: string;
|
|
18
|
-
createdBy: string;
|
|
19
|
-
createdAt: number;
|
|
20
|
-
updatedAt: number;
|
|
21
|
-
} | {
|
|
22
9
|
id: string;
|
|
23
10
|
ownerEmail: string;
|
|
24
11
|
orgId: string | null;
|
|
@@ -35,6 +22,19 @@ declare const _default: import("@agent-native/core").ActionDefinition<{
|
|
|
35
22
|
reviewedAt: number | null;
|
|
36
23
|
createdAt: number;
|
|
37
24
|
updatedAt: number;
|
|
25
|
+
} | {
|
|
26
|
+
id: string;
|
|
27
|
+
ownerEmail: string;
|
|
28
|
+
orgId: string | null;
|
|
29
|
+
kind: string;
|
|
30
|
+
name: string;
|
|
31
|
+
description: string | null;
|
|
32
|
+
path: string;
|
|
33
|
+
content: string;
|
|
34
|
+
scope: string;
|
|
35
|
+
createdBy: string;
|
|
36
|
+
createdAt: number;
|
|
37
|
+
updatedAt: number;
|
|
38
38
|
}>;
|
|
39
39
|
export default _default;
|
|
40
40
|
//# sourceMappingURL=create-workspace-resource.d.ts.map
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
declare const _default: import("@agent-native/core").ActionDefinition<{
|
|
2
2
|
id: string;
|
|
3
3
|
}, {
|
|
4
|
+
id: string;
|
|
5
|
+
ownerEmail: string;
|
|
6
|
+
orgId: string | null;
|
|
7
|
+
name: string;
|
|
8
|
+
platform: string;
|
|
9
|
+
destination: string;
|
|
10
|
+
threadRef: string | null;
|
|
11
|
+
notes: string | null;
|
|
12
|
+
createdBy: string;
|
|
13
|
+
createdAt: number;
|
|
14
|
+
updatedAt: number;
|
|
15
|
+
} | {
|
|
4
16
|
id: string;
|
|
5
17
|
ownerEmail: string;
|
|
6
18
|
orgId: string | null;
|
|
@@ -17,18 +29,6 @@ declare const _default: import("@agent-native/core").ActionDefinition<{
|
|
|
17
29
|
reviewedAt: number | null;
|
|
18
30
|
createdAt: number;
|
|
19
31
|
updatedAt: number;
|
|
20
|
-
} | {
|
|
21
|
-
id: string;
|
|
22
|
-
ownerEmail: string;
|
|
23
|
-
orgId: string | null;
|
|
24
|
-
name: string;
|
|
25
|
-
platform: string;
|
|
26
|
-
destination: string;
|
|
27
|
-
threadRef: string | null;
|
|
28
|
-
notes: string | null;
|
|
29
|
-
createdBy: string;
|
|
30
|
-
createdAt: number;
|
|
31
|
-
updatedAt: number;
|
|
32
32
|
}>;
|
|
33
33
|
export default _default;
|
|
34
34
|
//# sourceMappingURL=delete-destination.d.ts.map
|
|
@@ -23,6 +23,19 @@ declare const _default: import("@agent-native/core").ActionDefinition<{
|
|
|
23
23
|
} | {
|
|
24
24
|
status: "created";
|
|
25
25
|
resource: {
|
|
26
|
+
id: string;
|
|
27
|
+
ownerEmail: string;
|
|
28
|
+
orgId: string | null;
|
|
29
|
+
kind: string;
|
|
30
|
+
name: string;
|
|
31
|
+
description: string | null;
|
|
32
|
+
path: string;
|
|
33
|
+
content: string;
|
|
34
|
+
scope: string;
|
|
35
|
+
createdBy: string;
|
|
36
|
+
createdAt: number;
|
|
37
|
+
updatedAt: number;
|
|
38
|
+
} | {
|
|
26
39
|
id: string;
|
|
27
40
|
ownerEmail: string;
|
|
28
41
|
orgId: string | null;
|
|
@@ -39,19 +52,6 @@ declare const _default: import("@agent-native/core").ActionDefinition<{
|
|
|
39
52
|
reviewedAt: number | null;
|
|
40
53
|
createdAt: number;
|
|
41
54
|
updatedAt: number;
|
|
42
|
-
} | {
|
|
43
|
-
id: string;
|
|
44
|
-
ownerEmail: string;
|
|
45
|
-
orgId: string | null;
|
|
46
|
-
kind: string;
|
|
47
|
-
name: string;
|
|
48
|
-
description: string | null;
|
|
49
|
-
path: string;
|
|
50
|
-
content: string;
|
|
51
|
-
scope: string;
|
|
52
|
-
createdBy: string;
|
|
53
|
-
createdAt: number;
|
|
54
|
-
updatedAt: number;
|
|
55
55
|
};
|
|
56
56
|
source: "claude" | "json" | "markdown";
|
|
57
57
|
warnings: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-creation-store.d.ts","sourceRoot":"","sources":["../../../src/server/lib/app-creation-store.ts"],"names":[],"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,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAmM3C"}
|
|
@@ -2,13 +2,16 @@ import { spawn } from "node:child_process";
|
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { signA2AToken } from "@agent-native/core/a2a";
|
|
5
6
|
import { getDbExec } from "@agent-native/core/db";
|
|
7
|
+
import { getOrgA2ASecret, getOrgDomain } from "@agent-native/core/org";
|
|
6
8
|
import { ensureBuilderProject, getBuilderBranchProjectId, getRequestContext, isIntegrationCallerRequest, resolveBuilderCredentialsDetailed, runBuilderAgent, } from "@agent-native/core/server";
|
|
7
9
|
import { getSetting, putSetting } from "@agent-native/core/settings";
|
|
8
10
|
import { assertValidWorkspaceAppId } from "@agent-native/core/shared";
|
|
9
11
|
import { identityKeyForIncoming } from "./dispatch-integrations.js";
|
|
10
12
|
import { currentOrgId, currentOwnerEmail, recordAudit, resolveLinkedOwner, } from "./dispatch-store.js";
|
|
11
13
|
import { createRequest, listSecretOptions } from "./vault-store.js";
|
|
14
|
+
import { WORKSPACE_APPS_ACTION_PATH } from "./workspace-app-action-auth.js";
|
|
12
15
|
import { grantWorkspaceResourcesToApp, listWorkspaceResourceOptions, } from "./workspace-resources-store.js";
|
|
13
16
|
const SETTINGS_KEY = "dispatch-app-creation-settings";
|
|
14
17
|
const BUILDER_WORKSPACE_REPO_URL_ENV = "AGENT_NATIVE_WORKSPACE_REPO_URL";
|
|
@@ -20,7 +23,7 @@ const WORKSPACE_APP_METADATA_SETTINGS_KEY = "workspace-app-metadata";
|
|
|
20
23
|
const WORKSPACE_APPS_ENV_KEY = "AGENT_NATIVE_WORKSPACE_APPS_JSON";
|
|
21
24
|
const WORKSPACE_APPS_MANIFEST_FILE = "workspace-apps.json";
|
|
22
25
|
const WORKSPACE_APPS_GATEWAY_PATH = "/_workspace/apps";
|
|
23
|
-
const WORKSPACE_APPS_GATEWAY_TIMEOUT_MS =
|
|
26
|
+
const WORKSPACE_APPS_GATEWAY_TIMEOUT_MS = 2_500;
|
|
24
27
|
const MAX_PENDING_APPS = 50;
|
|
25
28
|
const PENDING_WORKSPACE_APP_TTL_MS = 7 * 24 * 60 * 60 * 1_000;
|
|
26
29
|
const AGENT_CARD_PATH = "/.well-known/agent-card.json";
|
|
@@ -787,16 +790,88 @@ async function readWorkspaceAppsFromGateway() {
|
|
|
787
790
|
const base = process.env.WORKSPACE_GATEWAY_URL;
|
|
788
791
|
if (!base)
|
|
789
792
|
return null;
|
|
793
|
+
let baseUrl;
|
|
794
|
+
try {
|
|
795
|
+
baseUrl = new URL(base);
|
|
796
|
+
}
|
|
797
|
+
catch {
|
|
798
|
+
// coercion-ok: malformed gateway configuration is an unavailable registry
|
|
799
|
+
// and falls back to local sources.
|
|
800
|
+
return null;
|
|
801
|
+
}
|
|
802
|
+
if (baseUrl.protocol !== "http:" && baseUrl.protocol !== "https:") {
|
|
803
|
+
return null;
|
|
804
|
+
}
|
|
790
805
|
const controller = new AbortController();
|
|
791
806
|
const timeout = setTimeout(() => controller.abort(), WORKSPACE_APPS_GATEWAY_TIMEOUT_MS);
|
|
807
|
+
const requestContext = getRequestContext();
|
|
808
|
+
const authHeaders = {};
|
|
809
|
+
if (requestContext?.userEmail) {
|
|
810
|
+
const [orgDomain, orgSecret] = requestContext.orgId
|
|
811
|
+
? await Promise.all([
|
|
812
|
+
// coercion-ok: an unavailable org row falls back to the deployment secret.
|
|
813
|
+
getOrgDomain(requestContext.orgId).catch(() => null),
|
|
814
|
+
// coercion-ok: an unavailable org row falls back to the deployment secret.
|
|
815
|
+
getOrgA2ASecret(requestContext.orgId).catch(() => null),
|
|
816
|
+
])
|
|
817
|
+
: [null, null];
|
|
818
|
+
const usableOrgSecret = typeof orgSecret === "string" && orgSecret.trim().length > 0;
|
|
819
|
+
const usableOrgDomain = typeof orgDomain === "string" && orgDomain.trim().length > 0;
|
|
820
|
+
try {
|
|
821
|
+
const token = await signA2AToken(requestContext.userEmail, usableOrgDomain ? orgDomain.trim() : undefined, usableOrgSecret ? orgSecret.trim() : undefined, {
|
|
822
|
+
expiresIn: "1m",
|
|
823
|
+
// The workspace registry is an authenticated read. Prefer the
|
|
824
|
+
// shared deployment secret so a registry read does not depend on
|
|
825
|
+
// every app having the same org row.
|
|
826
|
+
preferGlobalSecret: true,
|
|
827
|
+
});
|
|
828
|
+
authHeaders.Authorization = `Bearer ${token}`;
|
|
829
|
+
}
|
|
830
|
+
catch {
|
|
831
|
+
// coercion-ok: absent signing credentials keep local unauthenticated
|
|
832
|
+
// gateway discovery available and make hosted discovery fail closed.
|
|
833
|
+
// Keep the unauthenticated local-dev gateway path available. A hosted
|
|
834
|
+
// gateway will fail closed below when its action route needs identity.
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
const gatewayUrl = (pathname) => {
|
|
838
|
+
const url = new URL(baseUrl.toString());
|
|
839
|
+
const basePath = url.pathname.replace(/\/+$/, "");
|
|
840
|
+
url.pathname = `${basePath}${pathname}` || "/";
|
|
841
|
+
url.search = "";
|
|
842
|
+
url.hash = "";
|
|
843
|
+
return url;
|
|
844
|
+
};
|
|
845
|
+
const headers = {
|
|
846
|
+
accept: "application/json",
|
|
847
|
+
...authHeaders,
|
|
848
|
+
};
|
|
792
849
|
try {
|
|
793
|
-
const
|
|
794
|
-
headers
|
|
850
|
+
const localResponse = await fetch(gatewayUrl(WORKSPACE_APPS_GATEWAY_PATH), {
|
|
851
|
+
headers,
|
|
852
|
+
signal: controller.signal,
|
|
853
|
+
});
|
|
854
|
+
if (localResponse.ok) {
|
|
855
|
+
return parseWorkspaceAppsManifest(
|
|
856
|
+
// coercion-ok: malformed gateway JSON is an unavailable registry and
|
|
857
|
+
// must fall through to the local manifest sources.
|
|
858
|
+
await localResponse.json().catch(() => null));
|
|
859
|
+
}
|
|
860
|
+
if (!authHeaders.Authorization)
|
|
861
|
+
return null;
|
|
862
|
+
const actionUrl = gatewayUrl(WORKSPACE_APPS_ACTION_PATH);
|
|
863
|
+
actionUrl.searchParams.set("includeAgentCards", "false");
|
|
864
|
+
actionUrl.searchParams.set("audience", "all");
|
|
865
|
+
const actionResponse = await fetch(actionUrl, {
|
|
866
|
+
headers,
|
|
795
867
|
signal: controller.signal,
|
|
796
868
|
});
|
|
797
|
-
if (!
|
|
869
|
+
if (!actionResponse.ok)
|
|
798
870
|
return null;
|
|
799
|
-
return parseWorkspaceAppsManifest(
|
|
871
|
+
return parseWorkspaceAppsManifest(
|
|
872
|
+
// coercion-ok: malformed gateway JSON is an unavailable registry and
|
|
873
|
+
// must fall through to the local manifest sources.
|
|
874
|
+
await actionResponse.json().catch(() => null));
|
|
800
875
|
}
|
|
801
876
|
catch {
|
|
802
877
|
return null;
|