@tangle-network/agent-app 0.50.32 → 0.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/agent-enrollment/application.d.ts +25 -5
  2. package/dist/agent-enrollment/drizzle.js +1 -1
  3. package/dist/agent-enrollment/index.d.ts +1 -1
  4. package/dist/agent-enrollment/index.js +1 -1
  5. package/dist/app-oauth/index.d.ts +101 -0
  6. package/dist/app-oauth/index.js +231 -0
  7. package/dist/app-oauth/index.js.map +1 -0
  8. package/dist/assistant/index.js +1 -1
  9. package/dist/chat-routes/index.js +4 -4
  10. package/dist/{chunk-LDCR7MRU.js → chunk-2PDKWV2S.js} +2 -2
  11. package/dist/{chunk-NLXY7TFB.js → chunk-C3JSO2CB.js} +43 -18
  12. package/dist/chunk-C3JSO2CB.js.map +1 -0
  13. package/dist/{chunk-CNI46COH.js → chunk-CBRYWGUO.js} +2 -2
  14. package/dist/{chunk-CNI46COH.js.map → chunk-CBRYWGUO.js.map} +1 -1
  15. package/dist/{chunk-BATKJP3P.js → chunk-E4AY62T2.js} +24 -7
  16. package/dist/chunk-E4AY62T2.js.map +1 -0
  17. package/dist/{chunk-5KFRCVAO.js → chunk-IYLPQKAH.js} +2 -2
  18. package/dist/{chunk-5TOV7EDF.js → chunk-PF3AZD5G.js} +4 -4
  19. package/dist/{chunk-ACFM2GFL.js → chunk-SYIV74NB.js} +1 -1
  20. package/dist/design-canvas-react/index.js +4 -4
  21. package/dist/design-canvas-react/lazy.js +1 -1
  22. package/dist/hosted-agent/react/SharedLineAppNotice.d.ts +16 -0
  23. package/dist/hosted-agent/react/index.d.ts +1 -0
  24. package/dist/hosted-agent/react/index.js +46 -1
  25. package/dist/hosted-agent/react/index.js.map +1 -1
  26. package/dist/hosted-agent/react/lines.css +92 -2
  27. package/dist/platform/hub-settings.d.ts +1 -1
  28. package/dist/platform/index.d.ts +0 -1
  29. package/dist/platform/index.js +0 -101
  30. package/dist/platform/index.js.map +1 -1
  31. package/dist/preset-cloudflare/index.js +2 -2
  32. package/dist/sandbox/index.js +4 -4
  33. package/dist/studio-react/index.js +91 -56
  34. package/dist/studio-react/index.js.map +1 -1
  35. package/dist/theme/tokens.css +3 -1
  36. package/dist/tools/index.js +4 -4
  37. package/dist/web-react/index.js +4 -4
  38. package/dist/web-react/sandbox-terminal.d.ts +2 -0
  39. package/dist/web-react/terminal.js +1 -1
  40. package/dist/work-product/index.js +2 -2
  41. package/dist/workspace-react/companion.d.ts +31 -0
  42. package/dist/workspace-react/index.d.ts +1 -1
  43. package/dist/workspace-react/index.js +140 -2
  44. package/dist/workspace-react/index.js.map +1 -1
  45. package/package.json +25 -5
  46. package/dist/chunk-BATKJP3P.js.map +0 -1
  47. package/dist/chunk-NLXY7TFB.js.map +0 -1
  48. package/dist/platform/hub.d.ts +0 -107
  49. /package/dist/{chunk-LDCR7MRU.js.map → chunk-2PDKWV2S.js.map} +0 -0
  50. /package/dist/{chunk-5KFRCVAO.js.map → chunk-IYLPQKAH.js.map} +0 -0
  51. /package/dist/{chunk-5TOV7EDF.js.map → chunk-PF3AZD5G.js.map} +0 -0
  52. /package/dist/{chunk-ACFM2GFL.js.map → chunk-SYIV74NB.js.map} +0 -0
