@tangle-network/agent-app 0.63.58 → 0.63.60
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/assistant/index.js +7 -4
- package/dist/assistant/index.js.map +1 -1
- package/dist/{chunk-H7CSSEP7.js → chunk-LAZCUQFZ.js} +14 -6
- package/dist/{chunk-H7CSSEP7.js.map → chunk-LAZCUQFZ.js.map} +1 -1
- package/dist/platform/delegated-keys.d.ts +5 -5
- package/dist/platform/index.js +10 -11
- package/dist/platform/index.js.map +1 -1
- package/dist/theme/tokens.css +14 -11
- package/dist/vault/store/index.js +330 -259
- package/dist/vault/store/index.js.map +1 -1
- package/dist/vault/store/sandbox-hydrate.d.ts +22 -1
- package/dist/vault/store/sandbox-reconcile.d.ts +11 -3
- package/dist/vault/store/sandbox-sync.d.ts +26 -0
- package/dist/web-react/chat-message-types.d.ts +12 -4
- package/dist/web-react/chat-tool-call.d.ts +4 -1
- package/dist/web-react/index.d.ts +1 -1
- package/dist/web-react/index.js +3 -1
- package/package.json +5 -5
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* the recorded cursor.
|
|
7
7
|
*/
|
|
8
8
|
import type { Outcome } from '../../sandbox/outcome';
|
|
9
|
-
import { type
|
|
9
|
+
import { type VaultBoxSyncSkip } from './box-state';
|
|
10
|
+
import { type SandboxVaultSyncConfig, type SandboxVaultSyncStageObserver } from './sandbox-sync';
|
|
10
11
|
export interface VaultHydrationFileSystem {
|
|
11
12
|
exists(path: string): Promise<boolean>;
|
|
12
13
|
writeMany(files: Array<{
|
|
@@ -46,6 +47,13 @@ export interface VaultHydrationStats {
|
|
|
46
47
|
processedHeads: number;
|
|
47
48
|
/** True when the coordinator's record proved the box current and nothing was listed or written. */
|
|
48
49
|
inSync?: boolean;
|
|
50
|
+
/** Files the box refused for their size (`skipOversizeFiles`): absent from the box and its baseline. */
|
|
51
|
+
skipped: VaultBoxSyncSkip[];
|
|
52
|
+
/** Set when the copy budget ran out: heads not on the box yet, and whether later pages were not examined. */
|
|
53
|
+
deferred: {
|
|
54
|
+
pendingPaths: string[];
|
|
55
|
+
morePages: boolean;
|
|
56
|
+
} | null;
|
|
49
57
|
}
|
|
50
58
|
export interface VaultHydrationOptions {
|
|
51
59
|
/** Paths a reconciliation parked as conflicts; hydration leaves both copies alone. */
|
|
@@ -54,6 +62,19 @@ export interface VaultHydrationOptions {
|
|
|
54
62
|
appliedPaths?: ReadonlySet<string>;
|
|
55
63
|
/** May still be in flight (the Vault-loss probe): hydrate awaits it only to compare heads. */
|
|
56
64
|
pathsMissingFromBox?: ReadonlySet<string> | Promise<ReadonlySet<string>>;
|
|
65
|
+
/** False when the caller makes the warm-path decision and records the sync itself: hydration then neither skips nor records. */
|
|
66
|
+
recordSync?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* A copy that may span calls. Hydration spends `remainingChars` (Vault
|
|
69
|
+
* characters read; past it, it records what it wrote and returns `deferred`)
|
|
70
|
+
* and appends every Vault path it writes, so a caller that retries on a new
|
|
71
|
+
* box keeps one budget and can finish what the first attempt wrote.
|
|
72
|
+
*/
|
|
73
|
+
progress?: {
|
|
74
|
+
remainingChars: number;
|
|
75
|
+
writtenPaths: string[];
|
|
76
|
+
};
|
|
77
|
+
onStage?: SandboxVaultSyncStageObserver;
|
|
57
78
|
}
|
|
58
79
|
/** Hydrate every live Vault head into the box, page by page, until the listing ends. */
|
|
59
80
|
export declare function hydrateSandboxVault(config: SandboxVaultSyncConfig, box: VaultHydrationBox, workspaceId: string, options?: VaultHydrationOptions): Promise<Outcome<VaultHydrationStats>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SandboxExecChannel } from '../../sandbox/binary-read';
|
|
2
|
-
import type { VaultMutationConflict } from './revisions';
|
|
3
|
-
import { type SandboxVaultPathRejection, type SandboxVaultSyncChange, type SandboxVaultSyncConfig, type SandboxVaultSyncProgress } from './sandbox-sync';
|
|
2
|
+
import type { VaultMutationConflict, VaultWriteProvenance } from './revisions';
|
|
3
|
+
import { type SandboxVaultPathRejection, type SandboxVaultSyncChange, type SandboxVaultSyncConfig, type SandboxVaultSyncProgress, type SandboxVaultSyncStageObserver } from './sandbox-sync';
|
|
4
4
|
/** The box calls reconciliation makes; a `@tangle-network/sandbox` instance satisfies it. */
|
|
5
5
|
export interface VaultReconcileBox extends SandboxExecChannel {
|
|
6
6
|
id: string;
|
|
@@ -20,10 +20,12 @@ export interface SandboxVaultSyncResult {
|
|
|
20
20
|
pathsMissingFromBox: string[];
|
|
21
21
|
operationId: string | null;
|
|
22
22
|
changes: SandboxVaultSyncChange[];
|
|
23
|
+
/** Box changes the Vault already holds (another path committed the same bytes); recorded without a commit. */
|
|
24
|
+
convergedChanges?: SandboxVaultSyncChange[];
|
|
23
25
|
appliedPaths: string[];
|
|
24
26
|
conflicts: VaultMutationConflict[];
|
|
25
27
|
progress: SandboxVaultSyncProgress;
|
|
26
|
-
blockedReason?: 'filesystem_incarnation_missing' | 'filesystem_incarnation_not_ready' | 'vault_directory_missing' | 'sandbox_deletion_denied';
|
|
28
|
+
blockedReason?: 'filesystem_incarnation_missing' | 'filesystem_incarnation_not_ready' | 'vault_directory_missing' | 'sandbox_deletion_denied' | 'mass_deletion_guard';
|
|
27
29
|
baselineResetReason?: 'baseline_missing' | 'filesystem_incarnation_changed';
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
@@ -41,6 +43,12 @@ export declare function assertSandboxVaultReconciliation(workspaceId: string, re
|
|
|
41
43
|
export interface SandboxVaultSyncOptions {
|
|
42
44
|
sessionId?: string;
|
|
43
45
|
operationId?: string;
|
|
46
|
+
/** Attribution the commits carry. */
|
|
47
|
+
provenance?: VaultWriteProvenance;
|
|
48
|
+
/** Refuse, before any commit, a box file the Vault has no live head for (a retained mirror that must not promote unknown bytes). */
|
|
49
|
+
canonicalPathsOnly?: boolean;
|
|
50
|
+
onPhase?: (phase: 'baseline-read' | 'manifest' | 'canonical-heads' | 'file-reads' | 'head-reads' | 'plan-changes' | 'staged' | 'mutate' | 'baseline-write' | 'box-sync-invalidate') => void;
|
|
51
|
+
onStage?: SandboxVaultSyncStageObserver;
|
|
44
52
|
onStaged?: (checkpoint: {
|
|
45
53
|
operationId: string;
|
|
46
54
|
changes: SandboxVaultSyncChange[];
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
import { type VaultDeletionPolicy } from '../server';
|
|
1
2
|
import type { VaultHeadState, VaultMutationRequest, VaultMutationResult, VaultSandboxBaseline } from './revisions';
|
|
2
3
|
import type { VaultFrontmatterCodec, VaultHeadListOptions, VaultHeadListPage } from './store';
|
|
3
4
|
import type { VaultBoxStateView, VaultBoxSyncRecord } from './box-state';
|
|
5
|
+
import type { VaultHydrationBox } from './sandbox-hydrate';
|
|
4
6
|
/** The store calls the sync engine makes; `createVaultStore` returns all of them. */
|
|
5
7
|
export interface SandboxVaultSyncStore {
|
|
6
8
|
codec: VaultFrontmatterCodec;
|
|
7
9
|
listVaultHeadPage(workspaceId: string, options?: VaultHeadListOptions): Promise<VaultHeadListPage>;
|
|
8
10
|
readVaultFileState(workspaceId: string, filePath: string): Promise<VaultHeadState>;
|
|
9
11
|
commitVaultMutation(request: VaultMutationRequest): Promise<VaultMutationResult>;
|
|
12
|
+
/** The committed revision at or before `headRevision` whose content hash is `contentHash`, or null. */
|
|
13
|
+
findVaultRevisionWithContent(workspaceId: string, path: string, headRevision: string, contentHash: string): Promise<string | null>;
|
|
10
14
|
readVaultSandboxBaseline(workspaceId: string, sandboxId: string): Promise<VaultSandboxBaseline | null>;
|
|
11
15
|
writeVaultSandboxBaseline(baseline: VaultSandboxBaseline): Promise<void>;
|
|
12
16
|
readVaultBoxState(workspaceId: string): Promise<VaultBoxStateView | null>;
|
|
@@ -26,7 +30,29 @@ export interface SandboxVaultSyncConfig {
|
|
|
26
30
|
* box re-hydrates on its next turn. Defaults to `SANDBOX_VAULT_SYNC_CONTRACT`.
|
|
27
31
|
*/
|
|
28
32
|
contract?: string;
|
|
33
|
+
/**
|
|
34
|
+
* How a box may delete Vault files. `'rename-only'` (the default) commits a
|
|
35
|
+
* delete only as half of a same-content rename. `guard` commits any delete
|
|
36
|
+
* unless the batch trips `assessVaultDeletionBatch` (an empty scan, every
|
|
37
|
+
* file, or most of a large Vault), which withholds every delete of the pass.
|
|
38
|
+
*/
|
|
39
|
+
deletes?: 'rename-only' | {
|
|
40
|
+
guard: VaultDeletionPolicy;
|
|
41
|
+
};
|
|
42
|
+
/** Root-relative directories that hold no Vault files, such as a private session tree; reconcile never scans them. */
|
|
43
|
+
excludeDirs?: readonly string[];
|
|
44
|
+
/** Writes one request's text files to the box; defaults to `box.fs.writeMany`. */
|
|
45
|
+
writeText?: (box: VaultHydrationBox, files: Array<{
|
|
46
|
+
path: string;
|
|
47
|
+
content: string;
|
|
48
|
+
}>) => Promise<void>;
|
|
49
|
+
/** Leave a file with no baseline entry in place when the box already holds its exact bytes (a box restored from a snapshot). */
|
|
50
|
+
skipFilesAlreadyOnBox?: boolean;
|
|
51
|
+
/** Leave a file the box refuses for its size off the box and report it in `skipped`, instead of failing hydration. */
|
|
52
|
+
skipOversizeFiles?: boolean;
|
|
29
53
|
}
|
|
54
|
+
/** A sync stage's timing, for product telemetry. */
|
|
55
|
+
export type SandboxVaultSyncStageObserver = (stage: 'baseline_read' | 'head_list' | 'kv_read' | 'sandbox_write' | 'baseline_write' | 'reconcile_scan' | 'reconcile_import', startedAt: number, detail?: Record<string, number>) => void;
|
|
30
56
|
/** The engine's own hydration contract; a product appends its own when its box layout changes. */
|
|
31
57
|
export declare const SANDBOX_VAULT_SYNC_CONTRACT = "agent-app-sandbox-vault-sync-v1";
|
|
32
58
|
/** The body prefix of a Vault document whose remainder is base64-encoded binary bytes. */
|
|
@@ -110,7 +110,7 @@ export interface ChatMessagesProps {
|
|
|
110
110
|
/** Open a full-transcript view (e.g. {@link RunDrillIn}) from a tool row's
|
|
111
111
|
* actions slot. */
|
|
112
112
|
onToolCallClick?: (call: ChatToolCallInfo, message: ChatUiMessage) => void;
|
|
113
|
-
/** Per-tool custom
|
|
113
|
+
/** Per-tool custom renderers for the row's optional presentation and expanded body. */
|
|
114
114
|
toolRenderers?: ToolDetailRenderers;
|
|
115
115
|
/** Stream-error affordance: when the turn failed (a thrown transport error or
|
|
116
116
|
* a loop-level `onErrorEvent`), pass the message here to render an error row.
|
|
@@ -153,6 +153,14 @@ export interface ProposalApprovalHandlers {
|
|
|
153
153
|
onApprove: (proposalId: string, toolCallId: string) => void | Promise<void>;
|
|
154
154
|
onReject: (proposalId: string, toolCallId: string) => void | Promise<void>;
|
|
155
155
|
}
|
|
156
|
-
/**
|
|
157
|
-
*
|
|
158
|
-
export
|
|
156
|
+
/** Optional product-owned presentation for an existing shared tool row.
|
|
157
|
+
* Missing title/description/detail fields retain the shared defaults. */
|
|
158
|
+
export interface ToolDetailPresentation {
|
|
159
|
+
title?: string;
|
|
160
|
+
description?: string;
|
|
161
|
+
detail?: ReactNode;
|
|
162
|
+
}
|
|
163
|
+
/** Per-tool custom renderers, keyed by tool name. A React node customizes only
|
|
164
|
+
* the expanded detail; a presentation can also customize the collapsed row.
|
|
165
|
+
* Return null to retain every shared default. */
|
|
166
|
+
export type ToolDetailRenderers = Record<string, (call: ChatToolCallInfo, message: ChatUiMessage) => ReactNode | ToolDetailPresentation>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
/** Tool result adaptation, approval cards, and expanded run-row details. */
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
1
3
|
import type { ToolPart } from '@tangle-network/ui/types';
|
|
2
|
-
import type { ChatToolCallInfo, ChatUiMessage, ProposalApprovalHandlers, ToolDetailRenderers } from './chat-message-types';
|
|
4
|
+
import type { ChatToolCallInfo, ChatUiMessage, ProposalApprovalHandlers, ToolDetailPresentation, ToolDetailRenderers } from './chat-message-types';
|
|
5
|
+
export declare function resolveToolPresentation(rendered: ReactNode | ToolDetailPresentation): ToolDetailPresentation;
|
|
3
6
|
/** Extract `{proposalId, status}` from a tool outcome when it is a proposal
|
|
4
7
|
* awaiting human approval; null otherwise. */
|
|
5
8
|
export declare function pendingApprovalOf(call: ChatToolCallInfo): {
|
|
@@ -78,7 +78,7 @@ export * from './chat-message-types';
|
|
|
78
78
|
export * from './chat-message-metrics';
|
|
79
79
|
export * from './run-drill-in';
|
|
80
80
|
export * from './chat-empty-state';
|
|
81
|
-
export { pendingApprovalOf, chatToolCallPart } from './chat-tool-call';
|
|
81
|
+
export { pendingApprovalOf, chatToolCallPart, resolveToolPresentation } from './chat-tool-call';
|
|
82
82
|
export { ChatMessages, useThinkingSeconds } from './chat-messages';
|
|
83
83
|
export * from './api-access-panel';
|
|
84
84
|
export * from './agent-setup-block';
|
package/dist/web-react/index.js
CHANGED
|
@@ -109,6 +109,7 @@ import {
|
|
|
109
109
|
recordGridRowLabel,
|
|
110
110
|
resolveChatInteraction,
|
|
111
111
|
resolveProvenanceStanding,
|
|
112
|
+
resolveToolPresentation,
|
|
112
113
|
responseErrorMessage,
|
|
113
114
|
restoreChatInteractions,
|
|
114
115
|
rollUpProvenanceStanding,
|
|
@@ -146,7 +147,7 @@ import {
|
|
|
146
147
|
withoutRecordGridCreated,
|
|
147
148
|
withoutRecordGridRemoved,
|
|
148
149
|
withoutRecordGridUpdate
|
|
149
|
-
} from "../chunk-
|
|
150
|
+
} from "../chunk-LAZCUQFZ.js";
|
|
150
151
|
import {
|
|
151
152
|
useInfiniteScroll
|
|
152
153
|
} from "../chunk-UHSUY6H6.js";
|
|
@@ -528,6 +529,7 @@ export {
|
|
|
528
529
|
requestWorkspacePrewarm,
|
|
529
530
|
resolveChatInteraction,
|
|
530
531
|
resolveProvenanceStanding,
|
|
532
|
+
resolveToolPresentation,
|
|
531
533
|
responseErrorMessage,
|
|
532
534
|
restoreChatInteractions,
|
|
533
535
|
rollUpProvenanceStanding,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-app",
|
|
3
|
-
"version": "0.63.
|
|
3
|
+
"version": "0.63.60",
|
|
4
4
|
"packageManager": "pnpm@11.28.8",
|
|
5
5
|
"description": "Build agent applications with typed chat, tools, sandboxes, integrations, billing, and evaluation.",
|
|
6
6
|
"keywords": [
|
|
@@ -805,9 +805,9 @@
|
|
|
805
805
|
"@tangle-network/agent-runtime": "0.350.2",
|
|
806
806
|
"@tangle-network/brand": "1.27.1",
|
|
807
807
|
"@tangle-network/browser-agent-driver": "0.37.0",
|
|
808
|
-
"@tangle-network/hub-sdk": "0.33.
|
|
809
|
-
"@tangle-network/sandbox": "0.69.
|
|
810
|
-
"@tangle-network/sandbox-ui": "0.139.
|
|
808
|
+
"@tangle-network/hub-sdk": "0.33.4",
|
|
809
|
+
"@tangle-network/sandbox": "0.69.11",
|
|
810
|
+
"@tangle-network/sandbox-ui": "0.139.1",
|
|
811
811
|
"@tangle-network/tcloud": "0.8.5",
|
|
812
812
|
"@tangle-network/ui": "11.44.1",
|
|
813
813
|
"@testing-library/dom": "^10.4.2",
|
|
@@ -1008,7 +1008,7 @@
|
|
|
1008
1008
|
}
|
|
1009
1009
|
},
|
|
1010
1010
|
"dependencies": {
|
|
1011
|
-
"@tangle-network/charts": "0.21.
|
|
1011
|
+
"@tangle-network/charts": "0.21.13",
|
|
1012
1012
|
"proper-lockfile": "4.1.2"
|
|
1013
1013
|
}
|
|
1014
1014
|
}
|