@agent-native/dispatch 0.37.0 → 0.37.1-nightly-20260916013955
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-workspace-resource.d.ts +13 -13
- package/dist/actions/import-agent.d.ts +13 -13
- package/dist/actions/list-connected-agents.d.ts +1 -0
- package/dist/actions/provider-api-register.d.ts +8 -8
- package/dist/components/app-icon.d.ts.map +1 -1
- package/dist/components/app-icon.js +0 -1
- package/dist/components/app-icon.js.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.js.map +1 -1
- package/dist/shared/workspace-sso.d.ts +0 -1
- package/dist/shared/workspace-sso.d.ts.map +1 -1
- package/dist/shared/workspace-sso.js +0 -1
- package/dist/shared/workspace-sso.js.map +1 -1
- package/package.json +4 -4
- package/src/components/app-icon.tsx +0 -1
- package/src/config.ts +1 -1
- package/src/shared/workspace-sso.ts +0 -1
|
@@ -6,6 +6,19 @@ declare const _default: import("@agent-native/core/action").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
|
+
} | {
|
|
9
22
|
id: string;
|
|
10
23
|
ownerEmail: string;
|
|
11
24
|
orgId: string | null;
|
|
@@ -22,19 +35,6 @@ declare const _default: import("@agent-native/core/action").ActionDefinition<{
|
|
|
22
35
|
reviewedAt: number | null;
|
|
23
36
|
createdAt: number;
|
|
24
37
|
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,19 +1,6 @@
|
|
|
1
1
|
declare const _default: import("@agent-native/core/action").ActionDefinition<{
|
|
2
2
|
id: string;
|
|
3
3
|
}, {
|
|
4
|
-
id: string;
|
|
5
|
-
ownerEmail: string;
|
|
6
|
-
orgId: string | null;
|
|
7
|
-
kind: string;
|
|
8
|
-
name: string;
|
|
9
|
-
description: string | null;
|
|
10
|
-
path: string;
|
|
11
|
-
content: string;
|
|
12
|
-
scope: string;
|
|
13
|
-
createdBy: string;
|
|
14
|
-
createdAt: number;
|
|
15
|
-
updatedAt: number;
|
|
16
|
-
} | {
|
|
17
4
|
id: string;
|
|
18
5
|
ownerEmail: string;
|
|
19
6
|
orgId: string | null;
|
|
@@ -30,6 +17,19 @@ declare const _default: import("@agent-native/core/action").ActionDefinition<{
|
|
|
30
17
|
reviewedAt: number | null;
|
|
31
18
|
createdAt: number;
|
|
32
19
|
updatedAt: number;
|
|
20
|
+
} | {
|
|
21
|
+
id: string;
|
|
22
|
+
ownerEmail: string;
|
|
23
|
+
orgId: string | null;
|
|
24
|
+
kind: string;
|
|
25
|
+
name: string;
|
|
26
|
+
description: string | null;
|
|
27
|
+
path: string;
|
|
28
|
+
content: string;
|
|
29
|
+
scope: string;
|
|
30
|
+
createdBy: string;
|
|
31
|
+
createdAt: number;
|
|
32
|
+
updatedAt: number;
|
|
33
33
|
}>;
|
|
34
34
|
export default _default;
|
|
35
35
|
//# sourceMappingURL=delete-workspace-resource.d.ts.map
|
|
@@ -23,19 +23,6 @@ declare const _default: import("@agent-native/core/action").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
|
-
} | {
|
|
39
26
|
id: string;
|
|
40
27
|
ownerEmail: string;
|
|
41
28
|
orgId: string | null;
|
|
@@ -52,6 +39,19 @@ declare const _default: import("@agent-native/core/action").ActionDefinition<{
|
|
|
52
39
|
reviewedAt: number | null;
|
|
53
40
|
createdAt: number;
|
|
54
41
|
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[];
|
|
@@ -6,6 +6,7 @@ declare const _default: import("@agent-native/core/action").ActionDefinition<Rec
|
|
|
6
6
|
color: string;
|
|
7
7
|
cardUrl?: string;
|
|
8
8
|
auth?: import("@agent-native/core/resources/metadata").RemoteAgentAuth;
|
|
9
|
+
kind?: import("@agent-native/core/resources/metadata").RemoteAgentKind;
|
|
9
10
|
homeUrl?: string | undefined;
|
|
10
11
|
source: string;
|
|
11
12
|
resourceId: string | undefined;
|
|
@@ -47,6 +47,7 @@ declare const _default: import("node_modules/@agent-native/core/dist").ActionDef
|
|
|
47
47
|
notes?: string | undefined;
|
|
48
48
|
scope?: "org" | "user" | undefined;
|
|
49
49
|
}, {
|
|
50
|
+
message?: undefined;
|
|
50
51
|
id?: undefined;
|
|
51
52
|
deleted?: undefined;
|
|
52
53
|
providers: {
|
|
@@ -63,41 +64,40 @@ declare const _default: import("node_modules/@agent-native/core/dist").ActionDef
|
|
|
63
64
|
found?: undefined;
|
|
64
65
|
registered?: undefined;
|
|
65
66
|
label?: undefined;
|
|
66
|
-
message?: undefined;
|
|
67
67
|
} | {
|
|
68
|
+
message?: undefined;
|
|
68
69
|
id?: undefined;
|
|
69
|
-
count?: undefined;
|
|
70
70
|
deleted?: undefined;
|
|
71
71
|
providers?: undefined;
|
|
72
|
+
count?: undefined;
|
|
72
73
|
found: boolean;
|
|
73
74
|
provider: import("node_modules/@agent-native/core/dist/provider-api").CustomProviderConfig;
|
|
74
75
|
registered?: undefined;
|
|
75
76
|
label?: undefined;
|
|
76
|
-
message?: undefined;
|
|
77
77
|
} | {
|
|
78
|
-
|
|
78
|
+
message?: undefined;
|
|
79
79
|
deleted?: undefined;
|
|
80
80
|
providers?: undefined;
|
|
81
|
+
count?: undefined;
|
|
81
82
|
provider?: undefined;
|
|
82
83
|
found: boolean;
|
|
83
84
|
id: string;
|
|
84
85
|
registered?: undefined;
|
|
85
86
|
label?: undefined;
|
|
86
|
-
message?: undefined;
|
|
87
87
|
} | {
|
|
88
|
-
|
|
88
|
+
message?: undefined;
|
|
89
89
|
providers?: undefined;
|
|
90
|
+
count?: undefined;
|
|
90
91
|
provider?: undefined;
|
|
91
92
|
found?: undefined;
|
|
92
93
|
deleted: boolean;
|
|
93
94
|
id: string;
|
|
94
95
|
registered?: undefined;
|
|
95
96
|
label?: undefined;
|
|
96
|
-
message?: undefined;
|
|
97
97
|
} | {
|
|
98
|
-
count?: undefined;
|
|
99
98
|
deleted?: undefined;
|
|
100
99
|
providers?: undefined;
|
|
100
|
+
count?: undefined;
|
|
101
101
|
provider?: undefined;
|
|
102
102
|
found?: undefined;
|
|
103
103
|
registered: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-icon.d.ts","sourceRoot":"","sources":["../../src/components/app-icon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-icon.d.ts","sourceRoot":"","sources":["../../src/components/app-icon.tsx"],"names":[],"mappings":"AAiHA,wBAAgB,OAAO,CAAC,EACtB,EAAE,EACF,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,SAAS,EACT,IAAW,EACX,UAAkB,GACnB,EAAE;IACD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,mDAqCA"}
|
|
@@ -38,7 +38,6 @@ const APP_VISUALS_BY_ID = {
|
|
|
38
38
|
dispatch: { icon: IconRoute, colorRgb: "20 184 166" },
|
|
39
39
|
factory: { icon: IconUsers, colorRgb: "124 58 237" },
|
|
40
40
|
forms: { icon: IconClipboardList, colorRgb: "6 182 212" },
|
|
41
|
-
macros: { icon: IconCode, colorRgb: "113 113 122" },
|
|
42
41
|
mail: { icon: IconMail, colorRgb: "59 130 246" },
|
|
43
42
|
plan: { icon: IconLayoutBoard, colorRgb: "47 111 237" },
|
|
44
43
|
slides: { icon: IconPresentation, colorRgb: "236 72 153" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-icon.js","sourceRoot":"","sources":["../../src/components/app-icon.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,eAAe,EACf,aAAa,EACb,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,eAAe,EACf,aAAa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U,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,YAErC,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,WAAW,EAAE,GAAG,GAAI,GACpD,CACR,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,EAAU,EAAE,IAAY;IAC1C,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,MAAM,SAAS,IAAI,GAAG,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC;QACxC,IAAI,GAAG,CAAC,IAAI,GAAG,EAAE,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,MAAM,CAAC,EAAU,EAAE,IAAY;IACtC,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import {\n IconBrain,\n IconBrandChrome,\n IconBrandJira,\n IconBrush,\n IconCalendar,\n IconChartBar,\n IconClipboardList,\n IconCode,\n IconFileText,\n IconFolder,\n IconLayoutBoard,\n IconListCheck,\n IconMail,\n IconMessageCircle,\n IconPhoto,\n IconPresentation,\n IconRoute,\n IconVideoPlus,\n IconSettings,\n IconStack2,\n IconUsers,\n} from \"@tabler/icons-react\";\nimport type { CSSProperties } from \"react\";\n\nimport { cn } from \"../lib/utils\";\n\ntype AppIconComponent = typeof IconStack2;\n\nconst ICONS_BY_KEY: Record<string, AppIconComponent> = {\n barchart2: IconChartBar,\n brandjira: IconBrandJira,\n brain: IconBrain,\n calendardays: IconCalendar,\n calendarmonth: IconCalendar,\n chartbar: IconChartBar,\n code: IconCode,\n filetext: IconFileText,\n folder: IconFolder,\n galleryhorizontal: IconPresentation,\n globe: IconBrandChrome,\n layoutboard: IconLayoutBoard,\n listcheck: IconListCheck,\n mail: IconMail,\n messagecircle: IconMessageCircle,\n photo: IconPhoto,\n presentation: IconPresentation,\n route: IconRoute,\n settings: IconSettings,\n stack2: IconStack2,\n users: IconUsers,\n};\n\n/** Keep the Dispatch rail visually identical to the desktop app for first-party apps. */\nconst APP_VISUALS_BY_ID: Record<\n string,\n { icon: AppIconComponent; colorRgb: string }\n> = {\n analytics: { icon: IconChartBar, colorRgb: \"245 158 11\" },\n assets: { icon: IconPhoto, colorRgb: \"15 118 110\" },\n brain: { icon: IconBrain, colorRgb: \"139 92 246\" },\n calendar: { icon: IconCalendar, colorRgb: \"0 181 255\" },\n chat: { icon: IconMessageCircle, colorRgb: \"24 24 27\" },\n clips: { icon: IconVideoPlus, colorRgb: \"14 165 233\" },\n content: { icon: IconFileText, colorRgb: \"16 185 129\" },\n crm: { icon: IconUsers, colorRgb: \"37 99 235\" },\n design: { icon: IconBrush, colorRgb: \"244 114 182\" },\n dispatch: { icon: IconRoute, colorRgb: \"20 184 166\" },\n factory: { icon: IconUsers, colorRgb: \"124 58 237\" },\n forms: { icon: IconClipboardList, colorRgb: \"6 182 212\" },\n mail: { icon: IconMail, colorRgb: \"59 130 246\" },\n plan: { icon: IconLayoutBoard, colorRgb: \"47 111 237\" },\n slides: { icon: IconPresentation, colorRgb: \"236 72 153\" },\n tasks: { icon: IconListCheck, colorRgb: \"99 102 241\" },\n};\n\nfunction appIconComponent(\n id: string,\n name: string,\n iconKey?: string,\n): AppIconComponent {\n const normalizedIconKey = iconKey?.trim().toLowerCase();\n if (normalizedIconKey && ICONS_BY_KEY[normalizedIconKey]) {\n return ICONS_BY_KEY[normalizedIconKey];\n }\n\n const standardVisuals = APP_VISUALS_BY_ID[id.trim().toLowerCase()];\n if (standardVisuals) return standardVisuals.icon;\n\n const haystack = `${id} ${name}`.toLowerCase();\n\n if (haystack.includes(\"mail\") || haystack.includes(\"email\")) {\n return IconMail;\n }\n if (\n haystack.includes(\"analytics\") ||\n haystack.includes(\"metric\") ||\n haystack.includes(\"indicator\") ||\n haystack.includes(\"gtm\")\n ) {\n return IconChartBar;\n }\n if (haystack.includes(\"coach\") || haystack.includes(\"agent\")) {\n return IconBrain;\n }\n return IconStack2;\n}\n\nfunction safeHexColor(color: string | undefined): string | null {\n const normalized = color?.trim();\n return normalized && /^#[0-9a-f]{6}$/i.test(normalized) ? normalized : null;\n}\n\nexport function AppIcon({\n id,\n name,\n icon,\n color,\n className,\n size = \"md\",\n monochrome = false,\n}: {\n id: string;\n name: string;\n icon?: string;\n color?: string;\n className?: string;\n size?: \"sm\" | \"md\";\n monochrome?: boolean;\n}) {\n const Icon = appIconComponent(id, name, icon);\n const customColor = safeHexColor(color);\n const standardColorRgb = APP_VISUALS_BY_ID[id.trim().toLowerCase()]?.colorRgb;\n const style = customColor\n ? ({\n \"--dispatch-app-icon-color\": customColor,\n backgroundColor:\n \"color-mix(in srgb, var(--dispatch-app-icon-color) 14%, transparent)\",\n color: \"var(--dispatch-app-icon-color)\",\n } as CSSProperties)\n : standardColorRgb\n ? ({\n \"--dispatch-app-icon-color-rgb\": standardColorRgb,\n backgroundColor: \"rgb(var(--dispatch-app-icon-color-rgb) / 0.14)\",\n color: \"rgb(var(--dispatch-app-icon-color-rgb))\",\n } as CSSProperties)\n : ({\n \"--dispatch-app-icon-hue\": `${appHue(id, name)} 72% 44%`,\n backgroundColor: \"hsl(var(--dispatch-app-icon-hue) / 0.14)\",\n color: \"hsl(var(--dispatch-app-icon-hue))\",\n } as CSSProperties);\n\n return (\n <span\n aria-hidden=\"true\"\n className={cn(\n \"flex shrink-0 items-center justify-center rounded-lg\",\n size === \"sm\" ? \"size-7\" : \"size-10\",\n monochrome && \"bg-transparent text-sidebar-foreground/70\",\n className,\n )}\n style={monochrome ? undefined : style}\n >\n <Icon size={size === \"sm\" ? 15 : 19} strokeWidth={1.8} />\n </span>\n );\n}\n\nfunction hashForApp(id: string, name: string): number {\n let hash = 0;\n for (const character of `${id}:${name}`) {\n hash = (hash * 31 + character.charCodeAt(0)) | 0;\n }\n return hash;\n}\n\nfunction appHue(id: string, name: string): number {\n return 20 + (Math.abs(hashForApp(id, name)) % 320);\n}\n"]}
|
package/dist/config.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export interface DispatchConfig {
|
|
|
31
31
|
browserExtensionIds?: readonly string[];
|
|
32
32
|
/**
|
|
33
33
|
* App IDs to hide from `list-connected-agents` results. Used to filter
|
|
34
|
-
* out first-party Builder apps (calls, issues,
|
|
34
|
+
* out first-party Builder apps (calls, issues, …) from the
|
|
35
35
|
* Connected Agents list when those apps aren't shipped to end users.
|
|
36
36
|
*/
|
|
37
37
|
hiddenAgentIds?: string[];
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG","sourcesContent":["/**\n * Configuration shape for `setupDispatch(config)`. Captures every workspace\n * customization point we identified during the framework→workspace drift\n * audit so consumers can express their environment without forking source.\n */\n\nexport interface DispatchAuthConfig {\n /**\n * When true, only Google OAuth is shown on the login screen and other\n * providers are hidden. Used by Builder's own workspace, which enforces\n * Google SSO for its org.\n */\n googleOnly?: boolean;\n /** Marketing/branding copy passed straight through to `createAuthPlugin`. */\n marketing?: Record<string, unknown>;\n /** Exact framework routes that perform their own authentication checks. */\n publicPaths?: string[];\n}\n\nexport interface DispatchIntegrationsConfig {\n /**\n * Append or replace the integrations agent's system-prompt guidance.\n * Pass a string to replace the default; pass a function to mutate it.\n */\n systemPrompt?: string | ((defaultPrompt: string) => string);\n}\n\nexport interface DispatchConfig {\n auth?: DispatchAuthConfig;\n /**\n * Exact Chrome Web Store or managed-install extension ids allowed to pair\n * with Dispatch browser chat. Wildcards are not supported.\n */\n browserExtensionIds?: readonly string[];\n /**\n * App IDs to hide from `list-connected-agents` results. Used to filter\n * out first-party Builder apps (calls, issues,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG","sourcesContent":["/**\n * Configuration shape for `setupDispatch(config)`. Captures every workspace\n * customization point we identified during the framework→workspace drift\n * audit so consumers can express their environment without forking source.\n */\n\nexport interface DispatchAuthConfig {\n /**\n * When true, only Google OAuth is shown on the login screen and other\n * providers are hidden. Used by Builder's own workspace, which enforces\n * Google SSO for its org.\n */\n googleOnly?: boolean;\n /** Marketing/branding copy passed straight through to `createAuthPlugin`. */\n marketing?: Record<string, unknown>;\n /** Exact framework routes that perform their own authentication checks. */\n publicPaths?: string[];\n}\n\nexport interface DispatchIntegrationsConfig {\n /**\n * Append or replace the integrations agent's system-prompt guidance.\n * Pass a string to replace the default; pass a function to mutate it.\n */\n systemPrompt?: string | ((defaultPrompt: string) => string);\n}\n\nexport interface DispatchConfig {\n auth?: DispatchAuthConfig;\n /**\n * Exact Chrome Web Store or managed-install extension ids allowed to pair\n * with Dispatch browser chat. Wildcards are not supported.\n */\n browserExtensionIds?: readonly string[];\n /**\n * App IDs to hide from `list-connected-agents` results. Used to filter\n * out first-party Builder apps (calls, issues, …) from the\n * Connected Agents list when those apps aren't shipped to end users.\n */\n hiddenAgentIds?: string[];\n integrations?: DispatchIntegrationsConfig;\n}\n"]}
|
|
@@ -14,7 +14,6 @@ export declare const CANONICAL_WORKSPACE_SSO_APP_ORIGINS: {
|
|
|
14
14
|
readonly dispatch: "https://dispatch.agent-native.com";
|
|
15
15
|
readonly factory: "https://factory.agent-native.com";
|
|
16
16
|
readonly forms: "https://forms.agent-native.com";
|
|
17
|
-
readonly macros: "https://macros.agent-native.com";
|
|
18
17
|
readonly mail: "https://mail.agent-native.com";
|
|
19
18
|
readonly plan: "https://plan.agent-native.com";
|
|
20
19
|
readonly slides: "https://slides.agent-native.com";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-sso.d.ts","sourceRoot":"","sources":["../../src/shared/workspace-sso.ts"],"names":[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AAG,MAAM,CAAC;AAEzD,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,OAAO,2BAA2B,CAAC;CAClD;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAwBnE;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,CAC/C,GAAG,EAAE,OAAO,GACX,2BAA2B,EAAE,CA6C/B;AA4CD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,EAClC,OAAO,GAAE;IACP,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,2BAA2B,CAAC;CAC1C,GACL,OAAO,CAgCT"}
|
|
@@ -15,7 +15,6 @@ export const CANONICAL_WORKSPACE_SSO_APP_ORIGINS = {
|
|
|
15
15
|
dispatch: "https://dispatch.agent-native.com",
|
|
16
16
|
factory: "https://factory.agent-native.com",
|
|
17
17
|
forms: "https://forms.agent-native.com",
|
|
18
|
-
macros: "https://macros.agent-native.com",
|
|
19
18
|
mail: "https://mail.agent-native.com",
|
|
20
19
|
plan: "https://plan.agent-native.com",
|
|
21
20
|
slides: "https://slides.agent-native.com",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-sso.js","sourceRoot":"","sources":["../../src/shared/workspace-sso.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,2BAA2B,EAAE,CAAC;AAEvC,+EAA+E;AAC/E,MAAM,CAAC,MAAM,mCAAmC,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AAK,IAAI,YAAY,CAAC,MAAM,KAAK,MAAM,CACjE,CAAC;AACJ,CAAC","sourcesContent":["import { resolveEnvironmentTargets } from \"@agent-native/core/shared\";\n\nimport { DISPATCH_WORKSPACE_SSO_FLAG } from \"./feature-flags.js\";\n\nexport { DISPATCH_WORKSPACE_SSO_FLAG };\n\n/** Exact first-party origins. Never replace this with a suffix or wildcard. */\nexport const CANONICAL_WORKSPACE_SSO_APP_ORIGINS = {\n analytics: \"https://analytics.agent-native.com\",\n assets: \"https://assets.agent-native.com\",\n brain: \"https://brain.agent-native.com\",\n calendar: \"https://calendar.agent-native.com\",\n chat: \"https://chat.agent-native.com\",\n clips: \"https://clips.agent-native.com\",\n content: \"https://content.agent-native.com\",\n crm: \"https://crm.agent-native.com\",\n design: \"https://design.agent-native.com\",\n dispatch: \"https://dispatch.agent-native.com\",\n factory: \"https://factory.agent-native.com\",\n forms: \"https://forms.agent-native.com\",\n macros: \"https://macros.agent-native.com\",\n mail: \"https://mail.agent-native.com\",\n plan: \"https://plan.agent-native.com\",\n slides: \"https://slides.agent-native.com\",\n tasks: \"https://tasks.agent-native.com\",\n} as const;\n\nexport const WORKSPACE_SSO_CALLBACK_PATH =\n \"/_agent-native/identity/callback\" as const;\n\nconst CONTROL_CHARS = /[\\u0000-\\u001f\\u007f]/;\nconst APP_ID = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;\nconst CLIENT_ID = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/;\nconst LOCALHOST_HOSTS = new Set([\"localhost\", \"127.0.0.1\", \"[::1]\", \"::1\"]);\ntype WorkspaceSsoEnvironmentLane = \"production\" | \"beta\";\n\nexport interface WorkspaceSsoAppRegistration {\n appId: string;\n clientId: string;\n origin: string;\n callbackPath: typeof WORKSPACE_SSO_CALLBACK_PATH;\n}\n\nexport function exactWorkspaceSsoOrigin(raw: unknown): string | null {\n if (typeof raw !== \"string\" || !raw || CONTROL_CHARS.test(raw)) return null;\n try {\n const url = new URL(raw);\n if (\n url.protocol !== \"https:\" &&\n !(url.protocol === \"http:\" && LOCALHOST_HOSTS.has(url.hostname))\n ) {\n return null;\n }\n if (\n url.username ||\n url.password ||\n url.pathname !== \"/\" ||\n url.search ||\n url.hash\n ) {\n return null;\n }\n return url.origin;\n } catch {\n // coercion-ok: malformed registry origins are rejected as absent.\n return null;\n }\n}\n\n/**\n * Parse the same additive custom registry used by browser identity SSO. The\n * raw value is passed in so this shared module stays safe to import in the\n * browser bundle.\n */\nexport function parseWorkspaceSsoAppRegistrations(\n raw: unknown,\n): WorkspaceSsoAppRegistration[] {\n if (typeof raw !== \"string\" || !raw.trim()) return [];\n let value: unknown;\n try {\n value = JSON.parse(raw);\n } catch {\n // coercion-ok: malformed custom registry data must fail closed.\n return [];\n }\n if (!Array.isArray(value)) return [];\n\n const registrations: WorkspaceSsoAppRegistration[] = [];\n const seen = new Set<string>();\n for (const entry of value) {\n if (!entry || typeof entry !== \"object\") continue;\n const candidate = entry as Record<string, unknown>;\n const appId = candidate.appId;\n const clientId = candidate.clientId;\n const origin = exactWorkspaceSsoOrigin(candidate.origin);\n if (\n typeof appId !== \"string\" ||\n !APP_ID.test(appId) ||\n typeof clientId !== \"string\" ||\n !CLIENT_ID.test(clientId) ||\n !origin ||\n candidate.callbackPath !== WORKSPACE_SSO_CALLBACK_PATH ||\n !Array.isArray(candidate.capabilities) ||\n !candidate.capabilities.includes(\"identity-sso\") ||\n seen.has(appId) ||\n Object.prototype.hasOwnProperty.call(\n CANONICAL_WORKSPACE_SSO_APP_ORIGINS,\n appId,\n )\n ) {\n continue;\n }\n seen.add(appId);\n registrations.push({\n appId,\n clientId,\n origin,\n callbackPath: WORKSPACE_SSO_CALLBACK_PATH,\n });\n }\n return registrations;\n}\n\nfunction appOrigin(rawUrl: unknown): string | null {\n if (typeof rawUrl !== \"string\" || !rawUrl.trim()) return null;\n try {\n const url = new URL(rawUrl.trim());\n return url.protocol === \"http:\" || url.protocol === \"https:\"\n ? url.origin\n : null;\n } catch {\n // coercion-ok: malformed app metadata is not eligible for workspace SSO.\n return null;\n }\n}\n\nfunction isLoopbackOrigin(origin: string): boolean {\n try {\n return LOCALHOST_HOSTS.has(new URL(origin).hostname);\n } catch {\n // coercion-ok: only a previously parsed origin reaches this helper.\n return false;\n }\n}\n\nfunction isCanonicalWorkspaceSsoOrigin(\n origin: string,\n canonicalOrigin: string,\n environmentLane: WorkspaceSsoEnvironmentLane,\n): boolean {\n if (origin === canonicalOrigin) return true;\n if (environmentLane !== \"beta\") return false;\n\n try {\n const targets = resolveEnvironmentTargets(\n new URL(canonicalOrigin).hostname,\n );\n return targets ? origin === `https://${targets.betaHost}` : false;\n } catch {\n // coercion-ok: canonical origins are static metadata, so malformed values\n // are rejected as non-canonical.\n return false;\n }\n}\n\n/**\n * Keep the server-side app catalog and the browser's action choice on the\n * same exact-origin rules. `registryRaw` is deliberately supplied by the\n * caller so this shared module never reads process or browser environment.\n */\nexport function isWorkspaceSsoAppUrl(\n app: { id: string; url?: unknown },\n options: {\n nodeEnv?: string;\n registryRaw?: unknown;\n environmentLane?: WorkspaceSsoEnvironmentLane;\n } = {},\n): boolean {\n const origin = appOrigin(app.url);\n if (!origin) return false;\n\n const appId = app.id.trim().toLowerCase();\n const canonicalOrigin =\n CANONICAL_WORKSPACE_SSO_APP_ORIGINS[\n appId as keyof typeof CANONICAL_WORKSPACE_SSO_APP_ORIGINS\n ];\n if (\n canonicalOrigin &&\n isCanonicalWorkspaceSsoOrigin(\n origin,\n canonicalOrigin,\n options.environmentLane ?? \"production\",\n )\n ) {\n return true;\n }\n\n if (\n options.nodeEnv !== \"production\" &&\n canonicalOrigin &&\n isLoopbackOrigin(origin)\n ) {\n return true;\n }\n\n return parseWorkspaceSsoAppRegistrations(options.registryRaw).some(\n (registration) =>\n registration.appId === appId && registration.origin === origin,\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"workspace-sso.js","sourceRoot":"","sources":["../../src/shared/workspace-sso.ts"],"names":[],"mappings":"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C,EACxB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,iCAAiC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAChE,CAAC,YAAY,EAAE,EAAE,CACf,YAAY,CAAC,KAAK,KAAK,KAAK,IAAI,YAAY,CAAC,MAAM,KAAK,MAAM,CACjE,CAAC;AACJ,CAAC","sourcesContent":["import { resolveEnvironmentTargets } from \"@agent-native/core/shared\";\n\nimport { DISPATCH_WORKSPACE_SSO_FLAG } from \"./feature-flags.js\";\n\nexport { DISPATCH_WORKSPACE_SSO_FLAG };\n\n/** Exact first-party origins. Never replace this with a suffix or wildcard. */\nexport const CANONICAL_WORKSPACE_SSO_APP_ORIGINS = {\n analytics: \"https://analytics.agent-native.com\",\n assets: \"https://assets.agent-native.com\",\n brain: \"https://brain.agent-native.com\",\n calendar: \"https://calendar.agent-native.com\",\n chat: \"https://chat.agent-native.com\",\n clips: \"https://clips.agent-native.com\",\n content: \"https://content.agent-native.com\",\n crm: \"https://crm.agent-native.com\",\n design: \"https://design.agent-native.com\",\n dispatch: \"https://dispatch.agent-native.com\",\n factory: \"https://factory.agent-native.com\",\n forms: \"https://forms.agent-native.com\",\n mail: \"https://mail.agent-native.com\",\n plan: \"https://plan.agent-native.com\",\n slides: \"https://slides.agent-native.com\",\n tasks: \"https://tasks.agent-native.com\",\n} as const;\n\nexport const WORKSPACE_SSO_CALLBACK_PATH =\n \"/_agent-native/identity/callback\" as const;\n\nconst CONTROL_CHARS = /[\\u0000-\\u001f\\u007f]/;\nconst APP_ID = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;\nconst CLIENT_ID = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/;\nconst LOCALHOST_HOSTS = new Set([\"localhost\", \"127.0.0.1\", \"[::1]\", \"::1\"]);\ntype WorkspaceSsoEnvironmentLane = \"production\" | \"beta\";\n\nexport interface WorkspaceSsoAppRegistration {\n appId: string;\n clientId: string;\n origin: string;\n callbackPath: typeof WORKSPACE_SSO_CALLBACK_PATH;\n}\n\nexport function exactWorkspaceSsoOrigin(raw: unknown): string | null {\n if (typeof raw !== \"string\" || !raw || CONTROL_CHARS.test(raw)) return null;\n try {\n const url = new URL(raw);\n if (\n url.protocol !== \"https:\" &&\n !(url.protocol === \"http:\" && LOCALHOST_HOSTS.has(url.hostname))\n ) {\n return null;\n }\n if (\n url.username ||\n url.password ||\n url.pathname !== \"/\" ||\n url.search ||\n url.hash\n ) {\n return null;\n }\n return url.origin;\n } catch {\n // coercion-ok: malformed registry origins are rejected as absent.\n return null;\n }\n}\n\n/**\n * Parse the same additive custom registry used by browser identity SSO. The\n * raw value is passed in so this shared module stays safe to import in the\n * browser bundle.\n */\nexport function parseWorkspaceSsoAppRegistrations(\n raw: unknown,\n): WorkspaceSsoAppRegistration[] {\n if (typeof raw !== \"string\" || !raw.trim()) return [];\n let value: unknown;\n try {\n value = JSON.parse(raw);\n } catch {\n // coercion-ok: malformed custom registry data must fail closed.\n return [];\n }\n if (!Array.isArray(value)) return [];\n\n const registrations: WorkspaceSsoAppRegistration[] = [];\n const seen = new Set<string>();\n for (const entry of value) {\n if (!entry || typeof entry !== \"object\") continue;\n const candidate = entry as Record<string, unknown>;\n const appId = candidate.appId;\n const clientId = candidate.clientId;\n const origin = exactWorkspaceSsoOrigin(candidate.origin);\n if (\n typeof appId !== \"string\" ||\n !APP_ID.test(appId) ||\n typeof clientId !== \"string\" ||\n !CLIENT_ID.test(clientId) ||\n !origin ||\n candidate.callbackPath !== WORKSPACE_SSO_CALLBACK_PATH ||\n !Array.isArray(candidate.capabilities) ||\n !candidate.capabilities.includes(\"identity-sso\") ||\n seen.has(appId) ||\n Object.prototype.hasOwnProperty.call(\n CANONICAL_WORKSPACE_SSO_APP_ORIGINS,\n appId,\n )\n ) {\n continue;\n }\n seen.add(appId);\n registrations.push({\n appId,\n clientId,\n origin,\n callbackPath: WORKSPACE_SSO_CALLBACK_PATH,\n });\n }\n return registrations;\n}\n\nfunction appOrigin(rawUrl: unknown): string | null {\n if (typeof rawUrl !== \"string\" || !rawUrl.trim()) return null;\n try {\n const url = new URL(rawUrl.trim());\n return url.protocol === \"http:\" || url.protocol === \"https:\"\n ? url.origin\n : null;\n } catch {\n // coercion-ok: malformed app metadata is not eligible for workspace SSO.\n return null;\n }\n}\n\nfunction isLoopbackOrigin(origin: string): boolean {\n try {\n return LOCALHOST_HOSTS.has(new URL(origin).hostname);\n } catch {\n // coercion-ok: only a previously parsed origin reaches this helper.\n return false;\n }\n}\n\nfunction isCanonicalWorkspaceSsoOrigin(\n origin: string,\n canonicalOrigin: string,\n environmentLane: WorkspaceSsoEnvironmentLane,\n): boolean {\n if (origin === canonicalOrigin) return true;\n if (environmentLane !== \"beta\") return false;\n\n try {\n const targets = resolveEnvironmentTargets(\n new URL(canonicalOrigin).hostname,\n );\n return targets ? origin === `https://${targets.betaHost}` : false;\n } catch {\n // coercion-ok: canonical origins are static metadata, so malformed values\n // are rejected as non-canonical.\n return false;\n }\n}\n\n/**\n * Keep the server-side app catalog and the browser's action choice on the\n * same exact-origin rules. `registryRaw` is deliberately supplied by the\n * caller so this shared module never reads process or browser environment.\n */\nexport function isWorkspaceSsoAppUrl(\n app: { id: string; url?: unknown },\n options: {\n nodeEnv?: string;\n registryRaw?: unknown;\n environmentLane?: WorkspaceSsoEnvironmentLane;\n } = {},\n): boolean {\n const origin = appOrigin(app.url);\n if (!origin) return false;\n\n const appId = app.id.trim().toLowerCase();\n const canonicalOrigin =\n CANONICAL_WORKSPACE_SSO_APP_ORIGINS[\n appId as keyof typeof CANONICAL_WORKSPACE_SSO_APP_ORIGINS\n ];\n if (\n canonicalOrigin &&\n isCanonicalWorkspaceSsoOrigin(\n origin,\n canonicalOrigin,\n options.environmentLane ?? \"production\",\n )\n ) {\n return true;\n }\n\n if (\n options.nodeEnv !== \"production\" &&\n canonicalOrigin &&\n isLoopbackOrigin(origin)\n ) {\n return true;\n }\n\n return parseWorkspaceSsoAppRegistrations(options.registryRaw).some(\n (registration) =>\n registration.appId === appId && registration.origin === origin,\n );\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/dispatch",
|
|
3
|
-
"version": "0.37.
|
|
3
|
+
"version": "0.37.1-nightly-20260916013955",
|
|
4
4
|
"description": "Dispatch — workspace control plane for agent-native apps. Vault, integrations, destinations, scheduled jobs, and cross-app delegation, shipped as a single drop-in package.",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/agent-native#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"tailwind-merge": "^3.5.0",
|
|
89
89
|
"vaul": "^1.1.2",
|
|
90
90
|
"zod": "^4.3.6",
|
|
91
|
-
"@agent-native/toolkit": "0.20.
|
|
91
|
+
"@agent-native/toolkit": "0.20.2-nightly-20260916013955"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
94
|
"@react-router/dev": "^8.1.0",
|
|
@@ -102,10 +102,10 @@
|
|
|
102
102
|
"typescript-7": "npm:typescript@^7.0.2",
|
|
103
103
|
"vite": "8.1.0",
|
|
104
104
|
"vitest": "^4.1.5",
|
|
105
|
-
"@agent-native/core": "0.
|
|
105
|
+
"@agent-native/core": "0.181.0-nightly-20260916013955"
|
|
106
106
|
},
|
|
107
107
|
"peerDependencies": {
|
|
108
|
-
"@agent-native/core": "
|
|
108
|
+
"@agent-native/core": "0.181.0-nightly-20260916013955",
|
|
109
109
|
"react": ">=19.2.7",
|
|
110
110
|
"react-dom": ">=19.2.7",
|
|
111
111
|
"react-router": ">=8"
|
|
@@ -68,7 +68,6 @@ const APP_VISUALS_BY_ID: Record<
|
|
|
68
68
|
dispatch: { icon: IconRoute, colorRgb: "20 184 166" },
|
|
69
69
|
factory: { icon: IconUsers, colorRgb: "124 58 237" },
|
|
70
70
|
forms: { icon: IconClipboardList, colorRgb: "6 182 212" },
|
|
71
|
-
macros: { icon: IconCode, colorRgb: "113 113 122" },
|
|
72
71
|
mail: { icon: IconMail, colorRgb: "59 130 246" },
|
|
73
72
|
plan: { icon: IconLayoutBoard, colorRgb: "47 111 237" },
|
|
74
73
|
slides: { icon: IconPresentation, colorRgb: "236 72 153" },
|
package/src/config.ts
CHANGED
|
@@ -34,7 +34,7 @@ export interface DispatchConfig {
|
|
|
34
34
|
browserExtensionIds?: readonly string[];
|
|
35
35
|
/**
|
|
36
36
|
* App IDs to hide from `list-connected-agents` results. Used to filter
|
|
37
|
-
* out first-party Builder apps (calls, issues,
|
|
37
|
+
* out first-party Builder apps (calls, issues, …) from the
|
|
38
38
|
* Connected Agents list when those apps aren't shipped to end users.
|
|
39
39
|
*/
|
|
40
40
|
hiddenAgentIds?: string[];
|
|
@@ -18,7 +18,6 @@ export const CANONICAL_WORKSPACE_SSO_APP_ORIGINS = {
|
|
|
18
18
|
dispatch: "https://dispatch.agent-native.com",
|
|
19
19
|
factory: "https://factory.agent-native.com",
|
|
20
20
|
forms: "https://forms.agent-native.com",
|
|
21
|
-
macros: "https://macros.agent-native.com",
|
|
22
21
|
mail: "https://mail.agent-native.com",
|
|
23
22
|
plan: "https://plan.agent-native.com",
|
|
24
23
|
slides: "https://slides.agent-native.com",
|