@@ -1,107 +0,0 @@
1
- /**
2
- * Integrations-hub proxy routes: the app-side surface that forwards an
3
- * authenticated user's requests to the platform's `/v1/integrations/*` API
4
- * using their stored platform key. Auth, key lookup, and the wire client are
5
- * structural seams (`HubProxyContext`); error detection is by name + shape so
6
- * it survives bundlers duplicating module instances.
7
- */
8
- import { type TangleExecutionEnvironment, type TangleExecutionKeySource } from '../runtime/model';
9
- /** Hub bearer provenance mirrors the execution-key source union. */
10
- export type TangleHubBearerSource = TangleExecutionKeySource;
11
- /** Represent a resolved bearer token with its associated TangleHub bearer source */
12
- export interface ResolvedTangleHubBearer {
13
- bearer: string;
14
- source: TangleHubBearerSource;
15
- }
16
- /** Resolve options required to obtain a user's TangleHub bearer token including environment and API key retrieval */
17
- export interface ResolveUserTangleHubBearerOptions {
18
- userId: string;
19
- /** Deployment context. Only local development may use env credentials. */
20
- environment?: TangleExecutionEnvironment;
21
- /** Env to read for the local-development bearer. */
22
- env?: Record<string, string | undefined>;
23
- /** App-owned lookup for the caller's linked platform API key. */
24
- getUserApiKey: () => string | null | undefined | Promise<string | null | undefined>;
25
- }
26
- /** Resolve options for retrieving a TangleHub bearer token for a specified user */
27
- export interface ResolveUserTangleHubBearerForUserOptions<UserId = string> {
28
- userId: UserId;
29
- environment?: TangleExecutionEnvironment;
30
- env?: Record<string, string | undefined>;
31
- getUserApiKey: (userId: UserId) => string | null | undefined | Promise<string | null | undefined>;
32
- }
33
- /** Represent missing Tangle platform link error for a specified user ID */
34
- export declare class TangleBearerMissingError extends Error {
35
- readonly userId: string;
36
- constructor(userId: string);
37
- }
38
- /**
39
- * Resolve the Tangle bearer used by the integration hub proxy.
40
- *
41
- * Local development may use a server env key so apps can exercise the hub
42
- * without completing cross-site SSO. Deployed contexts must use the caller's
43
- * linked platform key; this keeps integration ownership aligned with the user.
44
- */
45
- export declare function resolveUserTangleHubBearer(opts: ResolveUserTangleHubBearerOptions): Promise<ResolvedTangleHubBearer>;
46
- /** Resolve the TangleHub bearer token for a specified user based on provided options */
47
- export declare function resolveUserTangleHubBearerForUser<UserId = string>(opts: ResolveUserTangleHubBearerForUserOptions<UserId>): Promise<ResolvedTangleHubBearer>;
48
- /** Structural guard (name + userId shape) — robust when the error class is
49
- * constructed in a different module instance than the one checking it. */
50
- export declare function isTangleBearerMissingError(error: unknown): error is TangleBearerMissingError;
51
- /** Structural detection of the platform hub wire error (name + numeric status). */
52
- export declare function isPlatformHubErrorLike(error: unknown): error is Error & {
53
- status: number;
54
- code?: string;
55
- };
56
- /** Structural subset of the platform hub wire client — extra methods are fine. */
57
- export interface HubClientLike {
58
- catalog(): Promise<unknown>;
59
- listConnections(): Promise<unknown>;
60
- revokeConnection(connectionId: string): Promise<unknown>;
61
- startAuth(input: {
62
- providerId: string;
63
- connectorId: string;
64
- returnUrl: string;
65
- requestedScopes?: string[];
66
- }): Promise<{
67
- authorizationUrl: string;
68
- state: string;
69
- }>;
70
- listHealthchecks(): Promise<unknown>;
71
- }
72
- /** Define methods to require user ID, get bearer token, and create a hub client bound to the bearer */
73
- export interface HubProxyContext {
74
- /** Resolve the authenticated user id. Throw the app's own auth Response /
75
- * redirect to reject — it propagates untouched. */
76
- requireUserId(request: Request): Promise<string>;
77
- /** The user's platform bearer; throw `TangleBearerMissingError` when unlinked. */
78
- getBearer(userId: string): Promise<string>;
79
- /** A hub client bound to the bearer. */
80
- createHubClient(bearer: string): HubClientLike;
81
- }
82
- /** Define arguments for configuring a proxy route with request and optional parameters */
83
- export interface HubProxyRouteArgs {
84
- request: Request;
85
- params?: Record<string, string | undefined>;
86
- }
87
- /** Define routes for hub proxy handling catalog, connections, healthchecks, and authorization actions */
88
- export interface HubProxyRoutes {
89
- /** GET → `{ catalog }`. */
90
- catalog(args: HubProxyRouteArgs): Promise<Response>;
91
- /** GET → `{ connections }`. */
92
- connections(args: HubProxyRouteArgs): Promise<Response>;
93
- /** DELETE → the platform revocation result verbatim; 405 otherwise. */
94
- connectionDelete(args: {
95
- request: Request;
96
- params: {
97
- connectionId: string;
98
- };
99
- }): Promise<Response>;
100
- /** GET → `{ healthchecks }`. */
101
- healthchecks(args: HubProxyRouteArgs): Promise<Response>;
102
- /** POST `{ providerId, connectorId, returnUrl, requestedScopes? }` →
103
- * `{ authorizationUrl, state }`; 405 non-POST; 400 on bad JSON / missing fields. */
104
- authStart(args: HubProxyRouteArgs): Promise<Response>;
105
- }
106
- /** Resolve hub proxy routes with authentication and error handling based on the given context */
107
- export declare function createHubProxyRoutes(ctx: HubProxyContext): HubProxyRoutes;