@tangle-network/agent-app 0.52.16 → 0.52.18

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.
@@ -1,4 +1,5 @@
1
1
  import type { AgentProfile } from '@tangle-network/agent-interface/profile';
2
+ import type { AgentProfileRegistryPort } from './agent-profile-registry';
2
3
  export type AgentProfileResourceKind = 'files' | 'skills' | 'tools' | 'agents' | 'commands' | 'instructions';
3
4
  export interface AgentProfileEditorProps {
4
5
  value: AgentProfile;
@@ -19,6 +20,8 @@ export interface AgentProfileEditorProps {
19
20
  showToolsAndPermissions?: boolean;
20
21
  /** Offer only public HTTPS MCP endpoints while retaining existing servers for review. Defaults to false. */
21
22
  publicHttpsMcpOnly?: boolean;
23
+ /** Host-supplied registry discovery (agent-app#776). Omit to hide catalog search entirely. */
24
+ registry?: AgentProfileRegistryPort;
22
25
  }
23
26
  /** Controlled editor for the canonical profile. The product owns save and execution authority. */
24
- export declare function AgentProfileEditor({ value, onChange, disabled, className, allowedResourceKinds, filePathPrefix, allowExecutableFiles, requireGitHubCommitSha, requireUniqueSkillNames, showToolsAndPermissions, publicHttpsMcpOnly }: AgentProfileEditorProps): import("react").JSX.Element;
27
+ export declare function AgentProfileEditor({ value, onChange, disabled, className, allowedResourceKinds, filePathPrefix, allowExecutableFiles, requireGitHubCommitSha, requireUniqueSkillNames, showToolsAndPermissions, publicHttpsMcpOnly, registry }: AgentProfileEditorProps): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import type { AgentProfileMcpServer, AgentProfileResourceRef } from '@tangle-network/agent-interface/profile';
2
+ import { type AgentProfileRegistryPort } from './agent-profile-registry';
3
+ export declare function AgentProfileRegistrySkillSearch({ registry, disabled, existing, validate, onAdd }: {
4
+ registry: AgentProfileRegistryPort;
5
+ disabled: boolean;
6
+ existing: readonly AgentProfileResourceRef[];
7
+ /** Product constraints; returns the reason a result cannot be added, or null when it can. */
8
+ validate: (ref: AgentProfileResourceRef) => string | null;
9
+ onAdd: (ref: AgentProfileResourceRef) => boolean;
10
+ }): import("react").JSX.Element;
11
+ export declare function AgentProfileRegistryMcpSearch({ registry, disabled, existingNames, validate, onAdd }: {
12
+ registry: AgentProfileRegistryPort;
13
+ disabled: boolean;
14
+ existingNames: readonly string[];
15
+ validate: (name: string, server: AgentProfileMcpServer) => string | null;
16
+ onAdd: (name: string, server: AgentProfileMcpServer) => boolean;
17
+ }): import("react").JSX.Element;
@@ -0,0 +1,54 @@
1
+ import type { AgentProfileMcpServer, AgentProfileResourceRef } from '@tangle-network/agent-interface/profile';
2
+ /**
3
+ * Registry discovery port for the shared profile editor (agent-app#776).
4
+ * The host authenticates and bounds every search server-side; the editor
5
+ * never talks to a catalog directly. Discovery never implies trust,
6
+ * authorization, or installation: choosing a result only adds the canonical
7
+ * reference to the profile draft, and the product's own constraints
8
+ * (pinned commits, HTTPS-only endpoints, unique names) still decide whether
9
+ * the reference may be added.
10
+ */
11
+ /** A skill offered by a maintained catalog. */
12
+ export interface AgentProfileRegistrySkill {
13
+ /** Canonical skill name; the product's format and uniqueness rules still apply. */
14
+ name: string;
15
+ /** What the skill is for, from the catalog. */
16
+ description?: string;
17
+ /** Display name of the catalog that answered, for example `Tangle Network skills`. */
18
+ catalog: string;
19
+ /** Permissions the skill declares, shown before the operator adds it. */
20
+ permissions?: readonly string[];
21
+ /** Canonical reference added to the profile when the operator chooses this skill. */
22
+ ref: AgentProfileResourceRef;
23
+ }
24
+ /** An MCP server offered by the official MCP Registry or a custom registry. */
25
+ export interface AgentProfileRegistryMcpServer {
26
+ /** Canonical server name; existing profile entries win over duplicates. */
27
+ name: string;
28
+ /** What the server provides, from the registry. */
29
+ description?: string;
30
+ /** Display name of the registry that answered, for example `Official MCP Registry`. */
31
+ catalog: string;
32
+ /** Canonical server entry added to the profile when the operator chooses it. */
33
+ server: AgentProfileMcpServer;
34
+ }
35
+ export interface AgentProfileRegistrySkillsResult {
36
+ skills: readonly AgentProfileRegistrySkill[];
37
+ /** Catalogs that could not answer; results from the remaining catalogs stay usable. */
38
+ unavailable?: readonly string[];
39
+ }
40
+ export interface AgentProfileRegistryMcpResult {
41
+ mcpServers: readonly AgentProfileRegistryMcpServer[];
42
+ unavailable?: readonly string[];
43
+ }
44
+ /** Registry search failures the editor renders distinctly. */
45
+ export type AgentProfileRegistryFailure = 'authorization-required' | 'unavailable' | 'failed';
46
+ export declare class AgentProfileRegistryError extends Error {
47
+ readonly kind: AgentProfileRegistryFailure;
48
+ constructor(kind: AgentProfileRegistryFailure, message: string);
49
+ }
50
+ /** Host-supplied registry search. Implementations must time out and never install anything. */
51
+ export interface AgentProfileRegistryPort {
52
+ searchSkills(query: string, signal?: AbortSignal): Promise<AgentProfileRegistrySkillsResult>;
53
+ searchMcpServers(query: string, signal?: AbortSignal): Promise<AgentProfileRegistryMcpResult>;
54
+ }
@@ -30,8 +30,10 @@ import type { WorkProductPersistedPart } from '../work-product/types';
30
30
  export * from './chat-stream';
31
31
  export * from './chat-interactions';
32
32
  export * from './chat-composer';
33
+ export { getChatFundingRecovery, type ChatFundingFailure, type ChatFundingRecovery } from './turn-funding-recovery';
33
34
  export { RouteChunkBoundary, type RouteChunkBoundaryProps } from './lazy-load-boundary';
34
35
  export * from './agent-profile-editor';
36
+ export * from './agent-profile-registry';
35
37
  export * from './agent-profile-viewer';
36
38
  export * from './composer-file-accept';
37
39
  export * from './interaction-card-support';
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  AgentActivityPanel,
3
3
  AgentProfileEditor,
4
+ AgentProfileRegistryError,
4
5
  AgentProfileViewer,
5
6
  ApiAccessPanel,
6
7
  ChatEmptyState,
@@ -64,6 +65,7 @@ import {
64
65
  formatRecordGridValue,
65
66
  formatSparklineValue,
66
67
  formatTokensPerSecond,
68
+ getChatFundingRecovery,
67
69
  hasSecretField,
68
70
  hydrateChatInteractions,
69
71
  insightDelta,
@@ -130,7 +132,7 @@ import {
130
132
  withoutRecordGridCreated,
131
133
  withoutRecordGridRemoved,
132
134
  withoutRecordGridUpdate
133
- } from "../chunk-IK7JCJQF.js";
135
+ } from "../chunk-2LPNGZFG.js";
134
136
  import {
135
137
  SessionHistoryPanel,
136
138
  formatSessionTimestamp,
@@ -261,6 +263,7 @@ export {
261
263
  ATTACHMENT_ACCEPT,
262
264
  AgentActivityPanel,
263
265
  AgentProfileEditor,
266
+ AgentProfileRegistryError,
264
267
  AgentProfileViewer,
265
268
  AgentSessionControls,
266
269
  ApiAccessPanel,
@@ -376,6 +379,7 @@ export {
376
379
  formatSessionTimestamp,
377
380
  formatSparklineValue,
378
381
  formatTokensPerSecond,
382
+ getChatFundingRecovery,
379
383
  hasSecretField,
380
384
  hydrateChatInteractions,
381
385
  insightDelta,
@@ -0,0 +1,20 @@
1
+ export interface ChatFundingFailure {
2
+ code?: string;
3
+ message?: string;
4
+ }
5
+ /** Presentation only. The host supplies its authenticated billing destination. */
6
+ export interface ChatFundingRecovery {
7
+ reason: 'insufficient_credits' | 'paid_access_required';
8
+ title: string;
9
+ message: string;
10
+ actionLabel: string;
11
+ /** Retrying the same request cannot repair a funding prerequisite. */
12
+ retryable: false;
13
+ }
14
+ /**
15
+ * Recognize a paid-access refusal across HTTP and SDK-wrapped chat failures.
16
+ * Structured codes take precedence; the message fallback covers older sandbox
17
+ * transports that preserve the provider's words but replace its error code.
18
+ * This does not infer funding from a generic HTTP status or authorize a run.
19
+ */
20
+ export declare function getChatFundingRecovery(failure: ChatFundingFailure | string | null | undefined): ChatFundingRecovery | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-app",
3
- "version": "0.52.16",
3
+ "version": "0.52.18",
4
4
  "packageManager": "pnpm@11.24.0",
5
5
  "description": "Build agent applications with typed chat, tools, sandboxes, integrations, billing, and evaluation.",
6
6
  "keywords": [